query_id
stringlengths
32
32
query
stringlengths
7
4.32k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
9647b873210526979d097a3177472b54
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be nonnil.
[ { "docid": "5b14142cd5703982fabe203c35082327", "score": "0.0", "text": "func (in *SidecarSetStatus) DeepCopyInto(out *SidecarSetStatus) {\n\t*out = *in\n\tif in.CollisionCount != nil {\n\t\tin, out := &in.CollisionCount, &out.CollisionCount\n\t\t*out = new(int32)\n\t\t**out = **in\n\t}\n}", "title": "" } ]
[ { "docid": "333b67297f915fbee5d71b6723b8df18", "score": "0.8143009", "text": "func (in *Info) DeepCopyInto(out *Info) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f7ee0334cf371f5b56a7f278fbc645b8", "score": "0.81416076", "text": "func (in *ValueFrom) DeepCopyInto(out *ValueFrom) {\n\t*out = *in\n}", "title": "" }, { "docid": "7301f5678de7282507f88cf56a8f5020", "score": "0.8120002", "text": "func (in *Version) DeepCopyInto(out *Version) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "c6850f95c4b786dfb720021fee99aac3", "score": "0.8108227", "text": "func (in *Version) DeepCopyInto(out *Version) {\n\t*out = *in\n}", "title": "" }, { "docid": "a082503dcbc413c6f686bfa34ed34463", "score": "0.8056491", "text": "func (in *NodeInterface) DeepCopyInto(out *NodeInterface) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "6e59956356edd23c7f64e8d77c6e2e2a", "score": "0.80526555", "text": "func (in *ValueFrom) DeepCopyInto(out *ValueFrom) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "6e59956356edd23c7f64e8d77c6e2e2a", "score": "0.80526555", "text": "func (in *ValueFrom) DeepCopyInto(out *ValueFrom) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "8efd0808623d9b730fb7e61f70087c8f", "score": "0.8048248", "text": "func (in *Container) DeepCopyInto(out *Container) {\n\t*out = *in\n}", "title": "" }, { "docid": "12aba946684ce7a45759b3de900e843d", "score": "0.80335647", "text": "func (d *Date) DeepCopyInto(out *Date) {\n\t*out = *d\n}", "title": "" }, { "docid": "8e8acfb208833240003e7bd04991a6fd", "score": "0.8023817", "text": "func (in *Res) DeepCopyInto(out *Res) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5b24c3ee0cabe62c71b4995b5197f3e8", "score": "0.8021735", "text": "func (in *ObjectSelector) DeepCopyInto(out *ObjectSelector) {\n\t*out = *in\n}", "title": "" }, { "docid": "47e926643765e9a4a156b16f17541bb3", "score": "0.8020454", "text": "func (in *Type) DeepCopyInto(out *Type) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "44a6cbccbb6bb25682871c474d6f5707", "score": "0.80163413", "text": "func (in *MatchExpression) DeepCopyInto(out *MatchExpression) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "30324ad038726659a523150f3368d0f5", "score": "0.8010444", "text": "func (in *Container) DeepCopyInto(out *Container) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e15ee59c73e0b956f52cc07e2dc67c42", "score": "0.8005563", "text": "func (in *NodeCleanUpDetail) DeepCopyInto(out *NodeCleanUpDetail) {\n\t*out = *in\n}", "title": "" }, { "docid": "da67199fd73512557ec605b34bb7786a", "score": "0.80031604", "text": "func (in *GitFileGeneratorItem) DeepCopyInto(out *GitFileGeneratorItem) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "b9940b476867bb05d134db61f68d9644", "score": "0.8000521", "text": "func (in *Sequence) DeepCopyInto(out *Sequence) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "0e6b303fbadbc23c61dcee39495476b2", "score": "0.79989505", "text": "func (in *Interface) DeepCopyInto(out *Interface) {\n\t*out = *in\n}", "title": "" }, { "docid": "64f7c5b12b50180e8fc16b78724a33b3", "score": "0.7995508", "text": "func (in *DebugInfo) DeepCopyInto(out *DebugInfo) {\n\t*out = *in\n}", "title": "" }, { "docid": "b484ecb198d3d15da23105d7d1e0fce9", "score": "0.7981913", "text": "func (in *HostMemory) DeepCopyInto(out *HostMemory) {\n\t*out = *in\n}", "title": "" }, { "docid": "a61d45a01b735be0637692d867f2886b", "score": "0.7981228", "text": "func (in *GitDirectoryGeneratorItem) DeepCopyInto(out *GitDirectoryGeneratorItem) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "083852392c5e9f16679610351c913068", "score": "0.7978546", "text": "func (in *Entry) DeepCopyInto(out *Entry) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "73f3c4b574f47b584d574904e9535278", "score": "0.7976488", "text": "func (in *Mba) DeepCopyInto(out *Mba) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "de7749f45d05b10ffc6cb8d5f6fb7e08", "score": "0.79704815", "text": "func (in *KeepAlive) DeepCopyInto(out *KeepAlive) {\n\t*out = *in\n}", "title": "" }, { "docid": "dc25f670b9ab6635efd1a7f707841646", "score": "0.79702604", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "6fbe56e0c85e188a8a0560cb5e8afedb", "score": "0.79678047", "text": "func (in *JsonnetVar) DeepCopyInto(out *JsonnetVar) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "df39ebb54f270c6d9f8b9577e7363c97", "score": "0.79637796", "text": "func (in *VMInfo) DeepCopyInto(out *VMInfo) {\n\t*out = *in\n}", "title": "" }, { "docid": "be82863d9978b104237d2472cfdf3614", "score": "0.7960887", "text": "func (in *CrossVersionObjectReference) DeepCopyInto(out *CrossVersionObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "724c532b18202d3ed4a017bc96ed7ac0", "score": "0.7952689", "text": "func (in *ObjRef) DeepCopyInto(out *ObjRef) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.79464746", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.79464746", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e5f7998496abc109db19d751b6e4c690", "score": "0.7943909", "text": "func (in *OperandVersion) DeepCopyInto(out *OperandVersion) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "03b47d22a5efb39d6ec384531900b624", "score": "0.79433995", "text": "func (in *Ovs) DeepCopyInto(out *Ovs) {\n\t*out = *in\n}", "title": "" }, { "docid": "92bd0f9f52c488e2823218fc03f28117", "score": "0.79433286", "text": "func (in *CrossVersionObjectReference) DeepCopyInto(out *CrossVersionObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fa8ae88431960117f58fb44b09159283", "score": "0.79426736", "text": "func (in *ProgressStep) DeepCopyInto(out *ProgressStep) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e147f3c4cabb40a6a4a8327bd70c51d6", "score": "0.7940007", "text": "func (in *GPULimit) DeepCopyInto(out *GPULimit) {\n\t*out = *in\n}", "title": "" }, { "docid": "15ea69cebeda46850cc727790e5bd7bd", "score": "0.7938373", "text": "func (in *Target) DeepCopyInto(out *Target) {\n\t*out = *in\n\tout.Cfg = in.Cfg\n}", "title": "" }, { "docid": "d9295895700ce483b375539279ecb7a0", "score": "0.7934999", "text": "func (in *Multus) DeepCopyInto(out *Multus) {\n\t*out = *in\n}", "title": "" }, { "docid": "4e012cd4b271b374007162be15072ad7", "score": "0.7925752", "text": "func (in *IsoContainer) DeepCopyInto(out *IsoContainer) {\n\t*out = *in\n}", "title": "" }, { "docid": "6a74df2be2dbe701a0ee65d8e03053f6", "score": "0.79135454", "text": "func (in *IPXE) DeepCopyInto(out *IPXE) {\n\t*out = *in\n}", "title": "" }, { "docid": "e7824965b786de83e5edd7c40c1905bd", "score": "0.7912545", "text": "func (in *Cache) DeepCopyInto(out *Cache) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9b532d431b3f33589b5f4ac91d132785", "score": "0.7909533", "text": "func (in *PhaseStep) DeepCopyInto(out *PhaseStep) {\n\t*out = *in\n}", "title": "" }, { "docid": "d76c01b6f2f6b38d5d88fdf56bc5b770", "score": "0.79077226", "text": "func (in *NSFSSpec) DeepCopyInto(out *NSFSSpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "6e0024c4cb6b6d1586b3b7e5f14e9680", "score": "0.7903206", "text": "func (in *CephBackupSource) DeepCopyInto(out *CephBackupSource) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "effa6307fdf6b6d8aef93425794295c1", "score": "0.7900976", "text": "func (in *OCIReferenceParts) DeepCopyInto(out *OCIReferenceParts) {\n\t*out = *in\n}", "title": "" }, { "docid": "9fc1385dfaa3a89b6a701b34d99f68ae", "score": "0.7900545", "text": "func (in *ContinueOn) DeepCopyInto(out *ContinueOn) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "943d7f6174a25b06a160290aa387b688", "score": "0.7900412", "text": "func (in *DatasetRoutine) DeepCopyInto(out *DatasetRoutine) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "c4c4ace47e2088630b69076a754ee18a", "score": "0.78935677", "text": "func (in *PlumbingValue) DeepCopyInto(out *PlumbingValue) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "dddf435977ebcd6bfaf0b4c062ea8042", "score": "0.78908926", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n}", "title": "" }, { "docid": "a1e837b1e5c0750250ec053337d4ea95", "score": "0.78904575", "text": "func (in *Rdt) DeepCopyInto(out *Rdt) {\n\t*out = *in\n\tout.Cache = in.Cache\n\tout.Mba = in.Mba\n\treturn\n}", "title": "" }, { "docid": "44aa843319d42aac540ebbb780c5f0d0", "score": "0.789015", "text": "func (in *Record) DeepCopyInto(out *Record) {\n\t*out = *in\n\tif in.StepInfo != nil {\n\t\tin, out := &in.StepInfo, &out.StepInfo\n\t\t*out = make([]byte, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "32b00888211ff9ca3596125ceec6d7e7", "score": "0.78898907", "text": "func (in *ObjectInfo) DeepCopyInto(out *ObjectInfo) {\n\t*out = *in\n\tout.GroupVersionKind = in.GroupVersionKind\n\treturn\n}", "title": "" }, { "docid": "23db226639df1ec5bfce6ed220d55ed3", "score": "0.78862274", "text": "func (in *Port) DeepCopyInto(out *Port) {\n\t*out = *in\n}", "title": "" }, { "docid": "153a99a016a77679a9b35b2afac0ce73", "score": "0.78860754", "text": "func (in *CloneFrom) DeepCopyInto(out *CloneFrom) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "153a99a016a77679a9b35b2afac0ce73", "score": "0.78860754", "text": "func (in *CloneFrom) DeepCopyInto(out *CloneFrom) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fea7ec9e7b416ca412ea4012d2bc4379", "score": "0.78817755", "text": "func (in *CallValue) DeepCopyInto(out *CallValue) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "0a324763431036abed5658a8c6a258d6", "score": "0.7881433", "text": "func (in *NodeSelector) DeepCopyInto(out *NodeSelector) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "468d028d016a29b90f8fb0728461fcc7", "score": "0.78786826", "text": "func (in *Command) DeepCopyInto(out *Command) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e0a6b516fdf9d0ade0ca8bf100e9c9c0", "score": "0.78765297", "text": "func (in *NFS) DeepCopyInto(out *NFS) {\n\t*out = *in\n}", "title": "" }, { "docid": "d256c820515fab73a5f773948f60b6b7", "score": "0.7876052", "text": "func (in *KeyValue) DeepCopyInto(out *KeyValue) {\n\t*out = *in\n}", "title": "" }, { "docid": "bb04cd638c939bd7a75e8da7e2cc1460", "score": "0.7875891", "text": "func (in *AWSDNSSpec) DeepCopyInto(out *AWSDNSSpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "dfd9b82d38c6fee08dd3cf0209bd1133", "score": "0.7875385", "text": "func (in *Disk) DeepCopyInto(out *Disk) {\n\t*out = *in\n}", "title": "" }, { "docid": "23691787fc6f5c7052485344cca224ef", "score": "0.78725225", "text": "func (in *Run) DeepCopyInto(out *Run) {\n\t*out = *in\n\tif in.Params != nil {\n\t\tin, out := &in.Params, &out.Params\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d04effc735adc59932f839adb9a5fcca", "score": "0.78718626", "text": "func (in *Target) DeepCopyInto(out *Target) {\n\t*out = *in\n}", "title": "" }, { "docid": "d02c4e245665db42aa7f449aedbc0217", "score": "0.78715247", "text": "func (in *DNSSelection) DeepCopyInto(out *DNSSelection) {\n\t*out = *in\n\tif in.Include != nil {\n\t\tin, out := &in.Include, &out.Include\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Exclude != nil {\n\t\tin, out := &in.Exclude, &out.Exclude\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "7469ccae1d21960cfa51970df24db597", "score": "0.78679615", "text": "func (in *HookRunArgument) DeepCopyInto(out *HookRunArgument) {\n\t*out = *in\n}", "title": "" }, { "docid": "23a65f1f8246d0a6155b7ec686aafb86", "score": "0.78650737", "text": "func (in *Revision) DeepCopyInto(out *Revision) {\n\t*out = *in\n}", "title": "" }, { "docid": "5186b8d1bfd3abf2fb983694f27e4aed", "score": "0.78643847", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1e1088954cae99b323e1b34730ad0490", "score": "0.7863521", "text": "func (in *Proxy) DeepCopyInto(out *Proxy) {\n\t*out = *in\n}", "title": "" }, { "docid": "4b45b7057d0a50a99f3ef94afc614586", "score": "0.7862096", "text": "func (in *Update) DeepCopyInto(out *Update) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1c6240a586997b039407221e81129759", "score": "0.78608483", "text": "func (in *Rest) DeepCopyInto(out *Rest) {\n\t*out = *in\n\tout.Rest = in.Rest\n\treturn\n}", "title": "" }, { "docid": "9986d28e50d7f5a5e40d87f7a686278a", "score": "0.7858952", "text": "func (in *NodeCleanUpResult) DeepCopyInto(out *NodeCleanUpResult) {\n\t*out = *in\n\tif in.Results != nil {\n\t\tin, out := &in.Results, &out.Results\n\t\t*out = make([]NodeCleanUpDetail, len(*in))\n\t\tcopy(*out, *in)\n\t}\n}", "title": "" }, { "docid": "29e02c97b127087f995d6b0457b82abc", "score": "0.7858474", "text": "func (in *Checksum) DeepCopyInto(out *Checksum) {\n\t*out = *in\n}", "title": "" }, { "docid": "395e42f980980caf06129125de0d1056", "score": "0.7857077", "text": "func (in *PlasterDockerfileBuild) DeepCopyInto(out *PlasterDockerfileBuild) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "be10e95aa69cc037d34c99b04c51d566", "score": "0.78567684", "text": "func (in *PodNodeSelector) DeepCopyInto(out *PodNodeSelector) {\n\t*out = *in\n\tout.Config = in.Config\n\treturn\n}", "title": "" }, { "docid": "619ced57a08dd863072d39bcb0947148", "score": "0.78558147", "text": "func (in *Core) DeepCopyInto(out *Core) {\n\t*out = *in\n\tout.Core = in.Core\n\treturn\n}", "title": "" }, { "docid": "4600993eda54ac756514102911f18857", "score": "0.7854855", "text": "func (in *Result) DeepCopyInto(out *Result) {\n\t*out = *in\n\tif in.Items != nil {\n\t\tin, out := &in.Items, &out.Items\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "b73a0bca7e66531ec43189e30dbb950c", "score": "0.7854631", "text": "func (in *MigrationVolumeInfo) DeepCopyInto(out *MigrationVolumeInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "8595c8a7e4fc300ac82d808dfdd3b97d", "score": "0.785354", "text": "func (in *Step) DeepCopyInto(out *Step) {\n\t*out = *in\n\tif in.Environment != nil {\n\t\tin, out := &in.Environment, &out.Environment\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\tif in.Labels != nil {\n\t\tin, out := &in.Labels, &out.Labels\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\tif in.Entrypoint != nil {\n\t\tin, out := &in.Entrypoint, &out.Entrypoint\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Command != nil {\n\t\tin, out := &in.Command, &out.Command\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.ExtraHosts != nil {\n\t\tin, out := &in.ExtraHosts, &out.ExtraHosts\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Volumes != nil {\n\t\tin, out := &in.Volumes, &out.Volumes\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Tmpfs != nil {\n\t\tin, out := &in.Tmpfs, &out.Tmpfs\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Devices != nil {\n\t\tin, out := &in.Devices, &out.Devices\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Networks != nil {\n\t\tin, out := &in.Networks, &out.Networks\n\t\t*out = make([]Conn, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\tif in.DNS != nil {\n\t\tin, out := &in.DNS, &out.DNS\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.DNSSearch != nil {\n\t\tin, out := &in.DNSSearch, &out.DNSSearch\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tout.AuthConfig = in.AuthConfig\n\tif in.Sysctls != nil {\n\t\tin, out := &in.Sysctls, &out.Sysctls\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "60ab2f0f445d10b5a62d93d1d95c53b2", "score": "0.7851947", "text": "func (in *NodeResult) DeepCopyInto(out *NodeResult) {\n\t*out = *in\n\tif in.Images != nil {\n\t\tin, out := &in.Images, &out.Images\n\t\t*out = make([]NodeCleanUpDetail, len(*in))\n\t\tcopy(*out, *in)\n\t}\n}", "title": "" }, { "docid": "b4edcf0a724e1fe7f417820e620e8dd9", "score": "0.78508246", "text": "func (in *KeyToPath) DeepCopyInto(out *KeyToPath) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "8f77db9449d807b50cf35ec73f5fcbce", "score": "0.784662", "text": "func (in *Pool) DeepCopyInto(out *Pool) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3e013886e6bc1d59a365df69c5ee97c5", "score": "0.78445214", "text": "func (in *ReferenceObject) DeepCopyInto(out *ReferenceObject) {\n\t*out = *in\n}", "title": "" }, { "docid": "c507de4966f2e549916d775c5aa6a00c", "score": "0.7842011", "text": "func (in *TlsData) DeepCopyInto(out *TlsData) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "cb9ae0cf9d42bca2cbea4af3bc24b150", "score": "0.7841857", "text": "func (in *Anonymous) DeepCopyInto(out *Anonymous) {\n\t*out = *in\n}", "title": "" }, { "docid": "ca7ac29d4707cb3199f6c0f7f01870c8", "score": "0.7839705", "text": "func (in *PullRequestGeneratorAzureDevOps) DeepCopyInto(out *PullRequestGeneratorAzureDevOps) {\n\t*out = *in\n\tif in.TokenRef != nil {\n\t\tin, out := &in.TokenRef, &out.TokenRef\n\t\t*out = new(SecretRef)\n\t\t**out = **in\n\t}\n\tif in.Labels != nil {\n\t\tin, out := &in.Labels, &out.Labels\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "2300229ea8d7d76543a7dc0370ad8527", "score": "0.78390783", "text": "func (in *CephRestoreSource) DeepCopyInto(out *CephRestoreSource) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1462f8c11ac9fb85a2db41dbf2f02527", "score": "0.78379166", "text": "func (in *NodeSpec) DeepCopyInto(out *NodeSpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "81964a32bfd6f7c4c30aba87ff257c5c", "score": "0.78374386", "text": "func (in *DatabaseConnectionInfo) DeepCopyInto(out *DatabaseConnectionInfo) {\n\t*out = *in\n}", "title": "" }, { "docid": "6517829e5f084e9fc164337dca5ad675", "score": "0.78366923", "text": "func (in *PodGC) DeepCopyInto(out *PodGC) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "44dc6b8ab066d5f4294fa5b4e52ab31e", "score": "0.7835683", "text": "func (in *BucketVersioning) DeepCopyInto(out *BucketVersioning) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "78e490f295133f130a3ed946e288149f", "score": "0.7832026", "text": "func (in *HierarchicalReference) DeepCopyInto(out *HierarchicalReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "66d2580ffb856b04e5d00a44ee008ce0", "score": "0.78316104", "text": "func (in *Target) DeepCopyInto(out *Target) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "cb473a50a2c7608cb863df348afabf6c", "score": "0.78270286", "text": "func (in *State) DeepCopyInto(out *State) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "783f47424c191839399d4e44b906dd71", "score": "0.78263044", "text": "func (in *Port) DeepCopyInto(out *Port) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "783f47424c191839399d4e44b906dd71", "score": "0.78263044", "text": "func (in *Port) DeepCopyInto(out *Port) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "45b81ab5647ffc92a79777654a796ae7", "score": "0.782368", "text": "func (in *ManagedDisk) DeepCopyInto(out *ManagedDisk) {\n\t*out = *in\n}", "title": "" }, { "docid": "de8b3130a4b02c2fe7327dbd014d80d9", "score": "0.78214157", "text": "func (in *ContainerImage) DeepCopyInto(out *ContainerImage) {\n\t*out = *in\n}", "title": "" }, { "docid": "f0098cc888d3f9bd31c28603507c9ac2", "score": "0.7820586", "text": "func (in *InfoItem) DeepCopyInto(out *InfoItem) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1841f8389d1b1da1c8510773fe898aa0", "score": "0.78168976", "text": "func (in *AVLivenessprobe) DeepCopyInto(out *AVLivenessprobe) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "350e1878a33036442bfcf23ab258cddb", "score": "0.78148896", "text": "func (in *NameValue) DeepCopyInto(out *NameValue) {\n\t*out = *in\n}", "title": "" } ]
a5ebfb23d8bf719bb127e596c8f6c1ee
Filter selects values from list and apply specified Lua filter.
[ { "docid": "be6cbbfa8c4ac5312a685cd8e37eee76", "score": "0.5562056", "text": "func (ll *LargeList) Filter(filterName string, filterArgs ...interface{}) ([]interface{}, error) {\n\tres, err := ll.client.Execute(ll.policy, ll.key, ll.packageName(), \"filter\", ll.binName, ll.userModule, NewValue(filterName), ToValueArray(filterArgs))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif res == nil {\n\t\treturn nil, nil\n\t}\n\treturn res.([]interface{}), err\n}", "title": "" } ]
[ { "docid": "1c5cf0c28217dfaffb8079ed6ce908f1", "score": "0.6829071", "text": "func (l IntList) Filter(fn predFunc) IntList {\n\tout := IntList{}\n\tfor _, v := range l {\n\t\tif fn(v) {\n\t\t\tout = append(out, v)\n\t\t}\n\t}\n\treturn out\n}", "title": "" }, { "docid": "475f0e9b2cf94e679329eebd5721c404", "score": "0.6778995", "text": "func (l IntList) Filter(f predFunc) IntList {\n\tr := l[:0]\n\n\tfor _, v := range l {\n\t\tif f(v) {\n\t\t\tr = append(r, v)\n\t\t}\n\t}\n\treturn r\n}", "title": "" }, { "docid": "cb135d4d65321b167c73d0389824aa7a", "score": "0.67393786", "text": "func filter(list []string, f func(string) bool) []string {\n\tvar out []string\n\tfor _, x := range list {\n\t\tif f(x) {\n\t\t\tout = append(out, x)\n\t\t}\n\t}\n\treturn out\n}", "title": "" }, { "docid": "408f794c84391e6bc5a319ca5b311366", "score": "0.6673553", "text": "func (list IntList) Filter(pred predFunc) (out IntList) {\n\tif len(list) == 0 {\n\t\treturn list\n\t}\n\tfor _, v := range list {\n\t\tif pred(v) {\n\t\t\tout = append(out, v)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "b52688fc641911407d508353f125a79a", "score": "0.66693306", "text": "func FilterList(list []string, fn FilterFunc) []string {\n\tn := 0\n\tfor i := 0; i < len(list); i++ {\n\t\tif fn(list[i]) {\n\t\t\tlist[n] = list[i]\n\t\t\tn++\n\t\t}\n\t}\n\treturn list[:n]\n}", "title": "" }, { "docid": "21aea3ef43be8b59659948a434f2ccbf", "score": "0.66019785", "text": "func FilterList[T any](sourceList []T, filterFunc func(T) bool) (result []T) {\n\tfor _, s := range sourceList {\n\t\tif filterFunc(s) {\n\t\t\tresult = append(result, s)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "797113a11ff48b7cd38668f463c7bae6", "score": "0.6486501", "text": "func Filter(vs []string, f func(string) bool) []string {\n\tvsf := []string{}\n\tfor _, v := range vs {\n\t\tif f(v) {\n\t\t\tvsf = append(vsf, v)\n\t\t}\n\t}\n\treturn vsf\n}", "title": "" }, { "docid": "421f79912fa44732939d8354ed1d2837", "score": "0.644669", "text": "func (s *Set) Filter(P FilterFunc) *Set {\n\tres := NewSet()\n\tfor v := range s.list {\n\t\tif !P(v) {\n\t\t\tcontinue\n\t\t}\n\t\tres.Add(v)\n\t}\n\treturn res\n}", "title": "" }, { "docid": "b79997bc3edd42580410f5bf06ac3c84", "score": "0.6443657", "text": "func (s *Set32) Filter(P FilterFunc32) *Set32 {\n\tres := NewSet32()\n\tfor v := range s.list {\n\t\tif !P(v) {\n\t\t\tcontinue\n\t\t}\n\t\tres.Add(v)\n\t}\n\treturn res\n}", "title": "" }, { "docid": "4b469ebaf19a447a875d711be2bb04cb", "score": "0.6432713", "text": "func Filter(vs []string, f func(string) bool) []string {\n\tvsf := make([]string, 0)\n\tfor _, v := range vs {\n\t\tif f(v) {\n\t\t\tvsf = append(vsf, v)\n\t\t}\n\t}\n\treturn vsf\n}", "title": "" }, { "docid": "4b469ebaf19a447a875d711be2bb04cb", "score": "0.6432713", "text": "func Filter(vs []string, f func(string) bool) []string {\n\tvsf := make([]string, 0)\n\tfor _, v := range vs {\n\t\tif f(v) {\n\t\t\tvsf = append(vsf, v)\n\t\t}\n\t}\n\treturn vsf\n}", "title": "" }, { "docid": "18107939774e605c7499bcf444d6d9f4", "score": "0.6429685", "text": "func (r IntList) Filter(f predFunc) IntList {\n\tmatchingItems := IntList{}\n\n\tfor _, v := range r {\n\t\tif f(v) {\n\t\t\tmatchingItems = matchingItems.Append(IntList{v})\n\t\t}\n\t}\n\treturn matchingItems\n}", "title": "" }, { "docid": "76f355119ba68a60b98c07829fc257bc", "score": "0.6397738", "text": "func Filter(items DashSlice, predicate Predicate) DashSlice {\n\tresult := DashSlice{}\n\n\tfor _, item := range items {\n\t\tif ok := predicate(item); ok {\n\t\t\tresult = append(result, item)\n\t\t}\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "4e9a498595bc47760a3c34a6f270629c", "score": "0.63768524", "text": "func Filter(list manifest.List, exprs Matchers) manifest.List {\n\tout := make(manifest.List, 0, len(list))\n\tfor _, m := range list {\n\t\tif !exprs.MatchString(m.KindName()) {\n\t\t\tcontinue\n\t\t}\n\t\tif exprs.IgnoreString(m.KindName()) {\n\t\t\tcontinue\n\t\t}\n\t\tout = append(out, m)\n\t}\n\treturn out\n}", "title": "" }, { "docid": "6daa152f6f57bca435c8a33572b57494", "score": "0.6362964", "text": "func (l IntList) Filter(fn predFunc) IntList {\n\tnewList := IntList{}\n\n\tfor _, el := range l {\n\t\tif fn(el) {\n\t\t\tnewList = append(newList, el)\n\t\t}\n\t}\n\treturn newList\n}", "title": "" }, { "docid": "b007386070dbf66a8b2d775907cc276d", "score": "0.6318829", "text": "func (v IntList) Filter(fn predFunc) IntList {\n\t// make a new empty IntList append elements and return it\n\tu := IntList{}\n\tfor i := 0; i < v.Length(); i++ {\n\t\tif fn(v[i]) {\n\t\t\tu = u.Append(IntList{v[i]})\n\t\t}\n\t}\n\treturn u\n}", "title": "" }, { "docid": "4857da65194468f1a8f4062d94942e5a", "score": "0.62974405", "text": "func (c *Generic) Filter(fn func(interface{}) bool) *Generic {\n\tn := 0\n\tfor i := 0; i < c.items.Len(); i++ {\n\t\tv := c.items.Index(i)\n\n\t\tif fn(v.Interface()) {\n\t\t\tc.items.Index(n).Set(v)\n\t\t\tn++\n\t\t}\n\t}\n\n\tc.items = c.items.Slice(0, n)\n\n\treturn c\n}", "title": "" }, { "docid": "2b16c305d1bd249e0a4d807194873a09", "score": "0.6291234", "text": "func Filter(skus []SKU, filterFn ...FilterFn) []SKU {\n\tif skus == nil {\n\t\treturn nil\n\t}\n\n\tfiltered := make([]SKU, 0)\n\tfor i := range skus {\n\t\tif All(&skus[i], filterFn) {\n\t\t\tfiltered = append(filtered, skus[i])\n\t\t}\n\t}\n\n\treturn filtered\n}", "title": "" }, { "docid": "b9903095289d6f72de68047e2a42ac67", "score": "0.62779135", "text": "func Filter(list []T, filterFunc func(T) bool) []T {\n\tresult := Foldl(list, []T{}, func(result, next T) T {\n\t\tif filterFunc(next) {\n\t\t\treturn append(result.([]T), next)\n\t\t}\n\t\treturn result\n\t})\n\treturn result.([]T)\n}", "title": "" }, { "docid": "5fd698910c39c88cfdd6c05fede75158", "score": "0.6243665", "text": "func (l ResultList) FilterBy(matcher func(*Result) bool) ResultList {\n\tout := make(ResultList, 0, len(l))\n\n\tfor i := range l {\n\t\tif matcher(&l[i]) {\n\t\t\tout = append(out, l[i])\n\t\t}\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "e53375052cf6be11f423068c37e174c8", "score": "0.6216318", "text": "func (list *IntList) Filter(fn predFunc) IntList {\n\tnewList := make(IntList, 0)\n\n\tfor _, num := range *list {\n\t\tif fn(num) {\n\t\t\ttempList := make(IntList, 1)\n\t\t\ttempList[0] = num\n\t\t\tnewList = newList.Append(tempList)\n\t\t}\n\t}\n\n\treturn newList\n}", "title": "" }, { "docid": "707a85fd586f04ea04914ce99e62af3c", "score": "0.6214119", "text": "func Filter(songs []Song, f func(Song) bool) []Song {\n\tvsf := make([]Song, 0)\n\tfor _, v := range songs {\n\t\tif f(v) {\n\t\t\tvsf = append(vsf, v)\n\t\t}\n\t}\n\treturn vsf\n}", "title": "" }, { "docid": "9cfbc44bb2f24d8684601e74d74dc126", "score": "0.6209452", "text": "func Filter(strs []string,f func(string) bool) []string {\n\tfs := make([]string,0)\n\tfor _, v := range strs{\n\t\tif f(v) {\n\t\t\tfs = append(fs, v)\n\t\t}\n\t}\n\treturn fs\n}", "title": "" }, { "docid": "0d5dd996b2a3b3680b3a0aa012e50c15", "score": "0.6179562", "text": "func (s Players) Filter(f func(Player) bool) (out Players) {\n\tfor _, v := range s {\n\t\tif f(v) {\n\t\t\tout = append(out, v)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "9bad019c79e3c8308ae508388e3d9be4", "score": "0.6177885", "text": "func (s *SliceOfSomething) Filter(filterFunc func(Something) bool) *SliceOfSomething {\n\tvar newItems []Something\n\tfor _, value := range s.items {\n\t\tif filterFunc(value) {\n\t\t\tnewItems = append(newItems, value)\n\t\t}\n\t}\n\treturn s\n}", "title": "" }, { "docid": "9a180586c61570c60ff71b276ed01080", "score": "0.6162423", "text": "func (t *Poireaux) Filter(filters ...func(*Poireau) bool) *Poireaux {\n\tret := NewPoireaux()\n\tfor _, i := range t.items {\n\t\tok := true\n\t\tfor _, f := range filters {\n\t\t\tok = ok && f(i)\n\t\t\tif !ok {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ok {\n\t\t\tret.Push(i)\n\t\t}\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "31f8ff6c167ef4ce4bc676ec2d545b2c", "score": "0.6116518", "text": "func Filter(vs []string, f func(string) bool) []string {\n vsf := make([]string, 0)\n for _, v := range vs {\n if f(v) {\n vsf = append(vsf, v)\n }\n }\n return vsf\n}", "title": "" }, { "docid": "8c041e876b4f7d3e6c97e4815e3f3e79", "score": "0.6101843", "text": "func (is Items) Filter(accept func(Item) bool) Items {\n\tvar res Items\n\tfor _, i := range is {\n\t\tif accept(i) {\n\t\t\tres = append(res, i)\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "a4b044a1f4b813ec4567bb34509d81e2", "score": "0.6082158", "text": "func Filter(g Generic, modifier func(index int, val interface{}) bool) Generic {\n\titems := g.Unpack()\n\tres := make([]interface{}, 0)\n\tfor index, val := range items {\n\t\tif modifier(index, val) {\n\t\t\tres = append(res, val)\n\t\t}\n\t}\n\treturn g.Pack(res)\n}", "title": "" }, { "docid": "b101db7f0bd50ffb8d9680c92ce136aa", "score": "0.6081036", "text": "func filter(vs []string, f func(string) bool) []string {\n\tvsf := make([]string, 0)\n\tfor _, v := range vs {\n\t\tif f(v) {\n\t\t\tvsf = append(vsf, v)\n\t\t}\n\t}\n\treturn vsf\n}", "title": "" }, { "docid": "0d779811e07d810248c67bebd4cb65c0", "score": "0.6079714", "text": "func Filter(records []Record, predicate func(Record) bool) []Record {\n\tresult := make([]Record, 0, len(records))\n\tfor _, r := range records {\n\t\tif predicate(r) {\n\t\t\tresult = append(result, r)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "56f546821e5c831e51230c9e63119ce9", "score": "0.60544705", "text": "func Filter(s []string, f func(s string) bool) Strings {\n\tm := Strings(make([]string, 0, len(s)))\n\tfor _, v := range s {\n\t\tif f(v) {\n\t\t\tm = append(m, v)\n\t\t}\n\t}\n\treturn m\n}", "title": "" }, { "docid": "4cf1652e1ab5199ba9b99623fd06a18f", "score": "0.6052917", "text": "func filter(ss []string, test func(string) bool) (ret []string) {\n\tfor _, s := range ss {\n\t\tif test(s) {\n\t\t\tret = append(ret, s)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "f7c7f22dae2cb5f9352b814678980cd8", "score": "0.60353583", "text": "func (ol ObjectList) filter(f func(*Object) bool) ObjectList {\n\tmatches := make(ObjectList, 0)\n\tfor i := range ol {\n\t\tif f(&ol[i]) {\n\t\t\tmatches = append(matches, ol[i])\n\t\t}\n\t}\n\treturn matches\n}", "title": "" }, { "docid": "0dd3ef320f712253a92b7f52f161cbf7", "score": "0.6007467", "text": "func Filter(args ...reflect.Value) (interface{}, error) {\n\tvar listv reflect.Value\n\tvar keyv reflect.Value\n\tvar valuev reflect.Value\n\n\tswitch len(args) {\n\tcase 0, 1, 2:\n\t\treturn nil, errors.New(\"missing list, key and value arguments\")\n\tcase 3:\n\t\tkeyv = args[0]\n\t\tvaluev = args[1]\n\t\tlistv = args[2]\n\tdefault:\n\t\treturn nil, errors.New(\"too many arguments\")\n\t}\n\n\tlistv = indirect(listv)\n\tkeyv = indirect(keyv)\n\tvaluev = indirect(valuev)\n\n\t// check list is a list\n\tlist, err := valueList(listv, \"list\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// check keyv\n\tif keyv.Kind() != reflect.String {\n\t\treturn nil, errors.New(\"key is not a string\")\n\t}\n\tkey := keyv.String()\n\n\tvar value interface{}\n\n\tout := reflect.MakeSlice(reflect.SliceOf(list.Type().Elem()), 0, 0)\n\n\tif !valuev.IsValid() || !valuev.CanInterface() {\n\t\treturn out.Interface(), nil\n\t}\n\tvalue = valuev.Interface()\n\n\tfor i := 0; i < list.Len(); i++ {\n\t\te := list.Index(i)\n\t\tv, err := lookup(e, key)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !v.IsValid() {\n\t\t\tcontinue\n\t\t}\n\t\tif v.Interface() == value {\n\t\t\tout = reflect.Append(out, e)\n\t\t}\n\t}\n\n\treturn out.Interface(), nil\n\n}", "title": "" }, { "docid": "7b00e5a9809f675daf5826b4ef1e9ced", "score": "0.5972097", "text": "func Filter[S ~[]T, T any](items S, f func(el T) bool) S {\n\tresult := make([]T, 0, len(items))\n\tfor _, el := range items {\n\t\tif f(el) {\n\t\t\tresult = append(result, el)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "606282bfc91cfc47fcfd1f3a3cba1bee", "score": "0.59709257", "text": "func (d *Discovery) filterList(servers []string) (filtered []string) {\n\tdlog.Common.Debug(\"Filtering server list\")\n\tfor _, server := range servers {\n\t\tif d.regex.MatchString(server) {\n\t\t\tfiltered = append(filtered, server)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "27ab0794e37b14f6e0cb3b503f9c53ec", "score": "0.59707594", "text": "func (rs ReleaseSet) Filter(f Filter) (filtered ReleaseSet) {\n\tfor i := range rs {\n\t\tif f.Match(&rs[i]) {\n\t\t\tfiltered = append(filtered, rs[i])\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "d53b6c4ff4b00fa5563cf2717686b2d6", "score": "0.596438", "text": "func (q *Query) Filter(fn func(Vertex) bool) *Query {\n\tvar output []Vertex\n\tfor _, v := range q.results {\n\t\tfil := fn(v)\n\t\tif fil {\n\t\t\toutput = append(output, v)\n\t\t}\n\t}\n\tq.results = output\n\treturn q\n}", "title": "" }, { "docid": "15947db970f104eb5a668112ffa2455f", "score": "0.5927188", "text": "func FilterOn[I any](slice *[]I, f func(index int, value I) (keep bool)) {\n\tif slice == nil { // do nothing\n\t\treturn\n\t}\n\t// see: https://github.com/golang/go/wiki/SliceTricks#filtering-without-allocating\n\tnewSlice := (*slice)[:0]\n\tfor i, v := range *slice {\n\t\tif f(i, v) {\n\t\t\tnewSlice = append(newSlice, v)\n\t\t}\n\t}\n\t*slice = newSlice\n}", "title": "" }, { "docid": "74eb1fba8d07be78a02afebd7d220258", "score": "0.5810526", "text": "func (x *Replayer) Filter(fn ...Filter) *Replayer {\n\tx.Filters = append(x.Filters, fn...)\n\treturn x\n}", "title": "" }, { "docid": "473edfe22be92a2772d89cb75f76bb6a", "score": "0.580706", "text": "func Filter(in []Status, pred StatusPredicate) []Status {\n\tvar filteredStatuses []Status\n\n\tfor _, s := range in {\n\t\tif pred(s) {\n\t\t\tfilteredStatuses = append(filteredStatuses, s)\n\t\t}\n\t}\n\treturn filteredStatuses\n}", "title": "" }, { "docid": "61752c0ab0d6d6502c85bfaf400f6dd1", "score": "0.5798677", "text": "func filterExpressionList(items *parser.List, removals *parser.List) {\n\twriteIndex := 0\n\tfor _, item := range items.Values {\n\t\tincluded := true\n\t\tfor _, removal := range removals.Values {\n\t\t\tequal, err := parser.ExpressionsAreSame(item, removal)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif equal {\n\t\t\t\tincluded = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif included {\n\t\t\titems.Values[writeIndex] = item\n\t\t\twriteIndex++\n\t\t}\n\t}\n\titems.Values = items.Values[:writeIndex]\n}", "title": "" }, { "docid": "61752c0ab0d6d6502c85bfaf400f6dd1", "score": "0.5798677", "text": "func filterExpressionList(items *parser.List, removals *parser.List) {\n\twriteIndex := 0\n\tfor _, item := range items.Values {\n\t\tincluded := true\n\t\tfor _, removal := range removals.Values {\n\t\t\tequal, err := parser.ExpressionsAreSame(item, removal)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif equal {\n\t\t\t\tincluded = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif included {\n\t\t\titems.Values[writeIndex] = item\n\t\t\twriteIndex++\n\t\t}\n\t}\n\titems.Values = items.Values[:writeIndex]\n}", "title": "" }, { "docid": "de9f15887247370b56a21d1d4ae5f739", "score": "0.5792099", "text": "func (set CommandParamSet) Filter(f func(*CommandParam) (bool, error)) (out CommandParamSet, err error) {\n\tvar ok bool\n\tout = CommandParamSet{}\n\tfor i := range set {\n\t\tif ok, err = f(set[i]); err != nil {\n\t\t\treturn\n\t\t} else if ok {\n\t\t\tout = append(out, set[i])\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "4e2459365c0cdf79270f1adf67cbb482", "score": "0.5759443", "text": "func filter(strings []string, f func(string) bool) []string {\n\tsatisfied := make([]string, 0)\n\tfor _, v := range strings {\n\t\tif f(v) {\n\t\t\tsatisfied = append(satisfied, v)\n\t\t}\n\t}\n\treturn satisfied\n}", "title": "" }, { "docid": "ee655479e433c775c1db22b9e87978c5", "score": "0.57372874", "text": "func (s *Set) Filter(fn func(interface{}) bool) *Set {\n\t// Create a set to return with elements which match filter function\n\tfilterSet := New()\n\n\t// Enumerate all elements and apply the function\n\tfor _, e := range s.Enumerate() {\n\t\t// Apply the function, add elements which it matches\n\t\tif fn(e) {\n\t\t\tfilterSet.Add(e)\n\t\t}\n\t}\n\n\treturn filterSet\n}", "title": "" }, { "docid": "e3d6b3e8ee2d0a64bc32fce277e0be2e", "score": "0.5716773", "text": "func Filter(c Context, s Sequence, filter Applicable) Sequence {\n\tvar res LazyResolver\n\tnext := s\n\n\tres = func() (Value, Sequence, bool) {\n\t\tfor f, r, ok := next.Split(); ok; f, r, ok = r.Split() {\n\t\t\tnext = r\n\t\t\tif Truthy(filter.Apply(c, Vector{f})) {\n\t\t\t\treturn f, NewLazySequence(res), true\n\t\t\t}\n\t\t}\n\t\treturn Nil, EmptyList, false\n\t}\n\treturn NewLazySequence(res)\n}", "title": "" }, { "docid": "49281ff4d433b24d494cd18a1cf0c738", "score": "0.5710686", "text": "func Filter(e ienforcer, u User, d Domain, action Action, source interface{}) interface{} {\n\tlinq.From(source).Where(func(v interface{}) bool {\n\t\treturn Check(e, u, d, action, v.(entry))\n\t}).ToSlice(&source)\n\treturn source\n}", "title": "" }, { "docid": "b61b664c5ea306ae692a026d2f7c6313", "score": "0.5706477", "text": "func (ms *MoveSlice) Filter(f func(index int) bool) {\n\tb := (*ms)[:0]\n\tfor i, x := range *ms {\n\t\tif f(i) {\n\t\t\tb = append(b, x)\n\t\t}\n\t}\n\t*ms = b\n}", "title": "" }, { "docid": "c0ec879e5cbac0c163ea69fe50ad663d", "score": "0.5704443", "text": "func (i *Integer) Filter(f func(int) bool) *Integer {\n\tvar buffer = make([]int, 0, len(i.values))\n\tfor num := range i.values {\n\t\tif f(num) {\n\t\t\tbuffer = append(buffer, num)\n\t\t}\n\t}\n\ti.values = buffer\n\n\treturn i\n}", "title": "" }, { "docid": "de197f9468a0e6145babf5336ffcdcd0", "score": "0.57030964", "text": "func LFilter(fn func(interface{}) bool, s Seq) Seq {\n\treturn NewLazy(filterThunk(fn, s))\n}", "title": "" }, { "docid": "f14d5ff0ff43aefcd10bc4816c165abb", "score": "0.56740797", "text": "func (es *ExpressionSet) Filter(v ValueSet) []string {\n\tes.RLock()\n\tout := []string{}\n\tfor f, e := range es.expressions {\n\t\tif e.Evaluate(v) {\n\t\t\tout = append(out, f)\n\t\t}\n\t}\n\tes.RUnlock()\n\treturn out\n}", "title": "" }, { "docid": "67c7a961cd0cf8fec64869b286d95a6f", "score": "0.56727666", "text": "func Filter (s []int, fn func(int) bool) []int{\n\tvar p []int // == nil\n\tfor _,v := range s {\n\t\tif fn(v) {\n\t\t\tp = append(p,v)\n\t\t}\n\t}\n\t\n\treturn p\n}", "title": "" }, { "docid": "2ad96388563645268da989d4bb7de75e", "score": "0.5665539", "text": "func (l *List) Filter(f func(int) bool) (rl *List) {\n\trl = new(List)\n\tif l.first == nil {\n\t\treturn\n\t}\n\n\tfake := new(Node)\n\tprev := fake\n\tfor next := l.first; next != nil; next = next.next {\n\t\tif n := next.val; f(n) {\n\t\t\tprev.next = &Node{val: n, prev: prev}\n\t\t\tprev = prev.next\n\t\t\trl.size++\n\t\t}\n\t}\n\tfake.next.prev = nil\n\n\trl.first, rl.last = fake.next, prev\n\treturn\n}", "title": "" }, { "docid": "090260f3d2c91a524251cb8110d5091a", "score": "0.56534284", "text": "func filterEmployeeExample() {\n\n\tvar list = EmployeeList{\n\t\t{\"Hao\", 44, 0, 8000},\n\t\t{\"Bob\", 34, 10, 5000},\n\t\t{\"Alice\", 23, 5, 9000},\n\t\t{\"Jack\", 26, 0, 4000},\n\t\t{\"Tom\", 48, 9, 7500},\n\t}\n\n\tvar filter EmployeeList\n\tfilter = list.Filter(func(e *Employee) bool {\n\t\treturn e.Age > 40\n\t})\n\n\tfmt.Println(\"----- Employee.Age > 40 ------\")\n\tfor _, e := range filter {\n\t\tfmt.Println(e)\n\t}\n\n\tfilter = list.Filter(func(e *Employee) bool {\n\t\treturn e.Salary <= 5000\n\t})\n\n\tfmt.Println(\"----- Employee.Salary <= 5000 ------\")\n\tfor _, e := range filter {\n\t\tfmt.Println(e)\n\t}\n}", "title": "" }, { "docid": "7440ac5c1a2d8afe49d3dcf96577d25b", "score": "0.56450635", "text": "func (a *apiServer) filter(values interface{}, check func(int) bool) {\n\trv := reflect.ValueOf(values)\n\tresults := reflect.MakeSlice(rv.Type().Elem(), 0, 0)\n\tfor i := 0; i < rv.Elem().Len(); i++ {\n\t\tif check(i) {\n\t\t\tresults = reflect.Append(results, rv.Elem().Index(i))\n\t\t}\n\t}\n\trv.Elem().Set(results)\n}", "title": "" }, { "docid": "38d3323b668c10ba735ef7c68697e039", "score": "0.5632885", "text": "func ExampleFilter() {\n\tslice := []float64{1, 2, -99, 4, 5, -99, 7}\n\tcondition := func(x float64) bool { return x > 0 }\n\tfmt.Println(sliceop.Filter(nil, slice, condition))\n\n\t// Output:\n\t// [1 2 4 5 7]\n}", "title": "" }, { "docid": "1ec8f58d00c8d8a91c579af46e3a8dd3", "score": "0.5619144", "text": "func filter(nums []int, callback func(int) bool ) []int{\n\tresult := []int{}\n\tfor _, v := range nums{\n\t\tif callback(v) { //true\n\t\t\tresult = append(result,v)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "6bdfedd35c7f519bff24d99a56854368", "score": "0.5589902", "text": "func Filter[S ~[]E, E any](s S, f func(E) bool) S {\n\tvar ns S\n\tfor _, el := range s {\n\t\tif f(el) {\n\t\t\tns = append(ns, el)\n\t\t}\n\t}\n\treturn ns\n}", "title": "" }, { "docid": "39ab99b766a8e543619d0ce81627f776", "score": "0.5584855", "text": "func (s *StringSlicer) Filter(fn func(string) bool) *StringSlicer {\n\tresult := &StringSlicer{}\n\tfor _, elem := range s.slice {\n\t\tif fn(elem) {\n\t\t\tresult.Add(elem)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "ce589a8ec61d172f267fc233c5f9e338", "score": "0.55817574", "text": "func filterByCondition(list []*lineageclass.Class, conditions []map[string]string) []*lineageclass.Class {\n\t_, race := containCondition(\"race\", conditions)\n\t_, starterClass := containCondition(\"starterClass\", conditions)\n\t_, firstClass := containCondition(\"firstClass\", conditions)\n\t_, secondClass := containCondition(\"secondClass\", conditions)\n\t_, thirdClass := containCondition(\"thirdClass\", conditions)\n\n\tbList := &listBuilder{\n\t\tlist: list,\n\t}\n\n\tbList.filterByRace(race).\n\t\tfilterByStarterClass(starterClass).\n\t\tfilterByFirstClass(firstClass).\n\t\tfilterBySecondClass(secondClass).\n\t\tfilterByThirdClass(thirdClass)\n\n\treturn bList.list\n}", "title": "" }, { "docid": "18a90dc7bae798c0e83f7769d554ac4d", "score": "0.5563583", "text": "func Filter(vs chan string, f Predicate) chan string {\n\toutstream := make(chan string)\n\tgo func() {\n\t\tfor v := range vs {\n\t\t\tif f(v) {\n\t\t\t\toutstream <- v\n\t\t\t}\n\t\t}\n\t\tclose(outstream)\n\t}()\n\treturn outstream\n}", "title": "" }, { "docid": "796ad4aa57ab4be2ab79a8d047f2f015", "score": "0.55491793", "text": "func Filter(arr []Annotation, cond func(Annotation) bool) []Annotation {\n\tresult := []Annotation{}\n\tfor i := range arr {\n\t\tif cond(arr[i]) {\n\t\t\tresult = append(result, arr[i])\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "e611f9129045d279ab1198a11cd7e934", "score": "0.5547451", "text": "func (s Stream) Filter(fn FilterFunc, opts ...Option) Stream {\n\treturn s.Walk(func(item interface{}, pipe chan<- interface{}) {\n\t\tif fn(item) {\n\t\t\tpipe <- item\n\t\t}\n\t}, opts...)\n}", "title": "" }, { "docid": "7199a9ae0fe0df9266dbe05bbc498461", "score": "0.55395967", "text": "func fFilter(fn func(a int) bool, arr []int) []int {\n\treturn nil\n}", "title": "" }, { "docid": "9900642d3a01165c0dbbb9ff98a40c7b", "score": "0.5528551", "text": "func (g *Goarray) Filter(c func(a int) bool) (result Goarray) {\n\tfor _, elem := range *g {\n\t\tif c(elem) {\n\t\t\tresult = append(result, elem)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "d5eb30333467625d79bc3f9183fa6b70", "score": "0.55281246", "text": "func (ss *TypeStringSlice) FilterBy(filter func(*TypeString) bool) *TypeStringSlice {\n\tnewSS := StringSlice(nil)\n\tfor _, v := range ss.Obj {\n\t\tif filter(String(v)) {\n\t\t\tnewSS.Push(v)\n\t\t}\n\t}\n\treturn newSS\n}", "title": "" }, { "docid": "d0323d2dcef6d5343fc4a50fd9470cec", "score": "0.55217636", "text": "func (cs Colliders) Filter(test func(Collider, int) bool) Colliders {\n\tret := make([]Collider, len(cs))\n\tit := 0\n\tfor i, v := range cs {\n\t\tif test(v, i) {\n\t\t\tret[it] = v\n\t\t\tit++\n\t\t}\n\t}\n\treturn ret[:it]\n}", "title": "" }, { "docid": "143ef63feb58a05aeb05f692d9592aff", "score": "0.5511074", "text": "func filter(m map[string]interface{}, allowList []string) (filtered map[string]interface{}) {\n\tif allowList != nil {\n\t\tfiltered = make(map[string]interface{})\n\t\tfor _, key := range allowList {\n\t\t\tv, found := m[key]\n\t\t\tif found {\n\t\t\t\tfiltered[key] = v\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfiltered = m\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "3f49a9a6ccc62577482d988ecadfa97e", "score": "0.5503671", "text": "func filter(todos []*Todo, p func(*Todo) bool) []*Todo {\n\tvar res []*Todo\n\tfor _, t := range todos {\n\t\tif p(t) {\n\t\t\tres = append(res, t)\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "d0c1d5dfa3f163e8a74787ee2fc720f9", "score": "0.5480548", "text": "func (d *DefaultResourceManager) filter(f []task.Filter, offer *mesos_v1.Offer) bool {\n\tfor _, filter := range f {\n\t\tfor _, attr := range offer.Attributes {\n\t\t\tswitch attr.GetType() {\n\t\t\tcase SCALAR:\n\t\t\t\tif d.filterOnAttrScalar(filter.Value, attr) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\tcase TEXT:\n\t\t\t\tif d.filterOnAttrText(filter.Value, attr) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\tcase SET:\n\t\t\tcase RANGES:\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "66cc7d22d38015bf4e842ddce9bd5f9f", "score": "0.54746383", "text": "func Filter(predicate func(Card) bool) Option {\n\treturn func(cards []Card) []Card {\n\t\tend := len(cards) - 1\n\t\tfor i := 0; i <= end; {\n\t\t\tif predicate(cards[i]) {\n\t\t\t\tcards[end], cards[i] = cards[i], cards[end]\n\t\t\t\tend--\n\t\t\t} else {\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\t\treturn cards[: end+1 : end+1]\n\t}\n}", "title": "" }, { "docid": "b7ad132a75c66807cf44baf655bf3b29", "score": "0.54712373", "text": "func filterByPredicate(res *[]interface{}, pred func(*interface{}) bool) []interface{} {\n\tvar result []interface{}\n\trespSlice := *res\n\tfor _, v := range respSlice {\n\t\tif pred(&v) {\n\t\t\tresult = append(result, v)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "3db9bf3733ccb5e2e3c4abf775cf0d85", "score": "0.5467643", "text": "func (ListAssetsFilter) Values() []ListAssetsFilter {\n\treturn []ListAssetsFilter{\n\t\t\"ALL\",\n\t\t\"TOP_LEVEL\",\n\t}\n}", "title": "" }, { "docid": "49b7135047ac455635e9c7a08e5cad0f", "score": "0.54436034", "text": "func MapFilter[S ~[]T, T any, G any](items S, f func(el T) (G, bool)) []G {\n\tresult := make([]G, 0, len(items))\n\tfor _, el := range items {\n\t\tr, b := f(el)\n\t\tif b {\n\t\t\tresult = append(result, r)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "c33a40c6bfa25dc09dce978afeaf7161", "score": "0.5442553", "text": "func TestFilteredList(t *testing.T) {\n\n\t// clear database\n\td.GetDataSourceInstance().Clear()\n\n\t// create 3 entries, 2 with \"li\" in the name\n\tu.AddFullList(&m.TodoList{\n\t\tID: \"1\",\n\t\tName: \"list 1\",\n\t})\n\tu.AddFullList(&m.TodoList{\n\t\tID: \"2\",\n\t\tName: \"Temporary\",\n\t})\n\tu.AddFullList(&m.TodoList{\n\t\tID: \"3\",\n\t\tName: \"limabean\",\n\t})\n\n\tfilterString := \"li\"\n\tfilteredList := u.FilterLists(d.GetDataSourceInstance().Database, filterString)\n\n\tif len(*filteredList) != 2 {\n\t\tt.Error(\"Unable to filter list\")\n\t}\n}", "title": "" }, { "docid": "725866f467a6be9c9faca525a84c2fc9", "score": "0.5434562", "text": "func StringFilter(f func(string) bool, data []string) []string {\n\tresult := make([]string, 0, 0)\n\tfor _, element := range data {\n\t\tif f(element) {\n\t\t\tresult = append(result, element)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "cf73d517b42660d720fd234939f4c208", "score": "0.54278433", "text": "func (df Table) Filter(maf ...MapFun) Table {\n\tmf := unwrapMap(maf)\n\n\tmask := make([][]bool, 0, len(mf))\n\tindex := make([]int, 0, df.size[0])\n\n\tfor _, val := range mf {\n\n\t\tswitch v := df.data[val.col].(type) {\n\t\tcase vec.IntVector:\n\t\t\tswitch f := val.fun.(type) {\n\t\t\tcase func(int, bool) bool:\n\t\t\t\tout, err := v.Check(f)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn Table{err: fmt.Errorf(\"error in Check() method in columns %s : %w\", val.col, err)}\n\n\t\t\t\t}\n\t\t\t\tmask = append(mask, out)\n\t\t\tdefault:\n\t\t\t\treturn Table{\n\t\t\t\t\terr: fmt.Errorf(\"wrong function definition, expected func(int) bool, got %T\", f),\n\t\t\t\t}\n\t\t\t}\n\t\tcase vec.StrVector:\n\t\t\tswitch f := val.fun.(type) {\n\t\t\tcase func(string, bool) bool:\n\t\t\t\tout, err := v.Check(f)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn Table{err: fmt.Errorf(\"error in Check() method in columns %s : %w\", val.col, err)}\n\n\t\t\t\t}\n\t\t\t\tmask = append(mask, out)\n\t\t\tdefault:\n\t\t\t\treturn Table{\n\t\t\t\t\terr: fmt.Errorf(\"wrong function definition, expected func(int) bool, got %T\", f),\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfor i := 0; i < df.size[0]; i++ {\n\t\ty := true\n\t\tfor j := 0; j < len(mf); j++ {\n\t\t\ty = y || mask[j][i]\n\t\t}\n\t\tif y {\n\t\t\tindex = append(index, i)\n\t\t}\n\t}\n\n\treturn df.Rows(index)\n\n}", "title": "" }, { "docid": "12f8c070b475e724d6fcd40f3093b7d9", "score": "0.5426264", "text": "func Filter(f func(Card) bool) func([]Card) []Card {\n\treturn func(c []Card) []Card {\n\t\tvar ret []Card\n\t\tfor _, card := range c {\n\t\t\tif !f(card) {\n\t\t\t\tret = append(ret, card)\n\n\t\t\t}\n\t\t}\n\t\treturn ret\n\n\t}\n}", "title": "" }, { "docid": "88532d8dc3b3b1d767b8de027e4b4220", "score": "0.5407588", "text": "func (o Outputs) Filter(condition func(output Output) bool) (filteredOutputs Outputs) {\n\tfilteredOutputs = make(Outputs, 0)\n\tfor _, output := range o {\n\t\tif condition(output) {\n\t\t\tfilteredOutputs = append(filteredOutputs, output)\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "9bbefa0922bd8fe8597b2cc728b4d94b", "score": "0.54008836", "text": "func (f objectToListFilter) Filter(objs ...runtime.Object) (retarr []runtime.Object, err error) {\n\t// Walk through all objects\n\tfor _, obj := range objs {\n\t\t// Match them one-by-one against the ObjectFilter\n\t\tmatch, err := f.of.Filter(obj)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// If the object matches, include it in the return array\n\t\tif match {\n\t\t\tretarr = append(retarr, obj)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "f6b8c8e4a74ddb044a6dda3c2facf210", "score": "0.5388064", "text": "func (bcl BuiltinCmdList) Filter(filter func(BuiltinCmd) bool) BuiltinCmdList {\n\tcmds := BuiltinCmdList{}\n\tfor _, l := range []BuiltinCmdList{bcl, Builtins.Commands()} {\n\t\tfor _, c := range l {\n\t\t\tif filter(c) {\n\t\t\t\tcmds = append(cmds, c)\n\t\t\t}\n\t\t}\n\t}\n\treturn cmds\n}", "title": "" }, { "docid": "ba8dd6c5b68de4d3ca52ad331217bd3e", "score": "0.5385542", "text": "func (h *ReleaseListFilter) Apply(list *action.List) {\n\tif h.Namespace == \"\" {\n\t\tlist.AllNamespaces = true\n\t}\n\n\tlist.Limit = h.Limit\n\tlist.Offset = h.Skip\n\n\tlist.StateMask = h.listStatesFromNames()\n\n\tif h.ByDate {\n\t\tlist.ByDate = true\n\t}\n}", "title": "" }, { "docid": "965bc9edd40ddfc122faf3f1ec0c77c1", "score": "0.53402275", "text": "func Filter(f func(card Card) bool) func([]Card) []Card {\n\treturn func(cards []Card) []Card {\n\t\tvar ret []Card\n\t\tfor _, c := range cards {\n\t\t\tif !f(c) {\n\t\t\t\tret = append(ret, c)\n\t\t\t}\n\t\t}\n\t\treturn ret\n\t}\n}", "title": "" }, { "docid": "82d4e39b1c1c932be8de43e195d24970", "score": "0.53331065", "text": "func FilterBy(list api.SeriesList, count int, summary func([]float64) float64, lowest bool) api.SeriesList {\n\tif len(list.Series) < count {\n\t\t// Limit the count to the number of available series\n\t\tcount = len(list.Series)\n\t}\n\tarray := newFilterList(len(list.Series), lowest)\n\tfor i := range array.index {\n\t\tarray.index[i] = i\n\t\tarray.value[i] = summary(list.Series[i].Values)\n\t}\n\tsort.Sort(array)\n\n\tseries := make([]api.Timeseries, count)\n\tfor i := range series {\n\t\tseries[i] = list.Series[array.index[i]]\n\t}\n\n\treturn api.SeriesList{\n\t\tSeries: series,\n\t\tTimerange: list.Timerange,\n\t}\n}", "title": "" }, { "docid": "7dedfb7cc55b837e075180802cd8d348", "score": "0.5332396", "text": "func (s *Stream) Filter(f func(interface{}) bool, threads ...int) *Stream {\n\ts.updateCores(threads...)\n\ts.filters = append(s.filters, f)\n\treturn s\n}", "title": "" }, { "docid": "3519cb1418f69b6c8ff314c3cbf8f94b", "score": "0.532912", "text": "func (n *nodeList) Filter(filter func(NodeDetails) bool) (nodes []NodeDetails) {\n\tn.Lock()\n\tnodes = make([]NodeDetails, 0, len(n.nodes))\n\tfor _, v := range n.nodes {\n\t\tif filter(v) {\n\t\t\tnodes = append(nodes, v)\n\t\t}\n\t}\n\tn.Unlock()\n\treturn\n}", "title": "" }, { "docid": "adc623cb11cba0025a2248afe4391f2f", "score": "0.5325338", "text": "func (ui *Filtergridlist) Filter() {\n\tl := []*duit.Gridrow{}\n\tfor _, row := range ui.Rows {\n\t\tif ui.Match(row) {\n\t\t\tl = append(l, row)\n\t\t}\n\t}\n\tui.Gridlist.Rows = l\n\tui.dui.MarkLayout(ui)\n}", "title": "" }, { "docid": "818a673582217fa84501aef2517c5e64", "score": "0.53087074", "text": "func (ListBulkImportJobsFilter) Values() []ListBulkImportJobsFilter {\n\treturn []ListBulkImportJobsFilter{\n\t\t\"ALL\",\n\t\t\"PENDING\",\n\t\t\"RUNNING\",\n\t\t\"CANCELLED\",\n\t\t\"FAILED\",\n\t\t\"COMPLETED_WITH_FAILURES\",\n\t\t\"COMPLETED\",\n\t}\n}", "title": "" }, { "docid": "a37aafbd6a9c0b5cf1ac8a10266ab8b0", "score": "0.530706", "text": "func (l ProjectItemFilterActive) Filter() []ProjectItem {\n\tnewList := make([]ProjectItem, 0, len(l))\n\tfor _, item := range []ProjectItem(l) {\n\t\tif item.Active {\n\t\t\tnewList = append(newList, item)\n\t\t}\n\t}\n\treturn newList\n}", "title": "" }, { "docid": "f62f927c51ddd5455af6453de6e2d801", "score": "0.5305139", "text": "func (slice StringSlice) Select(filter StringPredicate) (result StringSlice) {\n\tfor _, s := range slice {\n\t\tif filter(s) {\n\t\t\tresult = append(result, s)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "d14bf9e0633689978da81b63ab591b2c", "score": "0.53007174", "text": "func FilterMatch(it interface{}, filters []model.Filter) bool {\n\tfor _, filter := range filters {\n\t\tif !filter.Eval(it) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "e8fc720649ce3b4400d7f82d7fc7d312", "score": "0.52997875", "text": "func (c GetterConfigs) Filter(t string) (filtered GetterConfigs) {\n\tfor _, config := range c {\n\t\tif config.Type == t {\n\t\t\tfiltered = append(filtered, config)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "63de0c387911eefa936647ab9f0beca0", "score": "0.5287823", "text": "func Filter(f func(c Card) bool) func([]Card) []Card {\n\treturn func(cards []Card) []Card {\n\t\tvar ret []Card\n\t\tfor _, card := range cards {\n\t\t\tif !f(card) {\n\t\t\t\tret = append(ret, card)\n\t\t\t}\n\t\t}\n\t\treturn ret\n\t}\n}", "title": "" }, { "docid": "7680dcd047267f64d6a493b735605f6b", "score": "0.52837497", "text": "func (set UintSet) Filter(p func(uint) bool) UintSet {\n\tresult := NewUintSet()\n\tfor v := range set {\n\t\tif p(v) {\n\t\t\tresult[v] = struct{}{}\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "fc993aab383878cf0d90025e2e096d43", "score": "0.5281921", "text": "func (s *Silencer) Filter(l AlertLabelSets) AlertLabelSets {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tout := l\n\tfor _, sc := range s.Silences {\n\t\tunsilenced := AlertLabelSets{}\n\t\tfor _, labels := range out {\n\t\t\tif !sc.Matches(labels) {\n\t\t\t\tunsilenced = append(unsilenced, labels)\n\t\t\t}\n\t\t}\n\t\tout = unsilenced\n\t}\n\treturn out\n}", "title": "" }, { "docid": "480a42f276dd9fdb1695fd7dd4348968", "score": "0.52794254", "text": "func filterValues(values []Value, m Matcher) []Value {\n\tif len(values) == 0 {\n\t\treturn values\n\t}\n\tkept := []Value{}\n\tfor i, v := range values {\n\t\tif m(v.Source) {\n\t\t\tcontinue\n\t\t}\n\t\tif len(kept) > 0 {\n\t\t\t// Apply the account change relatively to kept values\n\t\t\tdelta := v.Value - values[i-1].Value\n\t\t\tv.Value = kept[len(kept)-1].Value + delta\n\t\t}\n\t\tkept = append(kept, v)\n\t}\n\treturn kept\n}", "title": "" }, { "docid": "f39b0aa482e93248177cd3305f6fc6bd", "score": "0.5276778", "text": "func (self *TDataSet) Filter(field string, values []interface{}, inverse ...bool) *TDataSet {\r\n\tif field == \"\" || values == nil {\r\n\t\treturn nil\r\n\t}\r\n\r\n\tinv := false\r\n\tif len(inverse) > 0 {\r\n\t\tinv = inverse[0]\r\n\t}\r\n\r\n\tnewDataSet := NewDataSet()\r\n\tfor _, rec := range self.Data {\r\n\t\ti := rec.GetFieldIndex(field)\r\n\t\tval := rec.get(i, false)\r\n\t\tif inv && utils.IdxOfItfs(val, values...) == -1 {\r\n\t\t\tnewDataSet.AppendRecord(rec)\r\n\t\t} else if !inv {\r\n\t\t\tnewDataSet.AppendRecord(rec)\r\n\t\t}\r\n\t}\r\n\r\n\treturn newDataSet\r\n}", "title": "" }, { "docid": "cca91400f546caac0494a8ef5a2cd643", "score": "0.5271165", "text": "func (s *set) filter(filter map[int]struct{}) {\n\tfor element := range filter {\n\t\tdelete(s.uncoveredElements, element)\n\t}\n}", "title": "" } ]
096be3b95ab49368f6c1b5027e94aa52
NewFullyQualifiedTEIDNetIP creates a new FullyQualifiedTEID IE from net.IP instead of string.
[ { "docid": "631cca381879449e4f0bd1cfdde7571a", "score": "0.80052054", "text": "func NewFullyQualifiedTEIDNetIP(ifType uint8, teid uint32, v4, v6 net.IP) *IE {\n\tv := NewFullyQualifiedTEIDFields(ifType, teid, v4, v6)\n\tb, err := v.Marshal()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn New(FullyQualifiedTEID, 0x00, b)\n}", "title": "" } ]
[ { "docid": "aa1851ae6f0f914697505ae6b93018b6", "score": "0.6941333", "text": "func NewFullyQualifiedTEID(ifType uint8, teid uint32, v4, v6 string) *IE {\n\tv := NewFullyQualifiedTEIDFields(ifType, teid, net.ParseIP(v4), net.ParseIP(v6))\n\tb, err := v.Marshal()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn New(FullyQualifiedTEID, 0x00, b)\n}", "title": "" }, { "docid": "98e721887431274224f2812e2325d4ab", "score": "0.6215709", "text": "func NewIp(address string) *Entity { return NewEntity(address, \"ip\") }", "title": "" }, { "docid": "78cf5101ac513f41b2e57d9808f9d257", "score": "0.6164063", "text": "func newIPNet(ipNet *net.IPNet) *net.IPNet {\n\tmask := make(net.IPMask, len(ipNet.Mask))\n\tcopy(mask, ipNet.Mask)\n\treturn &net.IPNet{\n\t\tIP: newIP(ipNet.IP),\n\t\tMask: mask,\n\t}\n}", "title": "" }, { "docid": "8f2668ee25b6908b0ed297f87ffd0ee7", "score": "0.5749333", "text": "func newIP(ip net.IP) net.IP {\n\tdup := make(net.IP, len(ip))\n\tcopy(dup, ip)\n\treturn dup\n}", "title": "" }, { "docid": "d8a16d73ae783ccbb4aa544d1bac0bcc", "score": "0.57457405", "text": "func NewNodeID(ipv4, ipv6, fqdn string) *IE {\n\tvar p []byte\n\n\tswitch {\n\tcase ipv4 != \"\":\n\t\tp = make([]byte, 5)\n\t\tp[0] = NodeIDIPv4Address\n\t\tcopy(p[1:], net.ParseIP(ipv4).To4())\n\tcase ipv6 != \"\":\n\t\tp = make([]byte, 17)\n\t\tp[0] = NodeIDIPv6Address\n\t\tcopy(p[1:], net.ParseIP(ipv6).To16())\n\tcase fqdn != \"\":\n\t\tp = make([]byte, 2+len([]byte(fqdn)))\n\t\tp[0] = NodeIDFQDN\n\t\tcopy(p[1:], utils.EncodeFQDN(fqdn))\n\tdefault: // all params are empty\n\t\treturn nil\n\t}\n\n\treturn New(NodeID, p)\n}", "title": "" }, { "docid": "2e645b7fbbcfa8455d39cdcce7886bde", "score": "0.5654516", "text": "func NewFullyQualifiedDomainName(fqdn string) *IE {\n\treturn newStringIE(FullyQualifiedDomainName, fqdn)\n}", "title": "" }, { "docid": "05df5a39f930ef420d59de2f54d85947", "score": "0.5594407", "text": "func Inet_ntoa(ip uint) net.IP {\n\tvar bytes [4]byte\n\tbytes[0] = byte(ip & 0xFF)\n\tbytes[1] = byte((ip >> 8) & 0xFF)\n\tbytes[2] = byte((ip >> 16) & 0xFF)\n\tbytes[3] = byte((ip >> 24) & 0xFF)\n\n\treturn net.IPv4(bytes[3], bytes[2], bytes[1], bytes[0])\n}", "title": "" }, { "docid": "2959792c19292a01c565c64396c45265", "score": "0.5583653", "text": "func NewNet() *Net {\n\treturn &Net{NewTrie()}\n}", "title": "" }, { "docid": "480a891bd6374a5079497722423adf2d", "score": "0.5493104", "text": "func NewFullyQualifiedTEIDFields(ifType uint8, teid uint32, v4, v6 net.IP) *FullyQualifiedTEIDFields {\n\tf := &FullyQualifiedTEIDFields{\n\t\tInterfaceType: ifType,\n\t\tTEIDGREKey: teid,\n\t}\n\n\tif v := v4.To4(); v != nil {\n\t\tf.Flags |= 0x80\n\t\tf.IPv4Address = v\n\t}\n\tif v := v6.To16(); v != nil {\n\t\tf.Flags |= 0x40\n\t\tf.IPv6Address = v\n\t}\n\n\treturn f\n}", "title": "" }, { "docid": "92a61bc3be54b877949617bca22a19af", "score": "0.54539716", "text": "func New(netIface net.Interface) (*Iface, error) {\n\n\tipv4s, ipv6s, n := expand(&netIface)\n\n\t// get IPv4 address and network\n\tvar v4Addr, v4Mask, v4Net string\n\tif len(ipv4s) > 0 {\n\t\taddr, network, err := net.ParseCIDR(ipv4s[0])\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\t}\n\t\tif addr != nil {\n\t\t\tv4Addr = addr.String()\n\t\t\tv4Mask = dotted(network.Mask)\n\t\t\tv4Net = network.String()\n\t\t}\n\t}\n\tvar ipv6 string\n\tif len(ipv6s) > 0 {\n\t\tipv6 = ipv6s[0]\n\t}\n\n\treturn &Iface{\n\t\tAddressCount: n,\n\t\tHardwareAddr: netIface.HardwareAddr.String(),\n\t\tIPv4Addr: v4Addr,\n\t\tIPv4Mask: v4Mask,\n\t\tIPv4Network: v4Net,\n\t\tIPv6Addr: ipv6,\n\t\tMTU: strconv.Itoa(netIface.MTU),\n\t\tName: netIface.Name,\n\t}, nil\n}", "title": "" }, { "docid": "0f5afff3ee1d502d51c0f4587d1d8b56", "score": "0.5386929", "text": "func New() IP {\n\treturn &cniIP{}\n}", "title": "" }, { "docid": "ed1b4150ad18ef76bd263214e536902b", "score": "0.5300336", "text": "func NewIPAddr(addr string) (ipaddr IPAddr, err error) {\n\tips, port, err := iputil.SplitAddr(addr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// TODO -- support ipv6\n\tipb := net.ParseIP(ips).To4()\n\tif ipb == nil {\n\t\terr = errors.New(\"Ignoring IPv6 address\")\n\t\treturn\n\t}\n\n\tip := binary.BigEndian.Uint32(ipb)\n\tipaddr.IP = ip\n\tipaddr.Port = port\n\treturn\n}", "title": "" }, { "docid": "124e058f63c1561c08fdceefdb0b49e8", "score": "0.5283159", "text": "func NewIp(ipIp string, ) *Ip {\n\tthis := Ip{}\n\tthis.IpIp = ipIp\n\treturn &this\n}", "title": "" }, { "docid": "7066df030fa70fe1414908166fbca303", "score": "0.52724874", "text": "func NewFTEID(flags uint8, teid uint32, v4, v6 net.IP, chid uint8) *IE {\n\tfields := NewFTEIDFields(flags, teid, v4, v6, chid)\n\n\tb, err := fields.Marshal()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn New(FTEID, b)\n}", "title": "" }, { "docid": "b0d5cdca54122cafa52ba7718597a6e9", "score": "0.5252439", "text": "func NewIPAddressOp(caller APICaller) IPAddressAPI {\n\treturn GetClientFactoryFunc(\"IPAddress\")(caller).(IPAddressAPI)\n}", "title": "" }, { "docid": "da95a33b43bfed3ef199a49f14093a9a", "score": "0.52407026", "text": "func NewID(ip string, port uint16) string {\n\t// prevent double square brackets\n\tip = strings.ReplaceAll(ip, \"[\", \"\")\n\tip = strings.ReplaceAll(ip, \"]\", \"\")\n\treturn net.JoinHostPort(ip, strconv.FormatUint(uint64(port), 10))\n}", "title": "" }, { "docid": "db01d1723109b7a5618392abf666fe1b", "score": "0.5218127", "text": "func NewIP(whitelistStrings []string, insecure bool) (*IP, error) {\n\tif len(whitelistStrings) == 0 && !insecure {\n\t\treturn nil, errors.New(\"no whiteListsNet provided\")\n\t}\n\n\tip := IP{}\n\n\tif !insecure {\n\t\tfor _, whitelistString := range whitelistStrings {\n\t\t\tipAddr := net.ParseIP(whitelistString)\n\n\t\t\tif ipAddr != nil {\n\t\t\t\tip.whiteListsIPs = append(ip.whiteListsIPs, &ipAddr)\n\t\t\t} else {\n\t\t\t\t_, whitelist, err := net.ParseCIDR(whitelistString)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"parsing CIDR whitelist %s: %v\", whitelist, err)\n\t\t\t\t}\n\t\t\t\tip.whiteListsNet = append(ip.whiteListsNet, whitelist)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &ip, nil\n}", "title": "" }, { "docid": "951f0cbfee3e52535a6b50183cd0666d", "score": "0.5183153", "text": "func normalizeIPNet(n string) *cnet.IPNet {\n\tif n == \"\" {\n\t\treturn nil\n\t}\n\t_, ipn, err := cnet.ParseCIDROrIP(n)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn ipn.Network()\n}", "title": "" }, { "docid": "7eae78d2e8546a134671bae9c16fa4c0", "score": "0.51651037", "text": "func NewIPNetTree() *IPNetTree {\n\treturn &IPNetTree{\n\t\tbtree.New(5),\n\t}\n}", "title": "" }, { "docid": "5798cddffb2016ebca71bbcbfd7997aa", "score": "0.51422083", "text": "func NewNetworkEUI(ma MA, netID uint32) EUI {\n\treturn ma.Combine(EUIFromUint64(uint64(netID) << 25))\n}", "title": "" }, { "docid": "98b19db9eee4ae38ca6734787f050664", "score": "0.51229775", "text": "func newNetAddress(addr net.Addr, services uint64) (*p2p.NetAddress, error) {\n\t// addr will be a net.TCPAddr when not using a proxy.\n\tif tcpAddr, ok := addr.(*net.TCPAddr); ok {\n\t\tip := tcpAddr.IP\n\t\tport := uint16(tcpAddr.Port)\n\t\tna := p2p.NewNetAddressIPPort(ip, port, services)\n\t\treturn na, nil\n\t}\n\n\t// For the most part, addr should be one of the two above cases, but\n\t// to be safe, fall back to trying to parse the information from the\n\t// address string as a last resort.\n\thost, portStr, err := net.SplitHostPort(addr.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tip := net.ParseIP(host)\n\tport, err := strconv.ParseUint(portStr, 10, 16)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tna := p2p.NewNetAddressIPPort(ip, uint16(port), services)\n\treturn na, nil\n}", "title": "" }, { "docid": "ef5d20cb186aa609ccd8dfe562472458", "score": "0.5098532", "text": "func NewNetwork(ipNet net.IPNet) Network {\n\treturn Network{\n\t\tIPNet: ipNet,\n\t\tNumber: NewNetworkNumber(ipNet.IP),\n\t\tMask: NetworkNumberMask(NewNetworkNumber(net.IP(ipNet.Mask))),\n\t}\n}", "title": "" }, { "docid": "91d7b734b9473777bb4ed69f53f6c54c", "score": "0.5082429", "text": "func NewFloatingIp(ctx *pulumi.Context,\n\tname string, args *FloatingIpArgs, opts ...pulumi.ResourceOption) (*FloatingIp, error) {\n\tif args == nil || args.Region == nil {\n\t\treturn nil, errors.New(\"missing required argument 'Region'\")\n\t}\n\tif args == nil {\n\t\targs = &FloatingIpArgs{}\n\t}\n\tvar resource FloatingIp\n\terr := ctx.RegisterResource(\"digitalocean:index/floatingIp:FloatingIp\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "0040e9f39af4e64ca4750df663433a9f", "score": "0.5053674", "text": "func NewIpflow(src, dest string) *Edge { return NewEdge(src, dest, \"ipflow\") }", "title": "" }, { "docid": "71a5926d1b65cdff8f0edcb278937268", "score": "0.5043102", "text": "func NewTestnet() Testnet {\n\treusableIsUp := reusableNetUp()\n\tlaunchReusable := os.Getenv(startForReUseEnv) == \"1\"\n\tks, err := NewKeystore(launchReusable, reusableIsUp)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tchainID := LocalNetReuse\n\tif !launchReusable && !reusableIsUp {\n\t\tchainID = fmt.Sprintf(\"localnet-%s\", tmrand.Str(6))\n\t}\n\n\treturn Testnet{\n\t\tKeystore: ks,\n\t\tchainID: chainID,\n\t}\n}", "title": "" }, { "docid": "089a01a72485e5f7c97e9aad8704f23d", "score": "0.49724013", "text": "func NewIPAddr(addr string) (IPAddr, error) {\n\tipv4Addr, err := NewIPv4Addr(addr)\n\tif err == nil {\n\t\treturn ipv4Addr, nil\n\t}\n\n\tipv6Addr, err := NewIPv6Addr(addr)\n\tif err == nil {\n\t\treturn ipv6Addr, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"invalid IPAddr %v\", addr)\n}", "title": "" }, { "docid": "78e155ac3feb76213c05512966917f72", "score": "0.49716613", "text": "func newNetNamespace(c *Client) *netNamespace {\n\treturn &netNamespace{\n\t\tr: c,\n\t}\n}", "title": "" }, { "docid": "693fefb3b97cac7e36a16fede2990774", "score": "0.4911614", "text": "func ParseInet(addr string) (*Inet, error) {\n\taddr_len := len(addr)\n\tif addr_len == 0 {\n\t\treturn nil, nil\n\t}\n\tif addr[0] == '[' && addr[addr_len-1] == ']' {\n\t\taddr = addr[1 : addr_len-1]\n\t}\n\n\tip, cidr, err := net.ParseCIDR(addr)\n\tvar mask net.IPMask\n\tif err != nil {\n\t\tip = net.ParseIP(addr)\n\t\tif ip == nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif v4 := ip.To4(); v4 != nil {\n\t\t\tmask = net.CIDRMask(32, 32)\n\t\t} else {\n\t\t\tmask = net.CIDRMask(128, 128)\n\t\t}\n\t} else {\n\t\tmask = cidr.Mask\n\t}\n\treturn &Inet{&net.IPNet{IP: ip, Mask: mask}}, nil\n}", "title": "" }, { "docid": "953cd158a521f7f3664d6d8cca341fe9", "score": "0.4889199", "text": "func NewNetwork(network string) Network {\n\treturn Network(network)\n}", "title": "" }, { "docid": "ed9db511742face501b466582dbe59e7", "score": "0.48775843", "text": "func NewInternetOp(caller APICaller) InternetAPI {\n\treturn GetClientFactoryFunc(\"Internet\")(caller).(InternetAPI)\n}", "title": "" }, { "docid": "ed9db511742face501b466582dbe59e7", "score": "0.48775843", "text": "func NewInternetOp(caller APICaller) InternetAPI {\n\treturn GetClientFactoryFunc(\"Internet\")(caller).(InternetAPI)\n}", "title": "" }, { "docid": "f975a09656a94239a651e1d2b8ce671e", "score": "0.48743543", "text": "func newENILimit(instanceType string, eniLimit int64, ipLimit int64) ENILimit {\n\treturn ENILimit{\n\t\tInstanceType: \"\\\"\" + instanceType + \"\\\":\",\n\t\tENILimit: eniLimit,\n\t\tIPLimit: ipLimit,\n\t}\n}", "title": "" }, { "docid": "52cad6eee836ab5e079defbef4eced74", "score": "0.48487577", "text": "func NidFromString(inString string) (*Nid, error) {\n\tnidRe := regexp.MustCompile(`^(.+)@(\\w+[^\\d*])(\\d*)$`)\n\tmatches := nidRe.FindStringSubmatch(inString)\n\tif len(matches) < 3 {\n\t\treturn nil, errors.Errorf(\"Cannot parse NID from %q\", inString)\n\t}\n\n\taddress := matches[1]\n\tdriver := matches[2]\n\tvar driverInstance int\n\tif matches[3] != \"\" {\n\t\tvar err error\n\t\tdriverInstance, err = strconv.Atoi(matches[3])\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"driver instance number failed\")\n\t\t}\n\t}\n\n\tipRe := regexp.MustCompile(`^[\\.\\d]+`)\n\tif !ipRe.MatchString(address) {\n\t\t// Not an IP address or number; try to resolve it\n\t\tipAddrs, err := net.LookupIP(address)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"unable to resolve non-numeric address %q into an IP address\", address)\n\t\t}\n\n\t\t// Just take the first IPv4 address (LNet doesn't support IPv6)\n\t\tfor _, addr := range ipAddrs {\n\t\t\tif addr.To4() != nil {\n\t\t\t\taddress = addr.String()\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif initFunc, present := drivers[driver]; present {\n\t\traw, err := initFunc(address, driverInstance)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"nid init failed\")\n\t\t}\n\t\treturn &Nid{raw: raw}, nil\n\t}\n\treturn nil, errors.Errorf(\"Unsupported LND: %s\", driver)\n}", "title": "" }, { "docid": "71f1b9d8b1087f716f22ef17bde5e1de", "score": "0.48459104", "text": "func newIAAddr(ia *IANA, ip net.IP, w ResponseSender, r *Request) error {\n\t// Send IPv6 address with 60 second preferred lifetime,\n\t// 90 second valid lifetime, no extra options\n\tiaaddr, err := NewIAAddr(ip, 60*time.Second, 90*time.Second, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Add IAAddr inside IANA, add IANA to options\n\t_ = ia.Options.Add(OptionIAAddr, iaaddr)\n\t_ = w.Options().Add(OptionIANA, ia)\n\n\t// Advertise address to soliciting clients\n\tlog.Printf(\"advertising IP: %s\", ip)\n\t_, err = w.Send(MessageTypeAdvertise)\n\treturn err\n}", "title": "" }, { "docid": "c8f813d8128755c9d2701f3fd071da38", "score": "0.48440966", "text": "func newTargetIp(targetIP []string) (prefixes []models.Prefix, err error) {\n\tprefixes = make([]models.Prefix, len(targetIP))\n\n\tfor i, ipaddr := range targetIP {\n\t\tip := net.ParseIP(ipaddr)\n\t\tif ip == nil {\n\t\t\treturn nil, errors.New(fmt.Sprintf(\"scope.TargetIp format error. input: %s\", ipaddr))\n\t\t}\n\t\tswitch {\n\t\tcase ip.To4() != nil: // ipv4\n\t\t\tprefix, err := models.NewPrefix(ipaddr + common.IPV4_HOST_PREFIX_LEN)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tprefixes[i] = prefix\n\t\tdefault: // ipv6\n\t\t\tprefix, err := models.NewPrefix(ipaddr + common.IPV6_HOST_PREFIX_LEN)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tprefixes[i] = prefix\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "3ace5b62cda8b3e65840bc3b56aae403", "score": "0.48098063", "text": "func ParseIP(s string) IP {\n\treturn IP([]byte(s))\n}", "title": "" }, { "docid": "f242ac2f8894e54a9ba6bb907ad8b765", "score": "0.47732827", "text": "func (t *NetworkInstance_Mpls_SignalingProtocols_RsvpTe) NewInterface(InterfaceId string) (*NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface)\n\t}\n\n\tkey := InterfaceId\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface{\n\t\tInterfaceId: &InterfaceId,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "0b64a455dfe072fd4ba9bc28d13a3865", "score": "0.47600615", "text": "func FromIP(ip net.IP) (*Multiaddr, error) {\n\tswitch {\n\tcase ip.To4() != nil:\n\t\treturn NewMultiaddr(\"/ip4/\" + ip.String())\n\tcase ip.To16() != nil:\n\t\treturn NewMultiaddr(\"/ip6/\" + ip.String())\n\tdefault:\n\t\treturn nil, errIncorrectNetAddr\n\t}\n}", "title": "" }, { "docid": "0713aac2f5a95cda9407dd2b219b3a77", "score": "0.47564462", "text": "func Inet(field string) string {\n\treturn InetAs(field, field)\n}", "title": "" }, { "docid": "8ac68a2298df7b9272058e8a66c0c0de", "score": "0.4755844", "text": "func InetNtoA(sum uint32) string {\n\tip := make(net.IP, net.IPv4len)\n\tip[0] = byte((sum >> 24) & 0xFF)\n\tip[1] = byte((sum >> 16) & 0xFF)\n\tip[2] = byte((sum >> 8) & 0xFF)\n\tip[3] = byte(sum & 0xFF)\n\treturn ip.String()\n}", "title": "" }, { "docid": "121369af89a070f9ad903e5c68a45398", "score": "0.47479913", "text": "func NewNetDefaultIPArgTest() testutils.Test {\n\tdoTest := func(netArg, expectedIP string, t *testing.T) {\n\t\tctx := testutils.NewRktRunCtx()\n\t\tdefer ctx.Cleanup()\n\n\t\tappCmd := \"--exec=/inspect -- --print-ipv4=eth0\"\n\t\tcmd := fmt.Sprintf(\"%s --debug --insecure-options=image run --net=\\\"%s\\\" --mds-register=false %s %s\",\n\t\t\tctx.Cmd(), netArg, getInspectImagePath(), appCmd)\n\t\tchild := spawnOrFail(t, cmd)\n\t\tdefer waitOrFail(t, child, 0)\n\n\t\texpectedRegex := `IPv4: (\\d+\\.\\d+\\.\\d+\\.\\d+)`\n\t\tresult, out, err := expectRegexTimeoutWithOutput(child, expectedRegex, 30*time.Second)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error: %v\\nOutput: %v\", err, out)\n\t\t\treturn\n\t\t}\n\n\t\tcontainerIP := result[1]\n\t\tif expectedIP != containerIP {\n\t\t\tt.Fatalf(\"--net=%s setting IP failed: Got %q but expected %q\", netArg, containerIP, expectedIP)\n\t\t}\n\t}\n\treturn testutils.TestFunc(func(t *testing.T) {\n\t\tdoTest(\"default:IP=172.16.28.123\", \"172.16.28.123\", t)\n\t\tdoTest(\"default-restricted:IP=172.17.42.42\", \"172.17.42.42\", t)\n\t})\n}", "title": "" }, { "docid": "ae3a76e936c6679d157ae494d96dc707", "score": "0.4744773", "text": "func newElasticIP(i resource.Instance, prov provider.DataCenter) (*elasticIP, error) {\n\tlog.Debug(\"Initializing ElasticIP for '%s'\", i.Name())\n\n\tp := &elasticIP{}\n\n\tvar err error\n\tp.providerElasticIP, err = prov.NewElasticIP(p, i)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, nil\n}", "title": "" }, { "docid": "14d35a825b2c9d1ef2009c5c521e4cc2", "score": "0.47198793", "text": "func IntranetIP() (ip string, err error) {\n\tips, err := IntranetIPArray()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(ips) == 0 {\n\t\treturn \"\", errors.New(\"no intranet ip found\")\n\t}\n\treturn ips[0], nil\n}", "title": "" }, { "docid": "8c202042a7513f4a207b03098750270f", "score": "0.4698866", "text": "func AddressFromString(ip string) Address {\n\treturn AddressFromNetIP(net.ParseIP(ip))\n}", "title": "" }, { "docid": "ebb9719eba412bcb6a9d40e88de6536f", "score": "0.4692581", "text": "func (t *IPAddress) Name() string { return \"IpAddress\" }", "title": "" }, { "docid": "554bd20d8aa845f36bd106291ea970aa", "score": "0.4689377", "text": "func NewNetwork(name string) (testcontainers.Network, error) {\n\tctx := context.Background()\n\tdp, err := testcontainers.NewDockerProvider()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnet, err := dp.CreateNetwork(ctx, testcontainers.NetworkRequest{\n\t\tName: name,\n\t\tCheckDuplicate: true,\n\t})\n\treturn net, err\n}", "title": "" }, { "docid": "16b44a6b0f235cd11ff4c1ab2cde09fb", "score": "0.4688944", "text": "func newIPTablesTracer(t *testing.T, ipt *iptablestest.FakeIPTables, nodeIP string) *iptablesTracer {\n\treturn &iptablesTracer{\n\t\tipt: ipt,\n\t\tnodeIP: nodeIP,\n\t\tt: t,\n\t}\n}", "title": "" }, { "docid": "5bd0e37492b3a088f8f3949845c027fd", "score": "0.46861228", "text": "func newQaddr(a string) qaddr { return qaddr{a: a, t: time.Now()} }", "title": "" }, { "docid": "f6dc899699ac8f26e1a66dfff480f833", "score": "0.46816716", "text": "func NewNetworkAccessRoot()(*NetworkAccessRoot) {\n m := &NetworkAccessRoot{\n Entity: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "e6f53e7316fe1526e607e018ef5cd207", "score": "0.46767998", "text": "func NewNetHostTest() testutils.Test {\n\treturn testutils.TestFunc(func(t *testing.T) {\n\t\ttestImageArgs := []string{\"--exec=/inspect --print-netns\"}\n\t\ttestImage := patchTestACI(\"rkt-inspect-networking.aci\", testImageArgs...)\n\t\tdefer os.Remove(testImage)\n\n\t\tctx := testutils.NewRktRunCtx()\n\t\tdefer ctx.Cleanup()\n\n\t\tcmd := fmt.Sprintf(\"%s --net=host --debug --insecure-options=image run --mds-register=false %s\", ctx.Cmd(), testImage)\n\t\tchild := spawnOrFail(t, cmd)\n\t\tctx.RegisterChild(child)\n\t\tdefer waitOrFail(t, child, 0)\n\n\t\texpectedRegex := `NetNS: (net:\\[\\d+\\])`\n\t\tresult, out, err := expectRegexWithOutput(child, expectedRegex)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error: %v\\nOutput: %v\", err, out)\n\t\t}\n\n\t\tns, err := os.Readlink(\"/proc/self/ns/net\")\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Cannot evaluate NetNS symlink: %v\", err)\n\t\t}\n\n\t\tif nsChanged := ns != result[1]; nsChanged {\n\t\t\tt.Fatalf(\"container left host netns\")\n\t\t}\n\t})\n}", "title": "" }, { "docid": "34038f52da9b01ae6f07db0b0bb8472b", "score": "0.4676635", "text": "func FromIP(ip net.IP) (ma.Multiaddr, error) {\n\treturn FromIPAndZone(ip, \"\")\n}", "title": "" }, { "docid": "c105fdcba89ea84bf261af4eb0016605", "score": "0.46643412", "text": "func (p *Protocol) newAddr(ctx context.Context, msg *netlink.Message, ms *netlink.MessageSet) *syserr.Error {\n\tstack := inet.StackFromContext(ctx)\n\tif stack == nil {\n\t\t// No network stack.\n\t\treturn syserr.ErrProtocolNotSupported\n\t}\n\n\tvar ifa linux.InterfaceAddrMessage\n\tattrs, ok := msg.GetData(&ifa)\n\tif !ok {\n\t\treturn syserr.ErrInvalidArgument\n\t}\n\n\tfor !attrs.Empty() {\n\t\tahdr, value, rest, ok := attrs.ParseFirst()\n\t\tif !ok {\n\t\t\treturn syserr.ErrInvalidArgument\n\t\t}\n\t\tattrs = rest\n\n\t\t// NOTE: A netlink message will contain multiple header attributes.\n\t\t// Both the IFA_ADDRESS and IFA_LOCAL attributes are typically sent\n\t\t// with IFA_ADDRESS being a prefix address and IFA_LOCAL being the\n\t\t// local interface address. We add the local interface address here\n\t\t// and ignore the IFA_ADDRESS.\n\t\tswitch ahdr.Type {\n\t\tcase linux.IFA_LOCAL:\n\t\t\terr := stack.AddInterfaceAddr(int32(ifa.Index), inet.InterfaceAddr{\n\t\t\t\tFamily: ifa.Family,\n\t\t\t\tPrefixLen: ifa.PrefixLen,\n\t\t\t\tFlags: ifa.Flags,\n\t\t\t\tAddr: value,\n\t\t\t})\n\t\t\tif linuxerr.Equals(linuxerr.EEXIST, err) {\n\t\t\t\tflags := msg.Header().Flags\n\t\t\t\tif flags&linux.NLM_F_EXCL != 0 {\n\t\t\t\t\treturn syserr.ErrExists\n\t\t\t\t}\n\t\t\t} else if err != nil {\n\t\t\t\treturn syserr.ErrInvalidArgument\n\t\t\t}\n\t\tcase linux.IFA_ADDRESS:\n\t\tdefault:\n\t\t\treturn syserr.ErrNotSupported\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "845dd195bc57027eda8d7523f5a04347", "score": "0.4660472", "text": "func newLocalNode(addr *net.TCPAddr) *localNode {\n\treturn newLocalNodeID(addr, addrToID(addr))\n}", "title": "" }, { "docid": "44e9d42d7361ccd28dddda0c310b441a", "score": "0.46587628", "text": "func New(ifname string, cfg Config) (Transport, error) {\n\tintf, e := net.InterfaceByName(ifname)\n\tif e != nil {\n\t\treturn nil, fmt.Errorf(\"net.InterfaceByName(%s) %w\", ifname, e)\n\t}\n\tif cfg.Local.Empty() {\n\t\tcfg.Local.HardwareAddr = intf.HardwareAddr\n\t}\n\tif cfg.Remote.Empty() {\n\t\tcfg.Remote.HardwareAddr = packettransport.MulticastAddressNDN\n\t}\n\tcfg.MTU = intf.MTU\n\n\th, e := afpacket.NewTPacket()\n\tif e != nil {\n\t\treturn nil, fmt.Errorf(\"afpacket.NewTPacket() %w\", e)\n\t}\n\n\ttr := &transport{\n\t\th: h,\n\t\tintf: *intf,\n\t}\n\tif e = tr.prepare(cfg.Locator); e != nil {\n\t\treturn nil, e\n\t}\n\n\ttr.Transport, e = packettransport.New(h, cfg.Config)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\ttr.Transport.OnStateChange(func(st l3.TransportState) {\n\t\tif st == l3.TransportClosed {\n\t\t\ttr.h.Close()\n\t\t}\n\t})\n\treturn tr, nil\n}", "title": "" }, { "docid": "9aa50970006d0588c991d23f49e556b7", "score": "0.46578035", "text": "func New(s string, forceFQDN bool) (hostport HostPort, err error) {\n\thostport.Port = NoPort\n\n\tvar portString string\n\thostport.Host, portString, err = net.SplitHostPort(s)\n\tif err != nil {\n\t\treturn\n\t}\n\thostport.Host, err = NormalizeHost(hostport.Host, forceFQDN)\n\tif err != nil {\n\t\treturn\n\t}\n\thostport.Port, err = NormalizePort(portString)\n\treturn\n}", "title": "" }, { "docid": "fafa50218c3a3bc56fdb0ac37a4f2dae", "score": "0.46485993", "text": "func IntranetIP() (string, error) {\n\tifaces, err := net.Interfaces()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tfor _, iface := range ifaces {\n\t\tif iface.Flags&net.FlagUp == 0 {\n\t\t\tcontinue // interface down\n\t\t}\n\t\tif iface.Flags&net.FlagLoopback != 0 {\n\t\t\tcontinue // loopback interface\n\t\t}\n\t\taddrs, err := iface.Addrs()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tfor _, addr := range addrs {\n\t\t\tvar ip net.IP\n\t\t\tswitch v := addr.(type) {\n\t\t\tcase *net.IPNet:\n\t\t\t\tip = v.IP\n\t\t\tcase *net.IPAddr:\n\t\t\t\tip = v.IP\n\t\t\t}\n\t\t\tif ip == nil || ip.IsLoopback() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tip = ip.To4()\n\t\t\tif ip == nil {\n\t\t\t\tcontinue // not an ipv4 address\n\t\t\t}\n\t\t\treturn ip.String(), nil\n\t\t}\n\t}\n\treturn \"\", errors.New(\"do you connected to the network? \")\n}", "title": "" }, { "docid": "1b5ec1ad8fc479cd9c955ff5967e8d5d", "score": "0.46405575", "text": "func NewIPify() *IPify {\n\treturn &IPify{\n\t\tURL: IPifyURL,\n\t}\n}", "title": "" }, { "docid": "76701c5f5452497739cb06c61c04f59b", "score": "0.4627871", "text": "func NewIPNetGenerator(cidr string) (*IPNetGenerator, error) {\n\t_, ipNet, err := net.ParseCIDR(cidr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tones, bits := ipNet.Mask.Size()\n\n\tnewIP := make(net.IP, len(ipNet.IP))\n\tcopy(newIP, ipNet.IP)\n\n\treturn &IPNetGenerator{\n\t\tIPNet: ipNet,\n\t\tcount: 1 << uint8(bits-ones),\n\t\tcurrent: newIP,\n\t}, nil\n}", "title": "" }, { "docid": "a8277b74eeb978b9e0bd3d1bafc6d84e", "score": "0.4624216", "text": "func createRandomIp() string {\n\tip := fmt.Sprintf(\"%d.%d.%d.%d\", rand.Intn(255), rand.Intn(255), rand.Intn(255), rand.Intn(255))\n\treturn ip\n}", "title": "" }, { "docid": "67bf6d62e7b54baa81b627c32d4b5c49", "score": "0.46141526", "text": "func newOctetString(msg string) (*C.OCTET_STRING_t, error) {\n\tmsgBytes := C.CBytes([]byte(msg))\n\toctStrC := C.OCTET_STRING_t{\n\t\tbuf: (*C.uchar)(msgBytes),\n\t\tsize: C.ulong(len(msg)),\n\t}\n\treturn &octStrC, nil\n}", "title": "" }, { "docid": "b9432fc1fa334c81195bf7e802d39b0a", "score": "0.460642", "text": "func IpNetwork_NewServer(s IpNetwork_Server) *server.Server {\n\tc, _ := s.(server.Shutdowner)\n\treturn server.New(IpNetwork_Methods(nil, s), s, c)\n}", "title": "" }, { "docid": "0f71360c675ede2e7a85c5426f906b39", "score": "0.46034217", "text": "func FromIP(ip net.IP) (ma.Multiaddr, error) {\n\tswitch {\n\tcase ip.To4() != nil:\n\t\treturn ma.NewMultiaddr(\"/ip4/\" + ip.String())\n\tcase ip.To16() != nil:\n\t\treturn ma.NewMultiaddr(\"/ip6/\" + ip.String())\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"incorrect network addr conversion\")\n\t}\n}", "title": "" }, { "docid": "9122cff85b7c661df95d7eec916cd0d9", "score": "0.45979235", "text": "func newAuthAddr(addr net.Addr) string {\n\tif addr == nil {\n\t\treturn \"\"\n\t}\n\thost, _, _ := net.SplitHostPort(addr.String())\n\treturn host\n}", "title": "" }, { "docid": "6ab1545cbbc15f2a37ab47c2e00940ec", "score": "0.45962957", "text": "func ForeignIP(ip string) (*IPInfo, error) {\r\n\tif ip != \"\" {\r\n\t\tip += \"/\" + ip\r\n\t}\r\n\tresponse, err := http.Get(\"http://ipinfo.io\" + ip + \"/json\")\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\tdefer response.Body.Close()\r\n\r\n\tcontents, err := ioutil.ReadAll(response.Body)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\tvar ipinfo IPInfo\r\n\tif err := json.Unmarshal(contents, &ipinfo); err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn &ipinfo, nil\r\n}", "title": "" }, { "docid": "ed2751571900bcb6f844d29e38eda323", "score": "0.4591723", "text": "func NewKey(ip net.IP, mask net.IPMask, clusterID uint8) Key {\n\tresult := Key{}\n\n\tones, _ := mask.Size()\n\tif ip4 := ip.To4(); ip4 != nil {\n\t\tif mask == nil {\n\t\t\tones = net.IPv4len * 8\n\t\t}\n\t\tresult.Prefixlen = getPrefixLen(ones)\n\t\tresult.Family = bpf.EndpointKeyIPv4\n\t\tcopy(result.IP[:], ip4)\n\t} else {\n\t\tif mask == nil {\n\t\t\tones = net.IPv6len * 8\n\t\t}\n\t\tresult.Prefixlen = getPrefixLen(ones)\n\t\tresult.Family = bpf.EndpointKeyIPv6\n\t\tcopy(result.IP[:], ip)\n\t}\n\n\tresult.ClusterID = clusterID\n\n\treturn result\n}", "title": "" }, { "docid": "83ae2bce4c45dd1d1940308447d1d67f", "score": "0.4591719", "text": "func NewProtocol(raw string) (Protocol, error) {\n\tswitch {\n\tcase strings.EqualFold(protocolUDPStr, raw):\n\t\treturn ProtocolUDP, nil\n\tcase strings.EqualFold(protocolTCPStr, raw):\n\t\treturn ProtocolTCP, nil\n\tdefault:\n\t\treturn Protocol(Unknown), fmt.Errorf(\"unknown protocol: %s\", raw)\n\t}\n}", "title": "" }, { "docid": "547f8e6052a35a1dc526bd3ab40905e0", "score": "0.45834243", "text": "func NewMultiaddr(s string) (*Multiaddr, error) {\n\tb, err := stringToBytes(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Multiaddr{Bytes: b}, nil\n}", "title": "" }, { "docid": "c9a6a3dd2ea41aa36d94496a0b081886", "score": "0.4580923", "text": "func ExtranetIP() (ip string, err error) {\n\tdefer func() {\n\t\tif p := recover(); p != nil {\n\t\t\terr = fmt.Errorf(\"Get external IP error: %v \", p)\n\t\t} else if err != nil {\n\t\t\terr = errors.New(\"Get external IP error: \" + err.Error())\n\t\t}\n\t}()\n\tresp, err := http.Get(\"http://pv.sohu.com/cityjson?ie=utf-8\")\n\tif err != nil {\n\t\treturn\n\t}\n\tb, err := ioutil.ReadAll(resp.Body)\n\tresp.Body.Close()\n\tif err != nil {\n\t\treturn\n\t}\n\tidx := bytes.Index(b, []byte(`\"cip\": \"`))\n\tb = b[idx+len(`\"cip\": \"`):]\n\tidx = bytes.Index(b, []byte(`\"`))\n\tb = b[:idx]\n\tip = string(b)\n\treturn\n}", "title": "" }, { "docid": "965907d87c93a34cc29af5bbaef8f87b", "score": "0.4577062", "text": "func NewNetworkNumber(ip net.IP) NetworkNumber {\n\tif ip == nil {\n\t\treturn nil\n\t}\n\tcoercedIP := ip.To4()\n\tparts := 1\n\tif coercedIP == nil {\n\t\tcoercedIP = ip.To16()\n\t\tparts = 4\n\t}\n\tif coercedIP == nil {\n\t\treturn nil\n\t}\n\tnn := make(NetworkNumber, parts)\n\tfor i := 0; i < parts; i++ {\n\t\tidx := i * net.IPv4len\n\t\tnn[i] = binary.BigEndian.Uint32(coercedIP[idx : idx+net.IPv4len])\n\t}\n\treturn nn\n}", "title": "" }, { "docid": "be89954c167d56b4aeda8d781bd60b44", "score": "0.4577045", "text": "func (t *Mpls_SignalingProtocols_RsvpTe) NewInterface(InterfaceId string) (*Mpls_SignalingProtocols_RsvpTe_Interface, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*Mpls_SignalingProtocols_RsvpTe_Interface)\n\t}\n\n\tkey := InterfaceId\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &Mpls_SignalingProtocols_RsvpTe_Interface{\n\t\tInterfaceId: &InterfaceId,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "0773afd39844d34f0b6d4bc76544f14a", "score": "0.45761904", "text": "func NewNetCNIDNSTest() testutils.Test {\n\treturn testutils.TestFunc(func(t *testing.T) {\n\t\tctx := testutils.NewRktRunCtx()\n\t\tdefer ctx.Cleanup()\n\n\t\tiface, _, err := testutils.GetNonLoIfaceWithAddrs(netlink.FAMILY_V4)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error while getting non-lo host interface: %v\\n\", err)\n\t\t}\n\t\tif iface.Name == \"\" {\n\t\t\tt.Skipf(\"Cannot run test without non-lo host interface\")\n\t\t}\n\n\t\tnt := networkTemplateT{\n\t\t\tName: \"bridge0\",\n\t\t\tType: \"cniproxy\",\n\t\t\tArgs: []string{\"X_LOG=output.json\", \"X_REAL_PLUGIN=bridge\", \"X_ADD_DNS=1\"},\n\t\t\tIpMasq: true,\n\t\t\tIsGateway: true,\n\t\t\tMaster: iface.Name,\n\t\t\tIpam: &ipamTemplateT{\n\t\t\t\tType: \"host-local\",\n\t\t\t\tSubnet: \"11.11.3.0/24\",\n\t\t\t\tRoutes: []map[string]string{\n\t\t\t\t\t{\"dst\": \"0.0.0.0/0\"},\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\n\t\t// bring the networking up, copy the proxy\n\t\tprepareTestNet(t, ctx, nt)\n\n\t\tga := testutils.NewGoroutineAssistant(t)\n\t\tga.Add(1)\n\n\t\tgo func() {\n\t\t\tdefer ga.Done()\n\n\t\t\tappCmd := \"--exec=/inspect -- --read-file --file-name=/etc/resolv.conf\"\n\t\t\tcmd := fmt.Sprintf(\"%s --debug --insecure-options=image run --net=%v --mds-register=false %s %s\",\n\t\t\t\tctx.Cmd(), nt.NetParameter(), getInspectImagePath(), appCmd)\n\t\t\tchild := ga.SpawnOrFail(cmd)\n\t\t\tdefer ga.WaitOrFail(child)\n\n\t\t\texpectedRegex := \"nameserver 1.2.3.4\"\n\n\t\t\t_, out, err := expectRegexTimeoutWithOutput(child, expectedRegex, 30*time.Second)\n\t\t\tif err != nil {\n\t\t\t\tga.Fatalf(\"Error: %v\\nOutput: %v\", err, out)\n\t\t\t}\n\t\t}()\n\n\t\tga.Wait()\n\t})\n}", "title": "" }, { "docid": "3ddd623a59e572f768a5e9a8d1851e5a", "score": "0.4572754", "text": "func StringToAddressType(s string) api.NodeAddressType {\n\tnorm := strings.ToLower(s)\n\tswitch norm {\n\tcase \"externalip\":\n\t\treturn api.NodeExternalIP\n\tcase \"internalip\":\n\t\treturn api.NodeInternalIP\n\tcase \"legacyhostip\":\n\t\treturn api.NodeLegacyHostIP\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "99bdf6baeba0ed8c330d50340b33cc0d", "score": "0.456779", "text": "func NewNetwork(spec *NetworkSpec) (*Network, error) {\n\tn := &Network{\n\t\tNetworkSpec: spec,\n\t}\n\n\tif len(spec.Name) > maxNetworkNameLen {\n\t\treturn nil, errors.New(\"too long name: \" + spec.Name)\n\t}\n\n\tswitch spec.Type {\n\tcase \"internal\":\n\t\tn.typ = NetworkInternal\n\t\tif spec.UseNAT {\n\t\t\treturn nil, errors.New(\"UseNAT must be false for internal network\")\n\t\t}\n\t\tif len(spec.Address) > 0 {\n\t\t\treturn nil, errors.New(\"Address cannot be specified for internal network\")\n\t\t}\n\tcase \"external\":\n\t\tn.typ = NetworkExternal\n\t\tif len(spec.Address) == 0 {\n\t\t\treturn nil, errors.New(\"Address must be specified for external network\")\n\t\t}\n\tcase \"bmc\":\n\t\tn.typ = NetworkBMC\n\t\tif spec.UseNAT {\n\t\t\treturn nil, errors.New(\"UseNAT must be false for BMC network\")\n\t\t}\n\t\tif len(spec.Address) == 0 {\n\t\t\treturn nil, errors.New(\"Address must be specified for BMC network\")\n\t\t}\n\tdefault:\n\t\treturn nil, errors.New(\"unknown type: \" + spec.Type)\n\t}\n\n\tif len(spec.Address) > 0 {\n\t\tip, ipNet, err := net.ParseCIDR(spec.Address)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tn.ip = ip\n\t\tn.ipNet = ipNet\n\t}\n\n\treturn n, nil\n}", "title": "" }, { "docid": "5959bca058f22c4d024d6246cc99cbd8", "score": "0.45612288", "text": "func newTarget(name, addr string) (*target, error) {\n\tt := &target{\n\t\tname: name,\n\t\tendpoints: []string{},\n\t}\n\n\tu, err := url.Parse(addr)\n\tif err == nil && u.Scheme != \"\" {\n\t\tt.endpoints = append(t.endpoints, u.String())\n\t} else {\n\t\t_, addrs, err := net.LookupSRV(\"\", \"\", addr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, a := range addrs {\n\t\t\thost := strings.Trim(a.Target, \".\")\n\t\t\te := fmt.Sprintf(\"http://%s:%d/\", host, a.Port)\n\t\t\tt.endpoints = append(t.endpoints, e)\n\t\t}\n\t}\n\n\tif len(t.endpoints) == 0 {\n\t\treturn nil, fmt.Errorf(\"no endpoints for target '%s'\", name)\n\t}\n\n\treturn t, nil\n}", "title": "" }, { "docid": "ea2184411d7ab4b494089b4c97a75aae", "score": "0.4552654", "text": "func AddressFromNetIP(ip net.IP) Address {\n\tif v4 := ip.To4(); v4 != nil {\n\t\tvar a v4Address\n\t\tcopy(a[:], v4)\n\t\treturn a\n\t}\n\n\tvar a v6Address\n\tcopy(a[:], ip)\n\treturn a\n}", "title": "" }, { "docid": "b3cd2683500bc5e26a3f1d777df5be43", "score": "0.45498508", "text": "func newAddr(client *btcrpcclient.Client) (btcutil.Address, error) {\n\taddr, err := client.GetNewAddress()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn addr, nil\n}", "title": "" }, { "docid": "fa4ab6524f809043bf0c5d400d345d31", "score": "0.45482728", "text": "func TestIpNet(t *testing.T) {\n\tip := net.IPv4(10, 19, 138, 135)\n\tmask := net.IPv4Mask(255, 255, 0, 0)\n\tipnet := net.IPNet{ip, mask}\n\tfmt.Println(\"ipnet network:\", ipnet.Network())\n\tfmt.Println(\"ipnet:\", ipnet.String())\n\tfor _, v := range []net.IP{\n\t\tnet.IPv4(10, 19, 138, 135),\n\t\tnet.IPv4(10, 19, 0, 34),\n\t\tnet.IPv4(10, 13, 45, 22),\n\t} {\n\t\tfmt.Println(ipnet, \"contains:\", v, ipnet.Contains(v))\n\t}\n}", "title": "" }, { "docid": "5c6e15b1d8ff2971c78d7da0b27eb370", "score": "0.45403782", "text": "func NewTestNetDefaultNetNS() testutils.Test {\n\treturn testutils.TestFunc(func(t *testing.T) {\n\t\ttestImageArgs := []string{\"--exec=/inspect --print-netns\"}\n\t\ttestImage := patchTestACI(\"rkt-inspect-networking.aci\", testImageArgs...)\n\t\tdefer os.Remove(testImage)\n\n\t\tctx := testutils.NewRktRunCtx()\n\t\tdefer ctx.Cleanup()\n\n\t\tf := func(argument string) {\n\t\t\tcmd := fmt.Sprintf(\"%s --debug --insecure-options=image run %s --mds-register=false %s\", ctx.Cmd(), argument, testImage)\n\t\t\tchild := spawnOrFail(t, cmd)\n\t\t\tdefer waitOrFail(t, child, 0)\n\n\t\t\texpectedRegex := `NetNS: (net:\\[\\d+\\])`\n\t\t\tresult, out, err := expectRegexWithOutput(child, expectedRegex)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Error: %v\\nOutput: %v\", err, out)\n\t\t\t}\n\n\t\t\tns, err := os.Readlink(\"/proc/self/ns/net\")\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Cannot evaluate NetNS symlink: %v\", err)\n\t\t\t}\n\n\t\t\tif nsChanged := ns != result[1]; !nsChanged {\n\t\t\t\tt.Fatalf(\"container did not leave host netns\")\n\t\t\t}\n\n\t\t}\n\t\tf(\"--net=default\")\n\t\tf(\"\")\n\t})\n}", "title": "" }, { "docid": "94cf117680360c107888fe46c6c804d8", "score": "0.45358604", "text": "func NewRequestID(id string) string {\n\tif id == \"\" {\n\t\treturn uuid.NewV4().String()\n\t}\n\tl := 0\n\tfor i, c := range id {\n\t\tswitch {\n\t\tcase 'A' <= c && c <= 'Z':\n\t\tcase 'a' <= c && c <= 'z':\n\t\tcase '0' <= c && c <= '9':\n\t\tcase c == '-', c == '_', c == '.', c == '~', c == '%', c == '+':\n\t\tcase i > 199:\n\t\t\tfallthrough\n\t\tdefault:\n\t\t\treturn uuid.NewV4().String()\n\t\t}\n\t\tl = i\n\t}\n\tif l < 20 {\n\t\treturn uuid.NewV4().String()\n\t}\n\treturn id\n}", "title": "" }, { "docid": "f3b34949293d33fdfe9b19b5808dab37", "score": "0.45354864", "text": "func newNS() (*netns.NsHandle, error) {\n\t// Create a new network namespace\n\tlog.Debug(\"Create a new ns\")\n\tnewns, err := netns.New()\n\tif err != nil {\n\t\tlog.Warn(err)\n\t\treturn nil, err\n\t}\n\n\tsrc := \"/proc/self/ns/net\"\n\ttarget := nsPath\n\n\tlog.Debugf(\"Create file %s\", target)\n\t// Create an empty file\n\tfile, err := os.Create(target)\n\tif err != nil {\n\t\tlog.Warn(err)\n\t\treturn nil, err\n\t}\n\t// And close it\n\terr = file.Close()\n\tif err != nil {\n\t\tlog.Warn(err)\n\t\treturn nil, err\n\t}\n\n\tlog.Debugf(\"Mount %s\", target)\n\n\t// Mount the netnsPath just like iproute2 does\n\tif err := syscall.Mount(src, target, \"none\", syscall.MS_BIND, \"\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &newns, nil\n}", "title": "" }, { "docid": "15324d7fc62b4a38e6e7afca2ce28247", "score": "0.45304075", "text": "func PTR(ip net.IP) string {\n\n\tif ip.To4() != nil {\n\t\tparts := strings.Split(ip.String(), \".\")\n\t\treturn fmt.Sprintf(\"%s.%s.%s.%s.in-addr.arpa\", parts[3], parts[2], parts[1], parts[0])\n\t}\n\n\t// Must be IPv6\n\tbuf := make([]byte, 0, len(ip)*4+len(\"ip6.arpa\"))\n\n\t// Add it, in reverse, to the buffer\n\tfor i := len(ip) - 1; i >= 0; i-- {\n\t\tv := ip[i]\n\t\tbuf = append(buf, hexDigit[v&0xF],\n\t\t\t'.',\n\t\t\thexDigit[v>>4],\n\t\t\t'.')\n\t}\n\n\tbuf = append(buf, \"ip6.arpa\"...)\n\n\treturn string(buf)\n}", "title": "" }, { "docid": "621b8d99076d5390cf2790e11169f77a", "score": "0.45298317", "text": "func CreateIP(conn client.Connection, req IPRequest, netmask, iface string) error {\n\tlogger := plog.WithFields(log.Fields{\n\t\t\"hostid\": req.HostID,\n\t\t\"ipaddress\": req.IPAddress,\n\t})\n\n\tbasepth := \"/\"\n\tif req.PoolID != \"\" {\n\t\tbasepth = path.Join(\"/pools\", req.PoolID)\n\t}\n\n\tt := conn.NewTransaction()\n\n\t// Prepare the pool ip\n\tppth := path.Join(basepth, \"/ips\")\n\terr := conn.CreateIfExists(ppth, &client.Dir{})\n\tif err != nil && err != client.ErrNodeExists {\n\t\tlogger.WithError(err).Debug(\"Could not initialize pool ip path\")\n\t\t// TODO: error\n\t\treturn err\n\t}\n\n\tppth = path.Join(ppth, req.IPID())\n\tpdat := &PoolIP{}\n\tt.Create(ppth, pdat)\n\n\t// Prepare the host ip\n\thpth := path.Join(basepth, \"/hosts\", req.HostID, \"/ips\")\n\terr = conn.CreateIfExists(hpth, &client.Dir{})\n\tif err != nil && err != client.ErrNodeExists {\n\t\tlogger.WithError(err).Debug(\"Could not initialize host ip path\")\n\t\t// TODO: error\n\t\treturn err\n\t}\n\n\thpth = path.Join(hpth, req.IPID())\n\thdat := &HostIP{\n\t\tNetmask: netmask,\n\t\tBindInterface: iface,\n\t}\n\tt.Create(hpth, hdat)\n\n\tif err := t.Commit(); err != nil {\n\t\tlogger.WithError(err).Debug(\"Could not commit transaction\")\n\t\t// TODO: err\n\t\treturn err\n\t}\n\tlogger.Debug(\"Created ip\")\n\treturn nil\n}", "title": "" }, { "docid": "c32042d05d7a4cc3a0d96a2bca48b7cb", "score": "0.45285332", "text": "func NewIPv6NetOp(caller APICaller) IPv6NetAPI {\n\treturn GetClientFactoryFunc(\"IPv6Net\")(caller).(IPv6NetAPI)\n}", "title": "" }, { "docid": "9ad68bf3ddb945192cb8c163d31ca1e6", "score": "0.45236483", "text": "func NewMockIPNet() *MockIPNet {\n\treturn &MockIPNet{\n\t\tpodIf: make(map[podmodel.ID]string),\n\t\tnetworkToVRFID: make(map[string]uint32),\n\t\tpodInterfaceToNetwork: make(map[string]string),\n\t\texternalInterfaceToNetwork: make(map[string]string),\n\t}\n}", "title": "" }, { "docid": "3bd347f3889027a8521e1353e5718c5c", "score": "0.45163697", "text": "func (o BasicDefenseThresholdOutput) InternetIp() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *BasicDefenseThreshold) pulumi.StringOutput { return v.InternetIp }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "28ee72dcede5f1ba4c7aacef833bdf89", "score": "0.45160136", "text": "func (t *Interface_Subinterface_Ipv4) NewAddress(Ip string) (*Interface_Subinterface_Ipv4_Address, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Address == nil {\n\t\tt.Address = make(map[string]*Interface_Subinterface_Ipv4_Address)\n\t}\n\n\tkey := Ip\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.Address[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %%v for list Address\", key)\n\t}\n\n\tt.Address[key] = &Interface_Subinterface_Ipv4_Address{\n\t\tIp: &Ip,\n\t}\n\n\treturn t.Address[key], nil\n}", "title": "" }, { "docid": "f94265227038fe1053ef345975e725d0", "score": "0.45110407", "text": "func CreateNodeByIP(ip net.IP, port uint16) (*Node, error) {\n\tnode := Node{\n\t\tip: ip,\n\t\tport: port,\n\t\ttimestamp: GetNowInMillis(),\n\t\tpingMillis: PingNoData,\n\t}\n\n\treturn &node, nil\n}", "title": "" }, { "docid": "25cc166d893ee4175e66281efe02b17f", "score": "0.45103267", "text": "func (t *IPAddr) Name() string { return \"IpAddress\" }", "title": "" }, { "docid": "f8a24ef1523c874983723f4c705c5d89", "score": "0.45090458", "text": "func NewLocalHost() (Host, error) {\n\tname, err := os.Hostname()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewHost(name, \"\"), nil\n}", "title": "" }, { "docid": "b2ed52b6a0dc469960e3d097b20b3c81", "score": "0.45060033", "text": "func IPNEQ(v net.IP) predicate.FieldType {\n\tvc := []byte(v)\n\treturn predicate.FieldType(sql.FieldNEQ(FieldIP, vc))\n}", "title": "" }, { "docid": "c7beed6abbc2949002edbbc50e372b87", "score": "0.45058376", "text": "func (_Network *NetworkCaller) NewOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _Network.contract.Call(opts, &out, \"newOwner\")\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "772eba68dca5330a7f0deb9041caf4ca", "score": "0.45010638", "text": "func (t *Interface_Subinterface_Ipv4) NewAddress(Ip string) (*Interface_Subinterface_Ipv4_Address, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Address == nil {\n\t\tt.Address = make(map[string]*Interface_Subinterface_Ipv4_Address)\n\t}\n\n\tkey := Ip\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.Address[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Address\", key)\n\t}\n\n\tt.Address[key] = &Interface_Subinterface_Ipv4_Address{\n\t\tIp: &Ip,\n\t}\n\n\treturn t.Address[key], nil\n}", "title": "" }, { "docid": "98844f7e29b1c24a7af7e0fb9fd3bc16", "score": "0.44926074", "text": "func NewAliDNS(key, secret, ipType string) *AliDNS {\n\tonce.Do(func() {\n\t\tinstance = &AliDNS{\n\t\t\tAccessKeyID: key,\n\t\t\tAccessKeySecret: secret,\n\t\t\tIPType: ipType,\n\t\t}\n\t})\n\treturn instance\n}", "title": "" }, { "docid": "57e27767481bd1a4c3fad4e1c3696574", "score": "0.4487044", "text": "func NewNetwork(environment *Environment, path string) (*Network, error) {\n\tvar net = new(Network)\n\tvar err error\n\tnet.env = environment\n\t// Open file for reading and check for errors\n\tfile, err := os.Open(path)\n\tdefer file.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Allocate name string and check for errors\n\tname := filepath.Base(path)\n\tcName := (*C.char)(C.CString(name))\n\tdefer C.free(unsafe.Pointer(cName))\n\tif err = net.Errors(); err != nil {\n\t\treturn nil, err\n\t}\n\t// Allocate file stream and check for errors\n\tcStrm := C.NewMemoryStream_ns(cName, net.env.c, nil)\n\tdefer C.DeleteStream_ns(cStrm)\n\tif err = net.Errors(); err != nil {\n\t\treturn nil, err\n\t}\n\t// Read file and check for errors\n\tbuf, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Stream file into Netica and check for errors\n\tcBuf := (*C.char)(C.CBytes(buf)) // C.CBytes causes spurious report prior to Go1.8: https://github.com/golang/go/issues/17563\n\tdefer C.free(unsafe.Pointer(cBuf))\n\tC.SetStreamContents_ns(cStrm, cBuf, C.long(len(buf)), C.FALSE)\n\tif err = net.Errors(); err != nil {\n\t\treturn nil, err\n\t}\n\t// Parse file into Netica network and check for errors\n\tnet.c = C.ReadNet_bn(cStrm, C.NO_VISUAL_INFO)\n\tif err = net.Errors(); err != nil {\n\t\treturn nil, err\n\t}\n\t// Compile network in Netica and check for errors\n\tC.CompileNet_bn(net.c)\n\tif err = net.Errors(); err != nil {\n\t\treturn nil, err\n\t}\n\t// Retract any findings in network and check for errors\n\tC.RetractNetFindings_bn(net.c)\n\tif err = net.Errors(); err != nil {\n\t\treturn nil, err\n\t}\n\t// Turn off automatic updating for network and check for errors\n\tC.SetNetAutoUpdate_bn(net.c, C.int(0))\n\tif err = net.Errors(); err != nil {\n\t\treturn nil, err\n\t}\n\t// Register in synchronization map\n\tnet.env.netlocks[net.c] = new(sync.RWMutex)\n\treturn net, nil\n}", "title": "" }, { "docid": "f92320cd15f9d2449f91c2e5581a15a9", "score": "0.44847238", "text": "func New(\n\tacsENI *ecsacs.ElasticNetworkInterface,\n\tnetNSName string,\n\tnetNSPath string,\n\tguestNetNSName string,\n\tpeerInterface *ecsacs.ElasticNetworkInterface,\n) (*NetworkInterface, error) {\n\tvar err error\n\n\tvar networkInterface *NetworkInterface\n\n\tinterfaceAssociationProtocol := aws.StringValue(acsENI.InterfaceAssociationProtocol)\n\n\tswitch interfaceAssociationProtocol {\n\n\tcase V2NInterfaceAssociationProtocol:\n\t\t// In case of V2N ENIs, network tunnel properties need to be included in the NetworkInterface object.\n\t\t// This will be used in creating the GENEVE interface to connect the baremetal host and the BigMac tunnel.\n\t\tnetworkInterface, err = v2nTunnelFromACS(acsENI)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to unmarshal interface tunnel properties\")\n\t\t}\n\n\tcase VETHInterfaceAssociationProtocol:\n\t\tnetworkInterface, err = vethPairFromACS(acsENI, peerInterface)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to unmarshal interface veth properties\")\n\t\t}\n\n\t// Standard ENIs (Default) and branch ENIs (VLANInterfaceAssociationProtocol) are both processed\n\t// by the common NetworkInterface handler.\n\tdefault:\n\t\t// Acquire the NetworkInterface information from the payload.\n\t\tnetworkInterface, err = ENIFromACS(acsENI)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to unmarshal eni\")\n\t\t}\n\n\t\t// Historically, if there is no interface association protocol in the NetworkInterface payload, we assume\n\t\t// it is a standard NetworkInterface. For more context, see the `IsStandardENI()` method in the `ecseni` model.\n\t\tif networkInterface.InterfaceAssociationProtocol == \"\" {\n\t\t\tnetworkInterface.InterfaceAssociationProtocol = DefaultInterfaceAssociationProtocol\n\t\t}\n\t}\n\n\tnetworkInterface.Index = aws.Int64Value(acsENI.Index)\n\tnetworkInterface.Name = GetENIName(acsENI)\n\tnetworkInterface.KnownStatus = StatusNone\n\tnetworkInterface.DesiredStatus = StatusReadyPull\n\tnetworkInterface.NetNSName = netNSName\n\tnetworkInterface.NetNSPath = netNSPath\n\tnetworkInterface.GuestNetNSName = guestNetNSName\n\n\treturn networkInterface, nil\n}", "title": "" }, { "docid": "ee4b8705fba775a82cff80c10ae26128", "score": "0.4482312", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_TrafficEngineering) NewInterface(InterfaceName string) (*SrlNokiaNetworkInstance_NetworkInstance_TrafficEngineering_Interface, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*SrlNokiaNetworkInstance_NetworkInstance_TrafficEngineering_Interface)\n\t}\n\n\tkey := InterfaceName\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &SrlNokiaNetworkInstance_NetworkInstance_TrafficEngineering_Interface{\n\t\tInterfaceName: &InterfaceName,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "bd6e2ba3498b54c67119590a3c9d9171", "score": "0.44771165", "text": "func NewIPAM(scope net.IPNet) (*IPAM, error) {\n\tones, bits := scope.Mask.Size()\n\tif ones >= bits-1 {\n\t\treturn nil, fmt.Errorf(\"there is no IP to manage\")\n\t}\n\tscopeIP := scope.IP.Mask(scope.Mask)\n\treturn &IPAM{\n\t\tRange: scope,\n\t\tLast: scope.IP.Mask(scope.Mask),\n\t\tPool: make([]net.IP, 0, 10),\n\t}, nil\n}", "title": "" }, { "docid": "d147a5f17dce1ead3582c2f4d418ec13", "score": "0.44753247", "text": "func (e *Ethtool) NewInterface(ifname string, ignoreEepromReadErrors bool) (*Interface, error) {\n\tif len([]byte(ifname)) >= IFNAMSIZ {\n\t\treturn nil, errors.New(fmt.Sprintf(\"Interface name must not be longer than %d characters.\", IFNAMSIZ))\n\t}\n\tiface := &Interface{\n\t\tethtool: e,\n\t\tName: ifname,\n\t}\n\n\tdriverInfo, err := iface.getDriverInfo()\n\tif err != nil {\n\t\treturn iface, errors.Wrapf(err, \"Could not retrieve driver info\")\n\t}\n\tiface.DriverInfo = driverInfo\n\n\teeprom, err := iface.getEEPROM()\n\tif err != nil {\n\t\tif ignoreEepromReadErrors {\n\t\t\treturn iface, nil\n\t\t}\n\t\treturn iface, err\n\t}\n\tiface.Eeprom = eeprom\n\treturn iface, nil\n}", "title": "" }, { "docid": "a310bd15d7499183132bab5424a0560f", "score": "0.44719505", "text": "func newNode(id Hash, ip net.IP, udpPort uint16) *node {\n\tn := &node{\n\t\tIP: ip,\n\t\tPort: udpPort,\n\t\tID: id,\n\t\taddr: fmt.Sprintf(\"%s:%d\", ip.String(), udpPort),\n\t\tupdateAt: time.Now(),\n\t\tudpAddr: &net.UDPAddr{IP: ip, Port: int(udpPort)},\n\t}\n\tn.nodeString = n.string()\n\n\treturn n\n}", "title": "" }, { "docid": "acd62b59b6f21ee799136eeae27a1a6f", "score": "0.44711322", "text": "func newClient(ifi *net.Interface, p net.PacketConn, addrs []net.Addr) (*Client, error) {\n\treturn &Client{\n\t\tifi: ifi,\n\t\tp: p,\n\t}, nil\n}", "title": "" } ]
10eacdb7fad4edb347591d483d4e154d
UpdateStatusbar updates the statusbar view
[ { "docid": "f397a4111155fc82926a03aadc140a67", "score": "0.7396586", "text": "func (ct *Cointop) UpdateStatusbar(s string) error {\n\tct.debuglog(\"UpdateStatusbar()\")\n\tcurrpage := ct.CurrentDisplayPage()\n\ttotalpages := ct.TotalPagesDisplay()\n\tvar quitText string\n\tvar favoritesText string\n\tvar portfolioText string\n\tif ct.IsPortfolioVisible() || ct.IsFavoritesVisible() {\n\t\tquitText = \"Return\"\n\t} else {\n\t\tquitText = \"Quit\"\n\t}\n\tif ct.IsPortfolioVisible() {\n\t\tportfolioText = \"[E]Edit\"\n\t} else {\n\t\tportfolioText = \"[P]Portfolio\"\n\t}\n\tif ct.IsFavoritesVisible() {\n\t\tfavoritesText = \"[Space]Unfavorite\"\n\t} else {\n\t\tfavoritesText = \"[F]Favorites\"\n\t}\n\n\thelpStr := fmt.Sprintf(\"%s%s %sHelp\", \"[Q]\", quitText, \"[?]\")\n\tvar content string\n\tif ct.IsPriceAlertsVisible() {\n\t\tvar editStr string\n\t\tif ct.ActivePriceAlertsLen() > 0 {\n\t\t\teditStr = \"[E]Edit \"\n\t\t}\n\t\tcontent = fmt.Sprintf(\"%s %s[+]Add\", helpStr, editStr)\n\t} else {\n\t\tbase := fmt.Sprintf(\"%s %sChart %sRange %sSearch %sConvert %s %s\", helpStr, \"[Enter]\", \"[[ ]]\", \"[/]\", \"[C]\", favoritesText, portfolioText)\n\t\tstr := pad.Right(fmt.Sprintf(\"%v %sPage %v/%v %s\", base, \"[← →]\", currpage, totalpages, s), ct.width(), \" \")\n\t\tv := ct.Version()\n\t\tsize := utf8.RuneCountInString(str)\n\t\tend := size - utf8.RuneCountInString(v) + 2\n\t\tif end > size {\n\t\t\tend = size\n\t\t}\n\n\t\tcontent = str[:end] + v\n\t}\n\n\tct.UpdateUI(func() error {\n\t\treturn ct.Views.Statusbar.Update(content)\n\t})\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "0ce4b5edc10867cebbdf95de3a8b17d6", "score": "0.7729832", "text": "func (m *Model) updateStatusBarContent() {\n\tm.statusBar.SetContent(\n\t\tm.dirTree.GetTotalFiles(),\n\t\tm.dirTree.GetCursor(),\n\t\tm.showCommandInput,\n\t\tm.moveMode,\n\t\tm.dirTree.GetSelectedFile(),\n\t\tm.itemToMove,\n\t)\n}", "title": "" }, { "docid": "9055cc0f0671d9e5f7fe48cdcfbf2d75", "score": "0.74555665", "text": "func (ct *Cointop) UpdateStatusbar(s string) error {\n\tlog.Debug(\"UpdateStatusbar()\")\n\tcurrpage := ct.CurrentDisplayPage()\n\ttotalpages := ct.TotalPagesDisplay()\n\tvar quitText string\n\tvar favoritesText string\n\tvar portfolioText string\n\tif ct.IsPortfolioVisible() || ct.IsFavoritesVisible() {\n\t\tquitText = \"Return\"\n\t} else {\n\t\tquitText = \"Quit\"\n\t}\n\tif ct.IsPortfolioVisible() {\n\t\tportfolioText = \"[E]Edit\"\n\t} else {\n\t\tportfolioText = \"[P]Portfolio\"\n\t}\n\tif ct.IsFavoritesVisible() {\n\t\tfavoritesText = \"[Space]Unfavorite\"\n\t} else {\n\t\tfavoritesText = \"[F]Favorites\"\n\t}\n\n\thelpStr := fmt.Sprintf(\"%s%s %sHelp\", \"[Q]\", quitText, \"[?]\")\n\tvar content string\n\tif ct.IsPriceAlertsVisible() {\n\t\tvar editStr string\n\t\tif ct.ActivePriceAlertsLen() > 0 {\n\t\t\teditStr = \"[E]Edit \"\n\t\t}\n\t\tcontent = fmt.Sprintf(\"%s %s[+]Add\", helpStr, editStr)\n\t} else {\n\t\tbase := fmt.Sprintf(\"%s %sChart %sRange %sSearch %sConvert %s %s\", helpStr, \"[Enter]\", \"[[ ]]\", \"[/]\", \"[C]\", favoritesText, portfolioText)\n\t\tstr := pad.Right(fmt.Sprintf(\"%v %sPage %v/%v %s\", base, \"[← →]\", currpage, totalpages, s), ct.Width(), \" \")\n\t\tv := ct.Version()\n\t\tsize := utf8.RuneCountInString(str)\n\t\tend := size - utf8.RuneCountInString(v) + 2\n\t\tif end > size {\n\t\t\tend = size\n\t\t}\n\n\t\tcontent = str[:end] + v\n\t}\n\n\tct.UpdateUI(func() error {\n\t\treturn ct.Views.Statusbar.Update(content)\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "0078207007dd11ce390bd6526fd4dead", "score": "0.6539429", "text": "func (h *Handler) UpdateStatus(w http.ResponseWriter, r *http.Request) {\n\n\tcmd := sigstat.Command{\n\t\tStatus: \"running\",\n\t}\n\n\th.client.CommandService().UpdateStatus(cmd)\n}", "title": "" }, { "docid": "67ea83c179677f58bfcfb8343908bc96", "score": "0.628352", "text": "func (srv *Server) Update() {\n\tsrv.mu.Lock()\n\tdefer srv.mu.Unlock()\n\tsrv.statusBar.ActiveTabIndex = srv.windows.ActiveIndex()\n\twin := srv.windows.Active()\n\tif win == nil {\n\t\treturn\n\t}\n\twin.Touch()\n\tsrv.statusBar.TabNames, srv.statusBar.TabsWithActivity = srv.windows.TabNames()\n\tsrv.chatPane.SelectedRow = win.CurrentLine()\n\tsrv.chatPane.Rows = win.Lines()\n\tsrv.chatPane.Title = win.Title()\n\n\tif ch, ok := win.(*Channel); ok {\n\t\tsrv.chatPane.SubTitle = ch.Topic()\n\t\tsrv.chatPane.ModeText = ch.Modes()\n\t} else {\n\t\tsrv.chatPane.SubTitle = \"\"\n\t\tsrv.chatPane.ModeText = \"\"\n\t}\n\tsrv.chatPane.LeftPadding = win.padding() + 7\n\tif srv.statusBar.ActiveTabIndex == 0 {\n\t\tsrv.chatPane.ModeText = srv.currentNick\n\t}\n\tsrv.mainWindow.Items = nil\n\tif v, ok := win.(WindowWithUserList); ok {\n\t\tsrv.userListPane.Rows = v.UserList()\n\t\tsuff := \"s\"\n\t\tif len(srv.userListPane.Rows) == 1 {\n\t\t\tsuff = \"\"\n\t\t}\n\t\tsrv.userListPane.Title = fmt.Sprintf(\"%d user%s\", len(srv.userListPane.Rows), suff)\n\t\tsrv.mainWindow.Set(\n\t\t\tui.NewCol(.85, srv.chatPane),\n\t\t\tui.NewCol(.15, srv.userListPane),\n\t\t)\n\t} else {\n\t\tsrv.mainWindow.Set(\n\t\t\tui.NewCol(1, srv.chatPane),\n\t\t)\n\t}\n}", "title": "" }, { "docid": "89ba87d3724e8155fcc0b635089da6cf", "score": "0.60762155", "text": "func GuiStatusBar(bounds Rectangle, text string) {\n\tctext := C.CString(text)\n\tdefer C.free(unsafe.Pointer(ctext))\n\tcbounds := *bounds.cptr()\n\tC.GuiStatusBar(cbounds, ctext)\n}", "title": "" }, { "docid": "f221c620d324fb81c1ed7a62e2414554", "score": "0.60638803", "text": "func GuiStatusBar(bounds Rectangle, text string) {\n\tcbounds, _ := *(*C.Rectangle)(unsafe.Pointer(&bounds)), cgoAllocsUnknown\n\ttext = safeString(text)\n\tctext, _ := unpackPCharString(text)\n\tC.GuiStatusBar(cbounds, ctext)\n\truntime.KeepAlive(text)\n}", "title": "" }, { "docid": "17f9b3d2115085e049f1224d981184d7", "score": "0.5964406", "text": "func (s *AirflowUISpec) UpdateStatus(rsrc interface{}, reconciled []ResourceInfo, err error) {\n\tstatus := rsrc.(*AirflowClusterStatus)\n\tstatus.UI = ComponentStatus{}\n\tif s != nil {\n\t\tstatus.UI.update(reconciled, err)\n\t\tif status.UI.Status != StatusReady {\n\t\t\tstatus.Status = StatusInProgress\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3c25a2f4d42ef46c3bb0e84a014f1f0d", "score": "0.57915705", "text": "func (c *Controller) updateStatus(name types.NamespacedName, update func(status *CmdStatus), stillHasSameProcNum func() bool) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\tif !stillHasSameProcNum() {\n\t\treturn\n\t}\n\n\tcmd, ok := c.updateCmds[name]\n\tif !ok {\n\t\treturn\n\t}\n\n\tupdate(&cmd.Status)\n\n\terr := c.client.Status().Update(c.globalCtx, cmd)\n\tif err != nil && !apierrors.IsNotFound(err) {\n\t\tc.st.Dispatch(store.NewErrorAction(fmt.Errorf(\"syncing to apiserver: %v\", err)))\n\t\treturn\n\t}\n\n\tc.st.Dispatch(local.NewCmdUpdateStatusAction(cmd))\n}", "title": "" }, { "docid": "e82b9c64ddad88b60a3a83a03dd8802b", "score": "0.5783529", "text": "func (k *KubernetesScheduler) StatusUpdate(driver mesos.SchedulerDriver, taskStatus *mesos.TaskStatus) {\n\tlog.Infof(\"Received status update %v\\n\", taskStatus)\n\n\tk.Lock()\n\tdefer k.Unlock()\n\n\tswitch taskStatus.GetState() {\n\tcase mesos.TaskState_TASK_STAGING:\n\t\tk.handleTaskStaging(taskStatus)\n\tcase mesos.TaskState_TASK_STARTING:\n\t\tk.handleTaskStarting(taskStatus)\n\tcase mesos.TaskState_TASK_RUNNING:\n\t\tk.handleTaskRunning(taskStatus)\n\tcase mesos.TaskState_TASK_FINISHED:\n\t\tk.handleTaskFinished(taskStatus)\n\tcase mesos.TaskState_TASK_FAILED:\n\t\tk.handleTaskFailed(taskStatus)\n\tcase mesos.TaskState_TASK_KILLED:\n\t\tk.handleTaskKilled(taskStatus)\n\tcase mesos.TaskState_TASK_LOST:\n\t\tk.handleTaskLost(taskStatus)\n\t}\n}", "title": "" }, { "docid": "6c2b9e745b06ee48442fbc1864c786b1", "score": "0.57476264", "text": "func (bar *StatusBar) Show(state bool) {\n\tbar.statusbar.SetVisible(state)\n}", "title": "" }, { "docid": "d746b85237c4cc8543438cf4287fa097", "score": "0.56136686", "text": "func (b *Bar) Update(progress int64) {\n\tb.control <- progress\n}", "title": "" }, { "docid": "14c0f5cbd49e080a2e162b899659d781", "score": "0.55245394", "text": "func (wg *WaitGroupBar) UpdateBar() {\n\twg.bar.SetValue(float64(wg.current) / float64(wg.max))\n}", "title": "" }, { "docid": "76e0780173548bb5f730fee346c838aa", "score": "0.5468648", "text": "func (m *Manager) updateStatus(ctx context.Context, status *MessageStatus) {\n\terr := m.r.UpdateStatus(ctx, status)\n\tif err != nil {\n\t\tlog.Log(ctx, errors.Wrap(err, \"update message status\"))\n\t}\n}", "title": "" }, { "docid": "51f358e0c43a0a29e903b733b5a180bd", "score": "0.54424876", "text": "func (r *Reconciler) UpdateStatus() error {\n\tlog := r.Logger.WithField(\"func\", \"UpdateStatus\")\n\tlog.Infof(\"Updating noobaa status\")\n\tr.NooBaa.Status.ObservedGeneration = r.NooBaa.Generation\n\treturn r.Client.Status().Update(r.Ctx, r.NooBaa)\n}", "title": "" }, { "docid": "25bf13f350e0cb5b29a7330153ddbb5e", "score": "0.5431086", "text": "func (bar *StatusBar) Init(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int) {\n\tvar stack int\n\tif len(stackId) == 0 {\n\t\tstack = 0\n\t} else {\n\t\tstack = stackId[0]\n\t}\n\tbar.Separator = \" | \"\n\tbar.statusbar = originStatusbar\n\tbar.contextId = bar.statusbar.GetContextId(strconv.Itoa(stack)) /* get contextId of stack */\n\tbar.Messages = make([]string, len(prefix))\n\tbar.Prefix = prefix\n}", "title": "" }, { "docid": "c445d4dc6276e9a15fb2edaa45c96dcd", "score": "0.54162234", "text": "func (m *MainWindow) UpdateServers() {\n\tif m.servers_already_updating {\n\t\treturn\n\t}\n\tm.servers_already_updating = true\n\n\tctx.Eventer.LaunchEvent(\"setToolbarLabelText\", map[string]string{\"text\": \"<markup><span foreground=\\\"red\\\" font_weight=\\\"bold\\\">\" + ctx.Translator.Translate(\"Updating servers...\", nil) + \"</span></markup>\"})\n\tcurrent_tab := m.tab_widget.GetTabLabelText(m.tab_widget.GetNthPage(m.tab_widget.GetCurrentPage()))\n\tfmt.Println(\"Updating servers on tab '\" + current_tab + \"'...\")\n\n\tif strings.Contains(current_tab, ctx.Translator.Translate(\"Servers\", nil)) {\n\t\tgo ctx.Requester.UpdateAllServers(false)\n\t} else if strings.Contains(current_tab, ctx.Translator.Translate(\"Favorites\", nil)) {\n\t\tgo ctx.Requester.UpdateFavoriteServers()\n\t}\n}", "title": "" }, { "docid": "cabfa785a8beb6bca5ece18ed8bce0b3", "score": "0.54126114", "text": "func NewStatusbarView() *StatusbarView {\n\tvar view *StatusbarView = ui.NewView(\"statusbar\")\n\treturn view\n}", "title": "" }, { "docid": "5d8dab87301b9bfca1988d12ecd01a9e", "score": "0.5410933", "text": "func NewStatusbarView() *StatusbarView {\n\treturn ui.NewView(\"statusbar\")\n}", "title": "" }, { "docid": "55ebb7c47edc05ca54d03fad7a67886c", "score": "0.53567004", "text": "func (bar *StatusBar) Disp() {\n\tvar dispMessages []string\n\tfor idxMessage, message := range bar.Messages {\n\t\tif len(message) != 0 {\n\t\t\tdispMessages = append(dispMessages, bar.Prefix[idxMessage]+\" \"+message)\n\t\t}\n\t}\n\tbar.statusbar.Push(bar.contextId, strings.Join(dispMessages, bar.Separator))\n}", "title": "" }, { "docid": "6df1733476346df48d5f79f7e410bc62", "score": "0.5355643", "text": "func (handler *BotHandler) updateStatus() {\n\thandler.McRunner.WaitGroup.Add(1)\n\tdefer handler.McRunner.WaitGroup.Done()\n\tfor {\n\t\tselect {\n\t\tcase <-time.After(60 * time.Second):\n\t\t\thandler.McRunner.StatusRequestChannel <- true\n\n\t\t\tselect {\n\t\t\tcase status := <-handler.McRunner.StatusChannel:\n\t\t\t\tstatusJSON, _ := json.Marshal(status)\n\t\t\t\theader := header{Type: \"status\", Data: statusJSON}\n\t\t\t\thandler.sock.WriteJSON(header)\n\t\t\tcase <-time.After(10 * time.Second):\n\t\t\t\tfmt.Println(\"Failed to receive status update from runner, might be deadlocked.\")\n\t\t\t}\n\t\tcase <-handler.killChannel:\n\t\t\treturn\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "807aae77047c332cf25b0c749ff4d401", "score": "0.5353038", "text": "func StatusBarStructureNew(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int) (bar *StatusBar) {\n\tbar = new(StatusBar)\n\tbar.Init(originStatusbar, prefix, stackId...)\n\treturn\n}", "title": "" }, { "docid": "2c2b4162b8bc210c94f1f4fcded2f459", "score": "0.5350435", "text": "func (r *ReconcilerBase) UpdateStatus(obj runtime.Object) error {\n\treturn r.GetClient().Status().Update(context.Background(), obj)\n}", "title": "" }, { "docid": "9e959d638ca22b95e71ecdb48f1e8e82", "score": "0.5350019", "text": "func updateStatus(args []string) {\n\tdata, klocworkURL := formBaseRequest(\"update_status\")\n\tdata.Set(\"project\", args[0])\n\tdata.Set(\"ids\", args[1])\n\tdata.Set(\"status\", args[2])\n\n\tsendRequest(klocworkURL, data)\n\n}", "title": "" }, { "docid": "6d547e45f656195017586dc313c5b28c", "score": "0.5343267", "text": "func (r *ChartReconciler) UpdateStatus(c *stablev1.Chart) error {\n\tif err := r.Status().Update(ctx, c); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5703c96d679c1f3d1f2d9a500d0fd2f4", "score": "0.5339992", "text": "func New(screen tcell.Screen) *StatusBar {\n\treturn &StatusBar{screen: screen}\n}", "title": "" }, { "docid": "e27e5017ebc8ed2a45fa9b9645614875", "score": "0.5338993", "text": "func (s SimpleTermUI) Update(pdata PrintData) {\n\tstartRow := (pdata.Position.X)\n\tendRow := (startRow + pdata.Size.X)\n\n\tstartCol := (pdata.Position.Y)\n\tendCol := (startCol + pdata.Size.Y)\n\n\tpaddedContent := simpleTermUIpad(pdata)\n\td.DebugLog(paddedContent)\n\n\tfor row := startRow; row < endRow; row++ {\n\t\ts.uiContent[row] = (s.uiContent[row][:startCol] +\n\t\t\tpaddedContent[row-startRow] +\n\t\t\ts.uiContent[row][endCol:])\n\t}\n\n\td.DebugLog(s.uiContent)\n\n\tfmt.Printf(CLR_SCREEN + gotoPosition(0, 0))\n\tfmt.Print(s.String())\n}", "title": "" }, { "docid": "dda1f79f3a91f89a7d188723a9e1c576", "score": "0.5330986", "text": "func (r *Reconciler) UpdateStatus() error {\n\terr := r.Client.Status().Update(r.Ctx, r.NooBaaAccount)\n\tif err != nil {\n\t\tr.Logger.Errorf(\"UpdateStatus: %s\", err)\n\t\treturn err\n\t}\n\tr.Logger.Infof(\"UpdateStatus: Done\")\n\treturn nil\n}", "title": "" }, { "docid": "df07142709aa563a9ed502b80f6d674f", "score": "0.5318885", "text": "func (r *Reconciler) updateStatus(ctx reconcileRequestContext, processingJobStatus string) error {\n\treturn r.updateStatusWithAdditional(ctx, processingJobStatus, \"\")\n}", "title": "" }, { "docid": "6aeba49b84e2a8a4f495b3be61ef0640", "score": "0.53044105", "text": "func (t *StatusTracker) UpdateStatus() {\n\tif t.failures < t.halfOpenThreshold {\n\t\tt.status = Closed\n\t} else if t.failures < t.openThreshold {\n\t\tt.status = HalfOpen\n\t} else {\n\t\tt.status = Open\n\t}\n}", "title": "" }, { "docid": "5a31ed2bd1b56a58cd70430fe1ac90ac", "score": "0.52776325", "text": "func (b *barRenderer) Refresh() {\n\tb.objects = b.appBar.children\n\tb.Layout(b.appBar.Size())\n\n\tcanvas.Refresh(b.appBar)\n}", "title": "" }, { "docid": "f3700119cb3bda3805a71d8281eca3c3", "score": "0.5260473", "text": "func newStatusView(gui *gocui.Gui) (controller *Status) {\n\tcontroller = new(Status)\n\n\t// populate main fields\n\tcontroller.name = \"status\"\n\tcontroller.gui = gui\n\tcontroller.helpKeys = make([]*key.Binding, 0)\n\tcontroller.requestedHeight = 1\n\n\treturn controller\n}", "title": "" }, { "docid": "4a9b46b9a161c726a1ea76e68fb28bb7", "score": "0.5235085", "text": "func statusHandler(w http.ResponseWriter, _ *http.Request) {\n\tbToMb := func(b uint64) string {\n\t\treturn fmt.Sprintf(\"%v MiB\", b/1024/1024)\n\t}\n\tvar m runtime.MemStats\n\truntime.ReadMemStats(&m)\n\n\trowData := [][2]string{\n\t\t{\"Total Files:\", fmt.Sprintf(\"%v\", uint64(fileCount(config.Global.Root)))},\n\t\t{\"Media Folder Size:\", bToMb(uint64(folderSize(config.Global.Root)))},\n\t\t{\"Thumbnail Folder Size:\", bToMb(uint64(folderSize(config.Global.Cache)))},\n\t\t{\"Folders Watched:\", fmt.Sprint(gallery.WatchedFolders)},\n\t\t{\"Public Url:\", config.Global.PublicUrl},\n\t\t{\"Prefix:\", config.Global.Prefix},\n\t\t{\"-\", \"\"},\n\t\t{\"Alloc Memory:\", bToMb(m.Alloc)},\n\t\t{\"Sys Memory:\", bToMb(m.Sys)},\n\t\t{\"Goroutines:\", fmt.Sprint(runtime.NumGoroutine())},\n\t\t{\"-\", \"\"},\n\t\t{\"App Version:\", BuildVersion},\n\t\t{\"App Build Date:\", BuildTimestamp},\n\t\t{\"Service Uptime:\", time.Since(startTime).String()},\n\t}\n\n\tpage := templates.TwoColTable{\n\t\tPage: templates.Page{\n\t\t\tTitle: \"System Status\",\n\t\t\tPrefix: urlPrefix,\n\t\t\tAppVersion: BuildVersion,\n\t\t\tAppBuildTime: BuildTimestamp,\n\t\t},\n\t\tRows: rowData,\n\t}\n\t_ = templates.Html.ExecuteTemplate(w, \"table\", &page)\n}", "title": "" }, { "docid": "9c69401c3540cfa0f0b00eb8a517169b", "score": "0.5227152", "text": "func (nr *namedReceiver) UpdateStatus(ctx context.Context, status *MessageStatus) error {\n\treturn nr.Receiver.UpdateStatus(ctx, status.wrap(ctx, nr.ns))\n}", "title": "" }, { "docid": "196d18ca1c99b9f5ba26109f5c40e910", "score": "0.51981264", "text": "func runStatusWindow() error {\n\tif nbmRunStatusWindow.Lock() {\n\t\tdefer nbmRunStatusWindow.Unlock()\n\n\t\tmw := declarative.MainWindow{\n\t\t\tAssignTo: &statusWindow,\n\t\t\tName: \"statusmw\",\n\t\t\tTitle: \"Status Data\",\n\t\t\tIcon: appIcon,\n\t\t\tSize: declarative.Size{Width: 300, Height: 250},\n\t\t\tLayout: declarative.VBox{MarginsZero: true},\n\t\t\tChildren: []declarative.Widget{\n\t\t\t\tdeclarative.Composite{\n\t\t\t\t\tLayout: declarative.Grid{Rows: 2},\n\t\t\t\t\tStretchFactor: 4,\n\t\t\t\t\tChildren: []declarative.Widget{\n\t\t\t\t\t\tdeclarative.TableView{\n\t\t\t\t\t\t\tName: \"statustv\",\n\t\t\t\t\t\t\tColumnsOrderable: true,\n\t\t\t\t\t\t\tAlternatingRowBG: true,\n\t\t\t\t\t\t\tHeaderHidden: true,\n\t\t\t\t\t\t\tLastColumnStretched: true,\n\t\t\t\t\t\t\tColumns: []declarative.TableViewColumn{\n\t\t\t\t\t\t\t\t{Name: \"Index\", Hidden: true},\n\t\t\t\t\t\t\t\t{Name: \"Name\"},\n\t\t\t\t\t\t\t\t{Name: \"Value\"},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tModel: newStatusTableDataModel(),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdeclarative.PushButton{\n\t\t\t\t\t\t\tText: \"OK\",\n\t\t\t\t\t\t\tOnClicked: func() {\n\t\t\t\t\t\t\t\tstatusWindow.Close()\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\n\t\t// create window\n\t\terr := mw.Create()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// disable maximize, minimize, and resizing\n\t\thwnd := statusWindow.Handle()\n\t\twin.SetWindowLong(hwnd, win.GWL_STYLE, win.GetWindowLong(hwnd, win.GWL_STYLE) & ^(win.WS_MAXIMIZEBOX|win.WS_MINIMIZEBOX|win.WS_SIZEBOX))\n\n\t\t// start message loop\n\t\tstatusWindow.Run()\n\t} else {\n\t\t// bring already running status window to top\n\t\tstatusWindow.Show()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e6e8732917e24fc365a03a874e1ec4d3", "score": "0.5171432", "text": "func (t *Table) recalcStatus() {\r\n\r\n\tif !t.statusPanel.Visible() {\r\n\t\treturn\r\n\t}\r\n\tt.statusPanel.SetContentHeight(t.statusLabel.Height())\r\n\tpy := t.ContentHeight() - t.statusPanel.Height()\r\n\tt.statusPanel.SetPosition(0, py)\r\n\tt.statusPanel.SetWidth(t.ContentWidth())\r\n}", "title": "" }, { "docid": "d0c83d57e95a563c814c74bc176a1517", "score": "0.5168461", "text": "func (v *Status) Update() error {\n\treturn nil\n}", "title": "" }, { "docid": "dcff632ce0bd1163a9cc9edd3bcd8f5b", "score": "0.5110527", "text": "func (m *MainPanel) update() {\n\n\titems, err := m.App().GetItems()\n\tm.items = items\n\n\t// preserve selected item\n\tif sel := m.selected; sel != nil {\n\t\tm.selected = nil\n\t\tcury := 0\n\t\tfor _, item := range m.items {\n\t\t\tif item.Name == sel.Name {\n\t\t\t\tm.selected = item\n\t\t\t\tm.cury = cury\n\t\t\t}\n\t\t\tcury++\n\t\t}\n\t}\n\tif err != nil {\n\t\tswitch e := err.(type) {\n\t\tcase *rest.Error:\n\t\t\tif e.Code == 401 {\n\t\t\t\tm.App().ShowAuth()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tm.SetError()\n\t\tm.SetStatus(fmt.Sprintf(\"Cannot load items: %v\", err))\n\t\tm.lines = []string{}\n\t\tm.styles = []tcell.Style{}\n\t\treturn\n\t}\n\n\tlines := make([]string, 0, len(m.items))\n\tstyles := make([]tcell.Style, 0, len(m.items))\n\n\tm.ndisabled = 0\n\tm.nfailed = 0\n\tm.nstopped = 0\n\tm.nrunning = 0\n\n\tm.height = 0\n\tm.width = 0\n\n\tfor _, info := range items {\n\t\td := time.Since(info.TimeStamp)\n\t\td -= d % time.Second\n\t\tline := fmt.Sprintf(\"%-20s %-10s %10s %-10s\",\n\t\t\tinfo.Name, util.Status(info), util.FormatDuration(d),\n\t\t\tinfo.Status)\n\n\t\tif len(line) > m.width {\n\t\t\tm.width = len(line)\n\t\t}\n\t\tm.height++\n\n\t\tlines = append(lines, line)\n\t\tvar style tcell.Style\n\t\tif !info.Enabled {\n\t\t\tstyle = StyleNormal\n\t\t\tm.ndisabled++\n\t\t} else if info.Failed {\n\t\t\tstyle = StyleError\n\t\t\tm.nfailed++\n\t\t} else if !info.Running {\n\t\t\tstyle = StyleWarn\n\t\t\tm.nstopped++\n\t\t} else {\n\t\t\tstyle = StyleGood\n\t\t\tm.nrunning++\n\t\t}\n\t\tstyles = append(styles, style)\n\t}\n\n\tm.lines = lines\n\tm.styles = styles\n\n\tm.SetStatus(fmt.Sprintf(\n\t\t\"%6d Services %6d Faulted %6d Running %6d Standby %6d Disabled\",\n\t\tlen(m.items),\n\t\tm.nfailed, m.nrunning, m.nstopped, m.ndisabled))\n\n\tif m.nfailed > 0 {\n\t\tm.SetError()\n\t} else if m.nstopped > 0 {\n\t\tm.SetWarn()\n\t} else if m.nrunning > 0 {\n\t\tm.SetGood()\n\t} else {\n\t\tm.SetNormal()\n\t}\n\n\twords := []string{\"[Q] Quit\", \"[H] Help\"}\n\n\tif item := m.selected; item != nil {\n\t\twords = append(words, \"[I] Info\")\n\t\twords = append(words, \"[L] Log\")\n\t\tif !item.Enabled {\n\t\t\twords = append(words, \"[E] Enable\")\n\t\t} else {\n\t\t\twords = append(words, \"[D] Disable\")\n\t\t\tif item.Failed {\n\t\t\t\twords = append(words, \"[C] Clear\")\n\t\t\t}\n\t\t\twords = append(words, \"[R] Restart\")\n\t\t}\n\t} else {\n\t\twords = append(words, \"[L] Log\")\n\t}\n\tm.SetKeys(words)\n}", "title": "" }, { "docid": "e9ade4a791d6c79bd79e65212b250d9a", "score": "0.50799537", "text": "func UpdateStatus(status, description string) {\n\tupdateAgentStatus(status, description)\n}", "title": "" }, { "docid": "c4ce26a1d681e9ddbcb6d6edd6da25cb", "score": "0.5078177", "text": "func (s *StatusBar) Draw(e *editarea.EditArea, area area.Area) {\n\tstatuses := getStatuses(e)\n\tcontent := strings.Join(statuses, \" / \")\n\n\tstyle := tcell.StyleDefault.\n\t\tBackground(tcell.ColorDarkGray).\n\t\tForeground(tcell.ColorBlack)\n\n\tfor x := area.Start.X; x < area.End.X; x++ {\n\t\ts.screen.SetContent(x, area.Start.Y, ' ', nil, style)\n\t}\n\n\toffset := 1\n\tfor x, r := range content {\n\t\ts.screen.SetContent(x+offset, area.Start.Y, r, nil, style)\n\t}\n}", "title": "" }, { "docid": "8e17a1abc22a28e5ba931aef0e4f9251", "score": "0.5073787", "text": "func (s *SchedulerSpec) UpdateStatus(rsrc interface{}, reconciled []ResourceInfo, err error) {\n\tstatus := rsrc.(*AirflowClusterStatus)\n\tstatus.Scheduler = SchedulerStatus{}\n\tif s != nil {\n\t\tstatus.Scheduler.Resources.update(reconciled, err)\n\t\tif status.Scheduler.Resources.Status != StatusReady {\n\t\t\tstatus.Status = StatusInProgress\n\t\t}\n\t}\n}", "title": "" }, { "docid": "84eaaff1f696fe5e9788cf4afdbe82d9", "score": "0.504227", "text": "func UpdateWidget(res http.ResponseWriter, req *http.Request) {\n\tresp := response.New()\n\n\tresp.Render(res, req)\n}", "title": "" }, { "docid": "86df944c8a41d54ed2c9eaebef98fe17", "score": "0.5041353", "text": "func StatusHandler(w http.ResponseWriter, r *http.Request) {\n\tvar s StatusReq\n\tvar asc AppStatChg\n\ts.logmsgs = make([]string, 1)\n\ts.logmsgs[0] = \"Status Handler\\n\"\n\tdecoder := json.NewDecoder(r.Body)\n\tif err := decoder.Decode(&s); err != nil {\n\t\tpanic(err)\n\t}\n\tUhura.LogStatus <- s // log status message before we start\n\t<-Uhura.LogStatusAck // make sure it was done\n\ts.w = w // send response here\n\ts.updateEnv = true // assume we update, set to false if error\n\n\tUhura.HReqMem <- 1 // ask to access the shared mem, blocks until granted\n\t<-Uhura.HReqMemAck // make sure we got it\n\tHandleSetStatus(&s, &asc) // handle the status req\n\tUhura.HReqMemAck <- 1 // tell Dispatcher we're done with the data\n\n\tsendHTTPLogMsgs(&s)\n\tif !s.updateEnv {\n\t\treturn // exit now if we don't update\n\t}\n\tUhura.StateChg <- asc // otherwise, send the struct describing the update\n\t<-Uhura.StateChgAck // wait for confirmation and we're done\n\tUhura.LogEnvDescr <- 1 // dump env descr\n\t<-Uhura.LogEnvDescrAck // make sure it got done\n}", "title": "" }, { "docid": "80f0c50383eb101363286652a943d152", "score": "0.50397146", "text": "func (w *Window) Update() {\n\tw.redraw()\n\tw.refreshWait()\n\tw.resize()\n\tpollEvents()\n}", "title": "" }, { "docid": "522957dbb9fa533b9e14d299debed27f", "score": "0.5038489", "text": "func (h *Hookbot) ShowStatus(period time.Duration) {\n\tdefer h.wg.Done()\n\tticker := time.NewTicker(period)\n\tvar ll, lp, ls, ldP, ldS int64\n\n\tfor {\n\t\tselect {\n\t\tcase <-ticker.C:\n\t\t\tl := atomic.LoadInt64(&h.listeners)\n\t\t\tp := atomic.LoadInt64(&h.publish)\n\t\t\ts := atomic.LoadInt64(&h.sends)\n\t\t\tdP := atomic.LoadInt64(&h.dropP)\n\t\t\tdS := atomic.LoadInt64(&h.dropS)\n\n\t\t\tlog.Printf(\"Listeners %5d [%+5d] pub %5d [%+5d] (d %5d [%+5d])\"+\n\t\t\t\t\" send %8d [%+7d] (d %5d [%+5d])\",\n\t\t\t\tl, l-ll, p, p-lp, dP, dP-ldP, s, s-ls, dS, dS-ldS)\n\n\t\t\tll, lp, ls, ldP, ldS = l, p, s, dP, dS\n\t\tcase <-h.shutdown:\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d69fa2e4e9864876ddf18cfd6ea1f835", "score": "0.5028878", "text": "func NewIstioStatusUpdater(instance *iop.IstioOperator) helmreconciler.RenderingListener {\n\treturn &IstioStatusUpdater{\n\t\tDefaultRenderingListener: &helmreconciler.DefaultRenderingListener{},\n\t\tinstance: instance,\n\t}\n}", "title": "" }, { "docid": "2c960bd35b036d2bac34b72de352dbf8", "score": "0.5025742", "text": "func update(vs *ViewServer, primary string, backup string){\n\tvs.currentView.Viewnum += 1\n\tvs.currentView.Primary = primary\n\tvs.currentView.Backup = backup\n\tvs.idleServer = \"\"\n\tvs.primaryACK = false\n\tvs.backupACK = false\n}", "title": "" }, { "docid": "8074b9dbb282d54dada694f5d48fadce", "score": "0.5022134", "text": "func (w *ServerInterfaceWrapper) UpdateUserStatus(ctx echo.Context) error {\n\tvar err error\n\t// ------------- Path parameter \"id\" -------------\n\tvar id int\n\n\terr = runtime.BindStyledParameter(\"simple\", false, \"id\", ctx.Param(\"id\"), &id)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter id: %s\", err))\n\t}\n\n\tctx.Set(\"OAuth.Scopes\", []string{\"\"})\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.UpdateUserStatus(ctx, id)\n\treturn err\n}", "title": "" }, { "docid": "df89797ccb06c179b00c7a0a62b23c90", "score": "0.50192386", "text": "func (hc *httpClient) StatusUpdate(appName, instanceId, status, lastDirtyTimestamp string) (bool, error) {\n\tparam := &requestParam{\n\t\tURL: hc.serviceUrl + uriApps + appName + \"/\" + instanceId + \"/status?value=\" + status + \"&lastDirtyTimestamp=\" + lastDirtyTimestamp,\n\t\tMethod: http.MethodPut,\n\t\tHeaders: hc.headers,\n\t\tUsername: hc.username,\n\t\tPassword: hc.password,\n\t}\n\n\t_, statusCode, err := handleHttpRequest(param)\n\tif err != nil {\n\t\thc.handleError(err)\n\t}\n\n\treturn statusCode == http.StatusOK, err\n}", "title": "" }, { "docid": "721b7d2984f94dfa0a5917d95acc1290", "score": "0.5007659", "text": "func (c *UsersController) AccountTerminalStatusUpdate(ctx *app.AccountTerminalStatusUpdateUsersContext) error {\n\t// UsersController_AccountTerminalStatusUpdate: start_implement\n\n\t// Put your logic here\n\tuserID, err := utility.GetToken(ctx.Context)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%v\", err)\n\t}\n\tuserTerminal := &models.UserTerminal{}\n\tuserTerminal.UserID = userID\n\tuserTerminal.ClientVersion = ctx.ClientVersion\n\tuserTerminal.Platform = ctx.Platform\n\tuserTerminalDB := models.NewUserTerminalDB(c.db)\n\terr = userTerminalDB.Update(ctx.Context, userTerminal)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%v\", err)\n\t}\n\t// UsersController_AccountTerminalStatusUpdate: end_implement\n\treturn nil\n}", "title": "" }, { "docid": "3f6b6e0cc644f93acf443c80ce0549fb", "score": "0.49907354", "text": "func (s *NFSStoreSpec) UpdateStatus(rsrc interface{}, reconciled []ResourceInfo, err error) {\n\tstatus := rsrc.(*AirflowBaseStatus)\n\tstatus.Storage = ComponentStatus{}\n\tif s != nil {\n\t\tstatus.Storage.update(reconciled, err)\n\t\tif status.Storage.Status != StatusReady {\n\t\t\tstatus.Status = StatusInProgress\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f850ed8cdfdd4ef5164c84b6aac34dfd", "score": "0.4989169", "text": "func (this *Monitor) systemStatus(msg *msgtypes.SystemStatus) {\n\tthis.enqueue(&pb.StatusMessage{SystemStatus: msg.ToPb()})\n}", "title": "" }, { "docid": "acd14baa00fd8e347cbeea232a43a708", "score": "0.49756634", "text": "func (a *API) setWidgetStatus( /*ctx context.Context,*/ id int, value string) error {\n\t// - [ ] `<id>[|<value>]`: Sets given `<value>` of widget with given `<id>`\n\t// - `Button`: `<value>` equals to `1` for press and `0` for release\n\t// - `Slider`: `<value>` is in range of slider\n\t// - `AudioTrigger`: `<value>` equals to `1` for active and `0` for inactive\n\t// - `CueList`: `<value>` is `<command>[|<index>]`:\n\t// - `PLAY`: Plays cue\n\t// - `STOP`: Stops cue\n\t// - `PREV`: Selects previous cue\n\t// - `NEXT`: Selects next cue\n\t// - `STEP|<index>`: Selects cue with given `<index>`\n\t// - `Frame`, `SoloFrame`: `<value>` is one of `NEXT_PG` (next page) or `PREV_PG` (previous page)\n\n\t// lock API\n\ta.lock.Lock()\n\tdefer a.lock.Unlock()\n\n\t// Send message\n\terr := a.writeText([]byte(fmt.Sprintf(\"QLC+API|setFunctionStatus|%d|%s\", id, value)))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "403020ecec1304dcd74466aeead81170", "score": "0.49595383", "text": "func (t *Task) updateStatus() {\n\tb, err := json.Marshal(&map[string]interface{}{\n\t\t\"type\": \"update\",\n\t\t\"start\": t.Desc.Start,\n\t\t\"end\": t.Desc.End,\n\t\t\"status\": t.Desc.Status,\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\torm.UpdateTask(&t.Desc)\n\tsockets.Message(t.Desc.ID, b)\n}", "title": "" }, { "docid": "12605b1c55e8ca94256fa516c1156d24", "score": "0.49517506", "text": "func (m *Myself) setStatus(stat int) {\n\tm.mutex.Lock()\n\tm.status = stat\n\tm.mutex.Unlock()\n}", "title": "" }, { "docid": "de0ea86ec72320fe91826746e595403e", "score": "0.49495396", "text": "func (gh GitHubStatusNotify) UpdateStatus(owner, repo, sha string, status int) error {\n\treturn github.StatusSet(gh.authConfig, owner, repo, sha, gh.githubStatuses[status%5], \"continuous-integration/microci\", \"\", \"\", false)\n}", "title": "" }, { "docid": "f49b8ac22fbe16daead6d73843067d27", "score": "0.49340057", "text": "func (s *swapClientServer) processStatusUpdates(mainCtx context.Context) {\n\tfor {\n\t\tselect {\n\t\t// On updates, refresh the server's in-memory state and inform\n\t\t// subscribers about the changes.\n\t\tcase swp := <-s.statusChan:\n\t\t\ts.swapsLock.Lock()\n\t\t\ts.swaps[swp.SwapHash] = swp\n\n\t\t\tfor _, subscriber := range s.subscribers {\n\t\t\t\tselect {\n\t\t\t\tcase subscriber <- swp:\n\t\t\t\tcase <-mainCtx.Done():\n\t\t\t\t\ts.swapsLock.Unlock()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ts.swapsLock.Unlock()\n\n\t\t// Server is shutting down.\n\t\tcase <-mainCtx.Done():\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "09110e8e16adbcabf03afa09792c2ec6", "score": "0.49110448", "text": "func (r *Renderer) renderStatus(bot *Bot) {\n\treport := bot.String()\n\n\tfmt.Printf(deco.BgBlack+\"%-30s%29s\\n\"+deco.DefaultColor, bot.lastCmd, report)\n\n\tr.lines++\n}", "title": "" }, { "docid": "35413fa962914bfa9e7e5d9f0c56ad06", "score": "0.49015194", "text": "func (s *WorkerSpec) UpdateStatus(rsrc interface{}, reconciled []ResourceInfo, err error) {\n\tstatus := rsrc.(*AirflowClusterStatus)\n\tstatus.Worker = ComponentStatus{}\n\tif s != nil {\n\t\tstatus.Worker.update(reconciled, err)\n\t\tif status.Worker.Status != StatusReady {\n\t\t\tstatus.Status = StatusInProgress\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0e8c4fd47a9b73feff6c19947ccfd31f", "score": "0.48975703", "text": "func (r *Reconciler) updateStatus(ctx context.Context, id types.ID, updates ...statusUpdate) error {\n\tstatus, err := r.getOrCreatePodStatus(ctx, id)\n\tif err != nil {\n\t\tr.log.Info(\"could not get/create pod status object\", \"error\", err)\n\t\treturn err\n\t}\n\n\tfor _, update := range updates {\n\t\tupdate(status)\n\t}\n\n\terr = r.Update(ctx, status)\n\tif err != nil {\n\t\tr.log.Error(err, \"could not update mutator status\")\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "9bb4339372c512805707992e24368035", "score": "0.48948666", "text": "func (manager *Manager) updateStatus(jobStatus ingestic.JobStatus) {\n\tmanager.estimatedEndTimeInSec = jobStatus.EstimatedEndTimeInSec\n\tmanager.percentageComplete = jobStatus.PercentageComplete\n\n\tevent := &automate_event.EventMsg{\n\t\tEventID: createEventUUID(),\n\t\tType: &automate_event.EventType{Name: automate_event_type.ProjectRulesUpdateStatus},\n\t\tPublished: ptypes.TimestampNow(),\n\t\tProducer: &automate_event.Producer{\n\t\t\tID: event_ids.ComplianceInspecReportProducerID,\n\t\t},\n\t\tData: &_struct.Struct{\n\t\t\tFields: map[string]*_struct.Value{\n\t\t\t\t\"Completed\": {\n\t\t\t\t\tKind: &_struct.Value_BoolValue{\n\t\t\t\t\t\tBoolValue: jobStatus.Completed,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"PercentageComplete\": {\n\t\t\t\t\tKind: &_struct.Value_NumberValue{\n\t\t\t\t\t\tNumberValue: float64(jobStatus.PercentageComplete),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"EstimatedTimeCompeleteInSec\": {\n\t\t\t\t\tKind: &_struct.Value_NumberValue{\n\t\t\t\t\t\tNumberValue: float64(jobStatus.EstimatedEndTimeInSec),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tproject_update_tags.ProjectUpdateIDTag: {\n\t\t\t\t\tKind: &_struct.Value_StringValue{\n\t\t\t\t\t\tStringValue: manager.projectUpdateID,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tpubReq := &automate_event.PublishRequest{Msg: event}\n\t_, err := manager.eventServiceClient.Publish(context.Background(), pubReq)\n\tif err != nil {\n\t\tlogrus.Warnf(\"Publishing Failed event %v\", err)\n\t}\n}", "title": "" }, { "docid": "55370f60a12b78bfc7b633e87ce8f23f", "score": "0.48873731", "text": "func (s *MySQLSpec) UpdateStatus(rsrc interface{}, reconciled []ResourceInfo, err error) {\n\tstatus := rsrc.(*AirflowBaseStatus)\n\tstatus.MySQL = ComponentStatus{}\n\tif s != nil {\n\t\tstatus.MySQL.update(reconciled, err)\n\t\tif status.MySQL.Status != StatusReady {\n\t\t\tstatus.Status = StatusInProgress\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9e8de1fc9dd0c26db017d48969fb9d92", "score": "0.48871586", "text": "func (runner *McRunner) updateStatus() {\n\trunner.WaitGroup.Add(1)\n\tdefer runner.WaitGroup.Done()\n\tfor {\n\t\tselect {\n\t\tcase <-runner.StatusRequestChannel:\n\t\t\tif runner.State != Running {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tstatus := new(Status)\n\t\t\tstatus.Name = runner.Settings.Name\n\t\t\tstatus.PlayerMax = runner.Settings.MaxPlayers\n\t\t\tswitch runner.State {\n\t\t\tcase NotRunning:\n\t\t\t\tstatus.Status = \"Not Running\"\n\t\t\tcase Starting:\n\t\t\t\tstatus.Status = \"Starting\"\n\t\t\tcase Running:\n\t\t\t\tstatus.Status = \"Running\"\n\t\t\t}\n\t\t\tstatus.ActiveTime = int(time.Since(runner.startTime).Seconds())\n\n\t\t\tproc, _ := process.NewProcess(int32(runner.cmd.Process.Pid))\n\t\t\tmemInfo, _ := proc.MemoryInfo()\n\t\t\tstatus.MemoryMax = runner.Settings.MaxRAM\n\t\t\tstatus.Memory = int(memInfo.RSS / (1024 * 1024))\n\n\t\t\tworldPath := filepath.Join(McServerPath(), \"world\")\n\t\t\tusage, _ := disk.Usage(worldPath)\n\t\t\tstatus.Storage = usage.Used / (1024 * 1024)\n\t\t\tstatus.StorageMax = usage.Total / (1024 * 1024)\n\n\t\t\trunner.executeCommand(\"list\")\n\t\t\tstatus.PlayerCount = <-runner.playerChannel\n\n\t\t\ttpsMap := make(map[int]float32)\n\t\t\trunner.executeCommand(\"forge tps\")\n\t\tloop:\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase m := <-runner.tpsChannel:\n\t\t\t\t\tfor k, v := range m {\n\t\t\t\t\t\ttpsMap[k] = v\n\t\t\t\t\t}\n\t\t\t\tcase <-time.After(1 * time.Second):\n\t\t\t\t\tbreak loop\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar tpsStrBuilder strings.Builder\n\t\t\ttpsStrBuilder.WriteString(\"{ \")\n\t\t\tfor k, v := range tpsMap {\n\t\t\t\ttpsStrBuilder.WriteString(fmt.Sprintf(\"\\\"%d\\\": %f, \", k, v))\n\t\t\t}\n\t\t\ttpsStr := tpsStrBuilder.String()[:tpsStrBuilder.Len()-3]\n\t\t\ttpsStrBuilder.Reset()\n\t\t\ttpsStrBuilder.WriteString(tpsStr)\n\t\t\ttpsStrBuilder.WriteString(\"}\")\n\t\t\ttpsStr = tpsStrBuilder.String()\n\t\t\tstatus.TPS = []byte(tpsStr)\n\n\t\t\trunner.StatusChannel <- status\n\t\tcase <-runner.killChannel:\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1d497a46c393eaaf04adf24730af1195", "score": "0.48781863", "text": "func (c *HBComp) updateMetricMoverStats() {\n\tvt := models.ValueType{\n\t\tKind: \"STRING\",\n\t\tValue: c.app.MetricMover.Status().String(),\n\t}\n\tc.app.Service.SetServiceAttribute(com.ServiceAttrMetricMoverStatus, vt)\n}", "title": "" }, { "docid": "9c5ce868493d2a7ed1fa19a6b7725faa", "score": "0.4871967", "text": "func (r *NetworkReconciler) updateStatus(network *ethereumv1alpha1.Network) error {\n\tnetwork.Status.NodesCount = len(network.Spec.Nodes)\n\n\tif err := r.Status().Update(context.Background(), network); err != nil {\n\t\tr.Log.Error(err, \"unable to update network status\")\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4badf527b9e6991b62b52f70e3c971cf", "score": "0.4859315", "text": "func (r *NodeReconciler) updateStatus(ctx context.Context, node *filecoinv1alpha1.Node) error {\n\t// TODO: update after multi-client support\n\tnode.Status.Client = \"lotus\"\n\n\tif err := r.Status().Update(ctx, node); err != nil {\n\t\tr.Log.Error(err, \"unable to update filecoin node status\")\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ffe4327586ab30cd50436b66bc0054b5", "score": "0.48261255", "text": "func (c *ZKCluster) watchStatusUpdates() {\n\tstatus_node := ZK_ROOT + \"/\" + c.info.Name + \"/status\"\n\tfor {\n\t\texists, stat, event, err := c.zc.conn.ExistsW(status_node)\n\t\tif err == nil && exists && stat.Version > c.version {\n\t\t\tif statusbytes, stat, err := c.zc.conn.Get(status_node); err == nil {\n\t\t\t\tvar status map[string]ShardStatus\n\t\t\t\tif err := json.Unmarshal(statusbytes, &status); err == nil {\n\t\t\t\t\tfor k, v := range status {\n\t\t\t\t\t\tif c.status[k] != v {\n\t\t\t\t\t\t\tc.status[k] = v\n\t\t\t\t\t\t\tc.updates <- v\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tc.version = stat.Version\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tselect {\n\t\tcase <- event:\n\t\tcase <- c.checkerdone: return\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b777b4252948fa8270d04e35c4cb6bc2", "score": "0.48008662", "text": "func (s *FlowerSpec) UpdateStatus(rsrc interface{}, reconciled []ResourceInfo, err error) {\n\tstatus := rsrc.(*AirflowClusterStatus)\n\tstatus.Flower = ComponentStatus{}\n\tif s != nil {\n\t\tstatus.Flower.update(reconciled, err)\n\t\tif status.Flower.Status != StatusReady {\n\t\t\tstatus.Status = StatusInProgress\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3d251d06fb2d3a693bb49c7771c65af5", "score": "0.48001617", "text": "func (c *rpcServices) UpdateStatus(rpcService *v1.RpcService) (result *v1.RpcService, err error) {\n\tresult = &v1.RpcService{}\n\terr = c.client.Put().\n\t\tNamespace(c.ns).\n\t\tResource(\"rpcservices\").\n\t\tName(rpcService.Name).\n\t\tSubResource(\"status\").\n\t\tBody(rpcService).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "758244f918526acb375e8ac0a3876f67", "score": "0.4799132", "text": "func (r *CustomDomainReconciler) statusUpdate(reqLogger logr.Logger, instance *customdomainv1alpha1.CustomDomain) error {\n\terr := r.Client.Status().Update(context.TODO(), instance)\n\tif err != nil {\n\t\treqLogger.Error(err, fmt.Sprintf(\"Status update for %s failed\", instance.Name))\n\t}\n\t//reqLogger.Info(fmt.Sprintf(\"Status updated for %s\", instance.Name))\n\treturn err\n}", "title": "" }, { "docid": "1481ccb5884daea48926804a1060cc09", "score": "0.4789556", "text": "func (r *Reconciler) updateStatus(ctx context.Context, appRollout *oamv1alpha2.AppRollout, opts ...client.UpdateOption) error {\n\tstatus := appRollout.DeepCopy().Status\n\treturn retry.RetryOnConflict(retry.DefaultBackoff, func() (err error) {\n\t\tif err = r.Get(ctx, client.ObjectKey{Namespace: appRollout.Namespace, Name: appRollout.Name}, appRollout); err != nil {\n\t\t\treturn\n\t\t}\n\t\tappRollout.Status = status\n\t\treturn r.Status().Update(ctx, appRollout, opts...)\n\t})\n}", "title": "" }, { "docid": "1040f89922f3c6c8884feb18ee4dbdfa", "score": "0.47806975", "text": "func (bar *StatusBar) Add(prefix, inString string) (position int) {\n\tbar.Prefix = append(bar.Prefix, prefix)\n\tbar.Messages = append(bar.Messages, prefix+\" \"+inString)\n\tbar.Disp()\n\treturn len(bar.Messages) - 1\n}", "title": "" }, { "docid": "3bfd43feeaf1b107ed3b22102b7044a1", "score": "0.47504142", "text": "func (u *Updater) UpdateCheckStatusTerminal(s CheckState) {\n\tcheckState, ok := u.terminalChecks.Load(s.ID)\n\n\tif !ok {\n\t\tu.terminalChecks.Store(s.ID, s)\n\t\treturn\n\t}\n\tcs := checkState.(CheckState)\n\n\t// We update the existing CheckState.\n\tcs.Merge(s)\n\n\tu.terminalChecks.Store(s.ID, cs)\n}", "title": "" }, { "docid": "922acbfbd21a36007f9f565f3ebd5914", "score": "0.4748663", "text": "func (clt *client) setStatus(newStatus Status) {\n\tclt.statusLock.Lock()\n\tclt.status = newStatus\n\tclt.statusLock.Unlock()\n}", "title": "" }, { "docid": "1cb465b7fbcbf7a1a1cee7a5452c73f3", "score": "0.4748105", "text": "func getStatus(cmd *cobra.Command, args []string) {\n\tconfig, err := statusKubeconfig.Get()\n\tif err != nil {\n\t\terrlog.LogError(errors.Wrap(err, \"couldn't get kubernetes config\"))\n\t\tos.Exit(1)\n\t}\n\tclient, err := kubernetes.NewForConfig(config)\n\tif err != nil {\n\t\terrlog.LogError(errors.Wrap(err, \"couldn't initialise kubernete client\"))\n\t\tos.Exit(1)\n\t}\n\n\tstatus, err := ops.NewSonobuoyClient().GetStatus(statusNamespace, client)\n\tif err != nil {\n\t\terrlog.LogError(errors.Wrap(err, \"error attempting to run sonobuoy\"))\n\t\tos.Exit(1)\n\t}\n\n\ttw := tabwriter.NewWriter(os.Stdout, 1, 8, 1, '\\t', tabwriter.AlignRight)\n\n\tfmt.Fprintf(tw, \"PLUGIN\\tNODE\\tSTATUS\\n\")\n\tfor _, pluginStatus := range status.Plugins {\n\t\tfmt.Fprintf(tw, \"%s\\t%s\\t%s\\n\", pluginStatus.Plugin, pluginStatus.Node, pluginStatus.Status)\n\t}\n\n\tif err := tw.Flush(); err != nil {\n\t\terrlog.LogError(errors.Wrap(err, \"couldn't write status out\"))\n\t\tos.Exit(1)\n\t}\n\tfmt.Printf(\"\\n%s\\n\", humanReadableStatus(status.Status))\n}", "title": "" }, { "docid": "29facdf21bd2ad06133ddfdc5948eb00", "score": "0.47480303", "text": "func (c *AKSCluster) UpdateStatus(status string) error {\n\treturn c.modelCluster.UpdateStatus(status)\n}", "title": "" }, { "docid": "46c334c2062f458a256d88a3cb05900a", "score": "0.47465384", "text": "func (r *ReferenceAdapter) StatusUpdate() error {\n\terr := r.kubeClient.Status().Update(context.TODO(), r.ProjectReference)\n\tif err != nil {\n\t\treturn operrors.Wrap(err, fmt.Sprintf(\"failed to update ProjectReference status of %s\", r.ProjectReference.Name))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d62e3df58e865bb19d79814c9e3e216a", "score": "0.47427097", "text": "func updateAgentStatus(status, message string) error {\n\t// IMP - To be removed once the model is in production\n\tif agent.cfg == nil || agent.cfg.GetAgentName() == \"\" {\n\t\treturn nil\n\t}\n\n\tif agent.agentResource != nil {\n\t\tagentResourceType := getAgentResourceType()\n\t\tresource := createAgentStatusSubResource(agentResourceType, status, message)\n\t\tbuffer, err := json.Marshal(resource)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\n\t\tsubResURL := agent.cfg.GetEnvironmentURL() + \"/\" + agentResourceType + \"/\" + agent.cfg.GetAgentName() + \"/status\"\n\t\t_, err = agent.apicClient.ExecuteAPI(coreapi.PUT, subResURL, nil, buffer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1f83d72ebd78fb254b1be24c3d51f9d3", "score": "0.47383448", "text": "func APIStatus(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(GetStatus()))\n}", "title": "" }, { "docid": "b0f76a77a3995620ff6750d2094c58df", "score": "0.473723", "text": "func (l *List) Update() {\n\tl.win.Update()\n}", "title": "" }, { "docid": "0470ab8d6f6afe5bef90d714236a500a", "score": "0.47353956", "text": "func (s *Server) apiStatusShow(\n\tctx context.Context,\n\treq *http.Request,\n\t_params httprouter.Params,\n) (response, error) {\n\tstatus, err := CollectAppStatus(ctx, s.pool, s.routesStore, s.neighborsStore)\n\treturn status, err\n}", "title": "" }, { "docid": "06577f9ae65ed990c89c70ccca3fc1a6", "score": "0.47352237", "text": "func notifyStatus(curStatus WorkerStatus, tid int) {\n\targs := CallArgs{}\n\targs.CurrentStatus = curStatus\n\targs.TaskID = tid\n\treply := CallReply{}\n\tcall(\"Coordinator.Response\", &args, &reply)\n}", "title": "" }, { "docid": "a53e69257e22aa0750f66c912341b898", "score": "0.47325543", "text": "func (dtm *DfgetTaskManager) UpdateStatus(ctx context.Context, clientID, taskID, status string) error {\n\tdfgetTask, err := dtm.getDfgetTask(clientID, taskID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif dfgetTask.Status != types.DfGetTaskStatusSUCCESS {\n\t\tdfgetTask.Status = status\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "df85263bc028d9cb018667287fd7ed7a", "score": "0.47311744", "text": "func statusHandler(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tenc := json.NewEncoder(w)\n\terr := enc.Encode(getCurrentStatus())\n\tif err != nil {\n\t\tsklog.Errorf(\"Failed to write or encode output: %s\", err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "cf71206ffd92291b471a3440e01133c4", "score": "0.47299004", "text": "func (r *Client) UpdateStatus(ctx context.Context, obj client.Object, state alertmanagerv1alpha1.State, requeueTime ...float64) (ctrl.Result, error) {\n\tlog := log.Logger(ctx, \"controllers.common\", \"common\", \"UpdateStatus\")\n\n\tif err := r.Status().Update(ctx, obj); err != nil {\n\t\tlog.Error(err, \"Unable to update status\", \"status\", state)\n\t\tr.Recorder.Event(obj, v1.EventTypeWarning, string(alertmanagerv1alpha1.Error), \"Unable to create/update status due to error \"+err.Error())\n\t\treturn ctrl.Result{RequeueAfter: 30 * time.Second}, nil\n\t}\n\n\tif state != alertmanagerv1alpha1.Error {\n\t\treturn ctrl.Result{}, nil\n\t}\n\n\t//if wait time is specified, requeue it after provided time\n\tif len(requeueTime) == 0 {\n\t\trequeueTime[0] = 0\n\t}\n\n\tlog.Info(\"Requeue time\", \"time\", requeueTime[0])\n\treturn ctrl.Result{RequeueAfter: time.Duration(requeueTime[0]) * time.Millisecond}, nil\n}", "title": "" }, { "docid": "fa345a24747747b6b6c7410f27832137", "score": "0.47172114", "text": "func MqUpdateAppStatus(cmd Mqkubecmd) error {\n\tmqdbchan <- cmd\n\treturn nil\n}", "title": "" }, { "docid": "e8a850571ca850db1d0382f71ee8e4ac", "score": "0.470558", "text": "func checkForUpdates(app *cli.App) {\n\tspinner, _ := pterm.DefaultSpinner.Start(\"Checking for updates...\")\n\tc := http.Client{Timeout: 10 * time.Second}\n\n\tresp, err := c.Get(\"https://github.com/ayoisaiah/focus/releases/latest\")\n\tif err != nil {\n\t\tpterm.Error.Println(\"HTTP Error: Failed to check for update\")\n\t\treturn\n\t}\n\n\tdefer resp.Body.Close()\n\n\tvar version string\n\n\t_, err = fmt.Sscanf(\n\t\tresp.Request.URL.String(),\n\t\t\"https://github.com/ayoisaiah/focus/releases/tag/%s\",\n\t\t&version,\n\t)\n\tif err != nil {\n\t\tpterm.Error.Println(\"Failed to get latest version\")\n\t\treturn\n\t}\n\n\tif version == app.Version {\n\t\ttext := pterm.Sprintf(\n\t\t\t\"Congratulations, you are using the latest version of %s\",\n\t\t\tapp.Name,\n\t\t)\n\t\tspinner.Success(text)\n\t} else {\n\t\tpterm.Warning.Prefix = pterm.Prefix{\n\t\t\tText: \"UPDATE AVAILABLE\",\n\t\t\tStyle: pterm.NewStyle(pterm.BgYellow, pterm.FgBlack),\n\t\t}\n\t\tpterm.Warning.Printfln(\"A new release of Focus is available: %s at %s\", version, resp.Request.URL.String())\n\t}\n}", "title": "" }, { "docid": "92ab285ca72ab1dbafe48002786ae944", "score": "0.4700346", "text": "func StatusHandler(w http.ResponseWriter, r *http.Request) {\n\tstatus_requests_cnt.Inc()\n\n\tw.Write([]byte(\"API is up and running\"))\n}", "title": "" }, { "docid": "3fad39d2345594b19a89a7fdeb12ef68", "score": "0.4693324", "text": "func (j *jobsService) updateStatus(\n\tctx context.Context,\n\tevent Event,\n\tjobName string,\n\tstatus JobStatus,\n) error {\n\tjob, ok := event.Worker.Job(jobName)\n\tif !ok {\n\t\treturn &meta.ErrNotFound{\n\t\t\tType: JobKind,\n\t\t\tID: jobName,\n\t\t}\n\t}\n\n\t// We have a conflict if the job's phase is already terminal\n\tif job.Status.Phase.IsTerminal() {\n\t\treturn &meta.ErrConflict{\n\t\t\tType: JobKind,\n\t\t\tID: job.Name,\n\t\t\tReason: fmt.Sprintf(\n\t\t\t\t\"Event %q job %q has already reached a terminal phase.\",\n\t\t\t\tevent.ID,\n\t\t\t\tjob.Name,\n\t\t\t),\n\t\t}\n\t}\n\n\treturn errors.Wrapf(\n\t\tj.jobsStore.UpdateStatus(\n\t\t\tctx,\n\t\t\tevent.ID,\n\t\t\tjobName,\n\t\t\tstatus,\n\t\t),\n\t\t\"error updating status of event %q worker job %q in store\",\n\t\tevent.ID,\n\t\tjobName,\n\t)\n}", "title": "" }, { "docid": "a5f330c8ceda0a09ae931fbdb8423683", "score": "0.4688749", "text": "func StatusUpdate(pkt event.Packet) client.RegistryFunc {\n\treturn func(clients client.Registry) error {\n\t\tfrom := pkt.UIDs()[0]\n\n\t\tif _, ok := clients[from]; !ok {\n\t\t\treturn fmt.Errorf(\"for packet numbered %v client %v is not connected\", pkt.Sequence(), from)\n\t\t}\n\n\t\ttargetClient := clients[from]\n\n\t\tfor uid := range targetClient.Followers {\n\t\t\tfollower, ok := clients[uid]\n\t\t\tif !ok {\n\t\t\t\t// Client is no longer present, delete from followers\n\t\t\t\tdelete(targetClient.Followers, uid)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !follower.IsActive() {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif err := follower.Send(pkt); err != nil {\n\t\t\t\tlog.Debug(fmt.Sprintf(\"notify.StatusUpdate: for client %v, got error %#q\", uid, err))\n\t\t\t\tdelete(targetClient.Followers, uid)\n\n\t\t\t\tclient.UnregisterFunc(uid)(clients)\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "37b0860356b23db2f685ae4d5697ca8a", "score": "0.46886608", "text": "func (v Validator) UpdateStatus(newStatus sdk.BondStatus) Validator {\n\tv.Status = newStatus\n\treturn v\n}", "title": "" }, { "docid": "27e337ab24ab21c5bf1c29513abc1d7a", "score": "0.46796718", "text": "func (_BaseContent *BaseContentTransactor) UpdateStatus(opts *bind.TransactOpts, status_code *big.Int) (*types.Transaction, error) {\n\treturn _BaseContent.contract.Transact(opts, \"updateStatus\", status_code)\n}", "title": "" }, { "docid": "4b8df5e1da533649d0d1900fa8187dd0", "score": "0.4677954", "text": "func (s *RedisSpec) UpdateStatus(rsrc interface{}, reconciled []ResourceInfo, err error) {\n\tstatus := rsrc.(*AirflowClusterStatus)\n\tstatus.Redis = ComponentStatus{}\n\tif s != nil {\n\t\tstatus.Redis.update(reconciled, err)\n\t\tif status.Redis.Status != StatusReady {\n\t\t\tstatus.Status = StatusInProgress\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dfe03cdc07776d52874fe53b5ef8b3db", "score": "0.46753913", "text": "func (c *kongs) UpdateStatus(kong *v1alpha1.Kong) (result *v1alpha1.Kong, err error) {\n\tresult = &v1alpha1.Kong{}\n\terr = c.client.Put().\n\t\tNamespace(c.ns).\n\t\tResource(\"kongs\").\n\t\tName(kong.Name).\n\t\tSubResource(\"status\").\n\t\tBody(kong).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "79122dfb6cbf193ba4fdccb10fa02111", "score": "0.4666909", "text": "func (w *Window) updatePosition() {\n\tgeo := w.screen.Geometry()\n\n\tswitch w.config.Position {\n\tcase WindowPositionTop:\n\t\tw.window.Move2(geo.X(), geo.Y())\n\tdefault:\n\t\t// Default is bottom.\n\t\tw.window.Move2(geo.X(), geo.Y()+geo.Height()-w.window.Height())\n\t}\n}", "title": "" }, { "docid": "eb826c8c9aab373c64438f58479a81c5", "score": "0.46621695", "text": "func (d *Daemon) HandleStatus(w http.ResponseWriter, r *http.Request) {\n\td.RLock()\n\tdefer d.RUnlock()\n\tstatus := Status{\n\t\tCmd: strings.Join(d.cfg.command, \" \"),\n\t\tCount: d.count,\n\t}\n\n\t// only if process is running\n\tif d.process.cmd != nil {\n\t\tstatus.Fpid = d.fpid\n\t\tstatus.Pid = d.process.Pid()\n\t\tif d.process.eTime.IsZero() {\n\t\t\tstatus.Up = AbsSince(d.process.sTime)\n\t\t} else {\n\t\t\tstatus.Down = AbsSince(d.process.eTime)\n\t\t}\n\t} else {\n\t\tstartin := d.process.sTime.Add(time.Duration(d.cfg.Wait) * time.Second)\n\t\tstatus.Status = fmt.Sprintf(\"Starting in %0.1f seconds\", startin.Sub(time.Now()).Seconds())\n\t}\n\n\t// return status in json\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tif err := json.NewEncoder(w).Encode(status); err != nil {\n\t\tlog.Println(err)\n\t}\n}", "title": "" }, { "docid": "6c8743d4d14c1df4c88dd2108422a5d6", "score": "0.46576214", "text": "func (all *Widgets) Status() *StatusWidget { return all.widgets[StatusWidgetName].(*StatusWidget) }", "title": "" }, { "docid": "d1804220d369f48dc445f52addc6260e", "score": "0.46571428", "text": "func UpdateProgress(ctx context.Context, n, outof uint64) {\n\tt := GetTask(ctx)\n\tif t == nil {\n\t\tpanic(\"status.UpdateProgress called with no corresponding status.Start\")\n\t}\n\tt.completion = float32(n) / float32(outof)\n\tonTaskProgress(ctx, t)\n}", "title": "" }, { "docid": "8363f6bf7a5a964d6731e1afd797a426", "score": "0.46541125", "text": "func (p *PodsWidget) Update() error {\n\tif !p.pause {\n\t\tpods, err := p.apiClient.GetPodsMetrics(p.filter, p.sortorder)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\trows := make([][]string, len(pods))\n\t\tfor i, pod := range pods {\n\t\t\trows[i] = make([]string, 11)\n\t\t\trows[i][0] = pod.Namespace\n\t\t\trows[i][1] = pod.Name\n\t\t\trows[i][2] = fmt.Sprintf(\"%d/%d\", pod.ContainersReady, pod.ContainersCount)\n\t\t\trows[i][3] = pod.Status\n\t\t\trows[i][4] = fmt.Sprintf(\"%d\", pod.Restarts)\n\t\t\trows[i][5] = fmt.Sprintf(\"%dm\", pod.CPU)\n\t\t\trows[i][6] = helpers.RenderCPUMax(pod.CPUMax, pod.CPUMaxContainerCount, int64(pod.ContainersCount))\n\t\t\trows[i][7] = helpers.FormatBytes(pod.Memory)\n\t\t\trows[i][8] = helpers.RenderMemoryMax(pod.MemoryMax, pod.MemoryMaxContainerCount, int64(pod.ContainersCount))\n\t\t\trows[i][9] = pod.IP\n\t\t\trows[i][10] = helpers.FormatDuration(time.Now().Sub(pod.CreationDate))\n\t\t}\n\n\t\tp.Rows = rows\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5fd615b670da67834f4dc1c250bdbe82", "score": "0.46409422", "text": "func (s *Sysinfo) Update() {\n\tinfo := syscall.Sysinfo_t{}\n\terr := syscall.Sysinfo(&info)\n\tif err != nil {\n\t\tlog.Printf(\"Sysinfo call failed: %s\", err.Error())\n\t\treturn\n\t}\n\n\ts.uptime = uint64(info.Uptime)\n\ts.memTotal = info.Totalram\n\ts.memFree = info.Freeram\n\ts.memShared = info.Sharedram\n\ts.memBuffer = info.Bufferram\n\ts.swapTotal = info.Totalswap\n\ts.swapFree = info.Freeswap\n\ts.load = info.Loads\n\ts.procs = uint64(info.Procs)\n}", "title": "" }, { "docid": "3b12e118c0f38d9840cd4681fbf88bc7", "score": "0.46374905", "text": "func (s *eremeticScheduler) StatusUpdate(driver sched.SchedulerDriver, status *mesos.TaskStatus) {\n\tid := status.TaskId.GetValue()\n\n\tlog.Debugf(\"Received task status [%s] for task [%s]\", status.State.String(), id)\n\n\ttask, err := database.ReadTask(id)\n\tif err != nil {\n\t\tlog.Debugf(\"Error reading task from database: %s\", err)\n\t}\n\n\tif task.ID == \"\" {\n\t\ttask = types.EremeticTask{\n\t\t\tID: id,\n\t\t\tSlaveId: status.SlaveId.GetValue(),\n\t\t}\n\t}\n\n\tif !task.IsRunning() && *status.State == mesos.TaskState_TASK_RUNNING {\n\t\tTasksRunning.Inc()\n\t}\n\n\tif types.IsTerminal(status.State) {\n\t\tTasksTerminated.With(prometheus.Labels{\"status\": status.State.String()}).Inc()\n\t\tif task.WasRunning() {\n\t\t\tTasksRunning.Dec()\n\t\t}\n\t}\n\n\ttask.UpdateStatus(types.Status{\n\t\tStatus: status.State.String(),\n\t\tTime: time.Now().Unix(),\n\t})\n\n\tif *status.State == mesos.TaskState_TASK_FAILED && !task.WasRunning() {\n\t\tif task.Retry >= maxRetries {\n\t\t\tlog.Warnf(\"giving up on %s after %d retry attempts\", id, task.Retry)\n\t\t} else {\n\t\t\tlog.Infof(\"task %s was never running. re-scheduling\", id)\n\t\t\ttask.UpdateStatus(types.Status{\n\t\t\t\tStatus: mesos.TaskState_TASK_STAGING.String(),\n\t\t\t\tTime: time.Now().Unix(),\n\t\t\t})\n\t\t\ttask.Retry++\n\t\t\tgo func() {\n\t\t\t\tQueueSize.Inc()\n\t\t\t\ts.tasks <- id\n\t\t\t}()\n\t\t}\n\t}\n\n\tif types.IsTerminal(status.State) {\n\t\thandler.NotifyCallback(&task)\n\t}\n\n\tdatabase.PutTask(&task)\n}", "title": "" } ]
0362b7b5f55720f208020f91c5080186
Container implements the Pattern interface
[ { "docid": "a89c14508495e52077998d17d7fe5ebb", "score": "0.49234885", "text": "func (Term) Container() bool { return false }", "title": "" } ]
[ { "docid": "ead7a31cbe1955b05513dabb35f3dce1", "score": "0.5655181", "text": "func (Sequence) Container() bool { return true }", "title": "" }, { "docid": "047bbf253409d63f07b7322d495664d5", "score": "0.56152743", "text": "func (ArrayPattern) bindingPatternNode() {}", "title": "" }, { "docid": "f316ecd03e874ccec1ffb7cecf45f5b7", "score": "0.5432341", "text": "func (f *Factory) Container() dicgo.Container {\n\tif f.container == nil {\n\t\tf.container = dic()\n\t}\n\treturn f.container\n}", "title": "" }, { "docid": "f6f60a8ec8aa6ac14e4bf4ce3ee6de04", "score": "0.5348385", "text": "func (c *Context) Container() *dig.Container {\n\tcontainer := dig.New()\n\n\tfor _, constructor := range c.Constructors {\n\t\tcontainer.Provide(constructor)\n\t}\n\n\tfor _, constructor := range c.Constructors {\n\t\tcontainer.Provide(constructor)\n\t}\n\n\tfor _, module := range c.Modules {\n\t\tmodule.Inject(container)\n\t}\n\n\treturn container\n}", "title": "" }, { "docid": "2829f4f1c682e5af71b5ea08564b0b02", "score": "0.5266144", "text": "func (ZeroOrMore) Container() bool { return true }", "title": "" }, { "docid": "66e907ff5bec433cc823bdc63728859b", "score": "0.5224958", "text": "func NewPattern() *Pattern { return &Pattern{\"\", \"\", 0.0, make([]Track, 0)} }", "title": "" }, { "docid": "d050368f5a1343777c30daf60f6a4927", "score": "0.5182473", "text": "func (s *Canvas) Pattern(id string, x, y, width, height interface{}, userSpace bool, attributes ...string) {\n\tpatternUnits := \"userSpaceOnUse\"\n\tif !userSpace {\n\t\tpatternUnits = \"objectBoundingBox\"\n\t}\n\ts.printf(`<pattern id=\"%s\" x=\"%v\" y=\"%v\" width=\"%v\" height=\"%v\" patternUnits=\"%s\" %s>`, id, x, y, width, height, patternUnits, strings.Join(attributes, \" \"))\n\ts.println()\n}", "title": "" }, { "docid": "bd5e6b0586cbddfddd37774f5a4780f2", "score": "0.5168614", "text": "func (OneOrMore) Container() bool { return true }", "title": "" }, { "docid": "23131ca5fff8e685e87b10fc3a418abc", "score": "0.5103578", "text": "func (Lexed) Container() bool { return false }", "title": "" }, { "docid": "b50250609f345b0c4a5025d5cd2a49f5", "score": "0.49928653", "text": "func Pattern(v interface{}) gr.Modifier {\n\treturn gr.Prop(\"pattern\", v)\n}", "title": "" }, { "docid": "2556953e7452be7839fa1a646c8c8ade", "score": "0.49924546", "text": "func (ElementBinding) elementPatternNode() {}", "title": "" }, { "docid": "33ab141f905322c1fd8c50f892458675", "score": "0.4974465", "text": "func (p *Player) Container(c string) ([]*Card, error) {\n\n\tswitch c {\n\tcase DECK:\n\t\treturn p.deck, nil\n\tcase HAND:\n\t\treturn p.hand, nil\n\tcase SHIELDZONE:\n\t\treturn p.shieldzone, nil\n\tcase MANAZONE:\n\t\treturn p.manazone, nil\n\tcase GRAVEYARD:\n\t\treturn p.graveyard, nil\n\tcase BATTLEZONE:\n\t\treturn p.battlezone, nil\n\tcase SPELLZONE:\n\t\treturn p.spellzone, nil\n\tcase HIDDENZONE:\n\t\treturn p.hiddenzone, nil\n\tdefault:\n\t\treturn nil, errors.New(\"Invalid container\")\n\t}\n\n}", "title": "" }, { "docid": "57d8af8e88f7a4eb76e4f986f9d27193", "score": "0.4956116", "text": "func (builder *CFGBuilder) visitPattern(p ast.Pattern, t Type, bind *Bind) ([]string, []Data) {\n\tvarNames := []string{}\n\tvarBinds := []Data{}\n\tswitch pat := p.(type) {\n\tcase *ast.WildcardPattern:\n\t\t*bind = Bind{\n\t\t\tIDNode: builder.newIDNode(),\n\t\t\tBindType: t,\n\t\t}\n\tcase *ast.BinderPattern:\n\t\t*bind = Bind{\n\t\t\tIDNode: builder.newIDNode(),\n\t\t\tBindType: t,\n\t\t}\n\t\tvarNames = append(varNames, pat.Variable.Id)\n\t\tvarBinds = append(varBinds, bind)\n\n\tcase *ast.ConstructorPattern:\n\t\tfmt.Printf(\"ConstructorPattern %s\\n\", pat.ConstrName)\n\t\tvar typeList []Type\n\t\tswitch typ := t.(type) {\n\t\tcase *EnumType:\n\t\t\ttypeList = typ.Constructors[pat.ConstrName]\n\t\tcase *AppTT:\n\t\t\tto := typ.To\n\t\t\tabsTT, ok := to.(*AbsTT)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.New(fmt.Sprintf(\"Not supported AppTT ConstructorPattern %T\", to)))\n\t\t\t}\n\t\t\targs := typ.Args\n\t\t\tvars := absTT.Vars\n\t\t\tterm := absTT.Term\n\t\t\tenumType, ok := term.(*EnumType)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.New(fmt.Sprintf(\"Not supported AppTT ConstructorPattern %T\", to)))\n\t\t\t}\n\t\t\tconstrTypes := enumType.Constructors[pat.ConstrName]\n\t\t\tvarToIndex := make(map[Type]int)\n\t\t\tfor i, _ := range vars {\n\t\t\t\tvarToIndex[&vars[i]] = i\n\t\t\t}\n\t\t\tindicies := make([]int, len(constrTypes))\n\t\t\tfor i, c := range constrTypes {\n\t\t\t\tindex, ok := varToIndex[c]\n\t\t\t\tif !ok {\n\t\t\t\t\tpanic(errors.New(fmt.Sprintf(\"Not found Type order\")))\n\t\t\t\t}\n\t\t\t\tindicies[i] = index\n\t\t\t}\n\t\t\ttypeList = make([]Type, len(constrTypes))\n\t\t\tfor i, _ := range indicies {\n\t\t\t\ttypeList[i] = args[indicies[i]]\n\t\t\t}\n\t\tdefault:\n\t\t\tpanic(errors.New(fmt.Sprintf(\"In %s; Not constructor pattern type: %T %d\", pat.ConstrName, t, len(pat.Pats))))\n\t\t}\n\t\tif len(typeList) != len(pat.Pats) {\n\t\t\tpanic(errors.New(fmt.Sprintf(\"constructor pattern argument length mistmatch: %s\", pat.ConstrName)))\n\t\t}\n\t\twhenData := make([]Bind, len(pat.Pats))\n\t\tfor i, subp := range pat.Pats {\n\t\t\tvar bNames []string\n\t\t\tvar bBinds []Data\n\t\t\tbNames, bBinds = builder.visitPattern(subp, typeList[i], &whenData[i])\n\n\t\t\tvarNames = append(varNames, bNames...)\n\t\t\tvarBinds = append(varBinds, bBinds...)\n\t\t\t//whenData[i] = b\n\t\t}\n\t\t*bind = Bind{\n\t\t\tIDNode: builder.newIDNode(),\n\t\t\tBindType: t,\n\t\t\tCond: &Cond{\n\t\t\t\tIDNode: builder.newIDNode(),\n\t\t\t\tCase: pat.ConstrName,\n\t\t\t\tData: whenData,\n\t\t\t},\n\t\t}\n\tdefault:\n\t\tpanic(errors.New(\"Unknown pattern \"))\n\t}\n\treturn varNames, varBinds\n}", "title": "" }, { "docid": "e5c53d7f36ba87f21da0609e9319a074", "score": "0.4865989", "text": "func (p *Base) Patterns() []*Pattern {\n\n\tvar pt []*Pattern\n\tlinq.From(patterns).WhereT(func(pt *Pattern) bool {\n\t\treturn pt.Service == p.name\n\t}).ToSlice(&pt)\n\n\treturn pt\n}", "title": "" }, { "docid": "8d8ce812de5b46776799c65d8fdf1618", "score": "0.48447838", "text": "func (c MatchCase) Pattern() interface{} {\n\treturn c.pattern\n}", "title": "" }, { "docid": "ac95176b20889e9b5dcfa5034d83d329", "score": "0.4827675", "text": "func (c *Container) Container(class, name string) (container *Container, err error) {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\tif c.closed() {\n\t\treturn nil, ErrClosed\n\t}\n\tidispatch, err := c.iface.GetObject(class, name)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer idispatch.Release()\n\tiresult, err := idispatch.QueryInterface(comutil.GUID(comiid.IADsContainer))\n\tif err != nil {\n\t\treturn\n\t}\n\tiface := (*api.IADsContainer)(unsafe.Pointer(iresult))\n\tcontainer = NewContainer(iface)\n\treturn\n}", "title": "" }, { "docid": "4daf9a0ab9d58df48041667c721f72f0", "score": "0.4818185", "text": "func (TermExact) Container() bool { return false }", "title": "" }, { "docid": "5d76ac9699d5762cbceb1135b00f2f7b", "score": "0.47936687", "text": "func (obj *pattern) Pattern() *regexp.Regexp {\n\treturn obj.ptrn\n}", "title": "" }, { "docid": "837468c4e6e238d5ee36a3ab6779ba23", "score": "0.47372285", "text": "func (Optional) Container() bool { return true }", "title": "" }, { "docid": "171e5655477373ff5fe8ac72fca2dbae", "score": "0.4727938", "text": "func (m *Module) Inject(container *dig.Container) {\n\tfor _, constructor := range m.Constructors {\n\t\tcontainer.Provide(constructor)\n\t}\n\tcontainer.Provide(m.OpenFunc)\n\treturn\n}", "title": "" }, { "docid": "6e460d47d7882754d0642f991a9b0273", "score": "0.46998113", "text": "func (p *Patrun)List(pat map[string]string, exact bool) []Pattern {\n var items []Pattern\n var keyMap []string\n\n if pat == nil {\n pat = map[string]string{}\n }\n\n if p.tree.data != nil {\n items = append(items, createMatchList(keyMap, p.tree.data, p.tree.modifier))\n }\n\n if p.tree.key != \"\" {\n\n descendTree(&items, pat, exact, true, p.tree.value, keyMap)\n }\n return items\n}", "title": "" }, { "docid": "f679e1cb7cac76ec57bf8dd674b7dbd2", "score": "0.4690262", "text": "func (v *Value) Pattern() Patterner {\n\treturn NewPattern(v.String())\n}", "title": "" }, { "docid": "64ffac65e62f2ce11227524490ca4d31", "score": "0.46882534", "text": "func (_this *SVGPatternElement) PatternContentUnits() *SVGAnimatedEnumeration {\n\tvar ret *SVGAnimatedEnumeration\n\tvalue := _this.Value_JS.Get(\"patternContentUnits\")\n\tret = SVGAnimatedEnumerationFromJS(value)\n\treturn ret\n}", "title": "" }, { "docid": "ce74094d028072542ef0b317ac43a060", "score": "0.46598187", "text": "func Seq(sequence ...Pattern) Pattern {\n\tswitch len(sequence) {\n\tcase 0:\n\t\treturn True\n\tcase 1:\n\t\treturn sequence[0]\n\tdefault:\n\t\treturn &patternSequence{sequence}\n\t}\n}", "title": "" }, { "docid": "690615b44b7b40fc4174bee651b9ce3b", "score": "0.46485305", "text": "func (this *Parser) Add(seq Sequence) error {\n\tthis.mu.Lock()\n\tdefer this.mu.Unlock()\n\n\tcur := this.root\n\n\tfor _, token := range seq {\n\t\tvar key string\n\n\t\tswitch {\n\t\tcase token.Field != FieldUnknown:\n\t\t\tkey = token.Field.String()\n\n\t\tcase token.Type != TokenUnknown && token.Type != TokenLiteral:\n\t\t\tkey = token.Type.String()\n\n\t\tcase token.Type == TokenLiteral:\n\t\t\tkey = token.Value\n\t\t}\n\n\t\tfound, ok := cur.children[key]\n\t\tif !ok {\n\t\t\tfound = newParseNode()\n\t\t\tfound.Token = token\n\t\t\tcur.children[key] = found\n\t\t}\n\n\t\tcur = found\n\t}\n\n\tcur.leaf = true\n\n\t//fmt.Printf(\"parser.go/AddPattern(): count = %d, height = %d\\n\", msg.Count(), this.height)\n\tif len(seq)+1 > this.height {\n\t\tthis.height = len(seq) + 1\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2b07c6a967900b38c9f19d66d438c66c", "score": "0.46401244", "text": "func (o InfinispanSpecOutput) Container() InfinispanSpecContainerPtrOutput {\n\treturn o.ApplyT(func(v InfinispanSpec) *InfinispanSpecContainer { return v.Container }).(InfinispanSpecContainerPtrOutput)\n}", "title": "" }, { "docid": "59630410c21be80d9cb7965961b190af", "score": "0.4637773", "text": "func NewItemContainer(nref, artAdjNoun, prep string, plural bool,\n descFile *string, mass, bulk interface{},\n toggleable, open bool) *ItemContainer {\n ni := NewItem(nref, artAdjNoun, prep, plural, mass, bulk)\n nic := ItemContainer{\n Item: *ni,\n WillToggle: toggleable,\n OpenState: open,\n Sides: make(map[byte]*ThingList),\n }\n \n ref.Reregister(&nic)\n return &nic\n}", "title": "" }, { "docid": "49f420d2a19deaaa92901a4dd6fa9dc9", "score": "0.46157447", "text": "func createContainer(size int) [][]BoardElement {\n\tboard := make([][]BoardElement, size)\n\tfor i := 0; i < size; i++ {\n\t\tboard[i] = make([]BoardElement, size)\n\t}\n\treturn board\n}", "title": "" }, { "docid": "f55d315cb03d3db911115be65a3923fa", "score": "0.46085674", "text": "func Any() Pattern {\n\treturn &AnyPattern{}\n}", "title": "" }, { "docid": "494e8995d1a23bb1c3246115e5e79aeb", "score": "0.46064392", "text": "func (o *Object) Container() *Container {\n\treturn o.c\n}", "title": "" }, { "docid": "15bac147ba5e754875c46d61696f2f71", "score": "0.45977396", "text": "func Pattern(p string) {\n\tdsl.Pattern(p)\n}", "title": "" }, { "docid": "b84de430e6b43b779e0a150de9b49e52", "score": "0.45948574", "text": "func Container() *container.Container {\n\tx := container.New()\n\n\tx.SetVersion(refstest.Version())\n\tx.SetAttributes(Attributes())\n\tx.SetOwnerID(ownertest.Generate())\n\tx.SetBasicACL(123)\n\tx.SetPlacementPolicy(netmaptest.PlacementPolicy())\n\n\treturn x\n}", "title": "" }, { "docid": "2c329fea5971aa12b5eacf685ff5d226", "score": "0.45932484", "text": "func (p *Player) ContainerRef(c string) (*[]*Card, error) {\n\n\tswitch c {\n\tcase DECK:\n\t\treturn &p.deck, nil\n\tcase HAND:\n\t\treturn &p.hand, nil\n\tcase SHIELDZONE:\n\t\treturn &p.shieldzone, nil\n\tcase MANAZONE:\n\t\treturn &p.manazone, nil\n\tcase GRAVEYARD:\n\t\treturn &p.graveyard, nil\n\tcase BATTLEZONE:\n\t\treturn &p.battlezone, nil\n\tcase SPELLZONE:\n\t\treturn &p.spellzone, nil\n\tcase HIDDENZONE:\n\t\treturn &p.hiddenzone, nil\n\tdefault:\n\t\treturn nil, errors.New(\"Invalid container\")\n\t}\n\n}", "title": "" }, { "docid": "2feeb13d61ebab952d77717f7517d42c", "score": "0.45844626", "text": "func FinalContainerDef(cr *redisv1alpha1.Redis, role string) []corev1.Container {\n\tvar containerDefinition []corev1.Container\n\tvar exporterDefinition corev1.Container\n\tvar exporterEnvDetails []corev1.EnvVar\n\n\tcontainerDefinition = append(containerDefinition, GenerateContainerDef(cr, role))\n\n\tif !cr.Spec.RedisExporter.Enabled {\n\t\treturn containerDefinition\n\t}\n\n\tif cr.Spec.GlobalConfig.Password != nil {\n\t\texporterEnvDetails = []corev1.EnvVar{\n\t\t\t{\n\t\t\t\tName: \"REDIS_PASSWORD\",\n\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\tName: cr.ObjectMeta.Name,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tKey: \"password\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, {\n\t\t\t\tName: \"REDIS_ADDR\",\n\t\t\t\tValue: \"redis://localhost:6379\",\n\t\t\t},\n\t\t}\n\t} else {\n\t\texporterEnvDetails = []corev1.EnvVar{\n\t\t\t{\n\t\t\t\tName: \"REDIS_ADDR\",\n\t\t\t\tValue: \"redis://localhost:6379\",\n\t\t\t},\n\t\t}\n\t}\n\texporterDefinition = corev1.Container{\n\t\tName: constRedisExpoterName,\n\t\tImage: cr.Spec.RedisExporter.Image,\n\t\tImagePullPolicy: cr.Spec.RedisExporter.ImagePullPolicy,\n\t\tEnv: exporterEnvDetails,\n\t\tResources: corev1.ResourceRequirements{\n\t\t\tLimits: corev1.ResourceList{}, Requests: corev1.ResourceList{},\n\t\t},\n\t}\n\n\tif cr.Spec.RedisExporter.Resources != nil {\n\t\texporterDefinition.Resources.Limits[corev1.ResourceCPU] = resource.MustParse(cr.Spec.RedisExporter.Resources.ResourceLimits.CPU)\n\t\texporterDefinition.Resources.Requests[corev1.ResourceCPU] = resource.MustParse(cr.Spec.RedisExporter.Resources.ResourceRequests.CPU)\n\t\texporterDefinition.Resources.Limits[corev1.ResourceMemory] = resource.MustParse(cr.Spec.RedisExporter.Resources.ResourceLimits.Memory)\n\t\texporterDefinition.Resources.Requests[corev1.ResourceMemory] = resource.MustParse(cr.Spec.RedisExporter.Resources.ResourceRequests.Memory)\n\t}\n\n\tcontainerDefinition = append(containerDefinition, exporterDefinition)\n\treturn containerDefinition\n}", "title": "" }, { "docid": "febcad6916698edbc7e7476b995b69ba", "score": "0.45832372", "text": "func (ctx *CanvasRenderingContext2D) CreatePattern(image Element, repetition string) *CanvasPattern {\n\treturn &CanvasPattern{Value: ctx.Call(\"createPattern\", image.Underlying(), repetition)}\n}", "title": "" }, { "docid": "ef781102fb5ef27fa9a5fd1f06a052a5", "score": "0.45818055", "text": "func Container(logger logr.Logger, spec v1alpha1.SplunkCollectorSpec) corev1.Container {\n\timage := spec.Image\n\tif len(image) == 0 {\n\t\timage = defaultCollectorImage\n\t}\n\n\targsMap := spec.Args\n\tif argsMap == nil {\n\t\targsMap = map[string]string{}\n\t}\n\n\tif _, exists := argsMap[\"config\"]; exists {\n\t\tlogger.Info(\"the 'config' flag isn't allowed and is being ignored\")\n\t}\n\n\t// this effectively overrides any 'config' entry that might exist in the CR\n\targsMap[\"config\"] = fmt.Sprintf(\"/conf/%s\", configmapEntry)\n\n\tvar args []string\n\tfor k, v := range argsMap {\n\t\targs = append(args, fmt.Sprintf(\"--%s=%s\", k, v))\n\t}\n\n\tvolumeMounts := []corev1.VolumeMount{{\n\t\tName: naming.ConfigMapVolume(),\n\t\tMountPath: \"/conf\",\n\t}}\n\n\tvolumeMounts = append(volumeMounts, spec.VolumeMounts...)\n\n\tvar envVars = spec.Env\n\tif spec.Env == nil {\n\t\tenvVars = []corev1.EnvVar{}\n\t}\n\n\treturn corev1.Container{\n\t\tName: naming.Container(),\n\t\tImage: image,\n\t\tImagePullPolicy: spec.ImagePullPolicy,\n\t\tVolumeMounts: volumeMounts,\n\t\tArgs: args,\n\t\tEnv: envVars,\n\t\tResources: spec.Resources,\n\t\tSecurityContext: spec.SecurityContext,\n\t}\n}", "title": "" }, { "docid": "f6273f20ade03aaf9f96b58d323f5702", "score": "0.45793712", "text": "func (o TempUrlOutput) Container() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *TempUrl) pulumi.StringOutput { return v.Container }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "956466de355be949baa12648353031ad", "score": "0.453641", "text": "func (_this *SVGPatternElement) PatternTransform() *SVGAnimatedTransformList {\n\tvar ret *SVGAnimatedTransformList\n\tvalue := _this.Value_JS.Get(\"patternTransform\")\n\tret = SVGAnimatedTransformListFromJS(value)\n\treturn ret\n}", "title": "" }, { "docid": "213f801b8ffb0b2a55f6a5cc31add45e", "score": "0.45247075", "text": "func newNodeContainer(c nodeContent, duplicates bool) *nodeContainer {\n\tnc := &nodeContainer{\n\t\troot: &node{\n\t\t\tcontent: c,\n\t\t},\n\t\tduplicates: duplicates,\n\t}\n\tnc.root.container = nc\n\treturn nc\n}", "title": "" }, { "docid": "074657ae643cb08d4a8163a545168ea1", "score": "0.45210326", "text": "func (container *Container) Clone() (newContainer *Container) {\n\treturn\n}", "title": "" }, { "docid": "8663ac2cca57fd7b76eab1042911a628", "score": "0.44978333", "text": "func newPatternsList(in []string) (PatternsList, error) {\n\tlist := PatternsList{}\n\n\tfor _, str := range in {\n\t\tre, err := strToRegexp(str)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tlist = append(list, re)\n\t}\n\n\treturn list, nil\n}", "title": "" }, { "docid": "d0c662c4b35a90245dd05afb27be8e1f", "score": "0.4496553", "text": "func NewContainer(data interface{}) *Container {\n\treturn &Container{data: data}\n}", "title": "" }, { "docid": "210460432e7985dc2febf8081a1d134e", "score": "0.44927377", "text": "func (o InfinispanSpecPtrOutput) Container() InfinispanSpecContainerPtrOutput {\n\treturn o.ApplyT(func(v *InfinispanSpec) *InfinispanSpecContainer {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Container\n\t}).(InfinispanSpecContainerPtrOutput)\n}", "title": "" }, { "docid": "948b8305188fea56c580bc5c424a5e2c", "score": "0.44916233", "text": "func Ref(grpname string) Pattern {\n\treturn &patternTextReferring{grpname}\n}", "title": "" }, { "docid": "4660773eeeb0209a26284dc2595f82e7", "score": "0.44407967", "text": "func (i IPPort) construct() IPPortClass { return &i }", "title": "" }, { "docid": "be14b6f03a580517ee9e3987a7612249", "score": "0.44357574", "text": "func container(pkgs []plugin.Info) (normalizer, error) {\n\tr, _, err := versioning(pkgs)\n\treturn r, err\n}", "title": "" }, { "docid": "594c3197679c5db9b3926241968e0fe9", "score": "0.4429069", "text": "func (qr *QR) placeFinderPatterns() {\n\tdrawPattern(qr.Canvas, 0, 0, 7)\n\tdrawPattern(qr.Canvas, qr.Modules-7, 0, 7)\n\tdrawPattern(qr.Canvas, 0, qr.Modules-7, 7)\n}", "title": "" }, { "docid": "aaef89c2fb3026845b3b536452a70d83", "score": "0.4428971", "text": "func (this *RegexpReplace) Constructor() FunctionConstructor { return NewRegexpReplace }", "title": "" }, { "docid": "7cded3aa8dd81f70a68514797b10b073", "score": "0.44251293", "text": "func (_this *SVGPatternElement) PatternUnits() *SVGAnimatedEnumeration {\n\tvar ret *SVGAnimatedEnumeration\n\tvalue := _this.Value_JS.Get(\"patternUnits\")\n\tret = SVGAnimatedEnumerationFromJS(value)\n\treturn ret\n}", "title": "" }, { "docid": "7ba199215b54dc9ab0dc8b0e0c89cb62", "score": "0.44090235", "text": "func (c *Container) Children() (iter *ObjectIter, err error) {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\tif c.closed() {\n\t\treturn nil, ErrClosed\n\t}\n\tiunknown, err := c.iface.NewEnum()\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer iunknown.Release()\n\tidispatch, err := iunknown.QueryInterface(ole.IID_IEnumVariant)\n\tif err != nil {\n\t\treturn\n\t}\n\tiface := (*ole.IEnumVARIANT)(unsafe.Pointer(idispatch))\n\titer = NewObjectIter(iface)\n\treturn\n}", "title": "" }, { "docid": "344be4ff1f6d83e20ab23a42150e0c54", "score": "0.4404413", "text": "func (d *Decoder) readPattern() (*Pattern, error) {\n\t// Read header\n\theader := make([]byte, numHeaderBytes)\n\tif _, err := d.reader.Read(header); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Validate header\n\tif !bytes.Equal(header, headerValue) {\n\t\treturn nil, ErrInvalidSpliceData\n\t}\n\n\t// Read payload size\n\tvar payloadSize uint64\n\tif err := binary.Read(d.reader, binary.BigEndian, &payloadSize); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Read hardware version\n\thwVersionBytes := make([]byte, numHWVersionBytes)\n\tif _, err := d.reader.Read(hwVersionBytes); err != nil {\n\t\treturn nil, err\n\t}\n\thwVersionBytes = removeNullBytes(hwVersionBytes)\n\thwVersion := string(hwVersionBytes)\n\n\t// Read tempo\n\tvar tempo float32\n\tif err := binary.Read(d.reader, binary.LittleEndian, &tempo); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Read track data\n\ttracks, err := d.parseTracks()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpattern := &Pattern{\n\t\thw: hwVersion,\n\t\ttempo: tempo,\n\t\ttracks: tracks,\n\t}\n\n\treturn pattern, nil\n}", "title": "" }, { "docid": "2355c137794ef721d88f63e22ad08d7a", "score": "0.44001412", "text": "func (o InfinispanSpecServiceOutput) Container() InfinispanSpecServiceContainerPtrOutput {\n\treturn o.ApplyT(func(v InfinispanSpecService) *InfinispanSpecServiceContainer { return v.Container }).(InfinispanSpecServiceContainerPtrOutput)\n}", "title": "" }, { "docid": "8c1e7afbc9b97d455e0cb7fed94eaf6c", "score": "0.43801108", "text": "func Pat(kind ProcedureKind, predecessors ...Pattern) Pattern {\n\treturn &OneKindPattern{\n\t\tkind: kind,\n\t\tpredecessors: predecessors,\n\t}\n}", "title": "" }, { "docid": "3d43843f091bf0e81a0aa52463106ed0", "score": "0.43797326", "text": "func marshalPattern(p Pattern) []byte {\n\tb, err := json.Marshal(&SPattern{p})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}", "title": "" }, { "docid": "956053481bab738d6c9c5f0a350d3dd1", "score": "0.43638566", "text": "func New(things []string) Container {\n\treturn Container{things: things}\n}", "title": "" }, { "docid": "5997a44a8d684eb056896982042ecd93", "score": "0.43619144", "text": "func (i *Index) AddPattern(p *pattern.Pattern) {\n\ti.mux.Lock()\n\tdefer i.mux.Unlock()\n\tfor _, word := range p.Sentence().Words {\n\t\tif word != store.Nothing {\n\t\t\tif _, ok := i.inverse[word]; ok {\n\t\t\t\ti.inverse[word] = append(i.inverse[word], p)\n\t\t\t} else {\n\t\t\t\ti.inverse[word] = []*pattern.Pattern{p}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d5accd9e36d332ceb3acfe861133c9f4", "score": "0.43542957", "text": "func (this *Pattern) Clone() *Pattern {\n\tif this == nil {\n\t\treturn nil\n\t}\n\tthat := &Pattern{}\n\tderiveDeepCopyPattern(that, this)\n\treturn that\n}", "title": "" }, { "docid": "ea88b7de449fc5e8e1e9f6fb9c56f2d0", "score": "0.4349097", "text": "func NewContainer(log logrus.FieldLogger) Container {\n\treturn &container{\n\t\tlog: log,\n\t\tservices: make([]*entry, 0),\n\t}\n}", "title": "" }, { "docid": "d1a2d21f7e7a616225f3487690926e57", "score": "0.43481797", "text": "func NewPattern(cola, colb Color) *Pattern {\n\tmatrix := NewMatrix(4, 4)\n\tmatrix, _ = matrix.GetIdentity()\n\tpat := &Pattern{\n\t\tColorA: cola,\n\t\tColorB: colb,\n\t\tTransform: matrix,\n\t}\n\treturn pat\n}", "title": "" }, { "docid": "1b90b8ae289cddafbc80b53b75f440c5", "score": "0.43426272", "text": "func NewContainer() Container {\n\treturn &container{\n\t\tdefs: map[string]*def{},\n\t\tservices: map[string]interface{}{},\n\t}\n}", "title": "" }, { "docid": "d375a79fcee5780d9cdcaba8d4a7febf", "score": "0.43417358", "text": "func containers(details bool) []Container {\n\tvar contArr []Container\n\n\tfor _, c := range cont.Containers() {\n\t\thostname, err := ioutil.ReadFile(path.Join(config.Agent.LxcPrefix, c, \"/rootfs/etc/hostname\"))\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tconfigPath := path.Join(config.Agent.LxcPrefix, c, \"config\")\n\n\t\tif ct, err := db.FindContainerByName(c); err == nil && ct != nil {\n\n\t\t\taContainer := Container{\n\t\t\t\tName: ct.Name,\n\t\t\t\tHostname: strings.TrimSpace(string(hostname)),\n\t\t\t\tStatus: cont.State(c),\n\t\t\t\tVlan: ct.Vlan,\n\t\t\t\tEnvId: ct.EnvironmentId,\n\t\t\t}\n\n\t\t\taContainer.Interfaces = interfaces(c, ct.Ip)\n\n\t\t\t//cacheable properties>>>\n\n\t\t\taContainer.ID = util.GetFromCacheOrCalculate(cache, c+\"_fingerprint\", func() string {\n\t\t\t\treturn gpg.GetFingerprint(c)\n\t\t\t})\n\n\t\t\taContainer.Arch = util.GetFromCacheOrCalculate(cache, c+\"_arch\", func() string {\n\t\t\t\treturn strings.ToUpper(cont.GetConfigItem(configPath, \"lxc.arch\"))\n\t\t\t})\n\n\t\t\taContainer.Parent = util.GetFromCacheOrCalculate(cache, c+\"_parent\", func() string {\n\t\t\t\treturn cont.GetConfigItem(configPath, \"subutai.parent\")\n\t\t\t})\n\n\t\t\taContainer.Quota.RAM = cont.QuotaRAM(c, \"\")\n\n\t\t\taContainer.Quota.CPU = cont.QuotaCPU(c, \"\")\n\n\t\t\taContainer.Quota.Disk = cont.QuotaDisk(c, \"\")\n\n\t\t\t//<<<cacheable properties\n\n\t\t\tif details {\n\t\t\t\taContainer.Pk = gpg.GetContainerPk(c)\n\t\t\t}\n\n\t\t\tcontArr = append(contArr, aContainer)\n\n\t\t}\n\t}\n\treturn contArr\n}", "title": "" }, { "docid": "7b9540b066be9d6be17259a952a93772", "score": "0.43300238", "text": "func (pattern *Pattern) Encode() io.Reader {\n\tbuf := new(bytes.Buffer)\n\tbuf.WriteString(\"SPLICE\")\n\n\tcontentbuf := new(bytes.Buffer)\n\n\t// Write version\n\tcontentbuf.WriteString(pattern.Version)\n\tcontentbuf.Write(make([]byte, 32-len(pattern.Version)))\n\n\t// Write tempo\n\tbinary.Write(contentbuf, binary.LittleEndian, pattern.Tempo)\n\n\t// Write tracks\n\tfor _, track := range pattern.Tracks {\n\t\tbinary.Write(contentbuf, binary.LittleEndian, int32(track.ID))\n\t\tbinary.Write(contentbuf, binary.LittleEndian, int8(len(track.Name)))\n\t\tcontentbuf.WriteString(track.Name)\n\t\tfor _, step := range track.Steps {\n\t\t\tif step {\n\t\t\t\tbinary.Write(contentbuf, binary.LittleEndian, int8(1))\n\t\t\t} else {\n\t\t\t\tbinary.Write(contentbuf, binary.LittleEndian, int8(0))\n\t\t\t}\n\t\t}\n\t}\n\n\t// Write contentlength and content to buffer\n\tbinary.Write(buf, binary.BigEndian, int64(contentbuf.Len()))\n\tcontentbuf.WriteTo(buf)\n\n\treturn buf\n}", "title": "" }, { "docid": "ad37e4c2ce24679c87e0342e7317e47a", "score": "0.4327597", "text": "func (c *CharacterFilterPatternReplaceChar) Pattern(pattern string) *CharacterFilterPatternReplaceChar {\n\tc.pattern = pattern\n\treturn c\n}", "title": "" }, { "docid": "920da711568b8769e898e31d24e221f7", "score": "0.43246472", "text": "func (g *Group) Register(name string, tag string, i interface{}) error {\n\n\tif i == nil {\n\t\treturn errors.New(\"Type argument is nil\")\n\t}\n\tif name == \"\" {\n\t\treturn errors.New(\"Name is invalid\")\n\t}\n\n\tg.lock.Lock()\n\tdefer g.lock.Unlock()\n\n\t// zero value principle support code.\n\tif g.items == nil {\n\t\tg.items = make(itemContainer)\n\t}\n\n\t// try to unwrap the type if it is a pointer\n\tt := reflect.TypeOf(i)\n\tif t.Kind() == reflect.Ptr {\n\t\tt = t.Elem()\n\t}\n\n\t// ensure the given object is a struct\n\tif t.Kind() != reflect.Struct {\n\t\treturn errors.Errorf(\"Type '%v' is not a struct\", t)\n\t}\n\n\t// build the tree\n\ttr, err := buildTree(tag, t)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"Failed to build type '%v'\", name)\n\t}\n\n\tg.items[name] = tr\n\n\treturn nil\n}", "title": "" }, { "docid": "7769821c6c1f4ed88c9b54fcb62337c2", "score": "0.43144667", "text": "func AllPattern() gRuntime.Pattern {\n\treturn gRuntime.MustPattern(gRuntime.NewPattern(1, []int{int(utilities.OpPush), 0}, []string{\"\"}, \"\"))\n}", "title": "" }, { "docid": "1ca4110ad7cad9e88d5d32a92f0f8225", "score": "0.4301369", "text": "func (root *node) insert(pattern string, parts []string, height int) {\n\t// 达到模式串指定的深度\n\tif len(parts) == height {\n\t\tif root.pattern != \"\" {\n\t\t\t// 路由添加短路逻辑1:如果某个路由重复添加,直接panic\n\t\t\tpanic(fmt.Errorf(\"[trie node] insert error , pattern of node is not empty, pattern of node :%s, insert pattern :%s\", root.pattern, pattern))\n\t\t}\n\t\t// 赋值模式串\n\t\troot.pattern = pattern\n\t\treturn\n\t}\n\tpart := parts[height]\n\tchildNode := matchChildNode(root, part)\n\n\tcheckPattern(pattern, part, root, height)\n\n\tif childNode == nil {\n\t\tchildNode = &node{part: part, isWild: part[0] == ':' || part[0] == '*'}\n\t\troot.children = append(root.children, childNode)\n\t}\n\n\tchildNode.insert(pattern, parts, height+1)\n}", "title": "" }, { "docid": "58b49c006add4053495d1ac65f9bdaab", "score": "0.42753363", "text": "func (c *Container) Inject(ptr interface{}) (err error) {\n\telemType := reflect.TypeOf(ptr).Elem()\n\telemVal := reflect.ValueOf(ptr).Elem()\n\n\tfor i := 0; i < elemType.NumField(); i++ { // 遍历字段\n\t\tfieldType := elemType.Field(i)\n\t\t// get tag. eg: `DI:\"request\"`\n\t\ttag := fieldType.Tag.Get(\"DI\")\n\t\tname := c.getInjectName(tag)\n\t\tif name == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tdiInstance, err := c.Get(name)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"dependency not found: %s\", name)\n\t\t}\n\n\t\telemVal.Field(i).Set(reflect.ValueOf(diInstance))\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "1bb625c5199e5481a62d9376798eed44", "score": "0.4270928", "text": "func (m *SchemaMutator) Pattern(v string) *SchemaMutator {\n\tm.lock.Lock()\n\tdefer m.lock.Unlock()\n\tm.proxy.pattern = v\n\treturn m\n}", "title": "" }, { "docid": "91c98b18d4c318c1ca54253ac716510c", "score": "0.42704314", "text": "func filterInstancesByPattern(instances [](*Instance), pattern string) [](*Instance) {\n\tif pattern == \"\" {\n\t\treturn instances\n\t}\n\tfiltered := [](*Instance){}\n\tfor _, instance := range instances {\n\t\tif matched, _ := regexp.MatchString(pattern, instance.Key.DisplayString()); matched {\n\t\t\tfiltered = append(filtered, instance)\n\t\t}\n\t}\n\treturn filtered\n}", "title": "" }, { "docid": "59e39c3036e1dc148adcc7a0ef1f2502", "score": "0.42653435", "text": "func (Either) Container() bool { return true }", "title": "" }, { "docid": "a974d354d9c7447834f519825dea432f", "score": "0.42575836", "text": "func (k Kind) Pattern() string {\n\tswitch k {\n\tcase Bool:\n\t\treturn `\\b(true|false)\\b`\n\tcase Int:\n\t\treturn \"[0-9]+\"\n\tcase Float:\n\t\treturn \"[0-9.]+\"\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "8995c047f8775e9c4bb48531c182340b", "score": "0.42532268", "text": "func containerDistributor(input <-chan *Page) <-chan *PageContainer {\n\toutput := make(chan *PageContainer, 50)\n\tgo func() {\n\t\tvar page *Page\n\t\tvar ok bool\n\t\tfor {\n\t\t\tpage, ok = <-input\n\n\t\t\tif !ok {\n\t\t\t\t// channel was closed!\n\t\t\t\tclose(output)\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\toutput <- &PageContainer{Page: page}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn output\n}", "title": "" }, { "docid": "26d618b275bd8528b7f890ebc1f5eab5", "score": "0.42424154", "text": "func (po *AbstractPolyadicExpression) Children() []ExpressionInterface {\n\treturn po.children\n}", "title": "" }, { "docid": "f27f3f4dd55de579644fffc806018e68", "score": "0.42394283", "text": "func (s *Canvas) PatternClose() { s.println(\"</pattern>\") }", "title": "" }, { "docid": "cb28fe83aa9d050b1491e92cffb68bfb", "score": "0.42356217", "text": "func (self *Rope) Children() []DisplayObject{\n\tarray00 := self.Object.Get(\"children\")\n\tlength00 := array00.Length()\n\tout00 := make([]DisplayObject, length00, length00)\n\tfor i00 := 0; i00 < length00; i00++ {\n\t\tout00[i00] = DisplayObject{array00.Index(i00)}\n\t}\n\treturn out00\n}", "title": "" }, { "docid": "de8d8a0c8e25d0597bc2221ba4d58ebc", "score": "0.42276862", "text": "func Register(i Implementation) {\n\timplementations = append(implementations, i)\n}", "title": "" }, { "docid": "b1497b322cd43f86077c7b9939a66cd3", "score": "0.4227317", "text": "func (Sequence) TerminalPattern() Pattern { return nil }", "title": "" }, { "docid": "6b3773426a5c432d5846957353087646", "score": "0.42052355", "text": "func newNodeContainerType(rootType reflect.Type, path *gpb.Path) (interface{}, spb.Status) {\n\tdbgPrintln(\"newNodeContainerType: type %s, next path %v\", rootType, path.GetElem()[0])\n\n\tif !IsTypeStructPtr(rootType) {\n\t\treturn nil, toStatus(scpb.Code_INVALID_ARGUMENT, fmt.Sprintf(\"newNodeContainerType: rootType has type %s, expect struct ptr\", rootType))\n\t}\n\n\tt := rootType.Elem()\n\n\tfor i := 0; i < t.NumField(); i++ {\n\t\tf := t.Field(i)\n\t\tps, err := schemaPaths(f)\n\t\tif err != nil {\n\t\t\treturn nil, errToStatus(err)\n\t\t}\n\t\tfor _, p := range ps {\n\t\t\tif pathMatchesPrefix(path, p) {\n\t\t\t\t// don't trim whole prefix for keyed list since name and key\n\t\t\t\t// are a in the same element.\n\t\t\t\tto := len(p)\n\t\t\t\tif IsTypeMap(f.Type) {\n\t\t\t\t\tto--\n\t\t\t\t}\n\t\t\t\treturn NewNode(f.Type, trimGNMIPathPrefix(path, p[0:to]))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, toStatus(scpb.Code_NOT_FOUND, fmt.Sprintf(\"could not find path in tree beyond type %s, remaining path %v\", rootType, path))\n}", "title": "" }, { "docid": "f1cd7d9869d0c480257fae8416ca1a79", "score": "0.42034325", "text": "func init() {\n\tAddImageType(&MyContainer{})\n}", "title": "" }, { "docid": "7a8449537397da9927183e27945f3016", "score": "0.4198246", "text": "func (docker *Docker) Container(image string) *Docker {\n\tdocker.Image = image\n\treturn docker\n}", "title": "" }, { "docid": "cad0a1aa6c8536c619b0f316a5379bcd", "score": "0.41971508", "text": "func (ElementConstructor) Regex(key string, pattern, options string) *Element {\n\tsize := uint32(1 + len(key) + 1 + len(pattern) + 1 + len(options) + 1)\n\telem := newElement(0, uint32(1+len(key)+1))\n\telem.value.data = make([]byte, size)\n\n\t_, err := elements.Regex.Element(0, elem.value.data, key, pattern, options)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn elem\n}", "title": "" }, { "docid": "22010bb00d5833574e9fde1d0b87d800", "score": "0.41942227", "text": "func (i Instances) Decode() {\n\tfor _, instance := range i {\n\t\tinstance.decode()\n\t}\n}", "title": "" }, { "docid": "88befcfcdd1edff24748f8218e40c55f", "score": "0.4192363", "text": "func (o InfinispanSpecServicePtrOutput) Container() InfinispanSpecServiceContainerPtrOutput {\n\treturn o.ApplyT(func(v *InfinispanSpecService) *InfinispanSpecServiceContainer {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Container\n\t}).(InfinispanSpecServiceContainerPtrOutput)\n}", "title": "" }, { "docid": "8ffba89905df10cf9d87f36d93ac182c", "score": "0.41888916", "text": "func (d *decodeState) storeRegexp(v reflect.Value) {\n\top := d.scanWhile(scanSkipSpace)\n\tif op != scanBeginCtor {\n\t\td.error(fmt.Errorf(\"expected beginning of constructor\"))\n\t}\n\n\targs, err := d.ctor(\"RegExp\", []reflect.Type{stringType, stringType})\n\tif err != nil {\n\t\td.error(err)\n\t}\n\tswitch kind := v.Kind(); kind {\n\tcase reflect.Interface:\n\t\targ0 := args[0].String()\n\t\targ1 := args[1].String()\n\t\tv.Set(reflect.ValueOf(RegExp{arg0, arg1}))\n\tdefault:\n\t\td.error(fmt.Errorf(\"cannot store %v value into %v type\", regexpType, kind))\n\t}\n}", "title": "" }, { "docid": "9de873f3b4ffea0f60fc75a317db74e1", "score": "0.41879204", "text": "func New(containers ...caching.Container) caching.Container {\n\treturn &container{\n\t\tlist: containers,\n\t}\n}", "title": "" }, { "docid": "f6da0e9ce5deb723ff03d1833745b033", "score": "0.41766497", "text": "func (c *Client) Container(name string) ContainerAPI {\n\treturn c.C(name)\n}", "title": "" }, { "docid": "024e8e6089b63f85e9618aa8e7404593", "score": "0.417353", "text": "func setlikeOf(obj interface{}) *ast.Pattern {\n\tiface, ok := obj.(*ast.Interface)\n\tif !ok {\n\t\treturn nil\n\t}\n\tfor _, pattern := range iface.Patterns {\n\t\tif pattern.Type == ast.Setlike {\n\t\t\treturn pattern\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6fd7375dd3be07245fe4ccf01758b2fb", "score": "0.4173404", "text": "func (n *node) insert(pattern string, parts []string, height int) {\n\tif len(parts) == height {\n\t\tn.pattern = pattern\n\t\treturn\n\t}\n\tpart := parts[height]\n\tchild := n.matchChild(part)\n\tif child == nil {\n\t\tchild = &node{part: part, isWild: part[0] == ':' || part[0] == '*'}\n\t\tn.children = append(n.children, child)\n\t}\n\tchild.insert(pattern, parts, height+1)\n}", "title": "" }, { "docid": "9121089d7b0252f0923bbd0d451c399b", "score": "0.417215", "text": "func (self *Rope) AddChildI(args ...interface{}) *DisplayObject{\n return &DisplayObject{self.Object.Call(\"addChild\", args)}\n}", "title": "" }, { "docid": "b991c41989154da513e7785d5bc17b28", "score": "0.41691062", "text": "func (o PipeSourceParametersFilterCriteriaFilterOutput) Pattern() pulumi.StringOutput {\n\treturn o.ApplyT(func(v PipeSourceParametersFilterCriteriaFilter) string { return v.Pattern }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b449efdd6a0365049827fd11c8ae4ff2", "score": "0.4165802", "text": "func (pa *ProphetAdapter) NewContainer() prophet.Container {\n\treturn &ContainerAdapter{}\n}", "title": "" }, { "docid": "123eb569e0590e3e894140547d433ac4", "score": "0.4163999", "text": "func (i InputWallPaper) construct() InputWallPaperClass { return &i }", "title": "" }, { "docid": "f14c1b619dd6d0fd16b816dd3e1a16b8", "score": "0.41558108", "text": "func (d *Docker) List() []types.Container {\n\tif d.mode == ModeStatic {\n\t\td.list = []types.Container{}\n\t\tplist, err := ps.Processes()\n\t\tE(err)\n\t\tfor _, p := range plist {\n\t\t\td.list = append(d.list, types.Container{\n\t\t\t\tNames: []string{p.Executable()},\n\t\t\t\tID: strconv.Itoa(p.Pid()),\n\t\t\t})\n\t\t}\n\t\treturn d.list\n\t}\n\tcontainers, err := d.cli.ContainerList(context.Background(), types.ContainerListOptions{})\n\tE(err)\n\td.list = []types.Container{}\n\td.list = append(d.list, containers...)\n\treturn d.list\n}", "title": "" }, { "docid": "7300db6bd6c28e575f1027a2be9ef18f", "score": "0.4154222", "text": "func (i IPPortSecret) construct() IPPortClass { return &i }", "title": "" }, { "docid": "0b4f97e1919687c5649e039a16f878a2", "score": "0.41532895", "text": "func (d *Decoder) Decode() (*Pattern, error) {\n\tpattern, err := d.readPattern()\n\td.Err = err\n\tif d.Err != nil {\n\t\treturn nil, err\n\t}\n\treturn pattern, nil\n}", "title": "" }, { "docid": "0d882622981d7f082d0eae95262dafb5", "score": "0.41495162", "text": "func acceptImpl(v visitor, object *yaml.RNode, p string, oa *openapi.ResourceSchema, settersSchema *spec.Schema) error {\n\tswitch object.YNode().Kind {\n\tcase yaml.DocumentNode:\n\t\t// Traverse the child of the document\n\t\treturn accept(v, yaml.NewRNode(object.YNode()), settersSchema)\n\tcase yaml.MappingNode:\n\t\tif err := v.visitMapping(object); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn object.VisitFields(func(node *yaml.MapNode) error {\n\t\t\t// get the schema for the field and propagate it\n\t\t\tfieldSchema := getSchema(node.Key, oa, node.Key.YNode().Value, settersSchema)\n\t\t\t// Traverse each field value\n\t\t\treturn acceptImpl(v, node.Value, p+\".\"+node.Key.YNode().Value, fieldSchema, settersSchema)\n\t\t})\n\tcase yaml.SequenceNode:\n\t\t// get the schema for the elements\n\t\tschema := getSchema(object, oa, \"\", settersSchema)\n\t\treturn object.VisitElements(func(node *yaml.RNode) error {\n\t\t\t// Traverse each list element\n\t\t\treturn acceptImpl(v, node, p, schema, settersSchema)\n\t\t})\n\tcase yaml.ScalarNode:\n\t\t// Visit the scalar field\n\t\tsetterSchema := getSchema(object, oa, \"\", settersSchema)\n\t\treturn v.visitScalar(object, setterSchema)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2a0e818e7d646b946f1fdb942b0ac302", "score": "0.4149156", "text": "func (f *Factory) Adds(constructors Constructors) error {\n\treturn f.registry.Adds(toObjects(constructors))\n}", "title": "" }, { "docid": "32a0a4897db89b2fad31d97c80626621", "score": "0.41471055", "text": "func (nps *PoissonPatternStream) Stream() IPatternStream {\n\tstream := nps.patItr.Value().(IPatternStream)\n\treturn stream\n}", "title": "" }, { "docid": "a3a804c5ffad0364938a1bb5e3d95032", "score": "0.41464093", "text": "func (m *Module) NumPatterns() int { return int(m.module.numpat) }", "title": "" }, { "docid": "27871dabbd229ec8805f7d1fd627e4a0", "score": "0.4145714", "text": "func (pg *NativeFinder) Pattern(pattern string) ([]PID, error) {\n\tvar pids []PID\n\tregxPattern, err := regexp.Compile(pattern)\n\tif err != nil {\n\t\treturn pids, err\n\t}\n\tprocs, err := pg.FastProcessList()\n\tif err != nil {\n\t\treturn pids, err\n\t}\n\tfor _, p := range procs {\n\t\tname, err := p.Name()\n\t\tif err != nil {\n\t\t\t//skip, this can be caused by the pid no longer existing\n\t\t\t//or you having no permissions to access it\n\t\t\tcontinue\n\t\t}\n\t\tif regxPattern.MatchString(name) {\n\t\t\tpids = append(pids, PID(p.Pid))\n\t\t}\n\t}\n\treturn pids, err\n}", "title": "" } ]
677796664670998224cc49e30e024583
addToPATH adds the given locations to PATH for the task.
[ { "docid": "87e2ee51ff827928bcc5822433b3718a", "score": "0.81581277", "text": "func (b *taskBuilder) addToPATH(loc ...string) {\n\tb.envPrefixes(\"PATH\", loc...)\n}", "title": "" } ]
[ { "docid": "9b7278a449a451d97ffa2d77b293b931", "score": "0.6564083", "text": "func (this *Motto) AddPath(paths ...string) {\n this.paths = append(this.paths, paths...)\n}", "title": "" }, { "docid": "cccfa6ac1dc901d2ec0fd7259b8495b1", "score": "0.6200333", "text": "func appendToPATH(value string) error {\n\tif isInPATH(value) {\n\t\treturn nil\n\t}\n\treturn persistEnvVar(\"PATH\", pathVar+envSeparator+value)\n}", "title": "" }, { "docid": "e72fc25d23c935347c2a8ce39fcd66c4", "score": "0.59490234", "text": "func (ms *Modules) AddPath(paths ...string) {\n\tfor _, path := range paths {\n\t\tfor _, p := range strings.Split(path, \":\") {\n\t\t\tif !ms.pathMap[p] {\n\t\t\t\tms.pathMap[p] = true\n\t\t\t\tms.Path = append(ms.Path, p)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1605e861470ea3c8ef27bd02c04d9014", "score": "0.5871487", "text": "func (s *Scope) appendPaths(path string, parts ...string) string {\n\tpaths := []string{path, s.Vendor, s.App}\n\tpaths = append(paths, parts...)\n\treturn filepath.Join(paths...)\n}", "title": "" }, { "docid": "358135fc32da2403e1967e6d3fc67089", "score": "0.5851661", "text": "func (s *Scope) appendPaths(path string, parts ...string) string {\n\tpaths := []string{path}\n\tpaths = append(paths, parts...)\n\treturn filepath.Join(paths...)\n}", "title": "" }, { "docid": "692533eae8e47e5c8ce0dd737a2bf1ef", "score": "0.55165905", "text": "func (loc Location) appendPath(num protoreflect.FieldNumber, idx int) Location {\n\tloc.Path = append(protoreflect.SourcePath(nil), loc.Path...) // make copy\n\tloc.Path = append(loc.Path, int32(num), int32(idx))\n\treturn loc\n}", "title": "" }, { "docid": "ae4addbedd8615c88337f168c7246989", "score": "0.53923184", "text": "func AppendEnvPath(variable, separator, path string) error {\n originalContents, varSet := os.LookupEnv(variable)\n\n var contents string\n if varSet == false || originalContents == \"\" {\n contents = path\n } else {\n contents = path + separator + variable\n }\n\n if err := os.Setenv(variable, contents); err != nil {\n return err\n }\n\n return nil\n}", "title": "" }, { "docid": "765c57d9267711e071b148fb81a8d691", "score": "0.53697914", "text": "func insertPath(path string) error {\n\treturn os.Setenv(\"PATH\", fmt.Sprintf(\"%v:%v\", path, os.Getenv(\"PATH\")))\n}", "title": "" }, { "docid": "f03bd1cfa5a3207fae32a561c182fac2", "score": "0.5314068", "text": "func AddSbinEnvPaths() error {\n\tenvPaths := strings.Split(os.Getenv(\"PATH\"), \":\")\n\n\tif !StringInSlice(\"/sbin\", envPaths) {\n\t\tenvPaths = append(envPaths, \"/sbin\")\n\t}\n\n\tif !StringInSlice(\"/usr/sbin\", envPaths) {\n\t\tenvPaths = append(envPaths, \"/usr/sbin\")\n\t}\n\n\treturn os.Setenv(\"PATH\", strings.Join(envPaths, \":\"))\n}", "title": "" }, { "docid": "ffdb884b5914a885278320bcdd7ce696", "score": "0.52969694", "text": "func (c *Action) AddPath(p string) {\n\tfmt.Fprintf(c.w, addPathFmt, escapeData(p))\n}", "title": "" }, { "docid": "3680afe929b7fe0a6d3f3cf8dd21b3a1", "score": "0.5295714", "text": "func (e *libEnvContext) AppendPath(name string) {\n\tif e == nil {\n\t\treturn\n\t}\n\te.EnvPath = append(e.EnvPath, name)\n}", "title": "" }, { "docid": "62970ddc0bd4491ea06c677bd207921f", "score": "0.52856326", "text": "func AppendToEnvPath(newPath string) {\n\tpath, err := getRegEnvValue(pathRegKey)\n\tif err != nil {\n\t\tlog.Fatal(\"GetStringValue\", err)\n\t}\n\tif err := saveRegEnvValue(pathRegKey, path+string(os.PathListSeparator)+newPath); err != nil {\n\t\tlog.Fatal(\"SetStringValue\", err)\n\t}\n\tsyscall.NewLazyDLL(\"user32.dll\").NewProc(\"SendMessageW\").Call(HWNDBroadcast, WMSettingChange, 0, uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(\"ENVIRONMENT\"))))\n}", "title": "" }, { "docid": "1af5aad29f26d909b40868cac5878ab0", "score": "0.52582216", "text": "func (r *reaper) addPath(path string) {\n\tr.resetPath(path)\n}", "title": "" }, { "docid": "a0dc4c07ca2496dcdf54e4ccaeb7bf31", "score": "0.5249432", "text": "func (group *endpointGroup) append(path string) {\n\tgroup.paths = append(group.paths, path)\n}", "title": "" }, { "docid": "c366f5fba39e4e10416fa513247e4153", "score": "0.52394295", "text": "func AddSearchPath(path string) {\n\tgopaths := strings.Split(build.Default.GOPATH, \":\")\n\tfor _, gopath := range gopaths {\n\t\tpaths := strings.Split(path, \":\")\n\t\tfor _, p := range paths {\n\t\t\trevel.ConfPaths = append(revel.ConfPaths, gopath+\"/src/\"+p)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1e4d565e00d9256212ec8f085cfa3736", "score": "0.52296996", "text": "func updatePath(cf *v1.ConfigFile, appPath string) {\n\tfor i, env := range cf.Config.Env {\n\t\tparts := strings.SplitN(env, \"=\", 2)\n\t\tif len(parts) != 2 {\n\t\t\t// Expect environment variables to be in the form KEY=VALUE, so this is unexpected.\n\t\t\tcontinue\n\t\t}\n\t\tkey, value := parts[0], parts[1]\n\t\tif key == \"PATH\" {\n\t\t\tvalue = fmt.Sprintf(\"%s:%s\", value, appPath)\n\t\t\tcf.Config.Env[i] = \"PATH=\" + value\n\t\t\treturn\n\t\t}\n\t}\n\n\t// If we get here, we never saw PATH.\n\tcf.Config.Env = append(cf.Config.Env, \"PATH=\"+appPath)\n}", "title": "" }, { "docid": "687817df77c6dbce3a6b3ec9177427bf", "score": "0.52114385", "text": "func (v Values) AddEnvAsPath(prefix, envName string, value interface{}) error {\n\tname := strings.TrimPrefix(envName, prefix)\n\tname = strings.ToLower(name)\n\tname = strings.Replace(name, \"_\", \".\", -1)\n\terr := v.SetAtPath(name, value)\n\treturn err\n}", "title": "" }, { "docid": "44a4828a0e41994a6c2b23dc4fc53e8b", "score": "0.51864606", "text": "func AddSitemapPath(path string) {\n\t// Normalize the path.\n\tpath = toPath(path)\n\n\t// Check if already present in slice.\n\tfor _, p := range sitemapPaths {\n\t\tif p == path {\n\t\t\tlog.L.Warning(\"webcrawler: the sitemap path '%s' is already in the list. Duplicate call...\", path)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Add the path to the slice.\n\tsitemapPaths = append(sitemapPaths, path)\n}", "title": "" }, { "docid": "338a988e80b583a284e93bf951d5c982", "score": "0.51844853", "text": "func (p *Paths) Append(paths ...Path) Paths {\n\tif p == nil {\n\t\treturn paths\n\t}\n\n\tfor _, newPath := range paths {\n\t\tif p.Contains(newPath) {\n\t\t\tcontinue\n\t\t}\n\n\t\t*p = append(*p, newPath)\n\t}\n\n\treturn *p\n}", "title": "" }, { "docid": "d3840601e1752b7c7b7e94472ccedbb7", "score": "0.5164274", "text": "func augmentPathEnv() {\n\t// We only have Linux executables.\n\tif runtime.GOOS != \"linux\" {\n\t\treturn\n\t}\n\n\t// If the executables are already present, skip.\n\t_, errdevdraw := exec.LookPath(\"devdraw\")\n\t_, err9pserve := exec.LookPath(\"9pserve\")\n\tif errdevdraw == nil && err9pserve == nil {\n\t\treturn\n\t}\n\n\twd, err := os.Getwd()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tpath := os.Getenv(\"PATH\") + \":\" + filepath.Join(wd, \"build\", \"bin\")\n\tos.Setenv(\"PATH\", path)\n\n\t// We also need fonts.\n\tif _, hzp9 := os.LookupEnv(\"PLAN9\"); !hzp9 {\n\t\tos.Setenv(\"PLAN9\", filepath.Join(wd, \"build\"))\n\t}\n}", "title": "" }, { "docid": "4f674e5392652e8428f7a965b7f8e8a1", "score": "0.5125424", "text": "func (f *FakeParser) AddLookupPath(rootPath string) (err error) {\n\tf.CalledAddLookupPath = true\n\tf.TargetFiles = append(f.TargetFiles, \"kool.yml\")\n\treturn\n}", "title": "" }, { "docid": "a1bf7d36e0a65fbc74f03f8e7e2982d4", "score": "0.5118066", "text": "func (t *DesktopTracer) JoinPath(paths []string) string {\n\tif len(paths) == 0 {\n\t\treturn \"\"\n\t}\n\n\tif t.b.Instance().GetConfiguration().GetOS().GetKind() == device.Windows {\n\t\tif paths[0] == \"\" {\n\t\t\treturn path.Clean(strings.Join(paths[1:], \"\\\\\"))\n\t\t}\n\t\treturn path.Clean(strings.Join(paths, \"\\\\\"))\n\t} else {\n\t\treturn path.Join(paths...)\n\t}\n}", "title": "" }, { "docid": "ef6db704a32510f4a031e5b058b4faa4", "score": "0.5103192", "text": "func AddItemsPath() string {\n\n\treturn fmt.Sprintf(\"/item\")\n}", "title": "" }, { "docid": "7c5d8e38049bc11d834df7192316ea37", "score": "0.5061988", "text": "func AddShiritoriPath(a int, b int) string {\n\treturn fmt.Sprintf(\"/add/%v/%v\", a, b)\n}", "title": "" }, { "docid": "bc1828a2b1de983205c5922dc8f1e6b3", "score": "0.5030162", "text": "func (b *Bogus) AddPath(path string) *Path {\n\tif _, ok := b.paths[path]; !ok {\n\t\tb.paths[path] = &Path{}\n\t}\n\n\treturn b.paths[path]\n}", "title": "" }, { "docid": "eb68d4fc7396923c4cfd5f6aa222d3d2", "score": "0.502865", "text": "func (c *GoogleStaticMapClient) AddPath(color string, weight int, coordinates [][]float64) {\n\tpath := mapPath{\n\t\tColor: color,\n\t\tWeight: weight,\n\t}\n\t// To Filter out the points greater than 1000\n\ttotalPoints := len(coordinates)\n\tfilteredCoordinates := make([][]float64, 0)\n\tif totalPoints > 1000 {\n\t\tnumToReduce := totalPoints - 1000\n\t\tnumHasReduce := 0\n\t\tstep := int(math.Ceil(float64(totalPoints) / float64(1000)))\n\t\tLog.Debug(\"Reduce Coordinates should has step no less than 2\", With(\"numToReduce\", numToReduce), With(\"step\", step))\n\t\tfor i := 0; i < totalPoints; i = i + step {\n\t\t\tfilteredCoordinates = append(filteredCoordinates, coordinates[i])\n\t\t\tnumHasReduce = numHasReduce + step - 1\n\t\t\tif numHasReduce >= numToReduce {\n\t\t\t\tLog.Debug(\"Already met the numToReduce\", With(\"numToReduce\", numToReduce), With(\"numHasReduce\", numHasReduce))\n\t\t\t\tif totalPoints-1 > i+step {\n\t\t\t\t\tfilteredCoordinates = append(filteredCoordinates, coordinates[i+step:totalPoints-1]...)\n\t\t\t\t} else {\n\t\t\t\t\tfilteredCoordinates = append(filteredCoordinates, coordinates[totalPoints-1])\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfilteredCoordinates = coordinates\n\t}\n\n\tpath.PolylineEncode = string(polyline.EncodeCoords(filteredCoordinates))\n\tc.Paths = append(c.Paths, path)\n}", "title": "" }, { "docid": "a2463d4d3d577f7ab7b4401bdc76c9e8", "score": "0.49886188", "text": "func Append(p Path, ps ...Path) Path {\n\tfor _, e := range ps {\n\t\t// Drop the leading '/' when appending/joining fully qualified paths.\n\t\tif len(e) > 0 && e[0] == \"/\" {\n\t\t\te = e[1:]\n\t\t}\n\t\tp = append(p, e...)\n\t}\n\treturn p\n}", "title": "" }, { "docid": "691dbcb246a65e3646b955a4fe97488c", "score": "0.4940989", "text": "func PathJoin(incoming []string) string { return filesys.PathJoin(incoming) }", "title": "" }, { "docid": "e769d8567ec8515235e0f69ae2fb67a6", "score": "0.49092022", "text": "func PrependEnvPath(variable, seperator, path string) error {\n originalContents, varSet := os.LookupEnv(variable)\n\n var contents string\n if varSet == false || originalContents == \"\" {\n contents = path\n } else {\n contents = variable + seperator + path\n }\n\n if err := os.Setenv(variable, contents); err != nil {\n return err\n }\n\n return nil\n}", "title": "" }, { "docid": "0dbd3eb9784fe34ffcf370df77523c11", "score": "0.48872674", "text": "func (idx *Index) AddMethodPathScopes(method, path string, scopes []string) (*node, error) {\n\tn, err := idx.AddPath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tn.Methods[method] = scopes\n\n\treturn n, nil\n}", "title": "" }, { "docid": "869cde5ac3f72a1aeab79cb54adb82a7", "score": "0.4862414", "text": "func (c *Config) AddPath(path string) error {\n\tvar (\n\t\tisDir = false\n\t\trealPath = \"\"\n\t)\n\t// It firstly checks the resource manager,\n\t// and then checks the filesystem for the path.\n\tif file := gres.Get(path); file != nil {\n\t\trealPath = path\n\t\tisDir = file.FileInfo().IsDir()\n\t} else {\n\t\t// Absolute path.\n\t\trealPath = gfile.RealPath(path)\n\t\tif realPath == \"\" {\n\t\t\t// Relative path.\n\t\t\tc.searchPaths.RLockFunc(func(array []string) {\n\t\t\t\tfor _, v := range array {\n\t\t\t\t\tif path, _ := gspath.Search(v, path); path != \"\" {\n\t\t\t\t\t\trealPath = path\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tif realPath != \"\" {\n\t\t\tisDir = gfile.IsDir(realPath)\n\t\t}\n\t}\n\tif realPath == \"\" {\n\t\tbuffer := bytes.NewBuffer(nil)\n\t\tif c.searchPaths.Len() > 0 {\n\t\t\tbuffer.WriteString(fmt.Sprintf(\"[gcfg] AddPath failed: cannot find directory \\\"%s\\\" in following paths:\", path))\n\t\t\tc.searchPaths.RLockFunc(func(array []string) {\n\t\t\t\tfor k, v := range array {\n\t\t\t\t\tbuffer.WriteString(fmt.Sprintf(\"\\n%d. %s\", k+1, v))\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tbuffer.WriteString(fmt.Sprintf(`[gcfg] AddPath failed: path \"%s\" does not exist`, path))\n\t\t}\n\t\terr := gerror.New(buffer.String())\n\t\tif errorPrint() {\n\t\t\tglog.Error(err)\n\t\t}\n\t\treturn err\n\t}\n\tif !isDir {\n\t\terr := gerror.Newf(`[gcfg] AddPath failed: path \"%s\" should be directory type`, path)\n\t\tif errorPrint() {\n\t\t\tglog.Error(err)\n\t\t}\n\t\treturn err\n\t}\n\t// Repeated path check.\n\tif c.searchPaths.Search(realPath) != -1 {\n\t\treturn nil\n\t}\n\tc.searchPaths.Append(realPath)\n\tintlog.Print(context.TODO(), \"AddPath:\", realPath)\n\treturn nil\n}", "title": "" }, { "docid": "c749a2bbe7ca077f558a80af96714890", "score": "0.48618463", "text": "func AlternateBinPath(paths ...string) (path string) {\n\tpaths = append([]string{AlternativeBinDir}, paths...)\n\treturn filepath.Join(paths...)\n}", "title": "" }, { "docid": "ccac1694ccaae2448f72e60fcdd67a4d", "score": "0.47742856", "text": "func (m *Migration) AddPath(path string) {\n\tif direction(path) == \"up\" {\n\t\tm.UpPath = path\n\t} else {\n\t\tm.DownPath = path\n\t}\n}", "title": "" }, { "docid": "198cb7798e3be9a7e8879d5d2fb9fe94", "score": "0.4768785", "text": "func (d DependencyCacheLayer) AppendPathEnv(name string, format string, args ...interface{}) error {\n\td.Logger.SubsequentLine(\"Writing %s\", name)\n\treturn d.CacheLayer.AppendPathEnv(name, format, args...)\n}", "title": "" }, { "docid": "c3762256b782e3f01bb1bb1eed9c5578", "score": "0.47325766", "text": "func AppendString(p Path, elem ...string) Path {\n\treturn Append(p, ToPaths(elem)...)\n}", "title": "" }, { "docid": "2cf351965efac99ce06505b294043ec6", "score": "0.46942496", "text": "func (fv *FileView) AddPathToFavs() {\n\tdp := fv.DirPath\n\tif dp == \"\" {\n\t\treturn\n\t}\n\t_, fnm := filepath.Split(dp)\n\thd, _ := homedir.Dir()\n\thd += string(filepath.Separator)\n\tif strings.HasPrefix(dp, hd) {\n\t\tdp = filepath.Join(\"~\", strings.TrimPrefix(dp, hd))\n\t}\n\tif fnm == \"\" {\n\t\tfnm = dp\n\t}\n\tif _, found := gi.Prefs.FavPaths.FindPath(dp); found {\n\t\tgi.PromptDialog(fv.Viewport, gi.DlgOpts{Title: \"Add Path To Favorites\", Prompt: fmt.Sprintf(\"Path is already on the favorites list: %v\", dp)}, true, false, nil, nil)\n\t\treturn\n\t}\n\tfi := gi.FavPathItem{\"folder\", fnm, dp}\n\tgi.Prefs.FavPaths = append(gi.Prefs.FavPaths, fi)\n\tgi.Prefs.Save()\n\tfv.FileSig.Emit(fv.This, int64(FileViewFavAdded), fi)\n\tfv.UpdateFavs()\n}", "title": "" }, { "docid": "78ae9833a54897ae83442e9c8d83ac8e", "score": "0.46735376", "text": "func (p *Patch) AddTasks(tasks []string) error {\n\tchange := adb.Change{\n\t\tUpdate: bson.M{\n\t\t\t\"$addToSet\": bson.M{TasksKey: bson.M{\"$each\": tasks}},\n\t\t},\n\t\tReturnNew: true,\n\t}\n\t_, err := db.FindAndModify(Collection, bson.M{IdKey: p.Id}, nil, change, p)\n\treturn err\n}", "title": "" }, { "docid": "78ae9833a54897ae83442e9c8d83ac8e", "score": "0.46735376", "text": "func (p *Patch) AddTasks(tasks []string) error {\n\tchange := adb.Change{\n\t\tUpdate: bson.M{\n\t\t\t\"$addToSet\": bson.M{TasksKey: bson.M{\"$each\": tasks}},\n\t\t},\n\t\tReturnNew: true,\n\t}\n\t_, err := db.FindAndModify(Collection, bson.M{IdKey: p.Id}, nil, change, p)\n\treturn err\n}", "title": "" }, { "docid": "db78c1a86b96382399731eba5df89526", "score": "0.46703044", "text": "func (dw *DrawingWand) PathLineToVerticalRelative(y float64) {\n\tC.MagickDrawPathLineToVerticalRelative(dw.dw, C.double(y))\n}", "title": "" }, { "docid": "37c03000c074a2d81f1b584eff09fa4e", "score": "0.46587658", "text": "func AddUsersPath() string {\n\treturn \"/api/v1/users\"\n}", "title": "" }, { "docid": "be1a240f4ac378431daeca4561687cc1", "score": "0.4654675", "text": "func addWatch(t *testing.T, w *Watcher, path ...string) {\n\tt.Helper()\n\tif len(path) < 1 {\n\t\tt.Fatalf(\"addWatch: path must have at least one element: %s\", path)\n\t}\n\terr := w.Add(join(path...))\n\tif err != nil {\n\t\tt.Fatalf(\"addWatch(%q): %s\", join(path...), err)\n\t}\n}", "title": "" }, { "docid": "4ed2d99dc77d4f9f37d621adb49bad3a", "score": "0.46538556", "text": "func (e *Enumerate) AddSyspath(syspath string) (err error) {\n\te.lock()\n\tdefer e.unlock()\n\ts := C.CString(syspath)\n\tdefer freeCharPtr(s)\n\tif C.udev_enumerate_add_syspath(e.ptr, s) != 0 {\n\t\terr = errors.New(\"udev: udev_enumerate_add_syspath failed\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "e849106301303a20e94524053953e3e4", "score": "0.46530852", "text": "func InsertBeforeSysPath(p string) string {\n sysModule := python.PyImport_ImportModule(\"sys\")\n path := sysModule.GetAttrString(\"path\")\n python.PyList_Insert(path, 0, PyStr(p))\n return GoStr(path.Repr())\n}", "title": "" }, { "docid": "14b1c1c002e401e3678d0bf644a96ef8", "score": "0.46264395", "text": "func (p Path) Add(child string) Path {\r\n\tret := Path(fmt.Sprint(p, string(os.PathSeparator), child))\r\n\treturn ret\r\n}", "title": "" }, { "docid": "ca5232ae8f01c38ab2acccf6b9bd7173", "score": "0.46156934", "text": "func Concat(path, path2 []string) []string {\n\tpathCopy := make([]string, len(path))\n\tcopy(pathCopy, path)\n\n\tif len(path) == 0 {\n\t\tpath2Copy := make([]string, len(path2))\n\t\tcopy(path2Copy, path)\n\t\treturn path2Copy\n\t}\n\n\tif len(path2) == 0 {\n\t\treturn pathCopy\n\t}\n\n\tif path[len(path)-1] != path2[0] {\n\t\tlog.Fatalln(\"Tried to compute\", path, \"+\", path2, \"but their ends differ\")\n\t}\n\n\tpathCopy = append(pathCopy[:len(pathCopy)-1], path2...)\n\treturn pathCopy\n}", "title": "" }, { "docid": "f44531ec69332126ef69ff10fd057b5b", "score": "0.46027207", "text": "func (c *Tool) Add(strs ...string) *Tool {\n\tfor _, s := range strs {\n\t\tc.Args = append(c.Args, s)\n\t}\n\treturn c\n}", "title": "" }, { "docid": "9bf6b09fd1bc1aae5fdceb03944ea63a", "score": "0.45986503", "text": "func (in *RunDetails) AddJarsToClasspath(path string) {\n\tif _, err := os.Stat(path); err == nil {\n\t\tvar jars []string\n\t\t_ = filepath.Walk(path, func(path string, info os.FileInfo, err error) error {\n\t\t\tname := info.Name()\n\t\t\tif !info.IsDir() && (strings.HasSuffix(name, \".jar\") || strings.HasSuffix(name, \".JAR\")) {\n\t\t\t\tjars = append(jars, path)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\n\t\tsort.Strings(jars)\n\t\tfor _, jar := range jars {\n\t\t\tin.AddClasspath(jar)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "babc7fd5b1ebba0e3f15dc251ef2b7c9", "score": "0.45711544", "text": "func (s *svcPaths) AddSvcPath(pathPtr *Path) {\n\t// path cannot be updated during this operation\n\tpathPtr.RLock()\n\ts.checkAddSvc(pathPtr.ServiceName)\n\t// v ^ order here cannot switch!\n\ts.mux.RLock()\n\ts.StoPs[pathPtr.ServiceName].Add(pathPtr)\n\ts.mux.RUnlock()\n\tpathPtr.RUnlock()\n}", "title": "" }, { "docid": "366feaadfa22c8e80c7adcd6633c29a2", "score": "0.45700613", "text": "func (dw *DrawingWand) PathLineToAbsolute(x, y float64) {\n\tC.MagickDrawPathLineToAbsolute(dw.dw, C.double(x), C.double(y))\n}", "title": "" }, { "docid": "219491639a09499a0f1c1feea1c244e2", "score": "0.45603636", "text": "func (dw *DrawingWand) PathLineToRelative(x, y float64) {\n\tC.MagickDrawPathLineToRelative(dw.dw, C.double(x), C.double(y))\n}", "title": "" }, { "docid": "ea07ec6fcc34fad77a1f659c7989052e", "score": "0.45397517", "text": "func (dw *DrawingWand) PathLineToVerticalAbsolute(y float64) {\n\tC.MagickDrawPathLineToVerticalAbsolute(dw.dw, C.double(y))\n}", "title": "" }, { "docid": "808b0dfeafc55c05d3f165019f0599e6", "score": "0.45214674", "text": "func addPathToProcessRestartTrigger(path string) {\n\t// First clean the path.\n\tpath = filepath.Clean(path)\n\n\t// Add it to the slice\n\trestartProcessOnChangedFiles = append(restartProcessOnChangedFiles, path)\n}", "title": "" }, { "docid": "20d8eb3c74f901fd990d4341d36ffea0", "score": "0.45188767", "text": "func InsertBeforeSysPath(p string) string {\n sysModule := python.PyImport_ImportModule(\"sys\")\n path := sysModule.GetAttrString(\"path\")\n python.PyList_Insert(path, 0, PyStr(p))\n fmt.Println(path)\n return GoStr(path.Repr())\n}", "title": "" }, { "docid": "c1081b640f93abe395f831712caf67b6", "score": "0.4513449", "text": "func JoinPath(ss ...string) string {\n\treturn filepath.Join(ss...)\n}", "title": "" }, { "docid": "fea2854be3feeae506bfb5f5a5a8af4c", "score": "0.4506341", "text": "func (c *Config) BindPath(path string) {\n\tc.path = append(c.path, path)\n}", "title": "" }, { "docid": "ac7a405f49ea4a95a07845326980568e", "score": "0.4489148", "text": "func (ps Paths) Append(fields ...string) Paths {\n\tps = append(ps, fields...)\n\treturn ps\n}", "title": "" }, { "docid": "240d32e741f2c7d5dd0f4e89ffc2af83", "score": "0.4476219", "text": "func (o OfflineNotaryRepository) AddDelegationPaths(data.RoleName, []string) error {\n\treturn nil\n}", "title": "" }, { "docid": "3eeef967e56ade1f431c012524c1e7c3", "score": "0.44680867", "text": "func NewPathCompleter() (Completer, error) {\n\t// Getenv returns the same value (\"\") if a path is not found\n\t// or if it has the value \"\". Oh well.\n\treturn NewEnvCompleter(\"PATH\")\n}", "title": "" }, { "docid": "af099928bb1a86e52c40b412a34f42f4", "score": "0.4463402", "text": "func JoinPaths(paths ...*pb.Path) *pb.Path {\n\tvar elems []*pb.PathElem\n\tfor _, path := range paths {\n\t\tif path != nil {\n\t\t\tpath = upgradePath(path)\n\t\t\telems = append(elems, path.Elem...)\n\t\t}\n\t}\n\treturn &pb.Path{Elem: elems}\n}", "title": "" }, { "docid": "84b7615c9f3f488b1d894bc9fde7fde7", "score": "0.4461329", "text": "func AddViewPath(viewPath string) error {\n\tif beeViewPathTemplateLocked {\n\t\tif _, exist := beeViewPathTemplates[viewPath]; exist {\n\t\t\treturn nil // Ignore if viewpath already exists\n\t\t}\n\t\tpanic(\"Can not add new view paths after beego.Run()\")\n\t}\n\tbeeViewPathTemplates[viewPath] = make(map[string]*template.Template)\n\treturn BuildTemplate(viewPath)\n}", "title": "" }, { "docid": "7009f638549847b4faa571d140c30ae4", "score": "0.4458491", "text": "func concatURLPaths(host string, path []string) (string, error) {\n\tif host == \"\" {\n\t\treturn \"\", errors.New(\"host can not be empty\")\n\t}\n\n\telements := make([]string, len(path)+1)\n\telements[0] = strings.TrimSuffix(host, \"/\")\n\n\tfor k, v := range path {\n\t\telements[k+1] = strings.Trim(v, \"/\")\n\t}\n\n\treturn strings.Join(elements, \"/\"), nil\n}", "title": "" }, { "docid": "253d481cff70e28dc5d47b61a2430b09", "score": "0.4456514", "text": "func Add(path, branch string) func(*types.Cmd) {\n\treturn func(g *types.Cmd) {\n\t\tg.AddOptions(\"add\")\n\t\tg.AddOptions(path)\n\t\tif len(branch) > 0 {\n\t\t\tg.AddOptions(branch)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "41dcea57779678e0821a0f71f7fa4c57", "score": "0.4452832", "text": "func (p *path) Push(x interface{}) {\n\t*p = append(*p, x.(directPath))\n}", "title": "" }, { "docid": "afa91aca4b7ba9a4c2ea64ded028bf41", "score": "0.44518802", "text": "func (b Plugin) Add(taps []string) error {\n\tif len(taps) == 0 {\n\t\tlogrus.Info(\"no Hombrew taps to install\")\n\t\treturn nil\n\t}\n\tlogrus.Info(\"Installing brew packages:\", taps)\n\tbrewArgs := append([]string{\"tap\"}, taps...)\n\t_, err := b.Commander(brewExe, brewArgs...)\n\tif err != nil {\n\t\tlogrus.Error(\"Failed installing brew packages:\", err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7c66acfb8ed901ef27b57793cc70a251", "score": "0.4450415", "text": "func (w *Walker) extendPath(child NavigableNode) {\n\tw.currentDepth++\n\n\t// Extend the slices if needed (doubling its capacity).\n\tif w.currentDepth >= len(w.path) {\n\t\tw.path = append(w.path, make([]NavigableNode, len(w.path))...)\n\t\tw.childIndex = append(w.childIndex, make([]uint, len(w.childIndex))...)\n\t\t// TODO: Check the performance of this grow mechanism.\n\t}\n\n\t// `child` now becomes the `ActiveNode()`.\n\tw.path[w.currentDepth] = child\n\tw.childIndex[w.currentDepth] = 0\n}", "title": "" }, { "docid": "2c6e7d1a1195bc55df69e3a701f56ba2", "score": "0.44187102", "text": "func AddUserPath() string {\n\treturn \"/users\"\n}", "title": "" }, { "docid": "da50a2bbe0bf2d27d082c061fad09c13", "score": "0.4416335", "text": "func addlibpath(ctxt *Link, srcref, objref, file, pkg, shlib string, fingerprint goobj.FingerprintType) *sym.Library {\n\tif l := ctxt.LibraryByPkg[pkg]; l != nil {\n\t\treturn l\n\t}\n\n\tif ctxt.Debugvlog > 1 {\n\t\tctxt.Logf(\"addlibpath: srcref: %s objref: %s file: %s pkg: %s shlib: %s fingerprint: %x\\n\", srcref, objref, file, pkg, shlib, fingerprint)\n\t}\n\n\tl := &sym.Library{}\n\tctxt.LibraryByPkg[pkg] = l\n\tctxt.Library = append(ctxt.Library, l)\n\tl.Objref = objref\n\tl.Srcref = srcref\n\tl.File = file\n\tl.Pkg = pkg\n\tl.Fingerprint = fingerprint\n\tif shlib != \"\" {\n\t\tif strings.HasSuffix(shlib, \".shlibname\") {\n\t\t\tdata, err := ioutil.ReadFile(shlib)\n\t\t\tif err != nil {\n\t\t\t\tErrorf(nil, \"cannot read %s: %v\", shlib, err)\n\t\t\t}\n\t\t\tshlib = strings.TrimSpace(string(data))\n\t\t}\n\t\tl.Shlib = shlib\n\t}\n\treturn l\n}", "title": "" }, { "docid": "1589ef9ba86954e363821e5f6d33fbc0", "score": "0.44021323", "text": "func (b *BuildProps) processPaths(ctx blueprint.BaseModuleContext) {\n\tprefix := projectModuleDir(ctx)\n\n\tb.Export_local_include_dirs = utils.PrefixDirs(b.Export_local_include_dirs, prefix)\n\tb.Export_local_system_include_dirs = utils.PrefixDirs(b.Export_local_system_include_dirs, prefix)\n\n\tb.processBuildWrapper(ctx)\n}", "title": "" }, { "docid": "4e6ad12b660179b83982c68bb5dc80cc", "score": "0.43996832", "text": "func PathUpdate(path string, m *interface{}, value interface{}) {\n\tmatches := re.FindAllStringSubmatch(path, -1)\n\tcomponents := make([]string, 0, len(matches))\n\tfor _, m := range matches {\n\t\tcomponents = append(components, m[1])\n\t}\n\tpathUpdate(components, m, value)\n}", "title": "" }, { "docid": "c559592daaca48c68afefc103eb2c84b", "score": "0.4397538", "text": "func lookupPath(exe string) string {\n\texePath, ok := commandPaths[exe]\n\tif ok {\n\t\treturn exePath\n\t}\n\n\tvar err error\n\texePath, err = exec.LookPath(exe)\n\tif err != nil {\n\t\tlog.Fatalf(\"Not installed: %s\\n\", exe)\n\t}\n\tcommandPaths[exe] = exePath\n\treturn exePath\n}", "title": "" }, { "docid": "fc5929053aa8291406be4510fc49c279", "score": "0.43969053", "text": "func (p Path) Push(part string) {\n\tp.parts = append(p.parts, part)\n}", "title": "" }, { "docid": "93fd5299fcc844b4e8b7aaf87d2b4320", "score": "0.43712127", "text": "func (c *Ctx) depPaths() {\n\tc.pathBuffer = append(c.pathBuffer[0:0], c.pathOriginal...)\n\t// If UnescapePath enabled, we decode the path and save it for the framework user\n\tif c.Core.Options.UnescapePath {\n\t\tc.pathBuffer = fasthttp.AppendUnquotedArg(c.pathBuffer[:0], c.pathBuffer)\n\t}\n\tc.path = BytesToString(c.pathBuffer)\n\n\t// another path is specified which is for routing recognition only\n\t// use the path that was changed by the previous configuration flags\n\tc.detectionPathBuffer = append(c.detectionPathBuffer[0:0], c.pathBuffer...)\n\t// If CaseSensitive is disabled, we lowercase the original path\n\tif !c.Core.CaseSensitive {\n\t\tc.detectionPathBuffer = ToLowerBytes(c.detectionPathBuffer)\n\t}\n\t// If StrictRouting is disabled, we strip all trailing slashes\n\tif len(c.detectionPathBuffer) > 1 && c.detectionPathBuffer[len(c.detectionPathBuffer)-1] == '/' {\n\t\tc.detectionPathBuffer = TrimRightBytes(c.detectionPathBuffer, '/')\n\t}\n\tc.detectionPath = BytesToString(c.detectionPathBuffer)\n\n\t// Define the path for dividing routes into areas for fast tree detection, so that fewer routes need to be traversed,\n\t// since the first three characters area select a list of routes\n\tc.treePath = c.treePath[0:0]\n\tif len(c.detectionPath) >= 3 {\n\t\tc.treePath = c.detectionPath[:3]\n\t}\n}", "title": "" }, { "docid": "065f9198bbdec3e54f481a5603993a4c", "score": "0.43687892", "text": "func (self *Chromosome) Add(locations ...Location) {\n\t//Add each location\n\tfor i := range locations {\n\t\tself.Locations = append(self.Locations, locations[i])\n\t}\n}", "title": "" }, { "docid": "9b038776f0476b390bec4e1760eb7112", "score": "0.43576434", "text": "func (a *appState) addPathFromFile(ctx context.Context, stderr io.Writer, file, name string) error {\n\tif _, err := os.Stat(file); err != nil {\n\t\treturn err\n\t}\n\n\tbyt, err := os.ReadFile(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tp := &relayer.Path{}\n\tif err = json.Unmarshal(byt, &p); err != nil {\n\t\treturn err\n\t}\n\n\tif err = a.config.ValidatePath(ctx, stderr, p); err != nil {\n\t\treturn err\n\t}\n\n\treturn a.config.AddPath(name, p)\n}", "title": "" }, { "docid": "dfb7df900e61da6bb8e21fb3cdc5e659", "score": "0.4346976", "text": "func JoinPath(path_arr []string) string {\n\treturn strings.Join(path_arr, \"/\")\n}", "title": "" }, { "docid": "03e9e94c7891f705bc371828099af0e7", "score": "0.43415922", "text": "func (b *Backend) Add(args []string) error {\n\ttask := strings.Join(args, \" \")\n\treturn b.addEntry(task)\n}", "title": "" }, { "docid": "7edbd8630eb3ec908b4dc2d68575e7f9", "score": "0.4337689", "text": "func (n *node) addTargets(taskIDs ...TaskID) {\n\tif n.targetIDs == nil {\n\t\tn.targetIDs = NewTaskIDs(TaskIDSlice(taskIDs))\n\t\treturn\n\t}\n\tn.targetIDs.Insert(TaskIDSlice(taskIDs))\n}", "title": "" }, { "docid": "dd9ece3f8b0f5eb4f95e4a8610ab1ad6", "score": "0.43320873", "text": "func formPath(nodeA string, nodeB string) {\n\n\t// Forms 3 paths from source(A) to destination(B)\n\n\tvar bounceNode string\n\tpathIndex := 0\n\tfor i := range pathsArray {\n\t\tpathsArray[i] = make([]string, 3)\n\t}\n\n\tfor i := 0; i < len(nodesTable); i++ {\n\t\t/*\n\t\t\tIf middle node is not equal to A then set middle node equal to bounce node\n\t\t\tThis will result in 3 paths (assuming 4 total nodes)\n\t\t\tExample ( A -> C -> B) (A -> D -> B) (A -> B)\n\t\t*/\n\t\tif nodesTable[i] != nodeA && nodesTable[i] != nodeB {\n\t\t\tbounceNode = nodesTable[i]\n\t\t\t// Assign Items in the Array\n\t\t\tpathsArray[pathIndex][0] = nodeA\n\t\t\tpathsArray[pathIndex][1] = bounceNode\n\t\t\tpathsArray[pathIndex][2] = nodeB\n\t\t\tpathIndex += 1\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "17eeef98c32d6b9f57f784cbd9ce3658", "score": "0.43262237", "text": "func (w *Watcher) Add(path string) {\n\t// Initial value to be different from any ETag\n\tw.paths[path] = \"Ooh, watch me, watch me!\"\n}", "title": "" }, { "docid": "c4ab09893a0c4a25887fc1eee142a81c", "score": "0.43224907", "text": "func AddDevicePath(expeditionID int) string {\n\tparam0 := strconv.Itoa(expeditionID)\n\n\treturn fmt.Sprintf(\"/expeditions/%s/sources/devices\", param0)\n}", "title": "" }, { "docid": "a7d83a3d50f5f60ca321a766ddd3542d", "score": "0.4305236", "text": "func (c *Config) UpgradeVarPaths(varPaths map[string]string, log log.Logger) error {\n\toptionsRegex, err := regexp.Compile(\"^\\\\.deployments\\\\[(\\\\d+)\\\\]\\\\.component\\\\.options\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcomponentRegex, err := regexp.Compile(\"^\\\\.deployments\\\\[(\\\\d+)\\\\]\\\\.component\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor path, value := range varPaths {\n\t\tif optionsRegex.MatchString(path) {\n\t\t\tnewPath := optionsRegex.ReplaceAllString(path, \".deployments[$1].helm\")\n\t\t\tdelete(varPaths, path)\n\t\t\tvarPaths[newPath] = value\n\t\t} else if componentRegex.MatchString(path) {\n\t\t\tnewPath := componentRegex.ReplaceAllString(path, \".deployments[$1].helm.values\")\n\t\t\tdelete(varPaths, path)\n\t\t\tvarPaths[newPath] = value\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "18fe71f0d7cc1b410abc3a72138d6e9f", "score": "0.43002895", "text": "func AddOrdinalValuesPath(stream string, ordinal int, value float64) string {\n\treturn fmt.Sprintf(\"/api/add/%v/%v/%v\", stream, ordinal, value)\n}", "title": "" }, { "docid": "fa19881fbd78307ec7c98ff03a944e74", "score": "0.42994347", "text": "func (s *Space) joinPath(path string, defaults string) string {\n\tif path == \"\" {\n\t\tpath = defaults\n\t}\n\treturn s.Join(path)\n}", "title": "" }, { "docid": "315c7ed96686ff0e43192e6178026fc8", "score": "0.42829353", "text": "func addPathSeparator(path string) string {\n\tcleanPath := filepath.Clean(path)\n\tlastSymbol := cleanPath[(len(cleanPath) - 1):]\n\tif lastSymbol == string(os.PathSeparator) {\n\t\treturn filepath.Clean(path)\n\t}\n\treturn filepath.Clean(path) + string(os.PathSeparator)\n}", "title": "" }, { "docid": "e9c98f85dac91b585fd98594547f03e3", "score": "0.42821893", "text": "func JoinPath(path []string) string {\n\treturn \"/\" + strings.Join(path, \"/\")\n}", "title": "" }, { "docid": "c2ec74efbf0244d900b52a80e1245bbc", "score": "0.42756796", "text": "func AddDisallowedPath(path string) {\n\t// Normalize the path.\n\tpath = toPath(path)\n\n\t// If the path does not end with a slash, then append the '$' symbol.\n\tif !strings.HasSuffix(path, \"/\") {\n\t\tpath += \"$\"\n\t}\n\n\t// Check if already present in slice.\n\tfor _, p := range disallowedPaths {\n\t\tif p == path {\n\t\t\tlog.L.Warning(\"webcrawler: the robots disallowed path '%s' is already in the list. Duplicate call...\", path)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Add the path to the slice.\n\tdisallowedPaths = append(disallowedPaths, path)\n}", "title": "" }, { "docid": "a475481dee8b3e750f4de490a5652a94", "score": "0.42738646", "text": "func (app *App) registerLocation(methods []string, path string, scopes []Scope, middlewares []middleware.Middleware) {\n\tfor _, scope := range scopes {\n\t\tapp.registerLocationForScope(methods, path, scope, middlewares)\n\t}\n}", "title": "" }, { "docid": "5c9db3c61a8e0c00e75f4d80ef2a19a6", "score": "0.42541385", "text": "func AddProductLocation(\n\tt *testing.T,\n\tsim *backends.SimulatedBackend,\n\tauth *bind.TransactOpts,\n\tcontract *bindingsvm.Vendormanagement,\n) {\n\ttx, err := contract.AddProductLocation(\n\t\tauth,\n\t\t\"lays chip\",\n\t\t\"3\",\n\t)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsim.Commit()\n\tif _, err := bind.WaitMined(context.Background(), sim, tx); err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "ae37fbf22801badb8f121c30f808cc93", "score": "0.42527926", "text": "func (d *Dispatcher) AddTaskExecs(execs ...*TaskExec) {\n\td.Tasks = append(d.Tasks, execs...)\n}", "title": "" }, { "docid": "6b0689ed65ee89d34e38fdb249ef5249", "score": "0.425189", "text": "func joinPath(parts ...string) string {\n\treturn strings.Join(parts, \"/\")\n}", "title": "" }, { "docid": "0a63bd6805fdf34b5a0dc54b436c1e0f", "score": "0.42513528", "text": "func (t *vhostTrie) insertPath(remainingPath, originalPath string, site *SiteConfig) {\n\tif remainingPath == \"\" {\n\t\tt.site = site\n\t\tt.path = originalPath\n\t\treturn\n\t}\n\tch := string(remainingPath[0])\n\tif _, ok := t.edges[ch]; !ok {\n\t\tt.edges[ch] = newVHostTrie()\n\t}\n\tt.edges[ch].insertPath(remainingPath[1:], originalPath, site)\n}", "title": "" }, { "docid": "65da390346f19d7164f3ad97a5d87b07", "score": "0.42501438", "text": "func (e *dockerExec) path(elems ...string) string {\n\treturn e.Executor.execPath(e.id, elems...)\n}", "title": "" }, { "docid": "66f49db64699905c6058da6b8ab9cde8", "score": "0.4239171", "text": "func (q *Queue) AddTasks(tasks []string) {\n\tq.tasks = append(q.tasks, tasks...)\n}", "title": "" }, { "docid": "e10cd9d841e9907f963738b42183e094", "score": "0.42368874", "text": "func AddStrInPath(path, str string) string {\n\text := filepath.Ext(path)\n\treturn path[:len(path)-len(ext)] + str + ext\n}", "title": "" }, { "docid": "dc65664c0f6dc5528324c66bf6dc0bd2", "score": "0.42336813", "text": "func (project *Project) AddGitBinToPath() error {\n\tfile, err := os.OpenFile(\".envrc\", os.O_RDWR|os.O_CREATE, 0666)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tif strings.Contains(scanner.Text(), \"PATH_add .git/bin\") {\n\t\t\treturn nil\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := file.Write([]byte(\"PATH_add .git/bin\\n\")); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a63cc96d7e1fb6c24bb9251e1835fdf7", "score": "0.42322934", "text": "func PathExpandTilda(path string) string {\n\tif len(path) < 2 {\n\t\treturn path\n\t}\n\n\tfixedPath := path\n\tif fixedPath[:2] == \"~/\" {\n\t\tuserDir, _ := user.Current()\n\t\thomeDir := userDir.HomeDir\n\t\tfixedPath = filepath.Join(homeDir, fixedPath[2:])\n\t}\n\n\treturn fixedPath\n}", "title": "" }, { "docid": "1ab76c914fbf7582b93050941f6befdc", "score": "0.42260718", "text": "func (p *Paths) Set(value string) error {\n\tfor _, val := range strings.Split(value, \",\") {\n\t\t*p = append(*p, val)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1f39357d95bf24a3e31804a58f28964f", "score": "0.4221214", "text": "func (b *Bundle) Add(path string, facts *Package) {\n\tb.decoded[path] = facts\n}", "title": "" }, { "docid": "1f39357d95bf24a3e31804a58f28964f", "score": "0.4221214", "text": "func (b *Bundle) Add(path string, facts *Package) {\n\tb.decoded[path] = facts\n}", "title": "" }, { "docid": "60576824c2b9b7c0a2cc457661b0d125", "score": "0.42206377", "text": "func addParams(path string, params interface{}) (string, error) {\n\tv := reflect.ValueOf(params)\n\tif v.Kind() == reflect.Ptr && v.IsNil() {\n\t\treturn path, nil\n\t}\n\n\tpathURL, err := url.Parse(path)\n\tif err != nil {\n\t\treturn path, err\n\t}\n\n\tnewPath := pathURL.Query()\n\tnewParams, err := query.Values(params)\n\tif err != nil {\n\t\treturn path, err\n\t}\n\n\tfor k, v := range newParams {\n\t\tnewPath[k] = v\n\t}\n\n\tpathURL.RawQuery = newParams.Encode()\n\treturn pathURL.String(), nil\n}", "title": "" } ]
4d010277162e6324c3ed33219847dd09
NewUpdateOrganizationParamsWithContext creates a new UpdateOrganizationParams object with the default values initialized, and the ability to set a context for a request
[ { "docid": "2c526e7456c30de061583e069cbf3399", "score": "0.8715741", "text": "func NewUpdateOrganizationParamsWithContext(ctx context.Context) *UpdateOrganizationParams {\n\tvar ()\n\treturn &UpdateOrganizationParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" } ]
[ { "docid": "122a43e0d889dcb6a7cc2d0aafa80503", "score": "0.7644201", "text": "func (o *UpdateOrganizationParams) WithContext(ctx context.Context) *UpdateOrganizationParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "122a43e0d889dcb6a7cc2d0aafa80503", "score": "0.7644201", "text": "func (o *UpdateOrganizationParams) WithContext(ctx context.Context) *UpdateOrganizationParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "464ae65a6dd34b1c720f232a56f54638", "score": "0.72214293", "text": "func NewUpdateOrganizationParams() *UpdateOrganizationParams {\n\tvar ()\n\treturn &UpdateOrganizationParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "464ae65a6dd34b1c720f232a56f54638", "score": "0.72214293", "text": "func NewUpdateOrganizationParams() *UpdateOrganizationParams {\n\tvar ()\n\treturn &UpdateOrganizationParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "d011724ec581c62e51008fa5ccc0efe0", "score": "0.67490953", "text": "func (o *UpdateOrganizationParams) WithOrganization(organization *models.Organization) *UpdateOrganizationParams {\n\to.SetOrganization(organization)\n\treturn o\n}", "title": "" }, { "docid": "22ef068d8684b38d2ed1493d851f7c37", "score": "0.67479545", "text": "func NewUpdateOrganizationParamsWithTimeout(timeout time.Duration) *UpdateOrganizationParams {\n\tvar ()\n\treturn &UpdateOrganizationParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "22ef068d8684b38d2ed1493d851f7c37", "score": "0.67479545", "text": "func NewUpdateOrganizationParamsWithTimeout(timeout time.Duration) *UpdateOrganizationParams {\n\tvar ()\n\treturn &UpdateOrganizationParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "b0f27d1be5e6f150ae7f4bf5babc3af5", "score": "0.6683347", "text": "func NewUpdateOrganizationParamsWithHTTPClient(client *http.Client) *UpdateOrganizationParams {\n\tvar ()\n\treturn &UpdateOrganizationParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "b0f27d1be5e6f150ae7f4bf5babc3af5", "score": "0.6683347", "text": "func NewUpdateOrganizationParamsWithHTTPClient(client *http.Client) *UpdateOrganizationParams {\n\tvar ()\n\treturn &UpdateOrganizationParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "07b30eefcae7a276914e2a5c6ce6abeb", "score": "0.65052706", "text": "func NewAddOrganizationParamsWithContext(ctx context.Context) *AddOrganizationParams {\n\treturn &AddOrganizationParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "61e9c6344772d7d22f1e0eae9c6c6cb8", "score": "0.62632394", "text": "func (o *UpdateOrganizationParams) WithTimeout(timeout time.Duration) *UpdateOrganizationParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "61e9c6344772d7d22f1e0eae9c6c6cb8", "score": "0.62632394", "text": "func (o *UpdateOrganizationParams) WithTimeout(timeout time.Duration) *UpdateOrganizationParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "2a7c8c39eaa54a75ea6adbc5c59bc10f", "score": "0.6102972", "text": "func NewInviteOrganizationParamsWithContext(ctx context.Context) *InviteOrganizationParams {\n\treturn &InviteOrganizationParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "8a473a74babc56afbb9f16b0762e08b6", "score": "0.59745055", "text": "func (o *UpdateOrganizationParams) WithID(id strfmt.UUID) *UpdateOrganizationParams {\n\to.SetID(id)\n\treturn o\n}", "title": "" }, { "docid": "0d8ee78385b3c158a61c340c09105446", "score": "0.59242797", "text": "func (o *UpdateOrganizationParams) WithHTTPClient(client *http.Client) *UpdateOrganizationParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "0d8ee78385b3c158a61c340c09105446", "score": "0.59242797", "text": "func (o *UpdateOrganizationParams) WithHTTPClient(client *http.Client) *UpdateOrganizationParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "62308d94921e935e7218af604fa61f69", "score": "0.5640615", "text": "func (o *UpdateOrganizationParams) WithOrganizationUpdate(organizationUpdate *api_models.OrganizationUpdate) *UpdateOrganizationParams {\n\to.SetOrganizationUpdate(organizationUpdate)\n\treturn o\n}", "title": "" }, { "docid": "2f8a450d0f92a2431590f05a3de14d97", "score": "0.5639892", "text": "func NewInviteOrganizationParams() *InviteOrganizationParams {\n\treturn &InviteOrganizationParams{\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "90edfeb1f4ced432afeb6412c1a0d286", "score": "0.56044775", "text": "func (o *UpdateOrganizationParams) WithOrganizationID(organizationID string) *UpdateOrganizationParams {\n\to.SetOrganizationID(organizationID)\n\treturn o\n}", "title": "" }, { "docid": "c9e8798014d75f744d560d5e3db4422c", "score": "0.5474674", "text": "func (o *GetParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "6c175ec465037c020f0f238c225da4c2", "score": "0.5448394", "text": "func (uu *UserUpdate) SetOrganization(o *Organization) *UserUpdate {\n\treturn uu.SetOrganizationID(o.ID)\n}", "title": "" }, { "docid": "37c17debf54b1ff874bef768d070668a", "score": "0.54437405", "text": "func (o *AddOrganizationParams) WithOrganization(organization *mono_models.OrganizationEditable) *AddOrganizationParams {\n\to.SetOrganization(organization)\n\treturn o\n}", "title": "" }, { "docid": "80555915dac6af774da34f9f0b4994b8", "score": "0.5430076", "text": "func (c *Handler) UpdateOrganization() http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tvar err error\n\n\t\torganization := router.URLParam(r, \"organization\")\n\t\t_, span := trace.StartSpan(r.Context(), \"repo.FindOrganization\")\n\t\torganizationConfig, err := c.repo.FindOrganization(organization)\n\t\tspan.End()\n\n\t\tif organizationConfig == nil {\n\t\t\terrors.Handler(w, r, ErrUserNotFound)\n\t\t\treturn\n\t\t}\n\n\t\tif err != nil {\n\t\t\terrors.Handler(w, r, err)\n\t\t\treturn\n\t\t}\n\n\t\terr = json.NewDecoder(r.Body).Decode(organizationConfig)\n\t\tif err != nil {\n\t\t\terrors.Handler(w, r, err)\n\t\t\treturn\n\t\t}\n\t\torganizationConfig.Organization = organization\n\n\t\t_, span = trace.StartSpan(r.Context(), \"repo.Add\")\n\t\terr = c.repo.AddOrganization(organizationConfig)\n\t\tspan.End()\n\n\t\tif err != nil {\n\t\t\terrors.Handler(w, r, errors.New(http.StatusBadRequest, err.Error()))\n\t\t\treturn\n\t\t}\n\n\t\tw.WriteHeader(http.StatusOK)\n\t}\n}", "title": "" }, { "docid": "8b9f7e3b07c3c732fbafa7590f72fad5", "score": "0.54201347", "text": "func (uuo *UserUpdateOne) SetOrganization(o *Organization) *UserUpdateOne {\n\treturn uuo.SetOrganizationID(o.ID)\n}", "title": "" }, { "docid": "74c5e2e8ba91c4a7f3baa633689aa260", "score": "0.54105395", "text": "func NewAddOrganizationParams() *AddOrganizationParams {\n\treturn &AddOrganizationParams{\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "4c095e8b84395bcb19ab0c844d0dbc4f", "score": "0.5385972", "text": "func (o *UpdateOrganizationParams) SetOrganization(organization *models.Organization) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "c9b6aa4c55242e3d13b9d01b752be9df", "score": "0.53800124", "text": "func NewUpdatePackageParamsWithContext(ctx context.Context) *UpdatePackageParams {\n\tvar ()\n\treturn &UpdatePackageParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "f62d7156533159bda8357276e4170e1c", "score": "0.53673875", "text": "func (o *AddOrganizationParams) WithContext(ctx context.Context) *AddOrganizationParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "3fcae0a753b2acfb65f49b7c16128f76", "score": "0.53409064", "text": "func NewUpdateAnOrderParamsWithContext(ctx context.Context) *UpdateAnOrderParams {\n\tvar (\n\t\tacceptDefault = string(\"application/json\")\n\t\tcontentTypeDefault = string(\"application/json\")\n\t)\n\treturn &UpdateAnOrderParams{\n\t\tAccept: acceptDefault,\n\t\tContentType: contentTypeDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "cebd3c4f2ac19a6c7ac548bdab51d65c", "score": "0.53109956", "text": "func NewUpdateOrganizationApiV1OrganizationsOrganizationIdPutRequestWithBody(server string, organizationId int, contentType string, body io.Reader) (*http.Request, error) {\n\tvar err error\n\n\tvar pathParam0 string\n\n\tpathParam0, err = runtime.StyleParamWithLocation(\"simple\", false, \"organization_id\", runtime.ParamLocationPath, organizationId)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tserverURL, err := url.Parse(server)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toperationPath := fmt.Sprintf(\"/api/v1/organizations/%s\", pathParam0)\n\tif operationPath[0] == '/' {\n\t\toperationPath = operationPath[1:]\n\t}\n\toperationURL := url.URL{\n\t\tPath: operationPath,\n\t}\n\n\tqueryURL := serverURL.ResolveReference(&operationURL)\n\n\treq, err := http.NewRequest(\"PUT\", queryURL.String(), body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Add(\"Content-Type\", contentType)\n\n\treturn req, nil\n}", "title": "" }, { "docid": "c159abd0bf632bb66916a2a84c5c4b20", "score": "0.5305578", "text": "func NewInviteOrganizationParamsWithHTTPClient(client *http.Client) *InviteOrganizationParams {\n\treturn &InviteOrganizationParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "7668244fe446391bf75976eefa8dc8e3", "score": "0.53037703", "text": "func (o *GetGlobalPermissionsParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "1d5a60dfc442cadbd70e5758879444fb", "score": "0.5302231", "text": "func NewUpdateSiteMetadataParamsWithContext(ctx context.Context) *UpdateSiteMetadataParams {\n\tvar ()\n\treturn &UpdateSiteMetadataParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "0886167eed6021087f7d51585142404d", "score": "0.5291685", "text": "func (o *GetPageParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "aafc3cce3fce4ee7aff2701594891bf0", "score": "0.52575666", "text": "func (o *InviteOrganizationParams) WithContext(ctx context.Context) *InviteOrganizationParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "03fed7797228b89adc1774b14ce11b8d", "score": "0.5236759", "text": "func NewUpdateLdapSettingsParamsWithContext(ctx context.Context) *UpdateLdapSettingsParams {\n\tvar ()\n\treturn &UpdateLdapSettingsParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "788c1ff274edea059bf990725e6fe89e", "score": "0.52311695", "text": "func NewInviteOrganizationParamsWithTimeout(timeout time.Duration) *InviteOrganizationParams {\n\treturn &InviteOrganizationParams{\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "99ba00b8b8d466e64f1370da17a51ab4", "score": "0.5228556", "text": "func (o *CheckMembershipExistenceParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "bbb548e34baed44f40c8beb8161afae4", "score": "0.5221401", "text": "func (o *WorkflowCatalogItemDefinitionAllOf) SetOrganization(v OrganizationOrganizationRelationship) {\n\to.Organization = &v\n}", "title": "" }, { "docid": "282a7ae282c3796a2d5a5e093bfba500", "score": "0.5188929", "text": "func (o *GetPointsParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "d6e8f9a58498928152758b57ed0ee89c", "score": "0.5188097", "text": "func NewUpdateOrganizationApiV1OrganizationsOrganizationIdPutRequest(server string, organizationId int, body UpdateOrganizationApiV1OrganizationsOrganizationIdPutJSONRequestBody) (*http.Request, error) {\n\tvar bodyReader io.Reader\n\tbuf, err := json.Marshal(body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbodyReader = bytes.NewReader(buf)\n\treturn NewUpdateOrganizationApiV1OrganizationsOrganizationIdPutRequestWithBody(server, organizationId, \"application/json\", bodyReader)\n}", "title": "" }, { "docid": "98a64b29aba150e0766187767413c71d", "score": "0.5183624", "text": "func (o *PatchWorkflowLinkParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "e9855bdd2e6afd6a3a9b1905942315e0", "score": "0.5170408", "text": "func (o *OrganizationsService) UpdateOrganization(org Organization) (*Organization, *Response, error) {\n\tvar updateRequest struct {\n\t\tDescription string `json:\"description\"`\n\t}\n\tupdateRequest.Description = org.Description\n\treq, err := o.client.NewRequest(IDM, \"PUT\", \"security/organizations/\"+org.OrganizationID, &updateRequest, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"api-version\", organizationAPIVersion)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tvar responseBody bytes.Buffer\n\n\tresp, err := o.client.Do(req, &responseBody)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn &org, resp, err\n\n}", "title": "" }, { "docid": "14fe714bec4dae403e7c5c326c5463bb", "score": "0.5167813", "text": "func (o *PatchWorkflowLinkParams) WithOrganization(organization string) *PatchWorkflowLinkParams {\n\to.SetOrganization(organization)\n\treturn o\n}", "title": "" }, { "docid": "c20d57b55911aec0d9a58b7a847f0d27", "score": "0.51663816", "text": "func NewUpdateLogicalRouterParamsWithContext(ctx context.Context) *UpdateLogicalRouterParams {\n\tvar ()\n\treturn &UpdateLogicalRouterParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "bf37c7247b8de42c5293e0a81e83c6e9", "score": "0.516315", "text": "func NewUpdateAzureIDPParamsWithContext(ctx context.Context) *UpdateAzureIDPParams {\n\tvar (\n\t\taidDefault = string(\"default\")\n\t\tiidDefault = string(\"default\")\n\t\ttidDefault = string(\"default\")\n\t)\n\treturn &UpdateAzureIDPParams{\n\t\tAid: aidDefault,\n\t\tIid: iidDefault,\n\t\tTid: tidDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "356d8e60032baac0380396b19113eca7", "score": "0.51620907", "text": "func (client *Client) UpdateOrganization(org resources.Organization) (resources.Organization, Warnings, error) {\n\torgGUID := org.GUID\n\torg.GUID = \"\"\n\n\tvar responseBody resources.Organization\n\n\t_, warnings, err := client.MakeRequest(RequestParams{\n\t\tRequestName: internal.PatchOrganizationRequest,\n\t\tURIParams: internal.Params{\"organization_guid\": orgGUID},\n\t\tRequestBody: org,\n\t\tResponseBody: &responseBody,\n\t})\n\n\treturn responseBody, warnings, err\n}", "title": "" }, { "docid": "3f876a024bdbc1a9b60735e04a956183", "score": "0.51584935", "text": "func (c *client) UpdateOrganization(id int64, org *Organization) (*Organization, error) {\n\tin := &APIPayload{Organization: org}\n\tout := new(APIPayload)\n\terr := c.put(fmt.Sprintf(\"/api/v2/organizations/%d.json\", id), in, out)\n\treturn out.Organization, err\n}", "title": "" }, { "docid": "7ecd9219060a95d0bb73da82aee4d83f", "score": "0.51569766", "text": "func (o *GetSuitesByTestCaseIDParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "4aefff168fa5f42f79fc4f97525be0ef", "score": "0.5148254", "text": "func NewKerberosRealmModifyParamsWithContext(ctx context.Context) *KerberosRealmModifyParams {\n\treturn &KerberosRealmModifyParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "14e75a695d7d0b2f2dda0165b3e09fd4", "score": "0.5147602", "text": "func NewUpdateGUIDParamsWithContext(ctx context.Context) *UpdateGUIDParams {\n\tvar ()\n\treturn &UpdateGUIDParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "fc3289482949d36c03e595105c928234", "score": "0.51125336", "text": "func NewAddOrganizationParamsWithTimeout(timeout time.Duration) *AddOrganizationParams {\n\treturn &AddOrganizationParams{\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "bb22a4d51544a26de2144a082bec51e2", "score": "0.5105033", "text": "func (o *AddOrganizationParams) SetOrganization(organization *mono_models.OrganizationEditable) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "e489de7ee2fe6f184a3f797e0e21da99", "score": "0.5078648", "text": "func (r *mutationResolver) UpdateOrganization(ctx context.Context, input UpdateOrganizationInput) (*models.Organization, error) {\n\tcUser := models.CurrentUser(ctx)\n\textras := map[string]interface{}{\n\t\t\"user\": cUser.UUID,\n\t}\n\n\tvar org models.Organization\n\tif err := org.FindByUUID(input.ID); err != nil {\n\t\treturn &models.Organization{}, domain.ReportError(ctx, err, \"UpdateOrganization.NotFound\", extras)\n\t}\n\n\tif !cUser.CanEditOrganization(org.ID) {\n\t\terr := errors.New(\"insufficient permissions\")\n\t\treturn &models.Organization{}, domain.ReportError(ctx, err, \"UpdateOrganization.Unauthorized\", extras)\n\t}\n\n\torg.Url = models.ConvertStringPtrToNullsString(input.URL)\n\n\tif input.LogoFileID != nil {\n\t\tif _, err := org.AttachLogo(*input.LogoFileID); err != nil {\n\t\t\treturn &models.Organization{}, domain.ReportError(ctx, err, \"UpdateOrganization.LogoFileNotFound\")\n\t\t}\n\t} else {\n\t\tif err := org.RemoveFile(); err != nil {\n\t\t\treturn &models.Organization{}, domain.ReportError(ctx, err, \"UpdateOrganization.RemoveLogo\")\n\t\t}\n\t}\n\n\torg.Name = input.Name\n\torg.AuthType = input.AuthType\n\torg.AuthConfig = input.AuthConfig\n\tif err := org.Save(); err != nil {\n\t\treturn &models.Organization{}, domain.ReportError(ctx, err, \"UpdateOrganization\", extras)\n\t}\n\n\treturn &org, nil\n}", "title": "" }, { "docid": "a54ec39cc62f39767112042e387df24d", "score": "0.5072878", "text": "func (o *GetParams) WithOrganization(organization string) *GetParams {\n\to.SetOrganization(organization)\n\treturn o\n}", "title": "" }, { "docid": "c150fb7437136c833d46944d62a51a23", "score": "0.50641745", "text": "func (o *DeletePageParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "e9633247cfae9635056292c74f38e678", "score": "0.5054304", "text": "func (o *KubernetesTrustedRegistriesPolicyAllOf) SetOrganization(v OrganizationOrganizationRelationship) {\n\to.Organization = &v\n}", "title": "" }, { "docid": "4665149d1b0d2cb785abaf983b5b00fd", "score": "0.50501114", "text": "func NewUpdateReasonParamsWithContext(ctx context.Context) *UpdateReasonParams {\n\tvar ()\n\treturn &UpdateReasonParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "8daca5a93982161460e992cc986cb91a", "score": "0.5049925", "text": "func (o *HyperflexClusterReplicationNetworkPolicyDeploymentAllOf) SetOrganization(v OrganizationOrganizationRelationship) {\n\to.Organization = &v\n}", "title": "" }, { "docid": "cb3505ec7b7d1b15beac0383d34364a2", "score": "0.5030681", "text": "func (o *GetGlobalPermissionsParams) WithOrganization(organization string) *GetGlobalPermissionsParams {\n\to.SetOrganization(organization)\n\treturn o\n}", "title": "" }, { "docid": "c8c161d2ff4744f1785e5f69dd4e8113", "score": "0.5030104", "text": "func (o *GetTestRunByIDParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "1a1150a9fd57c843dd6299cbfcae5925", "score": "0.5028681", "text": "func (z *Client) UpdateOrganization(ctx context.Context, orgID int64, org Organization) (Organization, error) {\n\tvar result, data struct {\n\t\tOrganization Organization `json:\"organization\"`\n\t}\n\n\tdata.Organization = org\n\n\tbody, err := z.put(ctx, fmt.Sprintf(\"/organizations/%d.json\", orgID), data)\n\tif err != nil {\n\t\treturn Organization{}, err\n\t}\n\n\terr = json.Unmarshal(body, &result)\n\tif err != nil {\n\t\treturn Organization{}, err\n\t}\n\n\treturn result.Organization, err\n}", "title": "" }, { "docid": "e0aeff667587ad6b52e08cefe210ade3", "score": "0.5026302", "text": "func NewObmsPutParamsWithContext(ctx context.Context) *ObmsPutParams {\n\tvar ()\n\treturn &ObmsPutParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "c59fbd010840395e331a8648209ee9a8", "score": "0.5018486", "text": "func (o *GetBuildChangesParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "404d61a6fd195c0b00d60279b98957b4", "score": "0.501739", "text": "func (a *Client) UpdateOrganization(params *UpdateOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOrganizationOK, *UpdateOrganizationNoContent, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewUpdateOrganizationParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"UpdateOrganization\",\n\t\tMethod: \"PUT\",\n\t\tPathPattern: \"/api/v1/orgs/{owner}\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\", \"https\"},\n\t\tParams: params,\n\t\tReader: &UpdateOrganizationReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t}\n\tfor _, opt := range opts {\n\t\topt(op)\n\t}\n\n\tresult, err := a.transport.Submit(op)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tswitch value := result.(type) {\n\tcase *UpdateOrganizationOK:\n\t\treturn value, nil, nil\n\tcase *UpdateOrganizationNoContent:\n\t\treturn nil, value, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*UpdateOrganizationDefault)\n\treturn nil, nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "title": "" }, { "docid": "1140993d48f6d18881f7de837c060d75", "score": "0.50141317", "text": "func (o *GetTestRunCodeCoverageParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "04b4ca0fb6d8f303cf86e54bafc4c67f", "score": "0.4996151", "text": "func NewUpdateWormSettingsParamsWithContext(ctx context.Context) *UpdateWormSettingsParams {\n\tvar ()\n\treturn &UpdateWormSettingsParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "2cf31bee18d17b69f61cfec3dec76dac", "score": "0.4989634", "text": "func (o *FabricFcZonePolicyAllOf) SetOrganization(v OrganizationOrganizationRelationship) {\n\to.Organization = &v\n}", "title": "" }, { "docid": "677374a222c183c53640b25b78dc53c7", "score": "0.4980183", "text": "func (o *BulkMoDeepClonerAllOf) SetOrganization(v OrganizationOrganizationRelationship) {\n\to.Organization = &v\n}", "title": "" }, { "docid": "a52dad6690857d6e8e942e4be99a526a", "score": "0.49780443", "text": "func NewUpdateCertificateParamsWithContext(ctx context.Context) *UpdateCertificateParams {\n\tvar ()\n\treturn &UpdateCertificateParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "ae6b3e8a9775f0f7fbc7e0057e37ba7e", "score": "0.49618605", "text": "func (o *GetReleaseTaskAttachmentsParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "799cfa4626a9d2e7d460f0dbf5626df8", "score": "0.4946341", "text": "func (o *GetPointsListParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "dfca2df5279a442d5f26990200384678", "score": "0.49374416", "text": "func NewUpdatePluginParamsWithContext(ctx context.Context) *UpdatePluginParams {\n\tvar ()\n\treturn &UpdatePluginParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "73bc35c5acee0121f7e38e1f486c0c52", "score": "0.4921969", "text": "func NewAddOrganizationParamsWithHTTPClient(client *http.Client) *AddOrganizationParams {\n\treturn &AddOrganizationParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "88f8d6bc3312d99d153f738200f6ab47", "score": "0.48929268", "text": "func (o *GetPageParams) WithOrganization(organization string) *GetPageParams {\n\to.SetOrganization(organization)\n\treturn o\n}", "title": "" }, { "docid": "79a313510fbbd88d1a9f79eef2e5325c", "score": "0.48915333", "text": "func NewPutCalendarParams() *PutCalendarParams {\n\tvar (\n\t\treplaceDefault bool = bool(false)\n\t\tupdateTriggersDefault bool = bool(false)\n\t)\n\treturn &PutCalendarParams{\n\t\tReplace: &replaceDefault,\n\t\tUpdateTriggers: &updateTriggersDefault,\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "b773c3a0ba311fdcb088e09b0bea8361", "score": "0.48761386", "text": "func NewIssueLicenseParamsWithContext(ctx context.Context) *IssueLicenseParams {\n\tvar ()\n\treturn &IssueLicenseParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "0e82c2dfc7b8c0735ada75252a796738", "score": "0.48621497", "text": "func (o *ChassisConfigImportAllOf) SetOrganization(v OrganizationOrganizationRelationship) {\n\to.Organization = &v\n}", "title": "" }, { "docid": "7527c9fbe3db75f6f1e383a0f13aff8f", "score": "0.48376358", "text": "func (o *DeletePackageVersionFromRecycleBinParams) SetOrganization(organization string) {\n\to.Organization = organization\n}", "title": "" }, { "docid": "9b5005de04a8c6f061b0fe2d2e961100", "score": "0.48372918", "text": "func NewUpdateCloudPoolParamsWithContext(ctx context.Context) *UpdateCloudPoolParams {\n\tvar ()\n\treturn &UpdateCloudPoolParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "5f3bec892a6bd18db4be64db429bdc54", "score": "0.48324817", "text": "func (o *FabricFcZonePolicy) SetOrganization(v OrganizationOrganizationRelationship) {\n\to.Organization = &v\n}", "title": "" }, { "docid": "ddea83ac481b296887fde76e1645b0b4", "score": "0.48002318", "text": "func NewUpdateEventSettingsParamsWithContext(ctx context.Context) *UpdateEventSettingsParams {\n\tvar ()\n\treturn &UpdateEventSettingsParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "81676b8b659be4540aa22e33b4e62522", "score": "0.4799084", "text": "func NewUpdateServiceParamsWithContext(ctx context.Context) *UpdateServiceParams {\n\tvar (\n\t\ttidDefault = string(\"default\")\n\t)\n\treturn &UpdateServiceParams{\n\t\tTid: tidDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "8d3ff36bc72c0284d129a0782cfc7dfd", "score": "0.47915414", "text": "func (s *Service) UpdateOrganization(ctx context.Context, id platform.ID, upd platform.OrganizationUpdate) (*platform.Organization, error) {\n\to, err := s.FindOrganizationByID(ctx, id)\n\tif err != nil {\n\t\treturn nil, &platform.Error{\n\t\t\tErr: err,\n\t\t\tOp: OpPrefix + platform.OpUpdateOrganization,\n\t\t}\n\t}\n\n\tif upd.Name != nil {\n\t\tif *upd.Name = strings.TrimSpace(*upd.Name); *upd.Name == \"\" {\n\t\t\treturn nil, platform.ErrOrgNameisEmpty\n\t\t}\n\t\tif _, err := s.FindOrganization(ctx, platform.OrganizationFilter{Name: upd.Name}); err == nil {\n\t\t\treturn nil, &platform.Error{\n\t\t\t\tCode: platform.EConflict,\n\t\t\t\tMsg: fmt.Sprintf(\"organization with name %s already exists\", *upd.Name),\n\t\t\t}\n\t\t}\n\t\to.Name = *upd.Name\n\t}\n\n\tif upd.Description != nil {\n\t\to.Description = *upd.Description\n\t}\n\n\to.UpdatedAt = s.Now()\n\n\ts.organizationKV.Store(o.ID.String(), o)\n\n\treturn o, nil\n}", "title": "" }, { "docid": "42d9d17f11a308d9edf6b87ccc9a6fe5", "score": "0.47632295", "text": "func NewUpdateRouteTableParamsWithContext(ctx context.Context) *UpdateRouteTableParams {\n\tvar ()\n\treturn &UpdateRouteTableParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "e5024fe9134258ea9ede858a5e5ab922", "score": "0.47596556", "text": "func NewUpdateGroupCustomAttributesPublicV2ParamsWithContext(ctx context.Context) *UpdateGroupCustomAttributesPublicV2Params {\n\tvar ()\n\treturn &UpdateGroupCustomAttributesPublicV2Params{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "158596bcd7228abaee2fa9fb9d51034f", "score": "0.4752888", "text": "func NewPostUpdateSoftwareComponentsParamsWithContext(ctx context.Context) *PostUpdateSoftwareComponentsParams {\n\tvar (\n\t\tlicensingModelDefault = string(\"Individual - Device/Perpetual\")\n\t\tsoftwareTypeDefault = string(\"Unmanaged\")\n\t)\n\treturn &PostUpdateSoftwareComponentsParams{\n\t\tLicensingModel: licensingModelDefault,\n\t\tSoftwareType: softwareTypeDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "7171cd731cd66fa29bf3be8af221f8e7", "score": "0.4735574", "text": "func (o *InviteOrganizationParams) WithAttributes(attributes InviteOrganizationBody) *InviteOrganizationParams {\n\to.SetAttributes(attributes)\n\treturn o\n}", "title": "" }, { "docid": "804624247e0c8fe335d683f9f9fb058a", "score": "0.4720412", "text": "func (o *UpdateOrganizationParams) SetOrganizationUpdate(organizationUpdate *api_models.OrganizationUpdate) {\n\to.OrganizationUpdate = organizationUpdate\n}", "title": "" }, { "docid": "d4e56d671a6a7be752315bda36157f05", "score": "0.46823096", "text": "func NewPutLdapConfigParamsWithContext(ctx context.Context) *PutLdapConfigParams {\n\tvar ()\n\treturn &PutLdapConfigParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "dc253ae1307fc4fdc8be2dbabe8b57ca", "score": "0.46787003", "text": "func NewUpdateSensorTypeUsingPUTParamsWithContext(ctx context.Context) *UpdateSensorTypeUsingPUTParams {\n\tvar ()\n\treturn &UpdateSensorTypeUsingPUTParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "f5e42f28ab4e098ab9ba3d271da25f83", "score": "0.46702567", "text": "func (s *Service) PutOrganization(ctx context.Context, o *platform.Organization) error {\n\ts.organizationKV.Store(o.ID.String(), o)\n\treturn nil\n}", "title": "" }, { "docid": "77d285194e139669d3054d2eea7343b8", "score": "0.46692815", "text": "func (c *Context) SetOrganization(o string) { c.orgName = o }", "title": "" }, { "docid": "d62777524c4a475e34fa60e959351191", "score": "0.46544087", "text": "func NewNvmeNamespaceModifyParamsWithContext(ctx context.Context) *NvmeNamespaceModifyParams {\n\treturn &NvmeNamespaceModifyParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "4f6494a79c9d8f585fe0688c0960afc0", "score": "0.46515682", "text": "func NewEavAttributeSetRepositoryV1SavePutParamsWithContext(ctx context.Context) *EavAttributeSetRepositoryV1SavePutParams {\n\tvar ()\n\treturn &EavAttributeSetRepositoryV1SavePutParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "ff3dad7d1ae467394ae3221c120687ca", "score": "0.46279156", "text": "func (o *UpdateOrganizationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param organizationId\n\tif err := r.SetPathParam(\"organizationId\", o.OrganizationID); err != nil {\n\t\treturn err\n\t}\n\n\tif o.OrganizationUpdate != nil {\n\t\tif err := r.SetBodyParam(o.OrganizationUpdate); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b3090ff3be0a52c3ba60824049ca3d6d", "score": "0.46220806", "text": "func NewGetOrganizationVpnFirewallRulesParamsWithContext(ctx context.Context) *GetOrganizationVpnFirewallRulesParams {\n\tvar ()\n\treturn &GetOrganizationVpnFirewallRulesParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "22af725b913e894dc7a5ca4888daab07", "score": "0.46180716", "text": "func NewSaveDefinitionParamsWithContext(ctx context.Context) *SaveDefinitionParams {\n\tvar ()\n\treturn &SaveDefinitionParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "8dd3676335fe3a30c5a1ca5803ef4858", "score": "0.46178672", "text": "func NewEmailCampaignPutParamsWithContext(ctx context.Context) *EmailCampaignPutParams {\n\tvar ()\n\treturn &EmailCampaignPutParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" } ]
d9d200e141602721d5ac65742f527e61
SetDefaultHook sets function that is called when the Heartbeat method of the parent MockStore instance is invoked and the hook queue is empty.
[ { "docid": "afb13411753eced1d35ae4fc1546132a", "score": "0.76765287", "text": "func (f *StoreHeartbeatFunc) SetDefaultHook(hook func(context.Context, []int) ([]int, error)) {\n\tf.defaultHook = hook\n}", "title": "" } ]
[ { "docid": "5ca7255aa0984fc497772c1163b580ef", "score": "0.7731665", "text": "func (f *WorkerStoreHeartbeatFunc) SetDefaultHook(hook func(context.Context, []int, store.HeartbeatOptions) ([]int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "8351c1bc1b28cdd4c3cb053c0c1e1d80", "score": "0.7595407", "text": "func (f *WorkerStoreRequeueFunc) SetDefaultHook(hook func(context.Context, int, time.Time) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "b526b7c8e23141eca2ce9b36508dc926", "score": "0.75864387", "text": "func (f *WorkerStoreResetStalledFunc) SetDefaultHook(hook func(context.Context) (map[int]time.Duration, map[int]time.Duration, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "c58540a54c4ec6c5623b3b6754ab6554", "score": "0.7385452", "text": "func (f *WorkerStoreHandleFunc) SetDefaultHook(hook func() basestore.TransactableHandle) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "17858730a380d29d116b33588becc97a", "score": "0.7318815", "text": "func (f *StoreDequeueFunc) SetDefaultHook(hook func(context.Context, string, interface{}) (Record, bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "83a8b190350203786b26a15779cdec69", "score": "0.7283649", "text": "func (f *StoreQueuedCountFunc) SetDefaultHook(hook func(context.Context) (int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "29b7b5dad4f33be2cd10bc4f1ec90d56", "score": "0.72496027", "text": "func (f *WorkerStoreQueuedCountFunc) SetDefaultHook(hook func(context.Context, bool) (int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "24a8ecc60dfc6fad1d94d730c0f72f2e", "score": "0.7239698", "text": "func (f *WorkerStoreDequeueFunc) SetDefaultHook(hook func(context.Context, string, []*sqlf.Query) (workerutil.Record, bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "9b3a4dacca3ac92914d2a60782bc5977", "score": "0.71844316", "text": "func (f *WithPreDequeuePreDequeueFunc) SetDefaultHook(hook func(context.Context, log.Logger) (bool, interface{}, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "0368fda7e8406658de8d7582119f7fa5", "score": "0.7127436", "text": "func (f *DBStoreWithFunc) SetDefaultHook(hook func(basestore.ShareableStore) DBStore) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "0368fda7e8406658de8d7582119f7fa5", "score": "0.7127436", "text": "func (f *DBStoreWithFunc) SetDefaultHook(hook func(basestore.ShareableStore) DBStore) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "e1d432b85cfb406b5d2d5ae3ffda405c", "score": "0.71166277", "text": "func (f *WorkerStoreWithFunc) SetDefaultHook(hook func(basestore.ShareableStore) store.Store) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "a62b81d3f064bcf65073304d30bbf10c", "score": "0.7105348", "text": "func (f *StoreListFunc) SetDefaultHook(hook func(context.Context, store.ListOpts) ([]shared.Symbol, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "b8bfeecfcad4d0a78df3f0d1cee5f6bf", "score": "0.7094314", "text": "func (f *BundleManagerClientSendDBFunc) SetDefaultHook(hook func(context.Context, int, io.Reader) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "866485d00e255ac0e4b41b8b60f3d479", "score": "0.7078314", "text": "func (f *WorkerStoreUpdateExecutionLogEntryFunc) SetDefaultHook(hook func(context.Context, int, int, workerutil.ExecutionLogEntry, store.ExecutionLogEntryOptions) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "606a2f9e49bfa9d7e7cc345032c32da0", "score": "0.70465344", "text": "func (f *StoreUpdateExecutionLogEntryFunc) SetDefaultHook(hook func(context.Context, int, int, ExecutionLogEntry) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "c655c833bf94d6d62b366dc476a33a68", "score": "0.70392865", "text": "func (f *BackgroundRoutineStartFunc) SetDefaultHook(hook func()) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "1069ac2347846acc1c71513a6a72b22d", "score": "0.7018441", "text": "func (f *StoreAddExecutionLogEntryFunc) SetDefaultHook(hook func(context.Context, int, ExecutionLogEntry) (int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "98e064d7d7817f146d512e9ca9642ff7", "score": "0.7017613", "text": "func (f *DBStoreInsertDependencyIndexingJobFunc) SetDefaultHook(hook func(context.Context, int, string, time.Time) (int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "cc1d70b412a1b8c77c5cc6a43a46f200", "score": "0.6996511", "text": "func (f *HandlerHandleFunc) SetDefaultHook(hook func(context.Context, log.Logger, Record) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "c504cbcc3f3449228661a82b19d7b277", "score": "0.69929963", "text": "func (f *PolicyMatcherCommitsDescribedByPolicyFunc) SetDefaultHook(hook func(context.Context, int, []dbstore.ConfigurationPolicy, time.Time, ...string) (map[string][]enterprise.PolicyMatch, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "95b1baef0cf0aa782688442e65963bd8", "score": "0.6987793", "text": "func (f *CommandRunnerRunCommandFunc) SetDefaultHook(hook func(context.Context, command, *Logger) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "ae0d64225c1263ce0be312b77f037aa8", "score": "0.697404", "text": "func (f *WorkerStoreMaxDurationInQueueFunc) SetDefaultHook(hook func(context.Context) (time.Duration, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "09f5c19af5b73473e395bb067ea40a05", "score": "0.6965055", "text": "func (f *WorkerStoreAddExecutionLogEntryFunc) SetDefaultHook(hook func(context.Context, int, workerutil.ExecutionLogEntry, store.ExecutionLogEntryOptions) (int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "6ecbfb2d5985e948a2343febf13ea1a4", "score": "0.69475836", "text": "func (f *WithHooksPostHandleFunc) SetDefaultHook(hook func(context.Context, log.Logger, Record)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "9ef3c63604ba9ab724dfa59cf75e1dee", "score": "0.6945927", "text": "func (f *WithHooksPreHandleFunc) SetDefaultHook(hook func(context.Context, log.Logger, Record)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "c300238865466d60a5e14f7696b4b184", "score": "0.6929467", "text": "func (f *ExternalServiceStoreUpsertFunc) SetDefaultHook(hook func(context.Context, ...*types.ExternalService) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "84375fc73a6811e8c20150b38fe7cbf0", "score": "0.6914943", "text": "func (f *DBStoreGetConfigurationPoliciesFunc) SetDefaultHook(hook func(context.Context, dbstore.GetConfigurationPoliciesOptions) ([]dbstore.ConfigurationPolicy, int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "5f2d2c2cf478189135b1ca4144172189", "score": "0.6905719", "text": "func (f *BackgroundRoutineStopFunc) SetDefaultHook(hook func()) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "a5700c210cd85c53fac231bcbce39e70", "score": "0.6892378", "text": "func (f *CacheRemoveFunc) SetDefaultHook(hook func(string) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "8895e83a59b4f83eb867bc7027e44dcc", "score": "0.68868893", "text": "func (f *GitserverClientHeadFunc) SetDefaultHook(hook func(context.Context, store.Store, int) (string, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "86494bdb53d2c1eef392743b5e14c669", "score": "0.68583673", "text": "func (f *DBStoreReferencesForUploadFunc) SetDefaultHook(hook func(context.Context, int) (dbstore.PackageReferenceScanner, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "86494bdb53d2c1eef392743b5e14c669", "score": "0.68583673", "text": "func (f *DBStoreReferencesForUploadFunc) SetDefaultHook(hook func(context.Context, int) (dbstore.PackageReferenceScanner, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "e4f1f1345860b1b661a86f5d659de885", "score": "0.6829175", "text": "func (f *ExternalServiceStoreListFunc) SetDefaultHook(hook func(context.Context, database.ExternalServicesListOptions) ([]*types.ExternalService, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "fe3ba38f2ff466d2c64d15f25d3dee38", "score": "0.68268806", "text": "func (f *WorkerStoreMarkFailedFunc) SetDefaultHook(hook func(context.Context, int, string, store.MarkFinalOptions) (bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "b7571a8d39a753714a4662f1f35de98c", "score": "0.68148494", "text": "func (f *WorkerStoreMarkCompleteFunc) SetDefaultHook(hook func(context.Context, int, store.MarkFinalOptions) (bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "90d6c6ea02e179676d722077ceea4994", "score": "0.68088365", "text": "func (f *StoreMarkFailedFunc) SetDefaultHook(hook func(context.Context, int, string) (bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "acb20f5eacf0f47dfce494fa4abcc786", "score": "0.6797772", "text": "func (f *DBStoreInsertCloneableDependencyRepoFunc) SetDefaultHook(hook func(context.Context, precise.Package) (bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "c5ccb7136f154350b587c960f01199dd", "score": "0.67962605", "text": "func (f *StoreMarkCompleteFunc) SetDefaultHook(hook func(context.Context, int) (bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "397ba06a8ef159bcbdcc75cc9e2520e4", "score": "0.6788432", "text": "func (f *IndexEnqueuerQueueIndexesForPackageFunc) SetDefaultHook(hook func(context.Context, precise.Package) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "38c8aca3a768e4f2d6dc5f6d943da43e", "score": "0.67882437", "text": "func (f *CacheBustTagsFunc) SetDefaultHook(hook func(...string) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "c92d43b7f112b9475eb0afbcb2344b2f", "score": "0.67489856", "text": "func (f *IndexEnqueuerQueueIndexesForRepositoryFunc) SetDefaultHook(hook func(context.Context, int) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "6892db954af15dbf7fa165c6f3f94fce", "score": "0.672761", "text": "func (f *GitserverClientHeadFunc) SetDefaultHook(hook func(context.Context, int) (string, bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "6892db954af15dbf7fa165c6f3f94fce", "score": "0.672761", "text": "func (f *GitserverClientHeadFunc) SetDefaultHook(hook func(context.Context, int) (string, bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "0228af7c45316372301a9ca681e39aed", "score": "0.6725288", "text": "func (f *BundleManagerClientGetUploadFunc) SetDefaultHook(hook func(context.Context, int, string) (string, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "88583ee0851814c44fdc3745bda2face", "score": "0.67097974", "text": "func (f *FileSystemExistsFunc) SetDefaultHook(hook func(string) (bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "b36bf34499e2f9a392d632096db376c1", "score": "0.66733557", "text": "func (f *PackageReferenceScannerNextFunc) SetDefaultHook(hook func() (shared.PackageReference, bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "558cee1ae467e9c099f9c8b10e3b13a9", "score": "0.66657144", "text": "func (f *IndexEnqueuerQueueIndexesForPackageFunc) SetDefaultHook(hook func(context.Context, semantic.Package) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "9b6716c22bca5c2d52ebcd2be0d6dbf6", "score": "0.6651575", "text": "func (f *DBStoreGetUploadByIDFunc) SetDefaultHook(hook func(context.Context, int) (dbstore.Upload, bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "9b6716c22bca5c2d52ebcd2be0d6dbf6", "score": "0.6651575", "text": "func (f *DBStoreGetUploadByIDFunc) SetDefaultHook(hook func(context.Context, int) (dbstore.Upload, bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "9b9bbd6613ce41245f081feae1cdbdbe", "score": "0.6650747", "text": "func (f *WorkerStoreCanceledJobsFunc) SetDefaultHook(hook func(context.Context, []int, store.CanceledJobsOptions) ([]int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "591a6fd2d3f59abf547a091c9dd12728", "score": "0.6646325", "text": "func (f *DBStoreGetUploadsFunc) SetDefaultHook(hook func(context.Context, dbstore.GetUploadsOptions) ([]dbstore.Upload, int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "591a6fd2d3f59abf547a091c9dd12728", "score": "0.6646325", "text": "func (f *DBStoreGetUploadsFunc) SetDefaultHook(hook func(context.Context, dbstore.GetUploadsOptions) ([]dbstore.Upload, int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "0ee81a0ac811751e4bc23b2edd53c704", "score": "0.66427183", "text": "func (f *BundleManagerClientSendUploadFunc) SetDefaultHook(hook func(context.Context, int, io.Reader) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "546675a2bc157e2ed980db6e7c5378ba", "score": "0.6632688", "text": "func (f *DBStoreGetAutoindexDisabledRepositoriesFunc) SetDefaultHook(hook func(context.Context) ([]int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "64facd7f9a5953bb0327bcfbae00c17e", "score": "0.662761", "text": "func (f *CacheSetValueFunc) SetDefaultHook(hook func(string, string, ...string) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "87ffe9a3752249ba5bbf95ee9f53a44c", "score": "0.66217256", "text": "func (f *IndexingSettingStoreGetLastestSchemaSettingsFunc) SetDefaultHook(hook func(context.Context, api.SettingsSubject) (*schema.Settings, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "87ffe9a3752249ba5bbf95ee9f53a44c", "score": "0.66217256", "text": "func (f *IndexingSettingStoreGetLastestSchemaSettingsFunc) SetDefaultHook(hook func(context.Context, api.SettingsSubject) (*schema.Settings, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "738256f46b2e7e8ca6ffad11457a410e", "score": "0.6615436", "text": "func (f *GitserverClientCommitGraphFunc) SetDefaultHook(hook func(context.Context, store.Store, int, gitserver.CommitGraphOptions) (map[string][]string, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "fb61eaf91066e539d003368707ed1801", "score": "0.6611013", "text": "func (f *BundleManagerClientBundleClientFunc) SetDefaultHook(hook func(int) client.BundleClient) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "2f378e571f85532d5c9a4c2a0cb4d623", "score": "0.6603699", "text": "func (f *StoreCanceledJobsFunc) SetDefaultHook(hook func(context.Context, []int) ([]int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "368ca3dae6f626377511ec49fbf9e6f1", "score": "0.65825707", "text": "func (f *PackageReferenceScannerCloseFunc) SetDefaultHook(hook func() error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "c996c02bf5d0894a3acf2bfebfa0006f", "score": "0.6570885", "text": "func (f *GitserverClientFileExistsFunc) SetDefaultHook(hook func(context.Context, int, string, string) (bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "c996c02bf5d0894a3acf2bfebfa0006f", "score": "0.6570885", "text": "func (f *GitserverClientFileExistsFunc) SetDefaultHook(hook func(context.Context, int, string, string) (bool, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "7ff936b2170ef0ba8540bc97fb838e7e", "score": "0.65447116", "text": "func (f *DBStoreSelectRepositoriesForIndexScanFunc) SetDefaultHook(hook func(context.Context, string, string, time.Duration, bool, *int, int) ([]int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "b763dedd68e57e5e22edb273ced5f92f", "score": "0.6534735", "text": "func (f *FileSystemGlobFunc) SetDefaultHook(hook func(string) ([]string, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "636a3d968b23a73041a427e005d97615", "score": "0.64819324", "text": "func (f *GitserverClientRepoInfoFunc) SetDefaultHook(hook func(context.Context, ...api.RepoName) (map[api.RepoName]*protocol.RepoInfo, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "9b182a1231e1c50c3b3713db87f28436", "score": "0.6461995", "text": "func (f *GitserverClientRawContentsFunc) SetDefaultHook(hook func(context.Context, int, string, string) ([]byte, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "9b182a1231e1c50c3b3713db87f28436", "score": "0.6461995", "text": "func (f *GitserverClientRawContentsFunc) SetDefaultHook(hook func(context.Context, int, string, string) ([]byte, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "8cfb3290cf466f619b9eaeb2e9285759", "score": "0.6452609", "text": "func (f *IndexableReposListerListFunc) SetDefaultHook(hook func(context.Context) ([]types.RepoName, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "962fc49b4cca819f4626bab1c350f0d9", "score": "0.6431553", "text": "func (f *RepoUpdaterClientRepoLookupFunc) SetDefaultHook(hook func(context.Context, api.RepoName) (*protocol1.RepoInfo, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "83e7817c0c6274a2cab836798c4da38c", "score": "0.6424817", "text": "func (f *S3APIPutBucketLifecycleConfigurationFunc) SetDefaultHook(hook func(context.Context, *s3.PutBucketLifecycleConfigurationInput) (*s3.PutBucketLifecycleConfigurationOutput, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "1e94b9388aaea2b5ea896dc1dabe29b2", "score": "0.64135766", "text": "func (f *IndexingRepoStoreListRepoNamesFunc) SetDefaultHook(hook func(context.Context, database.ReposListOptions) ([]types.RepoName, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "323e6bc8098d83d97790fe8b2a6fd38a", "score": "0.63824725", "text": "func (f *IndexEnqueuerQueueIndexesFunc) SetDefaultHook(hook func(context.Context, int, string, string, bool, bool) ([]dbstore.Index, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "102b084dfeb178d6a3a59a415138d810", "score": "0.63822985", "text": "func (f *IndexingRepoStoreListMinimalReposFunc) SetDefaultHook(hook func(context.Context, database.ReposListOptions) ([]types.MinimalRepo, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "d938f250c78c82c491e26a1de2cc636a", "score": "0.6357584", "text": "func (f *CacheGetValueFunc) SetDefaultHook(hook func(string) (string, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "aa3e95c69f721c9845262bef78b4652a", "score": "0.6335207", "text": "func (f *WorkerStoreRequeueFunc) SetDefaultReturn(r0 error) {\n\tf.SetDefaultHook(func(context.Context, int, time.Time) error {\n\t\treturn r0\n\t})\n}", "title": "" }, { "docid": "63eedf5e9eef9b70a9b9b66179d90eab", "score": "0.629531", "text": "func (f *DBStoreGetRepositoriesWithIndexConfigurationFunc) SetDefaultHook(hook func(context.Context) ([]int, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "46edb51f57d6736d425baa67d5be1966", "score": "0.6291183", "text": "func (f *IndexingRepoStoreListIndexableReposFunc) SetDefaultHook(hook func(context.Context, database.ListIndexableReposOptions) ([]types.MinimalRepo, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "eaaecfcbcc23a370b6e3e9bdb347b418", "score": "0.6289962", "text": "func (f *GitserverClientResolveRevisionFunc) SetDefaultHook(hook func(context.Context, int, string) (api.CommitID, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "eaaecfcbcc23a370b6e3e9bdb347b418", "score": "0.6289962", "text": "func (f *GitserverClientResolveRevisionFunc) SetDefaultHook(hook func(context.Context, int, string) (api.CommitID, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "9ff52674bb0e9b0f660fbc6d4a0174b7", "score": "0.62759644", "text": "func (f *FileSystemListFilesFunc) SetDefaultHook(hook func(string) ([]string, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "22f556725b5f4cc034f79a0ebfd43204", "score": "0.62618285", "text": "func (f *S3APIHeadObjectFunc) SetDefaultHook(hook func(context.Context, *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "43c3fa62e1c16dc8a24aa4fcd392663b", "score": "0.62608093", "text": "func (f *FileSystemReadFileFunc) SetDefaultHook(hook func(string) ([]byte, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "ed8138973d70d264cde84380ca45a2be", "score": "0.6230284", "text": "func (f *S3APICreateBucketFunc) SetDefaultHook(hook func(context.Context, *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "e0b9952336708e531365a0af7e8ecfc5", "score": "0.6180003", "text": "func (f *S3UploaderUploadFunc) SetDefaultHook(hook func(context.Context, *s3.PutObjectInput) error) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "52107020fe64ce444192a317c743fc77", "score": "0.6164939", "text": "func (f *GitserverClientListFilesFunc) SetDefaultHook(hook func(context.Context, int, string, *regexp.Regexp) ([]string, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "52107020fe64ce444192a317c743fc77", "score": "0.6164939", "text": "func (f *GitserverClientListFilesFunc) SetDefaultHook(hook func(context.Context, int, string, *regexp.Regexp) ([]string, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "2475a51dd07598e6b254bb4fee7edf55", "score": "0.608354", "text": "func (f *WithHooksPostHandleFunc) SetDefaultReturn() {\n\tf.SetDefaultHook(func(context.Context, log.Logger, Record) {\n\t\treturn\n\t})\n}", "title": "" }, { "docid": "e8346844582fd98c64fdd999f63edcfe", "score": "0.60756415", "text": "func (f *WorkerStoreHeartbeatFunc) SetDefaultReturn(r0 []int, r1 error) {\n\tf.SetDefaultHook(func(context.Context, []int, store.HeartbeatOptions) ([]int, error) {\n\t\treturn r0, r1\n\t})\n}", "title": "" }, { "docid": "a1f865e4dea862b686848e96c2367cfd", "score": "0.60695904", "text": "func (f *WithHooksPreHandleFunc) SetDefaultReturn() {\n\tf.SetDefaultHook(func(context.Context, log.Logger, Record) {\n\t\treturn\n\t})\n}", "title": "" }, { "docid": "0857c3de516472de6085c441fc966f32", "score": "0.601428", "text": "func (f *S3APIGetObjectFunc) SetDefaultHook(hook func(context.Context, *s3.GetObjectInput) (*s3.GetObjectOutput, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "ece8bda7da725845a001baf3d792fd35", "score": "0.6008496", "text": "func (f *BackgroundRoutineStartFunc) SetDefaultReturn() {\n\tf.SetDefaultHook(func() {\n\t\treturn\n\t})\n}", "title": "" }, { "docid": "f01529ff15067b1761601f363baea772", "score": "0.59743017", "text": "func (f *S3APICreateMultipartUploadFunc) SetDefaultHook(hook func(context.Context, *s3.CreateMultipartUploadInput) (*s3.CreateMultipartUploadOutput, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "9ef981f43940ccfd13629c9924481e33", "score": "0.5950077", "text": "func (f *StoreHeartbeatFunc) SetDefaultReturn(r0 []int, r1 error) {\n\tf.SetDefaultHook(func(context.Context, []int) ([]int, error) {\n\t\treturn r0, r1\n\t})\n}", "title": "" }, { "docid": "55715501fa702a40942110bd0b27cb01", "score": "0.5939962", "text": "func (f *WorkerStoreHandleFunc) SetDefaultReturn(r0 basestore.TransactableHandle) {\n\tf.SetDefaultHook(func() basestore.TransactableHandle {\n\t\treturn r0\n\t})\n}", "title": "" }, { "docid": "1756eb38ff44d7e54393240af914ca18", "score": "0.59397364", "text": "func (f *S3APICompleteMultipartUploadFunc) SetDefaultHook(hook func(context.Context, *s3.CompleteMultipartUploadInput) (*s3.CompleteMultipartUploadOutput, error)) {\n\tf.defaultHook = hook\n}", "title": "" }, { "docid": "41696a353979ea7ec2f8299d606d9bcb", "score": "0.59269994", "text": "func (f *WorkerStoreWithFunc) SetDefaultReturn(r0 store.Store) {\n\tf.SetDefaultHook(func(basestore.ShareableStore) store.Store {\n\t\treturn r0\n\t})\n}", "title": "" }, { "docid": "e222c341451bce58ce8b739201d2b59e", "score": "0.59069574", "text": "func (f *DBStoreWithFunc) SetDefaultReturn(r0 DBStore) {\n\tf.SetDefaultHook(func(basestore.ShareableStore) DBStore {\n\t\treturn r0\n\t})\n}", "title": "" }, { "docid": "e222c341451bce58ce8b739201d2b59e", "score": "0.59069574", "text": "func (f *DBStoreWithFunc) SetDefaultReturn(r0 DBStore) {\n\tf.SetDefaultHook(func(basestore.ShareableStore) DBStore {\n\t\treturn r0\n\t})\n}", "title": "" } ]
deb1c1e596f7803c8051fa8b840e1871
GetValues queries Consul for keys
[ { "docid": "966c999d5401221dcd7664bd0fdb745a", "score": "0.65982497", "text": "func (c *Client) GetValues(keys []string) (map[string]string, error) {\n\tvars := make(map[string]string)\n\tfor _, key := range keys {\n\t\tkey := strings.TrimPrefix(key, \"/\")\n\t\tpairs, _, err := c.client.List(key, nil)\n\t\tif err != nil {\n\t\t\treturn vars, err\n\t\t}\n\t\tfor _, p := range pairs {\n\t\t\tvars[path.Join(\"/\", p.Key)] = string(p.Value)\n\t\t}\n\t}\n\treturn vars, nil\n}", "title": "" } ]
[ { "docid": "5d1e9ad5c1230fc5ba1dfbfb261e98ea", "score": "0.6723757", "text": "func (m *RedisEngine) GetValues(keys ...interface{}) ([]string, error) {\n\treturn m.Do(\"MGET\", keys...).List()\n}", "title": "" }, { "docid": "566b6ddbbeb579babf9b654f5fe2d958", "score": "0.67217195", "text": "func (page APIKeyListResultPage) Values() []APIKey {\n\tif page.aklr.IsEmpty() {\n\t\treturn nil\n\t}\n\treturn *page.aklr.Value\n}", "title": "" }, { "docid": "76f8086b20f5c5a9f83e84cd5be3cf33", "score": "0.669951", "text": "func (c *Client) GetValues(keys []string) (map[string]string, error) {\n\tif len(keys) == 0 {\n\t\treturn nil, fmt.Errorf(\"nacos GetValues keys is nil\")\n\t}\n\n\t// To return map[string]string.\n\tvalues := make(map[string]string)\n\n\t// Search data.\n\tfor _, backendNode := range c.BackendNodes {\n\t\terr := c.getValuesFromHTTP(backendNode.BackendAddr, backendNode.NamespaceName, backendNode.AccessToken, keys, values)\n\t\tif err != nil {\n\t\t\tif strings.HasPrefix(err.Error(), \"code not 200\") {\n\t\t\t\t// HTTP code not 200, retry login.\n\t\t\t\t// log.Error(\"HTTP code not 200, retry login.\", err)\n\t\t\t\tif errLogin := c.loginWithPassword(); errLogin != nil {\n\t\t\t\t\treturn make(map[string]string), fmt.Errorf(\"nacos login with password error in getValues: %v\", errLogin)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn make(map[string]string), fmt.Errorf(\"nacos configClient.SearchConfig : %v %v\", backendNode, err)\n\t\t}\n\t}\n\n\treturn values, nil\n}", "title": "" }, { "docid": "ccb4908f2b36ddf58af03b0a8f09140f", "score": "0.6423422", "text": "func (c *Client) GetValues(keys []string) (map[string]string, error) {\n\tbranches := make(map[string]bool)\n\tfor _, key := range keys {\n\t\twalkTree(c, key, branches)\n\t}\n\tvars := make(map[string]string)\n\tfor key := range branches {\n\t\t// log.Debug(\"getting %s from vault\", key)\n\t\tresp, err := c.client.Logical().Read(key)\n\n\t\tif err != nil {\n\t\t\t// log.Debug(\"there was an error extracting %s\", key)\n\t\t\treturn nil, err\n\t\t}\n\t\tif resp == nil || resp.Data == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// if the key has only one string value\n\t\t// treat it as a string and not a map of values\n\t\tif val, ok := isKV(resp.Data); ok {\n\t\t\tvars[key] = val\n\t\t} else {\n\t\t\t// save the json encoded response\n\t\t\t// and flatten it to allow usage of gets & getvs\n\t\t\tjs, _ := json.Marshal(resp.Data)\n\t\t\tvars[key] = string(js)\n\t\t\tflatten(key, resp.Data, vars)\n\t\t}\n\t}\n\treturn vars, nil\n}", "title": "" }, { "docid": "f3df3a3984c7e25b6771da6b2bd27943", "score": "0.63068587", "text": "func (c *AdapterRedis) Values(ctx context.Context) ([]interface{}, error) {\n\t// Keys.\n\tv, err := c.redis.Do(ctx, \"KEYS\", \"*\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tkeys := v.Slice()\n\t// Values.\n\tv, err = c.redis.Do(ctx, \"MGET\", keys...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn v.Slice(), nil\n}", "title": "" }, { "docid": "d9c5b6e26935022ff724f3f8c1f42f85", "score": "0.6304175", "text": "func (c *Redis) Values(ctx context.Context) ([]interface{}, error) {\n\t// Keys.\n\tv, err := c.redis.Ctx(ctx).DoVar(\"KEYS\", \"*\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tkeys := v.Slice()\n\t// Values.\n\tv, err = c.redis.Ctx(ctx).DoVar(\"MGET\", keys...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn v.Slice(), nil\n}", "title": "" }, { "docid": "b01ebc59a180856c692f94e30ea83544", "score": "0.6277227", "text": "func (c *Client) GetValues(keys []string) (map[string]string, error) {\n\tvars := make(map[string]string)\n\tfor _, key := range keys {\n\t\tresp, err := c.client.Get(key, true, true)\n\t\tif err != nil {\n\t\t\treturn vars, err\n\t\t}\n\t\terr = nodeWalk(resp.Node, vars)\n\t\tif err != nil {\n\t\t\treturn vars, err\n\t\t}\n\t}\n\treturn vars, nil\n}", "title": "" }, { "docid": "8dc3d59f32c64e57edbb2dc1b7b90d88", "score": "0.62738186", "text": "func (c *Client) GetValues(prefix string) (map[string]string, error) {\n\tvars := make(map[string]string)\n\tservices, _ := ListServices(*c)\n\tservice_vars, _ := GetServicesHealth(*c, services)\n\tfor k, v := range service_vars {\n\t\tvars[k] = v\n\t}\n\treturn vars, nil\n}", "title": "" }, { "docid": "2aa742b8e461136a901bfbf0b9311d12", "score": "0.62443954", "text": "func (v Vault) GetValues(keys []string, results []*string) error {\n\tif len(keys) != len(results) {\n\t\treturn errors.New(\"number of keys and results must be equal\")\n\t}\n\n\tfor i, key := range keys {\n\t\tvalue, err := v.GetValue(key)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to get value for key \"+key)\n\t\t}\n\t\t*(results[i]) = value\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "45bd7bba1cf7dd05fda77b13d146e8a0", "score": "0.622685", "text": "func GetKeyEx(u *url.URL, path string, recurse bool) ([]GetKeyResponse, error) {\n\tvar cu url.URL = *u\n\tcu.Path = \"v1/kv/\" + path\n\tq := make(url.Values)\n\tif recurse {\n\t\tq.Add(\"recurse\", \"true\")\n\t}\n\tcu.RawQuery = q.Encode()\n\t// cu.RawQuery = \"raw\"\n\tglog.Infof(\"Making GET request to %s\", cu.String())\n\tctx, cancel := context.WithTimeout(context.Background(), httpTimeout)\n\tresp, err := http.DefaultClient.Do(uhttp.NewRequestWithContext(ctx, \"GET\", cu.String(), nil))\n\tcancel()\n\tif err != nil {\n\t\tglog.Errorf(\"Error getting key '%s' from Consul at %s error: %v\", path, cu.String(), err)\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\tb, _ := ioutil.ReadAll(resp.Body)\n\t\tglog.Errorf(\"Status error contacting Consul (%s) status %d body: %s\", cu.String(), resp.StatusCode, string(b))\n\t\tif resp.StatusCode == http.StatusNotFound {\n\t\t\treturn nil, ErrNotFound\n\t\t}\n\t\treturn nil, errors.New(http.StatusText(resp.StatusCode))\n\t}\n\tb, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tglog.Errorf(\"Error reading from Consul (%s) error: %v\", cu.String(), err)\n\t\treturn nil, err\n\t}\n\tvar gkr []GetKeyResponse\n\terr = json.Unmarshal(b, &gkr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tval := string(b)\n\tglog.Infof(\"Read from Consul '%s': '%s'\", path, val)\n\treturn gkr, nil\n}", "title": "" }, { "docid": "7901dc50a749217253915aaa1034a170", "score": "0.6199394", "text": "func ListKeyValues(configurationPath, name string) error {\n\tc, err := readConfiguration(configurationPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read configuration: %v\", err)\n\t}\n\n\tdb, err := openDatabase(c)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"open database: %v\", err)\n\t}\n\tdefer db.close()\n\n\tif err := db.listKeyValues(name); err != nil {\n\t\treturn fmt.Errorf(\"list key values: %v\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "84e755209678820922577dc798a161ef", "score": "0.6178815", "text": "func (s *MapStorage) Keys(key string) ([]string, error) {\n\tvar keys []string\n\tvar values []string\n\n\tfor k, v := range s.db {\n\t\t//if k, found := s.db[key]; found {\n\n\t\tif strings.Contains(k, key) {\n\t\t\tfmt.Println(v)\n\t\t\tkeys = append(keys, k)\n\t\t\tvalues = append(values, v)\n\t\t}\n\t}\n\n\tfmt.Println(\"KEYS - \", keys)\n\tfmt.Println(\"KEY - \", key)\n\treturn keys, nil\n}", "title": "" }, { "docid": "791774b2b46d587c6ff81e3a47cd5ab6", "score": "0.6164971", "text": "func (m *memoryCXDS) MultiGet(keys []cipher.SHA256) (vals [][]byte, err error) {\n\tif len(keys) == 0 {\n\t\treturn\n\t}\n\tvals = make([][]byte, 0, len(keys))\n\n\tm.mx.RLock()\n\tdefer m.mx.RUnlock()\n\n\tfor _, key := range keys {\n\t\tif mo, ok := m.kvs[key]; ok {\n\t\t\tvals = append(vals, mo.val)\n\t\t\tcontinue\n\t\t}\n\t\terr = data.ErrNotFound\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "fb51fd020115b6fc82fa1329f1913b8b", "score": "0.61387944", "text": "func (c *Client) GetValues(keys []string) (map[string]string, error) {\n\t// Ensure we have a connected redis client\n\trClient, err := c.connectedClient()\n\tif err != nil && err != redis.ErrNil {\n\t\treturn nil, err\n\t}\n\n\tvars := make(map[string]string)\n\tfor _, key := range keys {\n\t\tkey = strings.Replace(key, \"/*\", \"\", -1)\n\t\tvalue, err := redis.String(rClient.Do(\"GET\", key))\n\t\tif err == nil {\n\t\t\tvars[key] = value\n\t\t\tcontinue\n\t\t}\n\n\t\tif err != redis.ErrNil {\n\t\t\treturn vars, err\n\t\t}\n\n\t\tif key == \"/\" {\n\t\t\tkey = \"/*\"\n\t\t} else {\n\t\t\tkey = fmt.Sprintf(\"%s/*\", key)\n\t\t}\n\n\t\tidx := 0\n\t\tfor {\n\t\t\tvalues, err := redis.Values(rClient.Do(\"SCAN\", idx, \"MATCH\", key, \"COUNT\", \"1000\"))\n\t\t\tif err != nil && err != redis.ErrNil {\n\t\t\t\treturn vars, err\n\t\t\t}\n\t\t\tidx, _ = redis.Int(values[0], nil)\n\t\t\titems, _ := redis.Strings(values[1], nil)\n\t\t\tfor _, item := range items {\n\t\t\t\tvar newKey string\n\t\t\t\tif newKey, err = redis.String(item, nil); err != nil {\n\t\t\t\t\treturn vars, err\n\t\t\t\t}\n\t\t\t\tif value, err = redis.String(rClient.Do(\"GET\", newKey)); err == nil {\n\t\t\t\t\tvars[newKey] = value\n\t\t\t\t}\n\t\t\t}\n\t\t\tif idx == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn vars, nil\n}", "title": "" }, { "docid": "bbea3970474a0c190b436759102d3956", "score": "0.6096886", "text": "func (db *DB) RetrieveValues(ctx context.Context, keys []string) (vals []string, err error) {\n\tif err = db.DoInTransaction(ctx, func(ctx context.Context) error {\n\t\tvals, err = db.retrieveValues(ctx, keys)\n\t\treturn err\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\treturn vals, nil\n}", "title": "" }, { "docid": "7a0f542f46d6decbd5be7df32210c6f5", "score": "0.6027069", "text": "func (d *DB) GetByValue(value string) (keys []strings) {\n valueB := []byte(value)\n d.db.Update(func (tx *bbolt.Tx) error {\n b := tx.Bucket(tableURLs)\n if b == nil {\n return nil\n }\n c := b.Cursor()\n for k, v := c.First(); k != nil; k, v = c.Next() {\n if bytes.Equal(valueB, v) {\n keys = append(keys, string(k))\n }\n }\n return nil\n })\n return \n}", "title": "" }, { "docid": "e896a55a892ea55f6e9d568b9dfa67ec", "score": "0.60123867", "text": "func GetConsulVal(serverURI string, key string, dataCenter string) (string, error) {\n\t//fmt.Println(\"GetConsulKey key=\", key, \" dataCenter=\", dataCenter)\n\turi := serverURI + \"/v1/kv/\" + key\n\tif dataCenter > \"\" {\n\t\turi = uri + \"?dc=\" + url.QueryEscape(dataCenter)\n\t}\n\t//fmt.Println(\"uri=\", uri)\n\tstart := time.Now().UTC()\n\thc := http.Client{}\n\treq, err := http.NewRequest(\"GET\", uri, nil)\n\tif err != nil {\n\t\tmsg := fmt.Errorf(\"Error: GetConsulVal: opening uri= %s err=%s key=%s\", uri, err, key)\n\t\tfmt.Println(msg)\n\t\treturn \"\", msg\n\t}\n\treq.Header.Set(\"X-Consul-Token\", os.Getenv(\"CONSUL_HTTP_TOKEN\"))\n\tresp, err := hc.Do(req)\n\tif err != nil {\n\t\tmsg := fmt.Errorf(\"Error: GetConsulVal: uri=%s err=%s\", uri, err)\n\t\tfmt.Println(msg)\n\t\treturn \"\", msg\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\tfmt.Println(\"Error: GetConsulVal: Expected Status Code 200, Got \", resp.StatusCode)\n\t} else {\n\t\t//fmt.Println(\"Sucess:\")\n\t}\n\n\tvar m ConsulKV\n\n\tbody, _ := ioutil.ReadAll(resp.Body)\n\tbodys := strings.TrimSpace(string(body))\n\tbodys = strings.TrimSuffix(bodys, \"]\")\n\tbodys = strings.TrimPrefix(bodys, \"[\")\n\t//fmt.Println(\"body\", bodys)\n\terr = json.Unmarshal([]byte(bodys), &m)\n\tif err != nil {\n\t\tmsg := fmt.Errorf(\"Error: getConsulVal key=%s err=%s\", key, err)\n\t\treturn \"\", msg\n\t}\n\n\tTimeTrack(os.Stdout, start, \"finished single PUT uri=\"+uri+\"\\n\")\n\t//fmt.Println(\"statusCode=\", resp.StatusCode)\n\t//fmt.Println(\" body=\", string(body))\n\tuDec, _ := base64.StdEncoding.DecodeString(m.Value)\n\n\treturn string(uDec), nil\n}", "title": "" }, { "docid": "858b5a31bc208feccde320a3e55d0ffd", "score": "0.59807146", "text": "func (r *SSHKeyFindResult) Values() []interface{} {\n\tvar results []interface{}\n\tfor _, v := range r.SSHKeys {\n\t\tresults = append(results, v)\n\t}\n\treturn results\n}", "title": "" }, { "docid": "ada5bafee8197c0d3694089d07074421", "score": "0.59633505", "text": "func (bb *BBolt) GetAll() ([]*KeyValue, error) {\n\tvar response []*KeyValue\n\n\tbb.Storage.View(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(bb.BucketName))\n\t\tif b != nil {\n\t\t\tc := b.Cursor()\n\t\t\tfor k, v := c.First(); k != nil; k, v = c.Next() {\n\t\t\t\tkeyVal := &KeyValue{}\n\t\t\t\tkeyVal.Key = k\n\t\t\t\tkeyVal.Value = v\n\n\t\t\t\tresponse = append(response, keyVal)\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t})\n\n\treturn response, nil\n}", "title": "" }, { "docid": "d2c168d0f407e5a76cce734f15f2e62a", "score": "0.59385324", "text": "func (SearchFieldKey) Values() []SearchFieldKey {\n\treturn []SearchFieldKey{\n\t\t\"MEMBERS\",\n\t}\n}", "title": "" }, { "docid": "ec7331c49c0bce901031842e809ec358", "score": "0.5931298", "text": "func (c *ClusterClient) BatchGet(keys []*KeyObject) (ret []*KeyValue, err error) {\n\n\tvar requests []*pb.Request\n\n\tfor _, key := range keys {\n\t\trequest := &pb.Request{\n\t\t\tGet: &pb.GetRequest{\n\t\t\t\tKey: key.GetKey(),\n\t\t\t\tPartitionHash: key.GetPartitionHash(),\n\t\t\t},\n\t\t}\n\t\trequests = append(requests, request)\n\t}\n\n\toutputChan := make(chan *answer, len(keys))\n\tgo func() {\n\t\terr = c.BatchProcess(requests, func(responses []*pb.Response, err error) error {\n\t\t\tif err != nil {\n\t\t\t\toutputChan <- &answer{err: err}\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tvar output []*KeyValue\n\t\t\tfor _, response := range responses {\n\t\t\t\tkv := fromPbKeyTypeValue(response.Get.KeyValue)\n\t\t\t\toutput = append(output, kv)\n\t\t\t}\n\n\t\t\toutputChan <- &answer{keyValues: output}\n\n\t\t\treturn nil\n\t\t})\n\t\tclose(outputChan)\n\t}()\n\n\tfor ans := range outputChan {\n\t\tif ans.err != nil {\n\t\t\treturn nil, ans.err\n\t\t}\n\t\tret = append(ret, ans.keyValues...)\n\t}\n\n\treturn ret, err\n}", "title": "" }, { "docid": "1ba4e3113aa4648364b34f2f61e685e6", "score": "0.5917919", "text": "func (mc *Connection) Get(keys ...string) (results []cacheservice.Result, err error) {\n\tdefer handleError(&err)\n\tresults = mc.get(\"get\", keys)\n\treturn\n}", "title": "" }, { "docid": "552db402cd2c24fe80fd73297c2388bd", "score": "0.5901081", "text": "func (kv KV) Values() []string {\n\treturn kv.SortedPairs().Values()\n}", "title": "" }, { "docid": "c324b37010bb607cf8573a86d0ee87f8", "score": "0.58704", "text": "func (rs *ResultSet) KeyValues() []*KeyValue {\n\tkvs := []*KeyValue{}\n\tkey := \"\"\n\tfor idx, v := range rs.values {\n\t\tif idx%2 == 0 {\n\t\t\tkey = v.String()\n\t\t} else {\n\t\t\tkvs = append(kvs, &KeyValue{key, v})\n\t\t}\n\t}\n\treturn kvs\n}", "title": "" }, { "docid": "ce9cc42c891a78d5fbfdf57aff604418", "score": "0.5815149", "text": "func (m MemoryCacheHandler) GetAll(keys schemas.PK) (data []gdcache.ReturnKeyValue, err error) {\n\treturnKeyValues := make([]gdcache.ReturnKeyValue, 0)\n\tfor _, key := range keys {\n\t\tbytes, has := m.data[key]\n\t\treturnKeyValues = append(returnKeyValues, gdcache.ReturnKeyValue{\n\t\t\tKeyValue: gdcache.KeyValue{\n\t\t\t\tKey: key,\n\t\t\t\tValue: bytes,\n\t\t\t},\n\t\t\tHas: has,\n\t\t})\n\t}\n\treturn returnKeyValues, nil\n}", "title": "" }, { "docid": "40fa22a4a08d51dbf816125c4cd73fb9", "score": "0.5810213", "text": "func (ap *AccountProcessor) GetKeyValuePairs(address string) (*data.GenericAPIResponse, error) {\n\tobservers, err := ap.getObserversForAddress(address)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, observer := range observers {\n\t\tapiResponse := data.GenericAPIResponse{}\n\t\tapiPath := AddressPath + address + \"/keys\"\n\t\trespCode, err := ap.proc.CallGetRestEndPoint(observer.Address, apiPath, &apiResponse)\n\t\tif err == nil || respCode == http.StatusBadRequest || respCode == http.StatusInternalServerError {\n\t\t\tlog.Info(\"account get all key-value pairs\",\n\t\t\t\t\"address\", address,\n\t\t\t\t\"shard ID\", observer.ShardId,\n\t\t\t\t\"observer\", observer.Address,\n\t\t\t\t\"http code\", respCode)\n\t\t\tif apiResponse.Error != \"\" {\n\t\t\t\treturn nil, errors.New(apiResponse.Error)\n\t\t\t}\n\n\t\t\treturn &apiResponse, nil\n\t\t}\n\n\t\tlog.Error(\"account get all key-value pairs error\", \"observer\", observer.Address, \"address\", address, \"error\", err.Error())\n\t}\n\n\treturn nil, ErrSendingRequest\n}", "title": "" }, { "docid": "5df3b00202337211b2fadc4645752cde", "score": "0.5809733", "text": "func (rs *RedisSet) Values(key string) interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "eb067a94ea60626aff807c23c86344f3", "score": "0.5801414", "text": "func (client *Client) GetBulk(vb uint16, keys []string) (map[string]*Response, error) {\n\tterminalOpaque := uint32(len(keys) + 5)\n\trv := map[string]*Response{}\n\twg := sync.WaitGroup{}\n\tgoing := true\n\n\tdefer func() {\n\t\tgoing = false\n\t}()\n\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tfor going {\n\t\t\tres, err := client.Receive()\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif res.Opaque == terminalOpaque {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif res.Opcode != GETQ {\n\t\t\t\tlog.Panicf(\"Unexpected opcode in GETQ response: %+v\",\n\t\t\t\t\tres)\n\t\t\t}\n\t\t\trv[keys[res.Opaque]] = res\n\t\t}\n\t}()\n\n\tfor i, k := range keys {\n\t\terr := client.Transmit(&Request{\n\t\t\tOpcode: GETQ,\n\t\t\tVBucket: vb,\n\t\t\tKey: []byte(k),\n\t\t\tCas: 0,\n\t\t\tOpaque: uint32(i),\n\t\t\tExtras: []byte{},\n\t\t\tBody: []byte{}})\n\t\tif err != nil {\n\t\t\treturn rv, err\n\t\t}\n\t}\n\n\terr := client.Transmit(&Request{\n\t\tOpcode: NOOP,\n\t\tKey: []byte{},\n\t\tCas: 0,\n\t\tExtras: []byte{},\n\t\tBody: []byte{},\n\t\tOpaque: terminalOpaque})\n\tif err != nil {\n\t\treturn rv, err\n\t}\n\n\twg.Wait()\n\n\treturn rv, nil\n}", "title": "" }, { "docid": "bcca30113ccb19aeec173bf6c4c4c589", "score": "0.57929474", "text": "func includeKeyValues(host *gocql.HostInfo, values ...label.KeyValue) []label.KeyValue {\n\tconnectionLevelAttributes := []label.KeyValue{\n\t\tcassDBSystem(),\n\t\thostOrIP(host.HostnameAndPort()),\n\t\tcassPeerPort(host.Port()),\n\t\tcassVersion(host.Version().String()),\n\t\tcassHostID(host.HostID()),\n\t\tcassHostState(host.State().String()),\n\t}\n\treturn append(connectionLevelAttributes, values...)\n}", "title": "" }, { "docid": "57a23add94bd5a577934038735a734da", "score": "0.57841784", "text": "func GetAllValues(keys []string, getter func(string) float64) []BalanceSimple {\n\toutput := []BalanceSimple{}\n\tfor _, key := range keys {\n\t\toutput = append(output, BalanceSimple{\n\t\t\tCurrency: key,\n\t\t\tBalance: getter(key),\n\t\t\tComment: \"-\",\n\t\t\tAddress: \"-\",\n\t\t})\n\t}\n\treturn output\n}", "title": "" }, { "docid": "ea2fc031e1fb1562d8108b6fcca05cb9", "score": "0.5754473", "text": "func (this *DynamicEntity) getValues() map[string]interface{} {\n\t// Set child uuid's here if there is not already sets...\n\tinfos := make(map[string]interface{})\n\tinfos[\"name\"] = \"getValues\"\n\tinfos[\"uuid\"] = this.uuid\n\tinfos[\"getValues\"] = make(chan map[string]interface{})\n\tcache.m_getValues <- infos\n\tvalues := <-infos[\"getValues\"].(chan map[string]interface{})\n\treturn values\n}", "title": "" }, { "docid": "5b90a9fe9ac8004428cf42082a1b7513", "score": "0.5743349", "text": "func (sr bufferedSecretReader) Values() []string {\n\treturn sr.secretsRead\n}", "title": "" }, { "docid": "bfa53d9289d73f80dfea38ded6e4248d", "score": "0.5740999", "text": "func (args Args) Get(key string) []string {\n\tvalues := args.fields[key]\n\tif values == nil {\n\t\treturn make([]string, 0)\n\t}\n\tslice := make([]string, 0, len(values))\n\tfor key := range values {\n\t\tslice = append(slice, key)\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "5e9951c5d3818ca053ce6e7859d04399", "score": "0.57294875", "text": "func (m *DataStore) GetDataMultipleKeys(key *storeapi.MultiKey) (storeapi.ExpiringValues, error) {\n\tvar values storeapi.ExpiringValues\n\tfor _, k := range key.Keys {\n\t\tvalue, err := m.GetData(&storeapi.Key{Namespace: key.Namespace, Collection: key.Collection, Key: k})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvalues = append(values, value)\n\t}\n\treturn values, m.err\n}", "title": "" }, { "docid": "6fe2d63493316bf4b523da2c30083f6b", "score": "0.57198924", "text": "func getAll(c *gin.Context) {\n\n\tclient := newClient()\n\tvar array map[string]string\n\tarray = make(map[string]string)\n\n\tkeys, err := client.Do(\"KEYS\", \"*\").Result()\n\t//si error\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t}\n\t//obtenemos los valores de las claves\n\tfor i := 0; i < reflect.ValueOf(keys).Len(); i++ {\n\t\tkey := fmt.Sprintf(\"%v\", reflect.ValueOf(keys).Index(i)) // convert from interface to string\n\n\t\terr, val := get(key, client)\n\t\tif err != nil {\n\t\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\t}\n\t\tarray[key] = val\n\t}\n\tc.JSON(200, gin.H{\"keys\": array})\n}", "title": "" }, { "docid": "db05a46b389e0955198cdf4e807ea20b", "score": "0.570927", "text": "func (k *Kite) Values() []string {\n\treturn []string{\n\t\tk.Username,\n\t\tk.Environment,\n\t\tk.Name,\n\t\tk.Version,\n\t\tk.Region,\n\t\tk.Hostname,\n\t\tk.ID,\n\t}\n}", "title": "" }, { "docid": "f5525bc60067aac054fe31551faeca8d", "score": "0.5697278", "text": "func (m *Map) GetValues(ctx context.Context) ([]interface{}, error) {\n\trequest := codec.EncodeMapValuesRequest(m.name)\n\tif response, err := m.invokeOnRandomTarget(ctx, request, nil); err != nil {\n\t\treturn nil, err\n\t} else {\n\t\treturn m.convertToObjects(codec.DecodeMapValuesResponse(response))\n\t}\n}", "title": "" }, { "docid": "f5525bc60067aac054fe31551faeca8d", "score": "0.5697278", "text": "func (m *Map) GetValues(ctx context.Context) ([]interface{}, error) {\n\trequest := codec.EncodeMapValuesRequest(m.name)\n\tif response, err := m.invokeOnRandomTarget(ctx, request, nil); err != nil {\n\t\treturn nil, err\n\t} else {\n\t\treturn m.convertToObjects(codec.DecodeMapValuesResponse(response))\n\t}\n}", "title": "" }, { "docid": "3d526e2c0ca35226814ed55cb6b8e52b", "score": "0.5696647", "text": "func (page ConfigurationStoreListResultPage) Values() []ConfigurationStore {\n\tif page.cslr.IsEmpty() {\n\t\treturn nil\n\t}\n\treturn *page.cslr.Value\n}", "title": "" }, { "docid": "53ee8dfd2ebadfa0d995aab823984a18", "score": "0.5696493", "text": "func (c *Consul) KVList(prefix string) (api.KVPairs, error) {\n\tkv := c.Client.KV()\n\tpairs, _, err := kv.List(prefix, nil)\n\treturn pairs, err\n}", "title": "" }, { "docid": "268f9cd8c75bb6540e551394166f3068", "score": "0.5684045", "text": "func (rc *Redis) GetMulti(keys []string) []interface{} {\n\tc := rc.p.Get()\n\tdefer c.Close()\n\tvar args []interface{}\n\tfor _, key := range keys {\n\t\targs = append(args, rc.associate(key))\n\t}\n\tvalues, err := redis.Values(c.Do(\"MGET\", args...))\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn values\n}", "title": "" }, { "docid": "6de2397e750d8eaa4285a887d7912482", "score": "0.5680178", "text": "func (m *KeyValuePairCollectionResponse) GetValue()([]KeyValuePairable) {\n val, err := m.GetBackingStore().Get(\"value\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.([]KeyValuePairable)\n }\n return nil\n}", "title": "" }, { "docid": "0ba242964620b0555b656c31bd7df7ef", "score": "0.56696105", "text": "func getAllKeysFromDatastore(rw http.ResponseWriter, request *http.Request, p httprouter.Params) {\n\t//take values from request\n\tparamsInfo := strings.Split(request.Host,\":\")\n\tportnumber,_:= strconv.Atoi(paramsInfo[1])\n\tdatastore := ServerAndDataStoreMap[portnumber];\n\tvar jsonResponse string\n\tif len(datastore) > 0\t{\n\t\tcounter := 0\n\t\tfor key, value := range datastore {\n\t\t\tjsonResponse+= `{\"key\":`+strconv.Itoa(key)+`,\"value\":\"`+value+`\"},`\n\t\t\tcounter++\n\t\t}\n\t\tjsonResponse=jsonResponse[0:len(jsonResponse)-1]\n\t\tif counter > 1\t{\n\t\t\tjsonResponse = `[`+jsonResponse+`]`\n\t\t}\n\t}\n\t// If content not found give No content\n\tif jsonResponse !=\"\" {\n\t\t\trw.Header().Set(\"Content-Type\", \"application/json\")\n\t\t\trw.WriteHeader(http.StatusOK) // Status code for success\n\t\t\tfmt.Fprintf(rw, \"%s\", jsonResponse)\n\t} else {\n\t\t\trw.WriteHeader(http.StatusNoContent)\n\t}\n}", "title": "" }, { "docid": "d9c2837657e5fd6928649c803874c2dc", "score": "0.5667063", "text": "func (s *HTTPServer) KVSGetKeys(resp http.ResponseWriter, req *http.Request, args *structs.KeyRequest) (interface{}, error) {\n\t// Check for a separator, due to historic spelling error,\n\t// we now are forced to check for both spellings\n\tvar sep string\n\tparams := req.URL.Query()\n\tif _, ok := params[\"seperator\"]; ok {\n\t\tsep = params.Get(\"seperator\")\n\t}\n\tif _, ok := params[\"separator\"]; ok {\n\t\tsep = params.Get(\"separator\")\n\t}\n\n\t// Construct the args\n\tlistArgs := structs.KeyListRequest{\n\t\tDatacenter: args.Datacenter,\n\t\tPrefix: args.Key,\n\t\tSeperator: sep,\n\t\tQueryOptions: args.QueryOptions,\n\t}\n\n\t// Make the RPC\n\tvar out structs.IndexedKeyList\n\tif err := s.agent.RPC(\"KVS.ListKeys\", &listArgs, &out); err != nil {\n\t\treturn nil, err\n\t}\n\tsetMeta(resp, &out.QueryMeta)\n\n\t// Check if we get a not found. We do not generate\n\t// not found for the root, but just provide the empty list\n\tif len(out.Keys) == 0 && listArgs.Prefix != \"\" {\n\t\tresp.WriteHeader(http.StatusNotFound)\n\t\treturn nil, nil\n\t}\n\n\t// Use empty list instead of null\n\tif out.Keys == nil {\n\t\tout.Keys = []string{}\n\t}\n\treturn out.Keys, nil\n}", "title": "" }, { "docid": "82840121246e78e4b9311d8f96c7f543", "score": "0.56664896", "text": "func (s *InMemoryStore) Query(key string) ([]string, error) {\n\ts.lock.RLock()\n\tdefer s.lock.RUnlock()\n\tkey = strings.ToLower(key)\n\tkeySet, ok := s.store[key]\n\n\tif !ok {\n\t\t// property may not, thats ok since we just have to return empty\n\t\t// but at same time we should stop continuing the search since the intersection would be empty\n\t\treturn nil, fmt.Errorf(\"Error querying property %s\", key)\n\t}\n\n\tkeyList := make([]string, 0)\n\n\tfor key := range keySet {\n\t\tkeyList = append(keyList, key)\n\t}\n\n\treturn keyList, nil\n}", "title": "" }, { "docid": "1c9c8dd624948abc9f69c0d9a65b58ad", "score": "0.5662777", "text": "func (p *Values) GetValues(key string, itemCount int) []string {\n\tvar items []string\n\n\tfor i := 0; i < itemCount; i++ {\n\t\titems = append(items, p.GetValueAtIndex(key, i))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "356aff721e4f64c2919fe4beade6d6ca", "score": "0.5645176", "text": "func (ck *Clerk) Get(key string) string {\n\n\t// You will have to modify this function.\n\tvar args GetArgs\n\targs.Key = key\n\targs.Id = ck.id\n\tck.mu.Lock()\n\targs.ReqID = ck.reqid\n\tck.reqid++\n\tck.mu.Unlock()\n\tfor {\n\t\tfor _, v := range ck.servers {\n\t\t\tvar reply GetReply\n\t\t\tok := v.Call(\"RaftKV.Get\", &args, &reply)\n\t\t\tif ok && reply.WrongLeader == false {\n\t\t\t\t//if reply.Err == ErrNoKey {\n\t\t\t\t//\treply.Value = \"\"\n\t\t\t\t//\t}\n\t\t\t\treturn reply.Value\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9645403e3b42bcb5db8b297fd03758ce", "score": "0.5642806", "text": "func (h *Hash) Get(keys ...string) ([]string, error) {\n\tif len(keys) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tifaces := make([]interface{}, len(keys))\n\tfor i := range keys {\n\t\tifaces[i] = keys[i]\n\t}\n\n\tv, err := h.store.Do(h.key, hash.Get, ifaces...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvalues, ok := v.([]string)\n\tif !ok {\n\t\treturn nil, newTypeErr(values, v)\n\t}\n\n\treturn values, nil\n}", "title": "" }, { "docid": "62e0d3253f214a4c93a30ed9fbc8ca73", "score": "0.5629601", "text": "func getValues(hr *appv1.HelmRequest, cfg *rest.Config) (chartutil.Values, error) {\n\tvalues, err := getValuesFromSource(hr, cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnew := Values(hr.Spec.HelmValues.DeepCopy().Values)\n\tvalues = mergeValues(values, new)\n\tklog.V(2).Infof(\"get values for helm request: %s %+v\", hr.GetName(), values)\n\treturn values, nil\n\n}", "title": "" }, { "docid": "1f52f2f07a2d8f97611a9f6473d21539", "score": "0.5625731", "text": "func (d *ConsulStateDriver) ReadAll(baseKey string) ([][]byte, error) {\n\tbaseKey = processKey(baseKey)\n\tkvs, _, err := d.Client.KV().List(baseKey, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Consul returns success and a nil kv when a key is not found,\n\t// translate it to 'Key not found' error\n\tif kvs == nil {\n\t\treturn nil, core.Errorf(\"Key not found\")\n\t}\n\n\tvalues := [][]byte{}\n\tfor _, kv := range kvs {\n\t\tvalues = append(values, kv.Value)\n\t}\n\n\treturn values, nil\n}", "title": "" }, { "docid": "8fca891adc217330a8d9d08e6aa08db4", "score": "0.56242526", "text": "func (edgex *Edgex) KeyValueList(bucket, object, from, pattern, contentType string, maxcount int, values bool) (string, error) {\n\n\tobjectPath, err := utils.GetObjectPath(bucket, object)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\ts3xurl := edgex.newS3xURL(objectPath)\n\ts3xurl.AddOptions(S3XURLOptions{\n\t\t\"comp\": \"kv\",\n\t})\n\n\tif maxcount > 0 {\n\t\ts3xurl.AddOptions(S3XURLOptions{\n\t\t\t\"maxresults\": strconv.Itoa(maxcount),\n\t\t})\n\n\t}\n\n\tif values {\n\t\ts3xurl.AddOptions(S3XURLOptions{\n\t\t\t\"values\": \"1\",\n\t\t})\n\t}\n\n\trq := s3xurl.String()\n\tif from != \"\" {\n\t\trq = addKey(s3xurl.String(), from)\n\t}\n\n\tif pattern != \"\" {\n\t\trq = rq + \"&pattern=\" + pattern\n\t}\n\n\tif edgex.Debug > 0 {\n\t\tfmt.Printf(\"KeyValueList request: %s\\n\", rq)\n\t}\n\n\treq, err := http.NewRequest(\"GET\", rq, nil)\n\tif err != nil {\n\t\tfmt.Printf(\"k/v create key/value list error: %v\\n\", err)\n\t\treturn \"\", err\n\t}\n\n\treq.Header.Add(\"Content-Type\", contentType)\n\treq.Header.Add(\"Content-Length\", \"0\")\n\tres, err := edgex.httpClient.Do(req)\n\tif err != nil {\n\t\tfmt.Printf(\"k/v list error: %v\\n\", err)\n\t\treturn \"\", err\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode < 300 {\n\t\tbody, err := ioutil.ReadAll(res.Body)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Object key/value list read error: %v\\n\", err)\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn string(body), nil\n\t}\n\tif res.StatusCode == 404 {\n\t\treturn \"\", fmt.Errorf(\"Object %s not found\", objectPath)\n\t}\n\treturn \"\", fmt.Errorf(\"Object %s list error: %v\", objectPath, res)\n}", "title": "" }, { "docid": "9785f8fc6bd2162e11fc1376030dbbc8", "score": "0.562231", "text": "func (FilterKey) Values() []FilterKey {\n\treturn []FilterKey{\n\t\t\"hasAccessTo\",\n\t}\n}", "title": "" }, { "docid": "a73c3e97d344580a521b7b8b6ad1cf79", "score": "0.5621704", "text": "func (page APIKVReferenceCollectionPage) Values() []APIKVReference {\n\tif page.arc.IsEmpty() {\n\t\treturn nil\n\t}\n\treturn *page.arc.Value\n}", "title": "" }, { "docid": "0c033f585ce885c4340a27484fbdd9fc", "score": "0.56150675", "text": "func (h Header) Values(key string) []string {}", "title": "" }, { "docid": "c678f1b1fbd5364730db65cc56271fa3", "score": "0.56136614", "text": "func (d *Database) SearchKeyValue(key, value string) ([]string, error) {\n\tkey = strings.ToLower(key)\n\tvalue = \"%\" + strings.ToLower(value) + \"%\"\n\tlimit := config.Configuration.AutoCompleteMaxResults\n\n\tquery := `\nSELECT value_lower\nFROM metadata\nWHERE key_lower = ? \nAND value_lower LIKE ?\nGROUP BY value_lower \nORDER BY value_lower ASC\nLIMIT ?;`\n\n\t//TODO: user filter for queries\n\tif key == \"project\" {\n\t\tquery = `\nSELECT project\nFROM bookmarks\nWHERE project LIKE ? \nGROUP BY project\nORDER BY project ASC\nLIMIT ?;`\n\t}\n\n\tlogger := beginQuery(query, \"search metadata\")\n\tresults := make([]string, 0, 0)\n\n\tvar rows *sql.Rows\n\tvar err error\n\n\tif key == \"project\" {\n\t\trows, err = d.conn.Query(query, value, limit)\n\t} else {\n\t\trows, err = d.conn.Query(query, key, value, limit)\n\t}\n\tif err != nil {\n\t\tlogger.log(err)\n\t\treturn results, err\n\t}\n\n\tfor rows.Next() {\n\t\tvar val string\n\t\terr = rows.Scan(&val)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"Scan value: %v\", err)\n\t\t\terr = rows.Close()\n\t\t\tbreak\n\t\t}\n\n\t\tresults = append(results, val)\n\t}\n\tlogger.log(nil)\n\treturn results, nil\n}", "title": "" }, { "docid": "064db107a5441120506cb88cd6c387c2", "score": "0.560569", "text": "func (a CommonApi) GetKeys(key string) (*Array, *APIResponse, error) {\n\n\tvar httpMethod = \"Get\"\n\t// create path and map variables\n\tpath := a.Configuration.BasePath + \"/keys/{key}\"\n\tpath = strings.Replace(path, \"{\"+\"key\"+\"}\", fmt.Sprintf(\"%v\", key), -1)\n\n\n\theaderParams := make(map[string]string)\n\tqueryParams := url.Values{}\n\tformParams := make(map[string]string)\n\tvar postBody interface{}\n\tvar fileName string\n\tvar fileBytes []byte\n\t// add default headers if any\n\tfor key := range a.Configuration.DefaultHeader {\n\t\theaderParams[key] = a.Configuration.DefaultHeader[key]\n\t}\n\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{ }\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\theaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"application/json\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\theaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tvar successPayload = new(Array)\n\thttpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)\n\tif err != nil {\n\t\treturn successPayload, NewAPIResponse(httpResponse.RawResponse), err\n\t}\n\terr = json.Unmarshal(httpResponse.Body(), &successPayload)\n\treturn successPayload, NewAPIResponse(httpResponse.RawResponse), err\n}", "title": "" }, { "docid": "afc38d48860e92b21b330108d40d8da8", "score": "0.56029457", "text": "func GetValue(kvs []KV, key string) string {\n\tfor _, kv := range kvs {\n\t\tif kv.Key == key {\n\t\t\treturn kv.Value\n\t\t}\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "dd2d7719b319703eb2acbc9737632858", "score": "0.55922306", "text": "func getValues(c pb.HelloServiceClient, val *pb.Value) {\n\tlogrus.Info(\"sending request: {Val: %d, Name: \\\"%s\\\"}\", val.Val, val.Name)\n\tctx, cancel := context.WithTimeout(context.Background(), time.Second*5)\n\tdefer cancel()\n\n\tsvc, err := c.ValueToStream(ctx, val)\n\tif err != nil {\n\t\tlogrus.Fatalf(\"can't get value from the server: %v\", err)\n\t}\n\n\tfor {\n\t\tres, err := svc.Recv()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\n\t\tif err != nil {\n\t\t\tlogrus.Fatalf(\"streaming error: %v\", err)\n\t\t}\n\n\t\tlogrus.Infof(\"received value from the stream: {Val: %d, Name: \\\"%s\\\"}\", res.Val, res.Name)\n\t}\n\n\tlogrus.Info(\"ending connection\")\n}", "title": "" }, { "docid": "8c8336f641a4873c2fa84c51371c211c", "score": "0.5589804", "text": "func (d *RecordData) GetValues(enquoter Enquoter) []string {\n\tvalues := make([]string, 0, d.Length())\n\tfor _, col := range d.keys {\n\t\tvalues = append(values, enquoter(d.data[col]))\n\t}\n\n\treturn values\n}", "title": "" }, { "docid": "0bc986bbc65effd8375b425e4be52a29", "score": "0.55841714", "text": "func (m *DirectorySettingTemplate) GetValues()([]SettingTemplateValueable) {\n val, err := m.GetBackingStore().Get(\"values\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.([]SettingTemplateValueable)\n }\n return nil\n}", "title": "" }, { "docid": "2612e0a9741a19feb71c155593ea2b6d", "score": "0.5580823", "text": "func (tc *PocketClient) GetKeys() ([]agent.AddedKey, error) {\n return tc.LocalAgent().GetKeys(tc.Username)\n}", "title": "" }, { "docid": "6ed4e4d2b5c337814583bb70c3a50d16", "score": "0.5578225", "text": "func (_obj *Cache) GetAllKeys(Req *GetAllKeysReq, Rsp *GetAllKeysRsp, _opt ...map[string]string) (ret int32, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = Req.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\tctx := context.Background()\n\terr = _obj.s.Tars_invoke(ctx, 0, \"getAllKeys\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = _is.Read_int32(&ret, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\terr = (*Rsp).ReadBlock(_is, 2, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_obj.setMap(len(_opt), _resp, _context, _status)\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "e4906864a4c23beaff588263022adb22", "score": "0.55711645", "text": "func (m *bradfitzMemcacheClient) MultiGet(ctx context.Context, keys []string) ([][]byte, error) {\n\tcacheItemMap, err := m.client.GetMulti(keys)\n\tif err != nil {\n\t\tlog.Error(ctx, \"failed fetching\", keys, err)\n\t\treturn nil, err\n\t}\n\n\tresult := make([][]byte, len(cacheItemMap))\n\tvar i = 0\n\tfor _, cacheItem := range cacheItemMap {\n\t\tresult[i] = cacheItem.Value\n\t\ti++\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "aef3a4421f1eeddfe05d6340313f76c4", "score": "0.55679524", "text": "func (c configManager) List(key string) (KVPairs, error) {\n\tlist, err := c.store.List(key)\n\tretList := make(KVPairs, len(list))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor i, kv := range list {\n\t\tretList[i].Key = kv.Key\n\t\tretList[i].Value, err = secconf.Decode(kv.Value, bytes.NewBuffer(c.keystore))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn retList, nil\n}", "title": "" }, { "docid": "19da265380b472f17b744b3992ed45f1", "score": "0.5566546", "text": "func (k Keeper) GetAll(ctx sdk.Context, prefix []byte, unmarshal UnmarshalFn) (i []interface{}) {\n\tstore := ctx.KVStore(k.storeKey)\n\titerator := sdk.KVStorePrefixIterator(store, prefix)\n\tdefer iterator.Close()\n\n\tfor ; iterator.Valid(); iterator.Next() {\n\t\tvalue, _ := unmarshal(iterator.Value())\n\t\ti = append(i, value)\n\t}\n\treturn i\n}", "title": "" }, { "docid": "ab794a5f252068d08a28b080d16c4ab1", "score": "0.55661935", "text": "func (c Redis) GetMulti(ctx context.Context, keys ...string) ([]cache.Item, error) {\n\tval, err := c.conn.MGet(ctx, keys...).Result()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ti := []cache.Item{}\n\tfor _, v := range val {\n\t\tvalErr := cache.ErrCacheMiss\n\t\tvar b []byte\n\t\tif v != nil {\n\t\t\tb = []byte(v.(string))\n\t\t\tvalErr = nil\n\t\t}\n\n\t\ti = append(i, cache.NewItem(c.dec, b, valErr))\n\t}\n\n\treturn i, nil\n}", "title": "" }, { "docid": "b89abbf05b35f53f43abd2966ed7ffb1", "score": "0.5566167", "text": "func (c standardConfigManager) List(key string) (KVPairs, error) {\n\tlist, err := c.store.List(key)\n\tretList := make(KVPairs, len(list))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor i, kv := range list {\n\t\tretList[i].Key = kv.Key\n\t\tretList[i].Value = kv.Value\n\t}\n\treturn retList, err\n}", "title": "" }, { "docid": "20caba779e18055fe8ecc0856faf4757", "score": "0.55626386", "text": "func (rc *Redis) GetMulti(keys []string) []interface{} {\n\tvar rv []interface{}\n\tfor _, key := range keys {\n\t\tkey = rc.realKey(key)\n\t\tif v, err := rc.do(\"GET\", key); err == nil {\n\t\t\trv = append(rv, v.([]byte))\n\t\t} else {\n\t\t\trv = append(rv, err)\n\t\t}\n\t}\n\treturn rv\n}", "title": "" }, { "docid": "c2da6cbadd8799a1e2d3fee80f377d7f", "score": "0.55617654", "text": "func (d *V8value) GetKeys(keys StringList) int32 {\n\treturn int32(C.gocef_v8value_get_keys(d.toNative(), C.cef_string_list_t(keys), d.get_keys))\n}", "title": "" }, { "docid": "f1da9873097f4becaba18fcaf7eff8a9", "score": "0.5557473", "text": "func Values(out interface{}) interface{} {\n\tvalue := redirectValue(reflect.ValueOf(out))\n\tvalueType := value.Type()\n\n\tif value.Kind() == reflect.Map {\n\t\tkeys := value.MapKeys()\n\n\t\tlength := len(keys)\n\n\t\tresultSlice := reflect.MakeSlice(reflect.SliceOf(valueType.Elem()), length, length)\n\n\t\tfor i, key := range keys {\n\t\t\tresultSlice.Index(i).Set(value.MapIndex(key))\n\t\t}\n\n\t\treturn resultSlice.Interface()\n\t}\n\n\tif value.Kind() == reflect.Struct {\n\t\tlength := value.NumField()\n\n\t\tresultSlice := make([]interface{}, length)\n\n\t\tfor i := 0; i < length; i++ {\n\t\t\tresultSlice[i] = value.Field(i).Interface()\n\t\t}\n\n\t\treturn resultSlice\n\t}\n\n\tpanic(fmt.Sprintf(\"Type %s is not supported by Keys\", valueType.String()))\n}", "title": "" }, { "docid": "92238c73e5f25e60006d5fe651f25de4", "score": "0.5557279", "text": "func (s Store) ListValues(bundleID, accountUUID string) ([]*settingsmsg.Value, error) {\n\tvaluesFolder := s.buildFolderPathForValues(false)\n\tvalueFiles, err := os.ReadDir(valuesFolder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trecords := make([]*settingsmsg.Value, 0, len(valueFiles))\n\tfor _, valueFile := range valueFiles {\n\t\trecord := settingsmsg.Value{}\n\t\terr := s.parseRecordFromFile(&record, filepath.Join(valuesFolder, valueFile.Name()))\n\t\tif err != nil {\n\t\t\ts.Logger.Warn().Msgf(\"error reading %v\", valueFile)\n\t\t\tcontinue\n\t\t}\n\t\tif bundleID != \"\" && record.BundleId != bundleID {\n\t\t\tcontinue\n\t\t}\n\t\t// if requested accountUUID empty -> fetch all system level values\n\t\tif accountUUID == \"\" && record.AccountUuid != \"\" {\n\t\t\tcontinue\n\t\t}\n\t\t// if requested accountUUID empty -> fetch all individual + all system level values\n\t\tif accountUUID != \"\" && record.AccountUuid != \"\" && record.AccountUuid != accountUUID {\n\t\t\tcontinue\n\t\t}\n\t\trecords = append(records, &record)\n\t}\n\n\treturn records, nil\n}", "title": "" }, { "docid": "59e3d284d732ffec54222bdc8b529a25", "score": "0.55465066", "text": "func (l *OrderedMap) Values() []interface{} {\n\tl.mu.RLock()\n\tvalues := make([]interface{}, len(l.keys))\n\tfor idx, key := range l.keys {\n\t\tvalues[idx] = l.kv[key]\n\t}\n\tl.mu.RUnlock()\n\treturn values\n}", "title": "" }, { "docid": "7b655b7356b560d73cc0a4c17ea4bc3d", "score": "0.5545376", "text": "func (ck *Clerk) Get(key string) string {\n\tck.mu.Lock()\n\t// DPrintf(\"Client: Request command %v, key=%s, seriesNumber=%v, clientId=%v\", \"Get\", key, ck.seriesNumber, ck.clientId)\n\targs := GetArgs{key, ck.seriesNumber, ck.clientId}\n\tck.seriesNumber += 1\n\tck.mu.Unlock()\n\t// You will have to modify this function.\n\tfor {\n\t\treply := GetReply{}\n\t\tlastLeader := ck.lastLeader\n\t\tif lastLeader != nil {\n\t\t\tok := lastLeader.Call(\"KVServer.Get\", &args, &reply)\n\t\t\tif !ok {\n\t\t\t\treply.Err = \"RPC timeout\"\n\t\t\t\treply.WrongLeader = true\n\t\t\t} else if !reply.WrongLeader && reply.Err == \"\" {\n\t\t\t\tDPrintf(\"Client: Get value %s for key %s\\n\", reply.Value, key)\n\t\t\t\treturn reply.Value\n\t\t\t}\n\t\t}\n\t\tif reply.WrongLeader || lastLeader == nil {\n\t\t\tfor _, server := range ck.servers {\n\t\t\t\treply = GetReply{}\n\t\t\t\tok := server.Call(\"KVServer.Get\", &args, &reply)\n\t\t\t\tif !ok {\n\t\t\t\t\treply.Err = \"RPC timeout\"\n\t\t\t\t} else if !reply.WrongLeader {\n\t\t\t\t\tck.mu.Lock()\n\t\t\t\t\tck.lastLeader = server\n\t\t\t\t\tck.mu.Unlock()\n\t\t\t\t\tif reply.Err == \"\" {\n\t\t\t\t\t\tDPrintf(\"Client: Get value %s for key %s\\n\", reply.Value, key)\n\t\t\t\t\t\treturn reply.Value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttime.Sleep(time.Duration(10) * time.Millisecond)\n\t\t\t}\n\t\t}\n\t\tif reply.Err != \"\" {\n\t\t\tDPrintf(\"Called for key %s, but err: %s\", key, reply.Err)\n\t\t}\n\t\ttime.Sleep(10 * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "f7a0ca380c5cd848a7a794837a3fc83c", "score": "0.55436176", "text": "func (c *Client) Keys(ctx context.Context) ([]string, error) {\n\tpath := fmt.Sprintf(\"%s/api/v2/tailnet/%s/keys\", c.baseURL(), c.tailnet)\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", path, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tb, resp, err := c.sendRequest(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, handleErrorResponse(b, resp)\n\t}\n\n\tvar keys struct {\n\t\tKeys []*Key `json:\"keys\"`\n\t}\n\tif err := json.Unmarshal(b, &keys); err != nil {\n\t\treturn nil, err\n\t}\n\tret := make([]string, 0, len(keys.Keys))\n\tfor _, k := range keys.Keys {\n\t\tret = append(ret, k.ID)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "48c04580a2db97ddba59dfe79bfbd3bf", "score": "0.5523587", "text": "func (c *memcacheClient) GetMulti(keys []string) []interface{} {\n\tsize := len(keys)\n\tvar rv []interface{}\n\tmv, err := c.client.GetMulti(keys)\n\tif err == nil {\n\t\tfor _, v := range mv {\n\t\t\trv = append(rv, v.Value)\n\t\t}\n\t\treturn rv\n\t}\n\tfor i := 0; i < size; i++ {\n\t\trv = append(rv, err)\n\t}\n\treturn rv\n}", "title": "" }, { "docid": "0618881043fb1041c41c972a3cf1eacd", "score": "0.55223775", "text": "func (server *Server) GetCurrentValues(context echo.Context) error {\n\tvals, err := server.redisDB.HGetAll(\"values\")\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn context.JSON(http.StatusOK, vals)\n}", "title": "" }, { "docid": "666101a2127df3642e45beba92313675", "score": "0.55174667", "text": "func (v *Vault) readKeyValues(r io.Reader) error {\n\tdec := json.NewDecoder(r)\n\treturn dec.Decode(&v.keyValues)\n}", "title": "" }, { "docid": "c9111b710ed935e5f0a4737f5995f933", "score": "0.5517272", "text": "func (mc *Connection) Gets(keys ...string) (results []cacheservice.Result, err error) {\n\tdefer handleError(&err)\n\tresults = mc.get(\"gets\", keys)\n\treturn\n}", "title": "" }, { "docid": "7edf0276756b5500eca7279b261105c3", "score": "0.55073255", "text": "func (cbb *BytesBrokerWrapper) ListValues(key string) (keyval.BytesKeyValIterator, error) {\n\tkv, err := cbb.BytesBroker.ListValues(key)\n\tif err != nil {\n\t\treturn kv, err\n\t}\n\treturn &BytesKeyValIteratorWrapper{\n\t\tBytesKeyValIterator: kv,\n\t\tdecryptData: cbb.decryptData,\n\t}, nil\n}", "title": "" }, { "docid": "671653b866003e2012b950bf6660cd5f", "score": "0.55002874", "text": "func (sm *StreamMap) GetKeys() []string {\n keys := make([]string, len(sm.sMap))\n /* loop and get key */\n var i int = 0\n for k := range sm.sMap {\n keys[i] = k\n i++\n }\n return keys\n}", "title": "" }, { "docid": "23e0ce07709d2367015d7e11fc45228e", "score": "0.5496281", "text": "func (r *Service) GetKeys(prefix string) ([]string, error) {\n\tc := r.pool.Get()\n\tdefer c.Close()\n\tif err := c.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn r.getKeysConn(c, prefix)\n}", "title": "" }, { "docid": "61f34acec56d07615bbb8f2f603657b7", "score": "0.54858387", "text": "func (r *Recorder) Get(ctx context.Context, keys ...dskey.Key) (map[dskey.Key][]byte, error) {\n\tfor _, k := range keys {\n\t\tr.keys[k] = struct{}{}\n\t}\n\treturn r.getter.Get(ctx, keys...)\n}", "title": "" }, { "docid": "ee0a3063e262834fcc5f278d90c33c12", "score": "0.54853445", "text": "func (ca *ConsulAgent) GetKeys(prefix string) []string {\n\tpairs, _, err := ca.consulAgent.KV().Keys(prefix, \"\", nil)\n\tif err != nil {\n\t\tca.logger.LogError(\"Error getting keys for prefix \"+prefix, err)\n\t}\n\treturn pairs\n}", "title": "" }, { "docid": "ffcfc270f19d2bae1df72aeda010d2c8", "score": "0.54819196", "text": "func (r *resolveConfig) Value(k string) []string {\n\treturn r.properties[k]\n}", "title": "" }, { "docid": "7d486149d03e3c708e846943df1f6705", "score": "0.5479571", "text": "func (db *DB) RetrieveKVPs(ctx context.Context) (kvps []*services.KeyValuePair, err error) {\n\tif err = db.DoInTransaction(ctx, func(ctx context.Context) error {\n\t\tkvps, err = db.retrieveKVPs(ctx)\n\t\treturn err\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\treturn kvps, nil\n}", "title": "" }, { "docid": "ec61067defd73510562c3668aadc2ce8", "score": "0.5479384", "text": "func (r *RedisClient) Hvals(key string) ([]string, error) {\n\tlogrus.Debugf(\"HVALS %s\", key)\n\tс := r.pool.Get()\n\tdefer с.Close()\n\treturn redis.Strings(с.Do(\"HVALS\", key))\n}", "title": "" }, { "docid": "6316114c25fce64a7f63c45b7070234a", "score": "0.54789525", "text": "func (self *PksHandler) Get(w http.ResponseWriter, keyid string) error {\n\tvar cp *cassandra.ColumnParent = cassandra.NewColumnParent()\n\tvar sp *cassandra.SlicePredicate = cassandra.NewSlicePredicate()\n\tvar kr *cassandra.KeyRange = cassandra.NewKeyRange()\n\tvar slices []*cassandra.KeySlice\n\tvar ire *cassandra.InvalidRequestException\n\tvar ue *cassandra.UnavailableException\n\tvar te *cassandra.TimedOutException\n\tvar ks *cassandra.KeySlice\n\tvar kid []byte\n\tvar key, endkey []byte\n\tvar err error\n\tvar i int\n\n\tkid, err = hex.DecodeString(strings.TrimPrefix(keyid, \"0x\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Reverse the key ID. Also, copy it into an end key.\n\tfor i = len(kid) - 1; i >= 0; i-- {\n\t\tkey = append(key, kid[i])\n\t\tendkey = append(endkey, kid[i])\n\t}\n\t// The end key must be the start key + 1.\n\t// If the start key is all 0xFF, the end key should be all 0x00.\n\tfor i = len(endkey) - 1; i >= 0; i++ {\n\t\tif endkey[i] == 255 {\n\t\t\tendkey[i] = 0\n\t\t} else {\n\t\t\tendkey[i] += 1\n\t\t\tbreak\n\t\t}\n\t}\n\n\tcp.ColumnFamily = \"keys\"\n\tsp.ColumnNames = [][]byte{[]byte(\"keydata\")}\n\tkr.StartKey = key\n\tkr.EndKey = endkey\n\n\tslices, ire, ue, te, err = self.client.GetRangeSlices(\n\t\tcp, sp, kr, cassandra.ConsistencyLevel_ONE)\n\tif ire != nil {\n\t\treturn errors.New(ire.Why)\n\t} else if ue != nil {\n\t\treturn errors.New(\"Unavailable\")\n\t} else if te != nil {\n\t\treturn errors.New(\"Timed out\")\n\t} else if err != nil {\n\t\treturn err\n\t}\n\tpkslookupkeysfound.Add(int64(len(slices)))\n\t// Print all keydata columns to stdout, it's what the user wants.\n\tfor _, ks = range slices {\n\t\tvar cos *cassandra.ColumnOrSuperColumn\n\t\tfor _, cos = range ks.Columns {\n\t\t\tvar col = cos.Column\n\t\t\tif string(col.Name) != \"keydata\" {\n\t\t\t\tlog.Print(\"Got column \" + string(col.Name) +\n\t\t\t\t\t\" which I didn't ask for?\")\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tw.Write(col.Value)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c61bc07b791aa87e4a8b5d21ad629ff2", "score": "0.54771334", "text": "func (t *Cache) GetMulti(keys []string) []interface{} {\n\tvar args []string\n\tfor _, key := range keys {\n\t\targs = append(args, t.joinKey(key))\n\t}\n\tvalues, err := t.redisClient.MGet(args...).Result()\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn values\n}", "title": "" }, { "docid": "4a4758633a050ac22fe15158a90ba733", "score": "0.5472627", "text": "func GetKeyList() ([]string, error) {\n\tdb, err := badger.Open(\n\t\tbadger.DefaultOptions(viper.GetString(\"core.settings_db\")).\n\t\t\tWithLoggingLevel(badger.ERROR),\n\t)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer db.Close()\n\n\tkeys := []string{}\n\n\terr = db.View(func(txn *badger.Txn) error {\n\t\topts := badger.DefaultIteratorOptions\n\t\topts.PrefetchValues = false\n\n\t\tit := txn.NewIterator(opts)\n\t\tdefer it.Close()\n\n\t\tfor it.Rewind(); it.Valid(); it.Next() {\n\t\t\tk := string(it.Item().Key())\n\t\t\tkeys = append(keys, k)\n\t\t}\n\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn keys, nil\n}", "title": "" }, { "docid": "0a66a7745e5471ad2ced7bf0505d96bf", "score": "0.546846", "text": "func (c *Conf) GetKeys(arg, def string, label ...string) string {\n\tif arg != def {\n\t\treturn arg\n\t}\n\t//if c.Config == nil {\n\t//\treturn arg\n\t//}\n\tif x, o := c.Get(\"keys\", label...); o {\n\t\treturn x\n\t}\n\treturn arg\n}", "title": "" }, { "docid": "ea35e3c98c175f14ecdc0643a7b76974", "score": "0.54684556", "text": "func (h *Handler) GetKeysHandler(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tstatus := \"active\"\n\tif params[\"status\"] != \"\" {\n\t\tstatus = params[\"status\"]\n\t}\n\t// Get User ID\n\t_, role, err := auth.ExtractTokenUID(r)\n\tif err != nil {\n\t\thelpers.SendError(w, \"error UID extraction\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif role < 1 {\n\t\thelpers.SendError(w, \"Request denied, superadmin only\", http.StatusUnauthorized)\n\t\treturn\n\t}\n\t//ADD FILTER, //ADD PAGINATION\n\tvar keys []models.Key\n\t//IF USER IS SUPERADMIN, GET ALL\n\th.DB.Preload(\"Shares\").Preload(\"Conditions\").Where(\"status = ?\", status).Order(\"created_at desc\").Find(&keys)\n\t//IF USER IS NORMAL USER, GET ALLOWED (to be updated)\n\n\twrite, _ := json.Marshal(&keys)\n\thelpers.RenderJSON(w, write, http.StatusOK)\n}", "title": "" }, { "docid": "99998443553c5d9b38ec2a98aab58686", "score": "0.54650176", "text": "func (c *Store) GetKeyPairs(ids []string) ([]*types.StoredData, error) {\n\tlist, err := c.list(ids, c.keypairBucket)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar keypairs []*types.StoredData\n\tif err := json.Unmarshal(list, &keypairs); err != nil {\n\t\tc.log(LogLevelError, \"Trust store failed to unmarshal data from the embedded database\", err)\n\t\treturn nil, err\n\t}\n\treturn keypairs, nil\n}", "title": "" }, { "docid": "d7082882aaec6bcc211c5e6882116c72", "score": "0.546061", "text": "func GetMulti(c appengine.Context, key []string) (map[string]*Item, os.Error) {\n\tkeyAsBytes := make([][]byte, len(key))\n\tfor i, k := range key {\n\t\tkeyAsBytes[i] = []byte(k)\n\t}\n\treq := &pb.MemcacheGetRequest{\n\t\tKey: keyAsBytes,\n\t\tForCas: proto.Bool(true),\n\t}\n\tres := &pb.MemcacheGetResponse{}\n\tif err := c.Call(\"memcache\", \"Get\", req, res); err != nil {\n\t\treturn nil, err\n\t}\n\tm := make(map[string]*Item, len(res.Item))\n\tfor _, p := range res.Item {\n\t\tt := protoToItem(p)\n\t\tm[t.Key] = t\n\t}\n\treturn m, nil\n}", "title": "" }, { "docid": "3cd81df4128c8ad3d500dc4fd3bb5871", "score": "0.5456164", "text": "func (item *Entry) Values() []string {\n\tvalues := make([]string, len(*item))\n\tj := 0\n\tfor _, k := range allKeys {\n\t\tif v, ok := (*item)[k]; ok {\n\t\t\tvalues[j] = v\n\t\t\tj = j + 1\n\t\t}\n\t}\n\treturn values[:j]\n}", "title": "" }, { "docid": "cbad8a0c65c52a5e1fe54ce9d799b400", "score": "0.5455871", "text": "func (bs *RedisV5Buckets) Get(key string, ids ...int64) ([]int64, error) {\n\targs := make([]string, len(ids))\n\tfor i, v := range ids {\n\t\targs[i] = strconv.FormatInt(v, 10)\n\t}\n\n\tresults, err := bs.redis.HMGet(key, args...).Result()\n\tif err != nil {\n\t\treturn []int64{}, err\n\t}\n\n\tvals := make([]int64, len(ids))\n\tfor i, result := range results {\n\t\tif result == nil {\n\t\t\tvals[i] = 0\n\t\t} else if v, e := strconv.ParseInt(result.(string), 10, 64); e != nil {\n\t\t\tvals[i] = 0\n\t\t} else {\n\t\t\tvals[i] = v\n\t\t}\n\t}\n\n\treturn vals, nil\n}", "title": "" }, { "docid": "5d59f9f00b002f7e4948cea98a73c9a4", "score": "0.54520565", "text": "func (kvl *mockKeyProtoValLister) ListValues(prefix string) (keyval.ProtoKeyValIterator, error) {\n\tvar values []keyval.ProtoKeyVal\n\tfor key, msg := range kvl.ds {\n\t\tpkv := mockProtoKeyval{\n\t\t\tkey: key,\n\t\t\tmsg: msg,\n\t\t}\n\t\tvalues = append(values, &pkv)\n\t}\n\treturn &mockProtoKeyValIterator{\n\t\tvalues: values,\n\t\tidx: 0,\n\t}, nil\n}", "title": "" }, { "docid": "35225fe5a013b62eaa5a070343a8af69", "score": "0.5448698", "text": "func (ck *Clerk) Get(key string) string {\n\tvar request GetArgs\n\tck.mu.Lock()\n\trequest.ClientID = ck.id\n\trequest.Sequence = ck.sequence\n\tck.sequence++\n\trequest.Key = key\n\tck.mu.Unlock()\n\tfor {\n\t\tfor _, server := range ck.servers {\n\t\t\tvar reply GetReply\n\t\t\tok := server.Call(\"RaftKV.Get\", &request, &reply)\n\t\t\tif ok && !reply.WrongLeader {\n\t\t\t\treturn reply.Value\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b0c3f22b94e13fbfa277923301da6f88", "score": "0.5445256", "text": "func (ds *DataStore) List() (keys []string, err error) {\n\turl := ds.address + \"/data\"\n\tresp, err := ds.client.Get(url)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn\n\t}\n\tkeys = make([]string, 0)\n\terr = json.Unmarshal(body, &keys)\n\treturn\n}", "title": "" }, { "docid": "a10ce21583890a9dbd94f9044877284e", "score": "0.5443952", "text": "func (p *CacheServerAPI) GetKeys(c *gin.Context) {\n\tres := p.redisClient.Keys(\"topics*\")\n\tfmt.Print(res)\n}", "title": "" }, { "docid": "63fcee78583792c423670fee6865e6f7", "score": "0.54373527", "text": "func (kv KV) Keys(namespace string) (KVAPI, error) {\n\tm := KVAPI{\n\t\tParams: &kvParams{},\n\t}\n\tm.Params.Options = kvOptions{\n\t\tTeam: kv.Team,\n\t\tNamespace: namespace,\n\t}\n\n\tm.Method = \"list\"\n\n\tr, err := kvAPIOut(kv.keybase, m)\n\tif err != nil {\n\t\treturn r, err\n\t}\n\treturn r, nil\n}", "title": "" } ]
a4dd5477edde68c499e606437f21d0bb
ForwardRoomEvent mocks base method.
[ { "docid": "9aff4bdfaee849f07ca4b0d6c49d81c4", "score": "0.77103657", "text": "func (m *MockEventsForwarder) ForwardRoomEvent(ctx context.Context, eventAttributes events.RoomEventAttributes, forwarder forwarder.Forwarder) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ForwardRoomEvent\", ctx, eventAttributes, forwarder)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" } ]
[ { "docid": "3a1c1e99c5703bc1c2327d93209c5434", "score": "0.713798", "text": "func (m *MockForwarderClient) SendRoomEvent(ctx context.Context, forwarder forwarder.Forwarder, in *eventforwarder.RoomEvent) (*eventforwarder.Response, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SendRoomEvent\", ctx, forwarder, in)\n\tret0, _ := ret[0].(*eventforwarder.Response)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "1d2b72c72eded66068bddeddec30e227", "score": "0.60300994", "text": "func (m *MockEventsForwarder) ForwardPlayerEvent(ctx context.Context, eventAttributes events.PlayerEventAttributes, forwarder forwarder.Forwarder) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ForwardPlayerEvent\", ctx, eventAttributes, forwarder)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "0b8b14feff720fd74249fc614cb815fb", "score": "0.6012977", "text": "func (m *MockRoomReadRegistry) BookRoom(name string, arrival, departure time.Time) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"BookRoom\", name, arrival, departure)\n}", "title": "" }, { "docid": "35b2b5f235f60ecd27b1d0dd42e58f42", "score": "0.5988069", "text": "func (m *MockForwarderClient) SendRoomReSync(ctx context.Context, forwarder forwarder.Forwarder, in *eventforwarder.RoomStatus) (*eventforwarder.Response, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SendRoomReSync\", ctx, forwarder, in)\n\tret0, _ := ret[0].(*eventforwarder.Response)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "bfef6d63201acb6b6cdbd3eefbc4ece5", "score": "0.5848459", "text": "func (mr *MockEventsForwarderMockRecorder) ForwardRoomEvent(ctx, eventAttributes, forwarder interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ForwardRoomEvent\", reflect.TypeOf((*MockEventsForwarder)(nil).ForwardRoomEvent), ctx, eventAttributes, forwarder)\n}", "title": "" }, { "docid": "4ced26fd8ea2184c98d2d593a475ea5d", "score": "0.58091867", "text": "func (m *MockForwarderClient) SendRoomStatus(ctx context.Context, forwarder forwarder.Forwarder, in *eventforwarder.RoomStatus) (*eventforwarder.Response, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SendRoomStatus\", ctx, forwarder, in)\n\tret0, _ := ret[0].(*eventforwarder.Response)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "5573dfb3ee83a22e450a469ce85a6628", "score": "0.57148683", "text": "func (m *MockOobService) RegisterMsgEvent(arg0 chan<- service.StateMsg) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RegisterMsgEvent\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "c1a63eb0c174beb2b96d2f9848eaf047", "score": "0.567276", "text": "func (m *MockForwarderClient) SendPlayerEvent(ctx context.Context, forwarder forwarder.Forwarder, in *eventforwarder.PlayerEvent) (*eventforwarder.Response, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SendPlayerEvent\", ctx, forwarder, in)\n\tret0, _ := ret[0].(*eventforwarder.Response)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "5f87d329cd564d93f17a75966ce4e403", "score": "0.5665213", "text": "func (m *MockIEventMessaging) onMessagingEventState(ctx context.Context, broadcast NotifParamsBladeBroadcast) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"onMessagingEventState\", ctx, broadcast)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "e80aff5978151dc885727460459536ae", "score": "0.56113833", "text": "func (m *MockListener) Send(arg0 Event) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"Send\", arg0)\n}", "title": "" }, { "docid": "79d6ab0cfe5f70cf2678a6dec8f13381", "score": "0.5589833", "text": "func (m *MockProtocolService) RegisterMsgEvent(arg0 chan<- service.StateMsg) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RegisterMsgEvent\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "c309beacb68a37d2ee988831da0dcf80", "score": "0.550654", "text": "func (mr *MockForwarderClientMockRecorder) SendRoomEvent(ctx, forwarder, in interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"SendRoomEvent\", reflect.TypeOf((*MockForwarderClient)(nil).SendRoomEvent), ctx, forwarder, in)\n}", "title": "" }, { "docid": "26e37972cd00ed32a8721ac64c184fe4", "score": "0.5464111", "text": "func (m *MockHandler) SendHostEvent(ctx context.Context, event HostEvent) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"SendHostEvent\", ctx, event)\n}", "title": "" }, { "docid": "9bfec009cb05357ab8561fc6b81d080f", "score": "0.53746504", "text": "func (m *MockIEventTasking) onTaskingEvent(ctx context.Context, broadcast NotifParamsBladeBroadcast) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"onTaskingEvent\", ctx, broadcast)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "2121025f99deb87431b2ad101bc4c638", "score": "0.52767205", "text": "func (m *MockSender) SendHostEvent(ctx context.Context, event HostEvent) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"SendHostEvent\", ctx, event)\n}", "title": "" }, { "docid": "bbe50e9eb9774407bec9863f2b539b19", "score": "0.5264691", "text": "func (m *MockHandler) AddEvent(ctx context.Context, clusterID strfmt.UUID, hostID *strfmt.UUID, severity, msg string, eventTime time.Time, props ...interface{}) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, clusterID, hostID, severity, msg, eventTime}\n\tfor _, a := range props {\n\t\tvarargs = append(varargs, a)\n\t}\n\tm.ctrl.Call(m, \"AddEvent\", varargs...)\n}", "title": "" }, { "docid": "3dd7e332e4fb5f03fdba67783d03600b", "score": "0.52633864", "text": "func (m *MockSender) AddEvent(ctx context.Context, clusterID strfmt.UUID, hostID *strfmt.UUID, severity, msg string, eventTime time.Time, props ...interface{}) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, clusterID, hostID, severity, msg, eventTime}\n\tfor _, a := range props {\n\t\tvarargs = append(varargs, a)\n\t}\n\tm.ctrl.Call(m, \"AddEvent\", varargs...)\n}", "title": "" }, { "docid": "e2f95f87ebd66ff028049d9876faf1f1", "score": "0.5251505", "text": "func (m *MockCommandService) PostRoomMessage(arg0 context.Context, arg1 action.ChatMessage) (uint64, error) {\n\tret := m.ctrl.Call(m, \"PostRoomMessage\", arg0, arg1)\n\tret0, _ := ret[0].(uint64)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "4ab627102499666f75c6e2ae77e7d3ee", "score": "0.52448523", "text": "func (m *MockProviderRepository) CreateEvent() {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"CreateEvent\")\n}", "title": "" }, { "docid": "390bbde4a79fb1d3a2643c11a383d084", "score": "0.52223825", "text": "func (_m *MockClock) Travel(_param0 time.Time) {\n\t_m.ctrl.Call(_m, \"Travel\", _param0)\n}", "title": "" }, { "docid": "dc0b44bd369d78dd2082a5ba621a2232", "score": "0.52164", "text": "func (m *MockIEventCalling) onCallingEventConnect(ctx context.Context, broadcast NotifParamsBladeBroadcast, rawEvent *json.RawMessage) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"onCallingEventConnect\", ctx, broadcast, rawEvent)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "3f45c4a6ee330b99631a833693e8d746", "score": "0.52050763", "text": "func (suite *EventHandlerTestSuite) TestNonLeaderEvent() {\n\tvar called bool\n\tsuite.Handler.IsLeader = func() bool {\n\t\tcalled = true\n\t\treturn false\n\t}\n\n\t// Create Member Event\n\tevt := serf.MemberEvent{\n\t\tserf.EventMemberUpdate,\n\t\t[]serf.Member{suite.Member},\n\t}\n\n\t// Process event\n\tsuite.Mocker.On(\"HandleMemberUpdate\", evt).Return()\n\tsuite.Handler.HandleEvent(evt)\n\tsuite.True(called, \"IsLeader should have been called\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"Reconcile\")\n}", "title": "" }, { "docid": "e495a3c3d8547bb7e9a84361724ee543", "score": "0.5201212", "text": "func (suite *EventHandlerTestSuite) TestNodeJoined() {\n\n\t// Create Member Event\n\tevt := serf.MemberEvent{\n\t\tserf.EventMemberJoin,\n\t\t[]serf.Member{suite.Member},\n\t}\n\n\t// Process event\n\tsuite.Mocker.On(\"HandleMemberJoin\", evt).Return()\n\tsuite.Mocker.On(\"Reconcile\", suite.Member).Return()\n\tsuite.Handler.HandleEvent(evt)\n\tsuite.Mocker.AssertCalled(suite.T(), \"HandleMemberJoin\", evt)\n\tsuite.Mocker.AssertCalled(suite.T(), \"Reconcile\", suite.Member)\n}", "title": "" }, { "docid": "d91b96d74e84f92dcf74546995b00fde", "score": "0.51963854", "text": "func (m *MockIEventCalling) onCallingEventReceive(ctx context.Context, broadcast NotifParamsBladeBroadcast) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"onCallingEventReceive\", ctx, broadcast)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "59655c28267822c5acebd5d9f8114e9e", "score": "0.518463", "text": "func (mmProcessGameOverEvent *mStaterMockProcessGameOverEvent) Expect(msg string) *mStaterMockProcessGameOverEvent {\n\tif mmProcessGameOverEvent.mock.funcProcessGameOverEvent != nil {\n\t\tmmProcessGameOverEvent.mock.t.Fatalf(\"StaterMock.ProcessGameOverEvent mock is already set by Set\")\n\t}\n\n\tif mmProcessGameOverEvent.defaultExpectation == nil {\n\t\tmmProcessGameOverEvent.defaultExpectation = &StaterMockProcessGameOverEventExpectation{}\n\t}\n\n\tmmProcessGameOverEvent.defaultExpectation.params = &StaterMockProcessGameOverEventParams{msg}\n\tfor _, e := range mmProcessGameOverEvent.expectations {\n\t\tif minimock.Equal(e.params, mmProcessGameOverEvent.defaultExpectation.params) {\n\t\t\tmmProcessGameOverEvent.mock.t.Fatalf(\"Expectation set by When has same params: %#v\", *mmProcessGameOverEvent.defaultExpectation.params)\n\t\t}\n\t}\n\n\treturn mmProcessGameOverEvent\n}", "title": "" }, { "docid": "8ce71ef8837e65cf47e0cb501081c168", "score": "0.51723707", "text": "func TestRECV_SubmitterWalkUpResponseMsg_UnknownShard(t *testing.T) {\n\t// create a DLT stack instance with registered app and initialized mocks\n\tstack, sharder, endorser, p2pLayer, testDb := initMocksAndDb()\n\n\t// submit a transactions to add ancestor to local shard's Anchor\n\ttx, _ := stack.Submit(dto.TestSubmitter().NewRequest(\"test payload1\"))\n\t// build a SubmitterWalkUpResponseMsg that has same submitter, seq but different shard\n\tmsg := NewSubmitterWalkUpResponseMsg(NewSubmitterWalkUpRequestMsg(tx.Request()))\n\tmsg.Transactions = [][64]byte{dto.RandomHash()}\n\tmsg.Shards = [][]byte{[]byte(\"a different shard\")}\n\tp2pLayer.Reset()\n\tsharder.Reset()\n\tendorser.Reset()\n\ttestDb.Reset()\n\n\t// build a mock peer\n\tmockConn := p2p.TestConn()\n\tpeer := NewMockPeer(mockConn)\n\n\t// start stack's event listener\n\tevents := make(chan controllerEvent, 10)\n\tfinished := make(chan struct{}, 2)\n\tgo func() {\n\t\tstack.peerEventsListener(peer, events)\n\t\tfinished <- struct{}{}\n\t}()\n\n\t// now emit RECV_SubmitterWalkUpResponseMsg event providing history with an unknown shard\n\tevents <- newControllerEvent(RECV_SubmitterWalkUpResponseMsg, msg)\n\tevents <- newControllerEvent(SHUTDOWN, nil)\n\n\t// wait for event listener to finish\n\t<-finished\n\n\t// check if event listener correctly processed the event to handle submitter's walk up request\n\n\t// verify that endorser gets called to fetch submitter's known shards/tx\n\tif !endorser.KnownShardsTxsCalled {\n\t\tt.Errorf(\"Endorser did not get called for submitter/seq history\")\n\t}\n\n\t// we should have continued walk up because of unknow shard\n\t// we should have sent the submitter sync message\n\tif !peer.SendCalled {\n\t\tt.Errorf(\"did not send submitter sync message to peer\")\n\t} else if peer.SendMsgCode != SubmitterWalkUpRequestMsgCode {\n\t\tt.Errorf(\"Incorrect message code send: %d\", peer.SendMsgCode)\n\t} else if string(peer.SendMsg.(*SubmitterWalkUpRequestMsg).Submitter) != string(msg.Submitter) {\n\t\tt.Errorf(\"Incorrect SubmitterWalkUpRequestMsg Submitter: %s\", peer.SendMsg.(*SubmitterWalkUpRequestMsg).Submitter)\n\t} else if peer.SendMsg.(*SubmitterWalkUpRequestMsg).Seq != msg.Seq-1 {\n\t\tt.Errorf(\"Incorrect SubmitterWalkUpRequestMsg Sequence: %d\", peer.SendMsg.(*SubmitterWalkUpRequestMsg).Seq)\n\t}\n}", "title": "" }, { "docid": "e4a699b70bef06231a7f05b0a776383d", "score": "0.51436037", "text": "func (m *MockHandler) SendHostEventAtTime(ctx context.Context, event HostEvent, eventTime time.Time) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"SendHostEventAtTime\", ctx, event, eventTime)\n}", "title": "" }, { "docid": "94062ae02d04404229224c07ba0124fe", "score": "0.5130317", "text": "func (m *MockLifecycle) Append(arg0 fx.Hook) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"Append\", arg0)\n}", "title": "" }, { "docid": "1cb5d4f72be02d151f64b27450a80e66", "score": "0.5122212", "text": "func (m *MockOobService) RegisterActionEvent(arg0 chan<- service.DIDCommAction) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RegisterActionEvent\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "271ae1e25b5a31079cce877ae3ce22c9", "score": "0.51008415", "text": "func (m *MockProtocolService) RegisterActionEvent(arg0 chan<- service.DIDCommAction) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RegisterActionEvent\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "1a79c823e3c0a06cbe2e078260aba24f", "score": "0.509513", "text": "func TestEventsDispatcherRestart(t *testing.T) {\n\tlogger := logger.WithContext(\"t_name\", t.Name())\n\teventsStorePath := filepath.Join(eventsDir, t.Name())\n\tdefer os.RemoveAll(eventsStorePath) // cleanup\n\n\t// create dispatcher\n\tdispatcher, err := NewDispatcher(t.Name(), dedupInterval, sendInterval, &events.StoreConfig{Dir: eventsStorePath},\n\t\tnil, logger)\n\tAssertOk(t, err, \"failed to create dispatcher\")\n\tdispatcher.Start()\n\tdefer dispatcher.Shutdown()\n\n\t// create and start exporter\n\tmockExporter := exporters.NewMockExporter(fmt.Sprintf(\"mock.%s\", t.Name()), exporterChLen, logger)\n\texporterEventCh, offsetTracker, err := dispatcher.RegisterExporter(mockExporter)\n\tAssertOk(t, err, \"failed to register mock exporter with the dispatcher\")\n\tmockExporter.Start(exporterEventCh, offsetTracker)\n\tdefer mockExporter.Stop()\n\tdefer dispatcher.UnregisterExporter(mockExporter.Name())\n\n\t// ensure the mock exporter receive no events\n\tAssert(t, mockExporter.GetTotalEvents() == 0, \"expected: 0 events, got: %v\", mockExporter.GetTotalEvents())\n\n\t// send some events\n\tevt := *dummyEvt\n\tfor i := 0; i < 100; i++ {\n\t\tcreationTime, _ := types.TimestampProto(time.Now())\n\t\ttimeNow := api.Timestamp{Timestamp: *creationTime}\n\n\t\tevt.ObjectMeta.CreationTime = timeNow\n\t\tevt.ObjectMeta.ModTime = timeNow\n\t\tevt.ObjectMeta.UUID = uuid.New().String()\n\n\t\tAssertOk(t, dispatcher.Action(evt), \"failed to send event\")\n\t}\n\n\t// ensure the mock exporter received these events\n\tAssertEventually(t, func() (bool, interface{}) {\n\t\ttotalEvents := mockExporter.GetTotalEvents()\n\t\tif totalEvents == 100 {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, fmt.Sprintf(\"expected: 100 events, got: %d\", totalEvents)\n\t}, \"did not receive all the events from the bookmark\", string(\"5ms\"), string(\"5s\"))\n\n\t// let us assume proxy restarted at this point\n\n\t// create new dispatcher after a restart\n\tdispatcher, err = NewDispatcher(t.Name(), dedupInterval, sendInterval, &events.StoreConfig{Dir: eventsStorePath},\n\t\tnil, logger)\n\tAssertOk(t, err, \"failed to create dispatcher\")\n\tdispatcher.Start()\n\tdefer dispatcher.Shutdown()\n\n\t// create exporter after a restart\n\tmockExporter = exporters.NewMockExporter(fmt.Sprintf(\"mock.%s\", t.Name()), exporterChLen, logger)\n\texporterEventCh, offsetTracker, err = dispatcher.RegisterExporter(mockExporter)\n\tAssertOk(t, err, \"failed to register mock exporter with the dispatcher\")\n\tmockExporter.Start(exporterEventCh, offsetTracker)\n\n\t// to test whether the events are replayed during restart; lets reset the offset in the exporter's offset file\n\t// open the offset file and update the offset. so that the dispatcher can replay events for this exporter.\n\tfh, err := os.OpenFile(path.Join(eventsStorePath, \"offset\", fmt.Sprintf(\"mock.%s\", t.Name())),\n\t\tos.O_RDWR, 0) // open file in read write mode\n\tAssertOk(t, err, \"failed to open offset file\")\n\tdefer fh.Close() // close the file handler\n\n\toffsetBeforeReset, err := offsetTracker.GetOffset()\n\tAssertOk(t, err, \"failed to read offset using the offset tracker\")\n\toffsetMsg := fmt.Sprintf(\"%s %d\", offsetBeforeReset.Filename, 0)\n\tif _, err := fh.WriteAt([]byte(offsetMsg), 0); err != nil {\n\t\tlog.Errorf(\"could not write to offset file, err: %v\", err)\n\t}\n\n\tfh.Truncate(int64(len(offsetMsg)))\n\n\t// ensure the exporter received 0 events before processing the failed events (new exporter)\n\tAssert(t, mockExporter.GetTotalEvents() == 0, \"expected: 0 events, got: %v\", mockExporter.GetTotalEvents())\n\n\t// restart the exporter (as the file is reset to 0, it should receive all the events from the beginning as part of the registration)\n\tmockExporter.Stop()\n\tdispatcher.UnregisterExporter(mockExporter.Name())\n\tmockExporter = exporters.NewMockExporter(fmt.Sprintf(\"mock.%s\", t.Name()), exporterChLen, logger)\n\texporterEventCh, offsetTracker, err = dispatcher.RegisterExporter(mockExporter)\n\tAssertOk(t, err, \"failed to Register Exporter\")\n\tmockExporter.Start(exporterEventCh, offsetTracker)\n\n\tAssertEventually(t, func() (bool, interface{}) {\n\t\t// it should go back to where it left off (after processing failed events)\n\t\toffsetAfterReset, _ := offsetTracker.GetOffset()\n\t\tif offsetAfterReset.Filename == offsetAfterReset.Filename && offsetBeforeReset.BytesRead == offsetAfterReset.BytesRead {\n\t\t\treturn true, nil\n\t\t}\n\n\t\ttotalEvents := mockExporter.GetTotalEvents()\n\t\tif totalEvents >= 100 {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, fmt.Sprintf(\"expected: >=100 events, got: %d\", totalEvents)\n\t}, \"did not receive all the events from the bookmark\", string(\"5ms\"), string(\"5s\"))\n\ttotalEventsAfterReset := mockExporter.GetTotalEvents()\n\n\t// once the failed events are processed; the proxy will starts it's normal operation\n\tevt = *dummyEvt\n\tevt.EventAttributes.Type = \"DUMMY2\"\n\tfor i := 0; i < 10; i++ {\n\t\tcreationTime, _ := types.TimestampProto(time.Now())\n\t\ttimeNow := api.Timestamp{Timestamp: *creationTime}\n\n\t\tevt.ObjectMeta.CreationTime = timeNow\n\t\tevt.ObjectMeta.ModTime = timeNow\n\t\tevt.ObjectMeta.UUID = uuid.New().String()\n\n\t\tAssertOk(t, dispatcher.Action(evt), \"failed to send event\")\n\t}\n\n\t// now, the exporter should have replayed events + new events\n\tAssertEventually(t, func() (bool, interface{}) {\n\t\ttotalEvents := mockExporter.GetTotalEvents()\n\t\tif totalEvents >= totalEventsAfterReset+10 {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, fmt.Sprintf(\"expected: >=%d events, got: %d\", totalEventsAfterReset+10, totalEvents)\n\t}, \"did not receive all the events from the bookmark\", string(\"5ms\"), string(\"5s\"))\n\n\tAssertEventually(t, func() (bool, interface{}) {\n\t\tnumEvents := mockExporter.GetEventsByType(\"DUMMY2\")\n\t\tif numEvents >= 10 {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, fmt.Sprintf(\"expected: >=10 events, got: %d\", numEvents)\n\t}, \"did not receive all the events from the bookmark\", string(\"5ms\"), string(\"5s\"))\n}", "title": "" }, { "docid": "a3915a0bde29f1e1d73375670f7d0b3b", "score": "0.5066966", "text": "func TestEventToHand(t *testing.T) {\n\t// Prepare players & cards\n\tp1, p2 := MakePlayer(\"test 1\", FactionNorthernRealms, GenerateDeckWithUnitCards(RangeClose, 5, 30)), MakePlayer(\"test 2\", FactionMonsters, GenerateDeckWithUnitCards(RangeClose, 5, 30))\n\n\t// Create & reset game\n\tg := MakeGame(p1, p2)\n\n\t// Create card & toHand event\n\t_, handedCard := p1.Deck.WithoutRandom() //Pick random card from Deck\n\te := MakeEvent(g, handedCard, nil, EventToHand, p1)\n\tt.Error(e.CardID, handedCard.GUID())\n\n\t// Read current amount of cards in hand\n\thandLen := len(p1.Hand)\n\n\t// Post event to game\n\tg.PostEvent(e)\n\n\t// Check that we have more cards after registering the event\n\tif currentHandLen := len(p1.Hand); handLen+1 != currentHandLen {\n\t\tt.Errorf(\"Amount of cards in hand should be %d, but got %d instead\", handLen+1, currentHandLen)\n\t}\n\n\t// End game\n\tg.Next()\n}", "title": "" }, { "docid": "6fd99049ec381d8f6c07d60d346458e0", "score": "0.50525445", "text": "func (suite *EventHandlerTestSuite) TestUserEvent_LeaderElection() {\n\n\t// Create Member Event\n\tevt := serf.UserEvent{\n\t\tLTime: serf.LamportTime(0),\n\t\tName: suite.Prefix + \":new-leader\",\n\t\tPayload: make([]byte, 0),\n\t\tCoalesce: false,\n\t}\n\n\t// Process event\n\tsuite.Mocker.On(\"HandleLeaderElection\", evt).Return()\n\tsuite.Handler.HandleEvent(evt)\n\tsuite.Mocker.AssertCalled(suite.T(), \"HandleLeaderElection\", evt)\n}", "title": "" }, { "docid": "8e69eade3012e97b3786574f03f4597c", "score": "0.5048708", "text": "func TestPeerListnerGeneratesEventForForceShardFlushMsg(t *testing.T) {\n\t// create a DLT stack instance with registered app and initialized mocks\n\tstack, _, _, _ := initMocks()\n\n\t// build a mock peer\n\tmockConn := p2p.TestConn()\n\tpeer := NewMockPeer(mockConn)\n\n\t// setup mock connection to send a ForceShardFlushMsg followed by clean shutdown\n\tmockConn.NextMsg(ForceShardFlushMsgCode, &ForceShardFlushMsg{})\n\tmockConn.NextMsg(NodeShutdownMsgCode, &NodeShutdown{})\n\n\t// setup a test event listener\n\tevents := make(chan controllerEvent, 10)\n\tfinished := checkForEventCode(RECV_ForceShardFlushMsg, events)\n\n\t// now call stack's listener\n\tif err := stack.listener(peer, events); err != nil {\n\t\tt.Errorf(\"Transaction processing has errors: %s\", err)\n\t}\n\n\t// wait for event listener to process\n\tresult := <-finished\n\n\t// check if listener generate correct event\n\tif !result.seenMsgEvent {\n\t\tt.Errorf(\"Event listener did not generate RECV_ForceShardFlushMsg event!!!\")\n\t}\n}", "title": "" }, { "docid": "c3aeac614818c05006d023a8641823f7", "score": "0.5045047", "text": "func TestPeerListnerGeneratesEventForSubmitterWalkUpRequestMsg(t *testing.T) {\n\t// create a DLT stack instance with registered app and initialized mocks\n\tstack, _, _, _ := initMocks()\n\n\t// build a mock peer\n\tmockConn := p2p.TestConn()\n\tpeer := NewMockPeer(mockConn)\n\n\t// setup mock connection to send a SubmitterWalkUpRequestMsg followed by clean shutdown\n\tmockConn.NextMsg(SubmitterWalkUpRequestMsgCode, &SubmitterWalkUpRequestMsg{})\n\tmockConn.NextMsg(NodeShutdownMsgCode, &NodeShutdown{})\n\n\t// setup a test event listener\n\tevents := make(chan controllerEvent, 10)\n\tfinished := checkForEventCode(RECV_SubmitterWalkUpRequestMsg, events)\n\n\t// now call stack's listener\n\tif err := stack.listener(peer, events); err != nil {\n\t\tt.Errorf(\"Transaction processing has errors: %s\", err)\n\t}\n\n\t// wait for event listener to process\n\tresult := <-finished\n\n\t// check if listener generate correct event\n\tif !result.seenMsgEvent {\n\t\tt.Errorf(\"Event listener did not generate RECV_SubmitterWalkUpRequestMsg event!!!\")\n\t}\n}", "title": "" }, { "docid": "88c0a44a4f4c840df26c63d479fcd72b", "score": "0.50428736", "text": "func (m *MockOverlay) Tell(arg0 uint32, arg1 net.Addr, arg2 proto.Message) error {\n\tret := m.ctrl.Call(m, \"Tell\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "0de4815f7fbd6dcfab699f212c81e4ef", "score": "0.5039392", "text": "func (suite *EventHandlerTestSuite) TestQueryEvent() {\n\n\t// Create Query\n\tquery := serf.Query{\n\t\tLTime: serf.LamportTime(0),\n\t\tName: \"Event\",\n\t\tPayload: make([]byte, 0),\n\t}\n\n\t// Process event\n\tsuite.Mocker.On(\"HandleQueryEvent\", query).Return()\n\tsuite.Mocker.On(\"Reconcile\", query).Return()\n\tsuite.Handler.HandleEvent(&query)\n\tsuite.Mocker.AssertCalled(suite.T(), \"HandleQueryEvent\", query)\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"Reconcile\", query)\n}", "title": "" }, { "docid": "4708b62de6cae3a610deb8217ad6e989", "score": "0.50339985", "text": "func (m *MockIEventCalling) onCallingEventSendDigits(ctx context.Context, broadcast NotifParamsBladeBroadcast, rawEvent *json.RawMessage) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"onCallingEventSendDigits\", ctx, broadcast, rawEvent)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "bb3ffcb13d8b224cc158b01bb66dc4ee", "score": "0.50276005", "text": "func (m *MockRepository) CreateRoom() *model.Room {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateRoom\")\n\tret0, _ := ret[0].(*model.Room)\n\treturn ret0\n}", "title": "" }, { "docid": "b6640503ae555450eb5a0d360593b3e4", "score": "0.50149316", "text": "func TestRECV_SubmitterWalkUpResponseMsg_ContinueWalkUp(t *testing.T) {\n\t// create a DLT stack instance with registered app and initialized mocks\n\tstack, sharder, endorser, p2pLayer, testDb := initMocksAndDb()\n\n\t// setup DLT DB with submitter history using 1 shard/transaction pair for the submitter/seq\n\tsubmitter := []byte(\"a test submitter\")\n\tseq := uint64(0x21)\n\ttx1 := TestSignedTransaction(\"test payload1\")\n\ttx1.Request().SubmitterId = submitter\n\ttx1.Request().SubmitterSeq = seq\n\ttx1.Request().ShardId = []byte(\"shard 1\")\n\tif err := testDb.UpdateSubmitter(tx1); err != nil {\n\t\tt.Errorf(\"Failed to update submitter history for transaction 1: %s\", err)\n\t}\n\t// build another shard/transaction pair that is NOT in local DLT DB\n\ttx2 := TestSignedTransaction(\"test payload2\")\n\ttx2.Request().SubmitterId = submitter\n\ttx2.Request().SubmitterSeq = seq\n\ttx2.Request().ShardId = []byte(\"shard 2\")\n\n\t// build a SubmitterWalkUpResponseMsg that has above submitter/seq and both shard/transaction pairs\n\tmsg := &SubmitterWalkUpResponseMsg{\n\t\tSubmitter: submitter,\n\t\tSeq: seq,\n\t}\n\tmsg.Transactions = [][64]byte{tx1.Id(), tx2.Id()}\n\tmsg.Shards = [][]byte{tx1.Request().ShardId, tx2.Request().ShardId}\n\tp2pLayer.Reset()\n\tsharder.Reset()\n\tendorser.Reset()\n\ttestDb.Reset()\n\n\t// build a mock peer\n\tmockConn := p2p.TestConn()\n\tpeer := NewMockPeer(mockConn)\n\n\t// start stack's event listener\n\tevents := make(chan controllerEvent, 10)\n\tfinished := make(chan struct{}, 2)\n\tgo func() {\n\t\tstack.peerEventsListener(peer, events)\n\t\tfinished <- struct{}{}\n\t}()\n\n\t// now emit RECV_SubmitterWalkUpResponseMsg event providing history with one known and one unknown pair\n\tevents <- newControllerEvent(RECV_SubmitterWalkUpResponseMsg, msg)\n\tevents <- newControllerEvent(SHUTDOWN, nil)\n\n\t// wait for event listener to finish\n\t<-finished\n\n\t// check if event listener correctly processed the event to handle submitter's walk up request\n\n\t// verify that endorser gets called to fetch submitter's known shards/tx\n\tif !endorser.KnownShardsTxsCalled {\n\t\tt.Errorf(\"Endorser did not get called for submitter/seq history\")\n\t}\n\n\t// we should have continued walk up because of 1 unknown pair\n\t// we should have sent the submitter sync message\n\tif !peer.SendCalled {\n\t\tt.Errorf(\"did not send submitter sync message to peer\")\n\t} else if peer.SendMsgCode != SubmitterWalkUpRequestMsgCode {\n\t\tt.Errorf(\"Incorrect message code send: %d\", peer.SendMsgCode)\n\t} else if string(peer.SendMsg.(*SubmitterWalkUpRequestMsg).Submitter) != string(msg.Submitter) {\n\t\tt.Errorf(\"Incorrect SubmitterWalkUpRequestMsg Submitter: %s\", peer.SendMsg.(*SubmitterWalkUpRequestMsg).Submitter)\n\t} else if peer.SendMsg.(*SubmitterWalkUpRequestMsg).Seq != msg.Seq-1 {\n\t\tt.Errorf(\"Incorrect SubmitterWalkUpRequestMsg Sequence: %d\", peer.SendMsg.(*SubmitterWalkUpRequestMsg).Seq)\n\t}\n}", "title": "" }, { "docid": "b7de8a9ed44b494121a4ca1646320008", "score": "0.5011412", "text": "func TestPerfEvent_NewPlacements(t *testing.T) {\r\n\terrMock := fmt.Errorf(\"mock error\")\r\n\tmaxCPU := 12\r\n\tcpuPMU := uint32(4)\r\n\tcpuName := \"cpu\"\r\n\tcboxName := \"cbox\"\r\n\r\n\tmCorePMUTypes := []NamedPMUType{{Name: \"cpu\", PMUType: cpuPMU}}\r\n\tmUncorePMUTypes := []NamedPMUType{\r\n\t\t{Name: \"mcbox_1\", PMUType: 8},\r\n\t\t{Name: \"mcbox_2\", PMUType: 9},\r\n\t\t{Name: \"mcbox_3\", PMUType: 10},\r\n\t}\r\n\r\n\tmPerfEvent, _, mMonitor := newPerfEventForTest()\r\n\tcpus := []int{0, 2, 3, 4, 5}\r\n\r\n\tt.Run(\"missing cpu monitor\", func(t *testing.T) {\r\n\t\temptyPerfEvent := &PerfEvent{}\r\n\t\tpp, err := emptyPerfEvent.NewPlacements(\"\", cpus[0])\r\n\t\trequire.Error(t, err)\r\n\t\trequire.Nil(t, pp)\r\n\t})\r\n\r\n\tt.Run(\"cannot get max cpu number\", func(t *testing.T) {\r\n\t\tmPerfEvent.PMUTypes = mCorePMUTypes\r\n\t\tmPerfEvent.PMUName = cpuName\r\n\r\n\t\tmMonitor.On(\"cpusNum\").Return(-1, errMock).Once()\r\n\r\n\t\tpp, err := mPerfEvent.NewPlacements(cpuName, cpus[0])\r\n\t\trequire.Error(t, err)\r\n\t\trequire.Nil(t, pp)\r\n\t\tmMonitor.AssertExpectations(t)\r\n\t})\r\n\r\n\tt.Run(\"cpu exceeded\", func(t *testing.T) {\r\n\t\tmPerfEvent.PMUTypes = mCorePMUTypes\r\n\t\tmPerfEvent.PMUName = cpuName\r\n\r\n\t\tmMonitor.On(\"cpusNum\").Return(maxCPU, nil).Once()\r\n\r\n\t\tpp, err := mPerfEvent.NewPlacements(cpuName, maxCPU+1)\r\n\t\trequire.Error(t, err)\r\n\t\trequire.Nil(t, pp)\r\n\t\tmMonitor.AssertExpectations(t)\r\n\t})\r\n\r\n\tt.Run(\"pmu not available\", func(t *testing.T) {\r\n\t\tmPerfEvent.PMUTypes = mCorePMUTypes\r\n\t\tmPerfEvent.PMUName = cpuName\r\n\r\n\t\tpp, err := mPerfEvent.NewPlacements(cboxName, cpus[0])\r\n\t\trequire.Error(t, err)\r\n\t\trequire.Nil(t, pp)\r\n\t})\r\n\r\n\ttestCases := []struct {\r\n\t\tname string\r\n\t\teventPMUTypes []NamedPMUType\r\n\t\teventPMUName string\r\n\t\targPMUName string\r\n\t\targCPUs []int\r\n\t\tplcNumber int\r\n\t}{\r\n\t\t{\"specific pmu\", mUncorePMUTypes, cboxName, mUncorePMUTypes[0].Name, cpus, len(cpus)},\r\n\t\t{\"unit equal event pmu name\", mUncorePMUTypes, cboxName, cboxName, cpus, len(mUncorePMUTypes) * len(cpus)},\r\n\t\t{\"core cpu placement\", mCorePMUTypes, cpuName, cpuName, cpus, len(cpus)},\r\n\t\t{\"all pmus\", mUncorePMUTypes, cboxName, \"\", cpus, len(cpus) * len(mUncorePMUTypes)},\r\n\t}\r\n\tfor _, tt := range testCases {\r\n\t\tt.Run(tt.name, func(t *testing.T) {\r\n\t\t\tvar requiredPMUs []uint32\r\n\t\t\tfor _, p := range tt.eventPMUTypes {\r\n\t\t\t\trequiredPMUs = append(requiredPMUs, p.PMUType)\r\n\t\t\t}\r\n\t\t\tmPerfEvent.PMUTypes = tt.eventPMUTypes\r\n\t\t\tmPerfEvent.PMUName = tt.eventPMUName\r\n\r\n\t\t\tmMonitor.On(\"cpusNum\").Return(maxCPU, nil).Once()\r\n\r\n\t\t\tpp, err := mPerfEvent.NewPlacements(tt.argPMUName, tt.argCPUs[0], tt.argCPUs[1:]...)\r\n\r\n\t\t\trequire.NoError(t, err)\r\n\t\t\trequire.NotNil(t, pp)\r\n\t\t\trequire.Len(t, pp, tt.plcNumber)\r\n\t\t\tmMonitor.AssertExpectations(t)\r\n\r\n\t\t\tfor _, p := range pp {\r\n\t\t\t\tcpu, pmu := p.PMUPlacement()\r\n\t\t\t\trequire.Contains(t, cpus, cpu)\r\n\t\t\t\trequire.Contains(t, requiredPMUs, pmu)\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n}", "title": "" }, { "docid": "2f97be9941315a30771c5416a41e19bf", "score": "0.5003464", "text": "func (m *MockIEventCalling) onCallingEventRecord(ctx context.Context, broadcast NotifParamsBladeBroadcast, rawEvent *json.RawMessage) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"onCallingEventRecord\", ctx, broadcast, rawEvent)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "2b2d2351c9dc5c61104520e5cde2f991", "score": "0.500094", "text": "func (m *MockRuntimeServiceServer) PortForward(arg0 context.Context, arg1 *v1alpha2.PortForwardRequest) (*v1alpha2.PortForwardResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"PortForward\", arg0, arg1)\n\tret0, _ := ret[0].(*v1alpha2.PortForwardResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "a2943533583990d1269bc5be41e963d3", "score": "0.49946514", "text": "func TestMockEGenericTypeSetELowerBound(t *testing.T) {\n\to := &MockEGenericType{}\n\tv := new(MockEGenericType)\n\to.On(\"SetELowerBound\", v).Once()\n\to.SetELowerBound(v)\n\to.AssertExpectations(t)\n}", "title": "" }, { "docid": "845274280df3182ed5d70559b5210efb", "score": "0.49854177", "text": "func (m *MockIEventCalling) onCallingEventPlay(ctx context.Context, broadcast NotifParamsBladeBroadcast, rawEvent *json.RawMessage) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"onCallingEventPlay\", ctx, broadcast, rawEvent)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "6ff755862e0795b4677d46ce752d76d1", "score": "0.49794638", "text": "func (m *MockIEventCalling) onCallingEventState(ctx context.Context, broadcast NotifParamsBladeBroadcast) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"onCallingEventState\", ctx, broadcast)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "7065d1f7b3647f23fce2615f73a1bbeb", "score": "0.49770644", "text": "func (suite *EventHandlerTestSuite) TestNilEvent() {\n\n\t// Process event\n\tsuite.Handler.HandleEvent(nil)\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberJoin\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberLeave\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberFailure\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberUpdate\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberReap\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleUknownEvent\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleUserEvent\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleQueryEvent\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"Reconcile\")\n}", "title": "" }, { "docid": "5701b910263e306baf32cde50e44f3dd", "score": "0.49748728", "text": "func (_m *MockEventStore) WriteEvent(_a0 string, _a1 ...Event) error {\n\t_va := make([]interface{}, len(_a1))\n\tfor _i := range _a1 {\n\t\t_va[_i] = _a1[_i]\n\t}\n\tvar _ca []interface{}\n\t_ca = append(_ca, _a0)\n\t_ca = append(_ca, _va...)\n\tret := _m.Called(_ca...)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(string, ...Event) error); ok {\n\t\tr0 = rf(_a0, _a1...)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "86b5513449c284d18d67c5859e786460", "score": "0.4974577", "text": "func (m *MockInvariantRegistry) RegisterRoute(moduleName, route string, invar types.Invariant) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"RegisterRoute\", moduleName, route, invar)\n}", "title": "" }, { "docid": "86cc8bf34697d1ba3dc6dce9a77c64e5", "score": "0.49553627", "text": "func (m *MockRoom) EXPECT() *MockRoomMockRecorder {\n\treturn m.recorder\n}", "title": "" }, { "docid": "517ab354983b856d0cf3eaaf8ffdf188", "score": "0.49541214", "text": "func TestPeerListnerGeneratesEventForSubmitterWalkUpResponseMsg(t *testing.T) {\n\t// create a DLT stack instance with registered app and initialized mocks\n\tstack, _, _, _ := initMocks()\n\n\t// build a mock peer\n\tmockConn := p2p.TestConn()\n\tpeer := NewMockPeer(mockConn)\n\n\t// setup mock connection to send a SubmitterWalkUpRequestMsg followed by clean shutdown\n\tmockConn.NextMsg(SubmitterWalkUpResponseMsgCode, &SubmitterWalkUpResponseMsg{})\n\tmockConn.NextMsg(NodeShutdownMsgCode, &NodeShutdown{})\n\n\t// setup a test event listener\n\tevents := make(chan controllerEvent, 10)\n\tfinished := checkForEventCode(RECV_SubmitterWalkUpResponseMsg, events)\n\n\t// now call stack's listener\n\tif err := stack.listener(peer, events); err != nil {\n\t\tt.Errorf(\"Transaction processing has errors: %s\", err)\n\t}\n\n\t// wait for event listener to process\n\tresult := <-finished\n\n\t// check if listener generate correct event\n\tif !result.seenMsgEvent {\n\t\tt.Errorf(\"Event listener did not generate RECV_SubmitterWalkUpResponseMsg event!!!\")\n\t}\n}", "title": "" }, { "docid": "54086c93ddc33ab9a51e6524fb3e3bcb", "score": "0.4941015", "text": "func (m *MockIEventCalling) dispatchTapEventParams(ctx context.Context, callID, ctrlID string, params ParamsEventCallingCallTap) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"dispatchTapEventParams\", ctx, callID, ctrlID, params)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "19b1f5d80483c6ba116d1935c678c318", "score": "0.49407953", "text": "func TestRECV_SubmitterWalkUpResponseMsg_AllKnownPairs(t *testing.T) {\n\t// create a DLT stack instance with registered app and initialized mocks\n\tstack, sharder, endorser, p2pLayer, testDb := initMocksAndDb()\n\n\t// submit a transactions to add ancestor to local shard's Anchor\n\tsub := dto.TestSubmitter()\n\ttx, _ := stack.Submit(sub.NewRequest(\"test payload1\"))\n\tsub.LastTx = tx.Id()\n\tsub.Seq += 1\n\n\t// build a SubmitterWalkUpResponseMsg that has same submitter, seq, shard and transaction\n\tmsg := NewSubmitterWalkUpResponseMsg(NewSubmitterWalkUpRequestMsg(sub.NewRequest(\"dummy\")))\n\tmsg.Transactions = [][64]byte{tx.Id()}\n\tmsg.Shards = [][]byte{tx.Request().ShardId}\n\tp2pLayer.Reset()\n\tsharder.Reset()\n\tendorser.Reset()\n\ttestDb.Reset()\n\n\t// build a mock peer\n\tmockConn := p2p.TestConn()\n\tpeer := NewMockPeer(mockConn)\n\n\t// start stack's event listener\n\tevents := make(chan controllerEvent, 10)\n\tfinished := make(chan struct{}, 2)\n\tgo func() {\n\t\tstack.peerEventsListener(peer, events)\n\t\tfinished <- struct{}{}\n\t}()\n\n\t// now emit RECV_SubmitterWalkUpResponseMsg event providing history with known local history\n\tevents <- newControllerEvent(RECV_SubmitterWalkUpResponseMsg, msg)\n\tevents <- newControllerEvent(SHUTDOWN, nil)\n\n\t// wait for event listener to finish\n\t<-finished\n\n\t// check if event listener correctly processed the event to handle submitter's walk up request\n\n\t// verify that endorser gets called to fetch submitter's known shards/tx\n\tif !endorser.KnownShardsTxsCalled {\n\t\tt.Errorf(\"Endorser did not get called for submitter/seq history\")\n\t}\n\n\t// we should have transitioned to ProcessDownStage\n\t// we should have sent the SubmitterProcessDownRequestMsg message to fetch submitter's history for next sequence from peer\n\tif !peer.SendCalled {\n\t\tt.Errorf(\"did not send any message to peer\")\n\t} else if peer.SendMsgCode != SubmitterProcessDownRequestMsgCode {\n\t\tt.Errorf(\"Incorrect message code send: %d\", peer.SendMsgCode)\n\t} else if string(peer.SendMsg.(*SubmitterProcessDownRequestMsg).Submitter) != string(msg.Submitter) {\n\t\tt.Errorf(\"Incorrect submitter: %x\\nExpected: %x\", peer.SendMsg.(*SubmitterProcessDownRequestMsg).Submitter, msg.Submitter)\n\t} else if peer.SendMsg.(*SubmitterProcessDownRequestMsg).Seq != msg.Seq+1 {\n\t\tt.Errorf(\"Incorrect sequence: %d\\nExpected: %d\", peer.SendMsg.(*SubmitterProcessDownRequestMsg).Seq, msg.Seq+1)\n\t}\n}", "title": "" }, { "docid": "6c8e28df4d9b92c9958ad8e6fb6fe45b", "score": "0.49399477", "text": "func (m *MockIEvent) HandleEvent(event string, ctx iface.IContext, args ...interface{}) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{event, ctx}\n\tfor _, a := range args {\n\t\tvarargs = append(varargs, a)\n\t}\n\tm.ctrl.Call(m, \"HandleEvent\", varargs...)\n}", "title": "" }, { "docid": "caa4145f1683b840e1ea61d51668ea5b", "score": "0.49390197", "text": "func (mmProcessGameStartedEvent *mStaterMockProcessGameStartedEvent) Expect(msg string) *mStaterMockProcessGameStartedEvent {\n\tif mmProcessGameStartedEvent.mock.funcProcessGameStartedEvent != nil {\n\t\tmmProcessGameStartedEvent.mock.t.Fatalf(\"StaterMock.ProcessGameStartedEvent mock is already set by Set\")\n\t}\n\n\tif mmProcessGameStartedEvent.defaultExpectation == nil {\n\t\tmmProcessGameStartedEvent.defaultExpectation = &StaterMockProcessGameStartedEventExpectation{}\n\t}\n\n\tmmProcessGameStartedEvent.defaultExpectation.params = &StaterMockProcessGameStartedEventParams{msg}\n\tfor _, e := range mmProcessGameStartedEvent.expectations {\n\t\tif minimock.Equal(e.params, mmProcessGameStartedEvent.defaultExpectation.params) {\n\t\t\tmmProcessGameStartedEvent.mock.t.Fatalf(\"Expectation set by When has same params: %#v\", *mmProcessGameStartedEvent.defaultExpectation.params)\n\t\t}\n\t}\n\n\treturn mmProcessGameStartedEvent\n}", "title": "" }, { "docid": "60377df78572203f43c42078c828dc70", "score": "0.49366614", "text": "func (m *MockTxHandler) RegisterEvent(channel, ccName, event string) (<-chan *sdk.Event, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RegisterEvent\", channel, ccName, event)\n\tret0, _ := ret[0].(<-chan *sdk.Event)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "6f9ed59b78fc86d402b85c2274019b39", "score": "0.4933358", "text": "func (m *MockSender) SendHostEventAtTime(ctx context.Context, event HostEvent, eventTime time.Time) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"SendHostEventAtTime\", ctx, event, eventTime)\n}", "title": "" }, { "docid": "97a3e000070d5c1b12f1b5a79371a88d", "score": "0.49265793", "text": "func (m *MockCommandService) CreateRoom(arg0 context.Context, arg1 action.CreateRoom) (uint64, error) {\n\tret := m.ctrl.Call(m, \"CreateRoom\", arg0, arg1)\n\tret0, _ := ret[0].(uint64)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "d2d4c28b85316766994aae05434184ab", "score": "0.49194327", "text": "func TestEventsSkip(t *testing.T) {\n\tlogger := logger.WithContext(\"t_name\", t.Name())\n\teventsStorePath := filepath.Join(eventsDir, t.Name())\n\tdefer os.RemoveAll(eventsStorePath) // cleanup\n\n\t// create dispatcher\n\tdispatcher, err := NewDispatcher(t.Name(), dedupInterval, sendInterval, &events.StoreConfig{Dir: eventsStorePath},\n\t\tnil, logger)\n\tAssertOk(t, err, \"failed to create dispatcher\")\n\tdispatcher.Start()\n\tdefer dispatcher.Shutdown()\n\n\t// create and start exporter\n\tmockExporter := exporters.NewMockExporter(fmt.Sprintf(\"mock.%s\", t.Name()), exporterChLen, logger)\n\texporterEventCh, offsetTracker, err := dispatcher.RegisterExporter(mockExporter)\n\tAssertOk(t, err, \"failed to register mock exporter with the dispatcher\")\n\tmockExporter.Start(exporterEventCh, offsetTracker)\n\tdefer mockExporter.Stop()\n\tdefer dispatcher.UnregisterExporter(mockExporter.Name())\n\n\tevent := *dummyEvt\n\tcreationTime, _ := types.TimestampProto(time.Now())\n\tevent.CreationTime = api.Timestamp{Timestamp: *creationTime}\n\tdispatcher.Action(event)\n\tAssertEventually(t, func() (bool, interface{}) { // ensure the event is received at the exporter\n\t\tif mockExporter.GetTotalEvents() == 1 {\n\t\t\treturn true, nil\n\t\t}\n\t\treturn false, nil\n\t}, \"exporter did not receive event(s)\", string(\"10ms\"), string(\"2s\"))\n\n\t// send events with time backing to 2000's\n\tcreationTime, _ = types.TimestampProto(time.Date(2000, time.January, 2, 0, 0, 0, 0, time.UTC))\n\n\tevent = *dummyEvt\n\tevent.CreationTime = api.Timestamp{Timestamp: *creationTime}\n\tevent.Message = \"t1\"\n\tdispatcher.Action(event)\n\n\tevent = *dummyEvt\n\tevent.CreationTime = api.Timestamp{Timestamp: *creationTime}\n\tevent.Message = \"t2\"\n\tdispatcher.Action(event)\n\n\ttime.Sleep(2 * sendInterval)\n\tAssert(t, mockExporter.GetTotalEvents() == 1, \"expected event(s) are not skipped\")\n\n\tevent = *dummyEvt\n\tcreationTime, _ = types.TimestampProto(time.Now())\n\tevent.CreationTime = api.Timestamp{Timestamp: *creationTime}\n\tdispatcher.Action(event)\n\tAssertEventually(t, func() (bool, interface{}) { // ensure the event is received at the exporter\n\t\tif mockExporter.GetTotalEvents() == 2 {\n\t\t\treturn true, nil\n\t\t}\n\t\treturn false, nil\n\t}, \"exporter did not receive event(s)\", string(\"10ms\"), string(\"2s\"))\n}", "title": "" }, { "docid": "79df5224268d7387612f461d892bfff4", "score": "0.49086314", "text": "func (suite *EventHandlerTestSuite) TestNodeReaped() {\n\n\t// Create Member Event\n\tevt := serf.MemberEvent{\n\t\tserf.EventMemberReap,\n\t\t[]serf.Member{suite.Member},\n\t}\n\tnewMember := suite.Member\n\tnewMember.Status = StatusReap\n\n\t// Process event\n\tsuite.Mocker.On(\"HandleMemberReap\", evt).Return()\n\tsuite.Mocker.On(\"Reconcile\", newMember).Return()\n\tsuite.Handler.HandleEvent(evt)\n\tsuite.Mocker.AssertCalled(suite.T(), \"HandleMemberReap\", evt)\n\tsuite.Mocker.AssertCalled(suite.T(), \"Reconcile\", newMember)\n}", "title": "" }, { "docid": "d42fc275a807ea7738848e1969547379", "score": "0.49060416", "text": "func (m *MockPeerMessage) ImplementsPeerMessage() {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"ImplementsPeerMessage\")\n}", "title": "" }, { "docid": "eb9e99ece7547118ac0ed5ac9b00caef", "score": "0.4905817", "text": "func (m *MockCharacter) Response(other objects.GameObject) {\n\tm.ctrl.Call(m, \"Response\", other)\n}", "title": "" }, { "docid": "d66abab54bee3846c1570a6e6878ba8e", "score": "0.49047983", "text": "func TestSimpleRouting(t *testing.T) {\n\teventsReceived := make(chan *Event)\n\ttestHandler := func(event *Event, apiClient *client.RancherClient) error {\n\t\teventsReceived <- event\n\t\treturn nil\n\t}\n\n\teventHandlers := map[string]EventHandler{\"physicalhost.create\": testHandler}\n\trouter := newRouter(eventHandlers, 3, t, DefaultPingConfig)\n\tready := make(chan bool, 1)\n\tgo router.Start(ready)\n\tdefer router.Stop()\n\tdefer tu.ResetTestServer()\n\t// Wait for start to be ready\n\t<-ready\n\n\tpreCount := 0\n\tpre := func(event *Event) {\n\t\tevent.ID = strconv.Itoa(preCount)\n\t\tevent.ResourceID = strconv.FormatInt(time.Now().UnixNano(), 10)\n\t\tpreCount++\n\t\tevent.Name = \"physicalhost.create;handler=testRouter\"\n\t}\n\n\t// Push 3 events\n\tfor i := 0; i < 3; i++ {\n\t\terr := prepAndPostEvent(\"../testutils/resources/machine_create_event.json\", pre)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\treceivedEvents := map[string]*Event{}\n\tfor i := 0; i < 3; i++ {\n\t\treceivedEvent := awaitEvent(eventsReceived, 100, t)\n\t\tif receivedEvent != nil {\n\t\t\treceivedEvents[receivedEvent.ID] = receivedEvent\n\t\t}\n\t}\n\n\tfor i := 0; i < 3; i++ {\n\t\tif _, ok := receivedEvents[strconv.Itoa(i)]; !ok {\n\t\t\tt.Errorf(\"Didn't get event %v\", i)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b47fe9f6404b89ffed11c2ad3fcf1a35", "score": "0.4899057", "text": "func (m *MockStreamer) OnRequest(s network.Stream) (bool, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"OnRequest\", s)\n\tret0, _ := ret[0].(bool)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "2dc52b62fea292a4acfcd75b9f7e95eb", "score": "0.48974586", "text": "func (m *MockUpWrapper) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*websocket.Conn, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Upgrade\", w, r, responseHeader)\n\tret0, _ := ret[0].(*websocket.Conn)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "a1005fe4aefd56e85f604052b7bf0196", "score": "0.4892708", "text": "func (m *MockHost) SendMessage(arg0 p2p.Peer, arg1 []byte) error {\n\tret := m.ctrl.Call(m, \"SendMessage\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "0568863308e6d1b26ae0ca14ee797d7b", "score": "0.48916852", "text": "func (_m *ClientInterface) Event(e *statsd.Event) error {\n\tret := _m.Called(e)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*statsd.Event) error); ok {\n\t\tr0 = rf(e)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "ae34435bc1e5ed5557dd600b80f3cff6", "score": "0.48843607", "text": "func (m *MockIEventCalling) dispatchRecordEventParams(ctx context.Context, callID, ctrlID string, params ParamsEventCallingCallRecord) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"dispatchRecordEventParams\", ctx, callID, ctrlID, params)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "4dd5b0994cd3a38b735ff7f13589e0c0", "score": "0.4875675", "text": "func TestEventsDispatcher(t *testing.T) {\n\tlogger := logger.WithContext(\"t_name\", t.Name())\n\teventsStorePath := filepath.Join(eventsDir, t.Name())\n\tdefer os.RemoveAll(eventsStorePath) // cleanup\n\n\t// create dispatcher\n\tdispatcher, err := NewDispatcher(t.Name(), dedupInterval, sendInterval, &events.StoreConfig{Dir: eventsStorePath},\n\t\tnil, logger)\n\tAssertOk(t, err, \"failed to create dispatcher\")\n\tdispatcher.Start()\n\tdispatcher.Start() // start the dispatcher again; NO-OP\n\tdefer dispatcher.Shutdown()\n\n\t// create and start exporter\n\tmockExporter := exporters.NewMockExporter(fmt.Sprintf(\"mock.%s\", t.Name()), exporterChLen, logger)\n\texporterEventCh, offsetTracker, err := dispatcher.RegisterExporter(mockExporter)\n\tAssertOk(t, err, \"failed to register mock exporter with the dispatcher\")\n\tmockExporter.Start(exporterEventCh, offsetTracker)\n\tdefer mockExporter.Stop()\n\tdefer dispatcher.UnregisterExporter(mockExporter.Name())\n\n\t// copy event and set type\n\tevent := *dummyEvt\n\tNICDisconnectedEvtUUID := uuid.New().String()\n\tNICDisconnectedEvt := *(&event)\n\tNICDisconnectedEvt.EventAttributes.Type = \"TestNICDisconnected\"\n\tNICDisconnectedEvt.ObjectMeta.UUID = NICDisconnectedEvtUUID\n\n\tNICConnectedEvtUUID := uuid.New().String()\n\tNICConnectedEvt := *(&event)\n\tNICConnectedEvt.EventAttributes.Type = \"TestNICConnected\"\n\tNICConnectedEvt.ObjectMeta.UUID = NICConnectedEvtUUID\n\n\t// run multiple iterations\n\titerations := 10\n\tfor i := 0; i < iterations; i++ {\n\t\tfor i := 0; i < 10; i++ { // all events will be de-duped under the first (1st occurrence of an event in dedup interval) UUID\n\t\t\tcreationTime, _ := types.TimestampProto(time.Now())\n\t\t\ttimeNow := api.Timestamp{Timestamp: *creationTime}\n\t\t\tNICDisconnectedEvt.ObjectMeta.CreationTime = timeNow\n\t\t\tNICDisconnectedEvt.ObjectMeta.ModTime = timeNow\n\n\t\t\tNICConnectedEvt.ObjectMeta.CreationTime = timeNow\n\t\t\tNICConnectedEvt.ObjectMeta.ModTime = timeNow\n\n\t\t\tAssertOk(t, dispatcher.Action(NICDisconnectedEvt), \"failed to send event\")\n\t\t\tAssertOk(t, dispatcher.Action(NICConnectedEvt), \"failed to send event\")\n\n\t\t\t// keep updating uuid to make sure they're deduped under the first occurrence\n\t\t\tNICDisconnectedEvt.ObjectMeta.UUID = uuid.New().String()\n\t\t\tNICConnectedEvt.ObjectMeta.UUID = uuid.New().String()\n\t\t}\n\t}\n\n\t// ensure the exporter received all the events that're sent\n\ttotalEvents := iterations * 10 // 10 iterations sent 10 events each\n\n\tAssertEventually(t, func() (bool, interface{}) {\n\t\tdisconnected := mockExporter.GetEventsByType(\"TestNICDisconnected\")\n\t\tconnected := mockExporter.GetEventsByType(\"TestNICConnected\")\n\t\tif totalEvents == disconnected && totalEvents == connected {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, fmt.Sprintf(\"expected: %d events, got: (TestNICDisconnected %d + TestNICConnected %d)\\n\",\n\t\t\ttotalEvents*2, disconnected, connected)\n\t}, \"unexpected number of events\", string(\"5ms\"), string(\"5s\"))\n\n\t// send an event with missing attributes\n\tincomEvent := *(&event)\n\tincomEvent.ObjectMeta.Name = \"empty severity\"\n\tincomEvent.EventAttributes.Severity = \"\"\n\terr = dispatcher.Action(incomEvent)\n\tAssert(t, events.IsMissingEventAttributes(err), \"expected failure, should not accept incomplete event\")\n\n\tdispatcher.Shutdown()\n\n\t// sending events after shutdown should fail\n\ttestEvt := *(&event)\n\ttestEvt.EventAttributes.Type = \"Test\"\n\terr = dispatcher.Action(testEvt)\n\tAssert(t, strings.Contains(err.Error(), \"dispatcher stopped, cannot process events\"),\n\t\t\"expected failure\")\n\n\t// ensure the events are de-duped\n\tAssertEventually(t, func() (bool, interface{}) {\n\t\tdisconnectedEvt := mockExporter.GetEventByUUID(NICDisconnectedEvtUUID)\n\t\tconnectedEvt := mockExporter.GetEventByUUID(NICConnectedEvtUUID)\n\t\tif disconnectedEvt == nil || connectedEvt == nil {\n\t\t\treturn false, fmt.Sprintf(\"something wrong, couldn't find the expected event\")\n\t\t}\n\n\t\tif disconnectedEvt.GetCount() > 1 && connectedEvt.GetCount() > 1 {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, nil\n\t}, \"events are not deduped\", string(\"5ms\"), string(\"5s\"))\n}", "title": "" }, { "docid": "aa7507945ab8c461c0c8fb09624b876e", "score": "0.48673955", "text": "func TestSend(t *testing.T) {\n\tmessage := new(Message)\n\tmessage.Chat.ID = 42\n\n\tapi := new(MockAPI)\n\tansweredMessage := new(Message)\n\tapi.Mock.\n\t\tOn(\"SendMessage\", &SendMessage{ChatID: 42, Text: \"potato\"}).\n\t\tReturn(answeredMessage, nil)\n\n\tanswer := AnswerBack{message, api}\n\tanswer.Send(\"potato\")\n\n\tapi.AssertExpectations(t)\n}", "title": "" }, { "docid": "58ff53a35bb30c6b7c80d3aaa92e3730", "score": "0.48646465", "text": "func (m *MockService) AddBuiltinUpstream(arg0 apps.AppID, arg1 upstream.Upstream) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"AddBuiltinUpstream\", arg0, arg1)\n}", "title": "" }, { "docid": "daf3700cd9cfdd460ac743e100b0566e", "score": "0.48612094", "text": "func TestEventsDispatcherFlush(t *testing.T) {\n\tlogger := logger.WithContext(\"t_name\", t.Name())\n\teventsStorePath := filepath.Join(eventsDir, t.Name())\n\tdefer os.RemoveAll(eventsStorePath) // cleanup\n\n\t// large value to make sure the interval does not kick in before the flush;\n\t// it is possible that events could be flushed before hitting the batch interval if there is a file rotation.\n\tinterval := 5 * time.Second\n\n\tdispatcher, err := NewDispatcher(t.Name(), 10*time.Second, interval, &events.StoreConfig{Dir: eventsStorePath},\n\t\tnil, logger)\n\tAssertOk(t, err, \"failed to create dispatcher\")\n\tdispatcher.Start()\n\tdefer dispatcher.Shutdown()\n\n\t// create and start exporter\n\tmockExporter := exporters.NewMockExporter(fmt.Sprintf(\"mock.%s\", t.Name()), exporterChLen, logger)\n\texporterEventCh, offsetTracker, err := dispatcher.RegisterExporter(mockExporter)\n\tAssertOk(t, err, \"failed to register mock exporter with the dispatcher\")\n\tmockExporter.Start(exporterEventCh, offsetTracker)\n\tdefer mockExporter.Stop()\n\tdefer dispatcher.UnregisterExporter(mockExporter.Name())\n\n\t// copy event and set type\n\tevent := *dummyEvt\n\tNICDisconnectedEvt := *(&event)\n\tNICDisconnectedEvt.EventAttributes.Type = \"TestNICDisconnected\"\n\tNICDisconnectedEvt.ObjectMeta.UUID = uuid.New().String()\n\n\tNICConnectedEvt := *(&event)\n\tNICConnectedEvt.EventAttributes.Type = \"TestNICConnected\"\n\tNICConnectedEvt.ObjectMeta.UUID = uuid.New().String()\n\n\t// send events\n\tfor i := 0; i < 100; i++ {\n\t\tcreationTime, _ := types.TimestampProto(time.Now())\n\t\ttimeNow := api.Timestamp{Timestamp: *creationTime}\n\n\t\tNICDisconnectedEvt.ObjectMeta.CreationTime = timeNow\n\t\tNICDisconnectedEvt.ObjectMeta.ModTime = timeNow\n\n\t\tNICConnectedEvt.ObjectMeta.CreationTime = timeNow\n\t\tNICConnectedEvt.ObjectMeta.ModTime = timeNow\n\n\t\tAssertOk(t, dispatcher.Action(NICDisconnectedEvt), \"failed to send event\")\n\t\tAssertOk(t, dispatcher.Action(NICConnectedEvt), \"failed to send event\")\n\t}\n\n\t// exporter would have not received any de-duped event because the batch internal is not hit\n\ttemp := mockExporter.GetEventsByType(\"TestNICConnected\")\n\tAssert(t, temp < 100, \"expected: <100 events, got:%v\", temp)\n\n\ttemp = mockExporter.GetEventsByType(\"TestNICDisconnected\")\n\tAssert(t, temp < 100, \"expected: <100 events, got:%v\", temp)\n\n\t// deduped events from the dispatcher will be flushed to all the exporters\n\tdispatcher.Shutdown()\n\n\t// exporter would have not received any de-duped event because the batch internal is not hit\n\tAssertEventually(t, func() (bool, interface{}) {\n\t\tdisconnected := mockExporter.GetEventsByType(\"TestNICDisconnected\")\n\t\tconnected := mockExporter.GetEventsByType(\"TestNICConnected\")\n\n\t\tif disconnected == 100 && connected == 100 {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, fmt.Sprintf(\"expected 100 events for each type, got: (TestNICDisconnected %d, TestNICConnected %d)\",\n\t\t\tdisconnected, connected)\n\t}, \"exporter did not receive all the events or flush operation failed\", string(\"5ms\"), string(\"5s\"))\n\n\t// thus the exporters received the events before the dispatcher could hit batch interval\n}", "title": "" }, { "docid": "01afd74fdee013769746cdb0c967bdd2", "score": "0.4850716", "text": "func EventBusCommonTests(t *testing.T, bus1, bus2 eh.EventBus) {\n\tobserver1 := mocks.NewEventObserver()\n\tbus1.AddObserver(observer1)\n\n\tobserver2 := mocks.NewEventObserver()\n\tbus2.AddObserver(observer2)\n\n\tctx := mocks.WithContextOne(context.Background(), \"testval\")\n\n\tt.Log(\"publish event without handler\")\n\tid, _ := eh.ParseUUID(\"c1138e5f-f6fb-4dd0-8e79-255c6c8d3756\")\n\tevent1 := eh.NewEventForAggregate(mocks.EventType, &mocks.EventData{\"event1\"},\n\t\tmocks.AggregateType, id, 1)\n\tbus1.PublishEvent(ctx, event1)\n\texpectedEvents := []eh.Event{event1}\n\tobserver1.WaitForEvent(t)\n\tfor i, event := range observer1.Events {\n\t\tif err := mocks.CompareEvents(event, expectedEvents[i]); err != nil {\n\t\t\tt.Error(\"the event was incorrect:\", err)\n\t\t}\n\t}\n\tif val, ok := mocks.ContextOne(observer1.Context); !ok || val != \"testval\" {\n\t\tt.Error(\"the context should be correct:\", observer1.Context)\n\t}\n\tobserver2.WaitForEvent(t)\n\tfor i, event := range observer2.Events {\n\t\tif err := mocks.CompareEvents(event, expectedEvents[i]); err != nil {\n\t\t\tt.Error(\"the event was incorrect:\", err)\n\t\t}\n\t}\n\tif val, ok := mocks.ContextOne(observer2.Context); !ok || val != \"testval\" {\n\t\tt.Error(\"the context should be correct:\", observer2.Context)\n\t}\n\n\tt.Log(\"publish event\")\n\thandler := mocks.NewEventHandler(\"testHandler\")\n\tbus1.AddHandler(handler, mocks.EventType)\n\tbus1.PublishEvent(ctx, event1)\n\thandler.WaitForEvent(t)\n\texpectedEvents = []eh.Event{event1}\n\tfor i, event := range handler.Events {\n\t\tif err := mocks.CompareEvents(event, expectedEvents[i]); err != nil {\n\t\t\tt.Error(\"the event was incorrect:\", i, err)\n\t\t\tt.Log(observer2.Events)\n\t\t}\n\t}\n\tif val, ok := mocks.ContextOne(handler.Context); !ok || val != \"testval\" {\n\t\tt.Error(\"the context should be correct:\", handler.Context)\n\t}\n\texpectedEvents = []eh.Event{event1, event1}\n\tobserver1.WaitForEvent(t)\n\tfor i, event := range observer1.Events {\n\t\tif err := mocks.CompareEvents(event, expectedEvents[i]); err != nil {\n\t\t\tt.Error(\"the event was incorrect:\", i, err)\n\t\t\tt.Log(observer2.Events)\n\t\t}\n\t}\n\tif val, ok := mocks.ContextOne(observer1.Context); !ok || val != \"testval\" {\n\t\tt.Error(\"the context should be correct:\", observer1.Context)\n\t}\n\tobserver2.WaitForEvent(t)\n\tfor i, event := range observer2.Events {\n\t\tif err := mocks.CompareEvents(event, expectedEvents[i]); err != nil {\n\t\t\tt.Error(\"the event was incorrect:\", i, err)\n\t\t\tt.Log(observer2.Events)\n\t\t}\n\t}\n\tif val, ok := mocks.ContextOne(observer2.Context); !ok || val != \"testval\" {\n\t\tt.Error(\"the context should be correct:\", observer2.Context)\n\t}\n\n\tt.Log(\"publish another event\")\n\tbus1.AddHandler(handler, mocks.EventOtherType)\n\tevent2 := eh.NewEventForAggregate(mocks.EventOtherType, nil,\n\t\tmocks.AggregateType, id, 2)\n\tbus1.PublishEvent(ctx, event2)\n\thandler.WaitForEvent(t)\n\texpectedEvents = []eh.Event{event1, event2}\n\tfor i, event := range handler.Events {\n\t\tif err := mocks.CompareEvents(event, expectedEvents[i]); err != nil {\n\t\t\tt.Error(\"the event was incorrect:\", i, err)\n\t\t\tt.Log(observer2.Events)\n\t\t}\n\t}\n\tif val, ok := mocks.ContextOne(handler.Context); !ok || val != \"testval\" {\n\t\tt.Error(\"the context should be correct:\", handler.Context)\n\t}\n\texpectedEvents = []eh.Event{event1, event1, event2}\n\tobserver1.WaitForEvent(t)\n\tfor i, event := range observer1.Events {\n\t\tif err := mocks.CompareEvents(event, expectedEvents[i]); err != nil {\n\t\t\tt.Error(\"the event was incorrect:\", i, err)\n\t\t\tt.Log(observer2.Events)\n\t\t}\n\t}\n\tif val, ok := mocks.ContextOne(observer1.Context); !ok || val != \"testval\" {\n\t\tt.Error(\"the context should be correct:\", observer1.Context)\n\t}\n\tobserver2.WaitForEvent(t)\n\tfor i, event := range observer2.Events {\n\t\tif err := mocks.CompareEvents(event, expectedEvents[i]); err != nil {\n\t\t\tt.Error(\"the event was incorrect:\", i, err)\n\t\t\tt.Log(observer2.Events)\n\t\t}\n\t}\n\tif val, ok := mocks.ContextOne(observer2.Context); !ok || val != \"testval\" {\n\t\tt.Error(\"the context should be correct:\", observer2.Context)\n\t}\n}", "title": "" }, { "docid": "cd7ee32f8857759f2db901b5f1d30fd8", "score": "0.48463503", "text": "func (m *MockPeerMessage) ImplementsReplicaMessage() {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"ImplementsReplicaMessage\")\n}", "title": "" }, { "docid": "45453e4ef422f10d86174d03ecc8479d", "score": "0.48404613", "text": "func (suite *EventHandlerTestSuite) TestUserEvent() {\n\n\t// Create Member Event\n\tevt := serf.UserEvent{\n\t\tLTime: serf.LamportTime(0),\n\t\tName: suite.Prefix + \":user-event\",\n\t\tPayload: make([]byte, 0),\n\t\tCoalesce: false,\n\t}\n\tmodified := evt\n\tmodified.Name = \"user-event\"\n\n\t// Process event\n\tsuite.Mocker.On(\"HandleUserEvent\", modified).Return()\n\tsuite.Handler.HandleEvent(evt)\n\tsuite.Mocker.AssertCalled(suite.T(), \"HandleUserEvent\", modified)\n}", "title": "" }, { "docid": "212ae3de2ea2bc51a1e853f2a36ea486", "score": "0.4837043", "text": "func (m *MockEvent) OccurredOn() time.Time {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"OccurredOn\")\n\tret0, _ := ret[0].(time.Time)\n\treturn ret0\n}", "title": "" }, { "docid": "2e0ebcf1f412e9e6c4bbec22a16dba68", "score": "0.48339716", "text": "func (m *MockCharacter) Interact(other objects.GameObject) {\n\tm.ctrl.Call(m, \"Interact\", other)\n}", "title": "" }, { "docid": "f3726656a5843daf33c550ee548c5033", "score": "0.48273957", "text": "func (suite *EventHandlerTestSuite) TestUserEvent_UnknownEvent() {\n\n\t// Create Member Event\n\tevt := serf.UserEvent{\n\t\tLTime: serf.LamportTime(0),\n\t\tName: \"unk\",\n\t\tPayload: make([]byte, 0),\n\t\tCoalesce: false,\n\t}\n\n\t// Process event\n\tsuite.Mocker.On(\"HandleUnknownEvent\", evt).Return()\n\tsuite.Handler.HandleEvent(evt)\n\tsuite.Mocker.AssertCalled(suite.T(), \"HandleUnknownEvent\", evt)\n}", "title": "" }, { "docid": "892e7e883d2dda6bba18b63d0bf9cc91", "score": "0.48266694", "text": "func (c *Client) ExpectMemoryEvent(t *testing.T) *dap.MemoryEvent {\n\tt.Helper()\n\tm := c.ExpectMessage(t)\n\treturn c.CheckMemoryEvent(t, m)\n}", "title": "" }, { "docid": "d892d150437155be92c4657b3d9f94a9", "score": "0.4820442", "text": "func (m *MockConsensus) OnNewView(arg0 hotstuff.NewView) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"OnNewView\", arg0)\n}", "title": "" }, { "docid": "4be9cd2a294a4f302868148427028ef2", "score": "0.4809859", "text": "func (m *MockK8SClient) CreateEvent(namespace, name, message, component string) (*v11.Event, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateEvent\", namespace, name, message, component)\n\tret0, _ := ret[0].(*v11.Event)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "a6ad6210d35fa43089299ed4744a89fb", "score": "0.4808063", "text": "func (m *MockGameState) TryMove(obj objects.MovableObject, direction geom.Direction) {\n\tm.ctrl.Call(m, \"TryMove\", obj, direction)\n}", "title": "" }, { "docid": "4d00ed9215262e130255d14ead89cc19", "score": "0.48074478", "text": "func (m *MockCommandService) AddRoomMember(arg0 context.Context, arg1 action.AddRoomMember) (*result.AddRoomMember, error) {\n\tret := m.ctrl.Call(m, \"AddRoomMember\", arg0, arg1)\n\tret0, _ := ret[0].(*result.AddRoomMember)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "10c45767b8a0043864336c256ed4cb21", "score": "0.4791908", "text": "func TestRECV_SubmitterWalkUpRequestMsg_HasEntry(t *testing.T) {\n\t// create a DLT stack instance with registered app and initialized mocks\n\tstack, sharder, endorser, p2pLayer, testDb := initMocksAndDb()\n\n\t// submit a transactions to add one ancestor to local submitter history\n\tsubmitter := dto.TestSubmitter()\n\ttx, _ := stack.Submit(submitter.NewRequest(\"test payload1\"))\n\tsubmitter.LastTx = tx.Id()\n\tsubmitter.Seq += 1\n\n\tp2pLayer.Reset()\n\tsharder.Reset()\n\tendorser.Reset()\n\ttestDb.Reset()\n\n\t// build a mock peer\n\tmockConn := p2p.TestConn()\n\tpeer := NewMockPeer(mockConn)\n\n\t// start stack's event listener\n\tevents := make(chan controllerEvent, 10)\n\tfinished := make(chan struct{}, 2)\n\tgo func() {\n\t\tstack.peerEventsListener(peer, events)\n\t\tfinished <- struct{}{}\n\t}()\n\n\t// now emit RECV_SubmitterWalkUpRequestMsg event requesting history using submitter's request from transaction\n\treq := NewSubmitterWalkUpRequestMsg(submitter.NewRequest(\"dummy\"))\n\tevents <- newControllerEvent(RECV_SubmitterWalkUpRequestMsg, req)\n\tevents <- newControllerEvent(SHUTDOWN, nil)\n\n\t// wait for event listener to finish\n\t<-finished\n\n\t// check if event listener correctly processed the event to handle submitter's walk up request\n\n\t// verify that endorser gets called to fetch submitter's known shards/tx\n\tif !endorser.KnownShardsTxsCalled {\n\t\tt.Errorf(\"Endorser did not get called for submitter/seq history\")\n\t}\n\n\t// we should have sent the SubmitterWalkUpResponseMsg back with correct transaction/shard from submitter/seq history\n\tif !peer.SendCalled {\n\t\tt.Errorf(\"did not send any message to peer\")\n\t} else if peer.SendMsgCode != SubmitterWalkUpResponseMsgCode {\n\t\tt.Errorf(\"Incorrect message code send: %d\", peer.SendMsgCode)\n\t} else if string(peer.SendMsg.(*SubmitterWalkUpResponseMsg).Submitter) != string(req.Submitter) {\n\t\tt.Errorf(\"Incorrect response submitter: %x\\nExpected: %x\", peer.SendMsg.(*SubmitterWalkUpResponseMsg).Submitter, req.Submitter)\n\t} else if peer.SendMsg.(*SubmitterWalkUpResponseMsg).Seq != req.Seq {\n\t\tt.Errorf(\"Incorrect response sequence: %x\\nExpected: %x\", peer.SendMsg.(*SubmitterWalkUpResponseMsg).Seq, req.Seq)\n\t} else if len(peer.SendMsg.(*SubmitterWalkUpResponseMsg).Transactions) != 1 {\n\t\tt.Errorf(\"Incorrect number of transactions: %d\", len(peer.SendMsg.(*SubmitterWalkUpResponseMsg).Transactions))\n\t} else if len(peer.SendMsg.(*SubmitterWalkUpResponseMsg).Shards) != 1 {\n\t\tt.Errorf(\"Incorrect number of shards: %d\", len(peer.SendMsg.(*SubmitterWalkUpResponseMsg).Shards))\n\t} else if peer.SendMsg.(*SubmitterWalkUpResponseMsg).Transactions[0] != tx.Id() {\n\t\tt.Errorf(\"Incorrect transaction in response: %x\\nExpected: %x\", peer.SendMsg.(*SubmitterWalkUpResponseMsg).Transactions[0], tx.Id())\n\t} else if string(peer.SendMsg.(*SubmitterWalkUpResponseMsg).Shards[0]) != string(tx.Request().ShardId) {\n\t\tt.Errorf(\"Incorrect shard in response: %x\\nExpected: %x\", peer.SendMsg.(*SubmitterWalkUpResponseMsg).Shards[0], tx.Request().ShardId)\n\t}\n}", "title": "" }, { "docid": "8f01a69e819521a1c7e8d7ffa7b29e88", "score": "0.47904685", "text": "func (suite *EventHandlerTestSuite) TestUnknownEvent() {\n\n\t// Process event\n\tt1 := &MockEvent{Name: \"UnknownType\", Type: serf.EventType(-1)}\n\tt1.On(\"EventType\").Return()\n\tsuite.Handler.HandleEvent(t1)\n\n\t// Test Assertions\n\tt1.AssertCalled(suite.T(), \"EventType\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberJoin\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberLeave\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberFailure\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberUpdate\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleMemberReap\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleUknownEvent\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleUserEvent\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"HandleQueryEvent\")\n\tsuite.Mocker.AssertNotCalled(suite.T(), \"Reconcile\")\n}", "title": "" }, { "docid": "5ba3f23094a1d4e802e66a823f763e93", "score": "0.47891188", "text": "func (m *MockReplicaMessage) ImplementsReplicaMessage() {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"ImplementsReplicaMessage\")\n}", "title": "" }, { "docid": "c53182c9b2588a0db3328fd8dec0fb06", "score": "0.47877803", "text": "func TestRECV_SubmitterWalkUpResponseMsg_ZeroPairsNonZeroSeq(t *testing.T) {\n\t// create a DLT stack instance with registered app and initialized mocks\n\tstack, sharder, endorser, p2pLayer, testDb := initMocksAndDb()\n\n\t// setup DLT DB with submitter history using 1 shard/transaction pair for the submitter/seq\n\tsubmitter := []byte(\"a test submitter\")\n\tseq := uint64(0x21)\n\ttx1 := TestSignedTransaction(\"test payload1\")\n\ttx1.Request().SubmitterId = submitter\n\ttx1.Request().SubmitterSeq = seq\n\ttx1.Request().ShardId = []byte(\"shard 1\")\n\tif err := testDb.UpdateSubmitter(tx1); err != nil {\n\t\tt.Errorf(\"Failed to update submitter history for transaction 1: %s\", err)\n\t}\n\t// build a SubmitterWalkUpResponseMsg that has above submitter/seq bot no shard/transaction pairs\n\tmsg := &SubmitterWalkUpResponseMsg{\n\t\tSubmitter: submitter,\n\t\tSeq: tx1.Request().SubmitterSeq,\n\t}\n\tmsg.Transactions = [][64]byte{}\n\tmsg.Shards = [][]byte{}\n\tp2pLayer.Reset()\n\tsharder.Reset()\n\tendorser.Reset()\n\ttestDb.Reset()\n\n\t// build a mock peer\n\tmockConn := p2p.TestConn()\n\tpeer := NewMockPeer(mockConn)\n\n\t// start stack's event listener\n\tevents := make(chan controllerEvent, 10)\n\tfinished := make(chan struct{}, 2)\n\tgo func() {\n\t\tstack.peerEventsListener(peer, events)\n\t\tfinished <- struct{}{}\n\t}()\n\n\t// now emit RECV_SubmitterWalkUpResponseMsg event providing history with one known and one unknown pair\n\tevents <- newControllerEvent(RECV_SubmitterWalkUpResponseMsg, msg)\n\tevents <- newControllerEvent(SHUTDOWN, nil)\n\n\t// wait for event listener to finish\n\t<-finished\n\n\t// check if event listener correctly processed the event to handle submitter's walk up request\n\n\t// verify that endorser did not get called to fetch submitter's known shards/tx\n\tif endorser.KnownShardsTxsCalled {\n\t\tt.Errorf(\"Endorser should not get called for invalid submitter/seq history\")\n\t}\n\n\t// since we recieved 0 pairs for a seq that is non zero -- this is an error, peer sent us a shard/transaction for submitter\n\t// but has no previous history for that submitter's earlier sequences\n\n\t// we should have disconnected with peer\n\tif !peer.DisconnectCalled {\n\t\tt.Errorf(\"did not disconncect with peer\")\n\t}\n}", "title": "" }, { "docid": "cb16a4ea9a400a6da9bdc4a658523382", "score": "0.47832868", "text": "func (m *MockFeedServiceServer) HandleEvent(arg0 context.Context, arg1 *event.EventMsg) (*event.EventResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"HandleEvent\", arg0, arg1)\n\tret0, _ := ret[0].(*event.EventResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "9510efd4ff92dca2fbbf92e016f0faca", "score": "0.4780859", "text": "func (m *MockCommand) UpdateAppEvent(app_id, repo, tag, event string) error {\n\tret := m.ctrl.Call(m, \"UpdateAppEvent\", app_id, repo, tag, event)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "f6e3d9b27ef62ed1433fefd0e81003a0", "score": "0.4779624", "text": "func (m *MockRouteGuide_RecordRouteClient) Send(arg0 *routeguide.Point) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Send\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "f2d53f66c0ddb823a8900351553edf68", "score": "0.47770646", "text": "func (m *MockMeshNetworkingSnapshotListener) Sync(arg0 context.Context, arg1 *snapshot.MeshNetworkingSnapshot) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"Sync\", arg0, arg1)\n}", "title": "" }, { "docid": "ae5235be0e8bb98d71cf19858153a520", "score": "0.4775666", "text": "func (m *MockAppmeshClient) EnsureRoute(route *appmesh.RouteData) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"EnsureRoute\", route)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "1c4ed87000f072de808ae771369ec8f8", "score": "0.47605258", "text": "func (m *MockIEventCalling) dispatchSendDigitsState(ctx context.Context, callID, ctrlID string, sendDigitsState SendDigitsState, rawEvent *json.RawMessage) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"dispatchSendDigitsState\", ctx, callID, ctrlID, sendDigitsState, rawEvent)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "22ff7b0d610a08dd11007d9808b7d85e", "score": "0.47569802", "text": "func (_m *Bus) DispatchEvent(_a0 context.Context, _a1 bus.Event) error {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, bus.Event) error); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "3f362f92de36d55f232af089dc08654d", "score": "0.47431365", "text": "func testEventDispatcherWithExporters(t *testing.T, numExporters int, eventsStorePath string, logger log.Logger) {\n\t// dispatcher sends events to all the registered exporter\n\tdispatcher, err := NewDispatcher(t.Name(), dedupInterval, sendInterval, &events.StoreConfig{Dir: eventsStorePath},\n\t\tnil, logger)\n\tAssertOk(t, err, \"failed to create dispatcher\")\n\tdispatcher.Start()\n\tdefer dispatcher.Shutdown()\n\n\t// copy event\n\tevent := *dummyEvt\n\n\texporterWG := new(sync.WaitGroup)\n\texporterWG.Add(numExporters)\n\n\tproducerWG := new(sync.WaitGroup)\n\tproducerWG.Add(1)\n\n\tstopSendingEvents := make(chan struct{}, 1)\n\n\t// create all the exporters\n\tmockExporters := make([]*exporters.MockExporter, numExporters)\n\tfor i := 0; i < numExporters; i++ {\n\t\texporter := exporters.NewMockExporter(fmt.Sprintf(\"mock%d.%s\", i, t.Name()), exporterChLen, logger)\n\t\texporterEventCh, offsetTracker, err := dispatcher.RegisterExporter(exporter)\n\t\tAssertOk(t, err, \"failed to register mock exporter with the dispatcher\")\n\t\texporter.Start(exporterEventCh, offsetTracker)\n\t\tmockExporters[i] = exporter\n\t}\n\n\t// ensure all the exporters receive the events\n\t// any error from the exporters will be captured in assertion.\n\tfor i := 0; i < numExporters; i++ {\n\t\tgo func(mockExporter *exporters.MockExporter, dispatcher events.Dispatcher) {\n\t\t\tdefer exporterWG.Done()\n\t\t\tdefer mockExporter.Stop()\n\t\t\tdefer dispatcher.UnregisterExporter(mockExporter.Name())\n\n\t\t\tticker := time.NewTicker(sendInterval + (10 * time.Millisecond))\n\n\t\t\tTestNICConnectedEvents := 0\n\t\t\tTestNICDisconnectedEvents := 0\n\n\t\t\t// check if the mock exporter is receiving events from the dispatcher\n\t\t\t// number of events received should keep increasing for every iteration\n\t\t\t// as the producer is continuously generating events.\n\t\t\tfor iterations := 0; iterations < 5; iterations++ {\n\t\t\t\tselect {\n\t\t\t\tcase <-ticker.C:\n\t\t\t\t\tAssertEventually(t, func() (bool, interface{}) {\n\t\t\t\t\t\t// make sure the exporter received these events\n\t\t\t\t\t\ttemp := mockExporter.GetEventsByType(\"TestNICConnected\")\n\t\t\t\t\t\t// should > than the earlier iteration\n\t\t\t\t\t\tif !(temp > TestNICConnectedEvents) {\n\t\t\t\t\t\t\treturn false, fmt.Sprintf(\"exporter {%s}: expected TestNICConnectedEvents: >%d, got: %d\",\n\t\t\t\t\t\t\t\tmockExporter.Name(), TestNICConnectedEvents, temp)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tTestNICConnectedEvents = temp\n\n\t\t\t\t\t\ttemp = mockExporter.GetEventsByType(\"TestNICDisconnected\")\n\t\t\t\t\t\tif !(temp > TestNICDisconnectedEvents) {\n\t\t\t\t\t\t\treturn false, fmt.Sprintf(\"exporter {%s}: expected TestNICDisconnectedEvents: >%d, got: %d\",\n\t\t\t\t\t\t\t\tmockExporter.Name(), TestNICDisconnectedEvents, temp)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tTestNICDisconnectedEvents = temp\n\n\t\t\t\t\t\treturn true, nil\n\t\t\t\t\t}, \"did not receive all the events produced\", string(\"10ms\"), string(\"5s\"))\n\t\t\t\t}\n\t\t\t}\n\t\t}(mockExporters[i], dispatcher)\n\t}\n\n\t// send some events to the dispatcher\n\tgo func() {\n\t\t// copy event and set event type\n\t\tevt1 := *(&event)\n\t\tevt1.EventAttributes.Type = \"TestNICDisconnected\"\n\n\t\tevt2 := *(&event)\n\t\tevt2.EventAttributes.Type = \"TestNICConnected\"\n\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-stopSendingEvents:\n\t\t\t\tproducerWG.Done()\n\t\t\t\treturn\n\t\t\tcase <-time.After(10 * time.Millisecond):\n\t\t\t\tcreationTime, _ := types.TimestampProto(time.Now())\n\t\t\t\ttimeNow := api.Timestamp{Timestamp: *creationTime}\n\t\t\t\tevt1.ObjectMeta.CreationTime = timeNow\n\t\t\t\tevt1.ObjectMeta.ModTime = timeNow\n\t\t\t\tevt1.ObjectMeta.UUID = uuid.New().String()\n\n\t\t\t\tevt2.ObjectMeta.CreationTime = timeNow\n\t\t\t\tevt2.ObjectMeta.ModTime = timeNow\n\t\t\t\tevt2.ObjectMeta.UUID = uuid.New().String()\n\n\t\t\t\tdispatcher.Action(evt1)\n\t\t\t\tdispatcher.Action(evt2)\n\t\t\t}\n\t\t}\n\t}()\n\n\t// wait for all the exporters to finish\n\texporterWG.Wait()\n\n\tclose(stopSendingEvents)\n\n\t// wait for the producer to stop\n\tproducerWG.Wait()\n}", "title": "" }, { "docid": "9022ab566bd189c4675acf1e5f4d4ce5", "score": "0.4742818", "text": "func (m *MockOverlay) Self() net.Addr {\n\tret := m.ctrl.Call(m, \"Self\")\n\tret0, _ := ret[0].(net.Addr)\n\treturn ret0\n}", "title": "" }, { "docid": "5da8b0e7cda8bc7d626e916020d92d72", "score": "0.47392744", "text": "func (m *MockStreamProcessor) ListenForExit(arg0 func()) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"ListenForExit\", arg0)\n}", "title": "" }, { "docid": "41e04ecce0fb775e6e00f6178c65d0b0", "score": "0.4738442", "text": "func TestInboxForwarding(t *testing.T) {\n\tctx := context.Background()\n\tsetupFn := func(ctl *gomock.Controller) (c *MockCommonBehavior, fp *MockFederatingProtocol, sp *MockSocialProtocol, db *MockDatabase, cl *MockClock, a DelegateActor) {\n\t\tsetupData()\n\t\tc = NewMockCommonBehavior(ctl)\n\t\tfp = NewMockFederatingProtocol(ctl)\n\t\tsp = NewMockSocialProtocol(ctl)\n\t\tdb = NewMockDatabase(ctl)\n\t\tcl = NewMockClock(ctl)\n\t\ta = &sideEffectActor{\n\t\t\tcommon: c,\n\t\t\ts2s: fp,\n\t\t\tc2s: sp,\n\t\t\tdb: db,\n\t\t\tclock: cl,\n\t\t}\n\t\treturn\n\t}\n\tt.Run(\"DoesNotForwardIfAlreadyExists\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\t_, _, _, db, _, a := setupFn(ctl)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), testListen)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"DoesNotForwardIfToCollectionNotOwned\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\t_, _, _, db, _, a := setupFn(ctl)\n\t\tinput := addToIds(testListen)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testToIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testToIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testToIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testToIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testToIRI2)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testToIRI2)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"DoesNotForwardIfCcCollectionNotOwned\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\t_, _, _, db, _, a := setupFn(ctl)\n\t\tinput := mustAddCcIds(testListen)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testCcIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testCcIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testCcIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testCcIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testCcIRI2)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testCcIRI2)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"DoesNotForwardIfAudienceCollectionNotOwned\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\t_, _, _, db, _, a := setupFn(ctl)\n\t\tinput := mustAddAudienceIds(testListen)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI2)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"DoesNotForwardIfToOwnedButNotCollection\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\t_, _, _, db, _, a := setupFn(ctl)\n\t\tinput := addToIds(testListen)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testToIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testToIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testToIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testToIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testToIRI2)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testToIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testToIRI)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testToIRI)).Return(testPerson, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testToIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testToIRI2)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testToIRI2)).Return(testService, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testToIRI2)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"DoesNotForwardIfCcOwnedButNotCollection\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\t_, _, _, db, _, a := setupFn(ctl)\n\t\tinput := mustAddCcIds(testListen)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testCcIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testCcIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testCcIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testCcIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testCcIRI2)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testCcIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testCcIRI)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testCcIRI)).Return(testPerson, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testCcIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testCcIRI2)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testCcIRI2)).Return(testService, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testCcIRI2)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"DoesNotForwardIfAudienceOwnedButNotCollection\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\t_, _, _, db, _, a := setupFn(ctl)\n\t\tinput := mustAddAudienceIds(testListen)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI2)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return(testPerson, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI2)).Return(testService, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"DoesNotForwardIfNoChainIsOwned\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\tcm, fp, _, db, _, a := setupFn(ctl)\n\t\tinput := mustAddTagIds(\n\t\t\tmustAddAudienceIds(testListen))\n\t\tmockTPortTag := NewMockTransport(ctl)\n\t\tmockTPortTag2 := NewMockTransport(ctl)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI2)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return(testOrderedCollectionOfActors, nil),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI2)).Return(testCollectionOfActors, nil),\n\t\t\tfp.EXPECT().MaxInboxForwardingRecursionDepth(ctx).Return(0),\n\t\t\t// hasInboxForwardingValues\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testTagIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testTagIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testTagIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testTagIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testTagIRI2)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testTagIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testNoteId1)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testNoteId1)),\n\t\t\tcm.EXPECT().NewTransport(ctx, mustParse(testMyInboxIRI), goFedUserAgent()).Return(mockTPortTag, nil),\n\t\t\tmockTPortTag.EXPECT().Dereference(ctx, mustParse(testTagIRI)).Return(mustSerializeToBytes(newObjectWithId(testTagIRI)), nil),\n\t\t\tcm.EXPECT().NewTransport(ctx, mustParse(testMyInboxIRI), goFedUserAgent()).Return(mockTPortTag2, nil),\n\t\t\tmockTPortTag2.EXPECT().Dereference(ctx, mustParse(testTagIRI2)).Return(mustSerializeToBytes(newObjectWithId(testTagIRI2)), nil),\n\t\t\t// Deferred\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"ForwardsToRecipients\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\tcm, fp, _, db, _, a := setupFn(ctl)\n\t\tinput := mustAddTagIds(\n\t\t\tmustAddAudienceIds(testListen))\n\t\ttPort := NewMockTransport(ctl)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI2)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return(testOrderedCollectionOfActors, nil),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI2)).Return(testCollectionOfActors, nil),\n\t\t\tfp.EXPECT().MaxInboxForwardingRecursionDepth(ctx).Return(0),\n\t\t\t// hasInboxForwardingValues\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testTagIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testTagIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testTagIRI)),\n\t\t\t// after hasInboxForwardingValues\n\t\t\tfp.EXPECT().FilterForwarding(\n\t\t\t\tctx,\n\t\t\t\t[]*url.URL{\n\t\t\t\t\tmustParse(testAudienceIRI),\n\t\t\t\t\tmustParse(testAudienceIRI2),\n\t\t\t\t},\n\t\t\t\tinput,\n\t\t\t).Return(\n\t\t\t\t[]*url.URL{\n\t\t\t\t\tmustParse(testAudienceIRI),\n\t\t\t\t},\n\t\t\t\tnil,\n\t\t\t),\n\t\t\t// deliverToRecipients\n\t\t\tcm.EXPECT().NewTransport(ctx, mustParse(testMyInboxIRI), goFedUserAgent()).Return(tPort, nil),\n\t\t\ttPort.EXPECT().BatchDeliver(\n\t\t\t\tctx,\n\t\t\t\tmustSerializeToBytes(input),\n\t\t\t\t[]*url.URL{\n\t\t\t\t\tmustParse(testFederatedActorIRI3),\n\t\t\t\t\tmustParse(testFederatedActorIRI4),\n\t\t\t\t},\n\t\t\t),\n\t\t\t// Deferred\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"ForwardsToRecipientsIfChainIsNested\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\tcm, fp, _, db, _, a := setupFn(ctl)\n\t\tinput := mustAddAudienceIds(testNestedInReplyTo)\n\t\ttPort := NewMockTransport(ctl)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI2)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return(testOrderedCollectionOfActors, nil),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI2)).Return(testCollectionOfActors, nil),\n\t\t\tfp.EXPECT().MaxInboxForwardingRecursionDepth(ctx).Return(0),\n\t\t\t// hasInboxForwardingValues\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testNoteId1)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testNoteId1)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(inReplyToIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(inReplyToIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(inReplyToIRI)),\n\t\t\t// after hasInboxForwardingValues\n\t\t\tfp.EXPECT().FilterForwarding(\n\t\t\t\tctx,\n\t\t\t\t[]*url.URL{\n\t\t\t\t\tmustParse(testAudienceIRI),\n\t\t\t\t\tmustParse(testAudienceIRI2),\n\t\t\t\t},\n\t\t\t\tinput,\n\t\t\t).Return(\n\t\t\t\t[]*url.URL{\n\t\t\t\t\tmustParse(testAudienceIRI),\n\t\t\t\t},\n\t\t\t\tnil,\n\t\t\t),\n\t\t\t// deliverToRecipients\n\t\t\tcm.EXPECT().NewTransport(ctx, mustParse(testMyInboxIRI), goFedUserAgent()).Return(tPort, nil),\n\t\t\ttPort.EXPECT().BatchDeliver(\n\t\t\t\tctx,\n\t\t\t\tmustSerializeToBytes(input),\n\t\t\t\t[]*url.URL{\n\t\t\t\t\tmustParse(testFederatedActorIRI3),\n\t\t\t\t\tmustParse(testFederatedActorIRI4),\n\t\t\t\t},\n\t\t\t),\n\t\t\t// Deferred\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"ForwardsToRecipientsAfterDereferencing\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\tcm, fp, _, db, _, a := setupFn(ctl)\n\t\tinput := mustAddTagIds(\n\t\t\tmustAddAudienceIds(testListen))\n\t\ttagTPort := NewMockTransport(ctl)\n\t\ttagTPort2 := NewMockTransport(ctl)\n\t\ttPort := NewMockTransport(ctl)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI2)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return(testOrderedCollectionOfActors, nil),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI2)).Return(testCollectionOfActors, nil),\n\t\t\tfp.EXPECT().MaxInboxForwardingRecursionDepth(ctx).Return(0),\n\t\t\t// hasInboxForwardingValues\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testTagIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testTagIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testTagIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testTagIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testTagIRI2)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testTagIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testNoteId1)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testNoteId1)),\n\t\t\tcm.EXPECT().NewTransport(ctx, mustParse(testMyInboxIRI), goFedUserAgent()).Return(tagTPort, nil),\n\t\t\ttagTPort.EXPECT().Dereference(ctx, mustParse(testTagIRI)).Return(mustSerializeToBytes(mustAddInReplyToIds(newActivityWithId(testTagIRI))), nil),\n\t\t\tcm.EXPECT().NewTransport(ctx, mustParse(testMyInboxIRI), goFedUserAgent()).Return(tagTPort2, nil),\n\t\t\ttagTPort2.EXPECT().Dereference(ctx, mustParse(testTagIRI2)).Return(mustSerializeToBytes(newActivityWithId(testTagIRI2)), nil),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(inReplyToIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(inReplyToIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(inReplyToIRI)),\n\t\t\t// after hasInboxForwardingValues\n\t\t\tfp.EXPECT().FilterForwarding(\n\t\t\t\tctx,\n\t\t\t\t[]*url.URL{\n\t\t\t\t\tmustParse(testAudienceIRI),\n\t\t\t\t\tmustParse(testAudienceIRI2),\n\t\t\t\t},\n\t\t\t\tinput,\n\t\t\t).Return(\n\t\t\t\t[]*url.URL{\n\t\t\t\t\tmustParse(testAudienceIRI),\n\t\t\t\t},\n\t\t\t\tnil,\n\t\t\t),\n\t\t\t// deliverToRecipients\n\t\t\tcm.EXPECT().NewTransport(ctx, mustParse(testMyInboxIRI), goFedUserAgent()).Return(tPort, nil),\n\t\t\ttPort.EXPECT().BatchDeliver(\n\t\t\t\tctx,\n\t\t\t\tmustSerializeToBytes(input),\n\t\t\t\t[]*url.URL{\n\t\t\t\t\tmustParse(testFederatedActorIRI3),\n\t\t\t\t\tmustParse(testFederatedActorIRI4),\n\t\t\t\t},\n\t\t\t),\n\t\t\t// Deferred\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n\tt.Run(\"DoesNotForwardIfChainIsNestedTooDeep\", func(t *testing.T) {\n\t\t// Setup\n\t\tctl := gomock.NewController(t)\n\t\tdefer ctl.Finish()\n\t\t_, fp, _, db, _, a := setupFn(ctl)\n\t\tinput := mustAddAudienceIds(testNestedInReplyTo)\n\t\tgomock.InOrder(\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Exists(ctx, mustParse(testFederatedActivityIRI)).Return(false, nil),\n\t\t\tdb.EXPECT().Create(ctx, input).Return(nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testAudienceIRI2)).Return(true, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return(testOrderedCollectionOfActors, nil),\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Get(ctx, mustParse(testAudienceIRI2)).Return(testCollectionOfActors, nil),\n\t\t\tfp.EXPECT().MaxInboxForwardingRecursionDepth(ctx).Return(1),\n\t\t\t// hasInboxForwardingValues\n\t\t\tdb.EXPECT().Lock(ctx, mustParse(testNoteId1)),\n\t\t\tdb.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return(false, nil),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testNoteId1)),\n\t\t\t// Deferred\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)),\n\t\t\tdb.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)),\n\t\t)\n\t\t// Run\n\t\terr := a.InboxForwarding(ctx, mustParse(testMyInboxIRI), input)\n\t\t// Verify\n\t\tassertEqual(t, err, nil)\n\t})\n}", "title": "" }, { "docid": "32fda24083ac9dec42d30e6c001fdb72", "score": "0.47367668", "text": "func (m *MockRouteGuideServer) mustEmbedUnimplementedRouteGuideServer() {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"mustEmbedUnimplementedRouteGuideServer\")\n}", "title": "" }, { "docid": "c6fd73a3001506ecc85648a09364b9c7", "score": "0.47350523", "text": "func (_m *Manager) Reorg(event *model.Reorg) error {\n\tret := _m.Called(event)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*model.Reorg) error); ok {\n\t\tr0 = rf(event)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" } ]
69d1ac91429dc18a7bd9997a2acce346
DescribeFaceConfigWithCallback invokes the cloudauth.DescribeFaceConfig API asynchronously
[ { "docid": "43136f3047060703d510e44b9ff22e59", "score": "0.81765914", "text": "func (client *Client) DescribeFaceConfigWithCallback(request *DescribeFaceConfigRequest, callback func(response *DescribeFaceConfigResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeFaceConfigResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeFaceConfig(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" } ]
[ { "docid": "d7696d34bf6e07cf21f1e8a6da8e256b", "score": "0.6525263", "text": "func (client *Client) DescribeFaceConfigWithChan(request *DescribeFaceConfigRequest) (<-chan *DescribeFaceConfigResponse, <-chan error) {\n\tresponseChan := make(chan *DescribeFaceConfigResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.DescribeFaceConfig(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}", "title": "" }, { "docid": "3218148643396a062569011483a63f8f", "score": "0.62937534", "text": "func (client *Client) DescribeFaceConfig(request *DescribeFaceConfigRequest) (response *DescribeFaceConfigResponse, err error) {\n\tresponse = CreateDescribeFaceConfigResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "title": "" }, { "docid": "dc0417b43eb99f153046567b757ac690", "score": "0.5930873", "text": "func (client *Client) DescribeScreenVersionConfigWithCallback(request *DescribeScreenVersionConfigRequest, callback func(response *DescribeScreenVersionConfigResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeScreenVersionConfigResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeScreenVersionConfig(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "69f92932f183cc5db0d93c72f0b7fe30", "score": "0.56715894", "text": "func CreateDescribeFaceConfigResponse() (response *DescribeFaceConfigResponse) {\n\tresponse = &DescribeFaceConfigResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "4109324d9f307d7ddb43c0715b93ab63", "score": "0.55922884", "text": "func (client *Client) DescribeOssCallbackSettingWithCallback(request *DescribeOssCallbackSettingRequest, callback func(response *DescribeOssCallbackSettingResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeOssCallbackSettingResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeOssCallbackSetting(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "ecd85cc778b6bdcc149d32fe81bd628e", "score": "0.54315245", "text": "func (client *Client) DescribeStoreConfigWithCallback(request *DescribeStoreConfigRequest, callback func(response *DescribeStoreConfigResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeStoreConfigResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeStoreConfig(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "e348355db98c76af1b203cda491a2acd", "score": "0.53812975", "text": "func (client *Client) GetFacesWithCallback(request *GetFacesRequest, callback func(response *GetFacesResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetFacesResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GetFaces(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "06ccd2fae72a9ef46a4d2d0981d655c8", "score": "0.5269152", "text": "func CreateDescribeFaceConfigRequest() (request *DescribeFaceConfigRequest) {\n\trequest = &DescribeFaceConfigRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Cloudauth\", \"2019-03-07\", \"DescribeFaceConfig\", \"cloudauth\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "title": "" }, { "docid": "aa054b194cf25b6ab501bfadb16dcc34", "score": "0.5233621", "text": "func (client *Client) DescribeCloudAppWithCallback(request *DescribeCloudAppRequest, callback func(response *DescribeCloudAppResponse, err error)) (<-chan int) {\nresult := make(chan int, 1)\nerr := client.AddAsyncTask(func() {\nvar response *DescribeCloudAppResponse\nvar err error\ndefer close(result)\nresponse, err = client.DescribeCloudApp(request)\ncallback(response, err)\nresult <- 1\n})\nif err != nil {\ndefer close(result)\ncallback(nil, err)\nresult <- 0\n}\nreturn result\n}", "title": "" }, { "docid": "827478d679e0257b9c06e66b65625df5", "score": "0.5160897", "text": "func (client *Client) DescribeOssCallbackSettingWithChan(request *DescribeOssCallbackSettingRequest) (<-chan *DescribeOssCallbackSettingResponse, <-chan error) {\n\tresponseChan := make(chan *DescribeOssCallbackSettingResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.DescribeOssCallbackSetting(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}", "title": "" }, { "docid": "ccb98a22756a1a9f1b2ebb4d1b62fea4", "score": "0.509972", "text": "func (client *Client) QueryCommodityConfigWithCallback(request *QueryCommodityConfigRequest, callback func(response *QueryCommodityConfigResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *QueryCommodityConfigResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.QueryCommodityConfig(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "ec245614d4dc2e8d4d5f11bbc9b43682", "score": "0.5079781", "text": "func (client *Client) DescribeVpcFirewallCenListWithCallback(request *DescribeVpcFirewallCenListRequest, callback func(response *DescribeVpcFirewallCenListResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeVpcFirewallCenListResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeVpcFirewallCenList(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "6520f2c362babd589ba2243b075c53a8", "score": "0.4835732", "text": "func (client *Client) DescribeSystemParametersWithCallback(request *DescribeSystemParametersRequest, callback func(response *DescribeSystemParametersResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeSystemParametersResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeSystemParameters(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "ce11cfd4ae7648d7d2f07f9518f5de64", "score": "0.47793207", "text": "func (client *Client) DescribeCriteriaWithCallback(request *DescribeCriteriaRequest, callback func(response *DescribeCriteriaResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeCriteriaResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeCriteria(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "bec8cdc89f0452d760eb33960c131137", "score": "0.4766441", "text": "func (TwitterOAuthFactor) getConfig() (interface{}, error) {\n\tconsumerKey := viper.GetString(\"twitter_consumer_key\")\n\tconsumerSecret := viper.Get(\"twitter_consumer_secret\").(secret.String).SecretString()\n\toauthRedirectURL := viper.GetString(\"twitter_oauth_redirect_url\")\n\treturn &oauth1.Config{\n\t\tConsumerKey: consumerKey,\n\t\tConsumerSecret: consumerSecret,\n\t\tCallbackURL: oauthRedirectURL,\n\t\tEndpoint: twitter.AuthorizeEndpoint,\n\t}, nil\n}", "title": "" }, { "docid": "e4d42f1eeec8c0a65806b1493e71578d", "score": "0.4753778", "text": "func (client *Client) GetAuthInfoWithCallback(request *GetAuthInfoRequest, callback func(response *GetAuthInfoResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetAuthInfoResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GetAuthInfo(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "eca0583f72225607dd5473f253645201", "score": "0.47193804", "text": "func (client *Client) ListPageConfigTemplateWithCallback(request *ListPageConfigTemplateRequest, callback func(response *ListPageConfigTemplateResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *ListPageConfigTemplateResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.ListPageConfigTemplate(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "e6df8cc908d3e4d91ffc7d64d4bb62c2", "score": "0.4716653", "text": "func (client *Client) DescribeVpcFirewallDetailWithCallback(request *DescribeVpcFirewallDetailRequest, callback func(response *DescribeVpcFirewallDetailResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeVpcFirewallDetailResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeVpcFirewallDetail(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "0fbdb51fb6d947dafbd1978d840b690b", "score": "0.4614688", "text": "func (client *Client) DescribeMetricListWithCallback(request *DescribeMetricListRequest, callback func(response *DescribeMetricListResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeMetricListResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeMetricList(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "0fbdb51fb6d947dafbd1978d840b690b", "score": "0.4614688", "text": "func (client *Client) DescribeMetricListWithCallback(request *DescribeMetricListRequest, callback func(response *DescribeMetricListResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeMetricListResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeMetricList(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "46a34c24177393fda6e472286cd11248", "score": "0.4605891", "text": "func (client *Client) ConfigADConnectorUserWithCallback(request *ConfigADConnectorUserRequest, callback func(response *ConfigADConnectorUserResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *ConfigADConnectorUserResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.ConfigADConnectorUser(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "3da0c14266b2fb9f9da418974a985256", "score": "0.46045694", "text": "func (client *Client) DescribeLiveDomainTranscodeParamsWithCallback(request *DescribeLiveDomainTranscodeParamsRequest, callback func(response *DescribeLiveDomainTranscodeParamsResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeLiveDomainTranscodeParamsResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeLiveDomainTranscodeParams(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "07a6867f3b405a4c6557236057c29711", "score": "0.45520616", "text": "func (client *Client) DescribeClusterBasicInfoWithCallback(request *DescribeClusterBasicInfoRequest, callback func(response *DescribeClusterBasicInfoResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeClusterBasicInfoResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeClusterBasicInfo(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "c0aba6a7e93fe51526c596f34da456f0", "score": "0.4541814", "text": "func (client *Client) DescribeGatewayLDAPInfoWithCallback(request *DescribeGatewayLDAPInfoRequest, callback func(response *DescribeGatewayLDAPInfoResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeGatewayLDAPInfoResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeGatewayLDAPInfo(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "f015a94c802759c61b802fbf689f9bf6", "score": "0.45328662", "text": "func (client *Client) DescribeRPSDKWithCallback(request *DescribeRPSDKRequest, callback func(response *DescribeRPSDKResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeRPSDKResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeRPSDK(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "5569dbc1a82b3516f1f61a1e460564ef", "score": "0.45203406", "text": "func (client *Client) DescribeOssCallbackSetting(request *DescribeOssCallbackSettingRequest) (response *DescribeOssCallbackSettingResponse, err error) {\n\tresponse = CreateDescribeOssCallbackSettingResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "title": "" }, { "docid": "f6ac8b9ab0816a5bcc8b272a7284456e", "score": "0.4514804", "text": "func (svc *ServiceContext) GetConfig(c *gin.Context) {\n\ttype mapTarget struct {\n\t\tPool string `json:\"pool\"`\n\t\tFilter string `json:\"filter\"`\n\t}\n\ttype config struct {\n\t\tSearchAPI string `json:\"searchAPI\"`\n\t\tAvailabilityURL string `json:\"availabilityURL\"`\n\t\tCitationsURL string `json:\"citationsURL\"`\n\t\tColectionsURL string `json:\"collectionsURL\"`\n\t\tShelfBrowseURL string `json:\"shelfBrowseURL\"`\n\t\tHealthSciURL string `json:\"hsILLiadURL\"`\n\t\tDibsURL string `json:\"dibsURL\"`\n\t\tTranslateMessage string `json:\"translateMessage\"`\n\t\tKioskMode bool `json:\"kiosk\"`\n\t\tDevServer bool `json:\"devServer\"`\n\t\tFirebase *FirebaseConfig `json:\"firebase,omitempty\"`\n\t\tPickupLibraries []pickupLibrary `json:\"pickupLibraries\"`\n\t}\n\tacceptLang := strings.Split(c.GetHeader(\"Accept-Language\"), \",\")[0]\n\tlog.Printf(\"Accept-Language=%s\", acceptLang)\n\tcfg := config{SearchAPI: svc.SearchAPI, CitationsURL: svc.CitationsURL,\n\t\tColectionsURL: svc.CollectionsURL,\n\t\tAvailabilityURL: svc.AvailabilityURL, ShelfBrowseURL: svc.ShelfBrowseURL,\n\t\tHealthSciURL: svc.Illiad.HealthSciURL, KioskMode: false,\n\t\tDibsURL: svc.DibsURL,\n\t}\n\tif msg, ok := svc.PendingTranslates[acceptLang]; ok {\n\t\tlog.Printf(\"Adding translate message to config\")\n\t\tcfg.TranslateMessage = msg\n\t}\n\tif svc.Firebase.APIKey != \"\" {\n\t\tcfg.Firebase = &svc.Firebase\n\t}\n\n\tv4HostHeader := c.Request.Header.Get(\"V4Host\")\n\tlog.Printf(\"Config request V4Host header: %s\", v4HostHeader)\n\tif strings.Index(v4HostHeader, \"-kiosk\") > -1 || svc.Dev.Kiosk {\n\t\tlog.Printf(\"This request is from a kiosk\")\n\t\tcfg.KioskMode = true\n\t}\n\tif strings.Index(v4HostHeader, \"-dev\") > -1 || svc.Dev.AuthUser != \"\" {\n\t\tlog.Printf(\"This request is from a dev server\")\n\t\tcfg.DevServer = true\n\t}\n\n\tdbResp := svc.GDB.Order(\"name asc\").Find(&cfg.PickupLibraries)\n\tif dbResp.Error != nil {\n\t\tlog.Printf(\"ERROR: unable to get pickup libraries: %s\", dbResp.Error.Error())\n\t}\n\n\tc.JSON(http.StatusOK, cfg)\n}", "title": "" }, { "docid": "d00d185783af64e33bc64ce13eeb36a6", "score": "0.45108232", "text": "func GetAnalogValueCallbackThresholdFuture(brick *bricker.Bricker, connectorname string, uid uint32) *device.Threshold16 {\n\tfuture := make(chan *device.Threshold16)\n\tdefer close(future)\n\tsub := GetAnalogValueCallbackThreshold(\"getanalogvaluecallbackthresholdfuture\"+device.GenId(), uid,\n\t\tfunc(r device.Resulter, err error) {\n\t\t\tvar v *device.Threshold16 = nil\n\t\t\tif err == nil {\n\t\t\t\tif value, ok := r.(*device.Threshold16); ok {\n\t\t\t\t\tv = value\n\t\t\t\t}\n\t\t\t}\n\t\t\tfuture <- v\n\t\t})\n\terr := brick.Subscribe(sub, connectorname)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn <-future\n}", "title": "" }, { "docid": "bd82d50864072fe7a578b0bb263748bc", "score": "0.4504671", "text": "func LookupConfig(ctx *pulumi.Context, args *LookupConfigArgs, opts ...pulumi.InvokeOption) (*LookupConfigResult, error) {\n\tvar rv LookupConfigResult\n\terr := ctx.Invoke(\"google-native:gameservices/v1:getConfig\", args, &rv, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &rv, nil\n}", "title": "" }, { "docid": "ce9d9cb5abe17176109864886d116765", "score": "0.44617122", "text": "func (client *Client) DescribeExperimentEnvProgressWithCallback(request *DescribeExperimentEnvProgressRequest, callback func(response *DescribeExperimentEnvProgressResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeExperimentEnvProgressResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeExperimentEnvProgress(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "026972c9bc70309b2003a409001dcebb", "score": "0.44486114", "text": "func (client *Client) DescribeScreenVersionConfigWithChan(request *DescribeScreenVersionConfigRequest) (<-chan *DescribeScreenVersionConfigResponse, <-chan error) {\n\tresponseChan := make(chan *DescribeScreenVersionConfigResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.DescribeScreenVersionConfig(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}", "title": "" }, { "docid": "44e4d2cd127225f927d563bda35e3447", "score": "0.44451627", "text": "func GetHumidityCallbackThresholdFuture(brick *bricker.Bricker, connectorname string, uid uint32) *device.Threshold16 {\n\tfuture := make(chan *device.Threshold16)\n\tdefer close(future)\n\tsub := GetHumidityCallbackThreshold(\"gethumiditycallbackthresholdfuture\"+device.GenId(), uid,\n\t\tfunc(r device.Resulter, err error) {\n\t\t\tvar v *device.Threshold16 = nil\n\t\t\tif err == nil {\n\t\t\t\tif value, ok := r.(*device.Threshold16); ok {\n\t\t\t\t\tv = value\n\t\t\t\t}\n\t\t\t}\n\t\t\tfuture <- v\n\t\t})\n\terr := brick.Subscribe(sub, connectorname)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn <-future\n}", "title": "" }, { "docid": "92c9efd557b6b0a2d024089c0378265a", "score": "0.44387466", "text": "func (*GetConfigStreamResponse) Descriptor() ([]byte, []int) {\n\treturn file_zenoss_cloud_collection_cfg_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "62946a79eac7fa61ae23d5d534dc4e98", "score": "0.44255292", "text": "func (client *Client) DescribeLiveCertificateListWithCallback(request *DescribeLiveCertificateListRequest, callback func(response *DescribeLiveCertificateListResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeLiveCertificateListResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeLiveCertificateList(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "3be4682b1cab5afe01721b9e7960138a", "score": "0.44162193", "text": "func (c *baseClient) GetConnectorConfig(req ConnectorRequest) (GetConnectorConfigResponse, error) {\n\tresult := GetConnectorConfigResponse{}\n\tvar config map[string]interface{}\n\n\tresp, err := c.restClient.NewRequest().\n\t\tSetResult(&config).\n\t\tSetPathParams(map[string]string{\"name\": req.Name}).\n\t\tGet(\"connectors/{name}/config\")\n\tif err != nil {\n\t\treturn GetConnectorConfigResponse{}, err\n\t}\n\tif resp.StatusCode() >= 400 && resp.StatusCode() != 404 {\n\t\treturn GetConnectorConfigResponse{}, errors.Errorf(\"Get connector config : %v\", resp.String())\n\t}\n\n\tresult.Code = resp.StatusCode()\n\tresult.Config = config\n\treturn result, nil\n}", "title": "" }, { "docid": "1f3bf757e7632ed87700a899506e574a", "score": "0.44119954", "text": "func (m *CustomTaskExtensionCallbackConfiguration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {\n res := m.CustomExtensionCallbackConfiguration.GetFieldDeserializers()\n res[\"authorizedApps\"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {\n val, err := n.GetCollectionOfObjectValues(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateApplicationFromDiscriminatorValue)\n if err != nil {\n return err\n }\n if val != nil {\n res := make([]iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.Applicationable, len(val))\n for i, v := range val {\n if v != nil {\n res[i] = v.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.Applicationable)\n }\n }\n m.SetAuthorizedApps(res)\n }\n return nil\n }\n return res\n}", "title": "" }, { "docid": "7aac3eb6e81fcc7434ee607be3a4461b", "score": "0.44040343", "text": "func getOAuthCfg(ctx context.Context, isCalendar bool) *oauth2.Config {\n\tvar o sync.Once\n\tvar oauthCfg *oauth2.Config\n\to.Do(func() {\n\t\t//construct the redirect url, making sure to always use the base server host, which can be different due to custom provider domains\n\t\turlCallback := URICallback\n\t\tif isCalendar {\n\t\t\turlCallback = URICallbackCal\n\t\t}\n\t\turl, err := createGoogleURL(urlCallback)\n\t\tif err != nil {\n\t\t\tpanic(errors.Wrap(err, \"google redirect url\"))\n\t\t}\n\t\turl, err = CreateURLAbs(ctx, url, nil)\n\t\tif err != nil {\n\t\t\tpanic(errors.Wrap(err, \"google redirect url absolute\"))\n\t\t}\n\n\t\t//configure the oauth request\n\t\toauthCfg = &oauth2.Config{\n\t\t\tClientID: GetGoogleOAuthClientID(),\n\t\t\tClientSecret: GetGoogleOAuthClientSecret(),\n\t\t\tEndpoint: google.Endpoint,\n\t\t\tRedirectURL: url,\n\t\t}\n\t\tif isCalendar {\n\t\t\toauthCfg.Scopes = []string{\n\t\t\t\t\"https://www.googleapis.com/auth/calendar.readonly\",\n\t\t\t}\n\t\t} else {\n\t\t\toauthCfg.Scopes = []string{\n\t\t\t\t\"https://www.googleapis.com/auth/userinfo.email\",\n\t\t\t\t\"https://www.googleapis.com/auth/userinfo.profile\",\n\t\t\t}\n\t\t}\n\t})\n\treturn oauthCfg\n}", "title": "" }, { "docid": "ef84c90e3462641a0a296820870add91", "score": "0.43977168", "text": "func (device *ColorV2Bricklet) GetColorCallbackConfiguration() (period uint32, valueHasToChange bool, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetColorCallbackConfiguration), buf.Bytes())\n\tif err != nil {\n\t\treturn period, valueHasToChange, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 13 {\n\t\t\treturn period, valueHasToChange, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 13)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn period, valueHasToChange, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &period)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &valueHasToChange)\n\n\t}\n\n\treturn period, valueHasToChange, nil\n}", "title": "" }, { "docid": "98be7257c41e2fbde9480035cb454d8b", "score": "0.43966198", "text": "func (client *Client) FaceSearchWithCallback(request *FaceSearchRequest, callback func(response *FaceSearchResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *FaceSearchResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.FaceSearch(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "f3345c1f242430686d3f8d14e7f93560", "score": "0.43807843", "text": "func (m *ExtAuthConfig_OAuthConfig) GetCallbackPath() string {\n\tif m != nil {\n\t\treturn m.CallbackPath\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "618598e37ae214954ff98ea76f33230e", "score": "0.4367608", "text": "func (client *Client) GenerateDISyncTaskConfigForCreatingWithCallback(request *GenerateDISyncTaskConfigForCreatingRequest, callback func(response *GenerateDISyncTaskConfigForCreatingResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GenerateDISyncTaskConfigForCreatingResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GenerateDISyncTaskConfigForCreating(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "e6c1fccd809028e1ae8749fffab7adeb", "score": "0.434346", "text": "func GetClusterConfig(c *gin.Context) {\n\tcommonCluster, ok := getClusterFromRequest(c)\n\tif ok != true {\n\t\treturn\n\t}\n\tconfig, err := commonCluster.GetK8sConfig()\n\tif err != nil {\n\t\tlog.Errorf(\"Error during getting config: %s\", err.Error())\n\t\tc.JSON(http.StatusBadRequest, pkgCommon.ErrorResponse{\n\t\t\tCode: http.StatusBadRequest,\n\t\t\tMessage: \"Error during getting config\",\n\t\t\tError: err.Error(),\n\t\t})\n\t\treturn\n\t}\n\n\tcontentType := c.NegotiateFormat(gin.MIMEPlain, gin.MIMEJSON)\n\tlog.Debug(\"Content-Type: \", contentType)\n\tswitch contentType {\n\tcase gin.MIMEJSON:\n\t\tc.JSON(http.StatusOK, pkgCluster.GetClusterConfigResponse{\n\t\t\tStatus: http.StatusOK,\n\t\t\tData: string(config),\n\t\t})\n\tdefault:\n\t\tc.String(http.StatusOK, string(config))\n\t}\n\treturn\n}", "title": "" }, { "docid": "195079b896c3751b3a4dd4383e5f120f", "score": "0.4332495", "text": "func (client *Client) DescribeWhitelistSettingWithCallback(request *DescribeWhitelistSettingRequest, callback func(response *DescribeWhitelistSettingResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeWhitelistSettingResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeWhitelistSetting(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "0efc0ab49eae6f659cc91c2d8f985efd", "score": "0.43314072", "text": "func (o *Topic) GetConfigOk() (*[]ConfigEntry, bool) {\n\tif o == nil || o.Config == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Config, true\n}", "title": "" }, { "docid": "febd72ea60887d3b8a3a53559e1814f1", "score": "0.43281126", "text": "func GetConfig() (*rest.Config, error) { return config.GetConfig() }", "title": "" }, { "docid": "ab477113f4647416dc4decc63f84dbc7", "score": "0.43143198", "text": "func (client *Client) DescribeDataDownloadURLWithCallback(request *DescribeDataDownloadURLRequest, callback func(response *DescribeDataDownloadURLResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeDataDownloadURLResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeDataDownloadURL(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "7d68ab356a17ab2f7ff041e5b8eafc07", "score": "0.4312675", "text": "func (client *Client) DescribeEcGrantRelationWithCallback(request *DescribeEcGrantRelationRequest, callback func(response *DescribeEcGrantRelationResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeEcGrantRelationResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeEcGrantRelation(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "23243530a33579d8bcaf7110dbae6eb5", "score": "0.43098855", "text": "func (client *Client) DescribeInstanceSpecWithCallback(request *DescribeInstanceSpecRequest, callback func(response *DescribeInstanceSpecResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeInstanceSpecResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeInstanceSpec(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "d8f5bc3f906ba7be26ae49fb56bcaa0f", "score": "0.42914715", "text": "func (sdk *FabricSDK) ConfigProvider() apiconfig.Config {\n\treturn sdk.configProvider\n}", "title": "" }, { "docid": "bc5e4d1658c2690c72b24402bbfa72d1", "score": "0.42881054", "text": "func (client *Client) DescribeVulExportInfoWithCallback(request *DescribeVulExportInfoRequest, callback func(response *DescribeVulExportInfoResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeVulExportInfoResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeVulExportInfo(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "278ffd7b3c377a349d815485ab235605", "score": "0.42867112", "text": "func (client *Client) DescribeCloudAppWithChan(request *DescribeCloudAppRequest) (<-chan *DescribeCloudAppResponse, <-chan error) {\nresponseChan := make(chan *DescribeCloudAppResponse, 1)\nerrChan := make(chan error, 1)\nerr := client.AddAsyncTask(func() {\ndefer close(responseChan)\ndefer close(errChan)\nresponse, err := client.DescribeCloudApp(request)\nif err != nil {\nerrChan <- err\n} else {\nresponseChan <- response\n}\n})\nif err != nil {\nerrChan <- err\nclose(responseChan)\nclose(errChan)\n}\nreturn responseChan, errChan\n}", "title": "" }, { "docid": "b226a875603d09cbea88084fb81ac582", "score": "0.42799726", "text": "func FindConfigsPaginated(client graphql.Client, query *ConfigQuery, pageSize int64, callback FindConfigsPaginatedCallback) error {\n\tinput := &ConfigQueryInput{\n\t\tFirst: &pageSize,\n\t\tQuery: query,\n\t}\n\tfor {\n\t\tres, err := FindConfigs(client, input)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif res == nil {\n\t\t\tbreak\n\t\t}\n\t\tok, err := callback(res)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !ok || !res.PageInfo.HasNextPage {\n\t\t\tbreak\n\t\t}\n\t\tinput.After = &res.PageInfo.EndCursor\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d37f2b50ffe2a166abf79d1ec30b0aca", "score": "0.4276142", "text": "func (w *cachingValidationWrapper) GetCloudConfig(spec v1alpha1.MachineSpec) (string, string, error) {\n\treturn w.actualProvider.GetCloudConfig(spec)\n}", "title": "" }, { "docid": "144a29f497bfeb650c1c5ae971c59a1e", "score": "0.4275591", "text": "func (client *Client) DescribeStreamsWithCallback(request *DescribeStreamsRequest, callback func(response *DescribeStreamsResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeStreamsResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeStreams(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "9ee4ddcf7ee451048eef40258c683e67", "score": "0.42719266", "text": "func (s *HTTPServer) configGet(resp http.ResponseWriter, req *http.Request) (interface{}, error) {\n\tvar args structs.ConfigEntryQuery\n\tif done := s.parse(resp, req, &args.Datacenter, &args.QueryOptions); done {\n\t\treturn nil, nil\n\t}\n\tpathArgs := strings.SplitN(strings.TrimPrefix(req.URL.Path, \"/v1/config/\"), \"/\", 2)\n\n\tswitch len(pathArgs) {\n\tcase 2:\n\t\t// Both kind/name provided.\n\t\targs.Kind = pathArgs[0]\n\t\targs.Name = pathArgs[1]\n\n\t\tvar reply structs.ConfigEntryResponse\n\t\tif err := s.agent.RPC(\"ConfigEntry.Get\", &args, &reply); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif reply.Entry == nil {\n\t\t\treturn nil, NotFoundError{Reason: fmt.Sprintf(\"Config entry not found for %q / %q\", pathArgs[0], pathArgs[1])}\n\t\t}\n\n\t\treturn reply.Entry, nil\n\tcase 1:\n\t\t// Only kind provided, list entries.\n\t\targs.Kind = pathArgs[0]\n\n\t\tvar reply structs.IndexedConfigEntries\n\t\tif err := s.agent.RPC(\"ConfigEntry.List\", &args, &reply); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn reply.Entries, nil\n\tdefault:\n\t\treturn nil, NotFoundError{Reason: \"Must provide either a kind or both kind and name\"}\n\t}\n}", "title": "" }, { "docid": "7498b75fffb8286a4ada0b7f7498db76", "score": "0.4265078", "text": "func (client *Client) DescribeResultListWithCallback(request *DescribeResultListRequest, callback func(response *DescribeResultListResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeResultListResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeResultList(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "c3fe18b4860ca904498dfd432c1be23d", "score": "0.42583883", "text": "func (*GetConfigResponse) Descriptor() ([]byte, []int) {\n\treturn file_discovery_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "08bcbf6759ee98a8e2034abcd20e8010", "score": "0.42439166", "text": "func (client *Client) ListVulAutoRepairConfigWithCallback(request *ListVulAutoRepairConfigRequest, callback func(response *ListVulAutoRepairConfigResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *ListVulAutoRepairConfigResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.ListVulAutoRepairConfig(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "fee94aba4ffadcf652e54917821f4e47", "score": "0.42436865", "text": "func (f *FrontendRPC) GetConfig(_ *interface{}, reply *Config) error {\n\tvar args interface{}\n\terr := RPCCall(f.address, f.methodPrefix+\".GetConfig\", &args, reply)\n\treturn err\n}", "title": "" }, { "docid": "b112f25ca4ee0177d63322fed37dea65", "score": "0.42399642", "text": "func (client *Client) ListFaceGroupsWithCallback(request *ListFaceGroupsRequest, callback func(response *ListFaceGroupsResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *ListFaceGroupsResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.ListFaceGroups(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "d27afb78066566bfb7bfb3c7a47937ac", "score": "0.4235838", "text": "func (client *Client) DescribeConnectionStatusWithCallback(request *DescribeConnectionStatusRequest, callback func(response *DescribeConnectionStatusResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeConnectionStatusResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeConnectionStatus(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "dc6ad47c3f5afecaeabcd01939e1973f", "score": "0.42227694", "text": "func (*GetConfigResponse) Descriptor() ([]byte, []int) {\n\treturn file_config_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "5d716bad25d46bb86223761c1ebac08c", "score": "0.4218906", "text": "func (f *Function) GetConfig() (*lambda.GetFunctionOutput, error) {\n\tf.Log.Debug(\"fetching config\")\n\treturn f.Service.GetFunction(&lambda.GetFunctionInput{\n\t\tFunctionName: &f.FunctionName,\n\t})\n}", "title": "" }, { "docid": "e346b998f896a618d0870b4fa61e479c", "score": "0.42142683", "text": "func (device *ColorV2Bricklet) GetColorTemperatureCallbackConfiguration() (period uint32, valueHasToChange bool, option ThresholdOption, min uint16, max uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetColorTemperatureCallbackConfiguration), buf.Bytes())\n\tif err != nil {\n\t\treturn period, valueHasToChange, option, min, max, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 18 {\n\t\t\treturn period, valueHasToChange, option, min, max, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 18)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn period, valueHasToChange, option, min, max, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &period)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &valueHasToChange)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &option)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &min)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &max)\n\n\t}\n\n\treturn period, valueHasToChange, option, min, max, nil\n}", "title": "" }, { "docid": "91ee4802ae82fc8129c70cce3ad32006", "score": "0.42103258", "text": "func (o *IdentityCredentials) GetConfigOk() (map[string]interface{}, bool) {\n\tif o == nil || o.Config == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Config, true\n}", "title": "" }, { "docid": "7e967030f68e7e1d7e3ebe45acdd402b", "score": "0.4199551", "text": "func (client *Client) DescribeTraceLocationWithCallback(request *DescribeTraceLocationRequest, callback func(response *DescribeTraceLocationResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeTraceLocationResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeTraceLocation(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "bfec65f6feb174c65c81437511918745", "score": "0.41947", "text": "func (x *fastReflection_GetConfigurationDescriptorRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n}", "title": "" }, { "docid": "aed9240d93ba28eb1f3a0571043569cb", "score": "0.41926908", "text": "func (client *Client) DescribeChangeSetDetailWithCallback(request *DescribeChangeSetDetailRequest, callback func(response *DescribeChangeSetDetailResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeChangeSetDetailResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeChangeSetDetail(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "eadc76f87c6ab2ecdf1403bc5ddb83de", "score": "0.418308", "text": "func (x *fastReflection_GetConfigurationDescriptorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Config != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.Config.ProtoReflect())\n\t\tif !f(fd_GetConfigurationDescriptorResponse_config, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "093b6c2b88980a70706a69cd83a23ce2", "score": "0.416519", "text": "func (client *Client) DescribeCouponDetailWithCallback(request *DescribeCouponDetailRequest, callback func(response *DescribeCouponDetailResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeCouponDetailResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeCouponDetail(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "ff7d7f908f3be9ef84dc15dd5e46c5af", "score": "0.41584083", "text": "func (f *DefaultCommonFlags) ConfigProviderUrl() string {\n\treturn f.configProviderUrl\n}", "title": "" }, { "docid": "c14b5537031f3b3f9a12819791732daa", "score": "0.41429132", "text": "func CloudProviderConfigSecret(cloud *clientconfig.Cloud) ([]byte, error) {\n\tdomainID := cloud.AuthInfo.DomainID\n\tif domainID == \"\" {\n\t\tdomainID = cloud.AuthInfo.UserDomainID\n\t}\n\n\tdomainName := cloud.AuthInfo.DomainName\n\tif domainName == \"\" {\n\t\tdomainName = cloud.AuthInfo.UserDomainName\n\t}\n\n\t// We have to generate this config manually without \"go-ini\" library, because its\n\t// output data is incompatible with \"gcfg\".\n\t// For instance, if there is a string with a # character, then \"go-ini\" wraps it in bacticks,\n\t// like `aaa#bbb`, but gcfg doesn't recognize it and parses the data as `aaa, skipping\n\t// everything after the #.\n\t// For more information: https://bugzilla.redhat.com/show_bug.cgi?id=1771358\n\tvar res strings.Builder\n\tres.WriteString(\"[Global]\\n\")\n\tif cloud.AuthInfo.AuthURL != \"\" {\n\t\tres.WriteString(\"auth-url = \" + strconv.Quote(cloud.AuthInfo.AuthURL) + \"\\n\")\n\t}\n\tif cloud.AuthInfo.Username != \"\" {\n\t\tres.WriteString(\"username = \" + strconv.Quote(cloud.AuthInfo.Username) + \"\\n\")\n\t}\n\tif cloud.AuthInfo.Password != \"\" {\n\t\tres.WriteString(\"password = \" + strconv.Quote(cloud.AuthInfo.Password) + \"\\n\")\n\t}\n\tif cloud.AuthInfo.ProjectID != \"\" {\n\t\tres.WriteString(\"tenant-id = \" + strconv.Quote(cloud.AuthInfo.ProjectID) + \"\\n\")\n\t}\n\tif cloud.AuthInfo.ProjectName != \"\" {\n\t\tres.WriteString(\"tenant-name = \" + strconv.Quote(cloud.AuthInfo.ProjectName) + \"\\n\")\n\t}\n\tif domainID != \"\" {\n\t\tres.WriteString(\"domain-id = \" + strconv.Quote(domainID) + \"\\n\")\n\t}\n\tif domainName != \"\" {\n\t\tres.WriteString(\"domain-name = \" + strconv.Quote(domainName) + \"\\n\")\n\t}\n\tif cloud.RegionName != \"\" {\n\t\tres.WriteString(\"region = \" + strconv.Quote(cloud.RegionName) + \"\\n\")\n\t}\n\tif cloud.CACertFile != \"\" {\n\t\tres.WriteString(\"ca-file = /etc/kubernetes/static-pod-resources/configmaps/cloud-config/ca-bundle.pem\\n\")\n\t}\n\n\treturn []byte(res.String()), nil\n}", "title": "" }, { "docid": "fdcea151cce2055a4e08e55b857ea78b", "score": "0.41399133", "text": "func (client *Client) GetDetectionResultWithCallback(request *GetDetectionResultRequest, callback func(response *GetDetectionResultResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetDetectionResultResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GetDetectionResult(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "50ecf9bed4bbba52e38fe1563988ee6a", "score": "0.4137197", "text": "func (client *ConnectRestClient) GetConfig(connector string) (r ConnectorTasksConfig, e error) {\n\tresponse, e := requestAndGetResponse(\"GET\", client.connectEndPoint()+connector, nil)\n\tif e == nil {\n\t\terr := json.Unmarshal(response, &r)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e14aabb83f22bc3bd5c77fb8dfb17337", "score": "0.4130351", "text": "func (client *Client) GetProfileDetailWithCallback(request *GetProfileDetailRequest, callback func(response *GetProfileDetailResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetProfileDetailResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GetProfileDetail(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "b4ac947dd27a92497019ff8343e4b135", "score": "0.41214025", "text": "func (client *Client) DescribeContactGroupListWithCallback(request *DescribeContactGroupListRequest, callback func(response *DescribeContactGroupListResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeContactGroupListResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeContactGroupList(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "269a04fc913045403ed4fe781e086536", "score": "0.41099387", "text": "func GoogleCallback(db *gorm.DB) echo.HandlerFunc {\n\tconf := oauth2.Config{\n\t\tClientID: config.ClientID,\n\t\tClientSecret: config.ClientSecret,\n\t\tRedirectURL: config.RedirectURL,\n\t\tScopes: []string{config.Scope, \"profile\"},\n\t\tEndpoint: google.Endpoint,\n\t}\n\turl := \"https://www.googleapis.com/oauth2/v2/userinfo/\"\n\treturn handleCallback(db, conf, url)\n\n}", "title": "" }, { "docid": "1b97eef20c3b2396aab564ac0f78c429", "score": "0.41093367", "text": "func (client *Client) ModifyImageGatewayConfigWithCallback(request *ModifyImageGatewayConfigRequest, callback func(response *ModifyImageGatewayConfigResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *ModifyImageGatewayConfigResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.ModifyImageGatewayConfig(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "ec9ef104f6678f581373c925e83195db", "score": "0.41067103", "text": "func CreateDescribeOssCallbackSettingResponse() (response *DescribeOssCallbackSettingResponse) {\n\tresponse = &DescribeOssCallbackSettingResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "3fca69209be8e7ae7ff10f394cd41d22", "score": "0.4106091", "text": "func (*CallBackUrl) Descriptor() ([]byte, []int) {\n\treturn file_authenticator_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "d35fcacd61910cad5d709baa8025f6d2", "score": "0.41012248", "text": "func (*GetConfigStreamRequest) Descriptor() ([]byte, []int) {\n\treturn file_zenoss_cloud_collection_cfg_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "494331ad6e8b1c46fc56e2cbf62a8918", "score": "0.40952387", "text": "func (h *Handler) GetCallback(c echo.Context) error {\n\tuser, err := echogothic.CompleteUserAuth(c)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn echo.ErrBadRequest\n\t}\n\n\tlog.Println(user)\n\n\treturn c.JSON(200, map[string]goth.User{\"auth\": user})\n}", "title": "" }, { "docid": "8c5ff1ebcf4fab247b79bb14b267e28d", "score": "0.40942368", "text": "func (k *KubernetesSpecification) getConfig(cnsiRecord *interfaces.CNSIRecord, tokenRecord *interfaces.TokenRecord) (*rest.Config, error) {\n\tmasterURL := cnsiRecord.APIEndpoint.String()\n\treturn k.GetConfigForEndpoint(masterURL, *tokenRecord)\n}", "title": "" }, { "docid": "272a1089994e331f55d197f561b93ce3", "score": "0.4092833", "text": "func (client *Client) DescribeBackMenuWithCallback(request *DescribeBackMenuRequest, callback func(response *DescribeBackMenuResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeBackMenuResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeBackMenu(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "cf43fd8b288b5cc4c35e748f6fb51ab6", "score": "0.40920937", "text": "func (client *Client) DescribeScuDeductFactorWithCallback(request *DescribeScuDeductFactorRequest, callback func(response *DescribeScuDeductFactorResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeScuDeductFactorResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeScuDeductFactor(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "9eea5fec7de1e41144244236c98a2e7b", "score": "0.4079572", "text": "func GetClusterConfig(c *gin.Context) {\n\tlog := logger.WithFields(logrus.Fields{\"tag\": constants.TagFetchClusterConfig})\n\tcommonCluster, ok := GetCommonClusterFromRequest(c)\n\tif ok != true {\n\t\treturn\n\t}\n\tconfig, err := commonCluster.GetK8sConfig()\n\tif err != nil {\n\t\tlog.Errorf(\"Error during getting config: %s\", err.Error())\n\t\tc.JSON(http.StatusBadRequest, components.ErrorResponse{\n\t\t\tCode: http.StatusBadRequest,\n\t\t\tMessage: \"Error during getting config\",\n\t\t\tError: err.Error(),\n\t\t})\n\t\treturn\n\t}\n\n\t// Force persist keys\n\tpersistParam := c.DefaultQuery(\"persist\", \"false\")\n\tpersist, err := strconv.ParseBool(persistParam)\n\tif err != nil {\n\t\tpersist = false\n\t}\n\tif persist {\n\t\tcluster.PersistKubernetesKeys(commonCluster)\n\t}\n\n\tcontentType := c.NegotiateFormat(gin.MIMEPlain, gin.MIMEJSON)\n\tlog.Debug(\"Content-Type: \", contentType)\n\tswitch contentType {\n\tcase gin.MIMEJSON:\n\t\tc.JSON(http.StatusOK, components.GetClusterConfigResponse{\n\t\t\tStatus: http.StatusOK,\n\t\t\tData: string(config),\n\t\t})\n\tdefault:\n\t\tc.String(http.StatusOK, string(config))\n\t}\n\treturn\n}", "title": "" }, { "docid": "e02a0f93cd737e00a1e96801e390b3a1", "score": "0.40783125", "text": "func (client *Client) GetBalanceSheetInfoWithCallback(request *GetBalanceSheetInfoRequest, callback func(response *GetBalanceSheetInfoResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetBalanceSheetInfoResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GetBalanceSheetInfo(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "8bf02d514cf54b47c931b51549b23add", "score": "0.4075964", "text": "func CreateCustomTaskExtensionCallbackConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {\n return NewCustomTaskExtensionCallbackConfiguration(), nil\n}", "title": "" }, { "docid": "437f4ed1b4168ccebd249499e3c23e03", "score": "0.40757278", "text": "func (client *Client) GetJobDataUploadParamsWithCallback(request *GetJobDataUploadParamsRequest, callback func(response *GetJobDataUploadParamsResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetJobDataUploadParamsResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GetJobDataUploadParams(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "22246d1a94e96887aca13ccbb4bad3d4", "score": "0.40704983", "text": "func (a *AssuredEndpoints) GivenCallbackEndpoint(ctx context.Context, call *Call) (interface{}, error) {\n\ta.callbackCalls.AddAt(call.Headers[AssuredCallbackKey], call)\n\t_ = a.logger.Log(\"message\", \"assured callback set\", \"key\", call.Headers[AssuredCallbackKey], \"target\", call.Headers[AssuredCallbackTarget])\n\n\treturn call, nil\n}", "title": "" }, { "docid": "4cd5b6c978c56eacbe8bc89d7483a4f2", "score": "0.4064629", "text": "func (client *Client) GetSecretParameterWithCallback(request *GetSecretParameterRequest, callback func(response *GetSecretParameterResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetSecretParameterResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GetSecretParameter(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "0cb9778c5157dce3a3eb74324bd7aad9", "score": "0.40516523", "text": "func (client *Client) GetFacesWithChan(request *GetFacesRequest) (<-chan *GetFacesResponse, <-chan error) {\n\tresponseChan := make(chan *GetFacesResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.GetFaces(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}", "title": "" }, { "docid": "aea58f3c4ae35ebcabfc6dec47fbc10f", "score": "0.40506217", "text": "func (client *Client) DescribeStoreConfigWithChan(request *DescribeStoreConfigRequest) (<-chan *DescribeStoreConfigResponse, <-chan error) {\n\tresponseChan := make(chan *DescribeStoreConfigResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.DescribeStoreConfig(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}", "title": "" }, { "docid": "e6292a1453774e598e46bcbf0f9d19f6", "score": "0.40494606", "text": "func (client *Client) DescribeSynchronizationJobStatusWithCallback(request *DescribeSynchronizationJobStatusRequest, callback func(response *DescribeSynchronizationJobStatusResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeSynchronizationJobStatusResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeSynchronizationJobStatus(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "015b6a928d7706d8ab4f60100c555bac", "score": "0.4048716", "text": "func (_ValidatorUtils *ValidatorUtilsCallerSession) GetConfig(rollup common.Address) (struct {\n\tConfirmPeriodBlocks *big.Int\n\tExtraChallengeTimeBlocks *big.Int\n\tArbGasSpeedLimitPerBlock *big.Int\n\tBaseStake *big.Int\n\tStakeToken common.Address\n}, error) {\n\treturn _ValidatorUtils.Contract.GetConfig(&_ValidatorUtils.CallOpts, rollup)\n}", "title": "" }, { "docid": "7cfd4c44b6a50958dac423a4ecfdcc08", "score": "0.40370268", "text": "func getConfig() {\n\tfs := flag.NewFlagSet(\"twitter-to-email\", flag.ExitOnError)\n\n\tbucket = fs.String(\"bucket\", \"\", \"S3 Bucket\")\n\tconsumer_api_key = fs.String(\"consumer-api-key\", \"\", \"Twitter Consumer API Key\")\n\tconsumer_api_secret_key = fs.String(\"consumer-api-secret-key\", \"\", \"Twitter Consumer API Secret Key\")\n\taccess_token = fs.String(\"access-token\", \"\", \"Twitter Access token\")\n\taccess_token_secret = fs.String(\"access-token-secret\", \"\", \"Twitter Access token secret\")\n\temail = fs.String(\"email\", \"\", \"Email\")\n\n\tff.Parse(fs, []string{},\n\t\tff.WithConfigFile(\"config.json\"),\n\t\tff.WithConfigFileParser(ff.JSONParser))\n}", "title": "" }, { "docid": "9b8375756171b7d1163eb85b483027e7", "score": "0.4033392", "text": "func (device *ColorV2Bricklet) GetIlluminanceCallbackConfiguration() (period uint32, valueHasToChange bool, option ThresholdOption, min uint32, max uint32, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIlluminanceCallbackConfiguration), buf.Bytes())\n\tif err != nil {\n\t\treturn period, valueHasToChange, option, min, max, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 22 {\n\t\t\treturn period, valueHasToChange, option, min, max, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 22)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn period, valueHasToChange, option, min, max, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &period)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &valueHasToChange)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &option)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &min)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &max)\n\n\t}\n\n\treturn period, valueHasToChange, option, min, max, nil\n}", "title": "" }, { "docid": "43418cde85e4ef8c92df6e6dbfc33a4b", "score": "0.40160015", "text": "func (*Config) List(c context.Context, req *config.ListRequest) (*config.ListResponse, error) {\n\trsp := &config.ListResponse{}\n\tif err := proto.PageQuery(c, req.GetPageSize(), req.GetPageToken(), rsp, datastore.NewQuery(model.ConfigKind), func(cfg *model.Config) error {\n\t\trsp.Configs = append(rsp.Configs, &cfg.Config)\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\treturn rsp, nil\n}", "title": "" }, { "docid": "41b17b8ca576b9ca8e6fa7670e8a3909", "score": "0.40158772", "text": "func (client *Client) GetVideoListWithCallback(request *GetVideoListRequest, callback func(response *GetVideoListResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetVideoListResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GetVideoList(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "44e667f7b432a3ccdcdfba85882927fb", "score": "0.4009796", "text": "func (c *WireGuardContainer) GetDevicePeerQuickConfig(ctx echo.Context) error {\n\tquickConf, err := c.getDevicePeerQuickConfig(ctx)\n\tif err != nil {\n\t\tctx.Logger().Errorf(\"failed to get quick config: %s\", err)\n\t\treturn ctx.JSON(http.StatusBadRequest, models.Error{\n\t\t\tCode: \"request_params_error\",\n\t\t\tMessage: err.Error(),\n\t\t})\n\t}\n\n\treturn ctx.Stream(http.StatusOK, \"text/plain\", quickConf)\n}", "title": "" } ]
d6e11e8455dffff21a04aaa88c7c37ed
SetDefaults hydrates default values in the client lock collection get params (not the query body). All values with no default are reset to their zero value.
[ { "docid": "24c3ebb9edefcfd049de9f5febc5f24f", "score": "0.8077616", "text": "func (o *ClientLockCollectionGetParams) SetDefaults() {\n\tvar (\n\t\treturnRecordsDefault = bool(true)\n\n\t\treturnTimeoutDefault = int64(15)\n\t)\n\n\tval := ClientLockCollectionGetParams{\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}", "title": "" } ]
[ { "docid": "159f4653146d47a105cbb2c5f4b6ad3f", "score": "0.7307186", "text": "func SetDefaults(kv map[string]string) {\n\tcheckDefaultClient()\n\tc.SetDefaults(kv)\n}", "title": "" }, { "docid": "e7d59df962fdec819cae0d23f88d3525", "score": "0.7220359", "text": "func (o *SnaplockComplianceClockGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "0adaf94a5127e4309e650ec4807ecf46", "score": "0.7169535", "text": "func (o *SwitchCollectionGetParams) SetDefaults() {\n\tvar (\n\t\treturnRecordsDefault = bool(true)\n\n\t\treturnTimeoutDefault = int64(15)\n\t)\n\n\tval := SwitchCollectionGetParams{\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}", "title": "" }, { "docid": "54a757c4846a847d0a83de01f7aadc94", "score": "0.70273036", "text": "func (o *CifsServiceCollectionGetParams) SetDefaults() {\n\tvar (\n\t\treturnRecordsDefault = bool(true)\n\n\t\treturnTimeoutDefault = int64(15)\n\t)\n\n\tval := CifsServiceCollectionGetParams{\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}", "title": "" }, { "docid": "824c7163828256fb5c61b522bc25dcd3", "score": "0.7020609", "text": "func (o *CifsDomainPreferredDcCollectionGetParams) SetDefaults() {\n\tvar (\n\t\tneedStatusDefault = bool(false)\n\n\t\treturnRecordsDefault = bool(true)\n\n\t\treturnTimeoutDefault = int64(15)\n\t)\n\n\tval := CifsDomainPreferredDcCollectionGetParams{\n\t\tNeedStatus: &needStatusDefault,\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}", "title": "" }, { "docid": "2ea3ee58b9e6b96060b061974362ed0f", "score": "0.7018604", "text": "func (o *StorageBridgeCollectionGetParams) SetDefaults() {\n\tvar (\n\t\treturnRecordsDefault = bool(true)\n\n\t\treturnTimeoutDefault = int64(15)\n\t)\n\n\tval := StorageBridgeCollectionGetParams{\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}", "title": "" }, { "docid": "785222e466ff48f621de0a40308563df", "score": "0.6941858", "text": "func (o *LunGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "f6c22e29800d25d19024c6d60e5f361e", "score": "0.6889931", "text": "func (o *FpolicyConnectionCollectionGetParams) SetDefaults() {\n\tvar (\n\t\treturnRecordsDefault = bool(true)\n\n\t\treturnTimeoutDefault = int64(15)\n\t)\n\n\tval := FpolicyConnectionCollectionGetParams{\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}", "title": "" }, { "docid": "71117daa9b75d0cbc8c0e5612b493016", "score": "0.67394847", "text": "func (o *GetResourceParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "a0476dbc00f72fc070b99e53594523d9", "score": "0.6733004", "text": "func (o *GetClusterHostRequirementsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "6ebc8c5ff7f2b550832d10887450ef3c", "score": "0.6711255", "text": "func (o *CandidatesParams) SetDefaults() {\n\tvar (\n\t\tincludeStakesDefault = bool(false)\n\n\t\tnotShowStakesDefault = bool(false)\n\n\t\tstatusDefault = string(\"all\")\n\t)\n\n\tval := CandidatesParams{\n\t\tIncludeStakes: &includeStakesDefault,\n\t\tNotShowStakes: &notShowStakesDefault,\n\t\tStatus: &statusDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "381c8f69a4dcbe52e64428e9b692afb3", "score": "0.6667513", "text": "func (c *AdditionalFlags) SetDefaults() {\n\tif c.Server == nil {\n\t\tc.Server = []string{}\n\t}\n\tif c.Clients == nil {\n\t\tc.Clients = []string{}\n\t}\n}", "title": "" }, { "docid": "adefd56cdf935c9b261bf8ba8c629f5d", "score": "0.6658034", "text": "func (o *GetClustersParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "58875daa2aa4abd70d5bf2500e5f58c0", "score": "0.66300726", "text": "func (o *RefreshPricingParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "bc4bd12280cfc98ce1ffc31159538170", "score": "0.6611555", "text": "func (o *SyncUsingPOSTParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "8d9de8324e186b86ca685504ca550856", "score": "0.6593835", "text": "func (o *UpdateDiscoverCloudAzureAccountClientIDParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "06d7c62818b2474d407a583349cf1b30", "score": "0.65708387", "text": "func (o *GetPeersParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "2181e72c4de2339db1ee644a1350fbe8", "score": "0.65699875", "text": "func (o *GetAllVariablesUsingGETParams) SetDefaults() {\n\tvar (\n\t\tdollarOrderbyDefault = string(\"name desc\")\n\n\t\tdollarSkipDefault = string(\"0\")\n\n\t\tdollarTopDefault = string(\"25\")\n\n\t\tpageDefault = string(\"0\")\n\t)\n\n\tval := GetAllVariablesUsingGETParams{\n\t\tDollarOrderby: &dollarOrderbyDefault,\n\t\tDollarSkip: &dollarSkipDefault,\n\t\tDollarTop: &dollarTopDefault,\n\t\tPage: &pageDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "67f356fb623745ccca0f931b620ace60", "score": "0.65495133", "text": "func (o *GetDatacentersConnectionParams) SetDefaults() {\n\tvar (\n\t\tcontentLanguageDefault = string(\"en-US\")\n\t)\n\n\tval := GetDatacentersConnectionParams{\n\t\tContentLanguage: &contentLanguageDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "5bdd3a2106a4b952a0b1cb32a8c6f9e8", "score": "0.6534545", "text": "func (e *ZookeeperCluster) SetDefaults() {\n\tc := &e.Spec\n\tif len(c.Repository) == 0 {\n\t\tc.Repository = defaultRepository\n\t}\n\n\tif len(c.Version) == 0 {\n\t\tc.Version = DefaultZookeeperVersion\n\t}\n\n\tc.Version = strings.TrimLeft(c.Version, \"v\")\n}", "title": "" }, { "docid": "f255a9a7109de1385b39ac4a3a66eeac", "score": "0.6517379", "text": "func (o *GenerateDryRunInvoiceParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "10ae0dc31b01725f3ba5cf9bca47263d", "score": "0.64984643", "text": "func (o *PatchV1ServicesServiceIDParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "3725b0d86886c39a4856536e0b0c3ee9", "score": "0.6482349", "text": "func (o *ListAttachmentsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "e568a87f4c57bb91dafcc4c382cf2201", "score": "0.6467335", "text": "func (o *KeyManagerKeysGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "ebece2f605a6ab197b5cc5873ef6d234", "score": "0.6455924", "text": "func (o *GetLogProofParams) SetDefaults() {\n\tvar (\n\t\tfirstSizeDefault = int64(1)\n\t)\n\n\tval := GetLogProofParams{\n\t\tFirstSize: &firstSizeDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "5682bb31342b2ed88c980700efede20a", "score": "0.64539933", "text": "func (o *GetNamespaceQuotasUsingGETParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "52b616c784a2c177d1c1a73ec39dd6ac", "score": "0.6450436", "text": "func (o *GetV1ServicesServiceIDDependenciesParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "1fbe67adcaea5d142277b71f11588cc4", "score": "0.6413999", "text": "func (o *GetConfigurationDetectionIDsV2Params) SetDefaults() {\n\tvar (\n\t\tlimitDefault = int64(500)\n\n\t\tsortDefault = string(\"timestamp|desc\")\n\t)\n\n\tval := GetConfigurationDetectionIDsV2Params{\n\t\tLimit: &limitDefault,\n\t\tSort: &sortDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "70998cfe17cfe7ff1ba73289b3873b0c", "score": "0.64074963", "text": "func (o *UpdateDNSServerParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "d134dadb762b69d1ff3c7b596ef9417a", "score": "0.6406788", "text": "func (o *ListCatalogParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "c0f5b6e8332063e8c1cc6cfecc33d889", "score": "0.64063686", "text": "func (o *SetCliSecretParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "8883249966b2b1c0d6897b46114c6bc1", "score": "0.6390113", "text": "func (o *ListUniversesParams) SetDefaults() {\n\tvar (\n\t\tnameDefault = string(\"null\")\n\t)\n\n\tval := ListUniversesParams{\n\t\tName: &nameDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "6ac9324e2060770cb8f32f8cf72b495a", "score": "0.6383939", "text": "func (o *ResonateUserGetUserRestrictedParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "076d170d6c260ef68411ca82b73d7119", "score": "0.63631654", "text": "func (o *GetControllerServicesFromGroupParams) SetDefaults() {\n\tvar (\n\t\tincludeAncestorGroupsDefault = bool(true)\n\n\t\tincludeDescendantGroupsDefault = bool(false)\n\t)\n\n\tval := GetControllerServicesFromGroupParams{\n\t\tIncludeAncestorGroups: &includeAncestorGroupsDefault,\n\t\tIncludeDescendantGroups: &includeDescendantGroupsDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "3a5b8319a9ba5db135a081e5ddf625bc", "score": "0.63526696", "text": "func (o *TransferVersionParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "a6aa57c09ae6c22be7eacee2bbe9c30f", "score": "0.633774", "text": "func (o *GetBundlesParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "d91ca75512ce91ee48b7dd42d6c771e0", "score": "0.6329647", "text": "func (o *GetCombinedCloudClustersParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "60e46b0f9f50d4fb7909e3156fa20047", "score": "0.6320355", "text": "func (o *GetCostsItemsByDeploymentParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "09f2ccc4869fa1331d24fcd2f67e6e0b", "score": "0.6308367", "text": "func (v *VaultService) SetDefaults() bool {\n\tchanged := false\n\tvs := &v.Spec\n\tif vs.Nodes == 0 {\n\t\tvs.Nodes = 1\n\t\tchanged = true\n\t}\n\tif len(vs.BaseImage) == 0 {\n\t\tvs.BaseImage = defaultBaseImage\n\t\tchanged = true\n\t}\n\tif len(vs.Version) == 0 {\n\t\tvs.Version = defaultVersion\n\t\tchanged = true\n\t}\n\tif vs.TLS == nil {\n\t\tvs.TLS = &TLSPolicy{Static: &StaticTLS{\n\t\t\tServerSecret: DefaultVaultServerTLSSecretName(v.Name),\n\t\t\tClientSecret: DefaultVaultClientTLSSecretName(v.Name),\n\t\t}}\n\t\tchanged = true\n\t}\n\treturn changed\n}", "title": "" }, { "docid": "851c16ba7ae488aa4b85e50cf42cded8", "score": "0.6307854", "text": "func (o *PostDevicesRefreshParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "7e62d4c3dc24ed09ec154e97e82d8043", "score": "0.6304739", "text": "func (o *GetRepoRequirementsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "f4f352b8b4174b60b425fc551f64315d", "score": "0.6284917", "text": "func (o *GetStaticScriptsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "290f78e42ae96926de0ec760e333fd55", "score": "0.6284259", "text": "func (o *CopyProtectedEntityParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "b44844f35bfc853a5232cd2f60476e5d", "score": "0.6283941", "text": "func (o *AccountsGetAccountsParams) SetDefaults() {\n\tvar (\n\t\tpageDefault = int32(1)\n\n\t\tpageSizeDefault = int32(25)\n\t)\n\n\tval := AccountsGetAccountsParams{\n\t\tPage: &pageDefault,\n\t\tPageSize: &pageSizeDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "607fc924835da3fa0d880242d6149121", "score": "0.62678206", "text": "func (o *ListClusterHostsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "7b3fd4b2e9cb6990d636b82ab45a1b6e", "score": "0.62635684", "text": "func (o *GetChangesParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "29ab1a3555291e524160ef96567f88d3", "score": "0.6262822", "text": "func (o *QueryScheduledScansParams) SetDefaults() {\n\tvar (\n\t\tlimitDefault = int64(500)\n\n\t\toffsetDefault = int64(0)\n\n\t\tsortDefault = string(\"schedule.start_timestamp|desc\")\n\t)\n\n\tval := QueryScheduledScansParams{\n\t\tLimit: &limitDefault,\n\t\tOffset: &offsetDefault,\n\t\tSort: sortDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "95165201e1a267a0cbea6913e6c43743", "score": "0.6261853", "text": "func (s *Spec) setDefaults() {\n\tif s.ConcurrentRequests == 0 {\n\t\ts.ConcurrentRequests = CONCURRENT_REQUESTS\n\t}\n\tif s.OutputLevel == \"\" {\n\t\ts.OutputLevel = OUTPUT_LEVEL\n\t}\n\tif s.MaxAttempts == 0 {\n\t\ts.MaxAttempts = MAX_ATTEMPTS\n\t}\n\tif s.Uri == \"\" {\n\t\ts.Uri = URI\n\t}\n\tif s.Port == 0 {\n\t\tif s.Ssl {\n\t\t\ts.Port = SSL_PORT\n\t\t} else {\n\t\t\ts.Port = NON_SSL_PORT\n\t\t}\n\t}\n\tif s.Method == \"\" {\n\t\ts.Method = METHOD\n\t}\n\tif s.RequestHeaders == nil {\n\t\ts.RequestHeaders = new(http.Header)\n\t}\n\tif s.StatusCode == 0 {\n\t\ts.StatusCode = STATUS_CODE\n\t}\n\tif s.MaxTimeElapsed == 0 {\n\t\ts.MaxTimeElapsed = MAX_TIME_ELAPSED\n\t}\n\tif s.ResponseHeaders == nil {\n\t\ts.ResponseHeaders = new(http.Header)\n\t}\n\n\tfor _, spec := range s.Specs {\n\t\tspec.inheritDefaults(s)\n\t}\n}", "title": "" }, { "docid": "381065a5ba3c8739ca272fdf306b20ae", "score": "0.6256307", "text": "func (s *PolicyDocker) SetDefaults() {\n\ts.KeepSemver = utl.NewTrue()\n}", "title": "" }, { "docid": "b7f992095ce6ddf4e282d0e5a32bf869", "score": "0.62514603", "text": "func (o *VolumeModifyParams) SetDefaults() {\n\tvar (\n\t\tpreserveLunIdsDefault = bool(false)\n\n\t\treturnTimeoutDefault = int64(0)\n\n\t\tscheduledSnapshotNamingSchemeDefault = string(\"create_time\")\n\n\t\tsizingMethodDefault = string(\"use_existing_resources\")\n\n\t\tsnapshotDirectoryAccessEnabledDefault = bool(true)\n\t)\n\n\tval := VolumeModifyParams{\n\t\tPreserveLunIds: &preserveLunIdsDefault,\n\t\tReturnTimeout: &returnTimeoutDefault,\n\t\tScheduledSnapshotNamingScheme: &scheduledSnapshotNamingSchemeDefault,\n\t\tSizingMethod: &sizingMethodDefault,\n\t\tSnapshotDirectoryAccessEnabled: &snapshotDirectoryAccessEnabledDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "6687f8b5027f065254aa815c026570a1", "score": "0.6238653", "text": "func (o *DescribeSocks5ServerParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "a53bd962e2e43c62cd941d297527055a", "score": "0.6238497", "text": "func (o *GetProvenanceParams) SetDefaults() {\n\tvar (\n\t\tincrementalResultsDefault = bool(true)\n\n\t\tsummarizeDefault = bool(false)\n\t)\n\n\tval := GetProvenanceParams{\n\t\tIncrementalResults: &incrementalResultsDefault,\n\t\tSummarize: &summarizeDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "809aaa5c0dd76e180ab4a2655179dcf8", "score": "0.6215058", "text": "func (o *ListRefundsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "b5b4223e3e1273a6da2c51419237ed26", "score": "0.6208856", "text": "func (o *SystemUptimeMsGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "caa381177fc7dfdc988846e1048c760b", "score": "0.6186248", "text": "func (opts *ListOptions) SetDefaultValues() {\n\tif opts.PageSize <= 0 {\n\t\topts.PageSize = setting.API.DefaultPagingNum\n\t}\n\tif opts.PageSize > setting.API.MaxResponseItems {\n\t\topts.PageSize = setting.API.MaxResponseItems\n\t}\n\tif opts.Page <= 0 {\n\t\topts.Page = 1\n\t}\n}", "title": "" }, { "docid": "f30a97c821c133807dad50a766d55f90", "score": "0.6178813", "text": "func (o *GetLatestFlowVersionMetadataParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "3c841b7cf562ffb6376d54975e9e9ca6", "score": "0.61596715", "text": "func (o *UpdateAlertChannelParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "008497613d94ac076ed3245f3e9a2238", "score": "0.6158627", "text": "func (o *DeleteOrganizationMembershipsParams) SetDefaults() {\n\tvar (\n\t\tforceDefault = bool(false)\n\t)\n\n\tval := DeleteOrganizationMembershipsParams{\n\t\tForce: &forceDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "4c7777632dcc685e046c09d57cb1bbc7", "score": "0.61490625", "text": "func (o *CreateModelVersionParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "1ea046f3636c0999e1b0dc7f5d410119", "score": "0.61462706", "text": "func (o *RetrieveEmailsByCIDParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "ff2f3b480f2d815d20cd848f41707b48", "score": "0.6144804", "text": "func (o *GetRepositories1Params) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "50922cdcdb79caf1fc89e8aeb7f3b531", "score": "0.6144525", "text": "func (r *Poloniex) SetDefaults() {\n\tr.Enabled = true\n\tr.LiveOrderBook = utils.NewConcurrentMap()\n}", "title": "" }, { "docid": "b68dd6d32ea41782f93b7f023005b2e4", "score": "0.61438286", "text": "func (o *ClientLockCollectionGetParams) WithDefaults() *ClientLockCollectionGetParams {\n\to.SetDefaults()\n\treturn o\n}", "title": "" }, { "docid": "1b3de0f85a90ecd40c57878f2fda15b1", "score": "0.614268", "text": "func (o *UnbindHostParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "8a143a484374df8a8ece4cad08f10926", "score": "0.6133668", "text": "func (o *GetMigrateTransmittersParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "835c766fcb1f832617be0bb178d72624", "score": "0.61330825", "text": "func (o *ProtectedDryRunTxsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "7934028ed1d2994c88078c8cf2d242e3", "score": "0.61246514", "text": "func (r *Foxbit) SetDefaults() {\n\tr.Enabled = true\n\tr.LiveOrderBook = utils.NewConcurrentMap()\n}", "title": "" }, { "docid": "46b7b45e80d911dffbb3f945785b1999", "score": "0.61196136", "text": "func (o *URLFindListParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "40080bb01c592485b2999295432a8229", "score": "0.61140114", "text": "func (o *ServiceInstanceUpdateParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "ca1de6c59173dde546ac9ca0c66593e9", "score": "0.61139315", "text": "func (o *DeleteOrganizationAutoInviteParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "24e55042ee96a52a4fbecf3640b53dbc", "score": "0.61135536", "text": "func (this *HttpClient) Defaults(defaults Map) *HttpClient {\n\toptions, headers := parseMap(defaults)\n\n\t// merge options\n\tif this.options == nil {\n\t\tthis.options = options\n\t} else {\n\t\tfor k, v := range options {\n\t\t\tthis.options[k] = v\n\t\t}\n\t}\n\n\t// merge headers\n\tif this.Headers == nil {\n\t\tthis.Headers = headers\n\t} else {\n\t\tfor k, v := range headers {\n\t\t\tthis.Headers[k] = v\n\t\t}\n\t}\n\n\treturn this\n}", "title": "" }, { "docid": "ffeef6810dd84815a0a9c394228da59b", "score": "0.6109209", "text": "func (o *DeleteSwitchParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "9fca65d505fb5a7d5e733b31955842da", "score": "0.6108559", "text": "func setClientCfgDefaults(cfg *ClientCfg) {\n\tif cfg.PeersRefreshInterval == 0 {\n\t\tcfg.PeersRefreshInterval = 2 * time.Second\n\t}\n\tif cfg.Timeout == 0 {\n\t\tcfg.Timeout = 10 * time.Second\n\t}\n\tif cfg.ConnectionsPerPeer == 0 {\n\t\tcfg.ConnectionsPerPeer = maxInt(1, runtime.NumCPU()/2)\n\t}\n}", "title": "" }, { "docid": "8b2bf6fe2ab29e771d4d8424d5548a18", "score": "0.61043954", "text": "func (o *GetLatestTimestampParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "94eeefe01134105310ef17d909aac967", "score": "0.6103594", "text": "func (o *IscsiCredentialsDeleteParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "36872f249f08c3f7981b2c321ffe0000", "score": "0.6087132", "text": "func (o *GetV1MetricsIncidentsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "71cdaa465bfcc34591ef452214320681", "score": "0.60771316", "text": "func (o *CreateDefaultConstraintParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "7d500f3363e431671e88b98cb2ae8c27", "score": "0.6076254", "text": "func SetDefaultFields(fields Map) {\n\tstd.fields = fields\n}", "title": "" }, { "docid": "c7f9c1886b3c3ba17e930bad16355a47", "score": "0.6074867", "text": "func (o *FindParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "bcf36e15babfbd51bd17d764826179ba", "score": "0.60721576", "text": "func (o *CacheServiceRowCacheCapacityPostParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "20f48e4f356a4aa6cfc60ebe1a548cb2", "score": "0.6071716", "text": "func (o *CreateFutureInvoiceParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "f3b55ce4251ee21a03b901843b25ce6b", "score": "0.6065946", "text": "func (o *SystemSummaryFindListParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "2a1fbe43e82e91f8ac2c370c5c7ef7f9", "score": "0.6052056", "text": "func (o *DocumentPostResumesParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "2c462ceec115ba7b4c8d4db612beeda1", "score": "0.6050161", "text": "func (o *DeleteWorkspaceParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "ec50d4b90a2a205222049651c1f18fd2", "score": "0.60497135", "text": "func (cfg *ClientConfig) SetDefault() error {\n\tif cfg.URL == \"\" {\n\t\treturn errors.New(\"empty service url\")\n\t}\n\n\tif cfg.OperationTimeout == 0 {\n\t\tcfg.OperationTimeout = defaultOpTimeout\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f2555fe99534acc7d357198d5cf07b85", "score": "0.60476285", "text": "func (cs *ResourceSpec) SetDefaults(ctx context.Context) {\n\tif cs.FieldWithDefault == \"\" {\n\t\tcs.FieldWithDefault = \"I'm a default.\"\n\t}\n\tif cs.FieldWithContextDefault == \"\" {\n\t\toc, ok := ctx.Value(onContextKey{}).(*OnContext)\n\t\tif ok {\n\t\t\tcs.FieldWithContextDefault = oc.Value\n\t\t}\n\t}\n\tif cs.FieldThatsImmutableWithDefault == \"\" {\n\t\tcs.FieldThatsImmutableWithDefault = \"this is another default value\"\n\t}\n}", "title": "" }, { "docid": "be3ec95e1d26a2563d61080d70a4ea56", "score": "0.6043886", "text": "func (o *GetRenterDownloadasyncSiapathParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "1e76b49e62c772d94d8c37646397114f", "score": "0.60385954", "text": "func (o *UpdateVMFolderParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "de7b2d9a611182188e62f15c91b69612", "score": "0.6034379", "text": "func (c *PingParsing) SetDefaults() {\n\tif c.Count == nil {\n\t\tdefValue := 10\n\t\tc.Count = &defValue\n\t}\n\n\tif c.Deadline == nil {\n\t\tdefValue := 15 * time.Second\n\t\tc.Deadline = &defValue\n\t}\n\n\tif c.Timeout == nil {\n\t\tdefValue := 10 * time.Second\n\t\tc.Timeout = &defValue\n\t}\n}", "title": "" }, { "docid": "664cf9d2b50b0e789a2f225e082e28ac", "score": "0.6034194", "text": "func (o *PatchV1IncidentsIncidentIDParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "57f7b91cad41ff5ca16a2ef16a1c66e9", "score": "0.60251266", "text": "func (o *PostDevicesBackupsParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "67e44b9d8a196f9df79e6d66f73c4dab", "score": "0.60249555", "text": "func (o *UploadBackupParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "55c1cce9b21dd5f0b3a1d3c32cbd5da2", "score": "0.601676", "text": "func (o *ExtrasImageAttachmentsListParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "086c8e7f132647c34149d288208a3370", "score": "0.6014253", "text": "func (o *PatchV1IntegrationsStatuspageConnectionsConnectionIDParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "13c0aba3ac3b8f0e4a1512a532b9fec8", "score": "0.6010044", "text": "func (o *PostWalletInitParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "7eae840fe582713c383ec93043bde720", "score": "0.6006673", "text": "func (o *GetCostsChartsByDeploymentParams) SetDefaults() {\n\tvar (\n\t\tbucketingStrategyDefault = string(\"Daily\")\n\t)\n\n\tval := GetCostsChartsByDeploymentParams{\n\t\tBucketingStrategy: &bucketingStrategyDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "dedfbc8512dd2149b58a39b59ddb367b", "score": "0.6003285", "text": "func (s *Policy) SetDefaults() {\n\ts.LastModified = utl.NewTrue()\n\ts.LastDownloaded = utl.NewTrue()\n\ts.Common = (&PolicyCommon{}).GetDefaults()\n\ts.Docker = (&PolicyDocker{}).GetDefaults()\n}", "title": "" }, { "docid": "1a907e6d0d66bafdc69babe401560341", "score": "0.6000655", "text": "func (o *UpdateAccountParams) SetDefaults() {\n\tvar (\n\t\ttreatNullAsResetDefault = bool(false)\n\t)\n\n\tval := UpdateAccountParams{\n\t\tTreatNullAsReset: &treatNullAsResetDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "title": "" }, { "docid": "548af832735d28954f0831ae89f3c7f1", "score": "0.59952676", "text": "func (o *GetBlueprintResourcesPlanUsingGET1Params) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "60c960a7c6dd550d789abd28f8038f11", "score": "0.598073", "text": "func (o *StorageServiceLoggingLevelPostParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" } ]
2f1f67e8b476763e90422761b6311994
Updates orchestrator statistics in the database
[ { "docid": "5c81afd9137f8def6cef22dd6f3a2d60", "score": "0.6184298", "text": "func UpdateOrchestrator(x model.Orchestrator) {\n\tstatement, err := sqldb.Prepare(\"UPDATE Orchestrators SET ServiceURI=?, LastRewardRound=?, RewardCut=?, FeeShare=?, DelegatedState=?, ActivationRound=?, DeactivationRound=?, Active=?, Status=?, PricePerPixel=?, UpdatedAt=? WHERE Address=?\")\n\tif err != nil {\n\t\tlog.Errorln(\"Error in updating orchestrator\", x.Address)\n\t\tlog.Errorln(err.Error())\n\t}\n\t_, err = statement.Exec(x.ServiceURI, x.LastRewardRound, x.RewardCut, x.FeeShare, x.DelegatedStake.String(), x.ActivationRound, x.DeactivationRound.String(), x.Active, x.Status, x.PricePerPixel, time.Now().Unix(), x.Address)\n\tif err != nil {\n\t\tlog.Errorln(\"Error in updating orchestrator\", x.Address)\n\t\tlog.Errorln(err.Error())\n\t}\n}", "title": "" } ]
[ { "docid": "bfb1701d677aad6734f889db97a3b962", "score": "0.59048635", "text": "func UpdateStats(w http.ResponseWriter, r *http.Request) {\n\trepository := Repository{appengine.NewContext(r)}\n\tif err := repository.UpdateStats(); err != nil {\n\t\tErrorToJSON(w, err)\n\t\treturn\n\t}\n\n\tw.Write([]byte(\"Updated.\"))\n}", "title": "" }, { "docid": "663c040e218535239dce0e335740dddd", "score": "0.5557355", "text": "func UpdateStats(s Statistics) {\n\tstM.Lock()\n\tdefer stM.Unlock()\n\tst.Urls += s.Urls\n\tst.Gets += s.Gets\n\tst.Deletes += s.Deletes\n\tst.Upserts += s.Upserts\n\tst.GetsExpired += s.GetsExpired\n\tst.LastRequest = s.LastRequest\n}", "title": "" }, { "docid": "0ef133cf0698c26502104d4fc5eccd70", "score": "0.54301137", "text": "func updateStatistic(trackerUUID string, fileCount int, statistic []app.StorageDO) {\n\tret, _ := json.Marshal(statistic)\n\tlogger.Info(\"update statistic info:( \", string(ret), \")\")\n\tif statistic == nil || len(statistic) == 0 {\n\t\treturn\n\t}\n\tmanagedStatistic[trackerUUID] = statistic\n\tlibservicev2.SaveStorage(trackerUUID, statistic...)\n}", "title": "" }, { "docid": "4d0e04575f4f1f3f3196839b3696ff70", "score": "0.5352333", "text": "func (s *Storage) UpdateUserStatistic(id int64, field string) error {\n\tsql := fmt.Sprintf(\"UPDATE users_stats as us SET us.%s = us.%s + 1 WHERE us.user_id = '%d'\", field, field, id)\n\n\t_, err := s.db.Exec(sql)\n\n\treturn err\n}", "title": "" }, { "docid": "be8abe9b373128b189e5295e7bc0480e", "score": "0.53186363", "text": "func (v *vserver) updateStats() {\n\tfor _, s := range v.services {\n\t\ts.updateStats()\n\t}\n}", "title": "" }, { "docid": "53e7e07040098d16ea4b037cbae0ff83", "score": "0.53115624", "text": "func (cmd *StatsCommand) Execute() {\n\tvar g []int\n\n\tfirst := cmd.DB.LedgerHeaderFirstRow()\n\tlast := cmd.DB.LedgerHeaderLastRow()\n\tgaps := cmd.DB.LedgerHeaderGaps()\n\n\tif (first == nil) || (last == nil) {\n\t\tfmt.Println(\"Current database is empty!\")\n\t}\n\n\ttable := tablewriter.NewWriter(os.Stdout)\n\ttable.SetHeader([]string{\"Min\", \"Max\", \"Count\", \"ES\"})\n\n\tg = append(g, first.LedgerSeq)\n\n\tfor i := 0; i < len(gaps); i++ {\n\t\tgap := gaps[i]\n\t\tg = append(g, gap.Start-1)\n\t\tg = append(g, gap.End+1)\n\t}\n\n\tg = append(g, last.LedgerSeq)\n\n\ttotal := 0\n\ttotalES := 0\n\n\tfor i := 0; i < len(g)/2; i++ {\n\t\tmin := g[i*2]\n\t\tmax := g[i*2+1]\n\t\tcount := max - min + 1\n\t\tcountES := cmd.ES.LedgerCountInRange(min, max)\n\n\t\ttotal += count\n\t\ttotalES += countES\n\n\t\ttable.Append([]string{\n\t\t\tstrconv.Itoa(min),\n\t\t\tstrconv.Itoa(max),\n\t\t\tstrconv.Itoa(count),\n\t\t\tstrconv.Itoa(countES),\n\t\t})\n\t}\n\n\ttable.SetFooter([]string{\"\", \"Total\", strconv.Itoa(total), strconv.Itoa(totalES)})\n\n\ttable.Render()\n}", "title": "" }, { "docid": "d7df90f992020aa528b4ff3e8d07f423", "score": "0.53103584", "text": "func (o *Investor) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tif !boil.TimestampsAreSkipped(ctx) {\n\t\tcurrTime := time.Now().In(boil.GetLocation())\n\n\t\to.UpdatedAt = currTime\n\t}\n\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tinvestorUpdateCacheMut.RLock()\n\tcache, cached := investorUpdateCache[key]\n\tinvestorUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tinvestorAllColumns,\n\t\t\tinvestorPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"dbmodel: unable to update investors, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"investors\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", 0, investorPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(investorType, investorMapping, append(wl, investorPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"dbmodel: unable to update investors row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"dbmodel: failed to get rows affected by update for investors\")\n\t}\n\n\tif !cached {\n\t\tinvestorUpdateCacheMut.Lock()\n\t\tinvestorUpdateCache[key] = cache\n\t\tinvestorUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "title": "" }, { "docid": "62c32de3d05761504bc320158cb4c4cf", "score": "0.5146493", "text": "func (s user) Update() (err error) { return s.Scope().Update() }", "title": "" }, { "docid": "a75dce450891282228eb539e243912cd", "score": "0.5120789", "text": "func (m *Manager) UpdateIndividualViewCount() {\n\tq := `UPDATE %s\n\t\tLEFT JOIN (SELECT ad_id, SUM(view) AS dv FROM %s GROUP BY ad_id ) AS chad ON chad.ad_id = ads.id\n\t\tSET ads.view = chad.dv\n\t\tWHERE ads.cli_message_id IS NULL AND ads.active_status = ? AND ads.admin_status = ? AND ads.pay_status = ? `\n\tq = fmt.Sprintf(q, AdTableFull, ChannelAdTableFull)\n\t_, err := m.GetDbMap().Exec(q, ActiveStatusYes, AdminStatusAccepted, ActiveStatusYes)\n\tassert.Nil(err)\n}", "title": "" }, { "docid": "53786d46de2072d65e51a1c4536a6592", "score": "0.508106", "text": "func (h *Handle) Update(is infoschema.InfoSchema, opts ...cache.TableStatsOpt) error {\n\toldCache := h.statsCache.Load()\n\tlastVersion := oldCache.Version()\n\t// We need this because for two tables, the smaller version may write later than the one with larger version.\n\t// Consider the case that there are two tables A and B, their version and commit time is (A0, A1) and (B0, B1),\n\t// and A0 < B0 < B1 < A1. We will first read the stats of B, and update the lastVersion to B0, but we cannot read\n\t// the table stats of A0 if we read stats that greater than lastVersion which is B0.\n\t// We can read the stats if the diff between commit time and version is less than three lease.\n\toffset := DurationToTS(3 * h.Lease())\n\tif oldCache.Version() >= offset {\n\t\tlastVersion = lastVersion - offset\n\t} else {\n\t\tlastVersion = 0\n\t}\n\tctx := kv.WithInternalSourceType(context.Background(), kv.InternalTxnStats)\n\trows, _, err := h.execRestrictedSQL(ctx, \"SELECT version, table_id, modify_count, count from mysql.stats_meta where version > %? order by version\", lastVersion)\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\toption := &cache.TableStatsOption{}\n\tfor _, opt := range opts {\n\t\topt(option)\n\t}\n\ttables := make([]*statistics.Table, 0, len(rows))\n\tdeletedTableIDs := make([]int64, 0, len(rows))\n\tfor _, row := range rows {\n\t\tversion := row.GetUint64(0)\n\t\tphysicalID := row.GetInt64(1)\n\t\tmodifyCount := row.GetInt64(2)\n\t\tcount := row.GetInt64(3)\n\t\ttable, ok := h.getTableByPhysicalID(is, physicalID)\n\t\tif !ok {\n\t\t\tlogutil.BgLogger().Debug(\"unknown physical ID in stats meta table, maybe it has been dropped\", zap.Int64(\"ID\", physicalID))\n\t\t\tdeletedTableIDs = append(deletedTableIDs, physicalID)\n\t\t\tcontinue\n\t\t}\n\t\ttableInfo := table.Meta()\n\t\tif oldTbl, ok := oldCache.GetFromInternal(physicalID); ok && oldTbl.Version >= version && tableInfo.UpdateTS == oldTbl.TblInfoUpdateTS {\n\t\t\tcontinue\n\t\t}\n\t\ttbl, err := h.TableStatsFromStorage(tableInfo, physicalID, false, 0)\n\t\t// Error is not nil may mean that there are some ddl changes on this table, we will not update it.\n\t\tif err != nil {\n\t\t\tlogutil.BgLogger().Error(\"error occurred when read table stats\", zap.String(\"category\", \"stats\"), zap.String(\"table\", tableInfo.Name.O), zap.Error(err))\n\t\t\tcontinue\n\t\t}\n\t\tif tbl == nil {\n\t\t\tdeletedTableIDs = append(deletedTableIDs, physicalID)\n\t\t\tcontinue\n\t\t}\n\t\ttbl.Version = version\n\t\ttbl.RealtimeCount = count\n\t\ttbl.ModifyCount = modifyCount\n\t\ttbl.Name = getFullTableName(is, tableInfo)\n\t\ttbl.TblInfoUpdateTS = tableInfo.UpdateTS\n\t\ttables = append(tables, tbl)\n\t}\n\th.updateStatsCache(oldCache, tables, deletedTableIDs, opts...)\n\treturn nil\n}", "title": "" }, { "docid": "273fa672fddf045519699e6dd284d9d7", "score": "0.50600123", "text": "func (ac *actionsCollector) Update(ch chan<- prometheus.Metric) error {\n\torgs := parseArg(*githubOrgs)\n\tfor _, org := range orgs {\n\t\tvar a actions\n\t\treq, _ := http.NewRequest(\"GET\", \"https://api.github.com/orgs/\"+org+\"/settings/billing/actions\", nil)\n\t\treq.Header.Set(\"Authorization\", \"token \"+*githubToken)\n\t\tresp, err := ac.client.Do(req)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif resp.StatusCode != 200 {\n\t\t\treturn fmt.Errorf(\"status %s, organization: %s collector: %s\", resp.Status, org, actionsSubsystem)\n\t\t}\n\n\t\terr = json.NewDecoder(resp.Body).Decode(&a)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tresp.Body.Close()\n\n\t\tch <- prometheus.MustNewConstMetric(ac.usedMinutesTotal, prometheus.GaugeValue, float64(a.TotalMinutesUsed), org)\n\t\tch <- prometheus.MustNewConstMetric(ac.paidMinutedUsedTotal, prometheus.GaugeValue, float64(a.TotalPaidMinutedUsed), org)\n\t\tch <- prometheus.MustNewConstMetric(ac.includedMinutes, prometheus.GaugeValue, float64(a.IncludedMinutes), org)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "840b90fb6e29c3aa3c8edce2b7960cc7", "score": "0.5037884", "text": "func (m *DbStatsMetric) Update(cur bolt.Stats) {\n\tm.FreePageN.Update(int64(cur.FreePageN))\n\tm.PendingPageN.Update(int64(cur.PendingPageN))\n\tm.FreeAlloc.Update(int64(cur.FreeAlloc))\n\tm.FreelistInuse.Update(int64(cur.FreelistInuse))\n\tm.TxN.Update(int64(cur.TxN))\n\tm.OpenTxN.Update(int64(cur.OpenTxN))\n\tm.TxStatsMetric.Update(cur.TxStats)\n}", "title": "" }, { "docid": "dea159a8376d72e5daa658f6f498525a", "score": "0.5017601", "text": "func (promCollectors *PromCollectors) Update(site string, result Result, err error) {\n\n\tsiteLabels := prometheus.Labels{\"site\": site}\n\tpromCollectors.count.With(siteLabels).Inc()\n\tpromCollectors.code.With(siteLabels).Set(float64(result.StatusCode))\n\tpromCollectors.duration.With(siteLabels).Observe(result.Duration.Seconds())\n\tpromCollectors.length.With(siteLabels).Set(float64(result.Length))\n\tpromCollectors.hash.With(siteLabels).Set(float64(result.Hash))\n\tif err != nil {\n\t\tpromCollectors.error.With(siteLabels).Inc()\n\t}\n}", "title": "" }, { "docid": "f95720c9b52f351a3f46ca47f1e99d00", "score": "0.50130796", "text": "func (h *Handle) SaveStatsToStorage(tableID int64, count, modifyCount int64, isIndex int, hg *statistics.Histogram,\n\tcms *statistics.CMSketch, topN *statistics.TopN, statsVersion int, isAnalyzed int64, updateAnalyzeTime bool, source string) (err error) {\n\tstatsVer := uint64(0)\n\tdefer func() {\n\t\tif err == nil && statsVer != 0 {\n\t\t\th.recordHistoricalStatsMeta(tableID, statsVer, source)\n\t\t}\n\t}()\n\th.mu.Lock()\n\tdefer h.mu.Unlock()\n\tctx := kv.WithInternalSourceType(context.Background(), kv.InternalTxnStats)\n\texec := h.mu.ctx.(sqlexec.SQLExecutor)\n\t_, err = exec.ExecuteInternal(ctx, \"begin pessimistic\")\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tdefer func() {\n\t\terr = finishTransaction(ctx, exec, err)\n\t}()\n\ttxn, err := h.mu.ctx.Txn(true)\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\n\tversion := txn.StartTS()\n\t// If the count is less than 0, then we do not want to update the modify count and count.\n\tif count >= 0 {\n\t\t_, err = exec.ExecuteInternal(ctx, \"replace into mysql.stats_meta (version, table_id, count, modify_count) values (%?, %?, %?, %?)\", version, tableID, count, modifyCount)\n\t\tcache.TableRowStatsCache.Invalidate(tableID)\n\t} else {\n\t\t_, err = exec.ExecuteInternal(ctx, \"update mysql.stats_meta set version = %? where table_id = %?\", version, tableID)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tstatsVer = version\n\tcmSketch, err := statistics.EncodeCMSketchWithoutTopN(cms)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Delete outdated data\n\tif _, err = exec.ExecuteInternal(ctx, \"delete from mysql.stats_top_n where table_id = %? and is_index = %? and hist_id = %?\", tableID, isIndex, hg.ID); err != nil {\n\t\treturn err\n\t}\n\tif err = saveTopNToStorage(ctx, exec, tableID, isIndex, hg.ID, topN); err != nil {\n\t\treturn err\n\t}\n\tif _, err := exec.ExecuteInternal(ctx, \"delete from mysql.stats_fm_sketch where table_id = %? and is_index = %? and hist_id = %?\", tableID, isIndex, hg.ID); err != nil {\n\t\treturn err\n\t}\n\tflag := 0\n\tif isAnalyzed == 1 {\n\t\tflag = statistics.AnalyzeFlag\n\t}\n\tif _, err = exec.ExecuteInternal(ctx, \"replace into mysql.stats_histograms (table_id, is_index, hist_id, distinct_count, version, null_count, cm_sketch, tot_col_size, stats_ver, flag, correlation) values (%?, %?, %?, %?, %?, %?, %?, %?, %?, %?, %?)\",\n\t\ttableID, isIndex, hg.ID, hg.NDV, version, hg.NullCount, cmSketch, hg.TotColSize, statsVersion, flag, hg.Correlation); err != nil {\n\t\treturn err\n\t}\n\tif _, err = exec.ExecuteInternal(ctx, \"delete from mysql.stats_buckets where table_id = %? and is_index = %? and hist_id = %?\", tableID, isIndex, hg.ID); err != nil {\n\t\treturn err\n\t}\n\tsc := h.mu.ctx.GetSessionVars().StmtCtx\n\tvar lastAnalyzePos []byte\n\tlastAnalyzePos, err = saveBucketsToStorage(ctx, exec, sc, tableID, isIndex, hg)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif isAnalyzed == 1 && len(lastAnalyzePos) > 0 {\n\t\tif _, err = exec.ExecuteInternal(ctx, \"update mysql.stats_histograms set last_analyze_pos = %? where table_id = %? and is_index = %? and hist_id = %?\", lastAnalyzePos, tableID, isIndex, hg.ID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif updateAnalyzeTime && isIndex == 0 {\n\t\tif _, err = exec.ExecuteInternal(ctx, \"insert into mysql.column_stats_usage (table_id, column_id, last_analyzed_at) values(%?, %?, current_timestamp()) on duplicate key update last_analyzed_at = current_timestamp()\", tableID, hg.ID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "aeb984f0cc872f6fe0432556d2e4bad1", "score": "0.5005908", "text": "func (c *meminfoCollector1) Update(ch chan<- prometheus.Metric) error {\n tmp := updateExporterMetric(\"summary\", \"meminfo_summary\")\n if tmp == false {\n return nil\n }\n cmd, _ := exec.Command(\"whoami\").Output()\n path := \"/home/\"+strings.TrimSpace(string(cmd))+\"/csv/meminfostat.csv\"\n file, err := os.Open(path)\n// fmt.Println(\"***********MemInfo************\")\n if err != nil {\n fmt.Println(err)\n }\n var summarization = []string{\"stats\"}\n defer file.Close()\n lines,_ := csv.NewReader(file).ReadAll()\n var p25, median, p75, average, min, max float64\n for i , line := range lines {\n if i > 0 {\n p25, _ = strconv.ParseFloat(line[1],64)\n median, _ = strconv.ParseFloat(line[2],64)\n p75, _ = strconv.ParseFloat(line[3],64)\n average, _ = strconv.ParseFloat(line[4],64)\n min, _ = strconv.ParseFloat(line[5],64)\n max, _ = strconv.ParseFloat(line[6],64)\n\n var j = line[0] + \"_summary\"\n\n ch <- prometheus.MustNewConstMetric(\n prometheus.NewDesc(\n prometheus.BuildFQName(namespace, memInfoSubsystem1, j),\n fmt.Sprintf(\"Memory information field %s.\", j),\n summarization,\n nil,\n ),\n prometheus.GaugeValue, p25,\"p25\",\n )\n\n ch <- prometheus.MustNewConstMetric(\n prometheus.NewDesc(\n prometheus.BuildFQName(namespace, memInfoSubsystem1, j),\n fmt.Sprintf(\"Memory information field %s.\", j),\n summarization,\n nil,\n ),\n prometheus.GaugeValue, median,\"median\",\n )\n\n ch <- prometheus.MustNewConstMetric(\n prometheus.NewDesc(\n prometheus.BuildFQName(namespace, memInfoSubsystem1, j),\n fmt.Sprintf(\"Memory information field %s.\", j),\n summarization,\n nil,\n ),\n prometheus.GaugeValue, p75,\"p75\",\n )\n\n ch <- prometheus.MustNewConstMetric(\n prometheus.NewDesc(\n prometheus.BuildFQName(namespace, memInfoSubsystem1, j),\n fmt.Sprintf(\"Memory information field %s.\", j),\n summarization,\n nil,\n ),\n prometheus.GaugeValue, average,\"average\",\n )\n\n ch <- prometheus.MustNewConstMetric(\n prometheus.NewDesc(\n prometheus.BuildFQName(namespace, memInfoSubsystem1, j),\n fmt.Sprintf(\"Memory information field %s.\", j),\n summarization,\n nil,\n ),\n prometheus.GaugeValue, min,\"min\",\n )\n\n ch <- prometheus.MustNewConstMetric(\n prometheus.NewDesc(\n prometheus.BuildFQName(namespace, memInfoSubsystem1, j),\n fmt.Sprintf(\"Memory information field %s.\", j),\n summarization,\n nil,\n ),\n prometheus.GaugeValue, max,\"max\",\n )\n\n }\n }\n\n\n\n/* memInfo, err := c.getMemInfo()\n if err != nil {\n return fmt.Errorf(\"couldn't get meminfo: %s\", err)\n }\n log.Debugf(\"Set node_mem: %#v\", memInfo)\n for k, v := range memInfo {\n ch <- prometheus.MustNewConstMetric(\n prometheus.NewDesc(\n prometheus.BuildFQName(namespace, memInfoSubsystem, k),\n fmt.Sprintf(\"Memory information field %s.\", k),\n nil, nil,\n ),\n prometheus.GaugeValue, v,\n )\n }\n*/\n return nil\n}", "title": "" }, { "docid": "77cba68018a0d6cf7c77e70d48a7c3e5", "score": "0.50049776", "text": "func (c *JvbCollector) Update(identifier string, stats *Stats) {\n\tfor i, s := range c.statsSets {\n\t\tif s.jvbIdentifier == identifier {\n\t\t\tc.statsSets[i].lastUpdated = time.Now()\n\t\t\tc.statsSets[i].stats = *stats\n\t\t\treturn\n\t\t}\n\t}\n\n\tc.statsSets = append(c.statsSets, statsSet{\n\t\tlastUpdated: time.Now(),\n\t\tstats: *stats,\n\t\tjvbIdentifier: identifier,\n\t})\n}", "title": "" }, { "docid": "82ea341484f06dfc28b197e0503d4d1a", "score": "0.5003225", "text": "func (prof *Professional) update() error {\n\terr := dbclient.updateProfessional(prof)\n\treturn err\n}", "title": "" }, { "docid": "0fd421747646e7b02c0e7b559f604b52", "score": "0.4995991", "text": "func (repository Repository) UpdateAccumulator(accumulator Accumulator) {\n repository.Accumulators[accumulator.ID] = accumulator.Value\n}", "title": "" }, { "docid": "1c5fd0896ff751a197acb6fe92a44941", "score": "0.4970487", "text": "func (f *Dir) UpdateStats(linkedItems HardLinkedItems) {\n\ttotalSize := int64(4096)\n\ttotalUsage := int64(4096)\n\tvar itemCount int\n\tfor _, entry := range f.Files {\n\t\tcount, size, usage := entry.getItemStats(linkedItems)\n\t\ttotalSize += size\n\t\ttotalUsage += usage\n\t\titemCount += count\n\n\t\tif entry.GetMtime().After(f.Mtime) {\n\t\t\tf.Mtime = entry.GetMtime()\n\t\t}\n\n\t\tswitch entry.GetFlag() {\n\t\tcase '!', '.':\n\t\t\tif f.Flag != '!' {\n\t\t\t\tf.Flag = '.'\n\t\t\t}\n\t\t}\n\t}\n\tf.ItemCount = itemCount + 1\n\tf.Size = totalSize\n\tf.Usage = totalUsage\n}", "title": "" }, { "docid": "00ba3888f175ea9e81796c043932f154", "score": "0.49531633", "text": "func setUserStats(w http.ResponseWriter, r *http.Request) {\n\tuser := context.Get(r, \"user\").(*core.User)\n\n\tdata := context.Get(r, \"data\").(string)\n\tvar req setStatsRequest\n\terr := json.Unmarshal([]byte(data), &req)\n\tif err != nil {\n\t\tEasyErrorResponse(w, core.NebError, err)\n\t\treturn\n\t}\n\n\tuser.SetStats(req.Stats)\n\tEasyResponse(w, core.NebErrorNone, \"Updated Stats\")\n}", "title": "" }, { "docid": "cac63012c4ac4d81108b36667ae069af", "score": "0.49310526", "text": "func (st *HTTPStats) updateStats(r *http.Request, w *httpResponseRecorder, durationSecs float64) {\n\t// A successful request has a 2xx response code\n\tsuccessReq := (w.respStatusCode >= 200 && w.respStatusCode < 300)\n\t// Update stats according to method verb\n\tswitch r.Method {\n\tcase \"HEAD\":\n\t\tst.totalHEADs.Counter.Inc()\n\t\tst.totalHEADs.Duration.Add(durationSecs)\n\t\tif successReq {\n\t\t\tst.successHEADs.Counter.Inc()\n\t\t\tst.successHEADs.Duration.Add(durationSecs)\n\t\t}\n\tcase \"GET\":\n\t\tst.totalGETs.Counter.Inc()\n\t\tst.totalGETs.Duration.Add(durationSecs)\n\t\tif successReq {\n\t\t\tst.successGETs.Counter.Inc()\n\t\t\tst.successGETs.Duration.Add(durationSecs)\n\t\t}\n\tcase \"PUT\":\n\t\tst.totalPUTs.Counter.Inc()\n\t\tst.totalPUTs.Duration.Add(durationSecs)\n\t\tif successReq {\n\t\t\tst.successPUTs.Counter.Inc()\n\t\t\tst.totalPUTs.Duration.Add(durationSecs)\n\t\t}\n\tcase \"POST\":\n\t\tst.totalPOSTs.Counter.Inc()\n\t\tst.totalPOSTs.Duration.Add(durationSecs)\n\t\tif successReq {\n\t\t\tst.successPOSTs.Counter.Inc()\n\t\t\tst.totalPOSTs.Duration.Add(durationSecs)\n\t\t}\n\tcase \"DELETE\":\n\t\tst.totalDELETEs.Counter.Inc()\n\t\tst.totalDELETEs.Duration.Add(durationSecs)\n\t\tif successReq {\n\t\t\tst.successDELETEs.Counter.Inc()\n\t\t\tst.successDELETEs.Duration.Add(durationSecs)\n\t\t}\n\t}\n\t// Increment the prometheus http request response histogram with appropriate label\n\thttpRequestsDuration.With(prometheus.Labels{\"request_type\": r.Method}).Observe(durationSecs)\n}", "title": "" }, { "docid": "c43c150fbf20d0e96009d6eb132980f5", "score": "0.49248445", "text": "func (u *__ProfileMentioned_Updater) Update(db XODB) (int, error) {\n\tvar err error\n\n\tvar updateArgs []interface{}\n\tvar sqlUpdateArr []string\n\t/*for up, newVal := range u.updates {\n\t sqlUpdateArr = append(sqlUpdateArr, up)\n\t updateArgs = append(updateArgs, newVal)\n\t}*/\n\tfor _, up := range u.updates {\n\t\tsqlUpdateArr = append(sqlUpdateArr, up.col)\n\t\tupdateArgs = append(updateArgs, up.val)\n\t}\n\tsqlUpdate := strings.Join(sqlUpdateArr, \",\")\n\n\tsqlWherrs, whereArgs := whereClusesToSql(u.wheres, u.whereSep)\n\n\tvar allArgs []interface{}\n\tallArgs = append(allArgs, updateArgs...)\n\tallArgs = append(allArgs, whereArgs...)\n\n\tsqlstr := `UPDATE sun.profile_mentioned SET ` + sqlUpdate\n\n\tif len(strings.Trim(sqlWherrs, \" \")) > 0 { //2 for safty\n\t\tsqlstr += \" WHERE \" + sqlWherrs\n\t}\n\n\tif LogTableSqlReq.ProfileMentioned {\n\t\tXOLog(sqlstr, allArgs)\n\t}\n\tres, err := db.Exec(sqlstr, allArgs...)\n\tif err != nil {\n\t\tif LogTableSqlReq.ProfileMentioned {\n\t\t\tXOLogErr(err)\n\t\t}\n\t\treturn 0, err\n\t}\n\n\tnum, err := res.RowsAffected()\n\tif err != nil {\n\t\tif LogTableSqlReq.ProfileMentioned {\n\t\t\tXOLogErr(err)\n\t\t}\n\t\treturn 0, err\n\t}\n\n\treturn int(num), nil\n}", "title": "" }, { "docid": "18d22c1c082539beab6c9588a919c8e2", "score": "0.4924275", "text": "func (s *service) updateStats() {\n\tif !s.active {\n\t\treturn\n\t}\n\tlog.V(1).Infof(\"%v: updating IPVS statistics for %v\", s.vserver, s)\n\n\tncc := s.vserver.ncc\n\n\tipvsSvc, err := ncc.IPVSGetService(s.ipvsSvc)\n\tif err != nil {\n\t\tlog.Warningf(\"%v: failed to get statistics for %v: %v\", s.vserver, s, err)\n\t\treturn\n\t}\n\ts.stats.ServiceStats = ipvsSvc.Statistics\n\n\tfor _, ipvsDst := range ipvsSvc.Destinations {\n\t\tfound := false\n\t\tfor _, d := range s.dests {\n\t\t\tif d.ipvsDst.Address.Equal(ipvsDst.Address) &&\n\t\t\t\td.ipvsDst.Port == ipvsDst.Port {\n\t\t\t\td.stats.DestinationStats = ipvsDst.Statistics\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tlog.Warningf(\"%v: got statistics for unknown destination %v\", s.vserver, ipvsDst)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e65f7938ac66620e7812e19e3e63d19e", "score": "0.4912527", "text": "func SaveStats() (err error) {\n\terr = db.Update(func(txn *badger.Txn) (err error) {\n\t\t// find all the urls\n\t\tdbSetUint64(txn, statsKeyGlobalURLCount, st.Urls)\n\t\tdbSetUint64(txn, statsKeyGlobalGetCount, st.Gets)\n\t\tdbSetUint64(txn, statsKeyGlobalDelCount, st.Deletes)\n\t\tdbSetUint64(txn, statsKeyGlobalUpdCount, st.Upserts)\n\t\t// update global statistics\n\t\treturn\n\t})\n\treturn\n}", "title": "" }, { "docid": "2c89228744abd6b1552951ddbf0c2ee2", "score": "0.4890663", "text": "func (u UserController) Update(c *gin.Context) {\n\n}", "title": "" }, { "docid": "eb21170aebdb7bc07de43e9af1a2744f", "score": "0.4880059", "text": "func (self *HuntDispatcher) _flush_stats() error {\n\t// Only do something if we are dirty.\n\tif !self.dirty {\n\t\treturn nil\n\t}\n\n\tdb, err := datastore.GetDB(self.config_obj)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, hunt_obj := range self.hunts {\n\t\terr = db.SetSubject(\n\t\t\tself.config_obj,\n\t\t\thunt_obj.HuntId+\"/stats\", hunt_obj.Stats)\n\t\tif err != nil {\n\t\t\tlogger := logging.GetLogger(self.config_obj, &logging.FrontendComponent)\n\t\t\tlogger.Error(\"Flushing %s to disk: %v\", hunt_obj.HuntId, err)\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tself.dirty = false\n\n\treturn nil\n}", "title": "" }, { "docid": "adf2a7f7b9577b638e818c90a2cc2d67", "score": "0.48771623", "text": "func UpdateAnalyticsData() error {\n\tGAResponseJSONObject = nil\n\thttpClient, err := getterJWTConfig()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error while getting HTTPclient, err :%s\", err)\n\t}\n\tsvc, err := getterSVC(httpClient)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error while getting service account, err :%s\", err)\n\t}\n\n\tresponseForInstallations, err := svc.Data.Ga.Get(viewID, startDate, endDate, metricsForInstallations).Dimensions(dimensions).Filters(filters).MaxResults(maxResult).Do()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error while getting response, err: %s\", err)\n\t}\n\tGAResponse := responseForInstallations.Rows\n\tfor i := range GAResponse {\n\t\tif GAResponse[i][0] == \"Chaos-Operator\" {\n\t\t\tobject := GAResponseJSON{\n\t\t\t\tLabel: GAResponse[i][0],\n\t\t\t\tCount: GAResponse[i][1],\n\t\t\t}\n\t\t\tGAResponseJSONObject = append(GAResponseJSONObject, object)\n\t\t}\n\t}\n\n\tresponseForExperiments, err := svc.Data.Ga.Get(viewID, startDate, endDate, metricsForExperiments).Dimensions(dimensions).Filters(filters).MaxResults(maxResult).Do()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error while getting response, err: %s\", err)\n\t}\n\tvar totalCount int64\n\tGAResponse = responseForExperiments.Rows\n\t/* TODO --- this for-block needs to be refactored later\n\t */\n\tfor i := range GAResponse {\n\t\tobject := GAResponseJSON{\n\t\t\tLabel: GAResponse[i][0],\n\t\t\tCount: GAResponse[i][1],\n\t\t}\n\t\tif GAResponse[i][0] != \"Chaos-Operator\" {\n\t\t\tcount, err := strconv.ParseInt(object.Count, base, bitSize)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Error while converting count to string, err: %s\", err)\n\t\t\t}\n\t\t\ttotalCount = totalCount + count\n\t\t\tGAResponseJSONObject = append(GAResponseJSONObject, object)\n\t\t}\n\t}\n\n\tobject := GAResponseJSON{\n\t\tLabel: \"Total-Count\",\n\t\tCount: strconv.FormatInt(totalCount, base),\n\t}\n\tGAResponseJSONObject = append(GAResponseJSONObject, object)\n\n\treturn nil\n}", "title": "" }, { "docid": "bbf2b839ae15d386580781c2009a2003", "score": "0.48709646", "text": "func (s *statefulScheduler) updateStats() {\n\tremainingTasks := 0\n\twaitingTasks := 0\n\trunningTasks := 0\n\tjobsWaitingToStart := 0\n\n\trequestorsCounts := make(map[string]*requestorCounts) // map of requestor to job and task stats counts\n\n\t// get job and task counts by requestor, and overall jobs stats\n\tfor _, job := range s.inProgressJobs {\n\t\trequestor := job.Job.Def.Requestor\n\t\tif _, ok := requestorsCounts[requestor]; !ok {\n\t\t\t// first time we've seen this requestor, initialize its map entry\n\t\t\tcounts := &requestorCounts{}\n\t\t\trequestorsCounts[requestor] = counts\n\t\t}\n\n\t\trunning := job.GetNumRunning()\n\t\tcompleted := job.GetNumCompleted()\n\t\tremaining := len(job.Tasks) - completed\n\t\twaiting := remaining - running\n\t\tstatus := job.getJobStatus()\n\t\t// accumulate totals independent of requestors\n\t\tremainingTasks += remaining\n\t\twaitingTasks += waiting\n\t\trunningTasks += running\n\n\t\t// totals by requestor\n\t\tif job.TasksCompleted+job.TasksRunning == 0 {\n\t\t\tjobsWaitingToStart += 1\n\t\t} else if status == domain.InProgress {\n\t\t\trequestorsCounts[requestor].numJobsRunning++\n\t\t}\n\t\trequestorsCounts[requestor].numRemainingTasks += remaining\n\t\trequestorsCounts[requestor].numTasksRunning += running\n\t\trequestorsCounts[requestor].numTasksWaitingToStart += waiting\n\n\t\tif time.Since(job.TimeMarker) > LongJobDuration {\n\t\t\tjob.TimeMarker = time.Now()\n\t\t\tlog.WithFields(\n\t\t\t\tlog.Fields{\n\t\t\t\t\t\"requestor\": job.Job.Def.Requestor,\n\t\t\t\t\t\"jobType\": job.Job.Def.JobType,\n\t\t\t\t\t\"jobId\": job.Job.Id,\n\t\t\t\t\t\"tag\": job.Job.Def.Tag,\n\t\t\t\t\t\"basis\": job.Job.Def.Basis,\n\t\t\t\t\t\"priority\": job.Job.Def.Priority,\n\t\t\t\t\t\"numTasks\": len(job.Tasks),\n\t\t\t\t\t\"tasksRunning\": job.TasksRunning,\n\t\t\t\t\t\"tasksCompleted\": job.TasksCompleted,\n\t\t\t\t\t\"runTime\": time.Since(job.TimeCreated),\n\t\t\t\t}).Info(\"Long-running job\")\n\t\t}\n\t}\n\n\t// publish the requestor stats\n\ttasksRunningCheckSum := 0\n\ttasksWaitingCheckSum := 0\n\ttasksRemainingCheckSum := 0\n\tfor requestor, counts := range requestorsCounts {\n\t\ts.stat.Gauge(fmt.Sprintf(\"%s_%s\", stats.SchedNumRunningJobsGauge, requestor)).Update(int64(\n\t\t\tcounts.numJobsRunning))\n\t\ts.stat.Gauge(fmt.Sprintf(\"%s_%s\", stats.SchedWaitingJobsGauge, requestor)).Update(int64(\n\t\t\tcounts.numJobsWaitingToStart))\n\t\ts.stat.Gauge(fmt.Sprintf(\"%s_%s\", stats.SchedNumRunningTasksGauge, requestor)).Update(int64(\n\t\t\tcounts.numTasksRunning))\n\t\ts.stat.Gauge(fmt.Sprintf(\"%s_%s\", stats.SchedNumWaitingTasksGauge, requestor)).Update(int64(\n\t\t\tcounts.numTasksWaitingToStart))\n\t\ts.stat.Gauge(fmt.Sprintf(\"%s_%s\", stats.SchedInProgressTasksGauge, requestor)).Update(int64(\n\t\t\tcounts.numRemainingTasks))\n\t\ttasksRunningCheckSum += counts.numTasksRunning\n\t\ttasksWaitingCheckSum += counts.numTasksWaitingToStart\n\t\ttasksRemainingCheckSum += counts.numRemainingTasks\n\t}\n\n\tif tasksRunningCheckSum != runningTasks || tasksWaitingCheckSum != waitingTasks || tasksRemainingCheckSum != remainingTasks {\n\t\tlog.Errorf(\"stats checksum error\\nrunning: expected: %d, got:%d\\n waiting: expected: %d, got:%d\\nremaining: expected:%d, got:%d\",\n\t\t\trunningTasks, tasksRunningCheckSum, waitingTasks, tasksWaitingCheckSum, remainingTasks, tasksRemainingCheckSum)\n\t}\n\n\t// publish the rest of the stats\n\ts.stat.Gauge(stats.SchedAcceptedJobsGauge).Update(int64(len(s.inProgressJobs)))\n\ts.stat.Gauge(stats.SchedWaitingJobsGauge).Update(int64(jobsWaitingToStart))\n\ts.stat.Gauge(stats.SchedInProgressTasksGauge).Update(int64(remainingTasks))\n\ts.stat.Gauge(stats.SchedNumRunningTasksGauge).Update(int64(runningTasks))\n\ts.stat.Gauge(stats.SchedNumWaitingTasksGauge).Update(int64(waitingTasks))\n\ts.stat.Gauge(stats.SchedNumAsyncRunnersGauge).Update(int64(s.asyncRunner.NumRunning())) //TODO remove when done debugging\n\n\t// print internal data structure sizes\n\tvar lbs *LoadBasedAlg = s.config.SchedAlg.(*LoadBasedAlg)\n\tlbsStats := lbs.GetDataStructureSizeStats()\n\tfor k, v := range lbsStats {\n\t\ts.stat.Gauge(k).Update(int64(v))\n\t}\n\ts.stat.Gauge(stats.SchedTaskStartTimeMapSize).Update(int64(s.getSchedTaskStartTimeMapSize()))\n\ts.stat.Gauge(stats.SchedInProgressJobsSize).Update(int64(len(s.inProgressJobs)))\n\ts.stat.Gauge(stats.SchedRequestorMapSize).Update(int64(len(s.requestorMap)))\n\ts.stat.Gauge(stats.SchedRequestorHistorySize).Update(int64(s.requestorHistory.Len()))\n\ts.stat.Gauge(stats.SchedTaskDurationsSize).Update(int64(s.taskDurations.Len()))\n\ts.stat.Gauge(stats.SchedSagasSize).Update(int64(s.sagaCoord.GetNumSagas()))\n\ts.stat.Gauge(stats.SchedRunnersSize).Update(int64(s.asyncRunner.NumRunning()))\n}", "title": "" }, { "docid": "8c0670ed1878ff4baf50388f4fefbb0f", "score": "0.48644015", "text": "func (m *DbMetric) Update() error {\n\tm.DbStatsMetric.Update(m.db.Stats())\n\treturn m.db.View(func(tx *bolt.Tx) error {\n\t\tvar err error\n\t\tfor name, metric := range m.BucketStatsMetrics {\n\t\t\tb := tx.Bucket([]byte(name))\n\t\t\tif b == nil {\n\t\t\t\terr = fmt.Errorf(\"Bucket %q does not exist.\", name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmetric.Update(b.Stats())\n\t\t}\n\t\treturn err\n\t})\n}", "title": "" }, { "docid": "0a12d64cd36e068b397351ad1774fefe", "score": "0.4861338", "text": "func (r *responseStats) update(rsp transmission.Response) {\n\tr.lock.Lock()\n\tdefer r.lock.Unlock()\n\tr.count += 1\n\tr.statusCodes[rsp.StatusCode] += 1\n\tr.bodies[strings.TrimSpace(string(rsp.Body))] += 1\n\tif rsp.Err != nil {\n\t\tr.errors[rsp.Err.Error()] += 1\n\t}\n\tif r.minDuration == 0 {\n\t\tr.minDuration = rsp.Duration\n\t}\n\tif rsp.Duration < r.minDuration {\n\t\tr.minDuration = rsp.Duration\n\t} else if rsp.Duration > r.maxDuration {\n\t\tr.maxDuration = rsp.Duration\n\t}\n\tr.sumDuration += rsp.Duration\n\tev := rsp.Metadata.(event.Event)\n\tr.event = &ev\n}", "title": "" }, { "docid": "ce41250851679dad9b7d9ad82652ab74", "score": "0.48576206", "text": "func (view *DiskView) UpdateStats(ctx context.Context, req *rpc.UpdateStatsRequest) (*rpc.UpdateStatsResult, error) {\n\tview.graphCounts.update()\n\treturn &rpc.UpdateStatsResult{}, nil\n}", "title": "" }, { "docid": "71382981c78c2a3d507047652f169405", "score": "0.4856734", "text": "func (m SpaceAccountModel) UpdateWithAdminInfo(orms ...orm.Ormer) (uint32, error) {\n\tvar o orm.Ormer\n\tif len(orms) != 1 {\n\t\to = orm.NewOrm()\n\t} else {\n\t\to = orms[0]\n\t}\n\t// Only update balance\n\tnewInfo := orm.Params{\"balance\": m.Balance, \"last_charge_admin_id\": m.LastChargeAdminID, \"last_charge_admin_name\": m.LastChargeAdminName,\n\t\t\"last_charge_amount\": m.LastChargeAmount, \"last_charge_time\": m.LastChargeTime}\n\t_, err := o.QueryTable(m.TableName()).\n\t\tFilter(\"namespace\", m.Namespace).Update(newInfo)\n\n\treturn sqlstatus.ParseErrorCode(err)\n}", "title": "" }, { "docid": "6e21d0d03c0b585d48dd5ffc2e35417a", "score": "0.48508924", "text": "func (R *RedMon) UpdateStats() bool {\n\n\tvar redisStats typ.Stats\n\tvar txt string\n\tvar err error\n\n\ttxt = R.GetRedisInfo(\"Memory\", \"used_memory\")\n\tredisStats.Mem, err = strconv.ParseInt(txt, 10, 64)\n\tif err != nil {\n\t\tR.L.Printf(\"UpdateStats(Mem) Unable to convert %s to number %v\", txt, err)\n\t}\n\n\ttxt = R.GetRedisInfo(\"Server\", \"uptime_in_seconds\")\n\tredisStats.Uptime, err = strconv.ParseInt(txt, 10, 64)\n\tif err != nil {\n\t\tR.L.Printf(\"UpdateStats(Uptime) Uptime Unable to convert %s to number %v\", txt, err)\n\t}\n\n\ttxt = R.GetRedisInfo(\"Clients\", \"connected_clients\")\n\tredisStats.Clients, err = strconv.Atoi(txt)\n\tif err != nil {\n\t\tR.L.Printf(\"UpdateStats(Clients) Unable to convert %s to number %v\", txt, err)\n\t}\n\n\ttxt = R.GetRedisInfo(\"Replication\", \"master_last_io_seconds_ago\")\n\tredisStats.LastSyced, err = strconv.Atoi(txt)\n\tif err != nil && txt != \"\" {\n\t\tR.L.Printf(\"UpdateStats(master_last_io) Unable to convert %s to number %v\", txt, err)\n\t}\n\n\ttxt = R.GetRedisInfo(\"Replication\", \"slave_repl_offset\")\n\tredisStats.SlaveOffset, err = strconv.ParseInt(txt, 10, 64)\n\tif err != nil && txt != \"\" {\n\t\tR.L.Printf(\"UpdateStats(slave_repl_offset) Unable to convert %s to number %v\", txt, err)\n\t}\n\n\ttxt = R.GetRedisInfo(\"Replication\", \"slave_priority\")\n\tredisStats.SlavePriority, err = strconv.Atoi(txt)\n\tif err != nil && txt != \"\" {\n\t\tR.L.Printf(\"UpdateStats(slave_priority) Unable to convert %s to number %v\", txt, err)\n\t}\n\n\terrSync := R.P.SyncStats(redisStats)\n\tif !errSync {\n\t\tR.L.Printf(\"Error syncing stats to store\")\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "4ebbcb61932bafd81f41c7ab61a1560a", "score": "0.48393613", "text": "func ReplicateStats() error {\n\tif U, ok := app.Mapper.GetModel(&User{}); ok {\n\t\tvar users []User\n\t\tvar lookup = bson.M{\"from\": \"stats\", \"localField\": \"_id\", \"foreignField\": \"owner\", \"as\": \"stats\"}\n\t\tvar project = bson.M{\"count\": bson.M{\"$size\": \"$stats\"}}\n\t\tvar match = bson.M{\"count\": bson.M{\"$lte\": 0}}\n\n\t\tvar pipe = mgomap.Aggregate{}.Add(bson.M{\"$lookup\": lookup}).Add(bson.M{\"$project\": project}).Add(bson.M{\"$match\": match})\n\n\t\tif err := U.Pipe(pipe, &users); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, v := range users {\n\t\t\tCreateStats(v.GetID())\n\t\t}\n\n\t}\n\n\treturn errors.New(\"Err to create User instance\")\n}", "title": "" }, { "docid": "7f31d964cc3801974d167c315c079777", "score": "0.48101717", "text": "func (o *Ping) updateStats() {\n\to.stats.requestsSent = o.sentRequests\n\to.stats.requestsLeft = o.params.Amount - o.stats.requestsSent\n\ttotalReplies := int64(o.stats.repliesInOrder + o.stats.repliesOutOfOrder)\n\tif totalReplies != 0 {\n\t\to.stats.avgLatency = o.latencySum / time.Duration(totalReplies)\n\t}\n\to.stats.minLatencyUsec = o.stats.minLatency.Microseconds()\n\to.stats.maxLatencyUsec = o.stats.maxLatency.Microseconds()\n\to.stats.avgLatencyUsec = o.stats.avgLatency.Microseconds()\n}", "title": "" }, { "docid": "27e0185b939d3dea37e7244985130f4c", "score": "0.48084277", "text": "func (c *processCollector1) Update(ch chan<- prometheus.Metric) error {\n // status := PrintCache(\"collector\")\n // if status == false {\n // fmt.Println(\"No value found\")\n // }\n if err := c.processStat(ch); err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "eb1e529b8c7bbf38448ba69daca0a911", "score": "0.4801405", "text": "func (c *statCollector) Update(ch chan<- prometheus.Metric) error {\n\tstats, err := c.fs.Stat()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tch <- prometheus.MustNewConstMetric(c.intr, prometheus.CounterValue, float64(stats.IRQTotal))\n\tch <- prometheus.MustNewConstMetric(c.ctxt, prometheus.CounterValue, float64(stats.ContextSwitches))\n\tch <- prometheus.MustNewConstMetric(c.forks, prometheus.CounterValue, float64(stats.ProcessCreated))\n\n\tch <- prometheus.MustNewConstMetric(c.btime, prometheus.GaugeValue, float64(stats.BootTime))\n\n\tch <- prometheus.MustNewConstMetric(c.procsRunning, prometheus.GaugeValue, float64(stats.ProcessesRunning))\n\tch <- prometheus.MustNewConstMetric(c.procsBlocked, prometheus.GaugeValue, float64(stats.ProcessesBlocked))\n\n\treturn nil\n}", "title": "" }, { "docid": "eb1e529b8c7bbf38448ba69daca0a911", "score": "0.4801405", "text": "func (c *statCollector) Update(ch chan<- prometheus.Metric) error {\n\tstats, err := c.fs.Stat()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tch <- prometheus.MustNewConstMetric(c.intr, prometheus.CounterValue, float64(stats.IRQTotal))\n\tch <- prometheus.MustNewConstMetric(c.ctxt, prometheus.CounterValue, float64(stats.ContextSwitches))\n\tch <- prometheus.MustNewConstMetric(c.forks, prometheus.CounterValue, float64(stats.ProcessCreated))\n\n\tch <- prometheus.MustNewConstMetric(c.btime, prometheus.GaugeValue, float64(stats.BootTime))\n\n\tch <- prometheus.MustNewConstMetric(c.procsRunning, prometheus.GaugeValue, float64(stats.ProcessesRunning))\n\tch <- prometheus.MustNewConstMetric(c.procsBlocked, prometheus.GaugeValue, float64(stats.ProcessesBlocked))\n\n\treturn nil\n}", "title": "" }, { "docid": "3a72fd9d4fd11c2b2a2641b500851fd3", "score": "0.47844735", "text": "func (s *BaseSQLParserListener) EnterAlter_statistics_statement(ctx *Alter_statistics_statementContext) {\n}", "title": "" }, { "docid": "22df97d4c31f6eced8d3b453e9c68ea3", "score": "0.47699845", "text": "func (c *LibratoCollector) Update(ch chan<- prometheus.Metric) error {\n\tif err := c.updateLibratoMetrics(ch); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "53d81cde307144d8c80bb91a2bf27c37", "score": "0.47452128", "text": "func updateJobStats(job string){\n runTxn([]my.Statement{my.Statement{queries[\"updateJobStatsStatement\"], []string{job}}})\n}", "title": "" }, { "docid": "b5cf563ff24aea22a0cd70957848c4f1", "score": "0.47430065", "text": "func (d *PublicDashboardStoreImpl) Update(ctx context.Context, cmd SavePublicDashboardCommand) (int64, error) {\n\tvar affectedRows int64\n\terr := d.sqlStore.WithDbSession(ctx, func(sess *db.Session) error {\n\t\ttimeSettingsJSON, err := json.Marshal(cmd.PublicDashboard.TimeSettings)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tsqlResult, err := sess.Exec(\"UPDATE dashboard_public SET is_enabled = ?, annotations_enabled = ?, time_selection_enabled = ?, share = ?, time_settings = ?, updated_by = ?, updated_at = ? WHERE uid = ?\",\n\t\t\tcmd.PublicDashboard.IsEnabled,\n\t\t\tcmd.PublicDashboard.AnnotationsEnabled,\n\t\t\tcmd.PublicDashboard.TimeSelectionEnabled,\n\t\t\tcmd.PublicDashboard.Share,\n\t\t\tstring(timeSettingsJSON),\n\t\t\tcmd.PublicDashboard.UpdatedBy,\n\t\t\tcmd.PublicDashboard.UpdatedAt.UTC().Format(\"2006-01-02 15:04:05\"),\n\t\t\tcmd.PublicDashboard.Uid)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\taffectedRows, err = sqlResult.RowsAffected()\n\n\t\treturn err\n\t})\n\n\treturn affectedRows, err\n}", "title": "" }, { "docid": "d5a2273803be1ad2258f03e501e3f8aa", "score": "0.47366056", "text": "func UpdateDosenLocation(w http.ResponseWriter, r *http.Request) {\n\n\tlastUpdate := time.Now()\n\tformatedLastUpdate := lastUpdate.Format(\"2006-01-02 15:04\")\n\n\tuserID := r.Context().Value(\"user_id\").(int)\n\tvar status models.Status\n\tqueryUser := \"SELECT * FROM status WHERE user_id = ?\"\n\tif err := models.Dbm.SelectOne(&status, queryUser, userID); err != nil {\n\t\terrors.NewErrorWithStatusCode(http.StatusInternalServerError).WriteTo(w)\n\t\treturn\n\t}\n\tparsedDate, err := time.Parse(\"2006-01-02 15:04\", formatedLastUpdate)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar req req\n\n\tdecoder := json.NewDecoder(r.Body)\n\tif err := decoder.Decode(&req); err != nil {\n\t\terrors.NewErrorWithStatusCode(http.StatusBadRequest).WriteTo(w)\n\t\treturn\n\t}\n\n\tapRequests := req.Data\n\n\tvar apDb []models.AccessPoint\n\n\tquery := \"SELECT * FROM access_point\"\n\n\tif _, err := models.Dbm.Select(&apDb, query); err != nil {\n\t\terrors.NewError(\"can't fetch access points\", http.StatusInternalServerError).WriteTo(w)\n\t\treturn\n\t}\n\n\t// filter AP yang sama dengan AP yang ada di DB\n\tlistAp := make(map[string]int)\n\n\tfor _, apReq := range apRequests {\n\t\tfor _, apData := range apDb {\n\t\t\tif apReq.BSSID == apData.BSSID {\n\t\t\t\tif value, ok := listAp[apReq.BSSID]; ok {\n\t\t\t\t\tvalue = value + apReq.Level\n\t\t\t\t\tlistAp[apReq.BSSID] = value\n\t\t\t\t} else {\n\t\t\t\t\tlistAp[apReq.BSSID] = apReq.Level\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(listAp) == 0 {\n\t\t// TODO UPDATE POSISI DOSEN TO \"\"\n\t\tstatus.Posisi = \"Tidak ada\"\n\t\tstatus.LastUpdate = parsedDate\n\t\tif _, err := models.Dbm.Update(&status); err != nil {\n\t\t\terrors.NewErrorWithStatusCode(http.StatusInternalServerError).WriteTo(w)\n\t\t\treturn\n\t\t}\n\n\t\terrors.NewError(\"Tidak ada Access Point yang sesuai!\", http.StatusBadRequest).WriteTo(w)\n\t\treturn\n\t}\n\n\t// Deklarasi variabel untuk perhitungan data RGB\n\tvar jarakRSSI float64 = 80 // batas jarak dari 0 - maksimum nilai level dbm yang diterima\n\tvar minRSSI int = 0\n\n\t// nilai normalisasi\n\tvar normalisasi1 int\n\tvar normalisasi2 int\n\tvar normalisasi3 int\n\n\t// level RGB\n\tvar level1 int\n\tvar level2 int\n\tvar level3 int\n\n\t// lokasi gedung\n\tvar lokasiGedung string\n\tvar posisi string\n\n\t// Hitung rata2 tiap AP\n\taverage := make(map[string]int)\n\n\tfmt.Println(len(listAp))\n\n\tfor ap, dataLevel := range listAp {\n\t\t// Gedung A Lantai 1\n\t\t// A1 AP1 a0:3d:6f:85:c0:c1\n\t\tif ap == \"a0:3d:6f:85:c0:c1\" {\n\t\t\taverage[\"A1AP1\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// A1 AP2 a0:3d:6f:85:c3:01\n\t\tif ap == \"a0:3d:6f:85:c3:01\" {\n\t\t\taverage[\"A1AP2\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// A1 AP3 a0:e0:af:57:26:81\n\t\tif ap == \"a0:e0:af:57:26:81\" {\n\t\t\taverage[\"A1AP3\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// Gedung A Lantai 2\n\t\t// A2 AP1 a0:3d:6f:8b:11:61\n\t\tif ap == \"a0:3d:6f:8b:11:61\" {\n\t\t\taverage[\"A2AP1\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// A2 AP2 a0:3d:6f:8f:96:01\n\t\tif ap == \"a0:3d:6f:8f:96:01\" {\n\t\t\taverage[\"A2AP2\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// A2 AP3 a0:3d:6f:8b:0f:21\n\t\tif ap == \"a0:3d:6f:8b:0f:21\" {\n\t\t\taverage[\"A2AP3\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// Gedung E Lantai 1\n\t\t// E1 AP1 a0:3d:6f:8b:0b:c1\n\t\tif ap == \"a0:3d:6f:8b:0b:c1\" {\n\t\t\taverage[\"E1AP1\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// E1 AP2 a0:3d:6f:89:22:c1\n\t\tif ap == \"a0:3d:6f:89:22:c1\" {\n\t\t\taverage[\"E1AP2\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// E1 AP3 a0:3d:6f:89:22:e1\n\t\tif ap == \"a0:3d:6f:89:22:e1\" {\n\t\t\taverage[\"E1AP3\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// Gedung E Lantai 2\n\t\t// E2 AP1 a0:3d:6f:8b:0d:81\n\t\tif ap == \"a0:3d:6f:8b:0d:81\" {\n\t\t\taverage[\"E2AP1\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// E2 AP2 a0:e0:af:9a:12:01\n\t\tif ap == \"a0:e0:af:9a:12:01\" {\n\t\t\taverage[\"E2AP2\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// E2 AP3 a0:e0:af:99:e4:e1\n\t\tif ap == \"a0:e0:af:99:e4:e1\" {\n\t\t\taverage[\"E2AP3\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// F2 AP1 a0:3d:6f:8b:0d:c1\n\t\tif ap == \"a0:3d:6f:8b:0d:c1\" {\n\t\t\taverage[\"F2AP1\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// F2 AP2 a0:3d:6f:89:20:e1\n\t\tif ap == \"a0:3d:6f:89:20:e1\" {\n\t\t\taverage[\"F2AP2\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// F2 AP3 a0:3d:6f:8f:52:81\n\t\tif ap == \"a0:3d:6f:8f:52:81\" {\n\t\t\taverage[\"F2AP3\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// F3 AP1 a0:3d:6f:85:c1:41\n\t\tif ap == \"a0:3d:6f:85:c1:41\" {\n\t\t\taverage[\"F3AP1\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// F3 AP2 a0:3d:6f:8f:92:21\n\t\tif ap == \"a0:3d:6f:8f:92:21\" {\n\t\t\taverage[\"F3AP2\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// F3 AP3 a0:3d:6f:5c:8a:a1\n\t\tif ap == \"a0:3d:6f:5c:8a:a1\" {\n\t\t\taverage[\"F3AP3\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// F4 AP1 a0:3d:6f:8f:94:61\n\t\tif ap == \"a0:3d:6f:8f:94:61\" {\n\t\t\taverage[\"F4AP1\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// F4 AP2 a0:3d:6f:76:b8:c1\n\t\tif ap == \"a0:3d:6f:76:b8:c1\" {\n\t\t\taverage[\"F4AP2\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t\t// F4 AP3 a0:3d:6f:85:c1:81\n\t\tif ap == \"a0:3d:6f:85:c1:81\" {\n\t\t\taverage[\"F4AP3\"] = Round((float64(dataLevel) / 10.0))\n\t\t}\n\n\t}\n\n\tfmt.Printf(\"average A1AP1: %d\\n\", average[\"A1AP1\"])\n\tfmt.Printf(\"average A1AP2: %d\\n\", average[\"A1AP2\"])\n\tfmt.Printf(\"average A1AP3: %d\\n\", average[\"A1AP3\"])\n\tfmt.Printf(\"average A2AP1: %d\\n\", average[\"A2AP1\"])\n\tfmt.Printf(\"average A2AP2: %d\\n\", average[\"A2AP2\"])\n\tfmt.Printf(\"average A2AP3: %d\\n\", average[\"A2AP3\"])\n\tfmt.Printf(\"average E1AP1: %d\\n\", average[\"E1AP1\"])\n\tfmt.Printf(\"average E1AP2: %d\\n\", average[\"E1AP2\"])\n\tfmt.Printf(\"average E1AP3: %d\\n\", average[\"E1AP3\"])\n\tfmt.Printf(\"average E2AP1: %d\\n\", average[\"E2AP1\"])\n\tfmt.Printf(\"average E2AP2: %d\\n\", average[\"E2AP2\"])\n\tfmt.Printf(\"average E2AP3: %d\\n\", average[\"E2AP3\"])\n\tfmt.Printf(\"average F2AP1: %d\\n\", average[\"F2AP1\"])\n\tfmt.Printf(\"average F2AP2: %d\\n\", average[\"F2AP2\"])\n\tfmt.Printf(\"average F2AP3: %d\\n\", average[\"F2AP3\"])\n\tfmt.Printf(\"average F3AP1: %d\\n\", average[\"F3AP1\"])\n\tfmt.Printf(\"average F3AP2: %d\\n\", average[\"F3AP2\"])\n\tfmt.Printf(\"average F3AP3: %d\\n\", average[\"F3AP3\"])\n\tfmt.Printf(\"average F4AP1: %d\\n\", average[\"F4AP1\"])\n\tfmt.Printf(\"average F4AP2: %d\\n\", average[\"F4AP2\"])\n\tfmt.Printf(\"average F4AP3: %d\\n\", average[\"F4AP3\"])\n\n\t// Menentukan posisi gedung\n\tgedung := make(map[string]int)\n\n\tgedung[\"A1\"] = average[\"A1AP1\"] + average[\"A1AP2\"] + average[\"A1AP3\"]\n\tgedung[\"A2\"] = average[\"A2AP1\"] + average[\"A2AP2\"] + average[\"A2AP3\"]\n\tgedung[\"E1\"] = average[\"E1AP1\"] + average[\"E1AP2\"] + average[\"E1AP3\"]\n\tgedung[\"E2\"] = average[\"E2AP1\"] + average[\"E2AP2\"] + average[\"E2AP3\"]\n\tgedung[\"F2\"] = average[\"F2AP1\"] + average[\"F2AP2\"] + average[\"F2AP3\"]\n\tgedung[\"F3\"] = average[\"F3AP1\"] + average[\"F3AP2\"] + average[\"F3AP3\"]\n\tgedung[\"F4\"] = average[\"F4AP1\"] + average[\"F4AP2\"] + average[\"F4AP3\"]\n\n\tgedung[\"A\"] = gedung[\"A1\"] + gedung[\"A2\"]\n\tgedung[\"E\"] = gedung[\"E1\"] + gedung[\"E2\"]\n\tgedung[\"F\"] = gedung[\"F2\"] + gedung[\"F3\"] + gedung[\"F4\"]\n\n\t// check gedung\n\tif gedung[\"A\"] < gedung[\"E\"] && gedung[\"A\"] < gedung[\"F\"] {\n\t\t// AP Gedung A Lantai 1\n\t\tif gedung[\"A1\"] < gedung[\"A2\"] {\n\t\t\tnormalisasi1 = int(jarakRSSI) + (minRSSI + average[\"A1AP1\"])\n\t\t\tnormalisasi2 = int(jarakRSSI) + (minRSSI + average[\"A1AP2\"])\n\t\t\tnormalisasi3 = int(jarakRSSI) + (minRSSI + average[\"A1AP3\"])\n\t\t\tlokasiGedung = \"A1\"\n\t\t} else if gedung[\"A2\"] < gedung[\"A1\"] { // lantai 2\n\t\t\tnormalisasi1 = int(jarakRSSI) + (minRSSI + average[\"A2AP1\"])\n\t\t\tnormalisasi2 = int(jarakRSSI) + (minRSSI + average[\"A2AP2\"])\n\t\t\tnormalisasi3 = int(jarakRSSI) + (minRSSI + average[\"A2AP3\"])\n\t\t\tlokasiGedung = \"A2\"\n\t\t}\n\t} else if gedung[\"E\"] < gedung[\"A\"] && gedung[\"E\"] < gedung[\"F\"] {\n\t\t// AP Gedung E Lantai 1\n\t\tif gedung[\"E1\"] < gedung[\"E2\"] {\n\t\t\tnormalisasi1 = int(jarakRSSI) + (minRSSI + average[\"E1AP1\"])\n\t\t\tnormalisasi2 = int(jarakRSSI) + (minRSSI + average[\"E1AP2\"])\n\t\t\tnormalisasi3 = int(jarakRSSI) + (minRSSI + average[\"E1AP3\"])\n\t\t\tlokasiGedung = \"E1\"\n\t\t} else if gedung[\"E2\"] < gedung[\"E1\"] { // lantai 2\n\t\t\tnormalisasi1 = int(jarakRSSI) + (minRSSI + average[\"E2AP1\"])\n\t\t\tnormalisasi2 = int(jarakRSSI) + (minRSSI + average[\"E2AP2\"])\n\t\t\tnormalisasi3 = int(jarakRSSI) + (minRSSI + average[\"E2AP3\"])\n\t\t\tlokasiGedung = \"E2\"\n\t\t}\n\t} else if gedung[\"F\"] < gedung[\"A\"] && gedung[\"F\"] < gedung[\"E\"] {\n\t\t// AP Gedung F Lantai 2\n\t\tif gedung[\"F2\"] < gedung[\"F3\"] && gedung[\"F2\"] < gedung[\"F4\"] {\n\t\t\tnormalisasi1 = int(jarakRSSI) + (minRSSI + average[\"F2AP1\"])\n\t\t\tnormalisasi2 = int(jarakRSSI) + (minRSSI + average[\"F2AP2\"])\n\t\t\tnormalisasi3 = int(jarakRSSI) + (minRSSI + average[\"F2AP3\"])\n\t\t\tlokasiGedung = \"F2\"\n\t\t} else if gedung[\"F3\"] < gedung[\"F2\"] && gedung[\"F3\"] < gedung[\"F4\"] { // lantai 3\n\t\t\tnormalisasi1 = int(jarakRSSI) + (minRSSI + average[\"F3AP1\"])\n\t\t\tnormalisasi2 = int(jarakRSSI) + (minRSSI + average[\"F3AP2\"])\n\t\t\tnormalisasi3 = int(jarakRSSI) + (minRSSI + average[\"F3AP3\"])\n\t\t\tlokasiGedung = \"F3\"\n\t\t} else if gedung[\"F4\"] < gedung[\"F2\"] && gedung[\"F4\"] < gedung[\"F3\"] {\n\t\t\tnormalisasi1 = int(jarakRSSI) + (minRSSI + average[\"F4AP1\"])\n\t\t\tnormalisasi2 = int(jarakRSSI) + (minRSSI + average[\"F4AP2\"])\n\t\t\tnormalisasi3 = int(jarakRSSI) + (minRSSI + average[\"F4AP3\"])\n\t\t\tlokasiGedung = \"F4\"\n\t\t}\n\t}\n\n\t// Pelevelan persamaan (255/jarakRSSI)*normalisasi, nilai 255 didapatkan dari max nilai RGB\n\tlevel1 = Round((255 / jarakRSSI) * float64(normalisasi1)) // R\n\tlevel2 = Round((255 / jarakRSSI) * float64(normalisasi2)) // G\n\tlevel3 = Round((255 / jarakRSSI) * float64(normalisasi3)) // B\n\n\t// bandingkan data level RGB yang telah dihitung dengan data RGB Training di DB\n\tvar dataRgb []models.DataRgb\n\n\tqueryRgb := \"SELECT * FROM data_rgb WHERE gedung=?\"\n\n\tif _, err := models.Dbm.Select(&dataRgb, queryRgb, lokasiGedung); err != nil {\n\t\terrors.NewError(\"can't fetch rgb data\", http.StatusInternalServerError).WriteTo(w)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"R: %d\\n\", level1)\n\tfmt.Printf(\"G: %d\\n\", level2)\n\tfmt.Printf(\"B: %d\\n\", level3)\n\n\t// hitung mean squared error\n\tvar mseData []float64\n\n\t// difference = rgb training - rgb testing\n\tfor _, rgb := range dataRgb {\n\t\t// Mean Squared Error\n\t\tdifLevel1 := rgb.LevelR - level1\n\t\tdifLevel2 := rgb.LevelG - level2\n\t\tdifLevel3 := rgb.LevelB - level3\n\t\tmse := (math.Pow(float64(difLevel1), 2) + math.Pow(float64(difLevel2), 2) + math.Pow(float64(difLevel3), 2)) / 3\n\t\tmseData = append(mseData, mse)\n\t}\n\n\tif len(mseData) == 0 {\n\t\terrors.NewError(\"Data MSE kosong\", http.StatusInternalServerError).WriteTo(w)\n\t\treturn\n\t}\n\n\t// hitung nilai minimum\n\tvar minimumValue = mseData[0]\n\tvar idxMinimum = 0\n\n\tfor i, value := range mseData {\n\t\tif value < minimumValue {\n\t\t\tminimumValue = value\n\t\t\tidxMinimum = i\n\t\t}\n\t}\n\n\t// posisi dosen dilihat dari data RGB\n\tposisi = dataRgb[idxMinimum].Ruang\n\t//TODO UPDATE POSISI DOSEN\n\tstatus.Posisi = posisi\n\tstatus.LastUpdate = parsedDate\n\tif _, err := models.Dbm.Update(&status); err != nil {\n\t\terrors.NewErrorWithStatusCode(http.StatusInternalServerError).WriteTo(w)\n\t\treturn\n\t}\n\tvar response updateResponse\n\tresponse.Posisi = posisi\n\tresponse.Mse = minimumValue\n\n\tjson.NewEncoder(w).Encode(response)\n}", "title": "" }, { "docid": "8ef4bcc3710b85869552f26f3b178dc4", "score": "0.4730836", "text": "func updateVSPStats(ctx context.Context, db *database.VspDatabase,\n\tdcrd rpc.DcrdConnect, netParams *chaincfg.Params) error {\n\n\t// Update counts of voting, voted and revoked tickets.\n\tvoting, voted, revoked, err := db.CountTickets()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Update best block height.\n\tdcrdClient, err := dcrd.Client(ctx, netParams)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tblockHeight, err := dcrdClient.GetBestBlockHeight()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstatsMtx.Lock()\n\tdefer statsMtx.Unlock()\n\n\tstats.UpdateTime = dateTime(time.Now().Unix())\n\tstats.Voting = voting\n\tstats.Voted = voted\n\tstats.Revoked = revoked\n\tstats.BlockHeight = blockHeight\n\n\treturn nil\n}", "title": "" }, { "docid": "241f87e82a84b433d6e0062307881a95", "score": "0.47273228", "text": "func InsertOrchestrator(x model.Orchestrator) {\n\tstatement, err := sqldb.Prepare(\"INSERT INTO Orchestrators (Address, ServiceURI, LastRewardRound, RewardCut, FeeShare, DelegatedState, ActivationRound, DeactivationRound, Active, Status, PricePerPixel, UpdatedAt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\")\n\tif err != nil {\n\t\tlog.Errorln(\"Error in inserting orchestrator\", x.Address)\n\t\tlog.Errorln(err.Error())\n\t}\n\t_, err = statement.Exec(x.Address, x.ServiceURI, x.LastRewardRound, x.RewardCut, x.FeeShare, x.DelegatedStake.String(), x.ActivationRound, x.DeactivationRound.String(), x.Active, x.Status, x.PricePerPixel, time.Now().Unix())\n\tif err != nil {\n\t\tlog.Errorln(\"Error in inserting orchestrator\", x.Address)\n\t\tlog.Errorln(err.Error())\n\t}\n}", "title": "" }, { "docid": "241f87e82a84b433d6e0062307881a95", "score": "0.47273228", "text": "func InsertOrchestrator(x model.Orchestrator) {\n\tstatement, err := sqldb.Prepare(\"INSERT INTO Orchestrators (Address, ServiceURI, LastRewardRound, RewardCut, FeeShare, DelegatedState, ActivationRound, DeactivationRound, Active, Status, PricePerPixel, UpdatedAt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\")\n\tif err != nil {\n\t\tlog.Errorln(\"Error in inserting orchestrator\", x.Address)\n\t\tlog.Errorln(err.Error())\n\t}\n\t_, err = statement.Exec(x.Address, x.ServiceURI, x.LastRewardRound, x.RewardCut, x.FeeShare, x.DelegatedStake.String(), x.ActivationRound, x.DeactivationRound.String(), x.Active, x.Status, x.PricePerPixel, time.Now().Unix())\n\tif err != nil {\n\t\tlog.Errorln(\"Error in inserting orchestrator\", x.Address)\n\t\tlog.Errorln(err.Error())\n\t}\n}", "title": "" }, { "docid": "5cf49ac0e6f0a920f6fe7896ca969efd", "score": "0.47251323", "text": "func (self *HuntDispatcher) Update() error {\n\tlogger := logging.NewLogger(self.config_obj)\n\tdb, err := datastore.GetDB(self.config_obj)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, hunt := range self.hunts {\n\t\t// If the hunt is not in the running state we do not\n\t\t// schedule new clients for it.\n\t\tif hunt.State != api_proto.Hunt_RUNNING {\n\t\t\tcontinue\n\t\t}\n\t\tmodified, err := self._ScheduleClientsForHunt(hunt)\n\t\tif err != nil {\n\t\t\tlogger.Error(\"_ScheduleClientsForHunt:\", err)\n\t\t}\n\n\t\t// Spin here until all the results are processed for this hunt.\n\t\tfor {\n\t\t\tmodified2, result_count, err := self._SortResultsForHunt(hunt)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Error(\"_SortResultsForHunt:\", err)\n\t\t\t}\n\n\t\t\tif result_count == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif modified2 {\n\t\t\t\tmodified = true\n\t\t\t}\n\t\t}\n\n\t\tif modified {\n\t\t\terr = db.SetSubject(self.config_obj, hunt.HuntId, hunt)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Error(\"\", err)\n\t\t\t}\n\t\t}\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4b9d1f92d4a6dc7ed2937b9caafe75c0", "score": "0.47232935", "text": "func updateOperation(request *Request) {\n\tgetRandomTupleResponse, err := request.tarantoolConnection.Exec(\n\t\ttarantool.Call(getRandomTupleCommand,\n\t\t\t[]interface{}{rand.Int()}))\n\tif err == nil {\n\t\tdata := getRandomTupleResponse.Data\n\t\tif len(data) > 0 {\n\t\t\tkey := reflect.ValueOf(data[0]).Index(0).Elem().String()\n\t\t\t_, err := request.tarantoolConnection.Exec(\n\t\t\t\ttarantool.Update(\n\t\t\t\t\tbenchSpaceName,\n\t\t\t\t\tbenchSpacePrimaryIndexName,\n\t\t\t\t\t[]interface{}{key},\n\t\t\t\t\t[]tarantool.Op{tarantool.Op(\n\t\t\t\t\t\ttarantool.OpAssign(\n\t\t\t\t\t\t\t2,\n\t\t\t\t\t\t\tcommon.RandomString(request.ctx.DataSize)))}))\n\t\t\trequest.results.incrementRequestsCounters(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b034a74f167839666b7466affd93f49a", "score": "0.47228625", "text": "func Update(c *gin.Context) {\n\tlog.Info(\"update function called. \", lager.Data{\"X-Request-Id\": util.GetSorterId()})\n\t// Get the uservo id from the url parameter.\n\tuserId, _ := strconv.Atoi(c.Param(\"id\"))\n\n\t// Binding the uservo data\n\tvar u model.UserModel\n\tif err := c.Bind(&u); err != nil {\n\t\thandler.SendResponse(c, errno.ErrBind, nil)\n\t\treturn\n\t}\n\n\t// we update the record based on the uservo id .\n\tu.Id = uint64(userId)\n\tdUser, err := model.GetUserByBy(uint64(userId))\n\tif err != nil {\n\t\thandler.SendResponse(c, errno.ErrUserNotFound, nil)\n\t\treturn\n\t}\n\n\t// Validate the data\n\tif err := u.Validate(); err != nil {\n\t\thandler.SendResponse(c, errno.ErrValidation, nil)\n\t\treturn\n\t}\n\n\t// Encrypt the uservo password.\n\tif err := u.Encrypt(); err != nil {\n\t\thandler.SendResponse(c, errno.ErrEncrypt, nil)\n\t\treturn\n\t}\n\n\tu.CreatedTime = dUser.CreatedTime\n\tu.DeletedTime = dUser.DeletedTime\n\tu.UpdateTime = time.Now()\n\t// save changed fields.\n\tif err := u.Update(); err != nil {\n\t\tlog.Infof(\"%v\", err)\n\t\thandler.SendResponse(c, errno.ErrDatabase, nil)\n\t\treturn\n\t}\n\thandler.SendResponse(c, nil, nil)\n}", "title": "" }, { "docid": "3c4c8a003bc70388e1da16518a01ce8f", "score": "0.47167593", "text": "func (c *buddyinfoCollector) Update(ch chan<- prometheus.Metric) error {\n\tbuddyInfo, err := c.fs.BuddyInfo()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't get buddyinfo: %w\", err)\n\t}\n\n\tlevel.Debug(c.logger).Log(\"msg\", \"Set node_buddy\", \"buddyInfo\", buddyInfo)\n\tfor _, entry := range buddyInfo {\n\t\tfor size, value := range entry.Sizes {\n\t\t\tch <- prometheus.MustNewConstMetric(\n\t\t\t\tc.desc,\n\t\t\t\tprometheus.GaugeValue, value,\n\t\t\t\tentry.Node, entry.Zone, strconv.Itoa(size),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "98cfb803c4730fa8f2efcc6e575c5204", "score": "0.47141314", "text": "func (ps *personSqac) Update(person *Person) error {\n\n\terr := ps.ep.UpdEp.BeforeDB(person)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = ps.handle.Update(person)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = ps.ep.UpdEp.AfterDB(person)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn err\n}", "title": "" }, { "docid": "298ea3e2bfe24179f277755c390bbd0e", "score": "0.4697865", "text": "func (c *Commander) Updatetoberetained(w http.ResponseWriter, r *http.Request) {\n\tdb := database.DbConn()\n\tdefer db.Close()\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tif (strings.Contains(Role, \"project manager\")) == true {\n\t\tvar Post models.Toberetaineddata\n\t\terr := json.NewDecoder(r.Body).Decode(&Post)\n\t\tcatch(err)\n\t\tvar ManagerID int\n\t\tstmt1, err := db.Query(\"select id from sub_project_manager where sub_project_id in (select id from sub_project where sub_project_name= ?) and manager_id in (select id from project_manager where project_manager_email= ?)\", Post.ProjectName, UserName)\n\t\tcatch(err)\n\t\tdefer stmt1.Close()\n\t\tif stmt1.Next() != false {\n\t\t\terr := stmt1.Scan(&ManagerID)\n\t\t\tcatch(err)\n\t\t}\n\t\tif ManagerID != 0 {\n\t\t\tquery, err := db.Prepare(\"Update to_be_retained set activeresignation = ?, performance_impro_plan = ?, to_b_retained = ?, updated_at = ? where id = ?\")\n\t\t\tcatch(err)\n\t\t\tupdate := time.Now()\n\t\t\t_, errQuery := query.Exec(Post.ActiveResignation, Post.PerformanceImproPlan, Post.ToBeRetained, update, Post.ID)\n\t\t\tcatch(errQuery)\n\t\t\tdefer query.Close()\n\t\t\trespondwithJSON(w, http.StatusOK, map[string]string{\"message\": \"update successfully\"})\n\t\t} else {\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\tfmt.Fprintf(w, \"Project is not under you\")\n\t\t}\n\t} else {\n\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\tfmt.Fprintf(w, \"Unauthorised access\")\n\t}\n\n}", "title": "" }, { "docid": "d9bb274b4f48d67cb1036f532cd0b6cb", "score": "0.46959049", "text": "func (c *Client) recordToUpdate(statusCode int) {\n\n\tmapKey := strconv.Itoa(c.userIds.Uid) + \"-\" + strconv.Itoa(c.userIds.Tid)\n\n\tfile, error := os.OpenFile(\".update\", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0766)\n\tif error != nil {\n\t\tfmt.Println(error)\n\t}\n\n\tdefer file.Close()\n\tif _, ok := UPDATEMAP[mapKey]; ok {\n\t\tdelete(UPDATEMAP, mapKey)\n\t}\n\n\t//handle map {\"4-129\":[\"zz8k5nsfzv0jljl\",\"2\",\"node3-1,node2-1,node2-1\",\"gpu\",\"8\",\"0\"]}\n\tUPDATEMAP[mapKey] = append(UPDATEMAP[mapKey], c.hub.clients[*c.userIds].Head.rm.RandomName) //0\n\tUPDATEMAP[mapKey] = append(UPDATEMAP[mapKey], c.hub.clients[*c.userIds].Head.rm.FtpFileName) //1\n\tUPDATEMAP[mapKey] = append(UPDATEMAP[mapKey], strconv.Itoa(c.hub.clients[*c.userIds].Head.sm.Type)) //2\n\tUPDATEMAP[mapKey] = append(UPDATEMAP[mapKey], c.hub.clients[*c.userIds].Head.rm.Content.ResourceType) //3\n\n\tvar selectedNodes []string\n\tfor _, v := range *(c.hub.clients[*c.userIds].Head.rm.Content.SelectedNodes) {\n\t\tselectedNodes = append(selectedNodes, v.NodeNames+\"|\"+strconv.Itoa(v.GPUNum))\n\t}\n\tUPDATEMAP[mapKey] = append(UPDATEMAP[mapKey], strings.Join(selectedNodes, \",\")) //4\n\n\tUPDATEMAP[mapKey] = append(UPDATEMAP[mapKey], strconv.Itoa(statusCode)) // socket statusId //5\n\n\tUPDATEMAP[mapKey] = append(UPDATEMAP[mapKey], \"\") // updated:\"\", not updated:\"1\" //6\n\n\tUPDATEMAP[mapKey] = append(UPDATEMAP[mapKey], c.hub.clients[*c.userIds].Head.ips) // 7\n\n\t//dataReady, err := json.MarshalIndent(UPDATEMAP, \"\", \" \")\n\tdataReady, err := json.Marshal(UPDATEMAP)\n\tif err != nil {\n\t\tTrace.Printf(\"recordToUpdate MarshalIndent err: %s\\n\", err)\n\t}\n\tfile.Write(dataReady)\n}", "title": "" }, { "docid": "e7fda6742428a67d4e1f2d5cf4fde629", "score": "0.4686042", "text": "func (u *userStateManagerImpl) Update() {\n\tif u.expr == \"\" {\n\t\t// Nothing to do\n\t\treturn\n\t}\n\tvec, err := query_api.QueryPrometheusVector(u.promAPIClient, u.expr)\n\tif err != nil {\n\t\tglog.Errorf(\"failed querying user state metric %v\", err)\n\t\treturn\n\t}\n\tu.totalUsers = 0\n\tu.usersNetworkTable = make(map[string]*userNetworkState)\n\tfor _, v := range vec {\n\t\t// Get labels from query result\n\t\tvar networkID string\n\t\tvar gatewayID string\n\t\tfor label, value := range v.Metric {\n\t\t\tif string(label) == metrics.NetworkLabelName {\n\t\t\t\tnetworkID = string(value)\n\t\t\t} else if string(label) == metrics.GatewayLabelName {\n\t\t\t\tgatewayID = string(value)\n\t\t\t}\n\t\t}\n\t\tuserNetworkTable, ok := u.usersNetworkTable[networkID]\n\t\tif !ok {\n\t\t\tuserNetworkTable = &userNetworkState{\n\t\t\t\ttotalUsersPerNetwork: 0,\n\t\t\t\tusersGatewayTable: make(map[string]int),\n\t\t\t}\n\t\t\tu.usersNetworkTable[networkID] = userNetworkTable\n\t\t}\n\t\tuserCount := int(v.Value)\n\t\tuserNetworkTable.totalUsersPerNetwork += userCount\n\t\tuserNetworkTable.usersGatewayTable[gatewayID] = userCount\n\t\tu.totalUsers += userCount\n\t}\n}", "title": "" }, { "docid": "ec2bd34cdc142daa0a6c18e4575d8396", "score": "0.46728712", "text": "func (st *HTTPStats) updateStats(api string, r *http.Request, w *logger.ResponseWriter) {\n\t// A successful request has a 2xx response code\n\tsuccessReq := w.StatusCode >= 200 && w.StatusCode < 300\n\n\tif !strings.HasSuffix(r.URL.Path, prometheusMetricsPathLegacy) ||\n\t\t!strings.HasSuffix(r.URL.Path, prometheusMetricsV2ClusterPath) ||\n\t\t!strings.HasSuffix(r.URL.Path, prometheusMetricsV2NodePath) {\n\t\tst.totalS3Requests.Inc(api)\n\t\tif !successReq {\n\t\t\tswitch w.StatusCode {\n\t\t\tcase 0:\n\t\t\tcase 499:\n\t\t\t\t// 499 is a good error, shall be counted at canceled.\n\t\t\t\tst.totalS3Canceled.Inc(api)\n\t\t\tdefault:\n\t\t\t\tst.totalS3Errors.Inc(api)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Increment the prometheus http request response histogram with appropriate label\n\thttpRequestsDuration.With(prometheus.Labels{\"api\": api}).Observe(w.TimeToFirstByte.Seconds())\n}", "title": "" }, { "docid": "3abc3829ec79db38494a5723c245b7d3", "score": "0.46699718", "text": "func (db *DatabaseContext) UpdateCalculatedStats() {\n\n\t// Max channel cache size\n\tif cache, ok := db.changeCache.(*changeCache); ok {\n\t\tdb.DbStats.StatsCache().Set(base.StatKeyChannelCacheMaxEntries, base.ExpvarIntVal(cache.MaxCacheSize()))\n\t}\n\n}", "title": "" }, { "docid": "fc73695093fa9b4f399d250245653db7", "score": "0.46692947", "text": "func (maol *MidAdminOperationLog) Update(ctx context.Context, key ...interface{}) error {\n\tvar err error\n\tvar dbConn *sql.DB\n\n\t// if deleted, bail\n\tif maol._deleted {\n\t\treturn errors.New(\"update failed: marked for deletion\")\n\t}\n\n\ttx, err := components.M.GetConnFromCtx(ctx)\n\tif err != nil {\n\t\tdbConn, err = components.M.GetMasterConn()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\ttableName, err := GetMidAdminOperationLogTableName(key...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// sql query\n\tsqlstr := `UPDATE ` + tableName + ` SET ` +\n\t\t`user_id = ?, path = ?, method = ?, ip = ?, input = ?, created_at = ?, updated_at = ?` +\n\t\t` WHERE id = ?`\n\n\t// run query\n\tutils.GetTraceLog(ctx).Debug(\"DB\", zap.String(\"SQL\", fmt.Sprint(sqlstr, maol.UserID, maol.Path, maol.Method, maol.IP, maol.Input, maol.CreatedAt, maol.UpdatedAt, maol.ID)))\n\tif tx != nil {\n\t\t_, err = tx.Exec(sqlstr, maol.UserID, maol.Path, maol.Method, maol.IP, maol.Input, maol.CreatedAt, maol.UpdatedAt, maol.ID)\n\t} else {\n\t\t_, err = dbConn.Exec(sqlstr, maol.UserID, maol.Path, maol.Method, maol.IP, maol.Input, maol.CreatedAt, maol.UpdatedAt, maol.ID)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "b2ca169de7a018449cc3943fb5545c32", "score": "0.4669125", "text": "func (s *Stats) IncrementOrgs() {\n\ts.Lock()\n\tdefer s.Unlock()\n\ts.Organizations++\n}", "title": "" }, { "docid": "b7a062b2c5e4225d16e8059b6ffa87e1", "score": "0.46666026", "text": "func (d *Dao) UpdatePrivilegeResources(tx *gorm.DB, ps *model.PrivilegeResources) (aff int64, err error) {\n\tstage := map[string]interface{}{\n\t\t\"link\": ps.Link,\n\t}\n\tif ps.ImageURL != \"\" {\n\t\tstage[\"image_url\"] = ps.ImageURL\n\t}\n\tdb := tx.Table(_vipPrivilegesResources).Where(\"pid = ? AND resources_type = ?\", ps.PID, ps.Type).Updates(stage)\n\tif err = db.Error; err != nil {\n\t\treturn\n\t}\n\taff = db.RowsAffected\n\treturn\n}", "title": "" }, { "docid": "0c410691471d07f5970a0d85fc55ff62", "score": "0.46603084", "text": "func (cs *ConversationStat) Update(db XODB) error {\n\tvar err error\n\n\t// if doesn't exist, bail\n\tif !cs._exists {\n\t\treturn errors.New(\"update failed: does not exist\")\n\t}\n\n\t// if deleted, bail\n\tif cs._deleted {\n\t\treturn errors.New(\"update failed: marked for deletion\")\n\t}\n\n\t// sql query with composite primary key\n\tconst sqlstr = `UPDATE custmchat.conversation_stats SET ` +\n\t\t`total_count = ?, effective_count = ?, message_count = ?, good_count = ?, medium_count = ?, bad_count = ?, gold_count = ?, silver_count = ?, bronze_count = ?, no_grade_count = ?, duration_in_sec = ?, remark_count = ?, visit_count = ?, visit_page_count = ?, visitor_count = ?, wait_time_in_sec = ?` +\n\t\t` WHERE ent_id = ? AND created_at = ?`\n\n\t// run query\n\tXOLog(sqlstr, cs.TotalCount, cs.EffectiveCount, cs.MessageCount, cs.GoodCount, cs.MediumCount, cs.BadCount, cs.GoldCount, cs.SilverCount, cs.BronzeCount, cs.NoGradeCount, cs.DurationInSec, cs.RemarkCount, cs.VisitCount, cs.VisitPageCount, cs.VisitorCount, cs.WaitTimeInSec, cs.EntID, cs.CreatedAt)\n\t_, err = db.Exec(sqlstr, cs.TotalCount, cs.EffectiveCount, cs.MessageCount, cs.GoodCount, cs.MediumCount, cs.BadCount, cs.GoldCount, cs.SilverCount, cs.BronzeCount, cs.NoGradeCount, cs.DurationInSec, cs.RemarkCount, cs.VisitCount, cs.VisitPageCount, cs.VisitorCount, cs.WaitTimeInSec, cs.EntID, cs.CreatedAt)\n\treturn err\n}", "title": "" }, { "docid": "eacf5a1acd5c3ba35c10b5f06fb30695", "score": "0.46565157", "text": "func UpdateStats(context interface{}, db *db.DB, id string) (*Stats, error) {\n\tlog.Dev(context, \"UpdateStats\", \"Started : Form[%s]\", id)\n\n\tif !bson.IsObjectIdHex(id) {\n\t\tlog.Error(context, \"UpdateStats\", ErrInvalidID, \"Completed\")\n\t\treturn nil, ErrInvalidID\n\t}\n\n\tobjectID := bson.ObjectIdHex(id)\n\n\t// Find the number of submissions on this form\n\tcount, err := submission.Count(context, db, id)\n\tif err != nil {\n\t\tlog.Error(context, \"UpdateStats\", ErrInvalidID, \"Completed\")\n\t\treturn nil, err\n\t}\n\n\tstats := Stats{\n\t\tResponses: count,\n\t}\n\n\tf := func(c *mgo.Collection) error {\n\t\tu := bson.M{\n\t\t\t\"$set\": bson.M{\n\t\t\t\t\"stats\": stats,\n\t\t\t\t\"date_updated\": time.Now(),\n\t\t\t},\n\t\t}\n\t\tlog.Dev(context, \"UpdateStats\", \"MGO : db.%s.update(%s, %s)\", c.Name, mongo.Query(objectID), mongo.Query(u))\n\t\treturn c.UpdateId(objectID, u)\n\t}\n\n\tif err := db.ExecuteMGO(context, Collection, f); err != nil {\n\t\tlog.Error(context, \"UpdateStats\", err, \"Completed\")\n\t\treturn nil, err\n\t}\n\n\tlog.Dev(context, \"UpdateStats\", \"Completed\")\n\treturn &stats, nil\n}", "title": "" }, { "docid": "ffcfbe275f8cd72b6a94799ddff4190d", "score": "0.4655162", "text": "func (o *AuthProvider) Update(exec boil.Executor, whitelist ...string) error {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(exec); err != nil {\n\t\treturn err\n\t}\n\tkey := makeCacheKey(whitelist, nil)\n\tauthProviderUpdateCacheMut.RLock()\n\tcache, cached := authProviderUpdateCache[key]\n\tauthProviderUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := strmangle.UpdateColumnSet(authProviderColumns, authProviderPrimaryKeyColumns, whitelist)\n\t\tif len(wl) == 0 {\n\t\t\treturn errors.New(\"chado: unable to update auth_provider, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"auth_provider\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, authProviderPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(authProviderType, authProviderMapping, append(wl, authProviderPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\t_, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"chado: unable to update auth_provider row\")\n\t}\n\n\tif !cached {\n\t\tauthProviderUpdateCacheMut.Lock()\n\t\tauthProviderUpdateCache[key] = cache\n\t\tauthProviderUpdateCacheMut.Unlock()\n\t}\n\n\treturn o.doAfterUpdateHooks(exec)\n}", "title": "" }, { "docid": "1654098b575d6219ef1b9f965b81ca60", "score": "0.4655078", "text": "func (g *Game) UpdatePreference(c *gin.Context) {\n\n}", "title": "" }, { "docid": "75ead9eca56591797959e43f56747510", "score": "0.46492723", "text": "func (o *AccessToken) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tif !boil.TimestampsAreSkipped(ctx) {\n\t\tcurrTime := time.Now().In(boil.GetLocation())\n\n\t\to.UpdatedAt = currTime\n\t}\n\n\tvar err error\n\tkey := makeCacheKey(columns, nil)\n\taccessTokenUpdateCacheMut.RLock()\n\tcache, cached := accessTokenUpdateCache[key]\n\taccessTokenUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\taccessTokenAllColumns,\n\t\t\taccessTokenPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update access_tokens, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"access_tokens\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, accessTokenPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(accessTokenType, accessTokenMapping, append(wl, accessTokenPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update access_tokens row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for access_tokens\")\n\t}\n\n\tif !cached {\n\t\taccessTokenUpdateCacheMut.Lock()\n\t\taccessTokenUpdateCache[key] = cache\n\t\taccessTokenUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, nil\n}", "title": "" }, { "docid": "0924335303eb2271981409be19a1b5e4", "score": "0.4639851", "text": "func (ovsd *OvsDriver) Update(context interface{}, tableUpdates ovsdb.TableUpdates) {\n}", "title": "" }, { "docid": "36fa887e2ce490324e812171cefa0415", "score": "0.46314168", "text": "func UpdateAchievement(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {\n\tfmt.Println(\"Getting Achievements\")\n\n\treturn events.APIGatewayProxyResponse{\n\t\tBody: \"Put Request!\",\n\t\tStatusCode: 200,\n\t}, nil\n}", "title": "" }, { "docid": "41f115db11864be07be247ae3fe96eaa", "score": "0.46302757", "text": "func (m *UserAnalytics) SetActivityStatistics(value []ActivityStatisticsable)() {\n err := m.GetBackingStore().Set(\"activityStatistics\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "38ba6bb15469d257a50cbd15b07f0fdd", "score": "0.46297792", "text": "func (o *PlanetUser) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tplanetUserUpdateCacheMut.RLock()\n\tcache, cached := planetUserUpdateCache[key]\n\tplanetUserUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tplanetUserAllColumns,\n\t\t\tplanetUserPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update planet_users, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `planet_users` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, planetUserPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(planetUserType, planetUserMapping, append(wl, planetUserPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update planet_users row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for planet_users\")\n\t}\n\n\tif !cached {\n\t\tplanetUserUpdateCacheMut.Lock()\n\t\tplanetUserUpdateCache[key] = cache\n\t\tplanetUserUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "title": "" }, { "docid": "9f348625a634548290bd58f17c049808", "score": "0.46186784", "text": "func (s *Server) incrementStats(r *http.Request) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\ts.stats.IncrRequestStats(r.ContentLength)\n\ts.stats.IncrRouteStats(r.URL.Path, r.ContentLength)\n}", "title": "" }, { "docid": "34ffdc3ced2dab2d9a9dd57061a87cdb", "score": "0.46161675", "text": "func (msr *MiddlewareServerRepo) Update(middlewareServer metadata.MiddlewareServer) error {\n\tsql := `update t_meta_middleware_server_info set cluster_id = ?, server_name = ?, middleware_role = ?, host_ip = ?, port_num = ?, del_flag = ? where id = ?;`\n\tlog.Debugf(\"metadata MiddlewareServerRepo.Update() update sql: %s\", sql)\n\t_, err := msr.Execute(sql,\n\t\tmiddlewareServer.GetClusterID(),\n\t\tmiddlewareServer.GetServerName(),\n\t\tmiddlewareServer.GetMiddlewareRole(),\n\t\tmiddlewareServer.GetHostIP(),\n\t\tmiddlewareServer.GetPortNum(),\n\t\tmiddlewareServer.GetDelFlag(),\n\t\tmiddlewareServer.Identity(),\n\t)\n\n\treturn err\n}", "title": "" }, { "docid": "84a8cb613bfb3ff6536dae0fb69d6b68", "score": "0.46134517", "text": "func (a *ClientAllocations) Stats(args *cstructs.AllocStatsRequest, reply *cstructs.AllocStatsResponse) error {\n\t// We only allow stale reads since the only potentially stale information is\n\t// the Node registration and the cost is fairly high for adding another hope\n\t// in the forwarding chain.\n\targs.QueryOptions.AllowStale = true\n\n\t// Potentially forward to a different region.\n\tif done, err := a.srv.forward(\"ClientAllocations.Stats\", args, args, reply); done {\n\t\treturn err\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"client_allocations\", \"stats\"}, time.Now())\n\n\t// Check node read permissions\n\tif aclObj, err := a.srv.ResolveToken(args.AuthToken); err != nil {\n\t\treturn err\n\t} else if aclObj != nil && !aclObj.AllowNsOp(args.Namespace, acl.NamespaceCapabilityReadJob) {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\t// Verify the arguments.\n\tif args.AllocID == \"\" {\n\t\treturn errors.New(\"missing AllocID\")\n\t}\n\n\t// Find the allocation\n\tsnap, err := a.srv.State().Snapshot()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\talloc, err := snap.AllocByID(nil, args.AllocID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif alloc == nil {\n\t\treturn structs.NewErrUnknownAllocation(args.AllocID)\n\t}\n\n\t// Make sure Node is valid and new enough to support RPC\n\t_, err = getNodeForRpc(snap, alloc.NodeID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get the connection to the client\n\tstate, ok := a.srv.getNodeConn(alloc.NodeID)\n\tif !ok {\n\t\treturn findNodeConnAndForward(a.srv, alloc.NodeID, \"ClientAllocations.Stats\", args, reply)\n\t}\n\n\t// Make the RPC\n\treturn NodeRpc(state.Session, \"Allocations.Stats\", args, reply)\n}", "title": "" }, { "docid": "4af2d06dff5ef2e9908c9c32cdb9a560", "score": "0.46120164", "text": "func setUserAchievements(w http.ResponseWriter, r *http.Request) {\n\tuser := context.Get(r, \"user\").(*core.User)\n\n\tdata := context.Get(r, \"data\").(string)\n\tvar req setAchievementsRequest\n\terr := json.Unmarshal([]byte(data), &req)\n\tif err != nil {\n\t\tEasyErrorResponse(w, core.NebError, err)\n\t\treturn\n\t}\n\n\tcount := len(req.Achievements)\n\tfor _, ach := range req.Achievements {\n\t\terr = user.SetAchievementProgress(ach.Id, ach.Value)\n\t\tif err != nil {\n\t\t\tcount--\n\t\t\tcontinue\n\t\t}\n\t}\n\tif count != len(req.Achievements) {\n\t\tEasyResponse(w, core.NebErrorPartialFail, \"Updated \"+string(count)+\" Achievements\")\n\t\treturn\n\t}\n\n\tEasyResponse(w, core.NebErrorNone, \"Updated Achievements\")\n}", "title": "" }, { "docid": "48e72a6cb30b1d0e3436c2b2c45bac67", "score": "0.4611963", "text": "func (c *AdminuserController) Update(ctx *app.UpdateAdminuserContext) error {\n\t// TBD: implement\n\treturn nil\n}", "title": "" }, { "docid": "190a64576efe236f35a8d5112fc61ae1", "score": "0.4604394", "text": "func (m *ManageOperation) updateInstitutionTotal(account Account, typeMovement string, value int) error {\n\tvar totalInstitution TotalInstitution\n\tvar debitInstitution inf.Dec\n\tvar creditInstitution inf.Dec\n\terr := m.Session.Query(`SELECT institucion, nombre_institucion, debitos, creditos\n\t\t\t\t\t\t\t\tFROM totales_institucion_financiera\n\t\t\t\t\t\t\t\tWHERE institucion = ?`, account.InstitutionID).WithContext(context.TODO()).Consistency(gocql.One).Scan(&totalInstitution.InstitutionID, &totalInstitution.InstitutionName, &debitInstitution, &creditInstitution)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn nil\n\t}\n\ttotalInstitution.Debits = debitInstitution.String()\n\ttotalInstitution.Credits = creditInstitution.String()\n\tvar query *gocql.Query\n\tvar amountExchange int\n\tif typeMovement == \"DEBITO\" {\n\t\tamountExchange = m.ConvertStringFloatToCurrency(totalInstitution.Debits)\n\t\tamountExchange += value\n\t\ttotalInstitution.Debits = m.ConvertCurrencyToStringFloat(amountExchange)\n\t\tdebitDec, _ := new(inf.Dec).SetString(totalInstitution.Debits)\n\t\tquery = m.Session.Query(`UPDATE totales_institucion_financiera\n\t\t\t\tSET debitos = ?\n\t\t\t\tWHERE institucion = ?`, debitDec, totalInstitution.InstitutionID)\n\t}else{\n\t\tamountExchange = m.ConvertStringFloatToCurrency(totalInstitution.Credits)\n\t\tamountExchange += value\n\t\ttotalInstitution.Credits = m.ConvertCurrencyToStringFloat(amountExchange)\n\t\tcreditDec, _ := new(inf.Dec).SetString(totalInstitution.Credits)\n\t\tquery = m.Session.Query(`UPDATE totales_institucion_financiera\n\t\t\t\tSET creditos = ?\n\t\t\t\tWHERE institucion = ?`, creditDec, totalInstitution.InstitutionID)\n\t}\n\terr = query.WithContext(context.TODO()).Exec()\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6235dd89930ad6c81215e5e61faac040", "score": "0.4604126", "text": "func (s *MeterDefinitionStore) Update(obj interface{}) error {\n\t// TODO: For now, just call Add, in the future one could check if the resource version changed?\n\treturn s.Add(obj)\n}", "title": "" }, { "docid": "e06906e871b72844fdfcb665c906bcdc", "score": "0.45943895", "text": "func (p *Participant) Update(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {\n\tconn, err := db.Connect()\n\tdefer conn.Close()\n\tif err != nil {\n\t\treturn common.APIError(http.StatusInternalServerError, err)\n\t}\n\n\tsession := conn.NewSession(nil)\n\tdefer session.Close()\n\n\tfilter := dbr.And(\n\t\tdbr.Eq(\"id\", request.PathParameters[\"participant_id\"]),\n\t\tdbr.Eq(\"trip_id\", request.PathParameters[\"id\"]),\n\t\tdbr.Neq(\"role\", ParticipantOwnerRole),\n\t)\n\ttotal, err := db.Validate(session, []string{\"count(id) total\"}, db.TableTripParticipant, filter)\n\tif err != nil {\n\t\treturn common.APIError(http.StatusInternalServerError, err)\n\t}\n\n\tif total <= 0 {\n\t\treturn common.APIError(http.StatusForbidden, errors.New(\"trip owner can't be updated\"))\n\t}\n\n\ttokenUser := common.GetTokenUser(request)\n\tif !tokenUser.IsAdmin() {\n\t\tfilter := dbr.And(\n\t\t\tdbr.Eq(\"trip_id\", request.PathParameters[\"id\"]),\n\t\t\tdbr.Eq(\"user_id\", tokenUser.UserID),\n\t\t\tdbr.Or(\n\t\t\t\tdbr.Eq(\"role\", ParticipantOwnerRole),\n\t\t\t\tdbr.Eq(\"role\", ParticipantAdminRole),\n\t\t\t),\n\t\t)\n\t\ttotal, err := db.Validate(session, []string{\"count(id) total\"}, db.TableTripParticipant, filter)\n\t\tif err != nil {\n\t\t\treturn common.APIError(http.StatusInternalServerError, err)\n\t\t}\n\t\tif total <= 0 {\n\t\t\treturn common.APIError(http.StatusForbidden, errors.New(\"only trip admin can update participants\"))\n\t\t}\n\t}\n\n\tjsonMap := make(map[string]interface{})\n\terr = json.Unmarshal([]byte(request.Body), &jsonMap)\n\tif err != nil {\n\t\treturn common.APIError(http.StatusBadRequest, err)\n\t}\n\n\tjsonMap[\"updated_by\"] = tokenUser.UserID\n\tjsonMap[\"updated_date\"] = time.Now()\n\n\ttx, err := session.Begin()\n\tif err != nil {\n\t\treturn common.APIError(http.StatusInternalServerError, err)\n\t}\n\tdefer tx.RollbackUnlessCommitted()\n\n\terr = db.Update(tx, db.TableTripParticipant, request.PathParameters[\"participant_id\"], *p, jsonMap)\n\tif err != nil {\n\t\treturn common.APIError(http.StatusInternalServerError, err)\n\t}\n\n\ttx.Commit()\n\n\tresult, err := db.QueryOne(session, db.TableTripParticipant, request.PathParameters[\"participant_id\"], Participant{})\n\tif err != nil {\n\t\treturn common.APIError(http.StatusInternalServerError, err)\n\t}\n\n\treturn common.APIResponse(result, http.StatusOK)\n}", "title": "" }, { "docid": "f792cbacdcad7a44b7dc6e7c0c37d3f2", "score": "0.4582997", "text": "func (pc Controller) Update(c *gin.Context) {\n\tid := c.Params.ByName(\"id\")\n\tvar g users.Gateway\n\tp, err := g.UpdateByID(id, c)\n\n\tif err != nil {\n\t\tc.AbortWithStatus(400)\n\t\tfmt.Println(err)\n\t} else {\n\t\tc.JSON(200, p)\n\t}\n}", "title": "" }, { "docid": "ab5b3769a4120079cde6abca4271adff", "score": "0.45790836", "text": "func (client *Client) update(tx *sqlx.Tx) error {\n\tconst q = `UPDATE Clients\n\t SET name=$2, secret=$3, scopeWhitelist=$4, scopeBlacklist=$5, redirectURIs=$6, updatedAt=now()\n\t WHERE uuid=$1`\n\n\terr := client.deleteScope(tx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = tx.Exec(q, client.UUID, client.Name, client.Secret, client.ScopeWhitelist,\n\t\tclient.ScopeBlacklist, client.RedirectURIs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(client.ScopeProvidedMap) > 0 {\n\t\terr = client.createScope(tx)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "3b3f204d6104575a1118a5e5733b2179", "score": "0.45762604", "text": "func (ainfo *accountInfo) processUpdate(p ParamsUpdate) uint64{\nswitch(p.Operation){\n case \"deposit\":\n ainfo.processDeposit(p.Amt)\n case \"withDrawal\":\n ainfo.processWithdrawal(p.Amt)\n default:\n fmt.Println(\"Incorrect operation\\n\")\n}\nprocessedTrans[p.ReqId] = Hist{p.AccountNumber,ainfo.Balance,p.Operation}\nreturn ainfo.Balance\n}", "title": "" }, { "docid": "d5c3eb0c53b0ac397219ca616fddde7e", "score": "0.45650068", "text": "func (d *FirewallManager) updateCounts(operation, policyType string) {\n\t// BRIEF: read increaseCounts and decreaseCounts for an explanation\n\t// of when and why these functions are called.\n\n\tf := \"[FwManager-\" + d.name + \"](updateCounts) \"\n\n\t//-------------------------------------\n\t// Increase\n\t//-------------------------------------\n\n\tincrease := func() {\n\t\tdirections := []string{}\n\n\t\t// -- Increase the counts and append the directions to update accordingly.\n\t\tif (policyType == \"ingress\" || policyType == \"*\") && d.increaseCount(\"ingress\") {\n\t\t\tdirections = append(directions, \"ingress\")\n\t\t}\n\t\tif (policyType == \"egress\" || policyType == \"*\") && d.increaseCount(\"egress\") {\n\t\t\tdirections = append(directions, \"egress\")\n\t\t}\n\n\t\tif len(directions) == 0 {\n\t\t\treturn\n\t\t}\n\n\t\t// -- Let's now update the default actions.\n\t\tfor _, ip := range d.linkedPods {\n\t\t\tname := \"fw-\" + ip\n\t\t\tfor _, direction := range directions {\n\t\t\t\terr := d.updateDefaultAction(name, direction, pcn_types.ActionDrop)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Errorf(f+\"Could not update default action for firewall %s: %s\", name, direction)\n\t\t\t\t} else {\n\t\t\t\t\tif _, err := d.applyRules(name, direction); err != nil {\n\t\t\t\t\t\tlogger.Errorf(f+\"Could not apply rules for firewall %s: %s\", name, direction)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//-------------------------------------\n\t// Decrease\n\t//-------------------------------------\n\n\tdecrease := func() {\n\t\tdirections := []string{}\n\n\t\t// -- Decrease the counts and append the directions to update accordingly.\n\t\tif (policyType == \"ingress\" || policyType == \"*\") && d.decreaseCount(\"ingress\") {\n\t\t\tdirections = append(directions, \"ingress\")\n\t\t}\n\t\tif (policyType == \"egress\" || policyType == \"*\") && d.decreaseCount(\"egress\") {\n\t\t\tdirections = append(directions, \"egress\")\n\t\t}\n\n\t\tif len(directions) == 0 {\n\t\t\treturn\n\t\t}\n\n\t\t// -- Let's now update the default actions.\n\t\tfor _, ip := range d.linkedPods {\n\t\t\tname := \"fw-\" + ip\n\t\t\tfor _, direction := range directions {\n\t\t\t\terr := d.updateDefaultAction(name, direction, pcn_types.ActionForward)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Errorf(f+\"Could not update default action for firewall %s: %s\", name, direction)\n\t\t\t\t} else {\n\t\t\t\t\tif _, err := d.applyRules(name, direction); err != nil {\n\t\t\t\t\t\tlogger.Errorf(f+\"Could not apply rules for firewall %s: %s\", name, direction)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch operation {\n\tcase \"increase\":\n\t\tincrease()\n\tcase \"decrease\":\n\t\tdecrease()\n\t}\n}", "title": "" }, { "docid": "8cc2fd0ac7d528b526758f8bab7a41bd", "score": "0.4564278", "text": "func (s *Service) Update() error {\n\tdbis, err := s.MetaClient.Databases()\n\tif err != nil {\n\t\treturn err\n\t}\n\tallEntries := make(map[subEntry]bool, 0)\n\t// Add in new subscriptions\n\tfor _, dbi := range dbis {\n\t\tfor _, rpi := range dbi.RetentionPolicies {\n\t\t\tfor _, si := range rpi.Subscriptions {\n\t\t\t\tse := subEntry{\n\t\t\t\t\tdb: dbi.Name,\n\t\t\t\t\trp: rpi.Name,\n\t\t\t\t\tname: si.Name,\n\t\t\t\t}\n\t\t\t\tallEntries[se] = true\n\t\t\t\tif _, ok := s.subs[se]; ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tsub, err := s.createSubscription(se, si.Mode, si.Destinations)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.subs[se] = sub\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove deleted subs\n\tfor se := range s.subs {\n\t\tif !allEntries[se] {\n\t\t\tdelete(s.subs, se)\n\t\t\ts.Logger.Println(\"deleted old subscription for\", se.db, se.rp)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8f7fcd67b25cd83cf401592559a3c18f", "score": "0.45593235", "text": "func (f *FakeStore) Stat(keys []string) []apiintf.ObjectStat {\n\tf.Stats++\n\treturn nil\n}", "title": "" }, { "docid": "a915e5eea23125e21281fa714973b569", "score": "0.45537204", "text": "func Update(ctx context.Context, usr *DAO, db *sql.DB) error {\n\tdlock.Lock().Lock()\n\tdefer dlock.Lock().Unlock()\n\n\ttx, err := db.Begin()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = tx.ExecContext(ctx, `\n\tUPDATE users SET\n\t\tusername=?, display_name=?,\n\t\tcan_admin_accounts=?, can_admin_data=?, can_admin_integrations=?, is_robot_account=? WHERE rowid = ?;`,\n\t\tusr.Username, usr.DisplayName, usr.AdminPerms.Accounts, usr.AdminPerms.Data, usr.AdminPerms.Integrations, usr.IsRobot, usr.UID)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn err\n\t}\n\treturn tx.Commit()\n}", "title": "" }, { "docid": "e71fa9827d8462ab8aeba2e276353f11", "score": "0.45497826", "text": "func (s *Server) Stats(w http.ResponseWriter, r *http.Request) {\n\tif r.Method != \"GET\" {\n\t\thttp.Error(w, \"405 Method Not Allowed\", http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\n\tstats := s.db.GetStats()\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(stats)\n}", "title": "" }, { "docid": "2e210cdaf5dbd2bc70a5acf9dae49c8b", "score": "0.45472446", "text": "func (s *Service) UpArcStat(c context.Context, mid int64) (data *model.UpArcStat, err error) {\n\taddCache := true\n\tif data, err = s.dao.UpArcCache(c, mid); err != nil {\n\t\taddCache = false\n\t} else if data != nil {\n\t\treturn\n\t}\n\tdt := time.Now().AddDate(0, 0, -1).Add(-12 * time.Hour).Format(\"20060102\")\n\tif data, err = s.dao.UpArcStat(c, mid, dt); data != nil && addCache {\n\t\ts.cache.Do(c, func(c context.Context) {\n\t\t\ts.dao.SetUpArcCache(c, mid, data)\n\t\t})\n\t}\n\treturn\n}", "title": "" }, { "docid": "80de38ce9a6f56fc2669619b86d9026a", "score": "0.45471203", "text": "func (dao AccountingDocumentDAOPsql) Update(obj *models.AccountingDocument) error {\n\tquery := \"UPDATE accounting_documents SET abbreviation = upper($2), document_name = upper($3), updated_at = now() WHERE id = $1 RETURNING id, abbreviation, document_name, consecutive, created_at, updated_at\"\n\tdb := get()\n\tdefer db.Close()\n\n\tstmt, err := db.Prepare(query)\n\tif err != nil {\n\t\treturn nil\n\t}\n\tdefer stmt.Close()\n\n\trow := stmt.QueryRow(obj.ID, obj.Abbreviation, obj.DocumentName)\n\treturn dao.rowToObject(row, obj)\n}", "title": "" }, { "docid": "973425670b0872bb4c5aed2f76f04e8b", "score": "0.4534638", "text": "func dooidupdate(opts *cmdoptions, dbcon *sql.DB, oidinfo *util.CApolicyinfo) error {\n\tif dbcon == nil { // no database\n\t\treturn nil\n\t}\n\terr := util.InsertOIDs(dbcon, oidinfo, opts.verbose)\n\treturn err\n}", "title": "" }, { "docid": "461198b792b4d03ba6feb0014b99eb14", "score": "0.45343018", "text": "func (o *JudgementsSummary) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tkey := makeCacheKey(columns, nil)\n\tjudgementsSummaryUpdateCacheMut.RLock()\n\tcache, cached := judgementsSummaryUpdateCache[key]\n\tjudgementsSummaryUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tjudgementsSummaryAllColumns,\n\t\t\tjudgementsSummaryPrimaryKeyColumns,\n\t\t)\n\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update JudgementsSummaries, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"JudgementsSummaries\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, judgementsSummaryPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(judgementsSummaryType, judgementsSummaryMapping, append(wl, judgementsSummaryPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update JudgementsSummaries row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for JudgementsSummaries\")\n\t}\n\n\tif !cached {\n\t\tjudgementsSummaryUpdateCacheMut.Lock()\n\t\tjudgementsSummaryUpdateCache[key] = cache\n\t\tjudgementsSummaryUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, nil\n}", "title": "" }, { "docid": "24ee67bfffe9c147450b12b09d8373f6", "score": "0.4532413", "text": "func (r *InMemoryStatsCollector) UpdateGauge(name string, tags map[string]string, value int64) {}", "title": "" }, { "docid": "519f662963c7f5370317cddb91cd759a", "score": "0.45320436", "text": "func (o *RegistryRecommendation) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tregistryRecommendationUpdateCacheMut.RLock()\n\tcache, cached := registryRecommendationUpdateCache[key]\n\tregistryRecommendationUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tregistryRecommendationColumns,\n\t\t\tregistryRecommendationPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update registry_recommendations, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `registry_recommendations` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, registryRecommendationPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(registryRecommendationType, registryRecommendationMapping, append(wl, registryRecommendationPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update registry_recommendations row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for registry_recommendations\")\n\t}\n\n\tif !cached {\n\t\tregistryRecommendationUpdateCacheMut.Lock()\n\t\tregistryRecommendationUpdateCache[key] = cache\n\t\tregistryRecommendationUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "title": "" }, { "docid": "83264d57464eec9280c4fa7dd9bf6870", "score": "0.4518489", "text": "func (c *FaaSController) InstanceUpdateStats(nodeName string, port int, qlen int, kpps int, cycle int) error {\n\tw, exists := c.workers[nodeName]\n\tif !exists {\n\t\treturn fmt.Errorf(\"Worker[%s] does not exist\", nodeName)\n\t}\n\n\tins := w.insStartupPool.get(port)\n\tif ins == nil || ins.sg == nil {\n\t\treturn fmt.Errorf(\"SGroup not found\")\n\t}\n\n\tins.UpdateTrafficInfo(qlen, kpps, cycle)\n\tins.sg.UpdateTrafficInfo()\n\treturn nil\n}", "title": "" }, { "docid": "ff2cf3604eb35adcb65b4b43ec2a6de3", "score": "0.45155233", "text": "func (self *Moped) cmdStats(c *cmd) *reply {\n\treturn NewReply(c, map[string]interface{}{\n\t\t`artists`: 1,\n\t\t`albums`: 1,\n\t\t`songs`: 1,\n\t\t`uptime`: int(time.Since(self.startedAt).Seconds()),\n\t\t`db_playtime`: 0,\n\t\t`db_update`: time.Now().Unix(),\n\t\t`playtime`: 0,\n\t})\n}", "title": "" }, { "docid": "5e0906fb0d4515170aff1262f2a7a63c", "score": "0.45054522", "text": "func (c *GatewayCollector) Update(ch chan<- prometheus.Metric) error {\n\tnow := time.Now()\n\ttimeSince := now.Sub(c.lastUpdate)\n\tif timeSince.Seconds() < 3600.0 && timeSince.Seconds() > 0.0 {\n\t\tc.sampleInterval = timeSince.Seconds()\n\t}\n\tc.lastUpdate = now\n\treturn nil\n}", "title": "" }, { "docid": "30f9f6eeae82dc64b523e1bf07546939", "score": "0.45036906", "text": "func (sh *SweetHome) Update(player *Player) {\n\tplayer.ScoreCake = player.ScoreCake + sh.BonusCake\n\tplayer.ScoreGold = player.ScoreGold + sh.BonusGold\n\tplayer.ScoreCandy = player.ScoreCandy + sh.BonusCandy\n\tplayer.Health = sh.BonusHealth //maximum allowed value = Health of Player at start\n}", "title": "" }, { "docid": "e2b8d5be963898155d8193984626bc40", "score": "0.45011276", "text": "func (db *DB) UpdateRedditKarmaInfo(u *types.User) (*types.User, error) {\n\ttx, err := db.client.Begin()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// create SQL statement for db update\n\tsqlStatement := `\n\t\tUPDATE\n\t\t\tcoindrop_reddit\n\t\tSET\n\t\t\tcomment_karma = $1,\n\t\t\tlink_karma = $2\n\t\tWHERE\n\t\t\tuser_id = $3\n\t`\n\n\t// prepare statement\n\tstmt, err := db.client.Prepare(sqlStatement)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer stmt.Close()\n\n\t// execute db write using unique ID as the identifier\n\t_, err = stmt.Exec(\n\t\tu.Social.Reddit.CommentKarma,\n\t\tu.Social.Reddit.LinkKarma,\n\t\tu.UserID,\n\t)\n\tif err != nil {\n\t\t// rollback transaction if error thrown\n\t\treturn nil, tx.Rollback()\n\t}\n\n\t// commit db write\n\terr = tx.Commit()\n\tif err != nil {\n\t\t// rollback transaction if error thrown\n\t\treturn nil, tx.Rollback()\n\t}\n\n\treturn u, nil\n}", "title": "" }, { "docid": "b1b2ea05323b58db266a40a1115d1733", "score": "0.4495146", "text": "func (s *Service) UpdateStatistic(req types.UpdateStatisticRequest) error {\n\tvar (\n\t\tstatisticData types.StatisticData\n\t\tnewDailyData []types.StatisticDailyData\n\t\tnow time.Time\n\t\terr error\n\t)\n\n\ty, m, d := time.Now().Date()\n\tnow = time.Date(y, m, d, 0, 0, 0, 0, time.Local)\n\n\t// get old data\n\tstatisticData, err = s.resource.GetStatisticInfo(req.UniqueString)\n\tif err != nil && err != types.ErrNotFound {\n\t\treturn err\n\t}\n\n\t// update statistic data\n\tstatisticData.UniqueString = req.UniqueString\n\tstatisticData.Clicks++\n\n\t// update daily data\n\tdateUpdated := false\n\tfor _, v := range statisticData.DailyData {\n\t\t// update current date data\n\t\tif datetime.DateEqual(v.Date, now) {\n\t\t\tdateUpdated = true\n\t\t\tv.Clicks++\n\t\t}\n\n\t\t// only save last 30 days\n\t\tif now.Sub(v.Date) < (time.Hour * 24 * 30) {\n\t\t\tnewDailyData = append(newDailyData, v)\n\t\t}\n\t}\n\n\t// if no today data, create new\n\tif !dateUpdated {\n\t\tnewDailyData = append(newDailyData, types.StatisticDailyData{\n\t\t\tClicks: 1,\n\t\t\tDate: now,\n\t\t})\n\t}\n\n\t// replace with new daily data\n\tstatisticData.DailyData = newDailyData\n\n\t// save to DB\n\terr = s.resource.UpdateStatistic(statisticData)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn err\n}", "title": "" }, { "docid": "0b8fce6abc20d127d3044a44e4fcf283", "score": "0.44885027", "text": "func (gu *GrantUpdate) Exec(ctx context.Context) error {\n\t_, err := gu.Save(ctx)\n\treturn err\n}", "title": "" }, { "docid": "60524c463a1b361d75842b397ea2dfe1", "score": "0.44875008", "text": "func (rStats *RudderStatsT) Increment() {\n\tif !statsEnabled || rStats.dontProcess {\n\t\treturn\n\t}\n\tif rStats.StatType != CountType {\n\t\tpanic(fmt.Errorf(\"rStats.StatType:%s is not count\", rStats.StatType))\n\t}\n\trStats.Client.Increment(rStats.Name)\n}", "title": "" }, { "docid": "a1460e97eed47cd205d4af9ef5e1a8fe", "score": "0.44871074", "text": "func (m SpaceAccountModel) Update(orms ...orm.Ormer) (uint32, error) {\n\tvar o orm.Ormer\n\tif len(orms) != 1 {\n\t\to = orm.NewOrm()\n\t} else {\n\t\to = orms[0]\n\t}\n\t// Only update balance\n\tnewInfo := orm.Params{\"balance\": m.Balance}\n\t_, err := o.QueryTable(m.TableName()).\n\t\tFilter(\"namespace\", m.Namespace).Update(newInfo)\n\n\treturn sqlstatus.ParseErrorCode(err)\n}", "title": "" } ]
ece88946aa717ac5174b6fa38e86fb86
These might be useful in other packages as well
[ { "docid": "736930d2f7b3cb5119963b264608c89f", "score": "0.0", "text": "func protoToItems(pbItems []*pb.Item) []storage.Item {\n\tvar items = make([]storage.Item, len(pbItems))\n\n\tfor i := range pbItems {\n\t\titems[i] = object.FromProto(pbItems[i])\n\t\t// items[i] = pbItems[i]\n\t}\n\n\treturn items\n}", "title": "" } ]
[ { "docid": "f9bfa488bd57b056312eb5011da339bf", "score": "0.5289155", "text": "func Package() {}", "title": "" }, { "docid": "0c7c79817231297e94c2c065c6fa2f36", "score": "0.525277", "text": "func init() {\n\tif build.Default.ReleaseTags[len(build.Default.ReleaseTags)-1] <= \"go1.17\" {\n\t\tfor i := range importedObjectTests {\n\t\t\tif importedObjectTests[i].name == \"context.Context\" {\n\t\t\t\t// Expand any to interface{}.\n\t\t\t\timportedObjectTests[i].want = \"type Context interface{Deadline() (deadline time.Time, ok bool); Done() <-chan struct{}; Err() error; Value(key interface{}) interface{}}\"\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9a140b767c5f20d5313f7ed1d5084247", "score": "0.5202516", "text": "func getFns() map[string]*object.Builtin {\n\treturn map[string]*object.Builtin{\n\t\t// len(var:\"hello\")\n\t\t\"len\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ, object.ARRAY_OBJ},\n\t\t\tFn: lenFn,\n\t\t},\n\t\t// rand(max:20)\n\t\t\"rand\": &object.Builtin{\n\t\t\tTypes: []string{object.NUMBER_OBJ},\n\t\t\tFn: randFn,\n\t\t},\n\t\t// exit(code:0)\n\t\t\"exit\": &object.Builtin{\n\t\t\tTypes: []string{object.NUMBER_OBJ},\n\t\t\tFn: exitFn,\n\t\t},\n\t\t// flag(\"my-flag\")\n\t\t\"flag\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: flagFn,\n\t\t},\n\t\t// pwd()\n\t\t\"pwd\": &object.Builtin{\n\t\t\tTypes: []string{},\n\t\t\tFn: pwdFn,\n\t\t},\n\t\t// camel(\"string\")\n\t\t\"camel\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: camelFn,\n\t\t},\n\t\t// snake(\"string\")\n\t\t\"snake\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: snakeFn,\n\t\t},\n\t\t// kebab(\"string\")\n\t\t\"kebab\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: kebabFn,\n\t\t},\n\t\t// cd() or cd(path)\n\t\t\"cd\": &object.Builtin{\n\t\t\tTypes: []string{},\n\t\t\tFn: cdFn,\n\t\t},\n\t\t// clamp(num, min, max)\n\t\t\"clamp\": &object.Builtin{\n\t\t\tTypes: []string{object.NUMBER_OBJ},\n\t\t\tFn: clampFn,\n\t\t},\n\t\t// echo(arg:\"hello\")\n\t\t\"echo\": &object.Builtin{\n\t\t\tTypes: []string{},\n\t\t\tFn: echoFn,\n\t\t},\n\t\t// int(string:\"123\")\n\t\t// int(number:\"123\")\n\t\t\"int\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ, object.NUMBER_OBJ},\n\t\t\tFn: intFn,\n\t\t},\n\t\t// round(string:\"123.1\")\n\t\t// round(number:\"123.1\", 2)\n\t\t\"round\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ, object.NUMBER_OBJ},\n\t\t\tFn: roundFn,\n\t\t},\n\t\t// floor(string:\"123.1\")\n\t\t// floor(number:123.1)\n\t\t\"floor\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ, object.NUMBER_OBJ},\n\t\t\tFn: floorFn,\n\t\t},\n\t\t// ceil(string:\"123.1\")\n\t\t// ceil(number:123.1)\n\t\t\"ceil\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ, object.NUMBER_OBJ},\n\t\t\tFn: ceilFn,\n\t\t},\n\t\t// number(string:\"1.23456\")\n\t\t\"number\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ, object.NUMBER_OBJ},\n\t\t\tFn: numberFn,\n\t\t},\n\t\t// is_number(string:\"1.23456\")\n\t\t\"is_number\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ, object.NUMBER_OBJ},\n\t\t\tFn: isNumberFn,\n\t\t},\n\t\t// stdin()\n\t\t\"stdin\": &object.Builtin{\n\t\t\tNext: stdinNextFn,\n\t\t\tTypes: []string{},\n\t\t\tFn: stdinFn,\n\t\t},\n\t\t// env(variable:\"PWD\") or env(string:\"KEY\", string:\"VAL\")\n\t\t\"env\": &object.Builtin{\n\t\t\tTypes: []string{},\n\t\t\tFn: envFn,\n\t\t},\n\t\t// arg(position:1)\n\t\t\"arg\": &object.Builtin{\n\t\t\tTypes: []string{object.NUMBER_OBJ},\n\t\t\tFn: argFn,\n\t\t},\n\t\t// args()\n\t\t\"args\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: argsFn,\n\t\t},\n\t\t// type(variable:\"hello\")\n\t\t\"type\": &object.Builtin{\n\t\t\tTypes: []string{},\n\t\t\tFn: typeFn,\n\t\t},\n\t\t// fn.call(args_array)\n\t\t\"call\": &object.Builtin{\n\t\t\tTypes: []string{object.FUNCTION_OBJ, object.BUILTIN_OBJ},\n\t\t\tFn: callFn,\n\t\t},\n\t\t// chnk([...], int:2)\n\t\t\"chunk\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: chunkFn,\n\t\t},\n\t\t// split(string:\"hello\")\n\t\t\"split\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: splitFn,\n\t\t},\n\t\t// lines(string:\"a\\nb\")\n\t\t\"lines\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: linesFn,\n\t\t},\n\t\t// \"{}\".json()\n\t\t// Converts a valid JSON document to an ABS hash.\n\t\t\"json\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: jsonFn,\n\t\t},\n\t\t// \"a %s\".fmt(b)\n\t\t\"fmt\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: fmtFn,\n\t\t},\n\t\t// sum(array:[1, 2, 3])\n\t\t\"sum\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: sumFn,\n\t\t},\n\t\t// max(array:[1, 2, 3])\n\t\t\"max\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: maxFn,\n\t\t},\n\t\t// min(array:[1, 2, 3])\n\t\t\"min\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: minFn,\n\t\t},\n\t\t// reduce(array:[1, 2, 3], f(){}, accumulator)\n\t\t\"reduce\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: reduceFn,\n\t\t},\n\t\t// sort(array:[1, 2, 3])\n\t\t\"sort\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: sortFn,\n\t\t},\n\t\t// intersect(array:[1, 2, 3], array:[1, 2, 3])\n\t\t\"intersect\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: intersectFn,\n\t\t},\n\t\t// diff(array:[1, 2, 3], array:[1, 2, 3])\n\t\t\"diff\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: diffFn,\n\t\t},\n\t\t// union(array:[1, 2, 3], array:[1, 2, 3])\n\t\t\"union\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: unionFn,\n\t\t},\n\t\t// diff_symmetric(array:[1, 2, 3], array:[1, 2, 3])\n\t\t\"diff_symmetric\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: diffSymmetricFn,\n\t\t},\n\t\t// flatten(array:[1, 2, 3])\n\t\t\"flatten\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: flattenFn,\n\t\t},\n\t\t// flatten(array:[1, 2, 3])\n\t\t\"flatten_deep\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: flattenDeepFn,\n\t\t},\n\t\t// partition(array:[1, 2, 3])\n\t\t\"partition\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: partitionFn,\n\t\t},\n\t\t// map(array:[1, 2, 3], function:f(x) { x + 1 })\n\t\t\"map\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: mapFn,\n\t\t},\n\t\t// some(array:[1, 2, 3], function:f(x) { x == 2 })\n\t\t\"some\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: someFn,\n\t\t},\n\t\t// every(array:[1, 2, 3], function:f(x) { x == 2 })\n\t\t\"every\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: everyFn,\n\t\t},\n\t\t// find(array:[1, 2, 3], function:f(x) { x == 2 })\n\t\t\"find\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: findFn,\n\t\t},\n\t\t// filter(array:[1, 2, 3], function:f(x) { x == 2 })\n\t\t\"filter\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: filterFn,\n\t\t},\n\t\t// unique(array:[1, 2, 3])\n\t\t\"unique\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: uniqueFn,\n\t\t},\n\t\t// str(1)\n\t\t\"str\": &object.Builtin{\n\t\t\tTypes: []string{},\n\t\t\tFn: strFn,\n\t\t},\n\t\t// any(\"abc\", \"b\")\n\t\t\"any\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: anyFn,\n\t\t},\n\t\t// between(number, min, max)\n\t\t\"between\": &object.Builtin{\n\t\t\tTypes: []string{object.NUMBER_OBJ},\n\t\t\tFn: betweenFn,\n\t\t},\n\t\t// prefix(\"abc\", \"a\")\n\t\t\"prefix\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: prefixFn,\n\t\t},\n\t\t// suffix(\"abc\", \"a\")\n\t\t\"suffix\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: suffixFn,\n\t\t},\n\t\t// repeat(\"abc\", 3)\n\t\t\"repeat\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: repeatFn,\n\t\t},\n\t\t// replace(\"abc\", \"b\", \"f\", -1)\n\t\t\"replace\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: replaceFn,\n\t\t},\n\t\t// title(\"some thing\")\n\t\t\"title\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: titleFn,\n\t\t},\n\t\t// lower(\"ABC\")\n\t\t\"lower\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: lowerFn,\n\t\t},\n\t\t// upper(\"abc\")\n\t\t\"upper\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: upperFn,\n\t\t},\n\t\t// wait(`sleep 1 &`)\n\t\t\"wait\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: waitFn,\n\t\t},\n\t\t\"kill\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: killFn,\n\t\t},\n\t\t// trim(\"abc\")\n\t\t\"trim\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: trimFn,\n\t\t},\n\t\t// trim_by(\"abc\", \"c\")\n\t\t\"trim_by\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: trimByFn,\n\t\t},\n\t\t// index(\"abc\", \"c\")\n\t\t\"index\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: indexFn,\n\t\t},\n\t\t// last_index(\"abcc\", \"c\")\n\t\t\"last_index\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: lastIndexFn,\n\t\t},\n\t\t// shift([1,2,3])\n\t\t\"shift\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: shiftFn,\n\t\t},\n\t\t// reverse([1,2,3])\n\t\t\"reverse\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ, object.STRING_OBJ},\n\t\t\tFn: reverseFn,\n\t\t},\n\t\t// shuffle([1,2,3])\n\t\t\"shuffle\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: shuffleFn,\n\t\t},\n\t\t// push([1,2,3], 4)\n\t\t\"push\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: pushFn,\n\t\t},\n\t\t// pop([1,2,3], 4)\n\t\t\"pop\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ, object.HASH_OBJ},\n\t\t\tFn: popFn,\n\t\t},\n\t\t// keys([1,2,3]) returns array of indices\n\t\t// keys({\"a\": 1, \"b\": 2, \"c\": 3}) returns array of keys\n\t\t\"keys\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ, object.HASH_OBJ},\n\t\t\tFn: keysFn,\n\t\t},\n\t\t// values({\"a\": 1, \"b\": 2, \"c\": 3}) returns array of values\n\t\t\"values\": &object.Builtin{\n\t\t\tTypes: []string{object.HASH_OBJ},\n\t\t\tFn: valuesFn,\n\t\t},\n\t\t// items({\"a\": 1, \"b\": 2, \"c\": 3}) returns array of [key, value] tuples: [[a, 1], [b, 2] [c, 3]]\n\t\t\"items\": &object.Builtin{\n\t\t\tTypes: []string{object.HASH_OBJ},\n\t\t\tFn: itemsFn,\n\t\t},\n\t\t// join([1,2,3], \"-\")\n\t\t\"join\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: joinFn,\n\t\t},\n\t\t// sleep(3000)\n\t\t\"sleep\": &object.Builtin{\n\t\t\tTypes: []string{object.NUMBER_OBJ},\n\t\t\tFn: sleepFn,\n\t\t},\n\t\t// source(\"file.abs\") -- soure a file, with access to the global environment\n\t\t\"source\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: sourceFn,\n\t\t},\n\t\t// require(\"file.abs\") -- require a file without giving it access to the global environment\n\t\t\"require\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: requireFn,\n\t\t},\n\t\t// exec(command) -- execute command with interactive stdIO\n\t\t\"exec\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: execFn,\n\t\t},\n\t\t// eval(code) -- evaluates code in the context of the current ABS environment\n\t\t\"eval\": &object.Builtin{\n\t\t\tTypes: []string{object.STRING_OBJ},\n\t\t\tFn: evalFn,\n\t\t},\n\t\t// tsv([[1,2,3,4], [5,6,7,8]]) -- converts an array into a TSV string\n\t\t\"tsv\": &object.Builtin{\n\t\t\tTypes: []string{object.ARRAY_OBJ},\n\t\t\tFn: tsvFn,\n\t\t},\n\t\t// unix_ms() -- returns the current unix epoch, in milliseconds\n\t\t\"unix_ms\": &object.Builtin{\n\t\t\tTypes: []string{},\n\t\t\tFn: unixMsFn,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "e571a78b7c9a3c29e4d47f87b7fea6dd", "score": "0.5039861", "text": "func nodejsPackages(t *testing.T, deps codegen.StringSet) map[string]string {\n\tresult := make(map[string]string, len(deps))\n\tfor _, d := range deps.SortedValues() {\n\t\tpkgName := fmt.Sprintf(\"@pulumi/%s\", d)\n\t\tset := func(pkgVersion string) {\n\t\t\tresult[pkgName] = \"^\" + pkgVersion\n\t\t}\n\t\tswitch d {\n\t\tcase \"aws\":\n\t\t\tset(test.AwsSchema)\n\t\tcase \"azure-native\":\n\t\t\tset(test.AzureNativeSchema)\n\t\tcase \"azure\":\n\t\t\tset(test.AzureSchema)\n\t\tcase \"kubernetes\":\n\t\t\tset(test.KubernetesSchema)\n\t\tcase \"random\":\n\t\t\tset(test.RandomSchema)\n\t\tcase \"eks\":\n\t\t\tset(test.EksSchema)\n\t\tdefault:\n\t\t\tt.Logf(\"Unknown package requested: %s\", d)\n\t\t}\n\n\t}\n\treturn result\n}", "title": "" }, { "docid": "800dc3efc1a19bd7be39908f4fd2805d", "score": "0.50109243", "text": "func GetShortPackageAndFunctionName(function interface{}) string {\n\tstr := runtime.FuncForPC(reflect.ValueOf(function).Pointer()).Name()\n\tidx := strings.LastIndex(str, \"/\")\n\treturn str[idx+1:]\n\n}", "title": "" }, { "docid": "e82c93c0cea02e208516432150fe8c0e", "score": "0.49963287", "text": "func init() {\n\taddToBuiltinFns([]*BuiltinFn{\n\t\t{\"ns\", nsFn},\n\n\t\t{\"range\", rangeFn},\n\t\t{\"repeat\", repeat},\n\t\t{\"explode\", explode},\n\n\t\t{\"assoc\", assoc},\n\t\t{\"dissoc\", dissoc},\n\n\t\t{\"all\", all},\n\t\t{\"take\", take},\n\t\t{\"drop\", drop},\n\n\t\t{\"has-key\", hasKey},\n\t\t{\"has-value\", hasValue},\n\n\t\t{\"count\", count},\n\n\t\t{\"keys\", keys},\n\t})\n}", "title": "" }, { "docid": "0d57c47800ffb3479f9d2ac30def5701", "score": "0.49704146", "text": "func init() {\n\t_ = strconv.ParseUint\n\t_ = strconv.ParseInt\n\t_ = strings.Join\n\t_ = utils.Dump\n}", "title": "" }, { "docid": "a4dbd775da8ec73059935317ae2872bf", "score": "0.49149093", "text": "func _ /* ERROR missing function body */ [P any]()", "title": "" }, { "docid": "2034358de392c148289d9e3969a36af2", "score": "0.48979774", "text": "func typePackageAndName(typ types.Type) (pkgPath, typeName string) {\n\tif nt, ok := typ.(*types.Named); ok {\n\t\t// TODO: should be Pkg().Name() instead?\n\t\treturn nt.Obj().Pkg().Path(), nt.Obj().Name()\n\t}\n\treturn \"\", \"\"\n}", "title": "" }, { "docid": "a3857b74e664a4613e67753479116d5a", "score": "0.4872404", "text": "func GetShortPackageAndFunctionNameAndLine(function interface{}) string {\n\tstr := runtime.FuncForPC(reflect.ValueOf(function).Pointer()).Name()\n\tidx := strings.LastIndex(str, \"/\")\n\n\t_, _, line, _ := runtime.Caller(1)\n\n\tstr = str[idx+1:]\n\tstr += \".\" + string(line)\n\treturn str\n}", "title": "" }, { "docid": "029ab8924baec78fc6f8302fc8117829", "score": "0.48645282", "text": "func main() { \n\tfmt.Println(Mypackage.Mypackage(5)) \n}", "title": "" }, { "docid": "444b173d5dd08d5fc19e8674c8758b69", "score": "0.4835881", "text": "func trystringsPackage() {\n\tfmt.Println(\n\t\tstrings.Contains(\"test\", \"st\"),\n\t\tstrings.Count(\"test\", \"t\"),\n\t\tstrings.HasPrefix(\"test\", \"te\"),\n\t\tstrings.HasSuffix(\"test\", \"st\"),\n\t\tstrings.Index(\"asep\", \"e\"),\n\t\tstrings.Join([]string{\"a\", \"b\"}, \"-\"),\n\t\tstrings.Repeat(\"a\", 5),\n\t\tstrings.Replace(\"aaaa\", \"a\", \"b\", 2),\n\t\tstrings.Split(\"a-b-c-d-e\", \"-\"),\n\t\tstrings.ToLower(\"TEST\"),\n\t\tstrings.ToUpper(\"test\"),\n\t)\n\n\tarr1 := []byte(\"test\")\n\tstr1 := string([]byte{'t', 'e', 's', 't'})\n\tfmt.Println(\"the arr1 : \", arr1)\n\tfmt.Println(\"the str1 : \", str1)\n}", "title": "" }, { "docid": "da0b09956c53803fd31d254448b582b2", "score": "0.48141333", "text": "func main() {\n\t// basic.Iota2()\n\t// basic.PrintScan()\n\t// basic.ForExercieses()\n\t// basic.For3()\n\t// basic.Exercieses3()\n\t// basic.Exercieses4()\n\t// basic.Random()\n\t// container.Array()\n\t// container.ArraySort()\n\t// container.Slice3()\n\t// container.Slice4()\n\t// container.Map()\n\t// container.String()\n\t// container.Strconv()\n\t// function.Recursion()\n\t// function.Type()\n\t// function.Function2()\n\t// function.Closure()\n\t// pointer.Pointer()\n\t// pointer.Parray()\n\t// pointer.Pfunc()\n\t// structs.Extends()\n\t// structs.Type()\n\terror.Panic()\n}", "title": "" }, { "docid": "4badd686a166596ae0b863c955832dc6", "score": "0.4812058", "text": "func init() {\n\tinternal.Parse = Parse\n\tinternal.ParseFile = ParseFile\n}", "title": "" }, { "docid": "b8508cdcca5d44f52c494c13b1cce15d", "score": "0.47700027", "text": "func platformFlags(flags *pflag.FlagSet) {\n}", "title": "" }, { "docid": "28c10a98f711a23147826bafe00ddfc8", "score": "0.47636068", "text": "func ufs_initIDs(frame *rtda.Frame) {\n\t// todo\n}", "title": "" }, { "docid": "28c10a98f711a23147826bafe00ddfc8", "score": "0.47636068", "text": "func ufs_initIDs(frame *rtda.Frame) {\n\t// todo\n}", "title": "" }, { "docid": "0dfbba5520ec9dfecd3bbc7a80e7def0", "score": "0.47630745", "text": "func TestIssues_76(t *testing.T) {\n\t// TODO\n}", "title": "" }, { "docid": "1463d5284383523b451915c0be215a63", "score": "0.47469002", "text": "func init() {\n\tVECTY_REQUIRES_GO_1_14_PLUS = \"Vecty requires Go 1.14+\"\n}", "title": "" }, { "docid": "7d1ca41596b9c9cc71c7b1d8930dd12f", "score": "0.47382092", "text": "func TestSourceParameters(val Source, ptr *Source) { // want \"source identified\" \"source identified\"\n\n}", "title": "" }, { "docid": "2206bdae3aacc4bfc4ca045dcb57f2a1", "score": "0.47343293", "text": "func init() {\n\timports.Packages[\"github.com/cosmos72/gomacro/go/printer\"] = imports.Package{\n\t\tBinds: map[string]r.Value{\n\t\t\t\"Fprint\": r.ValueOf(Fprint),\n\t\t\t\"RawFormat\": r.ValueOf(RawFormat),\n\t\t\t\"SourcePos\": r.ValueOf(SourcePos),\n\t\t\t\"TabIndent\": r.ValueOf(TabIndent),\n\t\t\t\"UseSpaces\": r.ValueOf(UseSpaces),\n\t\t}, Types: map[string]r.Type{\n\t\t\t\"CommentedNode\": r.TypeOf((*CommentedNode)(nil)).Elem(),\n\t\t\t\"Config\": r.TypeOf((*Config)(nil)).Elem(),\n\t\t\t\"Mode\": r.TypeOf((*Mode)(nil)).Elem(),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "bf2af63da116c4968d357a3ca12c1a14", "score": "0.47163832", "text": "func GetFullPackageAndFunctionName(i interface{}) string {\n\treturn runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()\n}", "title": "" }, { "docid": "ce93af0630c70ebe279a866ac3e73ba7", "score": "0.47119787", "text": "func init() { //nolint:gochecknoinits // we do need an init for this\n\tshortVersion, longVersion, fullVersion = version.FromBuildInfoPath(\"fortio.org/fortio\")\n}", "title": "" }, { "docid": "c80c1ef461fddd42dcd19f1c3f3a877d", "score": "0.4710182", "text": "func (j *LinuxUtils) MyGoFunc() {\n}", "title": "" }, { "docid": "646aae9f95221f1269d87b23614c04c8", "score": "0.4704878", "text": "func fdInitIDs(frame *jvmstack.Frame) {\n\t// todo\n}", "title": "" }, { "docid": "1448ee6a1fba95a31b0bce835ebd0b40", "score": "0.46897906", "text": "func getNamesOfPackages(packages []*Package) []string {\n\tlist := []string{}\n\tfor _, pkg := range packages {\n\t\tlist = append(list, pkg.Name)\n\t}\n\treturn list\n}", "title": "" }, { "docid": "4259c2198db68cd9627189bf5eec840b", "score": "0.4688918", "text": "func someUsefulThings() {\n\t// Creates a random UUID\n\tf := uuid.New()\n\tuserlib.DebugMsg(\"UUID as string:%v\", f.String())\n\n\t// Example of writing over a byte of f\n\tf[0] = 10\n\tuserlib.DebugMsg(\"UUID as string:%v\", f.String())\n\n\t// takes a sequence of bytes and renders as hex\n\th := hex.EncodeToString([]byte(\"fubar\"))\n\tuserlib.DebugMsg(\"The hex: %v\", h)\n\n\t// Marshals data into a JSON representation\n\t// Will actually work with go structures as well\n\td, _ := json.Marshal(f)\n\tuserlib.DebugMsg(\"The json data: %v\", string(d))\n\tvar g uuid.UUID\n\tjson.Unmarshal(d, &g)\n\tuserlib.DebugMsg(\"Unmashaled data %v\", g.String())\n\n\t// This creates an error type\n\tuserlib.DebugMsg(\"Creation of error %v\", errors.New(strings.ToTitle(\"This is an error\")))\n\n\t// And a random RSA key. In this case, ignoring the error\n\t// return value\n\tvar key *userlib.PrivateKey\n\tkey, _ = userlib.GenerateRSAKey()\n\tuserlib.DebugMsg(\"Key is %v\", key)\n}", "title": "" }, { "docid": "ba5d028e203672df1e92b20bc5b31c99", "score": "0.468455", "text": "func isInternal(p *types.Package) (bool, error) {\n\tfor _, t := range p.Types {\n\t\tfor _, member := range t.Members {\n\t\t\tif member.Name == \"TypeMeta\" {\n\t\t\t\treturn !strings.Contains(member.Tags, \"json\"), nil\n\t\t\t}\n\t\t}\n\t}\n\treturn false, fmt.Errorf(\"unable to find TypeMeta for any types in package %s\", p.Path)\n}", "title": "" }, { "docid": "9635ad5724b2e830061e8059f4c88741", "score": "0.46775287", "text": "func GetFullPackageAndFunctionNameAndLine(function interface{}) string {\n\tstr := runtime.FuncForPC(reflect.ValueOf(function).Pointer()).Name()\n\n\t_, _, line, _ := runtime.Caller(1)\n\tstr += \".\" + string(line)\n\treturn str\n}", "title": "" }, { "docid": "72984cae394b816771d6221f03751452", "score": "0.46771392", "text": "func getVulnSqlFuncs() map[string][]string {\n\treturn map[string][]string{\n\t\t\"(*database/sql.DB)\": {\"Exec\", \"ExecContext\", \"Query\", \"QueryContext\", \"QueryRow\", \"QueryRowContext\"},\n\t}\n}", "title": "" }, { "docid": "6aa72e910c25df9c8a4106916442951e", "score": "0.467657", "text": "func init() {\n\tfuncMap[\"HelloWorldString\"] = testfuncs.HelloWorldString\n\tfuncMap[\"Java8TimeYear\"] = testfuncs.Java8TimeYear\n\tfuncMap[\"Java8LocalDate\"] = testfuncs.Java8LocalDate\n\tfuncMap[\"JavaException\"] = testfuncs.JavaException\n\tfuncMap[\"UserArray\"] = testfuncs.UserArray\n\tfuncMap[\"UserList\"] = testfuncs.UserList\n\tfuncMap[\"ByteArray\"] = testfuncs.ByteArray\n\tfuncMap[\"ShortArray\"] = testfuncs.ShortArray\n\tfuncMap[\"IntegerArray\"] = testfuncs.IntegerArray\n\tfuncMap[\"LongArray\"] = testfuncs.LongArray\n\tfuncMap[\"BooleanArray\"] = testfuncs.BooleanArray\n\tfuncMap[\"CharacterArray\"] = testfuncs.CharacterArray\n\tfuncMap[\"FloatArray\"] = testfuncs.FloatArray\n\tfuncMap[\"DoubleArray\"] = testfuncs.DoubleArray\n\tfuncMap[\"MultipleLevelA0Array\"] = testfuncs.MultipleLevelA0Array\n\n\tfuncMap[\"ObjectA0\"] = testfuncs.ObjectA0\n}", "title": "" }, { "docid": "766a769ebb14f929fc5c85bc480307ba", "score": "0.46759057", "text": "func FunctionForModule6GoDoc() {\n}", "title": "" }, { "docid": "766a769ebb14f929fc5c85bc480307ba", "score": "0.46759057", "text": "func FunctionForModule6GoDoc() {\n}", "title": "" }, { "docid": "766a769ebb14f929fc5c85bc480307ba", "score": "0.46759057", "text": "func FunctionForModule6GoDoc() {\n}", "title": "" }, { "docid": "4b1b04064812f4536bde9c0ce55a91fd", "score": "0.46744412", "text": "func someUsefulThings() {\n\t// Creates a random UUID\n\tf := uuid.New()\n\tuserlib.DebugMsg(\"UUID as string:%v\", f.String())\n\n\t// Example of writing over a byte of f\n\tf[0] = 10\n\tuserlib.DebugMsg(\"UUID as string:%v\", f.String())\n\n\t// takes a sequence of bytes and renders as hex\n\th := hex.EncodeToString([]byte(\"fubar\"))\n\tuserlib.DebugMsg(\"The hex: %v\", h)\n\n\t// Marshals data into a JSON representation\n\t// test\n\t// Will actually work with go structures as well\n\td, _ := json.Marshal(f)\n\tuserlib.DebugMsg(\"The json data: %v\", string(d))\n\tvar g uuid.UUID\n\tjson.Unmarshal(d, &g)\n\tuserlib.DebugMsg(\"Unmashaled data %v\", g.String())\n\n\t// This creates an error type\n\tuserlib.DebugMsg(\"Creation of error %v\", errors.New(strings.ToTitle(\"This is an error\")))\n\n\t// And a random RSA key. In this case, ignoring the error\n\t// return value\n\tvar key *userlib.PrivateKey\n\tkey, _ = userlib.GenerateRSAKey()\n\tuserlib.DebugMsg(\"Key is %v\", key)\n}", "title": "" }, { "docid": "468e3e009937b0543aac482f39fe87e1", "score": "0.46529347", "text": "func (*Value_Util) Descriptor() ([]byte, []int) {\n\treturn file_origin_proto_rawDescGZIP(), []int{0, 3}\n}", "title": "" }, { "docid": "c2cd485f04b7a4746f3ff9086cf317c1", "score": "0.4641999", "text": "func allPackages(pattern string) []string {\n\tpkgs := matchPackages(pattern)\n\tif len(pkgs) == 0 {\n\t\tfmt.Fprintf(os.Stderr, \"warning: %q matched no packages\\n\", pattern)\n\t}\n\treturn pkgs\n}", "title": "" }, { "docid": "003162c75be494d3a7afec51008b3a73", "score": "0.4641453", "text": "func buildStrImports(prgrm *CXProgram, pkg *CXPackage, ast *string) {\n\tif len(pkg.Imports) > 0 {\n\t\t*ast += \"\\tImports\\n\"\n\t}\n\n\tcount := 0\n\tfor _, impIdx := range pkg.Imports {\n\t\timpPkg, err := prgrm.GetPackageFromArray(impIdx)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\t*ast += fmt.Sprintf(\"\\t\\t%d.- Import: %s\\n\", count, impPkg.Name)\n\t\tcount++\n\t}\n}", "title": "" }, { "docid": "0c0a7d18a937633a75d82761688181ce", "score": "0.46379498", "text": "func initPGBuiltins() {\n\tfor k, v := range pgBuiltins {\n\t\tif _, exists := builtins[k]; exists {\n\t\t\tpanic(\"duplicate builtin: \" + k)\n\t\t}\n\t\tv.props.Category = categoryCompatibility\n\t\tbuiltins[k] = v\n\t}\n\n\t// Make non-array type i/o builtins.\n\tfor _, typ := range types.OidToType {\n\t\t// Skip most array types. We're doing them separately below.\n\t\tswitch typ.Oid() {\n\t\tcase oid.T_int2vector, oid.T_oidvector:\n\t\tdefault:\n\t\t\tif typ.Family() == types.ArrayFamily {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tbuiltinPrefix := PGIOBuiltinPrefix(typ)\n\t\tfor name, builtin := range makeTypeIOBuiltins(builtinPrefix, typ) {\n\t\t\tbuiltins[name] = builtin\n\t\t}\n\t}\n\t// Make array type i/o builtins.\n\tfor name, builtin := range makeTypeIOBuiltins(\"array_\", types.AnyArray) {\n\t\tbuiltins[name] = builtin\n\t}\n\tfor name, builtin := range makeTypeIOBuiltins(\"anyarray_\", types.AnyArray) {\n\t\tbuiltins[name] = builtin\n\t}\n\t// Make enum type i/o builtins.\n\tfor name, builtin := range makeTypeIOBuiltins(\"enum_\", types.AnyEnum) {\n\t\tbuiltins[name] = builtin\n\t}\n\n\t// Make crdb_internal.create_regfoo builtins.\n\tfor _, typ := range []*types.T{types.RegType, types.RegProc, types.RegProcedure, types.RegClass, types.RegNamespace} {\n\t\ttypName := typ.SQLStandardName()\n\t\tbuiltins[\"crdb_internal.create_\"+typName] = makeCreateRegDef(typ)\n\t}\n}", "title": "" }, { "docid": "a0b9a82684c1c400af3591765cedd4f9", "score": "0.46377116", "text": "func enumSchemaExt (db *sql.DB, schemaName string, schemaExtMap map[string]string) () {\r\n\t// Get list of extension for the schema by quering sys_package_version table\r\n\tqueryStr := fmt.Sprintf(\"select package_name, version from %s.sys_package_version where package_name like '/com.castsoftware%%' order by package_name\", schemaName)\r\n\t//fmt.Printf(\"Executing query: %s\\n\", queryStr)\r\n\textRows, err1 := db.Query(queryStr)\r\n\t\r\n\tif err1 != nil {\r\n\t\tfmt.Printf(\"Error occurred while enumerating schema packages\\n%s\\n\", err1)\r\n\t} else {\r\n\t\tfmt.Printf(\"Reading extensions installed on schema %s\\n\", schemaName)\r\n\t\tfor extRows.Next() {\r\n\t\t\tvar extID string\r\n\t\t\tvar extVer string\r\n\t\t\tpanicErr := extRows.Scan(&extID, &extVer)\r\n\t\t\tif panicErr != nil {panic(panicErr)}\r\n\t\t\t// Remove leading forward slash from extension name\r\n\t\t\textID = strings.Replace(extID,\"/com.castsoftware\", \"com.castsoftware\", -1)\r\n\t\t\tschemaExtMap[extID] = extVer\r\n\t\t\tfmt.Printf(\"%s=%s\\n\", extID, extVer)\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "51cb0562674b66ea876d79ca518ac3a7", "score": "0.46350035", "text": "func DlBootstrap() {\n\n}", "title": "" }, { "docid": "eb0f1f85fe9d9fc66d04120b504583ae", "score": "0.46325022", "text": "func init() {\n\timports.Packages[\"gioui.org/x/profiling\"] = imports.Package{\n\tName: \"profiling\",\n\tBinds: map[string]r.Value{\n\t\t\"NewRecorder\":\tr.ValueOf(profiling.NewRecorder),\n\t}, Types: map[string]r.Type{\n\t\t\"CSVTimingRecorder\":\tr.TypeOf((*profiling.CSVTimingRecorder)(nil)).Elem(),\n\t\t\"Timings\":\tr.TypeOf((*profiling.Timings)(nil)).Elem(),\n\t}, \n\t}\n}", "title": "" }, { "docid": "cef9d33ed64e1932cd96a2d32142e252", "score": "0.4620617", "text": "func TestPanic51916(t *testing.T) {\n\tconst input = `package main\n//line mah.go:600\n\nimport (\n\"foo.com/a.thing\"\n\"foo.com/surprise\"\n\"foo.com/v1\"\n\"foo.com/other/v2\"\n\"foo.com/other/v3\"\n\"foo.com/go-thing\"\n\"foo.com/go-wrong\"\n)\n\nvar _ = []interface{}{bar.X, v1.Y, a.A, v2.V2, other.V3, thing.Thing, gow.Wrong}`\n\n\tconst want = `package main\n\n//line mah.go:600\n\nimport (\n\t\"foo.com/a.thing\"\n\t\"foo.com/go-thing\"\n\tgow \"foo.com/go-wrong\"\n\tv2 \"foo.com/other/v2\"\n\t\"foo.com/other/v3\"\n\tbar \"foo.com/surprise\"\n\tv1 \"foo.com/v1\"\n)\n\nvar _ = []interface{}{bar.X, v1.Y, a.A, v2.V2, other.V3, thing.Thing, gow.Wrong}\n`\n\n\ttestConfig{\n\t\tmodule: packagestest.Module{\n\t\t\tName: \"foo.com\",\n\t\t\tFiles: fm{\n\t\t\t\t\"a.thing/a.go\": \"package a \\n const A = 1\",\n\t\t\t\t\"surprise/x.go\": \"package bar \\n const X = 1\",\n\t\t\t\t\"v1/x.go\": \"package v1 \\n const Y = 1\",\n\t\t\t\t\"other/v2/y.go\": \"package v2 \\n const V2 = 1\",\n\t\t\t\t\"other/v3/z.go\": \"package other \\n const V3 = 1\",\n\t\t\t\t\"go-thing/b.go\": \"package thing \\n const Thing = 1\",\n\t\t\t\t\"go-wrong/b.go\": \"package gow \\n const Wrong = 1\",\n\t\t\t\t\"test/t.go\": input,\n\t\t\t},\n\t\t},\n\t}.processTest(t, \"foo.com\", \"test/t.go\", nil, nil, want)\n}", "title": "" }, { "docid": "d558e22e3e04b47ae298680a6e09eb97", "score": "0.46152067", "text": "func someUsefulThings() {\r\n\t// Creates a random UUID\r\n\tf := uuid.New()\r\n\tuserlib.DebugMsg(\"UUID as string:%v\", f.String())\r\n\r\n\t// Example of writing over a byte of f\r\n\tf[0] = 10\r\n\tuserlib.DebugMsg(\"UUID as string:%v\", f.String())\r\n\r\n\t// takes a sequence of bytes and renders as hex\r\n\th := hex.EncodeToString([]byte(\"fubar\"))\r\n\tuserlib.DebugMsg(\"The hex: %v\", h)\r\n\r\n\t// Marshals data into a JSON representation\r\n\t// test\r\n\t// Will actually work with go structures as well\r\n\td, _ := json.Marshal(f)\r\n\tuserlib.DebugMsg(\"The json data: %v\", string(d))\r\n\tvar g uuid.UUID\r\n\tjson.Unmarshal(d, &g)\r\n\tuserlib.DebugMsg(\"Unmashaled data %v\", g.String())\r\n\r\n\t// This creates an error type\r\n\tuserlib.DebugMsg(\"Creation of error %v\", errors.New(strings.ToTitle(\"This is an error\")))\r\n\r\n\t// And a random RSA key. In this case, ignoring the error\r\n\t// return value\r\n\tvar key *userlib.PrivateKey\r\n\tkey, _ = userlib.GenerateRSAKey()\r\n\tuserlib.DebugMsg(\"Key is %v\", key)\r\n}", "title": "" }, { "docid": "d7f9825d30e00fbb32482d848d86cd08", "score": "0.46105486", "text": "func packageExample(repo string) (component string, example string) {\n\tswitch repo {\n\tdefault:\n\t\treturn \"package\", \"net/http: improve [...]\"\n\tcase \"website\":\n\t\treturn \"component\", \"_content/doc/go1.21: fix [...]\"\n\tcase \"vscode-go\":\n\t\treturn \"component\", \"src/goInstallTools: improve [...]\"\n\t}\n}", "title": "" }, { "docid": "a28e2f981c11860dbbb1674ee0ae9995", "score": "0.46093816", "text": "func writeImports(out *bytes.Buffer, imps importers.Set) {\n\tif impStr := imps.Format(); len(impStr) > 0 {\n\t\t_, _ = fmt.Fprintf(out, \"%s\\n\", impStr)\n\t}\n}", "title": "" }, { "docid": "38d0c7ac6726e71a154ad389ff676157", "score": "0.4608399", "text": "func common() []*descriptor.FileDescriptorProto {\n\tprotoDesc, err := desc.LoadMessageDescriptorForMessage(&descriptor.FileDescriptorProto{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tannoDesc, err := desc.LoadFieldDescriptorForExtension(annotations.E_Http)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\thttpDesc, err := desc.LoadMessageDescriptorForMessage(&annotations.Http{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tanyDesc, err := desc.LoadMessageDescriptorForMessage(&any.Any{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\temptyDesc, err := desc.LoadMessageDescriptorForMessage(&empty.Empty{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tstatusDesc, err := desc.LoadMessageDescriptorForMessage(&status.Status{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tclientDesc, err := desc.LoadFieldDescriptorForExtension(annotations.E_DefaultHost)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tresDesc, err := desc.LoadFieldDescriptorForExtension(annotations.E_Resource)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfieldBehavDesc, err := desc.LoadFieldDescriptorForExtension(annotations.E_FieldBehavior)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlroDesc, err := desc.LoadFieldDescriptorForExtension(longrunning.E_OperationInfo)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdurDesc, err := desc.LoadMessageDescriptorForMessage(&duration.Duration{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn []*descriptor.FileDescriptorProto{\n\t\tprotoDesc.GetFile().AsFileDescriptorProto(),\n\t\tannoDesc.GetFile().AsFileDescriptorProto(),\n\t\thttpDesc.GetFile().AsFileDescriptorProto(),\n\t\tanyDesc.GetFile().AsFileDescriptorProto(),\n\t\temptyDesc.GetFile().AsFileDescriptorProto(),\n\t\tstatusDesc.GetFile().AsFileDescriptorProto(),\n\t\tclientDesc.GetFile().AsFileDescriptorProto(),\n\t\tresDesc.GetFile().AsFileDescriptorProto(),\n\t\tfieldBehavDesc.GetFile().AsFileDescriptorProto(),\n\t\tlroDesc.GetFile().AsFileDescriptorProto(),\n\t\tdurDesc.GetFile().AsFileDescriptorProto(),\n\t}\n}", "title": "" }, { "docid": "165a8277d89699be845a33e88ef566ae", "score": "0.46045154", "text": "func libbeatAndPacketbeatCommonFieldsGo() error {\n\tif err := mage.GenerateFieldsYAML(); err != nil {\n\t\treturn err\n\t}\n\treturn mage.GenerateAllInOneFieldsGo()\n}", "title": "" }, { "docid": "2596e8be2910733269df912a90c01fa0", "score": "0.4602017", "text": "func CollectPythonIncompatibilities(interpreter *registry.ExecutableInterpreter) []string {\n return nil\n}", "title": "" }, { "docid": "5ced623302915034f7013b7eab9dbbe2", "score": "0.4600747", "text": "func someUsefulThings() {\r\n\t// Creates a random UUID\r\n\tf := uuid.New()\r\n\tuserlib.DebugMsg(\"UUID as string:%v\", f.String())\r\n\r\n\t// Example of writing over a byte of f\r\n\tf[0] = 10\r\n\tuserlib.DebugMsg(\"UUID as string:%v\", f.String())\r\n\r\n\t// takes a sequence of bytes and renders as hex\r\n\th := hex.EncodeToString([]byte(\"fubar\"))\r\n\tuserlib.DebugMsg(\"The hex: %v\", h)\r\n\r\n\t// Marshals data into a JSON representation\r\n\t// Will actually work with go structures as well\r\n\td, _ := json.Marshal(f)\r\n\tuserlib.DebugMsg(\"The json data: %v\", string(d))\r\n\tvar g uuid.UUID\r\n\tjson.Unmarshal(d, &g)\r\n\tuserlib.DebugMsg(\"Unmashaled data %v\", g.String())\r\n\r\n\t// This creates an error type\r\n\tuserlib.DebugMsg(\"Creation of error %v\", errors.New(strings.ToTitle(\"This is an error\")))\r\n\r\n\t// And a random RSA key. In this case, ignoring the error\r\n\t// return value\r\n\tvar pk userlib.PKEEncKey\r\n\tvar sk userlib.PKEDecKey\r\n\tpk, sk, _ = userlib.PKEKeyGen()\r\n\tuserlib.DebugMsg(\"Key is %v, %v\", pk, sk)\r\n}", "title": "" }, { "docid": "798818d2af4acb254a75e9266669210b", "score": "0.4595331", "text": "func init() {\n\tCodecHandle = new(codec.MsgpackHandle)\n\tCodecHandle.ErrorIfNoField = true\n\tCodecHandle.ErrorIfNoArrayExpand = true\n\tCodecHandle.Canonical = true\n\tCodecHandle.RecursiveEmptyCheck = true\n\tCodecHandle.WriteExt = true\n\tCodecHandle.PositiveIntUnsigned = true\n\n\tLenientCodecHandle = new(codec.MsgpackHandle)\n\t// allow unknown fields to ensure forward compatibility.\n\tLenientCodecHandle.ErrorIfNoField = false\n\tLenientCodecHandle.ErrorIfNoArrayExpand = true\n\tLenientCodecHandle.Canonical = true\n\tLenientCodecHandle.RecursiveEmptyCheck = true\n\tLenientCodecHandle.WriteExt = true\n\tLenientCodecHandle.PositiveIntUnsigned = true\n}", "title": "" }, { "docid": "a34fca963f52498e102869896649fe7e", "score": "0.4592908", "text": "func init() { Go_version_1_5_required_for_compilation() }", "title": "" }, { "docid": "5f3bd11f6cb41b326a69d25dff51b031", "score": "0.4588575", "text": "func globalNames(pkg *ast.Package) map[string]bool {\n\tnames := make(map[string]bool)\n\tfor _, file := range pkg.Files {\n\t\tfor _, decl := range file.Decls {\n\t\t\taddNames(names, decl)\n\t\t}\n\t}\n\treturn names\n}", "title": "" }, { "docid": "5f3bd11f6cb41b326a69d25dff51b031", "score": "0.4588575", "text": "func globalNames(pkg *ast.Package) map[string]bool {\n\tnames := make(map[string]bool)\n\tfor _, file := range pkg.Files {\n\t\tfor _, decl := range file.Decls {\n\t\t\taddNames(names, decl)\n\t\t}\n\t}\n\treturn names\n}", "title": "" }, { "docid": "cf01518c45f98b5b0ae86390ee90e552", "score": "0.45882308", "text": "func getLinks(pdoc *Package) []*utils.Link {\n\tlinks := make([]*utils.Link, 0, len(pdoc.Types)+len(pdoc.Imports)+len(pdoc.Funcs)+10)\n\t// Get all types, functions and import packages\n\tfor _, t := range pdoc.Types {\n\t\tlinks = append(links, &utils.Link{\n\t\t\tName: t.Name,\n\t\t\tComment: template.HTMLEscapeString(t.Doc),\n\t\t})\n\t}\n\n\tfor _, f := range pdoc.Funcs {\n\t\tlinks = append(links, &utils.Link{\n\t\t\tName: f.Name,\n\t\t\tComment: template.HTMLEscapeString(f.Doc),\n\t\t})\n\t}\n\n\tfor _, t := range pdoc.Types {\n\t\tfor _, f := range t.Funcs {\n\t\t\tlinks = append(links, &utils.Link{\n\t\t\t\tName: f.Name,\n\t\t\t\tComment: template.HTMLEscapeString(f.Doc),\n\t\t\t})\n\t\t}\n\t}\n\n\tfor _, v := range pdoc.Imports {\n\t\tif v != \"C\" {\n\t\t\tlinks = append(links, &utils.Link{\n\t\t\t\tName: path.Base(v) + \".\",\n\t\t\t\tPath: v,\n\t\t\t})\n\t\t}\n\t}\n\treturn links\n}", "title": "" }, { "docid": "00ff62add30c5350a0458c0ed2333866", "score": "0.45804358", "text": "func import_packages(pkg_names []string) []*packages.Package {\n\tif len(pkg_names) == 0 {\n\t\treturn []*packages.Package{}\n\t}\n\n\tcfg := &packages.Config{Mode: packages.NeedName |\n\t\tpackages.NeedSyntax | packages.NeedDeps |\n\t\tpackages.NeedImports | packages.NeedTypes |\n\t\tpackages.NeedTypesInfo | packages.NeedFiles}\n\n\tpkgs, err := packages.Load(cfg, pkg_names...)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"import_packages: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tif packages.PrintErrors(pkgs) > 0 {\n\t\tfmt.Println(\"import_packages error\")\n\t\tos.Exit(1)\n\t}\n\n\treturn pkgs\n}", "title": "" }, { "docid": "ed2886645cdcfb46d46eb7104f53ecf2", "score": "0.45786217", "text": "func getSeriouslyMisdesignedNsisPathArguments(prefix string, name string) []string {\n\ttokens := strings.Split(name, \" \")\n\ttokens[0] = fmt.Sprintf(\"%s%s\", prefix, tokens[0])\n\treturn tokens\n}", "title": "" }, { "docid": "758f05a25c894bbc08b6d9cc11914953", "score": "0.4575594", "text": "func staticcheckAnnotationApproved() {}", "title": "" }, { "docid": "dd0582307091eb516b4d2a53838983d7", "score": "0.45720044", "text": "func wellKnownNamespaceGroups() []relatedNamespaces {\n\treturn []relatedNamespaces{\n\t\t{\n\t\t\tname: \"kube-control-plane\",\n\t\t\tnamespaces: sets.NewString(\n\t\t\t\t\"openshift-cluster-version\",\n\t\t\t\t\"openshift-config-operator\",\n\t\t\t\t\"openshift-kube-apiserver-operator\", \"openshift-kube-apiserver\",\n\t\t\t\t\"openshift-etcd-operator\", \"openshift-etcd\",\n\t\t\t\t\"openshift-kube-controller-manager-operator\", \"openshift-kube-controller-manager\",\n\t\t\t\t\"openshift-kube-scheduler-operator\", \"openshift-kube-scheduler\",\n\t\t\t\t\"openshift-kube-storage-version-migrator-operator\", \"openshift-kube-storage-version-migrator\",\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"openshift-control-plane\",\n\t\t\tnamespaces: sets.NewString(\n\t\t\t\t\"openshift-apiserver-operator\", \"openshift-apiserver\",\n\t\t\t\t\"openshift-authentication-operator\", \"openshift-authentication\", \"openshift-oauth-apiserver\",\n\t\t\t\t\"openshift-controller-manager-operator\", \"openshift-controller-manager\",\n\t\t\t\t\"openshift-image-registry\",\n\t\t\t\t\"openshift-service-ca-operator\", \"openshift-service-ca\",\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"openshift-machines\",\n\t\t\tnamespaces: sets.NewString(\n\t\t\t\t\"openshift-cloud-controller-manager-operator\", \"openshift-cloud-controller-manager\",\n\t\t\t\t\"openshift-cloud-credential-operator\",\n\t\t\t\t\"openshift-cluster-machine-approver\",\n\t\t\t\t\"openshift-cluster-node-tuning-operator\",\n\t\t\t\t\"openshift-kni-infra\",\n\t\t\t\t\"openshift-machine-api\",\n\t\t\t\t\"openshift-machine-config-operator\",\n\t\t\t\t\"openshift-openstack-infra\",\n\t\t\t\t\"openshift-ovirt-infra\",\n\t\t\t\t\"openshift-vsphere-infra\",\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"openshift-networking\",\n\t\t\tnamespaces: sets.NewString(\n\t\t\t\t\"openshift-cloud-network-config-controller\",\n\t\t\t\t\"openshift-dns-operator\", \"openshift-dns\",\n\t\t\t\t\"openshift-host-network\",\n\t\t\t\t\"openshift-ingress\", \"openshift-ingress-canary\", \"openshift-ingress-operator\",\n\t\t\t\t\"openshift-network-operator\", \"openshift-multus\", \"openshift-network-diagnostics\", \"openshift-sdn\",\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"openshift-storage\",\n\t\t\tnamespaces: sets.NewString(\"openshift-cluster-storage-operator\", \"openshift-cluster-csi-drivers\"),\n\t\t},\n\t\t{\n\t\t\tname: \"openshift-support-stuff\",\n\t\t\tnamespaces: sets.NewString(\n\t\t\t\t\"openshift-console-operator\", \"openshift-console\",\n\t\t\t\t\"openshift-cluster-samples-operator\",\n\t\t\t\t\"openshift-insights\",\n\t\t\t\t\"openshift-marketplace\",\n\t\t\t\t\"openshift-operator-lifecycle-manager\",\n\t\t\t\t\"openshift-operators\",\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: \"openshift-monitoring\",\n\t\t\tnamespaces: sets.NewString(\n\t\t\t\t\"openshift-monitoring\",\n\t\t\t\t\"openshift-user-workload-monitoring\",\n\t\t\t),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "1dca339e1b353d8bda352f43ac4813df", "score": "0.45656386", "text": "func init() {}", "title": "" }, { "docid": "1dca339e1b353d8bda352f43ac4813df", "score": "0.45656386", "text": "func init() {}", "title": "" }, { "docid": "4255d943748ee0c0110b854272bc14bc", "score": "0.4559253", "text": "func fixImports(code string) (string, error) {\n\t// Debug flag out some information(ex: working directory)\n\t//imports.Debug = true\n\tfixed, err := imports.Process(\"\", []byte(code), &imports.Options{AllErrors: true})\n\treturn string(fixed), err\n}", "title": "" }, { "docid": "c6e94a335d91e1d39b058377964cd07c", "score": "0.45550618", "text": "func getPackageDepth() int {\n\t_, callerFile, _, ok := runtime.Caller(1)\n\tcallerPkg, _ := path.Split(callerFile)\n\tfor depth := 0; ok; depth++ {\n\t\tvar nextFile string\n\t\t_, nextFile, _, ok = runtime.Caller(1 + 1 + depth)\n\t\tnextPkg, _ := path.Split(nextFile)\n\t\tif callerPkg != nextPkg {\n\t\t\treturn depth\n\t\t}\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "f46db58e420ad63eb618e9427f20ab64", "score": "0.45514825", "text": "func findFuncs(path string, info os.FileInfo, err error) error {\n\t/* Ignore non-regular files */\n\tif !info.Mode().IsRegular() {\n\t\treturn nil\n\t}\n\n\t/* Try to open the file */\n\tf, err := elf.Open(path)\n\t/* Ignore format errors, these are generally scripts */\n\tif _, ok := err.(*elf.FormatError); ok {\n\t\treturn nil\n\t}\n\tif nil != err {\n\t\tlog.Printf(\"Unable to parse %q: %T\", path, err)\n\t\treturn nil\n\t}\n\tdefer f.Close()\n\n\t/* Get imported symbols */\n\tiss, err := f.ImportedSymbols()\n\tif nil != err {\n\t\tlog.Printf(\n\t\t\t\"Unable to get symbols imported by %q: %v\",\n\t\t\tpath,\n\t\t\terr,\n\t\t)\n\t}\n\n\t/* Work out how many symbols are imported from each library */\n\tlibs := make(map[string]int)\n\tfor _, is := range iss {\n\t\tif _, ok := libs[is.Library]; !ok {\n\t\t\tlibs[is.Library] = 0\n\t\t}\n\t\tlibs[is.Library]++\n\t}\n\n\t/* Struct to represent this file in the output */\n\to := File{Name: path}\n\n\t/* Find the lowest number of imports */\n\to.Count = 0\n\tmins := map[string]struct{}{}\n\tfor l, c := range libs {\n\t\t/* First iteration is the baseline */\n\t\tif 0 == o.Count {\n\t\t\to.Count = c\n\t\t\tmins[l] = struct{}{}\n\t\t\tcontinue\n\t\t}\n\t\tif c < o.Count {\n\t\t\t/* If we've found a library with fewer imports, clear\n\t\t\tthe list of smallest-import libraries, set this as the\n\t\t\tonly one */\n\t\t\to.Count = c\n\t\t\tmins = map[string]struct{}{l: struct{}{}}\n\t\t} else if c == o.Count {\n\t\t\t/* If we find a library with as few imports as the min,\n\t\t\tnote it as well. */\n\t\t\tmins[l] = struct{}{}\n\t\t}\n\t}\n\n\t/* Sort the list of low-import libraries */\n\tfor n := range mins {\n\t\to.Libs = append(o.Libs, n)\n\t}\n\tsort.Strings(o.Libs)\n\n\tFILES = append(FILES, o)\n\n\treturn nil\n}", "title": "" }, { "docid": "fc317c0c530e1e9ddbd580fb483f2ff2", "score": "0.45464638", "text": "func stripPCLinesAndNames(am *goobj2.ArchiveMember) {\n\tlists := [][]*goobj2.Sym{am.SymDefs, am.NonPkgSymDefs, am.NonPkgSymRefs}\n\tfor _, list := range lists {\n\t\tfor _, s := range list {\n\t\t\t// remove filename symbols when -tiny is passed as they\n\t\t\t// are only used for printing panics, and -tiny removes\n\t\t\t// panic printing; we need to set the symbol names to\n\t\t\t// 'gofile..', otherwise the linker will expect to see\n\t\t\t// filename symbols and panic\n\t\t\tif strings.HasPrefix(s.Name, \"gofile..\") {\n\t\t\t\ts.Name = \"gofile..\"\n\t\t\t}\n\n\t\t\tif s.Func == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor _, inl := range s.Func.InlTree {\n\t\t\t\tinl.Line = 1\n\t\t\t}\n\n\t\t\ts.Func.PCFile = nil\n\t\t\ts.Func.PCLine = nil\n\t\t\ts.Func.PCInline = nil\n\n\t\t\t// remove unneeded debug aux symbols\n\t\t\ts.Func.DwarfInfo = nil\n\t\t\ts.Func.DwarfLoc = nil\n\t\t\ts.Func.DwarfRanges = nil\n\t\t\ts.Func.DwarfDebugLines = nil\n\n\t\t}\n\t}\n\n\t// remove dwarf file list, it isn't needed as we pass \"-w, -s\" to the linker\n\tam.DWARFFileList = nil\n}", "title": "" }, { "docid": "ba0298d71b1e90accfdb9e76457fda5c", "score": "0.45460528", "text": "func getFormattedParam(prgrm *CXProgram, paramTypeSigIdxs []CXTypeSignatureIndex, pkg *CXPackage, buf *bytes.Buffer) {\n\tfor i, paramTypeSigIdx := range paramTypeSigIdxs {\n\t\tparamTypeSig := prgrm.GetCXTypeSignatureFromArray(paramTypeSigIdx)\n\n\t\t// Checking if this argument comes from an imported package.\n\t\texternalPkg := false\n\t\tif CXPackageIndex(pkg.Index) != paramTypeSig.Package {\n\t\t\texternalPkg = true\n\t\t}\n\n\t\tif paramTypeSig.Type == TYPE_CXARGUMENT_DEPRECATE {\n\t\t\tparam := prgrm.GetCXArgFromArray(CXArgumentIndex(paramTypeSig.Meta))\n\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%s %s\", GetFormattedName(prgrm, param, externalPkg, pkg), GetFormattedType(prgrm, paramTypeSig)))\n\t\t} else {\n\t\t\tname := paramTypeSig.Name\n\n\t\t\t// If it's a literal, just override the name with LITERAL_PLACEHOLDER.\n\t\t\tif paramTypeSig.Name == \"\" {\n\t\t\t\tname = constants.LITERAL_PLACEHOLDER\n\t\t\t}\n\n\t\t\t// TODO: Check if external pkg and pkg name shown are correct\n\t\t\tif externalPkg {\n\t\t\t\tname = fmt.Sprintf(\"%s.%s\", pkg.Name, name)\n\t\t\t}\n\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%s %s\", name, GetFormattedType(prgrm, paramTypeSig)))\n\t\t}\n\n\t\tif i != len(paramTypeSigIdxs)-1 {\n\t\t\tbuf.WriteString(\", \")\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "e89ef345be9043bbf85282c76a4bffbc", "score": "0.45409486", "text": "func garbleSymbols(am *goobj2.ArchiveMember, privImports privateImports, buf *bytes.Buffer, sb *strings.Builder) {\n\tlists := [][]*goobj2.Sym{am.SymDefs, am.NonPkgSymDefs, am.NonPkgSymRefs}\n\tfor _, list := range lists {\n\t\tfor _, s := range list {\n\t\t\t// skip debug symbols, and remove the debug symbol's data to save space\n\t\t\tif s.Kind >= goobj2.SDWARFINFO && s.Kind <= goobj2.SDWARFLINES {\n\t\t\t\ts.Size = 0\n\t\t\t\ts.Data = nil\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Skip local asm symbols. For some reason garbling these breaks things.\n\t\t\t// TODO: don't add duplicates\n\t\t\tif s.Kind == goobj2.SABIALIAS {\n\t\t\t\tif parts := strings.SplitN(s.Name, \".\", 2); parts[0] == \"main\" {\n\t\t\t\t\tskipPrefixes = append(skipPrefixes, s.Name)\n\t\t\t\t\tskipPrefixes = append(skipPrefixes, `\"\".`+parts[1])\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// garble read-only static data, but not strings. If import paths are in string\n\t\t\t// symbols, that means garbling string symbols might effect the behavior of the\n\t\t\t// compiled binary\n\t\t\tif s.Kind == goobj2.SRODATA && s.Data != nil && !strings.HasPrefix(s.Name, \"go.string.\") {\n\t\t\t\tvar dataTyp dataType\n\t\t\t\tif strings.HasPrefix(s.Name, \"type..importpath.\") {\n\t\t\t\t\tdataTyp = importPath\n\t\t\t\t} else if strings.HasPrefix(s.Name, \"type..namedata.\") {\n\t\t\t\t\tdataTyp = namedata\n\t\t\t\t}\n\t\t\t\ts.Data = garbleSymData(s.Data, privImports, dataTyp, buf)\n\n\t\t\t\tif s.Size != 0 {\n\t\t\t\t\ts.Size = uint32(len(s.Data))\n\t\t\t\t}\n\t\t\t}\n\t\t\ts.Name = garbleSymbolName(s.Name, privImports, sb)\n\n\t\t\tfor i := range s.Reloc {\n\t\t\t\ts.Reloc[i].Name = garbleSymbolName(s.Reloc[i].Name, privImports, sb)\n\t\t\t}\n\t\t\tif s.Type != nil {\n\t\t\t\ts.Type.Name = garbleSymbolName(s.Type.Name, privImports, sb)\n\t\t\t}\n\t\t\tif s.Func != nil {\n\t\t\t\tfor i := range s.Func.FuncData {\n\t\t\t\t\ts.Func.FuncData[i].Sym.Name = garbleSymbolName(s.Func.FuncData[i].Sym.Name, privImports, sb)\n\t\t\t\t}\n\t\t\t\tfor _, inl := range s.Func.InlTree {\n\t\t\t\t\tinl.Func.Name = garbleSymbolName(inl.Func.Name, privImports, sb)\n\t\t\t\t\tif opts.Tiny {\n\t\t\t\t\t\tinl.Line = 1\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif opts.Tiny {\n\t\t\t\t\ts.Func.PCFile = nil\n\t\t\t\t\ts.Func.PCLine = nil\n\t\t\t\t\ts.Func.PCInline = nil\n\t\t\t\t}\n\n\t\t\t\t// remove unneeded debug aux symbols\n\t\t\t\ts.Func.DwarfInfo = nil\n\t\t\t\ts.Func.DwarfLoc = nil\n\t\t\t\ts.Func.DwarfRanges = nil\n\t\t\t\ts.Func.DwarfDebugLines = nil\n\t\t\t}\n\t\t}\n\t}\n\tfor i := range am.SymRefs {\n\t\tam.SymRefs[i].Name = garbleSymbolName(am.SymRefs[i].Name, privImports, sb)\n\t}\n\n\t// remove dwarf file list, it isn't needed as we pass \"-w, -s\" to the linker\n\tam.DWARFFileList = nil\n}", "title": "" }, { "docid": "ff1b09b3dad3eabe080a8231756a7a70", "score": "0.45389068", "text": "func separateNotCompilingPackages(lintCtx *linter.Context) {\n\tgoodPkgs := make([]*packages.Package, 0, len(lintCtx.Packages))\n\tfor _, pkg := range lintCtx.Packages {\n\t\tif pkg.IllTyped {\n\t\t\tlintCtx.NotCompilingPackages = append(lintCtx.NotCompilingPackages, pkg)\n\t\t} else {\n\t\t\tgoodPkgs = append(goodPkgs, pkg)\n\t\t}\n\t}\n\n\tlintCtx.Packages = goodPkgs\n\tif len(lintCtx.NotCompilingPackages) != 0 {\n\t\tlintCtx.Log.Infof(\"Packages that do not compile: %+v\", lintCtx.NotCompilingPackages)\n\t}\n}", "title": "" }, { "docid": "43039a270fb76def364c9966059fc9f5", "score": "0.45384336", "text": "func init() {\n\t_ = pkger.Include(builtinPath)\n}", "title": "" }, { "docid": "31ba19b5351e92678eedb7edd8cf5a3a", "score": "0.4538258", "text": "func privateImportIndex(symName string, privImports privateImports, nameDataSym bool) (int, int, privateName) {\n\tmatchPkg := func(pkg string) int {\n\t\toff := strings.Index(symName, pkg)\n\t\tif off == -1 {\n\t\t\treturn -1\n\t\t\t// check that we didn't match inside an import path. If the\n\t\t\t// byte before the start of the match is not a small set of\n\t\t\t// symbols that can make up a symbol name, we must have matched\n\t\t\t// inside of an ident name as a substring. Or, if the byte\n\t\t\t// before the start of the match is a forward slash, we are\n\t\t\t// definitely inside of an input path.\n\t\t} else if off != 0 && (!isSymbol(symName[off-1]) || symName[off-1] == '/') {\n\t\t\treturn -1\n\t\t}\n\n\t\treturn off\n\t}\n\n\tvar privName privateName\n\tfirstOff, l := -1, 0\n\tfor _, privatePkg := range privImports.privatePaths {\n\t\toff := matchPkg(privatePkg)\n\t\tif off == -1 {\n\t\t\tcontinue\n\t\t} else if off < firstOff || firstOff == -1 {\n\t\t\t// preform the same check that matchPkg does above, but\n\t\t\t// on the byte after the end of the match so we are\n\t\t\t// completely sure we didn't match inside an import path\n\t\t\tl = len(privatePkg)\n\t\t\tif bAfter := off + l; bAfter < len(symName)-1 && symName[bAfter] != '.' && (!isSymbol(symName[bAfter]) || symName[bAfter] == '/') {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfirstOff = off\n\t\t}\n\t}\n\n\tif nameDataSym {\n\t\tfor _, pName := range privImports.privateNames {\n\t\t\t// search for the package name plus a period, to\n\t\t\t// minimize the likelihood that the package isn't\n\t\t\t// matched as a substring of another ident name.\n\t\t\t// ex: pkgName = main, symName = \"domainname\"\n\t\t\toff := matchPkg(pName.name + \".\")\n\t\t\tif off == -1 {\n\t\t\t\tcontinue\n\t\t\t} else if off < firstOff || firstOff == -1 {\n\t\t\t\tfirstOff = off\n\t\t\t\tl = len(pName.name)\n\t\t\t\tprivName = pName\n\t\t\t}\n\t\t}\n\t}\n\n\treturn firstOff, l, privName\n}", "title": "" }, { "docid": "4db51e9b097b7aaf9ff57f1be39cf976", "score": "0.4536143", "text": "func formatImports(usedPackages map[string]string) string {\n\tif len(usedPackages) == 0 {\n\t\treturn \"\"\n\t}\n\tif len(usedPackages) == 1 {\n\t\t// Special case: one-line import.\n\t\tfor path, id := range usedPackages {\n\t\t\tif id != \"\" {\n\t\t\t\treturn fmt.Sprintf(\"import %s %q\", id, path)\n\t\t\t}\n\t\t\treturn fmt.Sprintf(\"import %q\", path)\n\t\t}\n\t}\n\t// Typical case: multiple imports in factored declaration form.\n\t// Group into standard library imports then third-party imports.\n\tsortedStdlib := make([]string, 0, len(usedPackages))\n\tsortedThirdParty := make([]string, 0, len(usedPackages))\n\tfor path := range usedPackages {\n\t\tif strings.ContainsRune(path, '.') {\n\t\t\t// Third-party imports almost always contain a dot for a domain name,\n\t\t\t// especially in GOPATH/Go modules workspaces.\n\t\t\tsortedThirdParty = append(sortedThirdParty, path)\n\t\t} else {\n\t\t\tsortedStdlib = append(sortedStdlib, path)\n\t\t}\n\t}\n\tsort.Strings(sortedStdlib)\n\tsort.Strings(sortedThirdParty)\n\tsb := new(strings.Builder)\n\tsb.WriteString(\"import (\\n\")\n\tprintImports := func(paths []string) {\n\t\tfor _, path := range paths {\n\t\t\tid := usedPackages[path]\n\t\t\tif id == \"\" {\n\t\t\t\tfmt.Fprintf(sb, \"\\t%q\\n\", path)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(sb, \"\\t%s %q\\n\", id, path)\n\t\t\t}\n\t\t}\n\t}\n\tprintImports(sortedStdlib)\n\tif len(sortedStdlib) > 0 && len(sortedThirdParty) > 0 {\n\t\t// Insert blank line to separate.\n\t\tsb.WriteByte('\\n')\n\t}\n\tprintImports(sortedThirdParty)\n\tsb.WriteString(\")\")\n\treturn sb.String()\n}", "title": "" }, { "docid": "d18546e1efbce89ac16e39553db6f7e3", "score": "0.45321414", "text": "func (*OpenconfigSystem_System_Logging) IsYANGGoStruct() {}", "title": "" }, { "docid": "d46bccbd6d5fb058ae75de4f7754f76b", "score": "0.45317823", "text": "func main() {\n\t//todo\n}", "title": "" }, { "docid": "06382131108411d5390c8beaa48df2b0", "score": "0.4529994", "text": "func init() {\n\tp := types.NewPackage([]types.Type{\n\t\ttypes.MakeStructType(\"StructWithUnions\",\n\t\t\t[]types.Field{\n\t\t\t\ttypes.Field{\"a\", types.MakeType(ref.Ref{}, 1), false},\n\t\t\t\ttypes.Field{\"d\", types.MakeType(ref.Ref{}, 2), false},\n\t\t\t},\n\t\t\ttypes.Choices{},\n\t\t),\n\t\ttypes.MakeStructType(\"\",\n\t\t\t[]types.Field{},\n\t\t\ttypes.Choices{\n\t\t\t\ttypes.Field{\"b\", types.MakePrimitiveType(types.Float64Kind), false},\n\t\t\t\ttypes.Field{\"c\", types.MakePrimitiveType(types.StringKind), false},\n\t\t\t},\n\t\t),\n\t\ttypes.MakeStructType(\"\",\n\t\t\t[]types.Field{},\n\t\t\ttypes.Choices{\n\t\t\t\ttypes.Field{\"e\", types.MakePrimitiveType(types.Float64Kind), false},\n\t\t\t\ttypes.Field{\"f\", types.MakePrimitiveType(types.StringKind), false},\n\t\t\t},\n\t\t),\n\t}, []ref.Ref{})\n\t__genPackageInFile_struct_with_unions_CachedRef = types.RegisterPackage(&p)\n}", "title": "" }, { "docid": "c721ca4db976a0036436bd8f8532b8bb", "score": "0.4529435", "text": "func use(interface{})", "title": "" }, { "docid": "cd3b4a7417102b36dea0656473636344", "score": "0.45286164", "text": "func deriveGoStringMapsOfSimplerBuiltInTypes(this *MapsOfSimplerBuiltInTypes) string {\n\tbuf := bytes.NewBuffer(nil)\n\tfmt.Fprintf(buf, \"func() *test.MapsOfSimplerBuiltInTypes {\\n\")\n\tif this == nil {\n\t\tfmt.Fprintf(buf, \"return nil\\n\")\n\t} else {\n\t\tfmt.Fprintf(buf, \"this := &test.MapsOfSimplerBuiltInTypes{}\\n\")\n\t\tif this.StringToUint32 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.StringToUint32 = %#v\\n\", this.StringToUint32)\n\t\t}\n\t\tif this.Uint64ToInt64 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint64ToInt64 = %#v\\n\", this.Uint64ToInt64)\n\t\t}\n\t\tfmt.Fprintf(buf, \"return this\\n\")\n\t}\n\tfmt.Fprintf(buf, \"}()\\n\")\n\treturn buf.String()\n}", "title": "" }, { "docid": "7c5580ccd954ffd372f66ae8ff4736bc", "score": "0.45262024", "text": "func usesRequire(fun ast.Expr) bool {\n\tfunction, ok := fun.(*ast.SelectorExpr)\n\tif !ok {\n\t\treturn false\n\t}\n\tpkg, ok := function.X.(*ast.Ident)\n\tif !ok {\n\t\treturn false\n\t}\n\tif pkg.Name == \"assert\" || pkg.Name == \"require\" {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "baf7d06ae8c27a30ee96385a13519e5d", "score": "0.45229188", "text": "func init() {\n\tBuiltinDrivers[\"lxc\"] = NewLxcDriver\n}", "title": "" }, { "docid": "f86d788348b1af9f48dd5917103322a5", "score": "0.45210722", "text": "func isBadVersion(i int) bool{\n\t return true;\n }", "title": "" }, { "docid": "c1cb0187d318f9c89d4029f171999131", "score": "0.45209605", "text": "func deriveGoStringSliceOfBuiltInTypes(this *SliceOfBuiltInTypes) string {\n\tbuf := bytes.NewBuffer(nil)\n\tfmt.Fprintf(buf, \"func() *test.SliceOfBuiltInTypes {\\n\")\n\tif this == nil {\n\t\tfmt.Fprintf(buf, \"return nil\\n\")\n\t} else {\n\t\tfmt.Fprintf(buf, \"this := &test.SliceOfBuiltInTypes{}\\n\")\n\t\tif this.Bool != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Bool = %#v\\n\", this.Bool)\n\t\t}\n\t\tif this.Byte != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Byte = %#v\\n\", this.Byte)\n\t\t}\n\t\tif this.Complex128 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Complex128 = %#v\\n\", this.Complex128)\n\t\t}\n\t\tif this.Complex64 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Complex64 = %#v\\n\", this.Complex64)\n\t\t}\n\t\tif this.Float64 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Float64 = %#v\\n\", this.Float64)\n\t\t}\n\t\tif this.Float32 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Float32 = %#v\\n\", this.Float32)\n\t\t}\n\t\tif this.Int != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int = %#v\\n\", this.Int)\n\t\t}\n\t\tif this.Int16 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int16 = %#v\\n\", this.Int16)\n\t\t}\n\t\tif this.Int32 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int32 = %#v\\n\", this.Int32)\n\t\t}\n\t\tif this.Int64 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int64 = %#v\\n\", this.Int64)\n\t\t}\n\t\tif this.Int8 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int8 = %#v\\n\", this.Int8)\n\t\t}\n\t\tif this.Rune != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Rune = %#v\\n\", this.Rune)\n\t\t}\n\t\tif this.String != nil {\n\t\t\tfmt.Fprintf(buf, \"this.String = %#v\\n\", this.String)\n\t\t}\n\t\tif this.Uint != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint = %#v\\n\", this.Uint)\n\t\t}\n\t\tif this.Uint16 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint16 = %#v\\n\", this.Uint16)\n\t\t}\n\t\tif this.Uint32 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint32 = %#v\\n\", this.Uint32)\n\t\t}\n\t\tif this.Uint64 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint64 = %#v\\n\", this.Uint64)\n\t\t}\n\t\tif this.Uint8 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint8 = %#v\\n\", this.Uint8)\n\t\t}\n\t\tif this.UintPtr != nil {\n\t\t\tfmt.Fprintf(buf, \"this.UintPtr = %#v\\n\", this.UintPtr)\n\t\t}\n\t\tfmt.Fprintf(buf, \"return this\\n\")\n\t}\n\tfmt.Fprintf(buf, \"}()\\n\")\n\treturn buf.String()\n}", "title": "" }, { "docid": "7866ef4313edf2eca6836c9308acce72", "score": "0.45196056", "text": "func init() { Go_version_1_8_required_for_compilation() }", "title": "" }, { "docid": "aac5bb52749e2c357b19724f4e7ae94e", "score": "0.45170406", "text": "func init() {\n\timports.Packages[\"github.com/cosmos72/gomacro/base\"] = imports.Package{\n\t\tBinds: map[string]r.Value{\n\t\t\t\"CMacroExpand\": r.ValueOf(CMacroExpand),\n\t\t\t\"CMacroExpand1\": r.ValueOf(CMacroExpand1),\n\t\t\t\"CMacroExpandCodewalk\": r.ValueOf(CMacroExpandCodewalk),\n\t\t\t\"CmdOptForceEval\": r.ValueOf(CmdOptForceEval),\n\t\t\t\"CmdOptQuit\": r.ValueOf(CmdOptQuit),\n\t\t\t\"CollectNestedUnquotes\": r.ValueOf(CollectNestedUnquotes),\n\t\t\t\"DescendNestedUnquotes\": r.ValueOf(DescendNestedUnquotes),\n\t\t\t\"DuplicateNestedUnquotes\": r.ValueOf(DuplicateNestedUnquotes),\n\t\t\t\"False\": r.ValueOf(&False).Elem(),\n\t\t\t\"IsGensym\": r.ValueOf(IsGensym),\n\t\t\t\"IsGensymAnonymous\": r.ValueOf(IsGensymAnonymous),\n\t\t\t\"IsGensymInterface\": r.ValueOf(IsGensymInterface),\n\t\t\t\"IsGensymPrivate\": r.ValueOf(IsGensymPrivate),\n\t\t\t\"MakeBufReadline\": r.ValueOf(MakeBufReadline),\n\t\t\t\"MakeNestedQuote\": r.ValueOf(MakeNestedQuote),\n\t\t\t\"MakeQuote\": r.ValueOf(MakeQuote),\n\t\t\t\"MakeQuote2\": r.ValueOf(MakeQuote2),\n\t\t\t\"MakeTtyReadline\": r.ValueOf(MakeTtyReadline),\n\t\t\t\"MaxInt\": r.ValueOf(MaxInt),\n\t\t\t\"MaxUint\": r.ValueOf(MaxUint),\n\t\t\t\"MaxUint16\": r.ValueOf(MaxUint16),\n\t\t\t\"MinInt\": r.ValueOf(MinInt),\n\t\t\t\"NewGlobals\": r.ValueOf(NewGlobals),\n\t\t\t\"Nil\": r.ValueOf(&Nil).Elem(),\n\t\t\t\"None\": r.ValueOf(&None).Elem(),\n\t\t\t\"One\": r.ValueOf(&One).Elem(),\n\t\t\t\"OptCollectDeclarations\": r.ValueOf(OptCollectDeclarations),\n\t\t\t\"OptCollectStatements\": r.ValueOf(OptCollectStatements),\n\t\t\t\"OptCtrlCEnterDebugger\": r.ValueOf(OptCtrlCEnterDebugger),\n\t\t\t\"OptDebugCallStack\": r.ValueOf(OptDebugCallStack),\n\t\t\t\"OptDebugDebugger\": r.ValueOf(OptDebugDebugger),\n\t\t\t\"OptDebugField\": r.ValueOf(OptDebugField),\n\t\t\t\"OptDebugFromReflect\": r.ValueOf(OptDebugFromReflect),\n\t\t\t\"OptDebugGenerics\": r.ValueOf(OptDebugGenerics),\n\t\t\t\"OptDebugMacroExpand\": r.ValueOf(OptDebugMacroExpand),\n\t\t\t\"OptDebugMethod\": r.ValueOf(OptDebugMethod),\n\t\t\t\"OptDebugParse\": r.ValueOf(OptDebugParse),\n\t\t\t\"OptDebugQuasiquote\": r.ValueOf(OptDebugQuasiquote),\n\t\t\t\"OptDebugRecover\": r.ValueOf(OptDebugRecover),\n\t\t\t\"OptDebugSleepOnSwitch\": r.ValueOf(OptDebugSleepOnSwitch),\n\t\t\t\"OptDebugger\": r.ValueOf(OptDebugger),\n\t\t\t\"OptKeepUntyped\": r.ValueOf(OptKeepUntyped),\n\t\t\t\"OptMacroExpandOnly\": r.ValueOf(OptMacroExpandOnly),\n\t\t\t\"OptPanicStackTrace\": r.ValueOf(OptPanicStackTrace),\n\t\t\t\"OptShowCompile\": r.ValueOf(OptShowCompile),\n\t\t\t\"OptShowEval\": r.ValueOf(OptShowEval),\n\t\t\t\"OptShowEvalType\": r.ValueOf(OptShowEvalType),\n\t\t\t\"OptShowMacroExpand\": r.ValueOf(OptShowMacroExpand),\n\t\t\t\"OptShowParse\": r.ValueOf(OptShowParse),\n\t\t\t\"OptShowPrompt\": r.ValueOf(OptShowPrompt),\n\t\t\t\"OptShowTime\": r.ValueOf(OptShowTime),\n\t\t\t\"OptTrapPanic\": r.ValueOf(OptTrapPanic),\n\t\t\t\"ParseOptions\": r.ValueOf(ParseOptions),\n\t\t\t\"ReadBytes\": r.ValueOf(ReadBytes),\n\t\t\t\"ReadMultiline\": r.ValueOf(ReadMultiline),\n\t\t\t\"ReadOptCollectAllComments\": r.ValueOf(ReadOptCollectAllComments),\n\t\t\t\"ReadOptShowPrompt\": r.ValueOf(ReadOptShowPrompt),\n\t\t\t\"ReadString\": r.ValueOf(ReadString),\n\t\t\t\"SigAll\": r.ValueOf(SigAll),\n\t\t\t\"SigDebug\": r.ValueOf(SigDebug),\n\t\t\t\"SigDefer\": r.ValueOf(SigDefer),\n\t\t\t\"SigInterrupt\": r.ValueOf(SigInterrupt),\n\t\t\t\"SigNone\": r.ValueOf(SigNone),\n\t\t\t\"SigReturn\": r.ValueOf(SigReturn),\n\t\t\t\"SimplifyAstForQuote\": r.ValueOf(SimplifyAstForQuote),\n\t\t\t\"SimplifyNodeForQuote\": r.ValueOf(SimplifyNodeForQuote),\n\t\t\t\"StartSignalHandler\": r.ValueOf(StartSignalHandler),\n\t\t\t\"StopSignalHandler\": r.ValueOf(StopSignalHandler),\n\t\t\t\"StrGensym\": r.ValueOf(StrGensym),\n\t\t\t\"StrGensymAnonymous\": r.ValueOf(StrGensymAnonymous),\n\t\t\t\"StrGensymInterface\": r.ValueOf(StrGensymInterface),\n\t\t\t\"StrGensymPrivate\": r.ValueOf(StrGensymPrivate),\n\t\t\t\"True\": r.ValueOf(&True).Elem(),\n\t\t\t\"TypeOfBool\": r.ValueOf(&TypeOfBool).Elem(),\n\t\t\t\"TypeOfByte\": r.ValueOf(&TypeOfByte).Elem(),\n\t\t\t\"TypeOfComplex128\": r.ValueOf(&TypeOfComplex128).Elem(),\n\t\t\t\"TypeOfComplex64\": r.ValueOf(&TypeOfComplex64).Elem(),\n\t\t\t\"TypeOfDeferFunc\": r.ValueOf(&TypeOfDeferFunc).Elem(),\n\t\t\t\"TypeOfError\": r.ValueOf(&TypeOfError).Elem(),\n\t\t\t\"TypeOfFloat32\": r.ValueOf(&TypeOfFloat32).Elem(),\n\t\t\t\"TypeOfFloat64\": r.ValueOf(&TypeOfFloat64).Elem(),\n\t\t\t\"TypeOfInt\": r.ValueOf(&TypeOfInt).Elem(),\n\t\t\t\"TypeOfInt16\": r.ValueOf(&TypeOfInt16).Elem(),\n\t\t\t\"TypeOfInt32\": r.ValueOf(&TypeOfInt32).Elem(),\n\t\t\t\"TypeOfInt64\": r.ValueOf(&TypeOfInt64).Elem(),\n\t\t\t\"TypeOfInt8\": r.ValueOf(&TypeOfInt8).Elem(),\n\t\t\t\"TypeOfInterface\": r.ValueOf(&TypeOfInterface).Elem(),\n\t\t\t\"TypeOfPtrBool\": r.ValueOf(&TypeOfPtrBool).Elem(),\n\t\t\t\"TypeOfPtrComplex128\": r.ValueOf(&TypeOfPtrComplex128).Elem(),\n\t\t\t\"TypeOfPtrComplex64\": r.ValueOf(&TypeOfPtrComplex64).Elem(),\n\t\t\t\"TypeOfPtrFloat32\": r.ValueOf(&TypeOfPtrFloat32).Elem(),\n\t\t\t\"TypeOfPtrFloat64\": r.ValueOf(&TypeOfPtrFloat64).Elem(),\n\t\t\t\"TypeOfPtrInt\": r.ValueOf(&TypeOfPtrInt).Elem(),\n\t\t\t\"TypeOfPtrInt16\": r.ValueOf(&TypeOfPtrInt16).Elem(),\n\t\t\t\"TypeOfPtrInt32\": r.ValueOf(&TypeOfPtrInt32).Elem(),\n\t\t\t\"TypeOfPtrInt64\": r.ValueOf(&TypeOfPtrInt64).Elem(),\n\t\t\t\"TypeOfPtrInt8\": r.ValueOf(&TypeOfPtrInt8).Elem(),\n\t\t\t\"TypeOfPtrString\": r.ValueOf(&TypeOfPtrString).Elem(),\n\t\t\t\"TypeOfPtrUint\": r.ValueOf(&TypeOfPtrUint).Elem(),\n\t\t\t\"TypeOfPtrUint16\": r.ValueOf(&TypeOfPtrUint16).Elem(),\n\t\t\t\"TypeOfPtrUint32\": r.ValueOf(&TypeOfPtrUint32).Elem(),\n\t\t\t\"TypeOfPtrUint64\": r.ValueOf(&TypeOfPtrUint64).Elem(),\n\t\t\t\"TypeOfPtrUint8\": r.ValueOf(&TypeOfPtrUint8).Elem(),\n\t\t\t\"TypeOfPtrUintptr\": r.ValueOf(&TypeOfPtrUintptr).Elem(),\n\t\t\t\"TypeOfReflectType\": r.ValueOf(&TypeOfReflectType).Elem(),\n\t\t\t\"TypeOfRune\": r.ValueOf(&TypeOfRune).Elem(),\n\t\t\t\"TypeOfString\": r.ValueOf(&TypeOfString).Elem(),\n\t\t\t\"TypeOfUint\": r.ValueOf(&TypeOfUint).Elem(),\n\t\t\t\"TypeOfUint16\": r.ValueOf(&TypeOfUint16).Elem(),\n\t\t\t\"TypeOfUint32\": r.ValueOf(&TypeOfUint32).Elem(),\n\t\t\t\"TypeOfUint64\": r.ValueOf(&TypeOfUint64).Elem(),\n\t\t\t\"TypeOfUint8\": r.ValueOf(&TypeOfUint8).Elem(),\n\t\t\t\"TypeOfUintptr\": r.ValueOf(&TypeOfUintptr).Elem(),\n\t\t\t\"UnwrapTrivialAst\": r.ValueOf(UnwrapTrivialAst),\n\t\t\t\"UnwrapTrivialAstKeepBlocks\": r.ValueOf(UnwrapTrivialAstKeepBlocks),\n\t\t\t\"UnwrapTrivialNode\": r.ValueOf(UnwrapTrivialNode),\n\t\t\t\"ZeroStrings\": r.ValueOf(&ZeroStrings).Elem(),\n\t\t\t\"ZeroTypes\": r.ValueOf(&ZeroTypes).Elem(),\n\t\t\t\"ZeroValues\": r.ValueOf(&ZeroValues).Elem(),\n\t\t}, Types: map[string]r.Type{\n\t\t\t\"BufReadline\": r.TypeOf((*BufReadline)(nil)).Elem(),\n\t\t\t\"CmdOpt\": r.TypeOf((*CmdOpt)(nil)).Elem(),\n\t\t\t\"Globals\": r.TypeOf((*Globals)(nil)).Elem(),\n\t\t\t\"Inspector\": r.TypeOf((*Inspector)(nil)).Elem(),\n\t\t\t\"Options\": r.TypeOf((*Options)(nil)).Elem(),\n\t\t\t\"Output\": r.TypeOf((*Output)(nil)).Elem(),\n\t\t\t\"ReadOptions\": r.TypeOf((*ReadOptions)(nil)).Elem(),\n\t\t\t\"Readline\": r.TypeOf((*Readline)(nil)).Elem(),\n\t\t\t\"Signal\": r.TypeOf((*Signal)(nil)).Elem(),\n\t\t\t\"Signals\": r.TypeOf((*Signals)(nil)).Elem(),\n\t\t\t\"TtyReadline\": r.TypeOf((*TtyReadline)(nil)).Elem(),\n\t\t\t\"WhichMacroExpand\": r.TypeOf((*WhichMacroExpand)(nil)).Elem(),\n\t\t}, Proxies: map[string]r.Type{\n\t\t\t\"Inspector\": r.TypeOf((*P_github_com_cosmos72_gomacro_base_Inspector)(nil)).Elem(),\n\t\t\t\"Readline\": r.TypeOf((*P_github_com_cosmos72_gomacro_base_Readline)(nil)).Elem(),\n\t\t}, Untypeds: map[string]string{\n\t\t\t\"CmdOptForceEval\": \"int:2\",\n\t\t\t\"CmdOptQuit\": \"int:1\",\n\t\t}, Wrappers: map[string][]string{\n\t\t\t\"Globals\": []string{\"Copy\", \"Debugf\", \"Error\", \"ErrorAt\", \"Errorf\", \"Fprintf\", \"IncLine\", \"IncLineBytes\", \"MakeRuntimeError\", \"Position\", \"Sprintf\", \"ToString\", \"WarnExtraValues\", \"Warnf\"},\n\t\t\t\"Output\": []string{\"Copy\", \"ErrorAt\", \"Errorf\", \"Fprintf\", \"IncLine\", \"IncLineBytes\", \"MakeRuntimeError\", \"Position\", \"Sprintf\", \"ToString\"},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "d3ecd904fba3fd909721dca1b6c8b666", "score": "0.45148566", "text": "func getHelperMethodIfNeeded(functionName string, indent string) (string, bool) {\n\tswitch functionName {\n\tcase \"readFile\":\n\t\treturn `func readFileOrPanic(path string) pulumi.StringPtrInput {\n\t\t\t\tdata, err := os.ReadFile(path)\n\t\t\t\tif err != nil {\n\t\t\t\t\tpanic(err.Error())\n\t\t\t\t}\n\t\t\t\treturn pulumi.String(string(data))\n\t\t\t}`, true\n\tcase \"filebase64\":\n\t\treturn `func filebase64OrPanic(path string) pulumi.StringPtrInput {\n\t\t\t\t\tif fileData, err := os.ReadFile(path); err == nil {\n\t\t\t\t\t\treturn pulumi.String(base64.StdEncoding.EncodeToString(fileData[:]))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpanic(err.Error())\n\t\t\t\t\t}\n\t\t\t\t}`, true\n\tcase \"filebase64sha256\":\n\t\treturn `func filebase64sha256OrPanic(path string) pulumi.StringPtrInput {\n\t\t\t\t\tif fileData, err := os.ReadFile(path); err == nil {\n\t\t\t\t\t\thashedData := sha256.Sum256([]byte(fileData))\n\t\t\t\t\t\treturn pulumi.String(base64.StdEncoding.EncodeToString(hashedData[:]))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpanic(err.Error())\n\t\t\t\t\t}\n\t\t\t\t}`, true\n\tcase \"sha1\":\n\t\treturn `func sha1Hash(input string) string {\n\t\t\t\thash := sha1.Sum([]byte(input))\n\t\t\t\treturn hex.EncodeToString(hash[:])\n\t\t\t}`, true\n\tcase \"notImplemented\":\n\t\treturn fmt.Sprintf(`\n%sfunc notImplemented(message string) pulumi.AnyOutput {\n%s panic(message)\n%s}`, indent, indent, indent), true\n\tcase \"singleOrNone\":\n\t\treturn fmt.Sprintf(`%sfunc singleOrNone[T any](elements []T) T {\n%s\tif len(elements) != 1 {\n%s\t\tpanic(fmt.Errorf(\"singleOrNone expected input slice to have a single element\"))\n%s\t}\n%s\treturn elements[0]\n%s}`, indent, indent, indent, indent, indent, indent), true\n\tdefault:\n\t\treturn \"\", false\n\t}\n}", "title": "" }, { "docid": "ea8cc894f6ce22c1e3c8ea295a2ba095", "score": "0.45142743", "text": "func (w *Wrapper) importDirsUsed() []string {\n\tused := []string{}\n\tfor _, imp := range w.ImportDirs {\n\t\tfor _, proto := range w.ProtoFiles {\n\t\t\tif strings.HasPrefix(proto, imp) {\n\t\t\t\tused = append(used, imp)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn used\n}", "title": "" }, { "docid": "4aea4a88c83caf0948508213d14cba62", "score": "0.45131296", "text": "func deriveGoStringBuiltInTypes(this *BuiltInTypes) string {\n\tbuf := bytes.NewBuffer(nil)\n\tfmt.Fprintf(buf, \"func() *test.BuiltInTypes {\\n\")\n\tif this == nil {\n\t\tfmt.Fprintf(buf, \"return nil\\n\")\n\t} else {\n\t\tfmt.Fprintf(buf, \"this := &test.BuiltInTypes{}\\n\")\n\t\tfmt.Fprintf(buf, \"this.Bool = %#v\\n\", this.Bool)\n\t\tfmt.Fprintf(buf, \"this.Byte = %#v\\n\", this.Byte)\n\t\tfmt.Fprintf(buf, \"this.Complex128 = %#v\\n\", this.Complex128)\n\t\tfmt.Fprintf(buf, \"this.Complex64 = %#v\\n\", this.Complex64)\n\t\tfmt.Fprintf(buf, \"this.Float64 = %#v\\n\", this.Float64)\n\t\tfmt.Fprintf(buf, \"this.Float32 = %#v\\n\", this.Float32)\n\t\tfmt.Fprintf(buf, \"this.Int = %#v\\n\", this.Int)\n\t\tfmt.Fprintf(buf, \"this.Int16 = %#v\\n\", this.Int16)\n\t\tfmt.Fprintf(buf, \"this.Int32 = %#v\\n\", this.Int32)\n\t\tfmt.Fprintf(buf, \"this.Int64 = %#v\\n\", this.Int64)\n\t\tfmt.Fprintf(buf, \"this.Int8 = %#v\\n\", this.Int8)\n\t\tfmt.Fprintf(buf, \"this.Rune = %#v\\n\", this.Rune)\n\t\tfmt.Fprintf(buf, \"this.String = %#v\\n\", this.String)\n\t\tfmt.Fprintf(buf, \"this.Uint = %#v\\n\", this.Uint)\n\t\tfmt.Fprintf(buf, \"this.Uint16 = %#v\\n\", this.Uint16)\n\t\tfmt.Fprintf(buf, \"this.Uint32 = %#v\\n\", this.Uint32)\n\t\tfmt.Fprintf(buf, \"this.Uint64 = %#v\\n\", this.Uint64)\n\t\tfmt.Fprintf(buf, \"this.Uint8 = %#v\\n\", this.Uint8)\n\t\tfmt.Fprintf(buf, \"this.UintPtr = %#v\\n\", this.UintPtr)\n\t\tfmt.Fprintf(buf, \"return this\\n\")\n\t}\n\tfmt.Fprintf(buf, \"}()\\n\")\n\treturn buf.String()\n}", "title": "" }, { "docid": "53a7ce68d36881bb46fee362c0eed40c", "score": "0.45090228", "text": "func pkgfuncs(prefix, mod string) template.FuncMap {\n\treturn template.FuncMap{\n\t\t// pkgurl returns url to package documentation.\n\t\tprefix + \"pkgurl\": func(pkg string) string {\n\t\t\treturn pkgurl(mod, pkg, \"\")\n\t\t},\n\t\t// pkg returns markdown for a package with a link to documentation.\n\t\tprefix + \"pkg\": func(pkg string) string {\n\t\t\treturn fmt.Sprintf(\"[`%s`](%s)\", pkg, pkgurl(mod, pkg, \"\"))\n\t\t},\n\t\t// sym returns markdown for a symbol with a link to documentation.\n\t\tprefix + \"sym\": func(pkg, name string) string {\n\t\t\treturn fmt.Sprintf(\"[`%s.%s`](%s)\", path.Base(pkg), name, pkgurl(mod, pkg, name))\n\t\t},\n\t}\n}", "title": "" }, { "docid": "9b5f43296afecfff1f50e37a3a6accea", "score": "0.45067117", "text": "func isVersionInUse(sourceName string) bool {\n\tgv, _ := utils.GetCurrentGoVersion()\n\treturn gv == sourceName\n}", "title": "" }, { "docid": "1a4e72a19a7cb3e110539159e54aa415", "score": "0.45030415", "text": "func deriveGoStringPtrToBuiltInTypes(this *PtrToBuiltInTypes) string {\n\tbuf := bytes.NewBuffer(nil)\n\tfmt.Fprintf(buf, \"func() *test.PtrToBuiltInTypes {\\n\")\n\tif this == nil {\n\t\tfmt.Fprintf(buf, \"return nil\\n\")\n\t} else {\n\t\tfmt.Fprintf(buf, \"this := &test.PtrToBuiltInTypes{}\\n\")\n\t\tif this.Bool != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Bool = func (v bool) *bool { return &v }(%#v)\\n\", *this.Bool)\n\t\t}\n\t\tif this.Byte != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Byte = func (v byte) *byte { return &v }(%#v)\\n\", *this.Byte)\n\t\t}\n\t\tif this.Complex128 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Complex128 = func (v complex128) *complex128 { return &v }(%#v)\\n\", *this.Complex128)\n\t\t}\n\t\tif this.Complex64 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Complex64 = func (v complex64) *complex64 { return &v }(%#v)\\n\", *this.Complex64)\n\t\t}\n\t\tif this.Float64 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Float64 = func (v float64) *float64 { return &v }(%#v)\\n\", *this.Float64)\n\t\t}\n\t\tif this.Float32 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Float32 = func (v float32) *float32 { return &v }(%#v)\\n\", *this.Float32)\n\t\t}\n\t\tif this.Int != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int = func (v int) *int { return &v }(%#v)\\n\", *this.Int)\n\t\t}\n\t\tif this.Int16 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int16 = func (v int16) *int16 { return &v }(%#v)\\n\", *this.Int16)\n\t\t}\n\t\tif this.Int32 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int32 = func (v int32) *int32 { return &v }(%#v)\\n\", *this.Int32)\n\t\t}\n\t\tif this.Int64 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int64 = func (v int64) *int64 { return &v }(%#v)\\n\", *this.Int64)\n\t\t}\n\t\tif this.Int8 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Int8 = func (v int8) *int8 { return &v }(%#v)\\n\", *this.Int8)\n\t\t}\n\t\tif this.Rune != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Rune = func (v rune) *rune { return &v }(%#v)\\n\", *this.Rune)\n\t\t}\n\t\tif this.String != nil {\n\t\t\tfmt.Fprintf(buf, \"this.String = func (v string) *string { return &v }(%#v)\\n\", *this.String)\n\t\t}\n\t\tif this.Uint != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint = func (v uint) *uint { return &v }(%#v)\\n\", *this.Uint)\n\t\t}\n\t\tif this.Uint16 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint16 = func (v uint16) *uint16 { return &v }(%#v)\\n\", *this.Uint16)\n\t\t}\n\t\tif this.Uint32 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint32 = func (v uint32) *uint32 { return &v }(%#v)\\n\", *this.Uint32)\n\t\t}\n\t\tif this.Uint64 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint64 = func (v uint64) *uint64 { return &v }(%#v)\\n\", *this.Uint64)\n\t\t}\n\t\tif this.Uint8 != nil {\n\t\t\tfmt.Fprintf(buf, \"this.Uint8 = func (v uint8) *uint8 { return &v }(%#v)\\n\", *this.Uint8)\n\t\t}\n\t\tif this.UintPtr != nil {\n\t\t\tfmt.Fprintf(buf, \"this.UintPtr = func (v uintptr) *uintptr { return &v }(%#v)\\n\", *this.UintPtr)\n\t\t}\n\t\tfmt.Fprintf(buf, \"return this\\n\")\n\t}\n\tfmt.Fprintf(buf, \"}()\\n\")\n\treturn buf.String()\n}", "title": "" }, { "docid": "d2d85e61f95cb317daa6a14460ba0492", "score": "0.4497758", "text": "func (Pos) unexported() {\n}", "title": "" }, { "docid": "1a5bdbf58679aff99522adf0d616a0ea", "score": "0.44975716", "text": "func getUniqueImportPaths(packages []Package) []string {\n\tvar paths []string\n\tpmap := make(map[string]bool)\n\tfor _, p := range packages {\n\t\tif pmap[p.ImportPath] {\n\t\t\tcontinue\n\t\t}\n\t\tpmap[p.ImportPath] = true\n\t\tpaths = append(paths, p.ImportPath)\n\t}\n\n\tsort.Strings(paths)\n\treturn paths\n}", "title": "" }, { "docid": "dd1d37e7b2f4d43bbcaaaddca32b6854", "score": "0.4491186", "text": "func isStdlibPkg(pkg *types.Package) bool {\n\treturn pkg != nil && pkg.Path() == pkg.Name()\n}", "title": "" }, { "docid": "3a514ef1f50018e711484a2170a528aa", "score": "0.4489764", "text": "func XyzFunc() {}", "title": "" }, { "docid": "ee0c0b141f6e19eca982f6803e57da11", "score": "0.4488047", "text": "func main() {\n\n\tmystructvar := mypackage.Mystruct{\"helloo\"}\n\n\tfmt.Println(\"value is\", mystructvar.Mymethod())\n\n\tfmt.Println(mypackage.Dummy) // <<<<< rename,14,24,14,24,renamed,pass\n}", "title": "" }, { "docid": "86f8625b3fa61696f4a3869edcbbb058", "score": "0.44868872", "text": "func isBadVersion(version int) bool {\n\t// not implementation\n\treturn true\n}", "title": "" }, { "docid": "4b73e66b2b0e8af0c993f33f274217bb", "score": "0.44853333", "text": "func isStd(pkg string) bool {\n\treturn !strings.Contains(pkg, \".\")\n}", "title": "" }, { "docid": "7e8a3f11b3e7bf5edb041dd285153f7c", "score": "0.44850802", "text": "func almostOkayFunction() {\n\treturn nil\n}", "title": "" }, { "docid": "c44b16f1bdaf6c7e652d21534a992803", "score": "0.44845322", "text": "func Flags() int {\n return std.Flags()\n}", "title": "" }, { "docid": "ab1e5d1d49bff2c36802d1d68c6164f6", "score": "0.44817692", "text": "func main() {\n\t//testNestType()\n\t//testNestPointType()\n\n}", "title": "" }, { "docid": "291eff57f82ba6bf2c5b94698c0e0230", "score": "0.44786525", "text": "func (*Library) Descriptor() ([]byte, []int) {\n\treturn file_tmaps_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "166aafe34e716533182395a14aa802ba", "score": "0.4477052", "text": "func init() {\n\tPackages[\"os\"] = Package{\n\tBinds: map[string]Value{\n\t\t\"Args\":\tValueOf(&os.Args).Elem(),\n\t\t\"Chdir\":\tValueOf(os.Chdir),\n\t\t\"Chmod\":\tValueOf(os.Chmod),\n\t\t\"Chown\":\tValueOf(os.Chown),\n\t\t\"Chtimes\":\tValueOf(os.Chtimes),\n\t\t\"Clearenv\":\tValueOf(os.Clearenv),\n\t\t\"Create\":\tValueOf(os.Create),\n\t\t\"DevNull\":\tValueOf(os.DevNull),\n\t\t\"Environ\":\tValueOf(os.Environ),\n\t\t\"ErrClosed\":\tValueOf(&os.ErrClosed).Elem(),\n\t\t\"ErrExist\":\tValueOf(&os.ErrExist).Elem(),\n\t\t\"ErrInvalid\":\tValueOf(&os.ErrInvalid).Elem(),\n\t\t\"ErrNoDeadline\":\tValueOf(&os.ErrNoDeadline).Elem(),\n\t\t\"ErrNotExist\":\tValueOf(&os.ErrNotExist).Elem(),\n\t\t\"ErrPermission\":\tValueOf(&os.ErrPermission).Elem(),\n\t\t\"Executable\":\tValueOf(os.Executable),\n\t\t\"Exit\":\tValueOf(os.Exit),\n\t\t\"Expand\":\tValueOf(os.Expand),\n\t\t\"ExpandEnv\":\tValueOf(os.ExpandEnv),\n\t\t\"FindProcess\":\tValueOf(os.FindProcess),\n\t\t\"Getegid\":\tValueOf(os.Getegid),\n\t\t\"Getenv\":\tValueOf(os.Getenv),\n\t\t\"Geteuid\":\tValueOf(os.Geteuid),\n\t\t\"Getgid\":\tValueOf(os.Getgid),\n\t\t\"Getgroups\":\tValueOf(os.Getgroups),\n\t\t\"Getpagesize\":\tValueOf(os.Getpagesize),\n\t\t\"Getpid\":\tValueOf(os.Getpid),\n\t\t\"Getppid\":\tValueOf(os.Getppid),\n\t\t\"Getuid\":\tValueOf(os.Getuid),\n\t\t\"Getwd\":\tValueOf(os.Getwd),\n\t\t\"Hostname\":\tValueOf(os.Hostname),\n\t\t\"Interrupt\":\tValueOf(&os.Interrupt).Elem(),\n\t\t\"IsExist\":\tValueOf(os.IsExist),\n\t\t\"IsNotExist\":\tValueOf(os.IsNotExist),\n\t\t\"IsPathSeparator\":\tValueOf(os.IsPathSeparator),\n\t\t\"IsPermission\":\tValueOf(os.IsPermission),\n\t\t\"IsTimeout\":\tValueOf(os.IsTimeout),\n\t\t\"Kill\":\tValueOf(&os.Kill).Elem(),\n\t\t\"Lchown\":\tValueOf(os.Lchown),\n\t\t\"Link\":\tValueOf(os.Link),\n\t\t\"LookupEnv\":\tValueOf(os.LookupEnv),\n\t\t\"Lstat\":\tValueOf(os.Lstat),\n\t\t\"Mkdir\":\tValueOf(os.Mkdir),\n\t\t\"MkdirAll\":\tValueOf(os.MkdirAll),\n\t\t\"ModeAppend\":\tValueOf(os.ModeAppend),\n\t\t\"ModeCharDevice\":\tValueOf(os.ModeCharDevice),\n\t\t\"ModeDevice\":\tValueOf(os.ModeDevice),\n\t\t\"ModeDir\":\tValueOf(os.ModeDir),\n\t\t\"ModeExclusive\":\tValueOf(os.ModeExclusive),\n\t\t\"ModeIrregular\":\tValueOf(os.ModeIrregular),\n\t\t\"ModeNamedPipe\":\tValueOf(os.ModeNamedPipe),\n\t\t\"ModePerm\":\tValueOf(os.ModePerm),\n\t\t\"ModeSetgid\":\tValueOf(os.ModeSetgid),\n\t\t\"ModeSetuid\":\tValueOf(os.ModeSetuid),\n\t\t\"ModeSocket\":\tValueOf(os.ModeSocket),\n\t\t\"ModeSticky\":\tValueOf(os.ModeSticky),\n\t\t\"ModeSymlink\":\tValueOf(os.ModeSymlink),\n\t\t\"ModeTemporary\":\tValueOf(os.ModeTemporary),\n\t\t\"ModeType\":\tValueOf(os.ModeType),\n\t\t\"NewFile\":\tValueOf(os.NewFile),\n\t\t\"NewSyscallError\":\tValueOf(os.NewSyscallError),\n\t\t\"O_APPEND\":\tValueOf(os.O_APPEND),\n\t\t\"O_CREATE\":\tValueOf(os.O_CREATE),\n\t\t\"O_EXCL\":\tValueOf(os.O_EXCL),\n\t\t\"O_RDONLY\":\tValueOf(os.O_RDONLY),\n\t\t\"O_RDWR\":\tValueOf(os.O_RDWR),\n\t\t\"O_SYNC\":\tValueOf(os.O_SYNC),\n\t\t\"O_TRUNC\":\tValueOf(os.O_TRUNC),\n\t\t\"O_WRONLY\":\tValueOf(os.O_WRONLY),\n\t\t\"Open\":\tValueOf(os.Open),\n\t\t\"OpenFile\":\tValueOf(os.OpenFile),\n\t\t\"PathListSeparator\":\tValueOf(os.PathListSeparator),\n\t\t\"PathSeparator\":\tValueOf(os.PathSeparator),\n\t\t\"Pipe\":\tValueOf(os.Pipe),\n\t\t\"Readlink\":\tValueOf(os.Readlink),\n\t\t\"Remove\":\tValueOf(os.Remove),\n\t\t\"RemoveAll\":\tValueOf(os.RemoveAll),\n\t\t\"Rename\":\tValueOf(os.Rename),\n\t\t\"SEEK_CUR\":\tValueOf(os.SEEK_CUR),\n\t\t\"SEEK_END\":\tValueOf(os.SEEK_END),\n\t\t\"SEEK_SET\":\tValueOf(os.SEEK_SET),\n\t\t\"SameFile\":\tValueOf(os.SameFile),\n\t\t\"Setenv\":\tValueOf(os.Setenv),\n\t\t\"StartProcess\":\tValueOf(os.StartProcess),\n\t\t\"Stat\":\tValueOf(os.Stat),\n\t\t\"Stderr\":\tValueOf(&os.Stderr).Elem(),\n\t\t\"Stdin\":\tValueOf(&os.Stdin).Elem(),\n\t\t\"Stdout\":\tValueOf(&os.Stdout).Elem(),\n\t\t\"Symlink\":\tValueOf(os.Symlink),\n\t\t\"TempDir\":\tValueOf(os.TempDir),\n\t\t\"Truncate\":\tValueOf(os.Truncate),\n\t\t\"Unsetenv\":\tValueOf(os.Unsetenv),\n\t\t\"UserCacheDir\":\tValueOf(os.UserCacheDir),\n\t}, Types: map[string]Type{\n\t\t\"File\":\tTypeOf((*os.File)(nil)).Elem(),\n\t\t\"FileInfo\":\tTypeOf((*os.FileInfo)(nil)).Elem(),\n\t\t\"FileMode\":\tTypeOf((*os.FileMode)(nil)).Elem(),\n\t\t\"LinkError\":\tTypeOf((*os.LinkError)(nil)).Elem(),\n\t\t\"PathError\":\tTypeOf((*os.PathError)(nil)).Elem(),\n\t\t\"ProcAttr\":\tTypeOf((*os.ProcAttr)(nil)).Elem(),\n\t\t\"Process\":\tTypeOf((*os.Process)(nil)).Elem(),\n\t\t\"ProcessState\":\tTypeOf((*os.ProcessState)(nil)).Elem(),\n\t\t\"Signal\":\tTypeOf((*os.Signal)(nil)).Elem(),\n\t\t\"SyscallError\":\tTypeOf((*os.SyscallError)(nil)).Elem(),\n\t}, Proxies: map[string]Type{\n\t\t\"FileInfo\":\tTypeOf((*P_os_FileInfo)(nil)).Elem(),\n\t\t\"Signal\":\tTypeOf((*P_os_Signal)(nil)).Elem(),\n\t}, Untypeds: map[string]string{\n\t\t\"DevNull\":\t\"string:/dev/null\",\n\t\t\"PathListSeparator\":\t\"rune:58\",\n\t\t\"PathSeparator\":\t\"rune:47\",\n\t}, \n\t}\n}", "title": "" }, { "docid": "90022c14beb2ad3ffa3b663b06a2c5ba", "score": "0.4475332", "text": "func init() {\n\tPackages[\"regexp\"] = Package{\n\tBinds: map[string]Value{\n\t\t\"Compile\":\tValueOf(regexp.Compile),\n\t\t\"CompilePOSIX\":\tValueOf(regexp.CompilePOSIX),\n\t\t\"Match\":\tValueOf(regexp.Match),\n\t\t\"MatchReader\":\tValueOf(regexp.MatchReader),\n\t\t\"MatchString\":\tValueOf(regexp.MatchString),\n\t\t\"MustCompile\":\tValueOf(regexp.MustCompile),\n\t\t\"MustCompilePOSIX\":\tValueOf(regexp.MustCompilePOSIX),\n\t\t\"QuoteMeta\":\tValueOf(regexp.QuoteMeta),\n\t}, Types: map[string]Type{\n\t\t\"Regexp\":\tTypeOf((*regexp.Regexp)(nil)).Elem(),\n\t}, \n\t}\n}", "title": "" } ]
9647b873210526979d097a3177472b54
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be nonnil.
[ { "docid": "e9520b79f1621d2fb534f58b94798204", "score": "0.0", "text": "func (in *ProcessingJobSpec) DeepCopyInto(out *ProcessingJobSpec) {\n\t*out = *in\n\tif in.AppSpecification != nil {\n\t\tin, out := &in.AppSpecification, &out.AppSpecification\n\t\t*out = new(common.AppSpecification)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.Environment != nil {\n\t\tin, out := &in.Environment, &out.Environment\n\t\t*out = make([]*common.KeyValuePair, len(*in))\n\t\tfor i := range *in {\n\t\t\tif (*in)[i] != nil {\n\t\t\t\tin, out := &(*in)[i], &(*out)[i]\n\t\t\t\t*out = new(common.KeyValuePair)\n\t\t\t\t**out = **in\n\t\t\t}\n\t\t}\n\t}\n\tif in.NetworkConfig != nil {\n\t\tin, out := &in.NetworkConfig, &out.NetworkConfig\n\t\t*out = new(common.ProcessingNetworkConfig)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.ProcessingInputs != nil {\n\t\tin, out := &in.ProcessingInputs, &out.ProcessingInputs\n\t\t*out = make([]*common.ProcessingInput, len(*in))\n\t\tfor i := range *in {\n\t\t\tif (*in)[i] != nil {\n\t\t\t\tin, out := &(*in)[i], &(*out)[i]\n\t\t\t\t*out = new(common.ProcessingInput)\n\t\t\t\t**out = **in\n\t\t\t}\n\t\t}\n\t}\n\tif in.ProcessingOutputConfig != nil {\n\t\tin, out := &in.ProcessingOutputConfig, &out.ProcessingOutputConfig\n\t\t*out = new(common.ProcessingOutputConfig)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.ProcessingResources != nil {\n\t\tin, out := &in.ProcessingResources, &out.ProcessingResources\n\t\t*out = new(common.ProcessingResources)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.RoleArn != nil {\n\t\tin, out := &in.RoleArn, &out.RoleArn\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.Region != nil {\n\t\tin, out := &in.Region, &out.Region\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.StoppingCondition != nil {\n\t\tin, out := &in.StoppingCondition, &out.StoppingCondition\n\t\t*out = new(common.StoppingConditionNoSpot)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.Tags != nil {\n\t\tin, out := &in.Tags, &out.Tags\n\t\t*out = make([]*common.Tag, len(*in))\n\t\tfor i := range *in {\n\t\t\tif (*in)[i] != nil {\n\t\t\t\tin, out := &(*in)[i], &(*out)[i]\n\t\t\t\t*out = new(common.Tag)\n\t\t\t\t(*in).DeepCopyInto(*out)\n\t\t\t}\n\t\t}\n\t}\n\tif in.SageMakerEndpoint != nil {\n\t\tin, out := &in.SageMakerEndpoint, &out.SageMakerEndpoint\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n}", "title": "" } ]
[ { "docid": "fd68cc5c404d65fa5c03c64949665da7", "score": "0.80908763", "text": "func (in *Size) DeepCopyInto(out *Size) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5d6e92034d401db11b2b4eda0e0eefd6", "score": "0.8070461", "text": "func (in *RunnerInfo) DeepCopyInto(out *RunnerInfo) {\n\t*out = *in\n\tif in.Args != nil {\n\t\tin, out := &in.Args, &out.Args\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Command != nil {\n\t\tin, out := &in.Command, &out.Command\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.RunnerAnnotation != nil {\n\t\tin, out := &in.RunnerAnnotation, &out.RunnerAnnotation\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "d982116a7c640b8d4621f78e6466b9a1", "score": "0.8059588", "text": "func (in *StoredinfotypeOutputPath) DeepCopyInto(out *StoredinfotypeOutputPath) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f8afb71c2d59991b1cbdec6b51f10ad2", "score": "0.80569714", "text": "func (in *ConsoleInfo) DeepCopyInto(out *ConsoleInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "ed9b5634248e3b7802ed71d4cc82b2de", "score": "0.8044619", "text": "func (in *Build) DeepCopyInto(out *Build) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "30d5a6805fd4fa1a057ce4497fc7b0ff", "score": "0.8034833", "text": "func (in *Build) DeepCopyInto(out *Build) {\n\t*out = *in\n}", "title": "" }, { "docid": "c57a7585eb4b85fbf8808d7ab3ba88f0", "score": "0.8022487", "text": "func (in *All) DeepCopyInto(out *All) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e9cb500ebbcbb1ec1b2276e4a6ad7c35", "score": "0.8016474", "text": "func (in *FileSystemInfo) DeepCopyInto(out *FileSystemInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5284c00a2adccb70e1714da995a5c3d2", "score": "0.8015615", "text": "func (in *Container) DeepCopyInto(out *Container) {\n\t*out = *in\n\tout.Args = in.Args\n}", "title": "" }, { "docid": "20c3698346fd243d8c96d1b906bf7cd4", "score": "0.80137104", "text": "func (in *MongoDBBackup) DeepCopyInto(out *MongoDBBackup) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "64f7c5b12b50180e8fc16b78724a33b3", "score": "0.79961914", "text": "func (in *DebugInfo) DeepCopyInto(out *DebugInfo) {\n\t*out = *in\n}", "title": "" }, { "docid": "594e2c3bdd34c995d30cff3b3e04a3b4", "score": "0.798162", "text": "func (in *Backup) DeepCopyInto(out *Backup) {\n\t*out = *in\n}", "title": "" }, { "docid": "169ad04de6c05bd0b231ad19df0d40da", "score": "0.7973235", "text": "func (in *Selection) DeepCopyInto(out *Selection) {\n\t*out = *in\n\tif in.UseAllDevices != nil {\n\t\tin, out := &in.UseAllDevices, &out.UseAllDevices\n\t\t*out = new(bool)\n\t\t**out = **in\n\t}\n\tif in.Directories != nil {\n\t\tin, out := &in.Directories, &out.Directories\n\t\t*out = make([]Directory, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "4c8e7738691e5fc814aa9f04e5a0beb0", "score": "0.79706854", "text": "func (in *DependentObjectReference) DeepCopyInto(out *DependentObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "dc25f670b9ab6635efd1a7f707841646", "score": "0.7970074", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "dc25f670b9ab6635efd1a7f707841646", "score": "0.7970074", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "dc25f670b9ab6635efd1a7f707841646", "score": "0.7970074", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "c6b0eba8d2656b9cbfb96b38ddc4e4ca", "score": "0.79603237", "text": "func (in *MongoDBRestore) DeepCopyInto(out *MongoDBRestore) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1d7086a38f14633785818609a374af11", "score": "0.7957222", "text": "func (in *HostAndPath) DeepCopyInto(out *HostAndPath) {\n\t*out = *in\n}", "title": "" }, { "docid": "fcd61e82f34db96b76efba6276644908", "score": "0.79570514", "text": "func (in *ObjectSelector) DeepCopyInto(out *ObjectSelector) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "d71a08ebbf7d7d2bc0c2ca3727a341a9", "score": "0.79554325", "text": "func (in *OCIContentID) DeepCopyInto(out *OCIContentID) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5a741ba8543bcaf0b5e12409151d4a6b", "score": "0.7950686", "text": "func (in *Konnect) DeepCopyInto(out *Konnect) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9c50266b4bf090dac9b6eddc2dd56fe1", "score": "0.7946923", "text": "func (in *S2i) DeepCopyInto(out *S2i) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.79461676", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.79461676", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.79461676", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "33fc96978d0776f1e447efa87c0eae3f", "score": "0.7943864", "text": "func (in *Args) DeepCopyInto(out *Args) {\n\t*out = *in\n}", "title": "" }, { "docid": "a62d2491925276d66a89576351b7bdb4", "score": "0.7941823", "text": "func (in *Replicas) DeepCopyInto(out *Replicas) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5a06ad0ad03bce466da4cc53b9ab069a", "score": "0.79319304", "text": "func (in *PvcInfo) DeepCopyInto(out *PvcInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "04bd8ff77eb66f0d7482e20409a29ad4", "score": "0.7930174", "text": "func (in *Nexus) DeepCopyInto(out *Nexus) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9a15d89300bd7975c23b970cd7e97f3d", "score": "0.79287124", "text": "func (in *File) DeepCopyInto(out *File) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "28b00a91c908578687857cdc8c46f4ee", "score": "0.7926026", "text": "func (in *TestflowStep) DeepCopyInto(out *TestflowStep) {\n\t*out = *in\n\tif in.Config != nil {\n\t\tin, out := &in.Config, &out.Config\n\t\t*out = make([]ConfigElement, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "64d18093ce59b818a52f1604bd3d0643", "score": "0.792375", "text": "func (in *Copy) DeepCopyInto(out *Copy) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fa638bb1ac9efb6a5f0ef2e594d2d3c2", "score": "0.7922922", "text": "func (in *Check) DeepCopyInto(out *Check) {\n\t*out = *in\n}", "title": "" }, { "docid": "b757333658adc8c28495b373c70cdd61", "score": "0.7922167", "text": "func (in *CPUAndMem) DeepCopyInto(out *CPUAndMem) {\n\t*out = *in\n}", "title": "" }, { "docid": "aaeed9dbebc681d54de1c8c2058fad47", "score": "0.79184633", "text": "func (in *PropertyValue) DeepCopyInto(out *PropertyValue) {\n\t*out = *in\n}", "title": "" }, { "docid": "92a781c52ce2acbaf732790f97243de0", "score": "0.7916686", "text": "func (in *AddonObject) DeepCopyInto(out *AddonObject) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "79e328959883a47a6974d28ff0091ef3", "score": "0.7915593", "text": "func (in *NetcatResult) DeepCopyInto(out *NetcatResult) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1fb65e67bcc01531c8fbbd94912d7379", "score": "0.7914675", "text": "func (in *DotConfig) DeepCopyInto(out *DotConfig) {\n\t*out = *in\n}", "title": "" }, { "docid": "c33d03bd1dd1387c878363147f87efb5", "score": "0.79131836", "text": "func (in *NetworkVshpereOpts) DeepCopyInto(out *NetworkVshpereOpts) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "ebde97abbe9aa8149c7ca6159e15bd33", "score": "0.79022104", "text": "func (in *CPUAndMem) DeepCopyInto(out *CPUAndMem) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "33f5df736c2936ad4e31771a61e88775", "score": "0.7901591", "text": "func (in *MysqlVersion) DeepCopyInto(out *MysqlVersion) {\n\t*out = *in\n}", "title": "" }, { "docid": "619b2a77ef3bb1471e6a23e586917386", "score": "0.7899523", "text": "func (in *CABundleDestination) DeepCopyInto(out *CABundleDestination) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f10759a9e3b4b70095a75a8f29f6d525", "score": "0.7896576", "text": "func (in *DeidentifytemplateUnwrapped) DeepCopyInto(out *DeidentifytemplateUnwrapped) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "dddf435977ebcd6bfaf0b4c062ea8042", "score": "0.78905755", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n}", "title": "" }, { "docid": "dddf435977ebcd6bfaf0b4c062ea8042", "score": "0.78905755", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n}", "title": "" }, { "docid": "dddf435977ebcd6bfaf0b4c062ea8042", "score": "0.78905755", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n}", "title": "" }, { "docid": "dfbb452b64d186c585249239d1b0a5c2", "score": "0.7889006", "text": "func (in *PublishTask) DeepCopyInto(out *PublishTask) {\n\t*out = *in\n\tout.Registry = in.Registry\n}", "title": "" }, { "docid": "23db226639df1ec5bfce6ed220d55ed3", "score": "0.78859967", "text": "func (in *Port) DeepCopyInto(out *Port) {\n\t*out = *in\n}", "title": "" }, { "docid": "23db226639df1ec5bfce6ed220d55ed3", "score": "0.78859967", "text": "func (in *Port) DeepCopyInto(out *Port) {\n\t*out = *in\n}", "title": "" }, { "docid": "d5ca2454336c8c33ddb7dcd75d173870", "score": "0.78852975", "text": "func (in *NodePoolInfo) DeepCopyInto(out *NodePoolInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "84d6746ddc264a1fefeb930f6dc9a54d", "score": "0.7882239", "text": "func (in *IngestMatch) DeepCopyInto(out *IngestMatch) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "ae169a241fc750d6d99542ca8b2b06d1", "score": "0.7881399", "text": "func (in *BaseTask) DeepCopyInto(out *BaseTask) {\n\t*out = *in\n}", "title": "" }, { "docid": "7e6f9d20adbbec72ed85dde045cc014d", "score": "0.7877674", "text": "func (in *Partition) DeepCopyInto(out *Partition) {\n\t*out = *in\n\tout.FileSystem = in.FileSystem\n\treturn\n}", "title": "" }, { "docid": "fa756ae28922fed925a87b236587b156", "score": "0.7875656", "text": "func (in *Git) DeepCopyInto(out *Git) {\n\t*out = *in\n}", "title": "" }, { "docid": "f62c6fe6c0b72d76d8dcc28816c39d82", "score": "0.78754747", "text": "func (in *AquaEnforcerDetailes) DeepCopyInto(out *AquaEnforcerDetailes) {\n\t*out = *in\n}", "title": "" }, { "docid": "5c083f2a30b5b88fd1b331509f358f56", "score": "0.7873853", "text": "func (in *Directory) DeepCopyInto(out *Directory) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fbac25d82e819c2fbf45aff98d19462c", "score": "0.7866969", "text": "func (in *PingResult) DeepCopyInto(out *PingResult) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1e1088954cae99b323e1b34730ad0490", "score": "0.7865111", "text": "func (in *Proxy) DeepCopyInto(out *Proxy) {\n\t*out = *in\n}", "title": "" }, { "docid": "5186b8d1bfd3abf2fb983694f27e4aed", "score": "0.7863912", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5186b8d1bfd3abf2fb983694f27e4aed", "score": "0.7863912", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3131169e9b81994ea411b95e66f60963", "score": "0.78585416", "text": "func (in *MysqldImage) DeepCopyInto(out *MysqldImage) {\n\t*out = *in\n}", "title": "" }, { "docid": "b8c57c3a0f2dfa74226b698b7b8ad2e4", "score": "0.7850881", "text": "func (in *Snapshot) DeepCopyInto(out *Snapshot) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "170ddf2575c007ccb3fc0068b04801fb", "score": "0.78483486", "text": "func (in *MemoryGibPerVcpuObservation) DeepCopyInto(out *MemoryGibPerVcpuObservation) {\n\t*out = *in\n}", "title": "" }, { "docid": "8f77db9449d807b50cf35ec73f5fcbce", "score": "0.78464186", "text": "func (in *Pool) DeepCopyInto(out *Pool) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "36a32ca70ca4f4d6247817020e0c08f1", "score": "0.7845124", "text": "func (o *Root) DeepCopyInto(out *Root) {\n\n\ttarget, err := copystructure.Copy(o)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Unable to deepcopy Root: %s\", err))\n\t}\n\n\t*out = *target.(*Root)\n}", "title": "" }, { "docid": "768111c725e3f5f5235079124e0a96f5", "score": "0.78448206", "text": "func (in *Workspace) DeepCopyInto(out *Workspace) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "8a90fa08f4b62c55c837bba9860098d3", "score": "0.78377634", "text": "func (in *Flow) DeepCopyInto(out *Flow) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "60bb9d5b70e5ef6b1701bd732fca2874", "score": "0.78372204", "text": "func (in *DebugOptions) DeepCopyInto(out *DebugOptions) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f4587e0baa95f420bd0dba802ecd256c", "score": "0.7837198", "text": "func (in *Proxy) DeepCopyInto(out *Proxy) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "6af44f744e22e8c655f8c2045f82edd7", "score": "0.7835974", "text": "func (in *ImageBase) DeepCopyInto(out *ImageBase) {\n\t*out = *in\n}", "title": "" }, { "docid": "311404ea3ee92f40e4221355ddad6dfd", "score": "0.78334683", "text": "func (in *PortCheck) DeepCopyInto(out *PortCheck) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "09e260a9495f25232a2f6fb9adfde18d", "score": "0.7832324", "text": "func (in *BundleObjectReference) DeepCopyInto(out *BundleObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "ac7d637e82c210b8470a3e45007e7831", "score": "0.78320616", "text": "func (in *ContainerRuntime) DeepCopyInto(out *ContainerRuntime) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3727ea7357660f79348fd63217d4649b", "score": "0.78283066", "text": "func (in *Version) DeepCopyInto(out *Version) {\n\t*out = *in\n\tif in.Created != nil {\n\t\tin, out := &in.Created, &out.Created\n\t\t*out = new(intstr.IntOrString)\n\t\t**out = **in\n\t}\n\treturn\n}", "title": "" }, { "docid": "83ff2746330e827c5ffb7cb92d668e4f", "score": "0.78269345", "text": "func (in *StepOutput) DeepCopyInto(out *StepOutput) {\n\t*out = *in\n\tif in.Labels != nil {\n\t\tin, out := &in.Labels, &out.Labels\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\tif in.parsedUrl != nil {\n\t\tout.parsedUrl = DeepCopyUrl(in.parsedUrl)\n\t}\n\treturn\n}", "title": "" }, { "docid": "b97dabd2033a257ea967ae09454b7ca3", "score": "0.7823806", "text": "func (in *ChaosResultSpec) DeepCopyInto(out *ChaosResultSpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "2abf1d56e28a21e208ed94abae3e2540", "score": "0.7822091", "text": "func (in *NodeParams) DeepCopyInto(out *NodeParams) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "6c5428e893310edb09bf8bfeb46297b4", "score": "0.7821161", "text": "func (in *Info) DeepCopyInto(out *Info) {\n\t*out = *in\n\tif in.AvailableClusterVersions != nil {\n\t\tin, out := &in.AvailableClusterVersions, &out.AvailableClusterVersions\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.SupportedClusterVersions != nil {\n\t\tin, out := &in.SupportedClusterVersions, &out.SupportedClusterVersions\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "9d83cc4f04161818cdf7da63378fa24b", "score": "0.78168124", "text": "func (in *FDocument) DeepCopyInto(out *FDocument) {\n\t*out = *in\n\tif in.ID != nil {\n\t\tin, out := &in.ID, &out.ID\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.Path != nil {\n\t\tin, out := &in.Path, &out.Path\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.Published != nil {\n\t\tin, out := &in.Published, &out.Published\n\t\t*out = new(bool)\n\t\t**out = **in\n\t}\n\tif in.Content != nil {\n\t\tin, out := &in.Content, &out.Content\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\treturn\n}", "title": "" }, { "docid": "b16819350d4dbfa0a5a19961dffe66e9", "score": "0.7809754", "text": "func (in *ArangoBackupProgress) DeepCopyInto(out *ArangoBackupProgress) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1ab7dccf8a6a22edbbc3cbaf437ba91c", "score": "0.78084743", "text": "func (in *OneAgentProxy) DeepCopyInto(out *OneAgentProxy) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "46827d00f1b80e33018751dea427d715", "score": "0.78080773", "text": "func (in *DataSourceObject) DeepCopyInto(out *DataSourceObject) {\n\t*out = *in\n\tif in.Properties != nil {\n\t\tin, out := &in.Properties, &out.Properties\n\t\t*out = make([]v1.EnvVar, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "3500f1895e195cb0ab50f3e97e4f91e4", "score": "0.780787", "text": "func (in *AutoDelete) DeepCopyInto(out *AutoDelete) {\n\t*out = *in\n}", "title": "" }, { "docid": "768a732f575798df884d6452e16c6b7f", "score": "0.78043187", "text": "func (in *DeepOne) DeepCopyInto(out *DeepOne) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tin.ObjectMeta.DeepCopyInto(&out.ObjectMeta)\n\tin.Spec.DeepCopyInto(&out.Spec)\n\tout.Status = in.Status\n\treturn\n}", "title": "" }, { "docid": "06564a8f4dc1e0b6ccdd0a451e6ce4c9", "score": "0.7802322", "text": "func (in *APIProperty) DeepCopyInto(out *APIProperty) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "01b508f74eb653d3628e69f3ddedcd2a", "score": "0.7801014", "text": "func (in *Destination) DeepCopyInto(out *Destination) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "01b508f74eb653d3628e69f3ddedcd2a", "score": "0.7801014", "text": "func (in *Destination) DeepCopyInto(out *Destination) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1f4d6f97d1ffe46d909d150e1cc77749", "score": "0.7800726", "text": "func (in *External) DeepCopyInto(out *External) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "b7e7523fde1137751076e56a8a3a711e", "score": "0.77985334", "text": "func (in *RbacConfigTarget) DeepCopyInto(out *RbacConfigTarget) {\n\t*out = *in\n\tif in.Services != nil {\n\t\tin, out := &in.Services, &out.Services\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Namespaces != nil {\n\t\tin, out := &in.Namespaces, &out.Namespaces\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "88999343056500ee781727902f489eca", "score": "0.7795753", "text": "func (in *Global) DeepCopyInto(out *Global) {\n\t*out = *in\n\tout.IdentityContext = in.IdentityContext\n}", "title": "" }, { "docid": "db315275db75fe989c440fd49d503f25", "score": "0.7795556", "text": "func (in *Addon) DeepCopyInto(out *Addon) {\n\t*out = *in\n\tif in.Params != nil {\n\t\tin, out := &in.Params, &out.Params\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\tif in.Deps != nil {\n\t\tin, out := &in.Deps, &out.Deps\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "3fd37fa0a6e40b0c2c4b4779ff65d42b", "score": "0.7793468", "text": "func (in *Selector) DeepCopyInto(out *Selector) {\n\t*out = *in\n}", "title": "" }, { "docid": "c7e1d612f3613418287025d9beb75ebd", "score": "0.7792887", "text": "func (in *NamespacedName) DeepCopyInto(out *NamespacedName) {\n\t*out = *in\n}", "title": "" }, { "docid": "89c71347df6fe684a106ecc7aafaec49", "score": "0.77917653", "text": "func (in *UpdateStrategyDelayedRollingUpdate) DeepCopyInto(out *UpdateStrategyDelayedRollingUpdate) {\n\t*out = *in\n}", "title": "" }, { "docid": "34c8aebd15f9b68121362b956de82e91", "score": "0.778388", "text": "func (in *LocalReferenceByKindAndName) DeepCopyInto(out *LocalReferenceByKindAndName) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fabdc2e250a855e2774e0355dc7af71e", "score": "0.7783484", "text": "func (in *Depth) DeepCopyInto(out *Depth) {\n\t*out = *in\n\tif in.Limit != nil {\n\t\tin, out := &in.Limit, &out.Limit\n\t\t*out = new(intstr.IntOrString)\n\t\t**out = **in\n\t}\n\treturn\n}", "title": "" }, { "docid": "30dacc7875f9f591955fc2c63075047c", "score": "0.778174", "text": "func (in *DiskVsphereOpts) DeepCopyInto(out *DiskVsphereOpts) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "7f23713ad64a40a5dcef1f163fd06673", "score": "0.7781545", "text": "func (in *VMSpec) DeepCopyInto(out *VMSpec) {\n\t*out = *in\n\tif in.Zone != nil {\n\t\tin, out := &in.Zone, &out.Zone\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.CustomData != nil {\n\t\tin, out := &in.CustomData, &out.CustomData\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.SecondaryNICs != nil {\n\t\tin, out := &in.SecondaryNICs, &out.SecondaryNICs\n\t\t*out = new([]string)\n\t\tif **in != nil {\n\t\t\tin, out := *in, *out\n\t\t\t*out = make([]string, len(*in))\n\t\t\tcopy(*out, *in)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2c491c9c7a7bfdaf851a1ae13fa61785", "score": "0.77808714", "text": "func (in *Addon) DeepCopyInto(out *Addon) {\n\t*out = *in\n\tif in.AddonObjects != nil {\n\t\tin, out := &in.AddonObjects, &out.AddonObjects\n\t\t*out = make([]AddonObject, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "42fa4c83c011b43eb1801b15f7a029c9", "score": "0.7780794", "text": "func (in *SamplePointerSubElem) DeepCopyInto(out *SamplePointerSubElem) {\n\t*out = *in\n\treturn\n}", "title": "" } ]
46792666244a72ceee862eb764190cdb
Handles the test page This is a test API we can ping on our Amazon server
[ { "docid": "5c82946af44ad4d072904b74080c9c35", "score": "0.6312282", "text": "func testPing(w http.ResponseWriter, r *http.Request) {\n\t//Initialize struct for taking messages\n\ttype TestCrudPing struct {\n\t\tTheCrudPing string `json:\"TheCrudPing\"`\n\t}\n\t//Collect JSON from Postman or wherever\n\t//Get the byte slice from the request body ajax\n\tbs, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tlogWriter(err.Error())\n\t}\n\t//Marshal it into our type\n\tvar postedMessage TestCrudPing\n\tjson.Unmarshal(bs, &postedMessage)\n\n\tmessageLog := \"We've had a ping come in from somewhere: \" + postedMessage.TheCrudPing\n\tlogWriter(messageLog)\n\tfmt.Printf(\"%v\\n\", messageLog)\n\n\t//Declare data to return\n\ttype ReturnMessage struct {\n\t\tTheErr string `json:\"TheErr\"`\n\t\tResultMsg string `json:\"ResultMsg\"`\n\t\tSuccOrFail int `json:\"SuccOrFail\"`\n\t}\n\ttheReturnMessage := ReturnMessage{\n\t\tTheErr: \"Here's an error\",\n\t\tResultMsg: \"Yo, here's a result\",\n\t\tSuccOrFail: 0,\n\t}\n\t//Send the response back\n\ttheJSONMessage, err := json.Marshal(theReturnMessage)\n\t//Send the response back\n\tif err != nil {\n\t\terrIs := \"Error formatting JSON for return in addUser: \" + err.Error()\n\t\tlogWriter(errIs)\n\t}\n\tfmt.Fprint(w, string(theJSONMessage))\n}", "title": "" } ]
[ { "docid": "819246b62ec63726964eb7e8770e4ad5", "score": "0.68401045", "text": "func testPage(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Test Page: Endpoint Hit\") // Prints to terminal\n\tfmt.Fprintln(w, \"Test Page: Endpoint Hit\") // Prints to site\n}", "title": "" }, { "docid": "483709bea05880fa841c8312b81c67a4", "score": "0.66638887", "text": "func testHome(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Test Home: Endpoint Hit\")\n\tfmt.Fprintln(w, \"Test Home: Endpoint Hit\")\n}", "title": "" }, { "docid": "38d5b2c981c168bd0281f00a0b22fe92", "score": "0.6484628", "text": "func (c *Controllers) Test(w http.ResponseWriter, r *http.Request) {\n\tlogger.Info(\"Test Endpoint Hit\")\n\tresponse := TestResponse{\n\t\tMessage: \"Hello World\",\n\t}\n\n\tjson.NewEncoder(w).Encode(response)\n}", "title": "" }, { "docid": "bfd8c3e5a1520b261a59e3778a6a8446", "score": "0.6475662", "text": "func Test(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"API Running\")\n}", "title": "" }, { "docid": "9024be55824680e1174af6841497d297", "score": "0.6195019", "text": "func TestAPI(ctx *macaron.Context) {\n\tctx.WriteHeader(http.StatusOK)\n\tctx.Write([]byte(\"OK\"))\n}", "title": "" }, { "docid": "0cec1b4832aba42b308723ab46421ee8", "score": "0.61696285", "text": "func Test(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintln(w, \"Server is up\")\n}", "title": "" }, { "docid": "09690fa4a8791dfb6b620f343bfea63d", "score": "0.60649425", "text": "func ping(formatter *render.Render) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, req *http.Request) {\n\t\tfmt.Println(\"Ping - Payment API running\");\n\t\tresult := \"Orders API - Running\"\n\t\tformatter.JSON(w, http.StatusOK, result);\n\t}\n}", "title": "" }, { "docid": "34c72f72844309473fe2e4052ae704cc", "score": "0.6057527", "text": "func (h HelloExampleHandlerImpl) Ping(c *gin.Context) {\n\thello := payloadTest{\n\t\tTitle: \"Some Title\",\n\t\tMessage: \"Some Message\",\n\t\tBudegaMode: false,\n\t}\n\n\tc.JSON(200, hello)\n}", "title": "" }, { "docid": "ccdc24dc47667cf0aa3a3f36e0baebec", "score": "0.60366833", "text": "func (s *APIPingSuite) TestPing(c *check.C) {\n\tif environment.UseJavaVersion {\n\t\tc.Skip(\"no matched handler with java version\")\n\t}\n\tresp, err := request.Get(\"/_ping\")\n\tc.Assert(err, check.IsNil)\n\tdefer resp.Body.Close()\n\n\tCheckRespStatus(c, resp, 200)\n}", "title": "" }, { "docid": "9791a33846d6b878827dae7792533e99", "score": "0.59832495", "text": "func (node *RaftNode) TestHandler(w http.ResponseWriter, r *http.Request) {\n\n\tfmt.Fprintf(w, \"\\nServer is up\\n\\n\")\n\n}", "title": "" }, { "docid": "7315a30332bb64fb2768ef6d36380704", "score": "0.5946071", "text": "func CRH_Simple_Test() {\n\tfmt.Print(\"\\n\\n============= CloudResourceHandler: Simple Test =============\\n\")\n\n\t// 1. Create CloudResourceHandler\n\tcrh := api.NewCloudResourceHandler()\n\n\t// 2. Setup env.\n\terr := crh.SetServerAddr(spiderServer)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\terr = crh.SetTimeout(90 * time.Second)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// 3. Open New Session\n\terr = crh.Open()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// 4. Close (with defer)\n\tdefer crh.Close()\n\n\t// 5. Call API\n\tresult, err := crh.ListVMStatusByParam(connConfigNameList[0])\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"\\nresult :\\n%s\\n\", result)\n}", "title": "" }, { "docid": "8f5c6ce478929ad8d594dfccc9a2819f", "score": "0.5899387", "text": "func Test(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write([]byte(\"Server is active...\"))\n}", "title": "" }, { "docid": "2a77766a97c5d7b69cabafc313d05692", "score": "0.58693427", "text": "func TestHandler(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(200)\n\tw.Write([]byte(\"success\"))\n}", "title": "" }, { "docid": "b354f4b092a6b947e96179cccce61326", "score": "0.585453", "text": "func apihandler(t *testing.T, w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tmatch := catalogRequestRegex.FindStringSubmatch(r.RequestURI)\n\n\tif len(match) == 0 {\n\t\tt.Fatalf(\"unexpected request %s\", r.RequestURI)\n\t\treturn\n\t}\n\n\tif r.Method != http.MethodGet {\n\t\t// Anything more interesting than a GET, i.e. it relies upon server behavior\n\t\t// probably should be an integration test instead\n\t\tw.WriteHeader(200)\n\t\treturn\n\t}\n\n\t_, response, err := test.GetTestdata(filepath.Join(\"responses\", match[1]+\".json\"))\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected request %s with no matching testdata (%s)\", r.RequestURI, err)\n\t\treturn\n\t}\n\n\tw.Write(response)\n}", "title": "" }, { "docid": "c292c2ff4f7fd5f7ef28853ea916c6d2", "score": "0.5814519", "text": "func pingHandler(w http.ResponseWriter, req *http.Request) {\n\tfmt.Fprintf(w, \"OK\")\n}", "title": "" }, { "docid": "419872390062b2de9048ded6c9e882b1", "score": "0.57732815", "text": "func (c *Client) testApi() {\n\ttests := []testCase{\n\t\ttestCase{\"doNewSession\", c.doNewSession},\n\t\ttestCase{\"doRegister\", c.doRegister},\n\t\ttestCase{\"doLogin\", c.doLogin},\n\t\ttestCase{\"doRename\", c.doRename},\n\t\t//testCase{\"doDoBind\", c.doDoBind},\n\t\ttestCase{\"doHeartbeat\", c.doHeartbeat},\n\t\t//testCase{\"doOfflineSub\", c.doOfflineSub},\n\t}\n\tfor _, t := range tests {\n\t\tresult, err := t.fn()\n\t\tlog.Printf(\"--- %s ---\", t.name)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"[%v] error: %v\", t.name, err)\n\t\t}\n\t\tif result == nil {\n\t\t\tcontinue\n\t\t}\n\t\tfor k, v := range result {\n\t\t\tlog.Printf(\"%s=%v\", k, v)\n\t\t}\n\t\ttime.Sleep(time.Millisecond)\n\t}\n\tlog.Println(\"--- All done ---\")\n}", "title": "" }, { "docid": "7b63a05dda6a8e77d14f54121459f578", "score": "0.57636434", "text": "func ping(c echo.Context) error {\n\tlogger.WithFields(logger.Fields{\"component\": \"main\", \"action\": \"ping\"}).\n\t\tInfof(\"testing server connection.\")\n\treturn c.String(http.StatusOK, \"pong\")\n}", "title": "" }, { "docid": "4004a3ce7a062fbdcd5ec57c909be1e7", "score": "0.57611763", "text": "func pingHandler(formatter *render.Render) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, req *http.Request) {\n message := \"Burger Menu API Server Working on machine: \" + getSystemIp()\n\t\tformatter.JSON(w, http.StatusOK, struct{ Test string }{message})\n\t}\n}", "title": "" }, { "docid": "06b4d2105d0854d959c1286b41aec44d", "score": "0.5748704", "text": "func main() {\n\tcmd.Execute()\n\n\t// TODO: Move this to a function in helper package\n\t//testResult, err := apigwsvc.TestInvokeMethod(&apigateway.TestInvokeMethodInput{\n\t//\tBody: aws.String(`{\"operation\": \"create\"}`),\n\t//\tHttpMethod: aws.String(\"POST\"),\n\t//\tPathWithQueryString: aws.String(\"\"),\n\t//\tResourceId: resourceID,\n\t//\tRestApiId: api,\n\t//})\n\t//if err != nil || testResult.Status != aws.Int64(200) {\n\t//\tfmt.Println(err.Error(), testResult.Status)\n\t//}\n}", "title": "" }, { "docid": "cab889d7f413622d4ea7cc03a8e5724d", "score": "0.5740968", "text": "func testHandler(w http.ResponseWriter, r *http.Request) {\n\ttestEvent := `{\"output\":\"This is a test from falcosidekick\",\"priority\":\"Debug\",\"rule\":\"Test rule\", \"time\":\"` + time.Now().UTC().Format(time.RFC3339) + `\",\"outputfields\": {\"proc.name\":\"falcosidekick\",\"user.name\":\"falcosidekick\"}}`\n\n\tresp, err := http.Post(\"http://localhost:\"+strconv.Itoa(config.ListenPort), \"application/json\", bytes.NewBuffer([]byte(testEvent)))\n\tif err != nil {\n\t\tlog.Printf(\"[DEBUG] : Test Failed. Falcosidekick can't call itself\\n\")\n\t}\n\tdefer resp.Body.Close()\n\n\tlog.Printf(\"[DEBUG] : Test sent\\n\")\n\tif resp.StatusCode != http.StatusOK {\n\t\tlog.Printf(\"[DEBUG] : Test KO (%v)\\n\", resp.Status)\n\t}\n}", "title": "" }, { "docid": "78f53430f0db9383ff94d1e7929e552a", "score": "0.5735888", "text": "func testDetailsHandler(w http.ResponseWriter, r *http.Request) {\n\tquery := r.URL.Query()\n\ttestName := mux.Vars(r)[\"testname\"]\n\tresult, err := analyzer.GetTestDetails(testName, query)\n\tif err != nil {\n\t\tsendErrorResponse(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tsendResponse(w, result, http.StatusOK)\n}", "title": "" }, { "docid": "e2934b93556ef931ca37e041c1350b0c", "score": "0.5686069", "text": "func StartTestServer() {\n\n\t// set Config\n\tcfg := conf.Config()\n\n\t// Displaying server\n\t// screen message\n\tshowMsg()\n\n\t// Our redirect to https: will not work, it will not overwrite the url,\n\t// so we will disable ..\n\t//\n\t// He listens on port 80 but we will not actually let him run,\n\t// we omit to close the connection.\n\tif cfg.Schema == \"https\" {\n\n\t\t// This method will only serve to redirect everything you get\n\t\t// on port 80 to port 443, we will ensure that all access\n\t\t// will come from https\n\t\tgo http.ListenAndServe(\":\"+cfg.PortRedirect, http.HandlerFunc(redirect))\n\t}\n\n\t///create route\n\trouter := mux.NewRouter().StrictSlash(true)\n\n\t// Opening an escape port for Homologation\n\trTest := mux.NewRouter().StrictSlash(true)\n\n\t// Homologation\n\t// This handler is that we will test all the possibilities\n\t// that it can receive when the method is post coming from the api gateway of aws\n\trTest.\n\t\tHandleFunc(\"/postest\", func(w http.ResponseWriter, r *http.Request) {\n\n\t\t\tfmt.Println(\"Homologation Environment\")\n\t\t\tfmt.Println(\"Subdomain \" + \"http://\" + r.Host + r.URL.Path)\n\n\t\t\t// Showing the objects of the\n\t\t\t// http.request method\n\t\t\tshowMsgHandler(r)\n\n\t\t\t// Executes all the functions\n\t\t\t// of the request,\n\t\t\t// get, post etc.\n\t\t\tallBodyExec(w, r)\n\n\t\t\tmsgjson := conf.JsonMsg(200, \"Homologation\")\n\t\t\tfmt.Fprintln(w, msgjson)\n\t\t})\n\n\t// Production\n\t// Every time trying to access our api without a\n\t// method it fires to the root and sends a welcome message\n\trouter.Handle(\"/\", http.FileServer(http.Dir(\"msg\")))\n\n\t// This handler is that we will test all the possibilities\n\t// that it can receive when the method is post coming from the api gateway of aws\n\trouter.\n\t\tHandleFunc(\"/postest\", func(w http.ResponseWriter, r *http.Request) {\n\n\t\t\tw.Header().Add(\"Strict-Transport-Security\", \"max-age=63072000; includeSubDomains\")\n\n\t\t\t// Showing the objects of the\n\t\t\t// http.request method\n\t\t\tshowMsgHandler(r)\n\n\t\t\t// Executes all the functions\n\t\t\t// of the request,\n\t\t\t// get, post etc.\n\t\t\tallBodyExec(w, r)\n\n\t\t})\n\n\t// Now it is possible to get on port 443 using https,\n\t// we did a check when it is https, the system\n\t// parameterizes config as needed\n\tif cfg.Schema == \"https\" {\n\n\t\t// .crt — Alternate synonymous most common among *nix systems .pem (pubkey).\n\t\t// .csr — Certficate Signing Requests (synonymous most common among *nix systems).\n\t\t// .cer — Microsoft alternate form of .crt, you can use MS to convert .crt to .cer (DER encoded .cer, or base64[PEM] encoded .cer).\n\t\t// .pem = The PEM extension is used for different types of X.509v3 files which contain ASCII (Base64) armored data prefixed with a «—– BEGIN …» line. These files may also bear the cer or the crt extension.\n\t\t// .der — The DER extension is used for binary DER encoded certificates.\n\t\t//\n\t\t// Setting our tls to accept\n\t\t// our .key and .crt keys.\n\t\tcfgs := &tls.Config{\n\n\t\t\tMinVersion: tls.VersionTLS12,\n\t\t\tCurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},\n\t\t\tPreferServerCipherSuites: true,\n\t\t\tCipherSuites: []uint16{\n\t\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,\n\t\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,\n\t\t\t\ttls.TLS_RSA_WITH_AES_256_GCM_SHA384,\n\t\t\t\ttls.TLS_RSA_WITH_AES_256_CBC_SHA,\n\t\t\t},\n\t\t}\n\n\t\t// Config to upload our server\n\t\tconfServerHttps = &http.Server{\n\n\t\t\tHandler: router,\n\t\t\tAddr: cfg.Host + \":\" + cfg.ServerPort,\n\t\t\tTLSConfig: cfgs,\n\t\t\tTLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler), 0),\n\n\t\t\t// Good idea, good live!!!\n\t\t\t//WriteTimeout: 10 * time.Second,\n\t\t\t//ReadTimeout: 10 * time.Second,\n\t\t}\n\n\t} else {\n\n\t\t// Config to upload our server\n\t\tconfServerHttp = &http.Server{\n\n\t\t\tHandler: router,\n\t\t\tAddr: cfg.Host + \":\" + cfg.ServerPort,\n\n\t\t\t// Good idea, good live!!!\n\t\t\t//WriteTimeout: 10 * time.Second,\n\t\t\t//ReadTimeout: 10 * time.Second,\n\t\t}\n\t}\n\n\t// Config to upload our server\n\tconfServerHttpTest = &http.Server{\n\n\t\tHandler: rTest,\n\t\tAddr: cfg.Host + \":4001\",\n\n\t\t// Good idea, good live!!!\n\t\t//WriteTimeout: 10 * time.Second,\n\t\t//ReadTimeout: 10 * time.Second,\n\t}\n\n\t// Defining whether it is https or http,\n\t// if it is http leave the calls\n\t// without access keys\n\tif cfg.Schema == \"https\" {\n\n\t\tgo func() {\n\n\t\t\tlog.Fatal(confServerHttps.ListenAndServeTLS(cfg.Pem, cfg.Key))\n\n\t\t}()\n\n\t\tlog.Fatal(confServerHttpTest.ListenAndServe())\n\n\t} else {\n\n\t\tgo func() { log.Fatal(confServerHttp.ListenAndServe()) }()\n\n\t\tlog.Fatal(confServerHttpTest.ListenAndServe())\n\t}\n}", "title": "" }, { "docid": "e85f134ee4e6e42036f98e391f97265e", "score": "0.5677102", "text": "func TestHandlePsbInfo(t *testing.T) {\n\n\t_, err := http.NewRequest(\"GET\", \"http://psb/info\", nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tts := httptest.NewServer(http.HandlerFunc(handlePsbInfo))\n\tdefer ts.Close()\n\n\tres, err := http.Get(ts.URL)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif res.StatusCode != http.StatusOK {\n\t\tt.Errorf(\"invalid status %d, expected %d\", res.StatusCode, http.StatusOK)\n\t}\n\n\tdec := json.NewDecoder(res.Body)\n\tvar psbInfoResult psbInfo\n\terr = dec.Decode(&psbInfoResult)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tres.Body.Close()\n\n\tif !reflect.DeepEqual(psbInfoResult, expectedPsbInfo) {\n\t\tt.Errorf(\"invalid psb Info returned: %v, want %v\", psbInfoResult, expectedPsbInfo)\n\t}\n}", "title": "" }, { "docid": "9944fa02b3a97cea704ac2be6e083a3d", "score": "0.566656", "text": "func pingHandler(formatter *render.Render) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, req *http.Request) {\n\t\tmessage := \"Burger Restaurant API Server Working on machine: \" + getSystemIp()\n\t\tformatter.JSON(w, http.StatusOK, struct{ Test string }{message})\n\t}\n}", "title": "" }, { "docid": "b01f57c2a7588398bd27ae54ebfab164", "score": "0.56468683", "text": "func TestBeego(t *testing.T) {\n\tr, _ := http.NewRequest(\"GET\", \"/\", nil)\n\tw := httptest.NewRecorder()\n\tbeego.BeeApp.Handlers.ServeHTTP(w, r)\n\n\tbeego.Trace(\"testing\", \"TestBeego\", \"Code[%d]\\n%s\", w.Code, w.Body.String())\n\n\tConvey(\"Subject: Test Station Endpoint\\n\", t, func() {\n\t Convey(\"Status Code Should Be 200\", func() {\n\t So(w.Code, ShouldEqual, 200)\n\t })\n\t Convey(\"The Result Should Not Be Empty\", func() {\n\t So(w.Body.Len(), ShouldBeGreaterThan, 0)\n\t })\n\t})\n}", "title": "" }, { "docid": "394b72c0b5c1202a81c7de0afb9cbac6", "score": "0.5632085", "text": "func (sh *SysHandler) Ping(rw http.ResponseWriter, req *http.Request) {}", "title": "" }, { "docid": "3519814a766ccea2785cb9809ff5c1f8", "score": "0.56296176", "text": "func TestHandler(w http.ResponseWriter, r *http.Request) {\n\ttErr := Templates.ExecuteTemplate(w, \"room\", nil)\n\tif tErr != nil {\n\t\tlog.Println(\"failed to execute '/meetings' template\", tErr)\n\t}\n}", "title": "" }, { "docid": "c0200a1940562202f1859849b7899725", "score": "0.5626287", "text": "func (sfClient *SFClient) TestPing(ctx context.Context, req *TestPingRequest) (*TestPingResult, *SdkError) {\n\tvar res TestPingResult\n\t_, err := sfClient.MakeSFCall(ctx, \"TestPing\", 1, req, &res)\n\treturn &res, err\n}", "title": "" }, { "docid": "83f89f6a748a5df0895d796246245a4a", "score": "0.5619045", "text": "func PingEndPoint(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintln(w, \"Jobs API is alive!\")\n}", "title": "" }, { "docid": "0c833e4493c7165f180bd944758cd6e7", "score": "0.5612679", "text": "func main() {\n // Create a client for access\n\tclient := testapi.Client()\n\t\n\tstatus, err := client.Status.Get()\n\tif err != nil {\n\t\tfmt.Println(\"Issue getting status information\", err)\n\t}\n\tfmt.Printf(\"List status: %+v\", status)\n}", "title": "" }, { "docid": "95d6a7def35ad54d4e8362f5179449fc", "score": "0.56121635", "text": "func (c Client) Test() error {\n\tresp, err := c.makerq(\"get_user\", url.Values{\n\t\t\"u\": []string{\n\t\t\t\"2\",\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar tr testResponse\n\terr = json.Unmarshal(resp, &tr)\n\t// Ignore cannot unmarshal stuff\n\tif err != nil && err.Error() != \"json: cannot unmarshal array into Go value of type osuapi.testResponse\" {\n\t\treturn err\n\t}\n\tif tr.Error != \"\" {\n\t\treturn errors.New(\"osuapi: \" + tr.Error)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "179f84c25c14a24f2f1d3d98a88ef032", "score": "0.55863494", "text": "func pingHandler(formatter *render.Render) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, req *http.Request) {\n\t\tc1 := NewClient(server1)\n\n\t\tmessage, err := c1.Ping()\n\n\t\tif message == \"OK\" {\n\t\t\tmessage = \"Cart API is working.\"\n\t\t}\n\n\t\tif err != nil {\n\t\t\tfmt.Println(\"[HANDLER DEBUG] \", err.Error())\n\t\t\treturn\n\t\t} else {\n\t\t\tformatter.JSON(w, http.StatusOK, message)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "068d4e9efd595561b508d51a24f438e2", "score": "0.5578785", "text": "func homePage( w http.ResponseWriter, r *http.Request ){\n\n //Indicates endpoint has been hit\n fmt.Fprintf( w, \"Welcome to the Zoo!\" )\n fmt.Println( \"Endpoint Hit: homePage\" )\n\n //Creates template and executes html\n\n\n}", "title": "" }, { "docid": "21ac0a88028c2ce235f002a239c052a3", "score": "0.55730665", "text": "func TestPostHandler(t *testing.T) {\n\n // ...\n\n}", "title": "" }, { "docid": "a46e981a3a9218534e1c65e1b856d136", "score": "0.5563476", "text": "func TestGetInfo(t *testing.T) {\n\tg := getRouter(true)\n\turi := \"api/v1/user/info\"\n\tw := util.PerformRequest(http.MethodGet, g, uri, tokenString)\n\t// 读取响应body\n\tvar data InfoResponse\n\n\tif err := json.Unmarshal([]byte(w.Body.String()), &data); err != nil {\n\t\tt.Errorf(\"Test Error: Get UserInfo Error:%s\", err.Error())\n\t}\n\tif w.Code != http.StatusOK {\n\t\tt.Errorf(\"Test Error: StatusCode Error:%d\", w.Code)\n\t}\n\n}", "title": "" }, { "docid": "8b9e709d35d605bd05bf25bde579dbb4", "score": "0.555163", "text": "func test(ctx echo.Context) error {\r\n\treturn ctx.String(http.StatusOK, \"Hello, World!\")\r\n}", "title": "" }, { "docid": "ef8a124b090aae7ab24170a1fd7d5c9f", "score": "0.5550473", "text": "func (test *ApiTest) Run() *ApiResult {\n\tstart := time.Now()\n\tresult := &ApiResult{\n\t\tName: test.Name,\n\t\tTimestamp: time.Now(),\n\t\tStatus: 500,\n\t\tTestID: test.ID,\n\t}\n\tresponse, err := http.DefaultClient.Get(test.URL)\n\tresult.Duration = time.Since(start)\n\tif err != nil {\n\t\tresult.Error = err.Error()\n\t\treturn result\n\t} else if response.StatusCode != http.StatusOK {\n\t\tdefer response.Body.Close()\n\t\tres, _ := ioutil.ReadAll(response.Body)\n\n\t\tresult.Error = string(res)\n\t}\n\tresult.Status = response.StatusCode\n\treturn result\n}", "title": "" }, { "docid": "5f0a9d7cb1acdc310e002a48e8adf465", "score": "0.55490863", "text": "func index(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\r\n\tw.WriteHeader(http.StatusOK)\r\n\tw.Write([]byte(\"<html><body style='font-family:Arial'><h1>Leaderboard Check API</h1></body></html>\"))\r\n}", "title": "" }, { "docid": "155774ccea549f67e6cba230480c4282", "score": "0.5545618", "text": "func handlerTestServer(w http.ResponseWriter, r *http.Request) {\n\n\t// get SearchRequest from r *http.Request\n\tlimit, err := strconv.Atoi(r.URL.Query()[\"limit\"][0])\n\toffset, err := strconv.Atoi(r.URL.Query()[\"offset\"][0])\n\tquery := r.URL.Query()[\"query\"][0]\n\torderFieldr := r.URL.Query()[\"order_field\"][0]\n\torderBy, err := strconv.Atoi(r.URL.Query()[\"order_by\"][0])\n\n\tsr := SearchRequest{\n\t\tLimit: limit,\n\t\tOffset: offset,\n\t\tQuery: query,\n\t\tOrderField: orderFieldr,\n\t\tOrderBy: orderBy,\n\t}\n\n\t// check SearchRequest field\n\tif sr.OrderField == \"\" {\n\t\tsr.OrderField = \"Name\"\n\t}\n\n\t// get users from a datasource\n\tusers, err := usersFromXML(\"dataset.xml\")\n\tif err != nil {\n\t\tfmt.Printf(\"error: %v\", err)\n\t\treturn\n\t}\n\n\t// get Users regarding to sr(SearchRequest)\n\toutputUsers := make([]User, 0)\n\tfor _, user := range users {\n\t\tif strings.Contains(user.Name, sr.Query) || strings.Contains(user.About, sr.Query) {\n\t\t\toutputUsers = append(outputUsers, user)\n\t\t}\n\t}\n\n\t// outputUsers -> json\n\tresultJSON, err := json.Marshal(outputUsers)\n\n\t// put outputUsers into a response body\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tw.Write(resultJSON)\n\n}", "title": "" }, { "docid": "39efc664ea84bb1ddf97bb00c20ac664", "score": "0.55345935", "text": "func (p *OAuthProxy) PingPage(rw http.ResponseWriter, _ *http.Request) {\n\trw.WriteHeader(http.StatusOK)\n\tfmt.Fprintf(rw, \"OK\")\n}", "title": "" }, { "docid": "9f53de2b8aeb57525800f0ec7ed0f045", "score": "0.5528393", "text": "func index(w http.ResponseWriter, r *http.Request) {\n\t// Only method GET is allowed\n\tif r.Method != http.MethodGet {\n\t\trespondWithError(w, http.StatusMethodNotAllowed, http.StatusText(http.StatusMethodNotAllowed))\n\t\tlog.Printf(\"%s / from %s status %d\\n\", r.Method, r.RemoteAddr, http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\t// Responds with API status\n\tresponse := models.MessageAPIM{\n\t\tMessage: \"API is up and running\",\n\t}\n\trespondWithJSON(w, http.StatusOK, response)\n\tlog.Printf(\"%s / from %s status %d\\n\", r.Method, r.RemoteAddr, http.StatusOK)\n}", "title": "" }, { "docid": "e0b0131794c7ed02d4f9682e2c6ab262", "score": "0.55209297", "text": "func pingHandler(w http.ResponseWriter, r *http.Request) {\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tlog.Printf(\"cannot read ping request body: %s\\n\", err)\n\t\thttp.Error(w, \"cannot read ping request body, check the server logs\\n\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tif len(body) > 0 {\n\t\tpingRequest := &PingRequest{}\n\t\terr = json.Unmarshal(body, pingRequest)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"cannot unmarshal ping request body: %s\\n\", err)\n\t\t\thttp.Error(w, \"cannot unmarshal ping request body, check the server logs\\n\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\t// if the ping request contains a job result\n\t\tif pingRequest.Result != nil {\n\t\t\t// persist the result of the job\n\t\t\terr = core.Api().CompleteJob(pingRequest.Result)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"cannot set job status: %s\\n\", err)\n\t\t\t\thttp.Error(w, \"set job status, check the server logs\\n\", http.StatusBadRequest)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\t// if the ping request contains syslog events\n\t\tif pingRequest.Events != nil && len(pingRequest.Events.Events) > 0 {\n\t\t\t// adds extra information to the events\n\t\t\tevents, err := core.Api().Augment(pingRequest.Events)\n\t\t\t// if the augmentation fails\n\t\t\tif err != nil && len(events.Events) > 0 {\n\t\t\t\t// log a warning but continue\n\t\t\t\tlog.Printf(\"WARNING: event augmentation failed for host uuid '%s': %s\", events.Events[0].HostUUID, err)\n\t\t\t}\n\t\t\t// publish those events to registered sources\n\t\t\tcore.Api().PublishEvents(events)\n\t\t}\n\t}\n\t// todo: add support for fx version\n\tjobId, fxKey, _, err := core.Api().Ping()\n\tif err != nil {\n\t\tlog.Printf(\"can't record ping time: %v\\n\", err)\n\t\thttp.Error(w, \"can't record ping time, check the server logs\\n\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// create a command with no job\n\tvar cmdValue = &CmdInfo{\n\t\tJobId: jobId,\n\t}\n\t// if we have a job to execute\n\tif jobId > 0 {\n\t\t// fetches the definition for the job function to run from Onix\n\t\tcmdValue, err = core.Api().GetCommandValue(fxKey)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"can't retrieve Artisan function definition from Onix: %v\\n\", err)\n\t\t\thttp.Error(w, \"can't retrieve Artisan function definition from Onix, check server logs\\n\", http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\t// set the job reference\n\t\tcmdValue.JobId = jobId\n\t}\n\tcr, err := NewPingResponse(*cmdValue, core.Api().PingInterval())\n\tif err != nil {\n\t\tlog.Printf(\"can't sign ping response: %v\\n\", err)\n\t\thttp.Error(w, \"can't sign ping response, check the server logs\\n\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\tbytes, err := json.Marshal(cr)\n\tif err != nil {\n\t\tlog.Printf(\"can't marshal ping response: %s\\n\", err)\n\t\thttp.Error(w, \"can't marshal ping response, check the server logs\\n\", http.StatusInternalServerError)\n\t}\n\tw.WriteHeader(http.StatusCreated)\n\tw.Write(bytes)\n}", "title": "" }, { "docid": "82affc928016bc75d1a2b829b71d33df", "score": "0.5517832", "text": "func ping(ctx iris.Context) {\n\trender.JSON(ctx, 200, map[string]interface{}{\n\t\t\"message\": \"Parrot says hello.\",\n\t})\n}", "title": "" }, { "docid": "5fd3521044e895fbfbff48956d53f464", "score": "0.549287", "text": "func (a *APIController) Test(res http.ResponseWriter, req *http.Request) {\r\n\tfmt.Fprintf(res, \"Hello, you've requested: %s\\n\", req.URL.Path)\r\n}", "title": "" }, { "docid": "1027d0d77dc4d15b33775ef776b323bd", "score": "0.5477772", "text": "func TestShowIndexPageUnauthenticated(t *testing.T) {\n r := getRouter(true)\n\n r.GET(\"/\", showIndexPage)\n\n // Create a request to send to the above route\n req, _ := http.NewRequest(\"GET\", \"/\", nil)\n\n testHTTPResponse(t, r, req, func(w *httptest.ResponseRecorder) bool {\n // Test that the http status code is 200\n statusOK := w.Code == http.StatusOK\n\n // Test that the page title is \"Home Page\"\n // You can carry out a lot more detailed tests using libraries that can\n // parse and process HTML pages\n p, err := ioutil.ReadAll(w.Body)\n pageOK := err == nil && strings.Index(string(p), \"<title>Cloud Spider</title>\") > 0\n\n return statusOK && pageOK\n })\n}", "title": "" }, { "docid": "8e49bea90e843f3cbb73bc64cd5ebdd8", "score": "0.5467969", "text": "func TestPing(t *testing.T) {\n\tresult, err := makeRequest(c, \"PING\", []string{})\n\tif err != nil {\n\t\tt.Error(\"Error on PING command: \", err.Error())\n\t}\n\n\tif result != \"Pong!\" {\n\t\tt.Error(\"Wrong PING response: \", result)\n\t}\n}", "title": "" }, { "docid": "c683e635ffc3763051d721242e8c62b8", "score": "0.54653764", "text": "func TestProviderControlService_GetListInProgress(t *testing.T) {\n\n}", "title": "" }, { "docid": "394ac6f844c63f48c05dbc9df919550e", "score": "0.5448995", "text": "func (r *Rabbit) AlivenessTest(vhost string) error {\n\tif vhost == \"/\" {\n\t\tvhost = \"%2f\"\n\t}\n\n\tbody, err := r.doRequest(\"GET\", \"/api/aliveness-test/\"+vhost, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstatus := Status{}\n\terr = json.Unmarshal(body, &status)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif status.Status != \"ok\" {\n\t\treturn fmt.Errorf(\"there is a problem on vhost '%s'\", vhost)\n\t}\n\treturn nil\n\n}", "title": "" }, { "docid": "dffc390b9c19f9768f3c1d3f0d771dcd", "score": "0.54448", "text": "func (engine *Engine) Ping(handler HandlerFunc) {\n\tengine.GET(\"/ping\", handler)\n}", "title": "" }, { "docid": "f530635eb28d02cd73b8606758cfbcc8", "score": "0.54093516", "text": "func TestGet(t *testing.T) {\n\t//k8s.TestCreateDeploy()\n\t//fmt.Println(\"fererererer\")\n\t//k8s.TestJsonAndObj()\n\tk8s.TestK8sUtil()\n\n}", "title": "" }, { "docid": "525c628b44567d33188bb43c35fc770c", "score": "0.540123", "text": "func main() {\n\t// Calling `New()` from `pester` package to create an http client. Notice that by using the\n\t// `:=` notation the type of the variable will be inferred.\n\thttpClient := pester.New()\n\n\t// Setting the struct's attribute.\n\thttpClient.Backoff = linearBackoff\n\n\t// Functions in Go can return multiple values. The last returned value is usually an error\n\t// value. Go has an in-built `error` type for errors. Go handles errors in code via values\n\t// which can be easily passed around and modified while they can't be accidentally ignored.\n\t// There is a `panic` in-built function which has a behaviour similar to exceptions in other\n\t// languages but should be rarely used.\n\thttpResponse, err := httpClient.Get(yesNoURL)\n\t// `if err != nil` is the usual Go idiom to check whether the previous\n\t// function call was successful.\n\tif err != nil {\n\t\tlog.Fatal(\n\t\t\terrors.WithMessage(err, \"HTTP get towards yesno API\"),\n\t\t)\n\t}\n\n\tbodyContent, err := ioutil.ReadAll(httpResponse.Body)\n\tif err != nil {\n\t\tlog.Fatal(\n\t\t\terrors.WithMessage(err, \"reading body of yesno API response\"),\n\t\t)\n\t}\n\n\t// If not explicitly initialised values in Go are zero-initialised by default.\n\t// e.g. ints will be 0, bools will be false, strings will be empty...\n\tvar decodedContent yesNoResponse\n\n\t// Go has pointers in order to give explicit control to the programmer regarding\n\t// pass-by-value and pass-by-reference. There is no pointer arithmetic in Go.\n\t// Well, there is pointer arithmetic via the `unsafe` package but you probably never need it.\n\terr = json.Unmarshal(bodyContent, &decodedContent)\n\tif err != nil {\n\t\tlog.Fatal(\n\t\t\terrors.WithMessage(err, \"unmarshalling the JSON body content\"),\n\t\t)\n\t}\n\n\t// Go support some interesting verbs in `printf` (and similar functions) like `%v` here.\n\t// `%v` prints the whole contents of the struct.\n\tlog.Printf(\"Response from yesno: %v\", decodedContent)\n}", "title": "" }, { "docid": "51f716745550f8b8d10a940de4c3fbc5", "score": "0.53886694", "text": "func echo() {\n\n\turl := \"http://golangappnode1.appspot.com/status\"\n\n\tvar jsonStr = []byte(`{\"msg\":\"Hello!\"}`)\n\treq, err := http.NewRequest(\"POST\", url, bytes.NewBuffer(jsonStr))\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer resp.Body.Close()\n\n\tbody, _ := ioutil.ReadAll(resp.Body)\n\tstatusContent = string(body)\n\n}", "title": "" }, { "docid": "03307f7ce8c0e15292e2b892c2cb84d2", "score": "0.53827864", "text": "func API(w http.ResponseWriter, r *http.Request) {\n\tvar f = mux.Vars(r)[\"name\"]\n\tswitch f {\n\tcase \"ping\":\n\t\tr.ParseForm()\n\t\thost := r.FormValue(\"host\")\n\t\tp, err := icmp.NewPing(host + \" -c 1\")\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tresp := p.Run()\n\t\tr := <-resp\n\t\tw.Write([]byte(fmt.Sprintf(`{\"rtt\": %.2f,\"pl\":0}`, r.RTT)))\n\t}\n}", "title": "" }, { "docid": "85198840253428e2e6e1392d3b686cec", "score": "0.5379171", "text": "func Check(w http.ResponseWriter, r *http.Request) {\n\tif r.URL.Path != \"/\" {\n\t\thttp.NotFound(w, r)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(\"TEST Health\"))\n}", "title": "" }, { "docid": "6c054ec5ca2a493eb57cc5cf07b5acf8", "score": "0.53690237", "text": "func TestPost201Response(t *testing.T) {\n\tt.Parallel()\n\n\tts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusCreated)\n\t}))\n\n\tdefer ts.Close()\n\n\tc := &APIClient{\n\t\tBaseURL: ts.URL,\n\t\tClient: ts.Client(),\n\t}\n\n\t_, err := c.PingSuccess(TestHandle, TestPingParamsWithRIDCreate, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"expected successful Ping, got error: %+v\", err)\n\t}\n}", "title": "" }, { "docid": "df60ba55d1b9c65e41d1a9e7ca52582f", "score": "0.53623676", "text": "func Setup(server *echo.Echo) {\n\n\tserver.GET(\"/\", handlers.Healthcheck)\n\n}", "title": "" }, { "docid": "f2d80d4df35d6e21117e89529c2e81cf", "score": "0.5352492", "text": "func RunTestAPI(c *cli.Context) {\n\tm := martini.Classic()\n\tm.Use(render.Renderer(render.Options{\n\t\tIndentJSON: true, // Output human readable JSON\n\t}))\n\tm.Post(\"/wal-e/api\", binding.Bind(config.ContainerStartupRequest{}), func(req config.ContainerStartupRequest, r render.Render) {\n\t\tfmt.Printf(\"Recv [wal-e]: container start request: %v\\n\", req)\n\t\tname := \"patroni1\"\n\t\tpatroniScope := \"test-cluster-scope\"\n\t\twaleEnvVars := constructReturnedEnvVars(patroniScope, filterWaleEnvVars())\n\t\tstaticResponse := map[string]interface{}{\n\t\t\t\"cluster\": map[string]interface{}{\n\t\t\t\t\"name\": name,\n\t\t\t\t\"scope\": patroniScope,\n\t\t\t},\n\t\t\t\"wale_env\": waleEnvVars,\n\t\t\t// Example:\n\t\t\t// \tAWS_ACCESS_KEY_ID=AWS_ACCESS_KEY_ID\n\t\t\t// \tAWS_SECRET_ACCESS_KEY=AWS_SECRET_ACCESS_KEY\n\t\t\t// \tWAL_S3_BUCKET=WAL_S3_BUCKET\n\t\t\t// \tWALE_S3_ENDPOINT=https+path://s3.amazonaws.com:443\n\t\t\t// \tWALE_S3_PREFIX=s3://${WAL_S3_BUCKET}/backups/test-cluster-scope/wal/\n\t\t\t\"postgresql\": map[string]interface{}{\n\t\t\t\t\"admin\": map[string]interface{}{\n\t\t\t\t\t\"password\": \"admin-password\",\n\t\t\t\t},\n\t\t\t\t\"superuser\": map[string]interface{}{\n\t\t\t\t\t\"username\": \"superuser-username\",\n\t\t\t\t\t\"password\": \"superuser-password\",\n\t\t\t\t},\n\t\t\t\t\"appuser\": map[string]interface{}{\n\t\t\t\t\t\"username\": \"appuser-username\",\n\t\t\t\t\t\"password\": \"appuser-password\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"etcd\": map[string]interface{}{\n\t\t\t\t\"uri\": os.Getenv(\"ETCD_URI\"),\n\t\t\t\t\"host\": os.Getenv(\"ETCD_HOST\"),\n\t\t\t\t\"port\": os.Getenv(\"ETCD_PORT\"),\n\t\t\t\t\"protocol\": os.Getenv(\"ETCD_PROTOCOL\"),\n\t\t\t\t\"username\": os.Getenv(\"ETCD_USERNAME\"),\n\t\t\t\t\"password\": os.Getenv(\"ETCD_PASSWORD\"),\n\t\t\t},\n\t\t}\n\t\tr.JSON(200, staticResponse)\n\t})\n\tif os.Getenv(\"RSYNC_HOSTNAME\") != \"\" && os.Getenv(\"RSYNC_PRIVATE_KEY\") != \"\" {\n\t\tm.Post(\"/rsync-backup/api\", binding.Bind(config.ContainerStartupRequest{}), func(req config.ContainerStartupRequest, r render.Render) {\n\t\t\tfmt.Printf(\"Recv [rsync-backup]: container start request: %v\\n\", req)\n\t\t\tname := \"patroni3RsyncBackup\"\n\t\t\tpatroniScope := \"rsync-backup-cluster-scope\"\n\t\t\tstaticResponse := map[string]interface{}{\n\t\t\t\t\"cluster\": map[string]interface{}{\n\t\t\t\t\t\"name\": name,\n\t\t\t\t\t\"scope\": patroniScope,\n\t\t\t\t},\n\t\t\t\t\"rsync_archives\": rsyncArchiveTarget(),\n\t\t\t\t// Example:\n\t\t\t\t// \tAWS_ACCESS_KEY_ID=AWS_ACCESS_KEY_ID\n\t\t\t\t// \tAWS_SECRET_ACCESS_KEY=AWS_SECRET_ACCESS_KEY\n\t\t\t\t// \tWAL_S3_BUCKET=WAL_S3_BUCKET\n\t\t\t\t// \tWALE_S3_ENDPOINT=https+path://s3.amazonaws.com:443\n\t\t\t\t// \tWALE_S3_PREFIX=s3://${WAL_S3_BUCKET}/backups/test-cluster-scope/wal/\n\t\t\t\t\"postgresql\": map[string]interface{}{\n\t\t\t\t\t\"admin\": map[string]interface{}{\n\t\t\t\t\t\t\"password\": \"admin-password\",\n\t\t\t\t\t},\n\t\t\t\t\t\"superuser\": map[string]interface{}{\n\t\t\t\t\t\t\"username\": \"superuser-username\",\n\t\t\t\t\t\t\"password\": \"superuser-password\",\n\t\t\t\t\t},\n\t\t\t\t\t\"appuser\": map[string]interface{}{\n\t\t\t\t\t\t\"username\": \"appuser-username\",\n\t\t\t\t\t\t\"password\": \"appuser-password\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"etcd\": map[string]interface{}{\n\t\t\t\t\t\"uri\": os.Getenv(\"ETCD_URI\"),\n\t\t\t\t\t\"host\": os.Getenv(\"ETCD_HOST\"),\n\t\t\t\t\t\"port\": os.Getenv(\"ETCD_PORT\"),\n\t\t\t\t\t\"protocol\": os.Getenv(\"ETCD_PROTOCOL\"),\n\t\t\t\t\t\"username\": os.Getenv(\"ETCD_USERNAME\"),\n\t\t\t\t\t\"password\": os.Getenv(\"ETCD_PASSWORD\"),\n\t\t\t\t},\n\t\t\t}\n\t\t\tr.JSON(200, staticResponse)\n\t\t})\n\t}\n\tm.Run()\n}", "title": "" }, { "docid": "e99bd96b2e4f0b3a68cbbeb2a0448c8b", "score": "0.53481454", "text": "func Ping(c echo.Context) error {\n\treturn c.JSON(http.StatusOK, echo.Map{\"message\": \"pong\"})\n}", "title": "" }, { "docid": "e99bd96b2e4f0b3a68cbbeb2a0448c8b", "score": "0.53481454", "text": "func Ping(c echo.Context) error {\n\treturn c.JSON(http.StatusOK, echo.Map{\"message\": \"pong\"})\n}", "title": "" }, { "docid": "25f69d81078dc67d0efe6cef88af5a28", "score": "0.5343123", "text": "func TestHandlers_State(t *testing.T) {\n\th := NewHandlers(apiMgr)\n\th.manager = mockApiManager.MockApiManager{}\n\trr := requestFixture(h.Application, \"GET\", \"/app?name=test\", nil)\n\tif rr.Code != http.StatusOK {\n\t\tt.Fatalf(\"Wrong status code: want %d but got %d\", http.StatusOK, rr.Code)\n\t}\n}", "title": "" }, { "docid": "ce8dcaf22c1d9dfd96e56aee6a980412", "score": "0.5340426", "text": "func pingHandler(w http.ResponseWriter, r *http.Request) {\n\tw.Write([]byte(\"pong\\n\"))\n}", "title": "" }, { "docid": "bc376a16adb96afa650de27c67cf9201", "score": "0.53348607", "text": "func homePage(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprint(w, \"Welcome to the Homepage\")\n\tfmt.Println(\"Endpoint Hit: homePage\")\n}", "title": "" }, { "docid": "7bbe68aba1e03aab84804bb2a2b139df", "score": "0.53346384", "text": "func Ping(w http.ResponseWriter, r *http.Request) {\n\t// Just a sanity check\n\tif r.Method != http.MethodGet {\n\t\tw.WriteHeader(http.StatusNotFound)\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\tfmt.Fprintln(w, \"OK\")\n}", "title": "" }, { "docid": "1df4547f6b56ea26325f2eb4e1c1efb6", "score": "0.53342783", "text": "func (m *Client) Ping() error {\n\n\turl, err := url.Parse(\"/api/health\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq, err := m.client.Get(m.url.ResolveReference(url).String())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to query monitoring url: %w\", err)\n\t}\n\tdefer req.Body.Close() //nolint\n\tif req.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"monitoring doesnt seems helhty: return code %d\", req.StatusCode)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8eeb4d2d8eeecdcc4c98fe25014dc9cc", "score": "0.5327461", "text": "func Index(w http.ResponseWriter, r *http.Request) {\n\tlog.Debug(\"/ endpoint called\")\n\tw.Write([]byte(\"OK\"))\n}", "title": "" }, { "docid": "a55a270789205ead3d46080782f57fe7", "score": "0.5319278", "text": "func (c *Client) Ping(url string) error {\n\treq, err := http.NewRequest(\"POST\", url+\"/v1/_ping\", nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, statusCode, err := c.doRequest(req)\n\tif statusCode == http.StatusOK {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"Ping failed, statusCode: %d, error: %v\", statusCode, err)\n}", "title": "" }, { "docid": "9e8755ef9b4d80a4d175b2b145cc414f", "score": "0.53110075", "text": "func route_ping(w http.ResponseWriter, r *http.Request) {\n respBody := fmt.Sprintf(\"route_ping: hello %s\\n\", r.RemoteAddr)\n\n metrics_demoapp_requests++\n metrics_demoapp_response_bytes+=len(respBody)\n w.Write([]byte(respBody))\n}", "title": "" }, { "docid": "fdd3b1542aeca0ed1fa4239af6a11524", "score": "0.53091574", "text": "func TestServer(t *testing.T) {\n\toptions := requests.Options{\n\t\tUrl: \"/health-check\",\n\t\tMethod: \"GET\",\n\t}\n\tclient.NewRequest(options)\n\tres, err := client.Send()\n\tif err != nil{\n\t\tt.Fatalf(\"failed make a get request to server - %+v\", err)\n\t}\n\tt.Logf(\"server is wokring statusCode - %d\", res.GetStatusCode())\n}", "title": "" }, { "docid": "5a3c8bf199a37134d6fc1ac943ddb898", "score": "0.5306401", "text": "func PingHandler(w http.ResponseWriter, r *http.Request) {\r\n\tw.Header().Set(\"Context-Type\", \"application/x-www-form-urlencoded\")\r\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\r\n\tfmt.Println(\"Ping handler!\")\r\n\tpayload := struct{ Test string }{\"API version 1.0 alive!\"}\r\n\tjson.NewEncoder(w).Encode(payload)\r\n}", "title": "" }, { "docid": "fd71e1047fbde84e7ebb51a55abb6478", "score": "0.5306242", "text": "func homePage(w http.ResponseWriter, r *http.Request){\n fmt.Fprintf(w, \"Welcome to the HomePage!\")\n fmt.Println(\"Endpoint Hit: homePage\")\n}", "title": "" }, { "docid": "6cc184616f3e1313ad65e99143bca6e5", "score": "0.530121", "text": "func (a Adapter) ShowTest(id mockingbird.ULID) (code int, body []byte, err error) {\n\ttest, err := a.App.ShowTest(id)\n\tif errs.IsNotFound(err) {\n\t\treturn http.StatusNotFound, a.Tmpl.ErrorNotFound(), err\n\t}\n\tif err != nil {\n\t\treturn http.StatusInternalServerError, a.Tmpl.InternalError(), err\n\t}\n\tb, err := a.Tmpl.ShowTest(test)\n\tif err != nil {\n\t\treturn http.StatusInternalServerError, a.Tmpl.InternalError(), err\n\t}\n\n\treturn 200, b, nil\n}", "title": "" }, { "docid": "404e27b57f728263dd41bcc3e92d7836", "score": "0.5290247", "text": "func testingHandler(fail bool) Handler {\n\treturn func(inf *APIInfo) (int, error, error) {\n\t\tif fail {\n\t\t\treturn http.StatusBadRequest, errors.New(\"testing user error\"), errors.New(\"testing system error\")\n\t\t}\n\t\treturn http.StatusOK, nil, nil\n\t}\n}", "title": "" }, { "docid": "5aa3638555a092832c89cf8398221545", "score": "0.52901983", "text": "func Ping(c *gin.Context) {\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"data\": \"pong\",\n\t})\n\treturn\n}", "title": "" }, { "docid": "ba28fe0331b5f2502af86a9e5760a1c6", "score": "0.5288018", "text": "func HomePagePing(w http.ResponseWriter, r *http.Request) {\r\n\tfmt.Fprintf(w, \"Welcome to the HomePage!\")\r\n}", "title": "" }, { "docid": "758cb45a6890f0bf876a2e91f8467766", "score": "0.52681464", "text": "func (c *V2CommonController) Ping(writer http.ResponseWriter, request *http.Request) {\n\tresponse := common.NewPingResponse()\n\tc.sendResponse(writer, request, contractsV2.ApiPingRoute, response, http.StatusOK)\n}", "title": "" }, { "docid": "1462966adbe00f1c78d6a82d4a9656fd", "score": "0.5268012", "text": "func TestSearchHandler(t *testing.T) {\n\tt.Log(\"Given the need to test the SearchHandler endpoint.\")\n\t{\n\t\turl := \"/api/payment/transaction\"\n\t\tt.Logf(\"\\tWhen checking \\\"%s\\\" \", url)\n\t\t{\n\t\t\treq, err := http.NewRequest(\"GET\", url, nil)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(\"\\t\\tShould be able to create a request.\", ballotX, err)\n\t\t\t}\n\t\t\tt.Log(\"\\t\\tShould be able to create a request.\", checkMark)\n\n\t\t\tw := httptest.NewRecorder()\n\t\t\thttp.DefaultServeMux.ServeHTTP(w, req)\n\n\t\t\tif w.Code != 200 {\n\t\t\t\tt.Fatal(\"\\t\\tShould receive \\\"200\\\"\", ballotX, w.Code)\n\t\t\t}\n\t\t\tt.Log(\"\\t\\tShould receive \\\"200\\\"\", checkMark)\n\n\t\t\tresult := []search.Result{}\n\t\t\tif err := json.NewDecoder(w.Body).Decode(&result); err != nil {\n\t\t\t\tt.Fatal(\"\\t\\tShould decode the response.\", ballotX)\n\t\t\t}\n\t\t\tt.Log(\"\\t\\tShould decode the response.\", checkMark)\n\n\t\t\tif len(result) == 15 {\n\t\t\t\tt.Log(\"\\t\\tShould have data array of length of 15 .\", checkMark)\n\t\t\t} else {\n\t\t\t\tt.Error(\"\\t\\tShould have data array of length of 15 .\", ballotX)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d06b1cf8425f727484308c883121648e", "score": "0.5267973", "text": "func TestPingHandler_ShouldReturnAnswer(t *testing.T) {\n\treq, err := http.NewRequest(\"GET\", \"/ping\", nil)\n\tassert.Nil(t, err, \"Http request failed\")\n\trecorder := httptest.NewRecorder()\n\thttp.HandlerFunc(PingHandler).ServeHTTP(recorder, req)\n\tassert.Equal(t, plaintext, recorder.HeaderMap.Get(\"Content-type\"))\n\tassert.Equal(t, http.StatusOK, recorder.Code)\n\tassert.Equal(t, \"pong\", string(recorder.Body.Bytes()))\n}", "title": "" }, { "docid": "3dcf53964903abba2a9b0ae156c9e833", "score": "0.5262914", "text": "func testGetStats() bool {\n\n\t/*\n\t** Wait five second prior to sending the GET request\n\t */\n\ttime.Sleep(5000 * time.Millisecond)\n\n\tlog.Println(\"Starting GET /stats testGetStats\")\n\tresp, err := http.Get(\"http://localhost:8080/stats\")\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tdefer resp.Body.Close()\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tlog.Println(string(body))\n\n\tif strings.Contains(string(body), MultipleStatsResponse) {\n\t\tlog.Printf(\"GET /stats testGetStats test passed\\n\\n\")\n\t\treturn true\n\t} else {\n\t\tlog.Printf(\"GET /stats testGetStats test failed.\\n Expected: %s\\n\", SingleStatsResponse)\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "bfd436775c024232471e2cfbf9547245", "score": "0.52601296", "text": "func Ping(c *gin.Context) {\n\tc.JSON(http.StatusOK, PingResponse{Pong: \"OK\"})\n}", "title": "" }, { "docid": "2b76be39d7b31b687e4e0e4073ffd44e", "score": "0.52524674", "text": "func httpIndex(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintln(w, \"CNC Milling Machine REST Server\")\n}", "title": "" }, { "docid": "1b31feb71ea3bfdae41e560de3eccd28", "score": "0.52517396", "text": "func TestSearchCourseSuccess(t *testing.T) {\n\n\t_ = config.SetConfigurationFromFile(\"../../../config/config-test.json\")\n\n\t// generate a token to be appended to the request\n\tuser := microservice.User{Name: \"nome\", Surname: \"cognome\", Username: \"username\", Password: \"password\", Type: \"teacher\", Mail: \"name@example.com\"}\n\ttoken, _ := microservice.GenerateAccessToken(user, []byte(config.Configuration.TokenPrivateKey))\n\n\t// Make the get request for course searching\n\trequest, _ := http.NewRequest(http.MethodGet, \"/didattica-mobile/api/v1.0/courses/name/seq\", nil)\n\trequest.Header.Set(\"Content-Type\", \"application/json\")\n\trequest.AddCookie(&http.Cookie{Name: \"token\", Value: token})\n\n\tresponse := httptest.NewRecorder()\n\thandler := createTestGatewaySearchCourse()\n\t// a goroutine representing the microservice listens to the requests coming from the api gateway\n\tgo mock.LaunchCourseManagementMock()\n\t// simulates a request-response interaction between client and api gateway\n\thandler.ServeHTTP(response, request)\n\n\tif response.Code != http.StatusOK {\n\t\tt.Error(\"Expected 200 OK but got \" + strconv.Itoa(response.Code) + \" \" + http.StatusText(response.Code))\n\t}\n\n}", "title": "" }, { "docid": "af7feb3e7001b165c2d96f3319abfddd", "score": "0.52497894", "text": "func Ping() (string, int) {\n\tlogger := app.InitLogger()\n\tlogger.Info(\"Ping endpoint called\")\n\treturn \"pong\", http.StatusOK\n}", "title": "" }, { "docid": "b26c68b2681d934760f7713d11ae4590", "score": "0.5247146", "text": "func TestHealthCheck(t *testing.T) {\n req, err := http.NewRequest(\"GET\", \"/\", nil)\n\n if err != nil {\n t.Errorf(\"An error occurred. %v\", err)\n }\n\n rr := httptest.NewRecorder()\n handler := http.HandlerFunc(greeting)\n\n handler.ServeHTTP(rr, req)\n\n if status := rr.Code; status != http.StatusOK {\n t.Errorf(\"Handler returned wrong status code. Got %v, want %v\", status, http.StatusOK)\n }\n\n\n dt := time.Now()\n expected := fmt.Sprintf(\"Hello! Welcome to my containerized web server in Golang!\\nToday's date and time is: %s\", dt.Format(\"02-01-2006 15:04:05 Monday\"))\n if rr.Body.String() != expected {\n t.Errorf(\"Handler returned incorrect body: Got %v, want %v\", rr.Body.String(), expected)\n }\n}", "title": "" }, { "docid": "6e30b52db5b9854330117fdb9ecb0ea4", "score": "0.5247116", "text": "func (c *Client) Ping() error {\n\turl := c.resource(\"index\", nil)\n\n\treq, err := c.request(\"GET\", url.String())\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = c.send(req)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e8bc1999bdcb3b4d9495b1437c1e47f2", "score": "0.52467406", "text": "func Test() {\n\tfmt.Printf(\"test\\n\")\n\tc := &http.Client{\n\t\tTimeout: time.Second * 2}\n\n\t_, err := c.Get(\"http://1.1.1.1\")\n\tif err != nil {\n\t\tfmt.Printf(\"err : %s\\n\", err.Error())\n\t\tnerr := err.(net.Error)\n\t\tif nerr.Timeout() {\n\t\t\tfmt.Printf(\"timeout\\n\")\n\t\t}\n\t\treturn\n\t}\n\n}", "title": "" }, { "docid": "f3451acc1ce78c9c9ef7cd6a512d0f72", "score": "0.5246182", "text": "func HandlePing(ctx context.Context, w http.ResponseWriter, r *http.Request) {\n\tlogWrite(w, http.StatusOK, []byte(\"OK\"))\n}", "title": "" }, { "docid": "4db5dba28f8e3225ebe6deaf066e24d2", "score": "0.5244505", "text": "func TestMain(m *testing.M) {\n\thttpServer = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tdata, _ := ioutil.ReadAll(r.Body)\n\t\tdefer r.Body.Close()\n\t\t// put request and body to channel for the client to investigate them\n\t\trequestChan <- &RequestData{r, string(data)}\n\n\t\tfmt.Fprintf(w, responseBody)\n\t}))\n\tdefer httpServer.Close()\n\n\tos.Exit(m.Run())\n}", "title": "" }, { "docid": "4e86b8b8eb35df730cbd387b4f3c7110", "score": "0.5243951", "text": "func TestStandalonePages(t *testing.T) {\n\tsrv, err := NewServer()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsrv.SetupRoutes()\n\tbase := fmt.Sprintf(\"http://localhost:%d\", srv.Port)\n\tfor _, route := range []string{\"/\", \"/about\", \"/now\"} {\n\t\turl := fmt.Sprintf(\"%s%s\", base, route)\n\t\tr := httptest.NewRequest(\"GET\", url, nil)\n\t\tw := httptest.NewRecorder()\n\t\tsrv.ServeHTTP(w, r)\n\t\tif w.Result().StatusCode != http.StatusOK {\n\t\t\tt.Errorf(\"url %s: got status code %d; want %d\", url, w.Result().StatusCode, http.StatusOK)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c5eab9e267c9806015224eae8669c701", "score": "0.5241656", "text": "func TestApi(t *testing.T) {\n\n\tconvey.Convey(\"Given the Index handler\", t, func() {\n\t\thandler := Index()\n\n\t\tconvey.Convey(\"When I send a GET request\", func() {\n\t\t\treq := newGETRequest()\n\t\t\tw := httptest.NewRecorder()\n\t\t\thandler.ServeHTTP(w, req)\n\n\t\t\tconvey.Convey(\"Then then it should return status 200 OK\", func() {\n\t\t\t\tconvey.So(w.Code, convey.ShouldEqual, 200)\n\t\t\t\tconvey.So(w.Header().Get(\"Content-Type\"), convey.ShouldEqual, \"application/json; charset=UTF-8\")\n\t\t\t})\n\t\t})\n\t})\n\n\tconvey.Convey(\"Given an object\", t, func() {\n\t\tunit := map[string]interface{}{\n\t\t\t\"name\": \"test-unit\",\n\t\t\t\"body\": map[string]interface{}{\n\t\t\t\t\"foo\": \"bar\",\n\t\t\t},\n\t\t}\n\n\t\tconvey.Convey(\"When I pass it to the JSON handler\", func() {\n\t\t\tw := httptest.NewRecorder()\n\t\t\tJSON(w, unit)\n\n\t\t\tconvey.Convey(\"Then then it should return status 200 OK\", func() {\n\t\t\t\tconvey.So(w.Code, convey.ShouldEqual, 200)\n\t\t\t\tconvey.So(w.Header().Get(\"Content-Type\"), convey.ShouldEqual, \"application/json; charset=UTF-8\")\n\t\t\t})\n\t\t})\n\n\t\tconvey.Convey(\"When I pass an unsupported type to the JSON handler\", func() {\n\t\t\tcallJSON := func() {\n\t\t\t\tw := httptest.NewRecorder()\n\t\t\t\tJSON(w, func() {})\n\t\t\t}\n\t\t\tconvey.Convey(\"Then then it should panic\", func() {\n\t\t\t\tconvey.So(callJSON, convey.ShouldPanic)\n\t\t\t})\n\t\t})\n\n\t\tconvey.Convey(\"When I pass it to the Created handler\", func() {\n\t\t\tw := httptest.NewRecorder()\n\t\t\tCreated(w, unit)\n\n\t\t\tconvey.Convey(\"Then then it should return status 201 OK\", func() {\n\t\t\t\tconvey.So(w.Code, convey.ShouldEqual, 201)\n\t\t\t\tconvey.So(w.Header().Get(\"Content-Type\"), convey.ShouldEqual, \"application/json; charset=UTF-8\")\n\t\t\t})\n\t\t})\n\t})\n\n\tconvey.Convey(\"Given an error message\", t, func() {\n\t\tmessage := \"Test Error\"\n\n\t\tconvey.Convey(\"When I pass it to the BadRequest handler\", func() {\n\t\t\tw := httptest.NewRecorder()\n\t\t\tBadRequest(w, message)\n\n\t\t\tconvey.Convey(\"Then then it should return status 400 Bad Request\", func() {\n\t\t\t\tconvey.So(w.Code, convey.ShouldEqual, 400)\n\t\t\t\tconvey.So(w.Header().Get(\"Content-Type\"), convey.ShouldEqual, \"text/plain\")\n\t\t\t})\n\t\t})\n\n\t\tconvey.Convey(\"When I pass it to the ServerError handler\", func() {\n\t\t\tw := httptest.NewRecorder()\n\t\t\tServerError(w, message)\n\n\t\t\tconvey.Convey(\"Then then it should return status 500 Internal Error\", func() {\n\t\t\t\tconvey.So(w.Code, convey.ShouldEqual, 500)\n\t\t\t\tconvey.So(w.Header().Get(\"Content-Type\"), convey.ShouldEqual, \"text/plain\")\n\t\t\t})\n\t\t})\n\t})\n\n\tconvey.Convey(\"When I call the Deleted handler\", t, func() {\n\t\tw := httptest.NewRecorder()\n\t\tDeleted(w)\n\n\t\tconvey.Convey(\"Then then it should return status 204 No Content\", func() {\n\t\t\tconvey.So(w.Code, convey.ShouldEqual, 204)\n\t\t\tconvey.So(w.Header().Get(\"Content-Type\"), convey.ShouldEqual, \"\")\n\t\t})\n\t})\n\n\tconvey.Convey(\"When I call the Not Found handler\", t, func() {\n\t\tw := httptest.NewRecorder()\n\t\tNotFound(w)\n\n\t\tconvey.Convey(\"Then then it should return status 404 Not Found\", func() {\n\t\t\tconvey.So(w.Code, convey.ShouldEqual, 404)\n\t\t\tconvey.So(w.Header().Get(\"Content-Type\"), convey.ShouldEqual, \"text/plain\")\n\t\t})\n\t})\n\n\tconvey.Convey(\"When I call the Duplicate Error handler\", t, func() {\n\t\tw := httptest.NewRecorder()\n\t\tDuplicateError(w)\n\n\t\tconvey.Convey(\"Then then it should return status 409 Conflict\", func() {\n\t\t\tconvey.So(w.Code, convey.ShouldEqual, 409)\n\t\t\tconvey.So(w.Header().Get(\"Content-Type\"), convey.ShouldEqual, \"text/plain\")\n\t\t})\n\t})\n}", "title": "" }, { "docid": "9bf8387314035e6a4ac21d389a7119ea", "score": "0.5238236", "text": "func (a App) ping(w *framework.Response, r *framework.Request) {\n\t//go:generate echo hello form ping\n\ta.Log.Info(\"hello from the log side\")\n\tw.Message(\"pong\")\n}", "title": "" }, { "docid": "8b5df8246df2b023db564151fba07521", "score": "0.5236478", "text": "func homePage(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"Welcome to the HomePage!\")\n\tfmt.Println(\"Endpoint Hit: homePage\")\n}", "title": "" }, { "docid": "8b5df8246df2b023db564151fba07521", "score": "0.5236478", "text": "func homePage(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"Welcome to the HomePage!\")\n\tfmt.Println(\"Endpoint Hit: homePage\")\n}", "title": "" }, { "docid": "d2e7c9e600660fda9117cf9c760c8cb2", "score": "0.52338934", "text": "func MethodPing(w http.ResponseWriter, r *http.Request) {\n\n\t//\n\t//\n\t//\n\tt1 := time.Now()\n\n\t//\n\t//\n\t//\n\tjson := `{\"msg\":\"pong\"}`\n\n\t//\n\t//\n\t//\n\tpong := []byte(json)\n\n\t//\n\t//\n\t//\n\t// w.Header().Set(HttpHeaderTitle, HttpHeaderMsg)\n\n\t//\n\t//\n\t//\n\tw.Header().Set(\"X-Custom-Header\", \"HeaderValue-\"+cryptf.HashSeed(cryptf.Random(1, 30)))\n\n\t//\n\t//\n\t//\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\t//\n\t//\n\t//\n\tw.WriteHeader(http.StatusOK)\n\n\t//\n\t//\n\t//\n\tw.Write(pong)\n\n\t//\n\t//\n\t//\n\tt2 := time.Now()\n\n\t//\n\t//\n\t//\n\tmsg := \"Ping success\"\n\n\t//\n\t//\n\t//\n\tlogf.LogHandlerOff(w, r, msg, t1, t2)\n\n}", "title": "" }, { "docid": "ce9a47ca06bff668d9cdc6eae83fc29c", "score": "0.5231269", "text": "func StartTestAPI() {\n\n\t// Init router\n\tfmt.Println(\"Starting mux\")\n\tr := mux.NewRouter()\n\n\t// // Read private key and use that as the secret\n\t// pkSecret, err := ioutil.ReadFile(\"../../../private.ppk\") // in form of byte\n\t// if err != nil {\n\t// \tlog.Fatal(err)\n\t// }\n\n\t// // Declare a jwtMiddleware variable that is used with the negroni JWT middleware\n\t// // This checks to make sure each JWT token is validated using the private key read above\n\t// jwtMiddleware := jwtmiddleware.New(jwtmiddleware.Options{\n\t// \tValidationKeyGetter: func(token *jwt.Token) (interface{}, error) {\n\t// \t\treturn pkSecret, nil\n\t// \t},\n\t// \t// When set, the middleware verifies that tokens are signed with the specific signing algorithm\n\t// \t// If the signing method is not constant the ValidationKeyGetter callback can be used to implement additional checks\n\t// \t// Important to avoid security issues described here: https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/\n\t// \tSigningMethod: jwt.SigningMethodHS256,\n\t// })\n\n\tr.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\t\tw.Header().Set(\"Access-Control-Allow-Methods\", \"POST, GET, OPTIONS, PUT, DELETE\")\n\t\tw.Header().Set(\"Access-Control-Allow-Headers\", \"Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization\")\n\t\tw.Write([]byte(\"{\\\"hello\\\": \\\"world\\\"}\"))\n\t})\n\n\t// Basic handles for API\n\tr.HandleFunc(\"/test/login-start\", testLoginLevel).Methods(\"POST\")\n\tr.HandleFunc(\"/test/login-finish\", testLogin).Methods(\"POST\")\n\tr.HandleFunc(\"/test/register\", testRegister).Methods(\"POST\")\n\tr.HandleFunc(\"/test/log-config\", logConfigActivity).Methods(\"POST\")\n\tr.HandleFunc(\"/test/log-login\", logLoginActivity).Methods(\"POST\")\n\tr.HandleFunc(\"/test/log-practice\", logPracticeActivity).Methods(\"POST\")\n\tr.HandleFunc(\"/test/register-auth\", testRegisterAuth).Methods(\"POST\")\n\tr.HandleFunc(\"/test/register-keys\", testRegisterKeys).Methods(\"POST\")\n\tr.HandleFunc(\"/test/register-pass\", testRegisterPass).Methods(\"POST\")\n\tr.HandleFunc(\"/test/get-keys\", testGetUserKeys).Methods(\"GET\")\n\tr.HandleFunc(\"/test/get-pass\", testGetUserDisplayPass).Methods(\"GET\")\n\n\t// // restricted API call to register a user with a password\n\t// // requires a proper JWT token to access\n\t// r.Handle(\"/test/register-pass\", negroni.New(\n\t// \tnegroni.HandlerFunc(jwtMiddleware.HandlerWithNext),\n\t// \tnegroni.Wrap(http.HandlerFunc(testRegisterPass)),\n\t// ))\n\n\t// // restricted API call to register a user's auths\n\t// // requires a proper JWT token to access\n\t// r.Handle(\"/test/register-auth\", negroni.New(\n\t// \tnegroni.HandlerFunc(jwtMiddleware.HandlerWithNext),\n\t// \tnegroni.Wrap(http.HandlerFunc(testRegisterAuth)),\n\t// ))\n\n\t// Run the handler through CORS for testing\n\thandler := cors.Default().Handler(r)\n\n\t// Listen and serve the API over HTTP\n\t// TODO: have this serve over TLS for the server\n\thttp.ListenAndServe(\":8080\", handler)\n\n\t// Listen and serve the API over TLS (HTTPS)\n\t// err := http.ListenAndServeTLS(\":443\", \"certificate.crt\", \"private.key\", handler)\n\t// if err != nil {\n\t// \tlog.Fatal(\"ListenAndServe: \", err)\n\t// }\n}", "title": "" }, { "docid": "c56d7f31f4031d10b4856c489eb7ae05", "score": "0.52298933", "text": "func Test_GetStatusByTask_4(t *testing.T) {\r\n\tts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\r\n\t\tfmt.Fprintln(w, `{\"status\":1,\"msg\":\"List not exist: list_id=5\",\"data\":[]}`)\r\n\t}))\r\n\tdefer ts.Close()\r\n\r\n\t_, err := getVipStatusByTask(ts.URL)\r\n\tif err == nil {\r\n\t\tt.Error(\"should decode error\")\r\n\t}\r\n}", "title": "" }, { "docid": "3f7f897fc68169ba8b960caf612c71e4", "score": "0.52221173", "text": "func (m *DefaultManager) Test(policy *models.NotificationPolicy) error {\n\tp, err := json.Marshal(notifierModel.Payload{\n\t\tType: model.EventTypeTestEndpoint,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, target := range policy.Targets {\n\t\tswitch target.Type {\n\t\tcase \"http\":\n\t\t\treturn m.policyHTTPTest(target.Address, target.SkipCertVerify, p)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"invalid policy target type: %s\", target.Type)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "746577625057194e91bb274af7d0ec91", "score": "0.52201205", "text": "func TestSuccess(w http.ResponseWriter, r *http.Request) {\n\tTestSlack(false, r.URL.Path)\n\tw.Write([]byte(\"Tested Success\"))\n}", "title": "" }, { "docid": "2504c515b738f5921f875d3292efb2bc", "score": "0.521974", "text": "func TestHandlePublishOK(t *testing.T) {\n\n\tinitialize()\n\n\t// Get the element\n\tmessage := \"?exchange=TestHandlePublishOK&message=hello\"\n\treqGet := MockGetRequest(t, message)\n\trr := httptest.NewRecorder()\n\thandler := http.HandlerFunc(HandlePublish)\n\thandler.ServeHTTP(rr, reqGet)\n\t// Check the status code is what we expect.\n\tif status := rr.Code; status != http.StatusOK {\n\t\tt.Errorf(\"handler returned wrong status code: got %v want %v\",\n\t\t\tstatus, http.StatusOK)\n\t}\n\n}", "title": "" }, { "docid": "5a3559e30d56cda7e94072c04dd92d4d", "score": "0.52166635", "text": "func (c *APITestCase) Run() string {\n\tLogger.Printf(\"Test case [%s] START...\", c.CaseName)\n\tif c.TargetStatusCode != 0 {\n\t\tLogger.Printf(\"Expect response http code : [%d]\", c.TargetStatusCode)\n\t}\n\tif c.TargetBody != nil && c.TargetBody != \"\" {\n\t\tbodyStr, err := json.MarshalIndent(c.TargetBody, \"\", \"\\t\")\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tLogger.Printf(\"Expect response http body : \\n%s\\n\", bodyStr)\n\t}\n\tLogger.SetFlags(0)\n\tLogger.Printf(\"----->SEND : %s\", c.Req.ToString())\n\tstartTime := time.Now()\n\tstatusCode, body, err := c.Req.Invoke()\n\tduration := time.Since(startTime)\n\tLogger.Printf(\"----->RECEIVE %d in %d ms : \", statusCode, duration.Nanoseconds()/1e6)\n\tif body != nil && len(body) > 0 {\n\t\tLogger.Printf(\"%s\\n\", string(body))\n\t}\n\tLogger.SetFlags(log.LstdFlags | log.Lshortfile)\n\tif err != nil {\n\t\tif !c.AllowFail {\n\t\t\tLogger.Printf(\"Test case [%s] FAILED !!!\", c.CaseName)\n\t\t\tLogger.Println(\"allowFail = false,exit\")\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tLogger.Printf(\"Expect [%d] and Get [%d]\", c.TargetStatusCode, statusCode)\n\tif c.TargetStatusCode != 0 && statusCode != c.TargetStatusCode {\n\t\tFailCases = append(FailCases, c.CaseName)\n\t\tif statusCode == 0 {\n\t\t\tlog.Printf(\"Case [%-40s] TIMEOUT !!!\", c.CaseName)\n\t\t\tLogger.Printf(\"Test case [%s] TIMEOUT !!!\", c.CaseName)\n\t\t} else {\n\t\t\tlog.Printf(\"Case [%-40s] FAILED !!!\", c.CaseName)\n\t\t\tLogger.Printf(\"Test case [%s] FAILED !!!\", c.CaseName)\n\t\t}\n\t\tif !c.AllowFail {\n\t\t\tlog.Println(\"AllowFail = false,exit\")\n\t\t\tLogger.Println(\"allowFail = false,exit\")\n\t\t\tpanic(string(body))\n\t\t}\n\t} else {\n\t\tlog.Printf(\"Case [%-40s] SUCCESS\", c.CaseName)\n\t\tLogger.Printf(\"Test case [%s] SUCCESS\", c.CaseName)\n\t}\n\tLogger.Println(\"==================================================\")\n\treturn string(body)\n}", "title": "" }, { "docid": "0c55085ec8144ee9c7e03641cdfcce20", "score": "0.52162373", "text": "func Ping() string { return \"/ping\" }", "title": "" } ]
b2754709db665e051bbb9e2dba6ee596
Gen builds a ConfigParam list to allow the router to support a WPA network flow.
[ { "docid": "45d3c813c9bfdda859e5a0ad95152545", "score": "0.6123531", "text": "func (f *secSAE) Gen(axType DeviceType, band BandEnum) ([]ConfigParam, error) {\n\tradio := BandToRadio(axType, band)\n\trouterConfigParams := []ConfigParam{{radio, KeyAKM, \"sae\"}, {radio, KeyAuthMode, \"sae\"}, {radio, KeyWPAPSK, f.psk}}\n\tif f.cipher == AES {\n\t\trouterConfigParams = append(routerConfigParams, ConfigParam{radio, KeyCrypto, \"aes\"})\n\t} else {\n\t\treturn nil, errors.New(\"crypto schema not supported\")\n\t}\n\treturn routerConfigParams, nil\n}", "title": "" } ]
[ { "docid": "d13c634501ab4efa176ee700ea617449", "score": "0.5942246", "text": "func (lup *ListUploadParam) GenParams() map[string]interface{} {\n\tparams := map[string]interface{}{\n\t\t\"prefix\": lup.Prefix,\n\t\t\"delimiter\": lup.Delimiter,\n\t\t\"encoding-type\": lup.EncodingType,\n\t\t\"max-uploads\": lup.MaxUploads,\n\t\t\"key-marker\": lup.KeyMarker,\n\t\t\"upload-id-marker\": lup.UploadIDMarker,\n\t}\n\n\tfor k, v := range params {\n\t\tif v == \"\" {\n\t\t\tdelete(params, k)\n\t\t}\n\n\t\tif v == 0 {\n\t\t\tdelete(params, k)\n\t\t}\n\t}\n\tparams[\"uploads\"] = \"\"\n\n\treturn params\n\n}", "title": "" }, { "docid": "db5127b526dde6c29f209206f5f2b379", "score": "0.5364698", "text": "func (cfg NodeConfig) genArgs() []string {\n\tvar args []string\n\n\tswitch cfg.NetParams {\n\tcase &chaincfg.TestNet3Params:\n\t\targs = append(args, \"--bitcoin.testnet\")\n\tcase &chaincfg.SimNetParams:\n\t\targs = append(args, \"--bitcoin.simnet\")\n\tcase &chaincfg.RegressionNetParams:\n\t\targs = append(args, \"--bitcoin.regtest\")\n\t}\n\n\tbackendArgs := cfg.BackendCfg.GenArgs()\n\targs = append(args, backendArgs...)\n\targs = append(args, \"--bitcoin.active\")\n\targs = append(args, \"--nobootstrap\")\n\targs = append(args, \"--debuglevel=debug\")\n\targs = append(args, \"--bitcoin.defaultchanconfs=1\")\n\targs = append(args, fmt.Sprintf(\"--bitcoin.defaultremotedelay=%v\", DefaultCSV))\n\targs = append(args, fmt.Sprintf(\"--rpclisten=%v\", cfg.RPCAddr()))\n\targs = append(args, fmt.Sprintf(\"--restlisten=%v\", cfg.RESTAddr()))\n\targs = append(args, fmt.Sprintf(\"--restcors=https://%v\", cfg.RESTAddr()))\n\targs = append(args, fmt.Sprintf(\"--listen=%v\", cfg.P2PAddr()))\n\targs = append(args, fmt.Sprintf(\"--externalip=%v\", cfg.P2PAddr()))\n\targs = append(args, fmt.Sprintf(\"--logdir=%v\", cfg.LogDir))\n\targs = append(args, fmt.Sprintf(\"--datadir=%v\", cfg.DataDir))\n\targs = append(args, fmt.Sprintf(\"--tlscertpath=%v\", cfg.TLSCertPath))\n\targs = append(args, fmt.Sprintf(\"--tlskeypath=%v\", cfg.TLSKeyPath))\n\targs = append(args, fmt.Sprintf(\"--configfile=%v\", cfg.DataDir))\n\targs = append(args, fmt.Sprintf(\"--adminmacaroonpath=%v\", cfg.AdminMacPath))\n\targs = append(args, fmt.Sprintf(\"--readonlymacaroonpath=%v\", cfg.ReadMacPath))\n\targs = append(args, fmt.Sprintf(\"--invoicemacaroonpath=%v\", cfg.InvoiceMacPath))\n\targs = append(args, fmt.Sprintf(\"--trickledelay=%v\", trickleDelay))\n\targs = append(args, fmt.Sprintf(\"--profile=%d\", cfg.ProfilePort))\n\n\tif !cfg.HasSeed {\n\t\targs = append(args, \"--noseedbackup\")\n\t}\n\n\tif cfg.ExtraArgs != nil {\n\t\targs = append(args, cfg.ExtraArgs...)\n\t}\n\n\tif cfg.AcceptKeySend {\n\t\targs = append(args, \"--accept-keysend\")\n\t}\n\n\tif cfg.Etcd {\n\t\targs = append(args, \"--db.backend=etcd\")\n\t\targs = append(args, \"--db.etcd.embedded\")\n\t}\n\n\tif cfg.FeeURL != \"\" {\n\t\targs = append(args, \"--feeurl=\"+cfg.FeeURL)\n\t}\n\n\treturn args\n}", "title": "" }, { "docid": "9db01b9e4044f3ba3b563dde2a974b62", "score": "0.5254789", "text": "func GenerateConf(w io.Writer, lrns []int, osName, osVersion, serial string) error {\n\tendpoints := make([]string, len(lrns))\n\tfor i, lrn := range lrns {\n\t\tendpoints[i] = neco.BootNode0IP(lrn).String()\n\t}\n\n\tdata := serfConfig{\n\t\tTags: tags{\n\t\t\tOsName: osName,\n\t\t\tOsVersion: osVersion,\n\t\t\tSerial: serial,\n\t\t\tBootServer: \"true\",\n\t\t},\n\t\tInterface: \"node0\",\n\t\tReconnectInterval: \"30s\",\n\t\tReconnectTimeout: \"24h\",\n\t\tTombstoneTimeout: \"24h\",\n\t\tBroadcastTimeout: \"1m\",\n\t\tRetryJoin: endpoints,\n\t\tRetryMaxAttempts: 0,\n\t\tRetryInterval: \"30s\",\n\t\tLogLevel: \"debug\",\n\t\tProtocol: protocolVersion,\n\t}\n\te := json.NewEncoder(w)\n\te.SetIndent(\"\", \" \")\n\treturn e.Encode(data)\n}", "title": "" }, { "docid": "260dac6f188001db34d0031e56b7ce88", "score": "0.5240296", "text": "func (sh stdHandlerR4) GenerateParams(d *StdEncryptDict, opass, upass []byte) ([]byte, error) {\n\t// Make the O and U objects.\n\tO, err := sh.alg3(d.R, upass, opass)\n\tif err != nil {\n\t\tcommon.Log.Debug(\"ERROR: Error generating O for encryption (%s)\", err)\n\t\treturn nil, err\n\t}\n\td.O = O\n\tcommon.Log.Trace(\"gen O: % x\", O)\n\t// requires O\n\tekey := sh.alg2(d, upass)\n\n\tU, err := sh.alg5(ekey, upass)\n\tif err != nil {\n\t\tcommon.Log.Debug(\"ERROR: Error generating O for encryption (%s)\", err)\n\t\treturn nil, err\n\t}\n\td.U = U\n\tcommon.Log.Trace(\"gen U: % x\", U)\n\treturn ekey, nil\n}", "title": "" }, { "docid": "ac02eb3212cad42a8ddbb4c22d717234", "score": "0.52040374", "text": "func generateWgConfig() error {\n\tclients, err := ReadClients()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tserver, err := ReadServer()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconfigDataWg, err := util.DumpServerWg(clients, server)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = util.WriteFile(filepath.Join(os.Getenv(\"WG_CONF_DIR\"), os.Getenv(\"WG_INTERFACE_NAME\")), configDataWg.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b95d052c0122c0f177d3bc42dddec6da", "score": "0.5198481", "text": "func MakePwGenParams(u User) PwGenParams {\n\tvar params PwGenParams\n\n\tif u.Email == \"\" {\n\t\treturn params\n\t}\n\n\tparams.Version = \"003\"\n\tparams.PwCost = u.PwCost\n\tparams.Identifier = u.Email\n\n\tif u.PwFunc != \"\" { // v1 only\n\t\tparams.PwFunc = u.PwFunc\n\t\tparams.PwAlg = u.PwAlg\n\t\tparams.PwKeySize = u.PwKeySize\n\t}\n\tif u.PwSalt == \"\" { // v2 only\n\t\tnonce := u.PwNonce\n\t\tif nonce == \"\" {\n\t\t\tnonce = \"a04a8fe6bcb19ba61c5c0873d391e987982fbbd4\"\n\t\t}\n\t\tu.PwSalt = strings.Replace(\n\t\t\tfmt.Sprintf(\"% x\", sha1.Sum([]byte(u.Email+\"SN\"+nonce))),\n\t\t\t\" \",\n\t\t\t\"\",\n\t\t\t-1,\n\t\t)\n\t}\n\tif u.PwNonce != \"\" { // v3 only\n\t\tparams.PwNonce = u.PwNonce\n\t}\n\n\tparams.PwSalt = u.PwSalt\n\n\treturn params\n}", "title": "" }, { "docid": "dcd39aa3857fa0bbabcb1d106afdf6e6", "score": "0.51338416", "text": "func NewParams(serviceName string, config *config.Config, dc *dynamicconfig.Collection) (Params, error) {\n\tserviceConfig, err := config.GetServiceConfig(serviceName)\n\tif err != nil {\n\t\treturn Params{}, err\n\t}\n\n\tlistenIP, err := getListenIP(serviceConfig.RPC)\n\tif err != nil {\n\t\treturn Params{}, fmt.Errorf(\"get listen IP: %v\", err)\n\t}\n\n\tinboundTLS, err := serviceConfig.RPC.TLS.ToTLSConfig()\n\tif err != nil {\n\t\treturn Params{}, fmt.Errorf(\"inbound TLS config: %v\", err)\n\t}\n\toutboundTLS := map[string]*tls.Config{}\n\tfor _, outboundServiceName := range service.List {\n\t\toutboundServiceConfig, err := config.GetServiceConfig(outboundServiceName)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\toutboundTLS[outboundServiceName], err = outboundServiceConfig.RPC.TLS.ToTLSConfig()\n\t\tif err != nil {\n\t\t\treturn Params{}, fmt.Errorf(\"outbound %s TLS config: %v\", outboundServiceName, err)\n\t\t}\n\t}\n\n\tenableGRPCOutbound := dc.GetBoolProperty(dynamicconfig.EnableGRPCOutbound)()\n\n\tpublicClientOutbound, err := newPublicClientOutbound(config)\n\tif err != nil {\n\t\treturn Params{}, fmt.Errorf(\"public client outbound: %v\", err)\n\t}\n\n\tforwardingRules, err := getForwardingRules(dc)\n\tif err != nil {\n\t\treturn Params{}, err\n\t}\n\tif len(forwardingRules) == 0 {\n\t\t// not set, load from static config\n\t\tforwardingRules = config.HeaderForwardingRules\n\t}\n\tvar http *httpParams\n\n\tif serviceConfig.RPC.HTTP != nil {\n\t\tif serviceConfig.RPC.HTTP.Port <= 0 {\n\t\t\treturn Params{}, errors.New(\"HTTP port is not set\")\n\t\t}\n\t\tprocedureMap := map[string]struct{}{}\n\n\t\tfor _, v := range serviceConfig.RPC.HTTP.Procedures {\n\t\t\tprocedureMap[v] = struct{}{}\n\t\t}\n\n\t\thttp = &httpParams{\n\t\t\tAddress: net.JoinHostPort(listenIP.String(), strconv.Itoa(int(serviceConfig.RPC.HTTP.Port))),\n\t\t\tProcedures: procedureMap,\n\t\t}\n\n\t\tif serviceConfig.RPC.HTTP.TLS.Enabled {\n\t\t\thttptls, err := serviceConfig.RPC.HTTP.TLS.ToTLSConfig()\n\t\t\tif err != nil {\n\t\t\t\treturn Params{}, fmt.Errorf(\"creating TLS config for HTTP: %w\", err)\n\t\t\t}\n\n\t\t\thttp.TLS = httptls\n\t\t\thttp.Mode = serviceConfig.RPC.HTTP.TLSMode\n\t\t}\n\t}\n\n\treturn Params{\n\t\tServiceName: serviceName,\n\t\tHTTP: http,\n\t\tTChannelAddress: net.JoinHostPort(listenIP.String(), strconv.Itoa(int(serviceConfig.RPC.Port))),\n\t\tGRPCAddress: net.JoinHostPort(listenIP.String(), strconv.Itoa(int(serviceConfig.RPC.GRPCPort))),\n\t\tGRPCMaxMsgSize: serviceConfig.RPC.GRPCMaxMsgSize,\n\t\tOutboundsBuilder: CombineOutbounds(\n\t\t\tNewDirectOutbound(service.History, enableGRPCOutbound, outboundTLS[service.History]),\n\t\t\tNewDirectOutbound(service.Matching, enableGRPCOutbound, outboundTLS[service.Matching]),\n\t\t\tpublicClientOutbound,\n\t\t),\n\t\tInboundTLS: inboundTLS,\n\t\tOutboundTLS: outboundTLS,\n\t\tInboundMiddleware: yarpc.InboundMiddleware{\n\t\t\t// order matters: ForwardPartitionConfigMiddleware must be applied after ClientPartitionConfigMiddleware\n\t\t\tUnary: yarpc.UnaryInboundMiddleware(&InboundMetricsMiddleware{}, &ClientPartitionConfigMiddleware{}, &ForwardPartitionConfigMiddleware{}),\n\t\t},\n\t\tOutboundMiddleware: yarpc.OutboundMiddleware{\n\t\t\tUnary: yarpc.UnaryOutboundMiddleware(&HeaderForwardingMiddleware{\n\t\t\t\tRules: forwardingRules,\n\t\t\t}, &ForwardPartitionConfigMiddleware{}),\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "41a6335b91ee0662497f2ae217e1b0a7", "score": "0.5080077", "text": "func newMemberlistConf(c *Config) (*m.Config, error) {\n\tmc, err := config.NewMemberlistConfig(c.Memberlist.Environment)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmc.Name = c.Olricd.Name\n\tmc.BindAddr = c.Memberlist.BindAddr\n\tmc.BindPort = c.Memberlist.BindPort\n\n\tif c.Memberlist.EnableCompression != nil {\n\t\tmc.EnableCompression = *c.Memberlist.EnableCompression\n\t}\n\n\tif c.Memberlist.TCPTimeout != nil {\n\t\tmc.TCPTimeout, err = time.ParseDuration(*c.Memberlist.TCPTimeout)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif c.Memberlist.IndirectChecks != nil {\n\t\tmc.IndirectChecks = *c.Memberlist.IndirectChecks\n\t}\n\n\tif c.Memberlist.RetransmitMult != nil {\n\t\tmc.RetransmitMult = *c.Memberlist.RetransmitMult\n\t}\n\n\tif c.Memberlist.SuspicionMult != nil {\n\t\tmc.SuspicionMult = *c.Memberlist.SuspicionMult\n\t}\n\n\tif c.Memberlist.PushPullInterval != nil {\n\t\tmc.PushPullInterval, err = time.ParseDuration(*c.Memberlist.PushPullInterval)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif c.Memberlist.ProbeTimeout != nil {\n\t\tmc.ProbeTimeout, err = time.ParseDuration(*c.Memberlist.ProbeTimeout)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif c.Memberlist.ProbeInterval != nil {\n\t\tmc.ProbeInterval, err = time.ParseDuration(*c.Memberlist.ProbeInterval)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif c.Memberlist.GossipInterval != nil {\n\t\tmc.GossipInterval, err = time.ParseDuration(*c.Memberlist.GossipInterval)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif c.Memberlist.GossipToTheDeadTime != nil {\n\t\tmc.GossipToTheDeadTime, err = time.ParseDuration(*c.Memberlist.GossipToTheDeadTime)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif c.Memberlist.AdvertiseAddr != nil {\n\t\tmc.AdvertiseAddr = *c.Memberlist.AdvertiseAddr\n\t} else {\n\t\tif ip := net.ParseIP(mc.BindAddr); ip != nil {\n\t\t\tmc.AdvertiseAddr = ip.String()\n\t\t} else {\n\t\t\tans, err := net.LookupIP(mc.BindAddr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// Fail early.\n\t\t\tif len(ans) == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"no IP address found for %s\", mc.BindAddr)\n\t\t\t}\n\t\t\tmc.AdvertiseAddr = ans[0].String()\n\t\t}\n\t}\n\tif c.Memberlist.AdvertisePort != nil {\n\t\tmc.AdvertisePort = *c.Memberlist.AdvertisePort\n\t} else {\n\t\tmc.AdvertisePort = mc.BindPort\n\t}\n\n\tif c.Memberlist.SuspicionMaxTimeoutMult != nil {\n\t\tmc.SuspicionMaxTimeoutMult = *c.Memberlist.SuspicionMaxTimeoutMult\n\t}\n\n\tif c.Memberlist.DisableTCPPings != nil {\n\t\tmc.DisableTcpPings = *c.Memberlist.DisableTCPPings\n\t}\n\n\tif c.Memberlist.AwarenessMaxMultiplier != nil {\n\t\tmc.AwarenessMaxMultiplier = *c.Memberlist.AwarenessMaxMultiplier\n\t}\n\n\tif c.Memberlist.GossipNodes != nil {\n\t\tmc.GossipNodes = *c.Memberlist.GossipNodes\n\t}\n\tif c.Memberlist.GossipVerifyIncoming != nil {\n\t\tmc.GossipVerifyIncoming = *c.Memberlist.GossipVerifyIncoming\n\t}\n\tif c.Memberlist.GossipVerifyOutgoing != nil {\n\t\tmc.GossipVerifyOutgoing = *c.Memberlist.GossipVerifyOutgoing\n\t}\n\n\tif c.Memberlist.DNSConfigPath != nil {\n\t\tmc.DNSConfigPath = *c.Memberlist.DNSConfigPath\n\t}\n\n\tif c.Memberlist.HandoffQueueDepth != nil {\n\t\tmc.HandoffQueueDepth = *c.Memberlist.HandoffQueueDepth\n\t}\n\tif c.Memberlist.UDPBufferSize != nil {\n\t\tmc.UDPBufferSize = *c.Memberlist.UDPBufferSize\n\t}\n\treturn mc, nil\n}", "title": "" }, { "docid": "cf031abda52f1284ad04e6a6f14dd288", "score": "0.5024502", "text": "func make_config(t *testing.T, n int, unreliable bool) *config {\n\tncpu_once.Do(func() {\n\t\tif runtime.NumCPU() < 2 {\n\t\t\tfmt.Printf(\"warning: only one CPU, which may conceal locking bugs\\n\")\n\t\t}\n\t})\n\truntime.GOMAXPROCS(4)\n\tcfg := &config{}\n\tcfg.t = t\n\tcfg.net = labrpc.MakeNetwork()\n\tcfg.n = n\n\tcfg.applyErr = make([]string, cfg.n)\n\tcfg.pbservers = make([]*PBServer, cfg.n)\n\tcfg.connected = make([]bool, cfg.n)\n\tcfg.endnames = make([][]string, cfg.n)\n\n\tcfg.setunreliable(unreliable)\n\n\tcfg.net.LongDelays(true)\n\n\t// create a full set of PBServers\n\tfor i := 0; i < cfg.n; i++ {\n\t\tcfg.start1(i)\n\t}\n\n\t// connect everyone\n\tfor i := 0; i < cfg.n; i++ {\n\t\tcfg.connect(i)\n\t}\n\n\treturn cfg\n}", "title": "" }, { "docid": "498757457d1b2b735c6a79145019a4e6", "score": "0.49934024", "text": "func MakeConfigUpdate(sysCfg, mgmtCfg, configVersion string) ([]byte, error) {\n\treturn json.Marshal(CommandData{\n\t\tType: \"setparam\",\n\t\tSystemConfig: sysCfg,\n\t\tServerTimestamp: unixMicroPSTString(),\n\t\tManagementConfig: mgmtCfg,\n\t\tConfigVersion: configVersion,\n\t})\n}", "title": "" }, { "docid": "e4a9f71b622063030b2ccea8290944ca", "score": "0.49918735", "text": "func AddIndependentPropertyGeneratorsForIpConfiguration_ARM(gens map[string]gopter.Gen) {\n\tgens[\"PrivateIpAddress\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"PrivateIpAllocationMethod\"] = gen.PtrOf(gen.OneConstOf(IpConfiguration_PrivateIpAllocationMethod_Dynamic, IpConfiguration_PrivateIpAllocationMethod_Static))\n}", "title": "" }, { "docid": "66f7cee64b742ddbd2ad08984d29c96b", "score": "0.49911416", "text": "func (a *delay) BuildParams(t *train.Train, lang language.Tag) (*TemplateParams, *TemplateParams, bool, error) {\n\t_, through := train.FollowingStations(t.Route, true)\n\tlast := (t.Route.EndStation.ID == t.StationID)\n\tfirst := (t.Route.StartStation.ID == t.StationID)\n\tevent := train.GetReferenceEvent(t)\n\n\tparams := TemplateParams{\n\t\t\"Category\": l10n.FromMetaDictionary(train.GetCategory(t), l10n.Genitive, lang),\n\t\t\"Carrier\": l10n.FromMetaDictionary(t.Carrier, l10n.Locative, lang),\n\t\t\"Name\": t.Name,\n\t\t\"From\": t.Route.StartStation.Name,\n\t\t\"To\": t.Route.EndStation.Name,\n\t\t\"By\": through,\n\t\t\"Last\": last,\n\t\t\"First\": first,\n\t\t\"Delay\": train.GetDelay(t),\n\t\t\"Scheduled\": event.Time.Format(TimeFormat(lang)),\n\t}\n\tif res, val := train.HasI18nOption(t, train.DelayText, lang); res == true {\n\t\tparams[\"Custom\"] = val\n\t}\n\tif log.GetLevel() >= log.DebugLevel {\n\t\tlog.WithFields(log.Fields{\"logger\": \"annongen.producer.delay\", \"method\": \"BuildParams\", \"params\": fmt.Sprintf(\"%+v\", params)}).\n\t\t\tDebug(\"Parameters for speech generator\")\n\t}\n\treturn &params, &params, true, nil\n}", "title": "" }, { "docid": "d7247fc370600d5d6b1fe276b185d06d", "score": "0.49696022", "text": "func GenerateConfigurations() (config_v2.Config, LiveConfigurations) {\n\t// initialised with health-check listener and handler\n\tsecretlessConfig := config_v2.Config{\n\t\tServices: []*config_v2.Service{\n\t\t\t{\n\t\t\t\tDebug: true,\n\t\t\t\tConnector: \"mysql\",\n\t\t\t\tConnectorConfig: nil,\n\t\t\t\tCredentials: []*config_v2.Credential{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"host\",\n\t\t\t\t\t\tFrom: \"literal\",\n\t\t\t\t\t\tGet: sampleDbConfig.HostWithTLS,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"username\",\n\t\t\t\t\t\tFrom: \"literal\",\n\t\t\t\t\t\tGet: sampleDbConfig.User,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"password\",\n\t\t\t\t\t\tFrom: \"literal\",\n\t\t\t\t\t\tGet: sampleDbConfig.Password,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tListenOn: \"unix:///sock/mysql.sock\",\n\t\t\t\tName: \"health-check\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tDebug: true,\n\t\t\t\tConnector: \"pg\",\n\t\t\t\tConnectorConfig: nil,\n\t\t\t\tCredentials: []*config_v2.Credential{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"host\",\n\t\t\t\t\t\tFrom: \"literal\",\n\t\t\t\t\t\tGet: \"health-check\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"port\",\n\t\t\t\t\t\tFrom: \"literal\",\n\t\t\t\t\t\tGet: \"3306\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"username\",\n\t\t\t\t\t\tFrom: \"literal\",\n\t\t\t\t\t\tGet: \"health-check\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"password\",\n\t\t\t\t\t\tFrom: \"literal\",\n\t\t\t\t\t\tGet: \"health-check\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tListenOn: \"tcp://0.0.0.0:5432\",\n\t\t\t\tName: \"pg-bench\",\n\t\t\t},\n\t\t},\n\t}\n\n\tliveConfigurations := make(LiveConfigurations, 0)\n\n\t// TODO: Create a utility xprod function similar to the one here:\n\t// https://stackoverflow.com/questions/29002724/implement-ruby-style-cartesian-product-in-go\n\t// so we can avoid the nested for loops\n\t//\n\t// TODO: Remove \"Value\" suffixes -- no need for them, the lower case first letter\n\t// distinguishes them from the type itself, so it only degrades readability.\n\tportNumber := 3307\n\tfor _, serverTLSSetting := range AllTLSSettings() {\n\t\tfor _, socketType := range AllSocketTypes() {\n\t\t\tfor _, sslMode := range AllSSLModes() {\n\t\t\t\tfor _, sslHost := range AllSSLHosts() {\n\t\t\t\t\tfor _, publicCertStatus := range AllPublicCertStatuses() {\n\t\t\t\t\t\tfor _, privateKeyStatus := range AllPrivateKeyStatuses() {\n\t\t\t\t\t\t\tfor _, rootCertStatus := range AllRootCertStatuses() {\n\t\t\t\t\t\t\t\tfor _, areAuthCredentialsInvalid := range AllAuthCredentialsInvalidity() {\n\n\t\t\t\t\t\t\t\t\tconnectionPort := ConnectionPort{\n\t\t\t\t\t\t\t\t\t\t// TODO: perhaps resolve this duplication of listener type\n\t\t\t\t\t\t\t\t\t\tSocketType: socketType,\n\t\t\t\t\t\t\t\t\t\tPort: portNumber,\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tname := \"test_service_\" + connectionPort.ToPortString()\n\t\t\t\t\t\t\t\t\tcredentials := areAuthCredentialsInvalid.toSecrets()\n\n\t\t\t\t\t\t\t\t\tliveConfiguration := LiveConfiguration{\n\t\t\t\t\t\t\t\t\t\tAbstractConfiguration: AbstractConfiguration{\n\t\t\t\t\t\t\t\t\t\t\tSocketType: socketType,\n\t\t\t\t\t\t\t\t\t\t\tTLSSetting: serverTLSSetting,\n\t\t\t\t\t\t\t\t\t\t\tSSLHost: sslHost,\n\t\t\t\t\t\t\t\t\t\t\tSSLMode: sslMode,\n\t\t\t\t\t\t\t\t\t\t\tRootCertStatus: rootCertStatus,\n\t\t\t\t\t\t\t\t\t\t\tPrivateKeyStatus: privateKeyStatus,\n\t\t\t\t\t\t\t\t\t\t\tPublicCertStatus: publicCertStatus,\n\t\t\t\t\t\t\t\t\t\t\tAuthCredentialInvalidity: areAuthCredentialsInvalid,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tConnectionPort: connectionPort,\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tcredentials = append(\n\t\t\t\t\t\t\t\t\t\tcredentials,\n\t\t\t\t\t\t\t\t\t\t// rootCertStatus\n\t\t\t\t\t\t\t\t\t\trootCertStatus.toSecret(),\n\t\t\t\t\t\t\t\t\t\t//sslMode\n\t\t\t\t\t\t\t\t\t\tsslMode.toSecret(),\n\t\t\t\t\t\t\t\t\t\t//sslHost\n\t\t\t\t\t\t\t\t\t\tsslHost.toSecret(),\n\t\t\t\t\t\t\t\t\t\t//sslPrivateKeyTypeValue\n\t\t\t\t\t\t\t\t\t\tprivateKeyStatus.toSecret(),\n\t\t\t\t\t\t\t\t\t\t//sslPublicCertTypeValue\n\t\t\t\t\t\t\t\t\t\tpublicCertStatus.toSecret(),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t// serverTLSSetting\n\t\t\t\t\t\t\t\t\tcredentials = append(\n\t\t\t\t\t\t\t\t\t\tcredentials,\n\t\t\t\t\t\t\t\t\t\tserverTLSSetting.toSecrets(sampleDbConfig)...,\n\t\t\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\t\t\t// socketType\n\t\t\t\t\t\t\t\t\taddress := \"\"\n\t\t\t\t\t\t\t\t\tswitch socketType {\n\t\t\t\t\t\t\t\t\tcase TCP:\n\t\t\t\t\t\t\t\t\t\taddress = \"tcp://0.0.0.0:\" + connectionPort.ToPortString()\n\t\t\t\t\t\t\t\t\tcase Socket:\n\t\t\t\t\t\t\t\t\t\taddress = \"unix://\" + connectionPort.ToSocketPath()\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tsvc := &config_v2.Service{\n\t\t\t\t\t\t\t\t\t\tDebug: true,\n\t\t\t\t\t\t\t\t\t\t// TODO: grab value from envvar for flexibility\n\t\t\t\t\t\t\t\t\t\tConnector: sampleDbConfig.Protocol,\n\t\t\t\t\t\t\t\t\t\tConnectorConfig: nil,\n\t\t\t\t\t\t\t\t\t\tCredentials: credentials,\n\t\t\t\t\t\t\t\t\t\tListenOn: config_v2.NetworkAddress(address),\n\t\t\t\t\t\t\t\t\t\tName: name,\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tsecretlessConfig.Services = append(\n\t\t\t\t\t\t\t\t\t\tsecretlessConfig.Services,\n\t\t\t\t\t\t\t\t\t\tsvc)\n\t\t\t\t\t\t\t\t\tliveConfigurations = append(liveConfigurations, liveConfiguration)\n\n\t\t\t\t\t\t\t\t\tportNumber++\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn secretlessConfig, liveConfigurations\n}", "title": "" }, { "docid": "1c2a42b1751556d8d7c1f5f5d04f6882", "score": "0.49079558", "text": "func createConfigFromInitParam(param *InitParam) *Config {\n\tcfg := &Config{}\n\tcfg.AppFilesDir = param.AppFilesDir\n\tcfg.Devicename = param.Devicename\n\n\tcheckBooksDir(param)\n\tcheckCameraDir(param)\n\n\tcfg.AddDir(\"Books\", param.Books)\n\tcfg.AddDir(\"Camera\", param.Camera)\n\tcfg.AddDir(\"DCIM\", param.DCIM)\n\n\tcfg.AddDir(\"Documents\", param.Documents)\n\tcfg.AddDir(\"Downloads\", param.Downloads)\n\tcfg.AddDir(\"Movies\", param.Movies)\n\tcfg.AddDir(\"Music\", param.Music)\n\tcfg.AddDir(\"Pictures\", param.Pictures)\n\n\treturn cfg\n}", "title": "" }, { "docid": "3968b341ea8a8a3fbbc459f69a2fd8dd", "score": "0.49063426", "text": "func genConfigBuild(o *Options) (generatedFile, error) {\n\tif o.PlatformParams.CppToolchainTarget != \"\" {\n\t\treturn generatedFile{}, fmt.Errorf(\"<internal error> C++ toolchain target was already set\")\n\t}\n\t// Populate the C++ toolchain target if C++ config generation is enabled.\n\tif o.GenCPPConfigs {\n\t\to.PlatformParams.CppToolchainTarget = genCppToolchainTarget(o)\n\t} else {\n\t\to.PlatformParams.CppToolchainTarget = \"\"\n\t\tlog.Printf(\"Not generating a toolchain target to be used for the C++ Crosstool top because C++ config generation is disabled.\")\n\t}\n\tbuf := bytes.NewBuffer(nil)\n\tlog.Printf(\"Fully resolved platform params=%v\", o.PlatformParams)\n\tif err := platformsToolchainBuildTemplate.Execute(buf, o.PlatformParams); err != nil {\n\t\treturn generatedFile{}, fmt.Errorf(\"failed to generate platform BUILD file: %w\", err)\n\t}\n\treturn generatedFile{\n\t\tname: \"config/BUILD\",\n\t\tcontents: buf.Bytes(),\n\t}, nil\n}", "title": "" }, { "docid": "79fe94cac492bc44970c0effbb893e7f", "score": "0.49004915", "text": "func AddIndependentPropertyGeneratorsForEncryptionConfiguration(gens map[string]gopter.Gen) {\n\tgens[\"KeyName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"KeyVersion\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"VaultBaseUrl\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "98d6f75eec712068f384848249ff130a", "score": "0.48831192", "text": "func GenInitOptions(args []string) (json.RawMessage, error) {\n\tif len(args) != 1 {\n\t\treturn nil, fmt.Errorf(\"Usage: init <notary address hex>\")\n\t}\n\tbz, err := hex.DecodeString(args[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = weave.Address(bz).Validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\topts := fmt.Sprintf(`\n {\n\t\t\t\"multisig\": [],\n\t\t\t\"update_validators\": {\n\t\t\t\t\"addresses\": [\"%s\"]\n\t\t\t},\n\t\t\t \"gconf\": {\n\t\t\t\t\"votes:notary\": \"%s\"\n\t\t\t}\t\n }\n\t`, args[0], args[0])\n\treturn []byte(opts), nil\n}", "title": "" }, { "docid": "59afdcc2138d0a21616f827a7b23e0c6", "score": "0.48446986", "text": "func (conf RouterConfiguration) BuildConfigString() string {\n\treturn conf.Mode + \",\" + conf.Team + \",\" + conf.SSID + \",\" +\n\t\tconf.WPAKey + \",\" + util.BoolToStr(conf.BWLimit) + \",\" + util.BoolToStr(conf.Firewall) + \",\" +\n\t\tutil.BoolToStr(conf.DHCPEnabled) + \",\" + strconv.Itoa(conf.RadioID_24) + \",\" + strconv.Itoa(conf.RadioID_5) + \",\" +\n\t\tconf.Event + \",\\n\"\n}", "title": "" }, { "docid": "e436058f7c4d55caa95d02eb73c68aed", "score": "0.48414126", "text": "func (v *MediaParam) GenerateUrl() (params url.Values) {\n\tparams = url.Values{}\n\tparams.Set(\"build\", fmt.Sprintf(\"%d\", v.Build))\n\tparams.Set(\"mobi_app\", v.MobiAPP)\n\tparams.Set(\"platform\", v.Platform)\n\tparams.Set(\"access_key\", v.AccessKey)\n\tparams.Set(\"track_path\", v.TrackPath)\n\tparams.Set(\"season_id\", fmt.Sprintf(\"%d\", v.SeasonID))\n\treturn\n}", "title": "" }, { "docid": "d564fb5649f65566b7ccf26cdcf025be", "score": "0.48332915", "text": "func (s *store) generateConfigs() []integration.Config {\n\ts.Lock()\n\tdefer s.Unlock()\n\n\tconfigs := []integration.Config{}\n\tfor _, epConfig := range s.epConfigs {\n\t\tif epConfig.shouldCollect {\n\t\t\tfor _, tpl := range epConfig.templates {\n\t\t\t\tconfigs = append(configs, endpointChecksFromTemplate(tpl, epConfig.ep)...)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn configs\n}", "title": "" }, { "docid": "f2e9918638e7876475f19795bc1399a7", "score": "0.47972676", "text": "func (client *ManagementClient) listConfigurationsCreateRequest(ctx context.Context, configurationsRequest ConfigurationsRequest, options *ManagementClientListConfigurationsOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-12-01\")\n\tif options != nil && options.SkipToken != nil {\n\t\treqQP.Set(\"$skipToken\", *options.SkipToken)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, configurationsRequest)\n}", "title": "" }, { "docid": "59159598f825fa69314b81cf47497ee2", "score": "0.4786993", "text": "func CreateParamList(funcv reflect.Value, params []interface{}) ([]reflect.Value, error) {\n\tfunct := funcv.Type()\n\tnumParams := funct.NumIn()\n\tif len(params) != numParams {\n\t\treturn nil, errors.New(\"wrong number of parameters\")\n\t}\n\tresults := make([]reflect.Value, numParams)\n\tfor i := 0; i < numParams; i++ {\n\t\tparamType := funct.In(i)\n\t\tparamValue := reflect.New(paramType)\n\t\tparam := paramValue.Interface()\n\t\tconfig := mapstructure.DecoderConfig{\n\t\t\tDecodeHook: DecodeBytesAsString,\n\t\t\tResult: param,\n\t\t}\n\t\tdecoder, err := mapstructure.NewDecoder(&config)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\terr = decoder.Decode(params[i])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresults[i] = paramValue.Elem()\n\t}\n\treturn results, nil\n}", "title": "" }, { "docid": "86ddeac33dc5c7c5f010a187b5612553", "score": "0.47861055", "text": "func buildConfig(opts []Option) (*Config, error) {\n\tcfg := &Config{\n\t\taddress: DefAddress,\n\t\tmaxIdle: DefMaxIdle,\n\t\tidleTimeout: DefIdleTimeout * time.Second,\n\t}\n\n\tfor _, opt := range opts {\n\t\tif err := opt(cfg); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn cfg, nil\n}", "title": "" }, { "docid": "874f43a7321eb45c5ef2ccd576224f0d", "score": "0.47815967", "text": "func AddRelatedPropertyGeneratorsForProtocolSettings(gens map[string]gopter.Gen) {\n\tgens[\"Smb\"] = gen.PtrOf(SmbSettingGenerator())\n}", "title": "" }, { "docid": "5f1f36a54cd6e7ac6090f57198569351", "score": "0.47772628", "text": "func AddIndependentPropertyGeneratorsForFactoryVSTSConfiguration(gens map[string]gopter.Gen) {\n\tgens[\"AccountName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"CollaborationBranch\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"DisablePublish\"] = gen.PtrOf(gen.Bool())\n\tgens[\"LastCommitId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"ProjectName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"RepositoryName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"RootFolder\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"TenantId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Type\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "eb7ad2c3f6004fb263b8c01ac0e751dc", "score": "0.47723177", "text": "func GenSwitchkeysRescalingParams(Q, P []uint64) (params []uint64) {\n\n\tparams = make([]uint64, len(Q))\n\n\tPBig := ring.NewUint(1)\n\tfor _, pj := range P {\n\t\tPBig.Mul(PBig, ring.NewUint(pj))\n\t}\n\n\ttmp := ring.NewUint(0)\n\n\tfor i := 0; i < len(Q); i++ {\n\n\t\tparams[i] = tmp.Mod(PBig, ring.NewUint(Q[i])).Uint64()\n\t\tparams[i] = ring.ModExp(params[i], int(Q[i]-2), Q[i])\n\t\tparams[i] = ring.MForm(params[i], Q[i], ring.BRedParams(Q[i]))\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "2e76c5a0161e1bddf1693c1696a37b53", "score": "0.47710678", "text": "func groupConfigParams(params map[string]string, prefix string, checker func(string) bool) map[string]map[string]string {\n\tresultMap := make(map[string]map[string]string)\n\tfor k, v := range params {\n\t\tname, ok := getConfigParamName(k, prefix, checker)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tattribute := getConfigParamAttribute(k)\n\n\t\tm, ok := resultMap[name]\n\t\tif !ok {\n\t\t\tm = make(map[string]string)\n\t\t\tresultMap[name] = m\n\t\t}\n\t\tm[attribute] = v\n\t}\n\treturn resultMap\n}", "title": "" }, { "docid": "352c4c6ad0faa5876f0b0046173aed9d", "score": "0.4761759", "text": "func (w *SynapseWorker) GenerateConfig(s *Synapse) ([]byte, error) {\n\tworkerConfig := SynapseWorkerConfig{\n\t\tApp: w.Spec.Worker,\n\t\tReplicationHost: s.GetServiceName(),\n\t\tReplicationPort: s.Spec.Ports.Replication,\n\t\tListeners: []SynapseWorkerListener{{\n\t\t\tProtocol: w.Spec.Protocol,\n\t\t\tPort: w.Spec.Port,\n\t\t\tResources: w.Spec.Resources,\n\t\t}},\n\t}\n\n\treturn yaml.Marshal(workerConfig)\n}", "title": "" }, { "docid": "b7d2e83e123ce9214b3ef6c5d5f0763f", "score": "0.4741682", "text": "func CreateConfig() {\n\tcfg := Config{}\n\tcfg.Channels = map[TelegramChannel]ChannelConfig{}\n\n\tvar inputBuf string\n\n\t// GetChannel Telegram Api Token from @BotFather\n\tfmt.Print(\"Enter Telegram API Token: \")\n\t_, err := fmt.Scanln(&inputBuf)\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t\treturn\n\t}\n\tfmt.Println(\"\")\n\tcfg.TelegramApiToken = inputBuf\n\n\t// GetChannel DiscordApiToken from Discord Application portal\n\tfmt.Print(\"Enter Discord API Token: \")\n\t_, err = fmt.Scanln(&inputBuf)\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t\treturn\n\t}\n\tfmt.Println(\"\")\n\n\tfor true {\n\t\tfmt.Println(\"Enter Telegram ChanID\")\n\t\tfmt.Println(\"a comma, for example: -432232xx\")\n\t\t_, err = fmt.Scanln(&inputBuf)\n\n\t\tif inputBuf == \"EXIT\" || err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\t// do some checks on the telegram Channel ID\n\t\ttelegramChanId, err := strconv.Atoi(inputBuf)\n\t\tif err != nil {\n\t\t\tlogger.Warnf(\"%s is not a valid telegram channel id\", inputBuf)\n\t\t\tcontinue\n\t\t}\n\n\t\ttelegramChanIdTyped := TelegramChannel(telegramChanId)\n\n\t\tcfg.Channels[telegramChanIdTyped] = ChannelConfig{Reminder: map[string]Reminders{}}\n\n\t}\n\n\toutputBytes, err := json.MarshalIndent(cfg, \"\", \"\\t\")\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t\treturn\n\t}\n\terr = ioutil.WriteFile(\"gofer.json\", outputBytes, 0644)\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t\treturn\n\t}\n\n}", "title": "" }, { "docid": "cfc79d5c0eae75c8dfc725da36116662", "score": "0.47408253", "text": "func MakeConfig(mb module.BasicManager) params.EncodingConfig {\n\tcdc := amino.NewLegacyAmino()\n\tinterfaceRegistry := types.NewInterfaceRegistry()\n\tcodec := amino.NewProtoCodec(interfaceRegistry)\n\n\tencodingConfig := params.EncodingConfig{\n\t\tInterfaceRegistry: interfaceRegistry,\n\t\tCodec: codec,\n\t\tTxConfig: tx.NewTxConfig(codec, tx.DefaultSignModes),\n\t\tAmino: cdc,\n\t}\n\n\tenccodec.RegisterLegacyAminoCodec(encodingConfig.Amino)\n\tmb.RegisterLegacyAminoCodec(encodingConfig.Amino)\n\tenccodec.RegisterInterfaces(encodingConfig.InterfaceRegistry)\n\tmb.RegisterInterfaces(encodingConfig.InterfaceRegistry)\n\treturn encodingConfig\n}", "title": "" }, { "docid": "2d3004fc1707bf38ef4ae55d2c6343b8", "score": "0.47293964", "text": "func InitConfig(native *native.NativeService) ([]byte, error) {\n\tconfiguration := new(config.VBFTConfig)\n\tbuf, err := serialization.ReadVarBytes(bytes.NewBuffer(native.Input))\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"serialization.ReadVarBytes, contract params deserialize error: %v\", err)\n\t}\n\tif err := configuration.Deserialize(bytes.NewBuffer(buf)); err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"deserialize, contract params deserialize error: %v\", err)\n\t}\n\tcontract := native.ContextRef.CurrentContext().ContractAddress\n\n\t// check if initConfig is already execute\n\tgovernanceViewBytes, err := native.CacheDB.Get(utils.ConcatKey(contract, []byte(GOVERNANCE_VIEW)))\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"getGovernanceView, get governanceViewBytes error: %v\", err)\n\t}\n\tif governanceViewBytes != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"initConfig. initConfig is already executed\")\n\t}\n\n\t//check the configuration\n\terr = CheckVBFTConfig(configuration)\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"checkVBFTConfig failed: %v\", err)\n\t}\n\n\t//init globalParam\n\tglobalParam := &GlobalParam{\n\t\tCandidateFee: 500000000000,\n\t\tMinInitStake: configuration.MinInitStake,\n\t\tCandidateNum: 7 * 7,\n\t\tPosLimit: 20,\n\t\tA: 50,\n\t\tB: 50,\n\t\tYita: 5,\n\t\tPenalty: 5,\n\t}\n\terr = putGlobalParam(native, contract, globalParam)\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"putGlobalParam, put globalParam error: %v\", err)\n\t}\n\n\tvar view uint32 = 1\n\tvar maxId uint32\n\n\tpeerPoolMap := &PeerPoolMap{\n\t\tPeerPoolMap: make(map[string]*PeerPoolItem),\n\t}\n\tfor _, peer := range configuration.Peers {\n\t\tif peer.Index > maxId {\n\t\t\tmaxId = peer.Index\n\t\t}\n\t\taddress, err := common.AddressFromBase58(peer.Address)\n\t\tif err != nil {\n\t\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"common.AddressFromBase58, address format error: %v\", err)\n\t\t}\n\n\t\tpeerPoolItem := new(PeerPoolItem)\n\t\tpeerPoolItem.Index = peer.Index\n\t\tpeerPoolItem.PeerPubkey = peer.PeerPubkey\n\t\tpeerPoolItem.Address = address\n\t\tpeerPoolItem.InitPos = peer.InitPos\n\t\tpeerPoolItem.TotalPos = 0\n\t\tpeerPoolItem.Status = ConsensusStatus\n\t\tpeerPoolMap.PeerPoolMap[peerPoolItem.PeerPubkey] = peerPoolItem\n\n\t\tpeerPubkeyPrefix, err := hex.DecodeString(peerPoolItem.PeerPubkey)\n\t\tif err != nil {\n\t\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"hex.DecodeString, peerPubkey format error: %v\", err)\n\t\t}\n\t\tindex := peerPoolItem.Index\n\t\tindexBytes, err := GetUint32Bytes(index)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"getUint32Bytes, getUint32Bytes error: %v\", err)\n\t\t}\n\t\tnative.CacheDB.Put(utils.ConcatKey(contract, []byte(PEER_INDEX), peerPubkeyPrefix), cstates.GenRawStorageItem(indexBytes))\n\n\t\t//update total stake\n\t\terr = depositTotalStake(native, contract, address, peerPoolItem.InitPos)\n\t\tif err != nil {\n\t\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"depositTotalStake, depositTotalStake error: %v\", err)\n\t\t}\n\t}\n\n\t//init peer pool\n\terr = putPeerPoolMap(native, contract, 0, peerPoolMap)\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"putPeerPoolMap, put peerPoolMap error: %v\", err)\n\t}\n\terr = putPeerPoolMap(native, contract, view, peerPoolMap)\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"putPeerPoolMap, put peerPoolMap error: %v\", err)\n\t}\n\tindexBytes, err := GetUint32Bytes(maxId + 1)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getUint32Bytes, get indexBytes error: %v\", err)\n\t}\n\tnative.CacheDB.Put(utils.ConcatKey(contract, []byte(CANDIDITE_INDEX)), cstates.GenRawStorageItem(indexBytes))\n\n\t//init governance view\n\tgovernanceView := &GovernanceView{\n\t\tView: view,\n\t\tHeight: native.Height,\n\t\tTxHash: native.Tx.Hash(),\n\t}\n\terr = putGovernanceView(native, contract, governanceView)\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"putGovernanceView, put governanceView error: %v\", err)\n\t}\n\n\t//init config\n\tconfig := &Configuration{\n\t\tN: configuration.N,\n\t\tC: configuration.C,\n\t\tK: configuration.K,\n\t\tL: configuration.L,\n\t\tBlockMsgDelay: configuration.BlockMsgDelay,\n\t\tHashMsgDelay: configuration.HashMsgDelay,\n\t\tPeerHandshakeTimeout: configuration.PeerHandshakeTimeout,\n\t\tMaxBlockChangeView: configuration.MaxBlockChangeView,\n\t}\n\terr = putConfig(native, contract, config)\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"putConfig, put config error: %v\", err)\n\t}\n\n\t//init splitCurve\n\tsplitCurve := &SplitCurve{\n\t\tYi: []uint32{\n\t\t\t0, 95123, 180968, 258213, 327493, 389401, 444491, 493282, 536257, 573866, 606531, 634645, 658574, 678660, 695220, 708550,\n\t\t\t718927, 726606, 731826, 734808, 735759, 734870, 732317, 728265, 722867, 716262, 708583, 699949, 690472, 680254, 669391,\n\t\t\t657969, 646069, 633765, 621124, 608209, 595076, 581778, 568361, 554869, 541342, 527814, 514317, 500882, 487534, 474297,\n\t\t\t461191, 448236, 435447, 422839, 410425, 398217, 386223, 374452, 362910, 351604, 340537, 329713, 319135, 308805, 298723,\n\t\t\t288890, 279306, 269969, 260879, 252033, 243429, 235066, 226939, 219045, 211382, 203945, 196731, 189736, 182955, 176384,\n\t\t\t170018, 163854, 157887, 152113, 146526, 141122, 135896, 130845, 125963, 121246, 116690, 112290, 108041, 103940, 99981,\n\t\t\t96162, 92477, 88923, 85496, 82192, 79006, 75936, 72977, 70126, 67380,\n\t\t},\n\t}\n\terr = putSplitCurve(native, contract, splitCurve)\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"putSplitCurve, put splitCurve error: %v\", err)\n\t}\n\n\t//init admin OntID\n\terr = appCallInitContractAdmin(native, []byte(configuration.AdminOntID))\n\tif err != nil {\n\t\treturn utils.BYTE_FALSE, fmt.Errorf(\"appCallInitContractAdmin error: %v\", err)\n\t}\n\n\treturn utils.BYTE_TRUE, nil\n}", "title": "" }, { "docid": "b342bdf122c8aab588d5110204315aae", "score": "0.47048488", "text": "func buildConfig() string {\n\treturn fmt.Sprintf(\"grpc_port: %d\", *rpcPort)\n}", "title": "" }, { "docid": "18602586b930c3c0a6cc4394e9a624a4", "score": "0.47039086", "text": "func GenerateOPLConfig(namespaces []string, out io.Writer) error {\n\tt, err := template.New(\"config_template\").ParseFS(configTemplate, \"config_template/*\")\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\treturn errors.WithStack(t.ExecuteTemplate(out,\n\t\t\"namespaces.ts.tmpl\",\n\t\tstruct{ Namespaces []string }{Namespaces: namespaces}))\n}", "title": "" }, { "docid": "fb4cbef51cedc49f136c3808ea6f90c4", "score": "0.4699823", "text": "func getProfileParentConfigParams(tcParentConfigParams []tc.Parameter) (map[string]map[string]string, []string) {\n\twarnings := []string{}\n\tparentConfigParamsWithProfiles, err := tcParamsToParamsWithProfiles(tcParentConfigParams)\n\tif err != nil {\n\t\twarnings = append(warnings, \"error getting profiles from Traffic Ops Parameters, Parameters will not be considered for generation! : \"+err.Error())\n\t\tparentConfigParamsWithProfiles = []parameterWithProfiles{}\n\t}\n\n\t// this is an optimization, to avoid looping over all params, for every DS. Instead, we loop over all params only once, and put them in a profile map.\n\tprofileParentConfigParams := map[string]map[string]string{} // map[profileName][paramName]paramVal\n\tfor _, param := range parentConfigParamsWithProfiles {\n\t\tfor _, profile := range param.ProfileNames {\n\t\t\tif _, ok := profileParentConfigParams[profile]; !ok {\n\t\t\t\tprofileParentConfigParams[profile] = map[string]string{}\n\t\t\t}\n\t\t\tprofileParentConfigParams[profile][param.Name] = param.Value\n\t\t}\n\t}\n\treturn profileParentConfigParams, warnings\n}", "title": "" }, { "docid": "a5d8c6dc91e4d837027728353386ad17", "score": "0.4698145", "text": "func AddIndependentPropertyGeneratorsForSysctlConfig_STATUS_ARM(gens map[string]gopter.Gen) {\n\tgens[\"FsAioMaxNr\"] = gen.PtrOf(gen.Int())\n\tgens[\"FsFileMax\"] = gen.PtrOf(gen.Int())\n\tgens[\"FsInotifyMaxUserWatches\"] = gen.PtrOf(gen.Int())\n\tgens[\"FsNrOpen\"] = gen.PtrOf(gen.Int())\n\tgens[\"KernelThreadsMax\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetCoreNetdevMaxBacklog\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetCoreOptmemMax\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetCoreRmemDefault\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetCoreRmemMax\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetCoreSomaxconn\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetCoreWmemDefault\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetCoreWmemMax\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetIpv4IpLocalPortRange\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"NetIpv4NeighDefaultGcThresh1\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetIpv4NeighDefaultGcThresh2\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetIpv4NeighDefaultGcThresh3\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetIpv4TcpFinTimeout\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetIpv4TcpKeepaliveProbes\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetIpv4TcpKeepaliveTime\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetIpv4TcpMaxSynBacklog\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetIpv4TcpMaxTwBuckets\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetIpv4TcpTwReuse\"] = gen.PtrOf(gen.Bool())\n\tgens[\"NetIpv4TcpkeepaliveIntvl\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetNetfilterNfConntrackBuckets\"] = gen.PtrOf(gen.Int())\n\tgens[\"NetNetfilterNfConntrackMax\"] = gen.PtrOf(gen.Int())\n\tgens[\"VmMaxMapCount\"] = gen.PtrOf(gen.Int())\n\tgens[\"VmSwappiness\"] = gen.PtrOf(gen.Int())\n\tgens[\"VmVfsCachePressure\"] = gen.PtrOf(gen.Int())\n}", "title": "" }, { "docid": "5f771047f8c90b54752f4333036ab28e", "score": "0.46808365", "text": "func newConfig(opts ...Option) config {\n\tc := config{\n\t\tMeterProvider: otel.GetMeterProvider(),\n\t\tMinimumReadMemStatsInterval: DefaultMinimumReadMemStatsInterval,\n\t}\n\tfor _, opt := range opts {\n\t\topt.ApplyRuntime(&c)\n\t}\n\treturn c\n}", "title": "" }, { "docid": "7de30d14e1abe4e46af3eea874d09e76", "score": "0.4673383", "text": "func AddIndependentPropertyGeneratorsForCloningInfo_ARM(gens map[string]gopter.Gen) {\n\tgens[\"AppSettingsOverrides\"] = gen.MapOf(gen.AlphaString(), gen.AlphaString())\n\tgens[\"CloneCustomHostNames\"] = gen.PtrOf(gen.Bool())\n\tgens[\"CloneSourceControl\"] = gen.PtrOf(gen.Bool())\n\tgens[\"ConfigureLoadBalancing\"] = gen.PtrOf(gen.Bool())\n\tgens[\"CorrelationId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"HostingEnvironment\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Overwrite\"] = gen.PtrOf(gen.Bool())\n\tgens[\"SourceWebAppId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"SourceWebAppLocation\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"TrafficManagerProfileId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"TrafficManagerProfileName\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "b40d1a1b37015814355397d662d21034", "score": "0.46731085", "text": "func (client SecurityAdminConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"networkManagerName\": autorest.Encode(\"path\", networkManagerName),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2022-05-01\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\tif top != nil {\n\t\tqueryParameters[\"$top\"] = autorest.Encode(\"query\", *top)\n\t}\n\tif len(skipToken) > 0 {\n\t\tqueryParameters[\"$skipToken\"] = autorest.Encode(\"query\", skipToken)\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "title": "" }, { "docid": "ad9051850cfca929ecafdc8a6d0d5999", "score": "0.4666744", "text": "func (l *logHints) CreateConfig(event bus.Event) []*common.Config {\n\t// Clone original config\n\tconfig, _ := common.NewConfigFrom(l.Config)\n\thost, _ := event[\"host\"].(string)\n\tif host == \"\" {\n\t\treturn []*common.Config{}\n\t}\n\n\tvar hints common.MapStr\n\thIface, ok := event[\"hints\"]\n\tif ok {\n\t\thints, _ = hIface.(common.MapStr)\n\t}\n\n\tif builder.IsNoOp(hints, l.Key) {\n\t\tlogp.Debug(\"hints.builder\", \"disabled config in event: %+v\", event)\n\t\treturn []*common.Config{}\n\t}\n\n\tinputConfig := l.getInputs(hints)\n\tif inputConfig != nil {\n\t\tconfigs := []*common.Config{}\n\t\tfor _, cfg := range inputConfig {\n\t\t\tif config, err := common.NewConfigFrom(cfg); err == nil {\n\t\t\t\tconfigs = append(configs, config)\n\t\t\t}\n\t\t}\n\t\tlogp.Debug(\"hints.builder\", \"generated config %+v\", configs)\n\t\t// Apply information in event to the template to generate the final config\n\t\treturn template.ApplyConfigTemplate(event, configs)\n\t}\n\n\ttempCfg := common.MapStr{}\n\tmline := l.getMultiline(hints)\n\tif len(mline) != 0 {\n\t\ttempCfg.Put(multiline, mline)\n\t}\n\tif ilines := l.getIncludeLines(hints); len(ilines) != 0 {\n\t\ttempCfg.Put(includeLines, ilines)\n\t}\n\tif elines := l.getExcludeLines(hints); len(elines) != 0 {\n\t\ttempCfg.Put(excludeLines, elines)\n\t}\n\n\tif procs := l.getProcessors(hints); len(procs) != 0 {\n\t\ttempCfg.Put(processors, procs)\n\t}\n\n\t// Merge config template with the configs from the annotations\n\tif err := config.Merge(tempCfg); err != nil {\n\t\tlogp.Debug(\"hints.builder\", \"config merge failed with error: %v\", err)\n\t\treturn []*common.Config{config}\n\t}\n\n\tmodule := l.getModule(hints)\n\tif module != \"\" {\n\t\tmoduleConf := map[string]interface{}{\n\t\t\t\"module\": module,\n\t\t}\n\n\t\tfilesets := l.getFilesets(hints, module)\n\t\tfor fileset, conf := range filesets {\n\t\t\tfilesetConf, _ := common.NewConfigFrom(config)\n\t\t\tfilesetConf.SetString(\"containers.stream\", -1, conf.Stream)\n\n\t\t\tmoduleConf[fileset+\".enabled\"] = conf.Enabled\n\t\t\tmoduleConf[fileset+\".input\"] = filesetConf\n\n\t\t\tlogp.Debug(\"hints.builder\", \"generated config %+v\", moduleConf)\n\t\t}\n\t\tconfig, _ = common.NewConfigFrom(moduleConf)\n\t}\n\tlogp.Debug(\"hints.builder\", \"generated config %+v\", config)\n\n\t// Apply information in event to the template to generate the final config\n\treturn template.ApplyConfigTemplate(event, []*common.Config{config})\n}", "title": "" }, { "docid": "0fd168f3f147e76e2690d60774894c0d", "score": "0.4656746", "text": "func createConfiguration(rCfg *Config) (*configuration, error) {\n\tvar err error\n\tvar c configuration\n\t// Set ports\n\tif rCfg.Protocols.GRPC != nil {\n\t\tc.CollectorGRPCServerSettings = *rCfg.Protocols.GRPC\n\t\tif c.CollectorGRPCPort, err = extractPortFromEndpoint(rCfg.Protocols.GRPC.NetAddr.Endpoint); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to extract port for the gRPC endpoint: %w\", err)\n\t\t}\n\t}\n\n\tif rCfg.Protocols.HTTP != nil {\n\t\tc.CollectorHTTPSettings = *rCfg.Protocols.HTTP\n\t\tif c.CollectorHTTPPort, err = extractPortFromEndpoint(rCfg.Protocols.HTTP.Endpoint); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to extract port for the HTTP endpoint: %w\", err)\n\t\t}\n\t}\n\treturn &c, nil\n}", "title": "" }, { "docid": "3e663041082014d4799be0a983b1590e", "score": "0.46531355", "text": "func (m *MuxConfig) Build() *proxyman.MultiplexingConfig {\n\tif m.Concurrency < 0 {\n\t\treturn nil\n\t}\n\n\tvar con uint32 = 8\n\tif m.Concurrency > 0 {\n\t\tcon = uint32(m.Concurrency)\n\t}\n\n\treturn &proxyman.MultiplexingConfig{\n\t\tEnabled: m.Enabled,\n\t\tConcurrency: con,\n\t}\n}", "title": "" }, { "docid": "3e663041082014d4799be0a983b1590e", "score": "0.46531355", "text": "func (m *MuxConfig) Build() *proxyman.MultiplexingConfig {\n\tif m.Concurrency < 0 {\n\t\treturn nil\n\t}\n\n\tvar con uint32 = 8\n\tif m.Concurrency > 0 {\n\t\tcon = uint32(m.Concurrency)\n\t}\n\n\treturn &proxyman.MultiplexingConfig{\n\t\tEnabled: m.Enabled,\n\t\tConcurrency: con,\n\t}\n}", "title": "" }, { "docid": "588e0620659718bbafed3d631bcab9fe", "score": "0.46522143", "text": "func InitParameters(w int, n int) (params SchemeParameters, err error) {\n\tif (w != 0) && (w&(w-1)) != 0 {\n\t\treturn params, errors.New(\"w should be of power 2 and larger than 0\")\n\t}\n\tif n != 32 && n != 64 {\n\t\treturn params, errors.New(\"n should be 32 or 64 bytes security\")\n\t}\n\tparams.n = n\n\tparams.w = w\n\tparams.logw = int(math.Log2(float64(w)))\n\tparams.length1 = int(math.Ceil(float64((n * 8) / params.logw)))\n\tparams.length2 = int(math.Floor(math.Log2(float64(params.length1*(params.w-1))) /\n\t\tfloat64(params.logw)))\n\tparams.length = params.length1 + params.length2\n\n\treturn params, err\n}", "title": "" }, { "docid": "7afa3b84fb212d0a9e7c3b3c3a4abc77", "score": "0.46508726", "text": "func NewConmon_createContainer_Params_List(s *capnp.Segment, sz int32) (Conmon_createContainer_Params_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz)\n\treturn capnp.StructList[Conmon_createContainer_Params](l), err\n}", "title": "" }, { "docid": "619d4989d797f16030f18c426bb9ba97", "score": "0.4643447", "text": "func NewReceiver_send_Params_List(s *capnp.Segment, sz int32) (Receiver_send_Params_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz)\n\treturn Receiver_send_Params_List{l}, err\n}", "title": "" }, { "docid": "2d073c972c1ceef67e292ea0ac671837", "score": "0.46357855", "text": "func NewConfig() *Config {\n\treturn &Config{\n\t\tCount: 8,\n\t\tPortable: true,\n\t\tAlgorithm: \"bcrypt\",\n\t\tItoa: \"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n\t}\n}", "title": "" }, { "docid": "9eea70fa22dd917d009f7ff0b13b0826", "score": "0.4630194", "text": "func generateTLSConfig(protos []string) *tls.Config {\n\tkey, err := rsa.GenerateKey(rand.Reader, 1024)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ttemplate := x509.Certificate{SerialNumber: big.NewInt(1)}\n\tcertDER, err := x509.CreateCertificate(rand.Reader,\n\t\t&template, &template, &key.PublicKey, key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tkeyPEM := pem.EncodeToMemory(&pem.Block{\n\t\tType: \"RSA PRIVATE KEY\",\n\t\tBytes: x509.MarshalPKCS1PrivateKey(key),\n\t})\n\tcertPEM := pem.EncodeToMemory(&pem.Block{\n\t\tType: \"CERTIFICATE\",\n\t\tBytes: certDER,\n\t})\n\n\ttlsCert, err := tls.X509KeyPair(certPEM, keyPEM)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn &tls.Config{\n\t\tCertificates: []tls.Certificate{tlsCert},\n\t\tNextProtos: protos,\n\t}\n}", "title": "" }, { "docid": "5ffb9556ba5a82996fd48adeaba61867", "score": "0.46274674", "text": "func AddIndependentPropertyGeneratorsForEncryptionConfiguration_STATUS(gens map[string]gopter.Gen) {\n\tgens[\"KeyName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"KeyVersion\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"VaultBaseUrl\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "c1295a8131b14bc5d37af7e5194453b2", "score": "0.46191317", "text": "func (cfg *cfgBucket) BuildRouteConfig(useSsl bool, networkType string, firstConnect bool, loopbackAddr *localLoopbackAddress) *routeConfig {\n\tvar (\n\t\tkvServerList = routeEndpoints{}\n\t\tcapiEpList = routeEndpoints{}\n\t\tmgmtEpList = routeEndpoints{}\n\t\tn1qlEpList = routeEndpoints{}\n\t\tftsEpList = routeEndpoints{}\n\t\tcbasEpList = routeEndpoints{}\n\t\teventingEpList = routeEndpoints{}\n\t\tgsiEpList = routeEndpoints{}\n\t\tbackupEpList = routeEndpoints{}\n\t\tbktType bucketType\n\t)\n\n\tswitch cfg.NodeLocator {\n\tcase \"ketama\":\n\t\tbktType = bktTypeMemcached\n\tcase \"vbucket\":\n\t\tbktType = bktTypeCouchbase\n\tdefault:\n\t\tif cfg.UUID == \"\" {\n\t\t\tbktType = bktTypeNone\n\t\t} else {\n\t\t\tlogDebugf(\"Invalid nodeLocator %s\", cfg.NodeLocator)\n\t\t\tbktType = bktTypeInvalid\n\t\t}\n\t}\n\n\tif cfg.NodesExt != nil {\n\t\tlenNodes := len(cfg.Nodes)\n\t\tfor i, node := range cfg.NodesExt {\n\t\t\thostname := node.Hostname\n\t\t\tports := node.Services\n\n\t\t\tif networkType != \"default\" {\n\t\t\t\tif altAddr, ok := node.AltAddresses[networkType]; ok {\n\t\t\t\t\thostname = altAddr.Hostname\n\t\t\t\t\tif altAddr.Ports != nil {\n\t\t\t\t\t\tports = *altAddr.Ports\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif !firstConnect {\n\t\t\t\t\t\tlogDebugf(\"Invalid config network type %s\", networkType)\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar isSeedNode bool\n\t\t\tif loopbackAddr == nil {\n\t\t\t\thostname = getHostname(hostname, cfg.SourceHostname)\n\t\t\t} else {\n\t\t\t\tisSeedNode = fmt.Sprintf(\"%s:%d\", node.Hostname, node.Services.Mgmt) == loopbackAddr.Identifier\n\t\t\t\tif isSeedNode {\n\t\t\t\t\tlogDebugf(\"Seed node detected and set to overwrite, setting hostname to %s\", loopbackAddr.LoopbackAddr)\n\t\t\t\t\thostname = loopbackAddr.LoopbackAddr\n\t\t\t\t} else {\n\t\t\t\t\thostname = getHostname(hostname, cfg.SourceHostname)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tendpoints := endpointsFromPorts(ports, hostname, isSeedNode)\n\t\t\tif endpoints.kvServer.Address != \"\" {\n\t\t\t\tif bktType > bktTypeInvalid && i >= lenNodes {\n\t\t\t\t\tlogDebugf(\"KV node present in nodesext but not in nodes for %s\", endpoints.kvServer.Address)\n\t\t\t\t} else {\n\t\t\t\t\tkvServerList.NonSSLEndpoints = append(kvServerList.NonSSLEndpoints, endpoints.kvServer)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif endpoints.capiEp.Address != \"\" {\n\t\t\t\tcapiEpList.NonSSLEndpoints = append(capiEpList.NonSSLEndpoints, endpoints.capiEp)\n\t\t\t}\n\t\t\tif endpoints.mgmtEp.Address != \"\" {\n\t\t\t\tmgmtEpList.NonSSLEndpoints = append(mgmtEpList.NonSSLEndpoints, endpoints.mgmtEp)\n\t\t\t}\n\t\t\tif endpoints.n1qlEp.Address != \"\" {\n\t\t\t\tn1qlEpList.NonSSLEndpoints = append(n1qlEpList.NonSSLEndpoints, endpoints.n1qlEp)\n\t\t\t}\n\t\t\tif endpoints.ftsEp.Address != \"\" {\n\t\t\t\tftsEpList.NonSSLEndpoints = append(ftsEpList.NonSSLEndpoints, endpoints.ftsEp)\n\t\t\t}\n\t\t\tif endpoints.cbasEp.Address != \"\" {\n\t\t\t\tcbasEpList.NonSSLEndpoints = append(cbasEpList.NonSSLEndpoints, endpoints.cbasEp)\n\t\t\t}\n\t\t\tif endpoints.eventingEp.Address != \"\" {\n\t\t\t\teventingEpList.NonSSLEndpoints = append(eventingEpList.NonSSLEndpoints, endpoints.eventingEp)\n\t\t\t}\n\t\t\tif endpoints.gsiEp.Address != \"\" {\n\t\t\t\tgsiEpList.NonSSLEndpoints = append(gsiEpList.NonSSLEndpoints, endpoints.gsiEp)\n\t\t\t}\n\t\t\tif endpoints.backupEp.Address != \"\" {\n\t\t\t\tbackupEpList.NonSSLEndpoints = append(backupEpList.NonSSLEndpoints, endpoints.backupEp)\n\t\t\t}\n\n\t\t\tif endpoints.kvServerSSL.Address != \"\" {\n\t\t\t\tif bktType > bktTypeInvalid && i >= lenNodes {\n\t\t\t\t\tlogDebugf(\"KV node present in nodesext but not in nodes for %s\", endpoints.kvServerSSL.Address)\n\t\t\t\t} else {\n\t\t\t\t\tkvServerList.SSLEndpoints = append(kvServerList.SSLEndpoints, endpoints.kvServerSSL)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif endpoints.capiEpSSL.Address != \"\" {\n\t\t\t\tcapiEpList.SSLEndpoints = append(capiEpList.SSLEndpoints, endpoints.capiEpSSL)\n\t\t\t}\n\t\t\tif endpoints.mgmtEpSSL.Address != \"\" {\n\t\t\t\tmgmtEpList.SSLEndpoints = append(mgmtEpList.SSLEndpoints, endpoints.mgmtEpSSL)\n\t\t\t}\n\t\t\tif endpoints.n1qlEpSSL.Address != \"\" {\n\t\t\t\tn1qlEpList.SSLEndpoints = append(n1qlEpList.SSLEndpoints, endpoints.n1qlEpSSL)\n\t\t\t}\n\t\t\tif endpoints.ftsEpSSL.Address != \"\" {\n\t\t\t\tftsEpList.SSLEndpoints = append(ftsEpList.SSLEndpoints, endpoints.ftsEpSSL)\n\t\t\t}\n\t\t\tif endpoints.cbasEpSSL.Address != \"\" {\n\t\t\t\tcbasEpList.SSLEndpoints = append(cbasEpList.SSLEndpoints, endpoints.cbasEpSSL)\n\t\t\t}\n\t\t\tif endpoints.eventingEpSSL.Address != \"\" {\n\t\t\t\teventingEpList.SSLEndpoints = append(eventingEpList.SSLEndpoints, endpoints.eventingEpSSL)\n\t\t\t}\n\t\t\tif endpoints.gsiEpSSL.Address != \"\" {\n\t\t\t\tgsiEpList.SSLEndpoints = append(gsiEpList.SSLEndpoints, endpoints.gsiEpSSL)\n\t\t\t}\n\t\t\tif endpoints.backupEpSSL.Address != \"\" {\n\t\t\t\tbackupEpList.SSLEndpoints = append(backupEpList.SSLEndpoints, endpoints.backupEpSSL)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif useSsl {\n\t\t\tlogErrorf(\"Received config without nodesExt while SSL is enabled. Generating invalid config.\")\n\t\t\treturn &routeConfig{}\n\t\t}\n\n\t\tif bktType == bktTypeCouchbase {\n\t\t\tfor _, s := range cfg.VBucketServerMap.ServerList {\n\t\t\t\tkvServerList.NonSSLEndpoints = append(kvServerList.NonSSLEndpoints, routeEndpoint{\n\t\t\t\t\tAddress: s,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tfor _, node := range cfg.Nodes {\n\t\t\tif node.CouchAPIBase != \"\" {\n\t\t\t\t// Slice off the UUID as Go's HTTP client cannot handle being passed URL-Encoded path values.\n\t\t\t\tcapiEp := strings.SplitN(node.CouchAPIBase, \"%2B\", 2)[0]\n\n\t\t\t\tcapiEpList.NonSSLEndpoints = append(capiEpList.NonSSLEndpoints, routeEndpoint{\n\t\t\t\t\tAddress: capiEp,\n\t\t\t\t})\n\t\t\t}\n\t\t\tif node.Hostname != \"\" {\n\t\t\t\tmgmtEpList.NonSSLEndpoints = append(mgmtEpList.NonSSLEndpoints, routeEndpoint{\n\t\t\t\t\tAddress: fmt.Sprintf(\"http://%s\", node.Hostname),\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tif bktType == bktTypeMemcached {\n\t\t\t\t// Get the data port. No VBucketServerMap.\n\t\t\t\thost, err := hostFromHostPort(node.Hostname)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogErrorf(\"Encountered invalid memcached host/port string. Ignoring node.\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tcurKvHost := fmt.Sprintf(\"%s:%d\", host, node.Ports[\"direct\"])\n\t\t\t\tkvServerList.NonSSLEndpoints = append(kvServerList.NonSSLEndpoints, routeEndpoint{\n\t\t\t\t\tAddress: curKvHost,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\trc := &routeConfig{\n\t\trevID: cfg.Rev,\n\t\trevEpoch: cfg.RevEpoch,\n\t\tuuid: cfg.UUID,\n\t\tname: cfg.Name,\n\t\tkvServerList: kvServerList,\n\t\tcapiEpList: capiEpList,\n\t\tmgmtEpList: mgmtEpList,\n\t\tn1qlEpList: n1qlEpList,\n\t\tftsEpList: ftsEpList,\n\t\tcbasEpList: cbasEpList,\n\t\teventingEpList: eventingEpList,\n\t\tgsiEpList: gsiEpList,\n\t\tbackupEpList: backupEpList,\n\t\tbktType: bktType,\n\t\tclusterCapabilities: cfg.ClusterCapabilities,\n\t\tclusterCapabilitiesVer: cfg.ClusterCapabilitiesVer,\n\t\tbucketCapabilities: cfg.Capabilities,\n\t\tbucketCapabilitiesVer: cfg.CapabilitiesVersion,\n\t}\n\n\tif bktType == bktTypeCouchbase {\n\t\tvbMap := cfg.VBucketServerMap.VBucketMap\n\t\tnumReplicas := cfg.VBucketServerMap.NumReplicas\n\t\trc.vbMap = newVbucketMap(vbMap, numReplicas)\n\t} else if bktType == bktTypeMemcached {\n\t\tvar endpoints []routeEndpoint\n\t\tif useSsl {\n\t\t\tendpoints = kvServerList.SSLEndpoints\n\t\t} else {\n\t\t\tendpoints = kvServerList.NonSSLEndpoints\n\t\t}\n\t\trc.ketamaMap = newKetamaContinuum(endpoints)\n\t}\n\n\treturn rc\n}", "title": "" }, { "docid": "dcf793aa02c4c79d834e377bb415876d", "score": "0.46147296", "text": "func GenerateSignerConfig(roleMask int, ouString string, enrollmentId string, revocationHandle int, key *idemix.IssuerKey, revKey *ecdsa.PrivateKey) ([]byte, error) {\n\tattrs := make([]*FP256BN.BIG, 4)\n\n\tif ouString == \"\" {\n\t\treturn nil, errors.Errorf(\"the OU attribute value is empty\")\n\t}\n\n\tif enrollmentId == \"\" {\n\t\treturn nil, errors.Errorf(\"the enrollment id value is empty\")\n\t}\n\n\tattrs[msp.AttributeIndexOU] = idemix.HashModOrder([]byte(ouString))\n\tattrs[msp.AttributeIndexRole] = FP256BN.NewBIGint(roleMask)\n\tattrs[msp.AttributeIndexEnrollmentId] = idemix.HashModOrder([]byte(enrollmentId))\n\tattrs[msp.AttributeIndexRevocationHandle] = FP256BN.NewBIGint(revocationHandle)\n\n\trng, err := idemix.GetRand()\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"Error getting PRNG\")\n\t}\n\tsk := idemix.RandModOrder(rng)\n\tni := idemix.BigToBytes(idemix.RandModOrder(rng))\n\tmsg := idemix.NewCredRequest(sk, ni, key.Ipk, rng)\n\tcred, err := idemix.NewCredential(key, msg, attrs, rng)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"failed to generate a credential\")\n\t}\n\n\tcredBytes, err := proto.Marshal(cred)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"failed to marshal credential\")\n\t}\n\n\t// NOTE currently, idemixca creates CRI's with \"ALG_NO_REVOCATION\"\n\tcri, err := idemix.CreateCRI(revKey, []*FP256BN.BIG{FP256BN.NewBIGint(revocationHandle)}, 0, idemix.ALG_NO_REVOCATION, rng)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcriBytes, err := proto.Marshal(cri)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"failed to marshal CRI\")\n\t}\n\n\tsigner := &m.IdemixMSPSignerConfig{\n\t\tCred: credBytes,\n\t\tSk: idemix.BigToBytes(sk),\n\t\tOrganizationalUnitIdentifier: ouString,\n\t\tRole: int32(roleMask),\n\t\tEnrollmentId: enrollmentId,\n\t\tCredentialRevocationInformation: criBytes,\n\t}\n\n\treturn proto.Marshal(signer)\n}", "title": "" }, { "docid": "9cd94b2d1dfe59c363eead97e18a5088", "score": "0.46139812", "text": "func FillConfig(req *api.NetworksPost) error {\n\tdriverFunc, ok := drivers[req.Type]\n\tif !ok {\n\t\treturn ErrUnknownDriver\n\t}\n\n\tn := driverFunc()\n\tn.init(nil, 0, project.Default, req.Name, req.Type, req.Description, req.Config, \"Unknown\")\n\n\terr := n.fillConfig(req.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fc998db0473f364f75e4c5d906a69d48", "score": "0.46118027", "text": "func AddRelatedPropertyGeneratorsForFactory_Spec(gens map[string]gopter.Gen) {\n\tgens[\"Encryption\"] = gen.PtrOf(EncryptionConfigurationGenerator())\n\tgens[\"GlobalParameters\"] = gen.MapOf(gen.AlphaString(), GlobalParameterSpecificationGenerator())\n\tgens[\"Identity\"] = gen.PtrOf(FactoryIdentityGenerator())\n\tgens[\"PurviewConfiguration\"] = gen.PtrOf(PurviewConfigurationGenerator())\n\tgens[\"RepoConfiguration\"] = gen.PtrOf(FactoryRepoConfigurationGenerator())\n}", "title": "" }, { "docid": "b636bfb025917acba7017b46df1c228e", "score": "0.45966697", "text": "func (p *PKI) GenerateConfig(opt ...Option) (*authority.Config, error) {\n\tkey, err := p.ottPrivateKey.CompactSerialize()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error serializing private key\")\n\t}\n\n\tprov := &provisioner.JWK{\n\t\tName: p.provisioner,\n\t\tType: \"JWK\",\n\t\tKey: p.ottPublicKey,\n\t\tEncryptedKey: key,\n\t}\n\n\tvar authorityOptions *apiv1.Options\n\tif !p.casOptions.Is(apiv1.SoftCAS) {\n\t\tauthorityOptions = &p.casOptions\n\t}\n\n\tconfig := &authority.Config{\n\t\tRoot: []string{p.root},\n\t\tFederatedRoots: []string{},\n\t\tIntermediateCert: p.intermediate,\n\t\tIntermediateKey: p.intermediateKey,\n\t\tAddress: p.address,\n\t\tDNSNames: p.dnsNames,\n\t\tLogger: []byte(`{\"format\": \"text\"}`),\n\t\tDB: &db.Config{\n\t\t\tType: \"badger\",\n\t\t\tDataSource: GetDBPath(),\n\t\t},\n\t\tAuthorityConfig: &authority.AuthConfig{\n\t\t\tOptions: authorityOptions,\n\t\t\tDisableIssuedAtCheck: false,\n\t\t\tProvisioners: provisioner.List{prov},\n\t\t},\n\t\tTLS: &authority.TLSOptions{\n\t\t\tMinVersion: authority.DefaultTLSMinVersion,\n\t\t\tMaxVersion: authority.DefaultTLSMaxVersion,\n\t\t\tRenegotiation: authority.DefaultTLSRenegotiation,\n\t\t\tCipherSuites: authority.DefaultTLSCipherSuites,\n\t\t},\n\t\tTemplates: p.getTemplates(),\n\t}\n\tif p.enableSSH {\n\t\tenableSSHCA := true\n\t\tconfig.SSH = &authority.SSHConfig{\n\t\t\tHostKey: p.sshHostKey,\n\t\t\tUserKey: p.sshUserKey,\n\t\t}\n\t\t// Enable SSH authorization for default JWK provisioner\n\t\tprov.Claims = &provisioner.Claims{\n\t\t\tEnableSSHCA: &enableSSHCA,\n\t\t}\n\t\t// Add default SSHPOP provisioner\n\t\tsshpop := &provisioner.SSHPOP{\n\t\t\tType: \"SSHPOP\",\n\t\t\tName: \"sshpop\",\n\t\t\tClaims: &provisioner.Claims{\n\t\t\t\tEnableSSHCA: &enableSSHCA,\n\t\t\t},\n\t\t}\n\t\tconfig.AuthorityConfig.Provisioners = append(config.AuthorityConfig.Provisioners, sshpop)\n\t}\n\n\t// Apply configuration modifiers\n\tfor _, o := range opt {\n\t\tif err = o(config); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "ee78cd3a9dc139be974c13d946364e18", "score": "0.45928574", "text": "func AddIndependentPropertyGeneratorsForMultichannel(gens map[string]gopter.Gen) {\n\tgens[\"Enabled\"] = gen.PtrOf(gen.Bool())\n}", "title": "" }, { "docid": "e7d3e1e7fb8cda590286184f0320499a", "score": "0.45901537", "text": "func GetDefaultConfig() *ReadableConfig {\n\n\t// Static settings\n\tpTopPlate := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 4,\n\t\tMax: 1000,\n\t\tMin: -1000,\n\t\tName: \"P Constant Top\",\n\t\tSmallName: \"pTop\",\n\t\tInfo: \"Proportional constant of the PID of the top hot plate\",\n\t\tIsStatic: true,\n\t}\n\tiTopPlate := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 0.2,\n\t\tMax: 1000,\n\t\tMin: -1000,\n\t\tName: \"I Constant Top\",\n\t\tSmallName: \"iTop\",\n\t\tInfo: \"Integral constant of the PID of the top hot plate\",\n\t\tIsStatic: true,\n\t}\n\tdTopPlate := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 1,\n\t\tMax: 1000,\n\t\tMin: -1000,\n\t\tName: \"D Constant Top\",\n\t\tSmallName: \"dTop\",\n\t\tInfo: \"Derivative constant of the PID of the top hot plate\",\n\t\tIsStatic: true,\n\t}\n\tpBottomPlate := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 4,\n\t\tMax: 1000,\n\t\tMin: -1000,\n\t\tName: \"P Constant Bottom\",\n\t\tSmallName: \"pBot\",\n\t\tInfo: \"Proportional constant of the PID of the bottom hot plate\",\n\t\tIsStatic: true,\n\t}\n\tiBottomPlate := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 0.2,\n\t\tMax: 1000,\n\t\tMin: -1000,\n\t\tName: \"I Constant Bottom\",\n\t\tSmallName: \"iBot\",\n\t\tInfo: \"Integral constant of the PID of the bottom hot plate\",\n\t\tIsStatic: true,\n\t}\n\tdBottomPlate := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 1,\n\t\tMax: 1000,\n\t\tMin: -1000,\n\t\tName: \"D Constant Bottom\",\n\t\tSmallName: \"dBot\",\n\t\tInfo: \"Derivative constant of the PID of the bottom hot plate\",\n\t\tIsStatic: false,\n\t}\n\n\t// hardnessParam := &proto.Setting{\n\t// \tDestination: proto.Destination_MICROCONTROLLER,\n\t// \tValue: 0.7,\n\t// \tMax: 1,\n\t// \tMin: 0,\n\t// \tName: \"Hardness Constant\",\n\t// \tSmallName: \"hC\",\n\t// \tInfo: \"Hardness Constant is used for the calibration of the force put on objects when loading weight.\",\n\t// \tIsStatic: false,\n\t// }\n\n\tloadFactor := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 13550,\n\t\tMax: 100000,\n\t\tMin: -100000,\n\t\tName: \"Load Cell Factor\",\n\t\tSmallName: \"lcF\",\n\t\tInfo: \"Load Cell Factor is used to calibrate the load cell.\",\n\t\tIsStatic: false,\n\t}\n\n\tpMotor := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 1,\n\t\tMax: 1000,\n\t\tMin: -1000,\n\t\tName: \"P Constant Motor\",\n\t\tSmallName: \"pM\",\n\t\tInfo: \"Proportional constant of the PID of the motor controller.\",\n\t\tIsStatic: false,\n\t}\n\n\tiMotor := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 1,\n\t\tMax: 1000,\n\t\tMin: -1000,\n\t\tName: \"I Constant Motor\",\n\t\tSmallName: \"iM\",\n\t\tInfo: \"Integral constant of the PID of the motor controller.\",\n\t\tIsStatic: false,\n\t}\n\n\tdMotor := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 1,\n\t\tMax: 1000,\n\t\tMin: -1000,\n\t\tName: \"D Constant Motor\",\n\t\tSmallName: \"dM\",\n\t\tInfo: \"Derivative constant of the PID of the motor controller.\",\n\t\tIsStatic: false,\n\t}\n\n\tstepMult := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 1,\n\t\tMax: 100,\n\t\tMin: 0,\n\t\tName: \"Step Multiplier\",\n\t\tSmallName: \"sMu\",\n\t\tInfo: \"Multiply the output of the PID with this value\",\n\t\tIsStatic: false,\n\t}\n\n\tpidST := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 100,\n\t\tMax: 10000,\n\t\tMin: 0,\n\t\tName: \"PID Sample Time (ms)\",\n\t\tSmallName: \"pidST\",\n\t\tInfo: \"Sample time in milliseconds of the PID\",\n\t\tIsStatic: false,\n\t}\n\n\tmaxLoad := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 900,\n\t\tMax: 10000,\n\t\tMin: 0,\n\t\tName: \"Max load (kg) - Safety\",\n\t\tSmallName: \"mL\",\n\t\tInfo: \"Maximum Load possible that can be applied to the load cell\",\n\t\tIsStatic: false,\n\t}\n\n\tdelaySlow := &proto.Setting{\n\t\tDestination: proto.Destination_MICROCONTROLLER,\n\t\tValue: 150,\n\t\tMax: 5000,\n\t\tMin: 50,\n\t\tName: \"Delay Step Slow Move\",\n\t\tSmallName: \"dS\",\n\t\tInfo: \"Delay in ms between each step in the slow move action.\",\n\t\tIsStatic: false,\n\t}\n\n\treturn &ReadableConfig{\n\t\tDefaultRecipe: recipe.Recipe{\n\t\t\tUUID: \"\",\n\t\t\tName: \"Default\",\n\t\t\tInfo: \"This is the default recipe from config.\",\n\t\t\tSelectors: []*proto.Selector{},\n\t\t\tSettings: []*proto.Setting{\n\t\t\t\tloadFactor, pMotor, iMotor, dMotor, stepMult, pidST, maxLoad, delaySlow,\n\t\t\t},\n\t\t\tGraphs: []*proto.GraphSettings{\n\t\t\t\t{Name: \"Weight\", UnitVerticalAxis: \"kg\", UnitHorizontalAxis: \"s\", VerticalAxis: \"Weight\", HorizontalAxis: \"Time\", Points: []*proto.Point{}, IsStatic: false},\n\t\t\t\t{Name: \"Temperature\", UnitVerticalAxis: \"°c\", UnitHorizontalAxis: \"s\", VerticalAxis: \"Temperature\", HorizontalAxis: \"Time\", Points: []*proto.Point{}, IsStatic: false},\n\t\t\t},\n\t\t},\n\t\tStaticRecipe: recipe.Recipe{\n\t\t\tUUID: \"static\",\n\t\t\tName: \"static\",\n\t\t\tInfo: \"\",\n\t\t\tSettings: []*proto.Setting{\n\t\t\t\tpTopPlate, iTopPlate, dTopPlate, pBottomPlate, iBottomPlate, dBottomPlate,\n\t\t\t},\n\t\t},\n\t\tMetrics: []metrics.Metric{\n\t\t\t{\n\t\t\t\tName: \"Plates\",\n\t\t\t\tUnit: \"mm\",\n\t\t\t\tType: \"Distance\",\n\t\t\t\tSmallName: \"d\",\n\t\t\t\tInfo: \"Distance vertical parcourue depuis derniere mise a zero.\",\n\t\t\t\tHasTarget: false,\n\t\t\t\tValue: 0,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"Load Cell\",\n\t\t\t\tUnit: \"kg\",\n\t\t\t\tType: \"Weight\",\n\t\t\t\tSmallName: \"w\",\n\t\t\t\tInfo: \"Poids vertical entre les 2 plaques.\",\n\t\t\t\tHasTarget: false,\n\t\t\t\tValue: 0,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"Top\",\n\t\t\t\tUnit: \"°c\",\n\t\t\t\tType: \"Temperature\",\n\t\t\t\tSmallName: \"tT\",\n\t\t\t\tInfo: \"Temperature de la plaque du haut.\",\n\t\t\t\tHasTarget: false,\n\t\t\t\tValue: 0,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"Bottom\",\n\t\t\t\tUnit: \"°c\",\n\t\t\t\tType: \"Temperature\",\n\t\t\t\tSmallName: \"tB\",\n\t\t\t\tInfo: \"Temperature de la plaque du bas.\",\n\t\t\t\tHasTarget: false,\n\t\t\t\tValue: 0,\n\t\t\t},\n\t\t},\n\t\tControls: []control.Config{\n\t\t\t{\n\t\t\t\t// Id: `motion-up`,\n\t\t\t\tTitle: `Motion`,\n\t\t\t\tType: int(proto.ControlConfig_ICON_BUTTON),\n\t\t\t\tIconType: \"up_arrow\",\n\t\t\t\tActionName: \"motor\",\n\t\t\t\tStateActionPayload: []string{motorUp, motorStop},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Id: `motion-down`,\n\t\t\t\tTitle: `Motion`,\n\t\t\t\tType: int(proto.ControlConfig_ICON_BUTTON),\n\t\t\t\tIconType: \"down_arrow\",\n\t\t\t\tActionName: \"motor\",\n\t\t\t\tStateActionPayload: []string{motorDown, motorStop},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Id: `motion-up`,\n\t\t\t\tTitle: `Slow Motion`,\n\t\t\t\tType: int(proto.ControlConfig_ICON_BUTTON),\n\t\t\t\tIconType: \"up_arrow\",\n\t\t\t\tActionName: \"motor\",\n\t\t\t\tStateActionPayload: []string{motorUpSlow, motorStop},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Id: `motion-down`,\n\t\t\t\tTitle: `Slow Motion`,\n\t\t\t\tType: int(proto.ControlConfig_ICON_BUTTON),\n\t\t\t\tIconType: \"down_arrow\",\n\t\t\t\tActionName: \"motor\",\n\t\t\t\tStateActionPayload: []string{motorDownSlow, motorStop},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Id: `test`,\n\t\t\t\tTitle: `Test`,\n\t\t\t\tType: int(proto.ControlConfig_TWO_STATE_BUTTON),\n\t\t\t\tStateText: []string{\"Start\", \"Stop\"},\n\t\t\t\tActionName: \"test\",\n\t\t\t\tStateActionPayload: []string{\"start\", \"stop\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Id: `home`,\n\t\t\t\tTitle: `Homing`,\n\t\t\t\tType: int(proto.ControlConfig_SINGLE_STATE_BUTTON),\n\t\t\t\tStateText: []string{\"Home\"},\n\t\t\t\tActionName: \"home\",\n\t\t\t\tStateActionPayload: []string{\"start\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Id: `weight-tare`,\n\t\t\t\tTitle: `Weight`,\n\t\t\t\tType: int(proto.ControlConfig_SINGLE_STATE_BUTTON),\n\t\t\t\tStateText: []string{\"Tare\"},\n\t\t\t\tActionName: \"weight\",\n\t\t\t\tStateActionPayload: []string{\"tare\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Id: `distance-tare`,\n\t\t\t\tTitle: `Distance`,\n\t\t\t\tType: int(proto.ControlConfig_SINGLE_STATE_BUTTON),\n\t\t\t\tStateText: []string{\"Tare\"},\n\t\t\t\tActionName: \"distance\",\n\t\t\t\tStateActionPayload: []string{\"tare\"},\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "4472c5bea44fbc2a6542d93e7001eb91", "score": "0.4583851", "text": "func AddRelatedPropertyGeneratorsForSmbSetting(gens map[string]gopter.Gen) {\n\tgens[\"Multichannel\"] = gen.PtrOf(MultichannelGenerator())\n}", "title": "" }, { "docid": "e3ec564f888fd72f11b49eaccc0efcb6", "score": "0.4581404", "text": "func (client *ExportConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ExportConfigurationsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceName}\", url.PathEscape(resourceName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2015-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "title": "" }, { "docid": "7ccb36533ee39fc22f5f45ac19f162bc", "score": "0.45768654", "text": "func CreateConfig(fn string) error {\r\n\r\n\t// config structure\r\n\tconfig := []byte(`\r\n\t{\r\n\t\t\"commands\": {\r\n\t\t\t\"concurrent\": true,\r\n\t\t\t\"list\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"directory\": \"\",\r\n\t\t\t\t\t\"concurrent\": true,\r\n\t\t\t\t\t\"list\": [{ \"cmd\": \"\"}]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"directory\": \"\",\r\n\t\t\t\t\t\"concurrent\": true,\r\n\t\t\t\t\t \"list\": [{ \"cmd\": \"\"}]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"directory\": \"\",\r\n\t\t\t\t\t\"concurrent\": true,\r\n\t\t\t\t\t \"list\": [{ \"cmd\": \"\"}]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t}\r\n\t`)\r\n\r\n\tconfigStruct := Commands{}\r\n\r\n\terr := json.Unmarshal(config, &configStruct)\r\n\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tcJSON, _ := json.Marshal(configStruct)\r\n\r\n\terr = ioutil.WriteFile(fn, cJSON, 0644)\r\n\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\treturn nil\r\n\r\n}", "title": "" }, { "docid": "69e3b83957ee462ead7f316abee22ac8", "score": "0.45743072", "text": "func newProviderConfig(routerID string, networkID *string) *openstackv1alpha1.InfrastructureConfig {\n\tvar router *openstackv1alpha1.Router\n\n\tif routerID != \"\" {\n\t\trouter = &openstackv1alpha1.Router{ID: routerID}\n\t}\n\n\treturn &openstackv1alpha1.InfrastructureConfig{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: openstackv1alpha1.SchemeGroupVersion.String(),\n\t\t\tKind: \"InfrastructureConfig\",\n\t\t},\n\t\tFloatingPoolName: *floatingPoolName,\n\t\tNetworks: openstackv1alpha1.Networks{\n\t\t\tID: networkID,\n\t\t\tRouter: router,\n\t\t\tWorkers: vpcCIDR,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "3d415be5ab8dec2157119cdbbf5a18a1", "score": "0.45736125", "text": "func initAllowlistAndBlocklistConfigs(config *Config, md toml.MetaData) {\n\t// Initialize AllowlistEnabled config\n\tconfig.Aerospike.NamespaceMetricsAllowlistEnabled = md.IsDefined(\"Aerospike\", \"namespace_metrics_allowlist\")\n\tconfig.Aerospike.SetMetricsAllowlistEnabled = md.IsDefined(\"Aerospike\", \"set_metrics_allowlist\")\n\tconfig.Aerospike.NodeMetricsAllowlistEnabled = md.IsDefined(\"Aerospike\", \"node_metrics_allowlist\")\n\tconfig.Aerospike.XdrMetricsAllowlistEnabled = md.IsDefined(\"Aerospike\", \"xdr_metrics_allowlist\")\n\tconfig.Aerospike.UserMetricsUsersAllowlistEnabled = md.IsDefined(\"Aerospike\", \"user_metrics_users_allowlist\")\n\tconfig.Aerospike.JobMetricsAllowlistEnabled = md.IsDefined(\"Aerospike\", \"job_metrics_allowlist\")\n\tconfig.Aerospike.SindexMetricsAllowlistEnabled = md.IsDefined(\"Aerospike\", \"sindex_metrics_allowlist\")\n\tconfig.Aerospike.LatenciesMetricsAllowlistEnabled = md.IsDefined(\"Aerospike\", \"latencies_metrics_allowlist\")\n\n\t// Tolerate older whitelist and blacklist configurations for a while.\n\t// If whitelist and blacklist configs are defined copy them into allowlist and blocklist.\n\t// Error out if both configurations are used at the same time.\n\tif md.IsDefined(\"Aerospike\", \"namespace_metrics_whitelist\") {\n\t\tif config.Aerospike.NamespaceMetricsAllowlistEnabled {\n\t\t\tlog.Fatalf(\"namespace_metrics_whitelist and namespace_metrics_allowlist are mutually exclusive!\")\n\t\t}\n\n\t\tconfig.Aerospike.NamespaceMetricsAllowlistEnabled = true\n\t\tconfig.Aerospike.NamespaceMetricsAllowlist = config.Aerospike.NamespaceMetricsWhitelist\n\t}\n\n\tif md.IsDefined(\"Aerospike\", \"set_metrics_whitelist\") {\n\t\tif config.Aerospike.SetMetricsAllowlistEnabled {\n\t\t\tlog.Fatalf(\"set_metrics_whitelist and set_metrics_allowlist are mutually exclusive!\")\n\t\t}\n\n\t\tconfig.Aerospike.SetMetricsAllowlistEnabled = true\n\t\tconfig.Aerospike.SetMetricsAllowlist = config.Aerospike.SetMetricsWhitelist\n\t}\n\n\tif md.IsDefined(\"Aerospike\", \"node_metrics_whitelist\") {\n\t\tif config.Aerospike.NodeMetricsAllowlistEnabled {\n\t\t\tlog.Fatalf(\"node_metrics_whitelist and node_metrics_allowlist are mutually exclusive!\")\n\t\t}\n\n\t\tconfig.Aerospike.NodeMetricsAllowlistEnabled = true\n\t\tconfig.Aerospike.NodeMetricsAllowlist = config.Aerospike.NodeMetricsWhitelist\n\t}\n\n\tif md.IsDefined(\"Aerospike\", \"xdr_metrics_whitelist\") {\n\t\tif config.Aerospike.XdrMetricsAllowlistEnabled {\n\t\t\tlog.Fatalf(\"xdr_metrics_whitelist and xdr_metrics_allowlist are mutually exclusive!\")\n\t\t}\n\n\t\tconfig.Aerospike.XdrMetricsAllowlistEnabled = true\n\t\tconfig.Aerospike.XdrMetricsAllowlist = config.Aerospike.XdrMetricsWhitelist\n\t}\n\n\tif md.IsDefined(\"Aerospike\", \"namespace_metrics_blacklist\") {\n\t\tif len(config.Aerospike.NamespaceMetricsBlocklist) > 0 {\n\t\t\tlog.Fatalf(\"namespace_metrics_blacklist and namespace_metrics_blocklist are mutually exclusive!\")\n\t\t}\n\n\t\tconfig.Aerospike.NamespaceMetricsBlocklist = config.Aerospike.NamespaceMetricsBlacklist\n\t}\n\n\tif md.IsDefined(\"Aerospike\", \"set_metrics_blacklist\") {\n\t\tif len(config.Aerospike.SetMetricsBlocklist) > 0 {\n\t\t\tlog.Fatalf(\"set_metrics_blacklist and set_metrics_blocklist are mutually exclusive!\")\n\t\t}\n\n\t\tconfig.Aerospike.SetMetricsBlocklist = config.Aerospike.SetMetricsBlacklist\n\t}\n\n\tif md.IsDefined(\"Aerospike\", \"node_metrics_blacklist\") {\n\t\tif len(config.Aerospike.NodeMetricsBlocklist) > 0 {\n\t\t\tlog.Fatalf(\"node_metrics_blacklist and node_metrics_blocklist are mutually exclusive!\")\n\t\t}\n\n\t\tconfig.Aerospike.NodeMetricsBlocklist = config.Aerospike.NodeMetricsBlacklist\n\t}\n\n\tif md.IsDefined(\"Aerospike\", \"xdr_metrics_blacklist\") {\n\t\tif len(config.Aerospike.XdrMetricsBlocklist) > 0 {\n\t\t\tlog.Fatalf(\"xdr_metrics_blacklist and xdr_metrics_blocklist are mutually exclusive!\")\n\t\t}\n\n\t\tconfig.Aerospike.XdrMetricsBlocklist = config.Aerospike.XdrMetricsBlacklist\n\t}\n}", "title": "" }, { "docid": "d485f773096f9417f17a7d6b228f9c74", "score": "0.45653868", "text": "func mkConfig(logger logger, logging, debugging bool) config {\n\tcfg := config{id: uint16(logger)}\n\tcfg.setEnabled(logging, debugging)\n\treturn cfg\n}", "title": "" }, { "docid": "c4e1904bb42deaee066a9c138a14efaa", "score": "0.45558625", "text": "func getAllConnectionsFromConfig() (cl ConnectionList) {\n\tcm := viper.GetStringMap(ConnectionsKey) // map[string]interface{}\n\tfor name := range cm {\n\t\tif c, ok := getConnectionFromConfig(name); ok {\n\t\t\tcl = append(cl, c)\n\t\t} else {\n\t\t\tpanic(fmt.Sprintf(\"Expected but couldn't find connection name %q in configuration.\", name))\n\t\t}\n\t}\n\treturn cl\n}", "title": "" }, { "docid": "b1a954f3b79763d50af5f45be2b3589f", "score": "0.4553409", "text": "func validateInputAndGenerateConfig(inParam *InputParameters) *Config {\n\t// Validate db name\n\tif len(*inParam.dbName) >= util.MaxDBNameLength {\n\t\terr := fmt.Errorf(\"error: db name should be less than 256\")\n\t\tlog.Fatalf(\"Failed to parse db name(%s).\", err.Error())\n\t}\n\tif strings.ContainsAny(*inParam.dbName, util.DBStringExceptions) {\n\t\terr := fmt.Errorf(\"error: db name should be a single world and should not have \\\"%s\\\"\",\n\t\t\tutil.DBStringExceptions)\n\t\tlog.Fatalf(\"Failed to parse db name(%s). %s\", *inParam.dbName, err.Error())\n\t}\n\n\t// Validate DNS port range\n\tif *inParam.port > util.MaxPortNumber || *inParam.port == 0 {\n\t\terr := fmt.Errorf(\"error: port number not in valid range\")\n\t\tlog.Fatalf(\"Failed to parse port number(%s).\", err.Error())\n\t}\n\n\t// Validate DNS management port range\n\tif *inParam.mgmtPort > util.MaxPortNumber || *inParam.mgmtPort == 0 {\n\t\terr := fmt.Errorf(\"error: management port number not in valid range\")\n\t\tlog.Fatalf(\"Failed to parse management port number(%s).\", err.Error())\n\t}\n\tif *inParam.port == *inParam.mgmtPort {\n\t\terr := fmt.Errorf(\"error: cannot use same port number for dns and management\")\n\t\tlog.Fatalf(\"Port number conflict(%s).\", err.Error())\n\t}\n\n\t// Validate connTimeOut range\n\tif *inParam.connTimeOut > util.MaxConnTimeout || *inParam.connTimeOut < util.MinConnTimeout {\n\t\terr := fmt.Errorf(\"error: connection timeout not in valid range(2~50)\")\n\t\tlog.Fatalf(\"Failed to parse connection timeout input(%s).\", err.Error())\n\t}\n\n\t// Validate IP address\n\tipAdd := net.ParseIP(*inParam.ipAddString)\n\tif ipAdd == nil {\n\t\terr := fmt.Errorf(\"error: parsing ip address failed, not in ipv4/ipv6 format\")\n\t\tlog.Fatalf(\"Failed to parse ip address(%s). %s\", *inParam.ipAddString, err.Error())\n\t}\n\n\tif ipAdd != nil && (ipAdd.IsMulticast() || ipAdd.Equal(net.IPv4bcast)) {\n\t\terr := fmt.Errorf(\"error: multicast or broadcast ip address \")\n\t\tlog.Fatalf(\"Multicast or broadcast ip address(%s). %s\", *inParam.ipAddString, err.Error())\n\t}\n\n\t// Validate Management IP address\n\tipMgmtAdd := net.ParseIP(*inParam.ipMgmtAddString)\n\tif ipMgmtAdd == nil {\n\t\terr := fmt.Errorf(\"error: parsing management ip address failed, not in ipv4/ipv6 format\")\n\t\tlog.Fatalf(\"Failed to parse management ip address(%s). %s\", *inParam.ipMgmtAddString, err.Error())\n\t}\n\n\tif ipMgmtAdd != nil && (ipMgmtAdd.IsMulticast() || ipMgmtAdd.Equal(net.IPv4bcast)) {\n\t\terr := fmt.Errorf(\"error: multicast or broadcast ip address \")\n\t\tlog.Fatalf(\"Multicast or broadcast ip address(%s). %s\", *inParam.ipMgmtAddString, err.Error())\n\t}\n\n\t// Validate forwarder\n\tforwarderAdd := net.ParseIP(*inParam.forwarder)\n\tif forwarderAdd == nil {\n\t\terr := fmt.Errorf(\"error: parsing forwarder failed, not in ipv4/ipv6 format\")\n\t\tlog.Fatalf(\"Failed to parse forwarder address(%s). %s\", *inParam.forwarder, err.Error())\n\t}\n\n\tif forwarderAdd != nil && (forwarderAdd.IsMulticast() || forwarderAdd.Equal(net.IPv4bcast)) {\n\t\terr := fmt.Errorf(\"error: multicast or broadcast ip address \")\n\t\tlog.Fatalf(\"Multicast or broadcast ip address(%s). %s\", *inParam.forwarder, err.Error())\n\t}\n\n\treturn &Config{dbName: *inParam.dbName,\n\t\tport: *inParam.port,\n\t\tmgmtPort: *inParam.mgmtPort,\n\t\tipAdd: ipAdd,\n\t\tipMgmtAdd: ipMgmtAdd,\n\t\tconnectionTimeout: *inParam.connTimeOut,\n\t\tforwarder: forwarderAdd,\n\t\tloadBalance: *inParam.loadBalance,\n\t}\n}", "title": "" }, { "docid": "0e33a39b091ed3a7de61533c1e72fb5e", "score": "0.45530054", "text": "func (configgen *ConfigGeneratorImpl) BuildExtensionConfiguration(\n\tproxy *model.Proxy, push *model.PushContext, extensionConfigNames []string, pullSecrets map[string][]byte,\n) []*core.TypedExtensionConfig {\n\tenvoyFilterPatches := push.EnvoyFilters(proxy)\n\textensions := envoyfilter.InsertedExtensionConfigurations(envoyFilterPatches, extensionConfigNames)\n\twasmPlugins := push.WasmPlugins(proxy)\n\textensions = append(extensions, extension.InsertedExtensionConfigurations(wasmPlugins, extensionConfigNames, pullSecrets)...)\n\treturn extensions\n}", "title": "" }, { "docid": "f7de31c5beec5ee5a3dfe0611ee5e8c8", "score": "0.45524907", "text": "func AddRelatedPropertyGeneratorsForSiteConfig_ARM(gens map[string]gopter.Gen) {\n\tgens[\"ApiDefinition\"] = gen.PtrOf(ApiDefinitionInfo_ARMGenerator())\n\tgens[\"ApiManagementConfig\"] = gen.PtrOf(ApiManagementConfig_ARMGenerator())\n\tgens[\"AppSettings\"] = gen.SliceOf(NameValuePair_ARMGenerator())\n\tgens[\"AutoHealRules\"] = gen.PtrOf(AutoHealRules_ARMGenerator())\n\tgens[\"AzureStorageAccounts\"] = gen.MapOf(gen.AlphaString(), AzureStorageInfoValue_ARMGenerator())\n\tgens[\"ConnectionStrings\"] = gen.SliceOf(ConnStringInfo_ARMGenerator())\n\tgens[\"Cors\"] = gen.PtrOf(CorsSettings_ARMGenerator())\n\tgens[\"Experiments\"] = gen.PtrOf(Experiments_ARMGenerator())\n\tgens[\"HandlerMappings\"] = gen.SliceOf(HandlerMapping_ARMGenerator())\n\tgens[\"IpSecurityRestrictions\"] = gen.SliceOf(IpSecurityRestriction_ARMGenerator())\n\tgens[\"Limits\"] = gen.PtrOf(SiteLimits_ARMGenerator())\n\tgens[\"Push\"] = gen.PtrOf(PushSettings_ARMGenerator())\n\tgens[\"ScmIpSecurityRestrictions\"] = gen.SliceOf(IpSecurityRestriction_ARMGenerator())\n\tgens[\"VirtualApplications\"] = gen.SliceOf(VirtualApplication_ARMGenerator())\n}", "title": "" }, { "docid": "785d0302efa971336e91dee9aa681259", "score": "0.45504856", "text": "func (kv *ShardKV) generateWorkList(old, new *shardmaster.Config) {\n\t// 0 is initial state, no need to send any shards\n\tif old.Num == 0 {\n\t\treturn\n\t}\n\tvar os, ns = make(map[int]bool), make(map[int]bool)\n\tfor s, g := range old.Shards {\n\t\tif g == kv.gid {\n\t\t\tos[s] = true\n\t\t}\n\t}\n\tfor s, g := range new.Shards {\n\t\tif g == kv.gid {\n\t\t\tns[s] = true\n\t\t}\n\t}\n\tvar recFrom []Item\n\tfor k, _ := range ns {\n\t\tif !os[k] {\n\t\t\trecFrom = append(recFrom, Item{k, old.Shards[k]}) //包含了所有new config与old config不同的部分\n\t\t}\n\t}\n\tif len(recFrom) != 0 {\n\t\tfmt.Printf(\"oldconfig:%v,newConfig:%v,receFrom:%v\\n\", old, new, recFrom) //recFrom中存储着需要gc的shard\n\t\tkv.workList[new.Num] = MigrateWork{recFrom, *old}\n\t}\n}", "title": "" }, { "docid": "ad3883c4472d1f34e87f6fd01641eb2a", "score": "0.4548012", "text": "func GenerateArgs(provider string) string {\n\targs := \"\"\n\n\tparams := getParams(provider)\n\n\tfor key, value := range params {\n\t\tif value != \"\" {\n\t\t\targs = args + fmt.Sprintf(\"%s=%s\", key, value) + \" \"\n\t\t}\n\t}\n\n\treturn args\n}", "title": "" }, { "docid": "8c5dadade771b797e2010a22c9d5f991", "score": "0.454156", "text": "func NewEnvoyConfigGenerator(catalog catalog.MeshCataloger, certManager *certificate.Manager) *EnvoyConfigGenerator {\n\tg := &EnvoyConfigGenerator{\n\t\tcatalog: catalog,\n\t\tcertManager: certManager,\n\t\txdsLog: make(map[string]map[envoy.TypeURI][]time.Time),\n\t}\n\tg.generators = map[envoy.TypeURI]func(context.Context, *models.Proxy) ([]types.Resource, error){\n\t\tenvoy.TypeCDS: g.generateCDS,\n\t\tenvoy.TypeEDS: g.generateEDS,\n\t\tenvoy.TypeLDS: g.generateLDS,\n\t\tenvoy.TypeRDS: g.generateRDS,\n\t\tenvoy.TypeSDS: g.generateSDS,\n\t}\n\treturn g\n}", "title": "" }, { "docid": "c80952aa1c2c1e417dd31ddc2fb03ff9", "score": "0.45345348", "text": "func (h *ConfigHandler) pullConfigList() ([]string, error) {\n\tcfgIDs := []string{}\n\n\tindex := 0\n\tlimit := h.viper.GetInt(\"sidecar.configListPageSize\")\n\n\tmodKey := ModKey(h.bizID, h.appID, h.path)\n\n\tfor {\n\t\tr := &pb.PullConfigListReq{\n\t\t\tSeq: common.Sequence(),\n\t\t\tBizId: h.viper.GetString(fmt.Sprintf(\"appmod.%s.bizid\", modKey)),\n\t\t\tAppId: h.viper.GetString(fmt.Sprintf(\"appmod.%s.appid\", modKey)),\n\t\t\tPage: &pbcommon.Page{Start: int32(index), Limit: int32(limit)},\n\t\t}\n\n\t\tctx, cancel := context.WithTimeout(context.Background(), h.viper.GetDuration(\"connserver.callTimeout\"))\n\t\tdefer cancel()\n\n\t\tlogger.V(4).Infof(\"ConfigHandler[%s %s %s]| request to connserver, %+v\", h.bizID, h.appID, h.path, r)\n\n\t\t// pull config list from connserver.\n\t\tresp, err := h.connSvrCli.PullConfigList(ctx, r)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif resp.Code != pbcommon.ErrCode_E_OK {\n\t\t\treturn nil, errors.New(resp.Message)\n\t\t}\n\n\t\tfor _, cfg := range resp.Configs {\n\t\t\tcfgIDs = append(cfgIDs, cfg.CfgId)\n\t\t}\n\n\t\tif len(resp.Configs) < limit {\n\t\t\tbreak\n\t\t}\n\t\tindex += len(resp.Configs)\n\t}\n\n\treturn cfgIDs, nil\n}", "title": "" }, { "docid": "ec4482c51c55b52ee317ea7d06a76d6e", "score": "0.4534295", "text": "func newConfigs() *config {\n\treturn &config{}\n}", "title": "" }, { "docid": "5d5f40a4724e3b9741e7f82c70e60c94", "score": "0.45338237", "text": "func genMemberConfigs(platform string, cluster string, service string, azs []string, opts *catalog.CatalogKafkaOptions) []*manage.ReplicaConfig {\n\tdomain := dns.GenDefaultDomainName(cluster)\n\n\treplicaCfgs := make([]*manage.ReplicaConfig, opts.Replicas)\n\tfor i := 0; i < int(opts.Replicas); i++ {\n\t\tmember := utils.GenServiceMemberName(service, int64(i))\n\t\tmemberHost := dns.GenDNSName(member, domain)\n\n\t\tbindip := memberHost\n\t\tif platform == common.ContainerPlatformSwarm {\n\t\t\tbindip = catalog.BindAllIP\n\t\t}\n\n\t\tindex := i % len(azs)\n\t\tcontent := fmt.Sprintf(memberfileContent, azs[index], memberHost, i, bindip)\n\n\t\t// create the member config file\n\t\tmemberCfg := &manage.ConfigFileContent{\n\t\t\tFileName: catalog.MEMBER_FILE_NAME,\n\t\t\tFileMode: common.DefaultConfigFileMode,\n\t\t\tContent: content,\n\t\t}\n\n\t\tconfigs := []*manage.ConfigFileContent{memberCfg}\n\t\treplicaCfg := &manage.ReplicaConfig{Zone: azs[index], MemberName: member, Configs: configs}\n\t\treplicaCfgs[i] = replicaCfg\n\t}\n\treturn replicaCfgs\n}", "title": "" }, { "docid": "a94aa2aa1f1279fd73bc4320447673aa", "score": "0.45265552", "text": "func GeneratePolicyParameters(in *iampmv1.Policy) (*v1alpha1.PolicyParameters, error) {\n\to := &v1alpha1.PolicyParameters{\n\t\tType: reference.FromPtrValue(in.Type),\n\t\tSubjects: GenerateCRSubjects(in.Subjects),\n\t\tRoles: GenerateCRRoles(in.Roles),\n\t\tResources: GenerateCRResources(in.Resources),\n\t\tDescription: in.Description,\n\t}\n\treturn o, nil\n}", "title": "" }, { "docid": "5f82e48ea0d82eac44f8c03fc89386dc", "score": "0.45239046", "text": "func AddIndependentPropertyGeneratorsForGlobalParameterSpecification(gens map[string]gopter.Gen) {\n\tgens[\"Type\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "dadc2702ea7506bc8793a8cdfa61fe4a", "score": "0.45220733", "text": "func GenerateVPNConfig(keysDir string, files *FileSpec, vpn *VpnSpec, out io.Writer, fetcher CertFetcher) error {\n\ttpl, err := template.New(\"VPN\").Parse(ovpnTemplate)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvd := ovpnData{\n\t\tRemoteHost: vpn.Server,\n\t\tRemotePort: vpn.Port,\n\t}\n\treadFileIn := func(path string, dest *string) error {\n\t\tc, err := fetcher(path)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"can't read certificate %s : %w\", path, err)\n\t\t}\n\t\tdata, err := ioutil.ReadAll(c)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"can't read certificate %s : %w\", path, err)\n\t\t}\n\t\t*dest = string(data)\n\t\treturn nil\n\t}\n\tif err := filepath.Walk(\n\t\tkeysDir,\n\t\tfunc(path string, info os.FileInfo, err error) error {\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tname := filepath.Base(path)\n\t\t\tswitch name {\n\t\t\tcase files.CertFile:\n\t\t\t\tif err := readFileIn(path, &vd.Cert); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\tcase files.KeyFile:\n\t\t\t\tif err := readFileIn(path, &vd.Key); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\tcase files.CAFile:\n\t\t\t\tif err := readFileIn(path, &vd.Ca); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\tcase files.PKCS12:\n\t\t\t\tr, err := fetcher(path)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tdata, err := ioutil.ReadAll(r)\n\t\t\t\tr.Close()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tdataStr := formatBase64(base64.StdEncoding.EncodeToString(data))\n\t\t\t\tvd.PKCS12 = &dataStr\n\t\t\tcase files.TAFile:\n\t\t\t\tvar v string\n\t\t\t\tif err := readFileIn(path, &v); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tvd.TlsAuth = &v\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn err\n\t}\n\treturn tpl.Execute(out, &vd)\n}", "title": "" }, { "docid": "a6a8f941a178cf977b6a1628ed8ed5dc", "score": "0.4515327", "text": "func newConfigV101() *configV101 {\n\tconf := new(configV101)\n\tconf.Version = \"1.0.1\"\n\t// make sure to allocate map's otherwise Golang\n\t// exits silently without providing any errors\n\tconf.Hosts = make(map[string]struct {\n\t\tAccessKeyID string\n\t\tSecretAccessKey string\n\t})\n\tconf.Aliases = make(map[string]string)\n\treturn conf\n}", "title": "" }, { "docid": "c4e96e1d159f7e712cde2f517f373d36", "score": "0.45129144", "text": "func NewConmon_version_Params_List(s *capnp.Segment, sz int32) (Conmon_version_Params_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz)\n\treturn capnp.StructList[Conmon_version_Params](l), err\n}", "title": "" }, { "docid": "e71d711330ad7ad77cd138f096afe4a2", "score": "0.4510599", "text": "func NewUdpPort_send_Params_List(s *capnp.Segment, sz int32) (UdpPort_send_Params_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz)\n\treturn UdpPort_send_Params_List{l}, err\n}", "title": "" }, { "docid": "bb75f5ffb1f8d01b1ac8beedbb29b62e", "score": "0.4510522", "text": "func (c *config) initConfig() {\n\n\ttr := &http.Transport{\n\t\tMaxIdleConns: 10,\n\t\tIdleConnTimeout: 30 * time.Second,\n\t}\n\n\tc.HTTPClient = &http.Client{Transport: tr}\n\tflag.StringVar(&c.oauthURL, \"oauthURL\", \"\", \"The url to proxy the call to\")\n\tflag.BoolVar(&c.dumpRequest, \"dumpRequest\", false, \"will output the request to the logs\")\n\tflag.BoolVar(&c.removeAuthHeader, \"removeAuthHeader\", true, \"will remove any authentication header set\")\n\tflag.StringToStringVar(&c.headers, \"headers\", map[string]string{}, \"Header values passed as: h1=v1,h2=v2\")\n\tflag.StringToStringVar(&c.requestBodyForm, \"requestBodyForm\", map[string]string{}, \"Request Body form parameters passed as: h1=v1,h2=v2\")\n\tflag.Parse()\n\n\tlog.Info(\"Proxy configuration has been set with the values...\")\n\tlog.Infof(\"oauthURL: %s\", c.oauthURL)\n\tlog.Infof(\"headers: %v\", c.headers)\n\tlog.Infof(\"requestBodyForm: %v\", c.requestBodyForm)\n\n}", "title": "" }, { "docid": "0e7e6be331f528b0035de7f0b6ac039c", "score": "0.4510503", "text": "func AddIndependentPropertyGeneratorsForApiManagementConfig_ARM(gens map[string]gopter.Gen) {\n\tgens[\"Id\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "da0dd10585427a41eba28e5a8e946880", "score": "0.4506741", "text": "func NewBridgeConfig_List(s *capnp.Segment, sz int32) (BridgeConfig_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}, sz)\n\treturn BridgeConfig_List{l}, err\n}", "title": "" }, { "docid": "da0dd10585427a41eba28e5a8e946880", "score": "0.4506741", "text": "func NewBridgeConfig_List(s *capnp.Segment, sz int32) (BridgeConfig_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}, sz)\n\treturn BridgeConfig_List{l}, err\n}", "title": "" }, { "docid": "318914a9402485d5908dfa084fdf88ee", "score": "0.4505292", "text": "func buildBindParams(bindParams *ServiceParams) map[string]interface{} {\n\tparams := map[string]interface{}{}\n\n\tfor k, v := range bindParams.Properties {\n\t\tparams[k] = v[\"value\"]\n\t}\n\n\treturn params\n}", "title": "" }, { "docid": "2796596afdc9f3834be9a08b4482dbcc", "score": "0.45040932", "text": "func (m *Main) BuildAdvancedConfig() *cconf.AdvancedConfig {\n\ttmp := conf.InitAdvancedOptions(false) // defaults + url overrides\n\ttmp.HTTPTimeout = int(m.Sync.Advanced.HTTPTimeoutMs / 1000)\n\ttmp.StreamingEnabled = m.Sync.Advanced.StreamingEnabled\n\ttmp.SplitsRefreshRate = int(m.Sync.SplitRefreshRateMs / 1000)\n\ttmp.SegmentsRefreshRate = int(m.Sync.SegmentRefreshRateMs / 1000)\n\treturn tmp\n}", "title": "" }, { "docid": "607d4e02b29b4007ce5a202db6c705f3", "score": "0.4502334", "text": "func newConfig(opts []Option) *config {\n\tc := &config{\n\t\tPropagators: otel.GetTextMapPropagator(),\n\t\tTracerProvider: otel.GetTracerProvider(),\n\t}\n\tc.Propagators = propagation.NewCompositeTextMapPropagator(\n\t\tpropagation.TraceContext{},\n\t\tpropagation.Baggage{},\n\t)\n\tfor _, o := range opts {\n\t\to.Apply(c)\n\t}\n\treturn c\n}", "title": "" }, { "docid": "052d03867f9dc6618a2bce172184e8f8", "score": "0.4498855", "text": "func AddIndependentPropertyGeneratorsForKubeletConfig_STATUS_ARM(gens map[string]gopter.Gen) {\n\tgens[\"AllowedUnsafeSysctls\"] = gen.SliceOf(gen.AlphaString())\n\tgens[\"ContainerLogMaxFiles\"] = gen.PtrOf(gen.Int())\n\tgens[\"ContainerLogMaxSizeMB\"] = gen.PtrOf(gen.Int())\n\tgens[\"CpuCfsQuota\"] = gen.PtrOf(gen.Bool())\n\tgens[\"CpuCfsQuotaPeriod\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"CpuManagerPolicy\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"FailSwapOn\"] = gen.PtrOf(gen.Bool())\n\tgens[\"ImageGcHighThreshold\"] = gen.PtrOf(gen.Int())\n\tgens[\"ImageGcLowThreshold\"] = gen.PtrOf(gen.Int())\n\tgens[\"PodMaxPids\"] = gen.PtrOf(gen.Int())\n\tgens[\"TopologyManagerPolicy\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "d133fd3b2766878b572938eb2bd97b13", "score": "0.44929588", "text": "func NewConfig() *config.Config {\n\tc := &config.Config{}\n\tc.MaxCap = 10\n\tc.DynamicLink = false\n\tc.OverflowCap = true\n\tc.AcquireTimeout = 3 * time.Second\n\treturn c\n}", "title": "" }, { "docid": "224946115bc30e8254c3d6fef3e61d65", "score": "0.4491384", "text": "func generate(challenge *kctfv1.Challenge) *corev1.ConfigMap {\n\tdata := map[string]string{\n\t\t\"pow.conf\": strconv.Itoa(challenge.Spec.PowDifficultySeconds*1337) + \"\\n\",\n\t}\n\tconfigmap := &corev1.ConfigMap{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: challenge.Name + \"-pow\",\n\t\t\tNamespace: challenge.Namespace,\n\t\t},\n\t\tData: data,\n\t}\n\n\treturn configmap\n}", "title": "" }, { "docid": "83fd998b29371d161277fc572da40d25", "score": "0.44871986", "text": "func (s PeerSend) Marshal() Config {\n\tc := NewBareConfig(p2pExType)\n\n\tv := reflect.ValueOf(s)\n\tt := v.Type()\n\n\tfor i := 0; i < v.NumField(); i++ {\n\t\tswitch t.Field(i).Name {\n\t\tcase \"QueueName\":\n\t\t\tc.QueueDeclare.Queue = v.Field(i).Interface().(string)\n\t\tcase \"QueueNoWait\":\n\t\t\tc.QueueDeclare.NoWait = v.Field(i).Interface().(bool)\n\t\tcase \"Immediate\":\n\t\t\tc.Publish.Immediate = v.Field(i).Interface().(bool)\n\t\tdefault:\n\t\t}\n\t}\n\treturn c\n}", "title": "" }, { "docid": "2afa1198dbfd237a74f79d912f1d359f", "score": "0.44870082", "text": "func (gw Gateway) PrintParams() {\n\tfmt.Println(\"\\nAPI Gwateway params\")\n\tfmt.Println(\"===================\")\n\tgwConf := config.Config.Gateway\n\tfmt.Println(\"* endpoint:\")\n\tfmt.Printf(\"\\t- schema:\\t\\t%s\\n\", gwConf.Endpoint.Schema)\n\tfmt.Printf(\"\\t- path:\\t\\t\\t%s\\n\", gwConf.Endpoint.Path)\n\tfmt.Printf(\"\\t- port:\\t\\t\\t%d\\n\", gwConf.Endpoint.Port)\n\tfmt.Println(\"* admin endpoint:\")\n\tfmt.Printf(\"\\t- schema:\\t\\t%s\\n\", gwConf.Admin.Schema)\n\tfmt.Printf(\"\\t- path:\\t\\t\\t%s\\n\", gwConf.Admin.Path)\n\tfmt.Printf(\"\\t- port:\\t\\t\\t%d\\n\", gwConf.Admin.Port)\n\tfmt.Printf(\"\\t- security enabled:\\t%+v\\n\", gwConf.Admin.Security.Enabled)\n\tfmt.Println(\"---\")\n}", "title": "" }, { "docid": "ee57c74a7e731c6229767742002e18d3", "score": "0.44861287", "text": "func AddIndependentPropertyGeneratorsForFactoryGitHubConfiguration(gens map[string]gopter.Gen) {\n\tgens[\"AccountName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"ClientId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"CollaborationBranch\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"DisablePublish\"] = gen.PtrOf(gen.Bool())\n\tgens[\"HostName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"LastCommitId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"RepositoryName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"RootFolder\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Type\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "36d9e0bc17441860d3276093d8da52f5", "score": "0.4484866", "text": "func (client *NetworkInterfaceTapConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *NetworkInterfaceTapConfigurationsListOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif networkInterfaceName == \"\" {\n\t\treturn nil, errors.New(\"parameter networkInterfaceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{networkInterfaceName}\", url.PathEscape(networkInterfaceName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "title": "" }, { "docid": "b6d96703eb7c7d259d2828d969f6fcb4", "score": "0.4482743", "text": "func IpConfiguration_ARMGenerator() gopter.Gen {\n\tif ipConfiguration_ARMGenerator != nil {\n\t\treturn ipConfiguration_ARMGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForIpConfiguration_ARM(generators)\n\tipConfiguration_ARMGenerator = gen.Struct(reflect.TypeOf(IpConfiguration_ARM{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForIpConfiguration_ARM(generators)\n\tAddRelatedPropertyGeneratorsForIpConfiguration_ARM(generators)\n\tipConfiguration_ARMGenerator = gen.Struct(reflect.TypeOf(IpConfiguration_ARM{}), generators)\n\n\treturn ipConfiguration_ARMGenerator\n}", "title": "" }, { "docid": "49d778897ce918262fee8a1101d511f1", "score": "0.44810012", "text": "func GetBaseURIParameters(config CONFIGURATION) map[string]interface{} {\r\n kvpMap := map[string]interface{}{\r\n \"cluster_vip\": config.ClusterVip(),\r\n }\r\n return kvpMap;\r\n}", "title": "" }, { "docid": "fba5d4e7f453b5e3806b26f8c6962020", "score": "0.44796926", "text": "func NewScheduler_sendCoflow_Params_List(s *capnp.Segment, sz int32) (Scheduler_sendCoflow_Params_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz)\n\treturn Scheduler_sendCoflow_Params_List{l}, err\n}", "title": "" }, { "docid": "365f3d01035938e25b89ddfe32e1c3ad", "score": "0.44764385", "text": "func GenerateFirewall(name string, in v1alpha1.FirewallParameters, firewall *compute.Firewall) {\n\tfirewall.Name = name\n\tfirewall.Description = gcp.StringValue(in.Description)\n\tfirewall.Network = gcp.StringValue(in.Network)\n\tfirewall.Priority = gcp.Int64Value(in.Priority)\n\tfirewall.SourceRanges = in.SourceRanges\n\tfirewall.DestinationRanges = in.DestinationRanges\n\tfirewall.SourceTags = in.SourceTags\n\tfirewall.TargetTags = in.TargetTags\n\tfirewall.SourceServiceAccounts = in.SourceServiceAccounts\n\tfirewall.TargetServiceAccounts = in.TargetServiceAccounts\n\tfirewall.Direction = gcp.StringValue(in.Direction)\n\tfirewall.Disabled = gcp.BoolValue(in.Disabled)\n\tif in.Allowed != nil {\n\t\tfirewall.Allowed = make([]*compute.FirewallAllowed, len(in.Allowed))\n\t\tfor idx, rule := range in.Allowed {\n\t\t\tfirewall.Allowed[idx] = &compute.FirewallAllowed{\n\t\t\t\tIPProtocol: rule.IPProtocol,\n\t\t\t\tPorts: rule.Ports,\n\t\t\t}\n\t\t}\n\t}\n\n\tif in.Denied != nil {\n\t\tfirewall.Denied = make([]*compute.FirewallDenied, len(in.Denied))\n\t\tfor idx, rule := range in.Denied {\n\t\t\tfirewall.Denied[idx] = &compute.FirewallDenied{\n\t\t\t\tIPProtocol: rule.IPProtocol,\n\t\t\t\tPorts: rule.Ports,\n\t\t\t}\n\t\t}\n\t}\n\n\tif in.LogConfig != nil {\n\t\tfirewall.LogConfig = &compute.FirewallLogConfig{\n\t\t\tEnable: in.LogConfig.Enable,\n\t\t}\n\t}\n}", "title": "" }, { "docid": "165ab32bb79126128dca1be517b3b830", "score": "0.44739255", "text": "func NewTunnelConfiguration()(*TunnelConfiguration) {\n m := &TunnelConfiguration{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "title": "" }, { "docid": "90aad5f1e184f98670a88d160ac02000", "score": "0.44730678", "text": "func initPluginConfig(f *factory.Factory, pFactory *pluginfactory.Factory, pluginCfgHandler *pluginCfg.CfgHandler) {\n\tpluginBuilder := pluginConnection.NewBuilder()\n\tif f.CfgHandler.Cfg.AccessToken != \"\" {\n\t\tpluginBuilder.WithAccessToken(f.CfgHandler.Cfg.AccessToken)\n\t}\n\tif f.CfgHandler.Cfg.RefreshToken != \"\" {\n\t\tpluginBuilder.WithRefreshToken(f.CfgHandler.Cfg.RefreshToken)\n\t}\n\tif f.CfgHandler.Cfg.MasAccessToken != \"\" {\n\t\tpluginBuilder.WithMASAccessToken(f.CfgHandler.Cfg.MasAccessToken)\n\t}\n\tif f.CfgHandler.Cfg.MasRefreshToken != \"\" {\n\t\tpluginBuilder.WithMASRefreshToken(f.CfgHandler.Cfg.MasRefreshToken)\n\t}\n\tif f.CfgHandler.Cfg.ClientID != \"\" {\n\t\tpluginBuilder.WithClientID(f.CfgHandler.Cfg.ClientID)\n\t}\n\tif f.CfgHandler.Cfg.Scopes != nil {\n\t\tpluginBuilder.WithScopes(f.CfgHandler.Cfg.Scopes...)\n\t}\n\tif f.CfgHandler.Cfg.APIUrl != \"\" {\n\t\tpluginBuilder.WithURL(f.CfgHandler.Cfg.APIUrl)\n\t}\n\tif f.CfgHandler.Cfg.AuthURL == \"\" {\n\t\tf.CfgHandler.Cfg.AuthURL = build.ProductionAuthURL\n\t}\n\tpluginBuilder.WithAuthURL(f.CfgHandler.Cfg.AuthURL)\n\tif f.CfgHandler.Cfg.MasAuthURL == \"\" {\n\t\tf.CfgHandler.Cfg.MasAuthURL = build.ProductionMasAuthURL\n\t}\n\tpluginBuilder.WithMASAuthURL(f.CfgHandler.Cfg.MasAuthURL)\n\tpluginBuilder.WithInsecure(f.CfgHandler.Cfg.Insecure)\n\tpluginBuilder.WithConfig(pluginCfgHandler)\n\n\tpluginConnectionFunction := func(connectionCfg *pluginConnection.Config) (pluginConnection.Connection, error) {\n\t\ttransportWrapper := func(a http.RoundTripper) http.RoundTripper {\n\t\t\treturn &httputil.LoggingRoundTripper{\n\t\t\t\tProxied: a,\n\t\t\t}\n\t\t}\n\n\t\tpluginBuilder.WithTransportWrapper(transportWrapper)\n\n\t\tpluginBuilder.WithConnectionConfig(connectionCfg)\n\n\t\tconn, err := pluginBuilder.Build()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\terr = conn.RefreshTokens(context.TODO())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn conn, nil\n\t}\n\n\tpFactory.Connection = pluginConnectionFunction\n}", "title": "" }, { "docid": "338222a5acf07d218d47d49af130488e", "score": "0.44694346", "text": "func newMachineConfigPoolAndConfigs(name string, params ...string) []runtime.Object {\n\tmcp := newMachineConfigPool(name, params...)\n\n\tout := []runtime.Object{mcp}\n\n\tfiles := []ign3types.File{}\n\n\t// Create individual MachineConfigs to accompany the child MachineConfigs referred to by our MachineConfigPool.\n\tfor _, childConfig := range mcp.Spec.Configuration.Source {\n\t\tif childConfig.Kind != \"MachineConfig\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tfilename := fmt.Sprintf(\"/etc/%s\", childConfig.Name)\n\t\tfile := ctrlcommon.NewIgnFile(filename, childConfig.Name)\n\t\tfiles = append(files, file)\n\n\t\tout = append(out, testhelpers.NewMachineConfig(\n\t\t\tchildConfig.Name,\n\t\t\tmap[string]string{\n\t\t\t\t\"machineconfiguration.openshift.io/role\": name,\n\t\t\t},\n\t\t\t\"\",\n\t\t\t[]ign3types.File{file}))\n\t}\n\n\t// Create a rendered MachineConfig to accompany our MachineConfigPool.\n\tout = append(out, testhelpers.NewMachineConfig(\n\t\tmcp.Spec.Configuration.Name,\n\t\tmap[string]string{\n\t\t\tctrlcommon.GeneratedByControllerVersionAnnotationKey: \"version-number\",\n\t\t\t\"machineconfiguration.openshift.io/role\": name,\n\t\t},\n\t\t\"\",\n\t\tfiles))\n\n\treturn out\n}", "title": "" }, { "docid": "9b01c88c5a3a217953f6c83d4109dde3", "score": "0.44681266", "text": "func Make(cfg Config) (Config, error) {\n\tfor _, key := range AllKeys {\n\t\tv := cfg.Value(key)\n\t\tif v == nil {\n\t\t\tcontinue\n\t\t}\n\t\tvstr, ok := v.(string)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"expected string for key %s, got %T\", key, v)\n\t\t}\n\t\tname, arg := peel(vstr, \",\")\n\t\tprovider, ok := Lookup(key, name)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"provider %s not defined for key %s\", name, key)\n\t\t}\n\t\tvar err error\n\t\tcfg, err = provider.Configure(cfg, arg)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"configuring key %s with provider %s: %v\", key, name, err)\n\t\t}\n\t}\n\treturn cfg, nil\n}", "title": "" }, { "docid": "26130075d7234685b7c312a2506a6d1c", "score": "0.44626442", "text": "func AddIndependentPropertyGeneratorsForFactoryVSTSConfiguration_STATUS(gens map[string]gopter.Gen) {\n\tgens[\"AccountName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"CollaborationBranch\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"DisablePublish\"] = gen.PtrOf(gen.Bool())\n\tgens[\"LastCommitId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"ProjectName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"RepositoryName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"RootFolder\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"TenantId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Type\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" } ]
819bf73a2fdf1061ed70c44f4faea99e
Deprecated: Use CPlayer_AcceptSSA_Request.ProtoReflect.Descriptor instead.
[ { "docid": "56a403ce7a0e5881bb59e765b2d775e9", "score": "0.76102084", "text": "func (*CPlayer_AcceptSSA_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_player_steamworkssdk_proto_rawDescGZIP(), []int{9}\n}", "title": "" } ]
[ { "docid": "982a193786fb0a7cafa0118d6d9f2a36", "score": "0.64378583", "text": "func (*CPlayer_AcceptSSA_Response) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_player_steamworkssdk_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "630624165092f6ec736da7b111250b98", "score": "0.64343274", "text": "func (*StreamingRecognitionRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_ai_stt_v2_stt_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "e7272f4823093fcfcc47f30acebd0f37", "score": "0.64309126", "text": "func (*CRemoteClient_AllocateTURNServer_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_remoteclient_service_messages_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "e9f9834a5d7d282de2473de921389467", "score": "0.64308786", "text": "func (*SVRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_drkey_mgmt_v1_mgmt_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "49c7c06d132207219e574ba0acb8b97b", "score": "0.63366306", "text": "func (*DiscoveryRequest) Descriptor() ([]byte, []int) {\n\treturn file_xds_envoy_simplified_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "556832597dd305a779aabec363c38b83", "score": "0.63287646", "text": "func (*HostASRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_drkey_mgmt_v1_mgmt_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "ce2c3a96a746eb5d237bf42faa8b5a0f", "score": "0.63113886", "text": "func (*CFileVerification_SteamServiceCheck_Request) Descriptor() ([]byte, []int) {\n\treturn file_steam_client_steammessages_vac_steamclient_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "7940c79423e997b0776146f1f6643c5d", "score": "0.63032293", "text": "func (*CFileVerification_SteamServiceCheck_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_vac_steamclient_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "085b72ead8cc6793161ab646d36c6535", "score": "0.6252912", "text": "func (*UpdateScoreRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_api_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "a2b95e7900ffb8b2fbc597bf9cf24a08", "score": "0.62306863", "text": "func (*CRemoteClient_AllocateSDR_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_remoteclient_service_messages_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "bcffa3e99b454c9f26521b59f2981e3b", "score": "0.6219054", "text": "func (*PolicerModifyRequest) Descriptor() ([]byte, []int) {\n\treturn file_jnx_firewall_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "f4559cf87463e99c1635d94c6f8f1d57", "score": "0.6206382", "text": "func (*AddLessons_Request) Descriptor() ([]byte, []int) {\n\treturn file_schedule_service_api_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "a5f1debabecf1289c9727a7c98edf71c", "score": "0.6193869", "text": "func (*CPlayer_AddFriend_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_player_steamworkssdk_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "48a12ce93490db0b8a6e0a18f6ab8e52", "score": "0.6153894", "text": "func (*ASHostRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_drkey_mgmt_v1_mgmt_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "82e76db67a1de4095593cc2199d7c023", "score": "0.6131493", "text": "func (*ApproveWalletSharingRequestRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "a40da033ef958fcfaabe9508540288ab", "score": "0.6131201", "text": "func (*PolicerAddRequest) Descriptor() ([]byte, []int) {\n\treturn file_jnx_firewall_service_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "22e5f6fb9b7ee062c06442111ca8913f", "score": "0.6123357", "text": "func (*CRemotePlay_SessionStarted_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_remoteclient_service_messages_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "ca59aa3f8b77959a2dedbe956ecd2e24", "score": "0.6121893", "text": "func (*LaneChangesForVideoRequest) Descriptor() ([]byte, []int) {\n\treturn file_processed_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "4ec9fa89b1136d0049bec4fce7af5687", "score": "0.6120155", "text": "func (*FilterModifyRequest) Descriptor() ([]byte, []int) {\n\treturn file_jnx_firewall_service_proto_rawDescGZIP(), []int{92}\n}", "title": "" }, { "docid": "43cd0a6d616cd985fbfc47f7e1af975f", "score": "0.61009264", "text": "func (*CPlayer_SetPerFriendPreferences_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_player_steamworkssdk_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "023661ed8f1c1e543debc4c3d0018036", "score": "0.6096892", "text": "func (*TSAvailabilityRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_rpc_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "a5077aa75144902d335c57d713511141", "score": "0.60816365", "text": "func (*AcceptInviteRequest) Descriptor() ([]byte, []int) {\n\treturn file_cs3_ocm_invite_v1beta1_invite_api_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "d4d2e9dfb2e8621795815c459c8ce279", "score": "0.6063375", "text": "func (*GetAnalysisRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "62c9e01f599787de5e7399330d718a92", "score": "0.60549563", "text": "func (*UpdateManifestRequest) Descriptor() ([]byte, []int) {\n\treturn file_code_justin_tv_vod_vodapi_rpc_vodapi_requests_proto_rawDescGZIP(), []int{40}\n}", "title": "" }, { "docid": "9b54d314b4dbda8e7dddb7e451ce33cd", "score": "0.60524374", "text": "func (*VoiceRequest) Descriptor() ([]byte, []int) {\n\treturn file_calling_message_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "e1ff2feb4003a231581fb182fd92ec5a", "score": "0.60508966", "text": "func (*CreateAnalysisRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "3f56d309b5a0f1e224caee9f1e7bc028", "score": "0.60490024", "text": "func (*CPlayer_IgnoreFriend_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_player_steamworkssdk_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "91fbba3bf1d4304232fe25a496300c27", "score": "0.60488915", "text": "func (*GenerateValidationRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_security_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "1ab4da10afa6b807db8e7db49a55b27a", "score": "0.6043941", "text": "func (*PresenceStatsRequest) Descriptor() ([]byte, []int) {\n\treturn file_client_proto_rawDescGZIP(), []int{29}\n}", "title": "" }, { "docid": "e007b9d77102cf2ab06f35f7b0a85b53", "score": "0.6043563", "text": "func (*FilterAddRequest) Descriptor() ([]byte, []int) {\n\treturn file_jnx_firewall_service_proto_rawDescGZIP(), []int{91}\n}", "title": "" }, { "docid": "80b5c7879fa6e4cd2a70c97da9da89b0", "score": "0.6040147", "text": "func (*UpdateConversationRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "f1056bb9260cdfeac87ca74fd8cc8777", "score": "0.603593", "text": "func (*TSRetrieveRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_rpc_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "e5ad3a711a51cff720a9e6088bd7297b", "score": "0.6025632", "text": "func (*AccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_rvasp_v1_api_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "b53c6f7394f771e64036339e5429eaf2", "score": "0.6023765", "text": "func (*CommonAPIClearUpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_tesla_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "833c6ad8f4c863308e846643bb19e58d", "score": "0.60191506", "text": "func (*GetPlayerBansRequest) Descriptor() ([]byte, []int) {\n\treturn file_punishments_punishments_proto_rawDescGZIP(), []int{28}\n}", "title": "" }, { "docid": "6322843503700f5e91e417063a43344b", "score": "0.60175234", "text": "func (*SetUserActive_Request) Descriptor() ([]byte, []int) {\n\treturn file_grpc_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "905a91dec83ebea03ed2c7c967482c78", "score": "0.60127646", "text": "func (*InspectRequest) Descriptor() ([]byte, []int) {\n\treturn file_pilosa_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "9df71ecce1e3647a4b25bdbb80097939", "score": "0.60099643", "text": "func (*CheckTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_security_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "7d09ab8a65927dfd2c2d7d12e9e412cd", "score": "0.60064155", "text": "func (*AuthorizationTrustRequest) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_authorization_pb2_authorization_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "6a19bac7ac056828a6fd33ed512da6f1", "score": "0.60029924", "text": "func (*ResolveTrackAppealRequest) Descriptor() ([]byte, []int) {\n\treturn file_code_justin_tv_vod_vodapi_rpc_vodapi_requests_proto_rawDescGZIP(), []int{61}\n}", "title": "" }, { "docid": "dcccb9b1183d538afb431bb2f3abb277", "score": "0.60006773", "text": "func (*StopProvider_Request) Descriptor() ([]byte, []int) {\n\treturn file_tfplugin6_proto_rawDescGZIP(), []int{3, 0}\n}", "title": "" }, { "docid": "5bf4b2fe106451c38f18ae6bfdb77f7c", "score": "0.5998701", "text": "func (*StreamGameRequest) Descriptor() ([]byte, []int) {\n\treturn file_game_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "597a30dcaa346b6ff6483aef65c818a7", "score": "0.59917027", "text": "func (*GetRecognitionRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_ai_stt_v3_stt_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "11313fc9a0fa5a6f42416a19033407f0", "score": "0.5987936", "text": "func (*CRemoteClient_SetPairingInfo_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_remoteclient_service_messages_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "59420aa21b557f15b6e717fe5e9d69ac", "score": "0.59854484", "text": "func (*ReStartStreamVRRequest) Descriptor() ([]byte, []int) {\n\treturn file_server_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "2d26aa05ec8716c9ce07f83ee2688e9d", "score": "0.59746253", "text": "func (*PlayRequest) Descriptor() ([]byte, []int) {\n\treturn file_snake_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "f5882252b5048b361cb43b82a093ba52", "score": "0.59658676", "text": "func (*PlanResourceChange_Request) Descriptor() ([]byte, []int) {\n\treturn file_tfplugin6_proto_rawDescGZIP(), []int{13, 0}\n}", "title": "" }, { "docid": "5f73c8a32fc6476a6d20bd0d251ca859", "score": "0.59633595", "text": "func (*CFriendMessages_IsInFriendsUIBeta_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_friendmessages_steamclient_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "f985459cc2d290e3724dbd6cc0de5893", "score": "0.596022", "text": "func (*ResetSuppressPeerRequest) Descriptor() ([]byte, []int) {\n\treturn file_huaweiV8R10_isis_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "db5233db9e0c20ed1641bc17166d9508", "score": "0.5958105", "text": "func (*ManagerUpdateUserVideoPrivacyPropertiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_code_justin_tv_vod_vodapi_rpc_vodapi_requests_proto_rawDescGZIP(), []int{57}\n}", "title": "" }, { "docid": "d817ee436296afd3550c4df30140e9d2", "score": "0.59508276", "text": "func (*BulkAnalyzeConversationsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "8c665fa42d483f7e392e31c6a9eabc8c", "score": "0.59463984", "text": "func (*UpdateAssessmentRequest) Descriptor() ([]byte, []int) {\n\treturn file_assessment_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "df4b7e9acd2e398e00b3a34e843ca8b7", "score": "0.59457624", "text": "func (*CFileVerification_SignatureCheck_Request) Descriptor() ([]byte, []int) {\n\treturn file_steam_client_steammessages_vac_steamclient_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "254f1f4611561bffd5b0ff6ade36d870", "score": "0.5945523", "text": "func (*InternalUpdateUserVideoPrivacyPropertiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_code_justin_tv_vod_vodapi_rpc_vodapi_requests_proto_rawDescGZIP(), []int{55}\n}", "title": "" }, { "docid": "0229c6ec627170bb128f18f3fe2b0ec0", "score": "0.59454477", "text": "func (*UpdateSettingsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{53}\n}", "title": "" }, { "docid": "ef8242a991ec0ced9f35f2420b5db635", "score": "0.59445524", "text": "func (RequestPnLPositionUpdates_Request) EnumDescriptor() ([]byte, []int) {\n\treturn file_request_pnl_position_updates_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "0b8af2fc770c808a0312020383f2372d", "score": "0.59425664", "text": "func (*DiagnosticsRequest) Descriptor() ([]byte, []int) {\n\treturn file_diagnostics_api_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "880f57b21f5ccda5a961fcdea49321d1", "score": "0.5942507", "text": "func (*CPlayer_GetNewSteamAnnouncementState_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_player_steamworkssdk_proto_rawDescGZIP(), []int{29}\n}", "title": "" }, { "docid": "4c3c634d4422a68f7975fa4c94ab25d9", "score": "0.5938041", "text": "func (*UpdateCallRequest) Descriptor() ([]byte, []int) {\n\treturn file_calling_message_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "e45050f6c5665205e77ab16b06975f83", "score": "0.5937158", "text": "func (*CheckValidationRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_security_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "57e2ee3ffaf21a96081aec90abdfc377", "score": "0.59285504", "text": "func (*ForwardInviteRequest) Descriptor() ([]byte, []int) {\n\treturn file_cs3_ocm_invite_v1beta1_invite_api_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "46f62d379f24f7393f0f7474e885a02f", "score": "0.5927177", "text": "func (*SportLinesRequest) Descriptor() ([]byte, []int) {\n\treturn file_sportlines_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "dc8908b9ca551768e49b9f480c3c7ae1", "score": "0.59261686", "text": "func (*SignInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_monitoring_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "b6bdde3f6576ba4951e163c1d19c151a", "score": "0.5924104", "text": "func (*ContactRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_contactist_server_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "c3f3c6955e0b248d2bbd70e45beecc5f", "score": "0.5922089", "text": "func (*GetServiceTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_services_accounts_proto_accounts_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "db3c5f5670e03d6110cb43f7ab178b51", "score": "0.59202516", "text": "func (*FirewallRequest) Descriptor() ([]byte, []int) {\n\treturn file_app_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "bded9b35acbc824f50b3461beedd7ae9", "score": "0.5913787", "text": "func (*CFileVerification_SignatureCheck_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_vac_steamclient_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "f2eb0f0b832150f3235db09dec1449b7", "score": "0.5912561", "text": "func (*ManagerSetVodsViewabilityRequest) Descriptor() ([]byte, []int) {\n\treturn file_code_justin_tv_vod_vodapi_rpc_vodapi_requests_proto_rawDescGZIP(), []int{70}\n}", "title": "" }, { "docid": "4d257f946d0fd80438b4be0171e941bf", "score": "0.5912248", "text": "func (*UpdateStudentRequest) Descriptor() ([]byte, []int) {\n\treturn file_student_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "249d9e29be04ac3c2747905568ab2795", "score": "0.59108794", "text": "func (*GenerateTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_security_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "3607ad31bec95e636cf718493da09452", "score": "0.5908652", "text": "func (*SqlInstancesAddServerCaRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_sql_v1beta4_cloud_sql_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "4dc76d63ccf60425995e77eea617810e", "score": "0.59044474", "text": "func (*ValidateRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_v1_auth_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "9623a768aea91b6012aaf9c246909708", "score": "0.59038544", "text": "func (*StakeInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_staking_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "56b078723d12c2ee3eb8b8a265e7d79c", "score": "0.5901022", "text": "func (*WantScoreReq) Descriptor() ([]byte, []int) {\n\treturn file_user_srv_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "f27e2970d70c752976e497033e210adc", "score": "0.5899509", "text": "func (*StreamRequest) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_gogoatalk_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "e5681f65afead796b3f1dc7de90ebcd1", "score": "0.58976954", "text": "func (*LongRunningRecognitionRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_ai_stt_v2_stt_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "30fc125009f91a8248dd566b53ab774f", "score": "0.58951813", "text": "func (*TrackAppealRequest) Descriptor() ([]byte, []int) {\n\treturn file_code_justin_tv_vod_vodapi_rpc_vodapi_requests_proto_rawDescGZIP(), []int{58}\n}", "title": "" }, { "docid": "75be4c190a1c270b43f6a1424dbf0572", "score": "0.58938605", "text": "func (*GetServiceRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_api_serviceusage_v1_serviceusage_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "21c4983ba50bfde08eeb5b873585b58e", "score": "0.5891959", "text": "func (*WatchPlayerAcquittalsRequest) Descriptor() ([]byte, []int) {\n\treturn file_punishments_punishments_proto_rawDescGZIP(), []int{51}\n}", "title": "" }, { "docid": "6e751a07de0205b0f011870c6ce06104", "score": "0.58905584", "text": "func (*CreateRequest) Descriptor() ([]byte, []int) {\n\treturn file_private_game_game_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "89d53f0fcaca3dc825f7b9b919e4bf83", "score": "0.588945", "text": "func (*ModifyClubInformRequest) Descriptor() ([]byte, []int) {\n\treturn file_club_leader_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "53210a252d79028555efc93b73f3f701", "score": "0.58883363", "text": "func (*GetOnlineFeaturesRequest) Descriptor() ([]byte, []int) {\n\treturn file_feast_serving_ServingService_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "53210a252d79028555efc93b73f3f701", "score": "0.58883363", "text": "func (*GetOnlineFeaturesRequest) Descriptor() ([]byte, []int) {\n\treturn file_feast_serving_ServingService_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "91d86f8786fe8767344a9a84e0dd8b7c", "score": "0.58876336", "text": "func (*SquareRequest) Descriptor() ([]byte, []int) {\n\treturn file_calculatorpb_calculator_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "7d19682bb04584dde6a1a86e7455198d", "score": "0.58840984", "text": "func (*StakeInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_m2m_staking_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "738c1d0bafa156006dcbbc4224880059", "score": "0.58830124", "text": "func (*SBaseRequest) Descriptor() ([]byte, []int) {\n\treturn file_social_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "585d60f340862e8c039a6476f47f9a9d", "score": "0.5881903", "text": "func (*ManagerGetVodMuteInfosRequest) Descriptor() ([]byte, []int) {\n\treturn file_code_justin_tv_vod_vodapi_rpc_vodapi_requests_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "440de976e21a92910d5f682b12aefa6d", "score": "0.58818537", "text": "func (*Input_SecurityRule) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_video_livestream_v1_resources_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "fab739ff5f27df1fdd82f6bbda0bc8c1", "score": "0.5879982", "text": "func (*UpdateCertificateAuthorityRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_security_privateca_v1_service_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "5f0187c49d6e555a3583013ad2708d8d", "score": "0.58788383", "text": "func (*RequestSignRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_rpc_rpc_proto_rawDescGZIP(), []int{51}\n}", "title": "" }, { "docid": "dadb3e89725c7563e4e046e9ebfa7c9a", "score": "0.5877084", "text": "func (*TSStoreRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_rpc_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "967cf69e4cd0cb43532a54449ce2b4a8", "score": "0.58747774", "text": "func (*IsRestrictedRequest) Descriptor() ([]byte, []int) {\n\treturn file_restriction_service_v1_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "945621bb4a1380c88a91a824d3ab4aab", "score": "0.5871236", "text": "func (*CalculateStatsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "c37134d2a740d2b514f1c0d46b7b3e1f", "score": "0.5870209", "text": "func (*GetTeamRequest) Descriptor() ([]byte, []int) {\n\treturn file_buf_alpha_registry_v1alpha1_team_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "edd1d930f1ea92b72a4be91f23266ca8", "score": "0.5867875", "text": "func (*HomeAdvertiseUpdateReq) Descriptor() ([]byte, []int) {\n\treturn file_api_sms_v1_sms_proto_rawDescGZIP(), []int{77}\n}", "title": "" }, { "docid": "695ea2351680f0988d3e31b91947cf7f", "score": "0.5865748", "text": "func (*AddRequest) Descriptor() ([]byte, []int) {\n\treturn file_natan_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "268246431186af9cc6aa64e20b95af03", "score": "0.5865676", "text": "func (*AddUserPlus_Request) Descriptor() ([]byte, []int) {\n\treturn file_grpc_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "ee00bed76959dc012e9d92c2773c5ab5", "score": "0.58638954", "text": "func (*CPlayer_SetCommunityPreferences_Request) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_player_steamworkssdk_proto_rawDescGZIP(), []int{27}\n}", "title": "" }, { "docid": "a2888d44d95766c6630253ed53d933c2", "score": "0.5863104", "text": "func (*TokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_his_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "a8c834b4e5b6d9f0d215b28d2a1ce134", "score": "0.58608913", "text": "func (*SaluteWithDeadlineRequest) Descriptor() ([]byte, []int) {\n\treturn file_advanced_features_calculator_calculatorpb_calculatorpb_proto_rawDescGZIP(), []int{3}\n}", "title": "" } ]
b3184f2f502e041e6767c6d955679452
GetCash is a free data retrieval call binding the contract method 0x3b1d21a2. Solidity: function getCash() constant returns(uint256)
[ { "docid": "a66e765c13e406c7d68377095a0cd5ab", "score": "0.8053657", "text": "func (_CBAT *CBATCaller) GetCash(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _CBAT.contract.Call(opts, out, \"getCash\")\n\treturn *ret0, err\n}", "title": "" } ]
[ { "docid": "ed1c34bf1b557d7c036394c3345cbdac", "score": "0.7753372", "text": "func (_CBAT *CBATSession) GetCash() (*big.Int, error) {\n\treturn _CBAT.Contract.GetCash(&_CBAT.CallOpts)\n}", "title": "" }, { "docid": "c19f11fba01a5843065b163cedd62cf8", "score": "0.76949614", "text": "func (_CBAT *CBATCallerSession) GetCash() (*big.Int, error) {\n\treturn _CBAT.Contract.GetCash(&_CBAT.CallOpts)\n}", "title": "" }, { "docid": "bc3343b1716eee654727ec61ed64138d", "score": "0.6016496", "text": "func (_RootChain *RootChainCaller) GetPlasmaCoin(opts *bind.CallOpts, slot uint64) (*big.Int, *big.Int, *big.Int, common.Address, uint8, uint8, common.Address, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t\tret1 = new(*big.Int)\n\t\tret2 = new(*big.Int)\n\t\tret3 = new(common.Address)\n\t\tret4 = new(uint8)\n\t\tret5 = new(uint8)\n\t\tret6 = new(common.Address)\n\t)\n\tout := &[]interface{}{\n\t\tret0,\n\t\tret1,\n\t\tret2,\n\t\tret3,\n\t\tret4,\n\t\tret5,\n\t\tret6,\n\t}\n\terr := _RootChain.contract.Call(opts, out, \"getPlasmaCoin\", slot)\n\treturn *ret0, *ret1, *ret2, *ret3, *ret4, *ret5, *ret6, err\n}", "title": "" }, { "docid": "281d0130ef1236cde0fadf6783e5aaaf", "score": "0.60041785", "text": "func GetBalance(contract *Contract, account string, priv *myCrypto.PrivateKey) (balance *big.Int, err error) {\n\n\tbalanceEncrypted, err := contract.CheckBalance(nil, common.HexToAddress(account))\n\tif err != nil {\n\t\tlog.Fatalf(\"could not get balance: %v\", err)\n\t\treturn nil, err\n\t}\n\t//fmt.Println(\"log: the c,d of balance:\", balanceEncrypted.C, balanceEncrypted.D)\n\tzero := big.NewInt(0)\n\tif (balanceEncrypted.C.Cmp(zero) == 0) && (balanceEncrypted.D.Cmp(zero) == 0) {\n\t\treturn zero, nil\n\t}\n\t//No commit here, since there is no need to change chain state\n\n\tbalance, err = myCrypto.DecryptInt(priv, balanceEncrypted.C, balanceEncrypted.D)\n\tif err != nil {\n\t\tlog.Fatalf(\"could not decrypt balance: %v\", err)\n\t\treturn nil, err\n\t}\n\t//fmt.Println(\"=====Function GetBalance:\", account, balance)\n\treturn balance, nil\n}", "title": "" }, { "docid": "a13b0d3818ec0f7ad41a264b20a3dca1", "score": "0.5979636", "text": "func WebCash(cnum int, turns int) {\n\ts := cashParams{\n\t\tCnum: cnum,\n\t\tTurns: turns,\n\t\tdefaultParams: defaultParams{\n\t\t\tUsername: \"salted\",\n\t\t\tAIKey: \"49ee125ad5e9a3b81dfb771ac0d3d2fb\",\n\t\t\tServer: \"ai\",\n\t\t\tApiFunction: \"cash\"}}\n\n\tb, _ := json.Marshal(s)\n\n\tbody, _ := doPost(string(b))\n\tfmt.Println(body)\n\n\t// publicmarket := PublicMarket{}\n\n\t// _ = json.Unmarshal([]byte(body), &publicmarket)\n\n\t// fmt.Println(publicmarket)\n}", "title": "" }, { "docid": "683bc571e1575fff62d6c091dd1c29e3", "score": "0.5825619", "text": "func (s *SmartContract) get(stub shim.ChaincodeStubInterface, args []string) sc.Response {\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect arguments. Expecting a key\")\n\t}\n\n\tshipAsBytes, err := stub.GetState(args[0])\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get asset\")\n\t}\n\n\treturn shim.Success(shipAsBytes);\n}", "title": "" }, { "docid": "7ee6c800c2bd126995cb5e76fdcf82f2", "score": "0.57883114", "text": "func (s *CashEntriesEndpoint) Get(ctx context.Context, division int, id *types.GUID) (*CashEntries, error) {\n\tb, _ := s.client.ResolvePathWithDivision(\"/api/v1/{division}/financialtransaction/CashEntries\", division) // #nosec\n\tu, err := api.AddOdataKeyToURL(b, id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\te := &CashEntries{}\n\t_, _, requestError := s.client.NewRequestAndDo(ctx, \"GET\", u.String(), nil, e)\n\treturn e, requestError\n}", "title": "" }, { "docid": "1565d71fff2a5715c3e85990b7af10d1", "score": "0.57180053", "text": "func (_ReserveContract *ReserveContractCaller) GetBalance(opts *bind.CallOpts, token common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ReserveContract.contract.Call(opts, out, \"getBalance\", token)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "7dd5d1ece5f92975e35a8e09e2c0ccbf", "score": "0.5680634", "text": "func (r *LitRPC) GetContract(args GetContractArgs,\n\treply *GetContractReply) error {\n\tvar err error\n\n\treply.Contract, err = r.Node.DlcManager.LoadContract(args.Idx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1e0c9267f9ddcb51ed5d1b355426e618", "score": "0.5646165", "text": "func (_PayFor *PayForCaller) GetBalanceContract(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _PayFor.contract.Call(opts, out, \"getBalanceContract\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "69c9b55a073d3d22da0c4360485653a3", "score": "0.56142086", "text": "func (_RootChain *RootChainCallerSession) GetPlasmaCoin(slot uint64) (*big.Int, *big.Int, *big.Int, common.Address, uint8, uint8, common.Address, error) {\n\treturn _RootChain.Contract.GetPlasmaCoin(&_RootChain.CallOpts, slot)\n}", "title": "" }, { "docid": "50f7f1ff1921d59b736eb1fc610350f1", "score": "0.55423766", "text": "func GetBalance(clifile string, crosp string) int {\n amap := methods.GetConfigs(clifile)\n amap[\"cmd\"] = \"Balance\"\n amap[\"who\"] = clifile\n coins, _ := SendMessages(amap, crosp)\n // myhash := himitsu.HashPublicKey(amap[\"pubkey\"])\n myhash := amap[\"pubhash\"]\n tempbal := 0\n for ix := 0; ix < len(coins); ix++ {\n denom, _ := strconv.Atoi(coins[ix].Denom)\n tempbal = tempbal + denom\n } // end for coins.\n\n ballons[myhash] = tempbal\n baltime[myhash] = methods.MilliNow()\n allaccounts[myhash] = coins\n fmt.Printf(\"Balance for %s = %d.\\n\", clifile, tempbal)\n return tempbal\n}", "title": "" }, { "docid": "72f9f9c72a3d239b17a2eff22bfacac2", "score": "0.55227435", "text": "func (_RootChain *RootChainSession) GetPlasmaCoin(slot uint64) (*big.Int, *big.Int, *big.Int, common.Address, uint8, uint8, common.Address, error) {\n\treturn _RootChain.Contract.GetPlasmaCoin(&_RootChain.CallOpts, slot)\n}", "title": "" }, { "docid": "d8d0337b07eb4e22cba3db27d7b1e174", "score": "0.55145735", "text": "func (k *Kraken) GetTradeBalance(symbol, asset string) (interface{}, error) {\n\tvalues := url.Values{}\n\n\tif len(symbol) > 0 {\n\t\tvalues.Set(\"aclass\", symbol)\n\t}\n\tif len(asset) > 0 {\n\t\tvalues.Set(\"asset\", asset)\n\t}\n\n\treturn k.SendAuthenticatedHTTPRequest(krakenTradeBalance, values)\n}", "title": "" }, { "docid": "92398af25728219f879568fc167c4214", "score": "0.5505314", "text": "func (s *SaveData) GetMoney() uint32 {\n\tencryptedMoney := s.readU32(0x1410)\n\tkey := s.GetEncryptionKey()\n\treturn encryptedMoney ^ key\n}", "title": "" }, { "docid": "8b3b77cdffb1813f5209be97b1b35b7a", "score": "0.5490133", "text": "func (k BaseViewKeeper) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin {\n\tstore := ctx.KVStore(k.storeKey)\n\tbalancesStore := prefix.NewStore(store, types.BalancesPrefix)\n\taccountStore := prefix.NewStore(balancesStore, addr.Bytes())\n\n\tbz := accountStore.Get([]byte(denom))\n\tif bz == nil {\n\t\treturn sdk.NewCoin(denom, sdk.ZeroInt())\n\t}\n\n\tvar balance sdk.Coin\n\tk.cdc.MustUnmarshalBinaryBare(bz, &balance)\n\n\treturn balance\n}", "title": "" }, { "docid": "2b1cd6a0b993fb45953a679a8b65b080", "score": "0.5487325", "text": "func (p *paymentTokens) getAmount(ns, token string) (int, error) {\n\n\tif d, err := p.redisClient.HGet(\"cashouts:amounts\"+ns, token).Result(); err != nil {\n\t\treturn 0, err\n\t} else {\n\t\tamount, _ := strconv.ParseInt(d, 10, 0)\n\t\treturn int(amount), nil\n\t}\n\n}", "title": "" }, { "docid": "00f4d7e72dae570701e71fa209dc7942", "score": "0.54859716", "text": "func (core *coreService) ReadContract(ctx context.Context, in *iotextypes.Execution, from string, gasLimit uint64) (string, *iotextypes.Receipt, error) {\n\tlog.L().Debug(\"receive read smart contract request\")\n\tsc := &action.Execution{}\n\tif err := sc.LoadProto(in); err != nil {\n\t\treturn \"\", nil, status.Error(codes.InvalidArgument, err.Error())\n\t}\n\tkey := hash.Hash160b(append([]byte(sc.Contract()), sc.Data()...))\n\t// TODO: either moving readcache into the upper layer or change the storage format\n\tif d, ok := core.readCache.Get(key); ok {\n\t\tres := iotexapi.ReadContractResponse{}\n\t\tif err := proto.Unmarshal(d, &res); err == nil {\n\t\t\treturn res.Data, res.Receipt, nil\n\t\t}\n\t}\n\n\tif from == action.EmptyAddress {\n\t\tfrom = address.ZeroAddress\n\t}\n\tcallerAddr, err := address.FromString(from)\n\tif err != nil {\n\t\treturn \"\", nil, status.Error(codes.FailedPrecondition, err.Error())\n\t}\n\tstate, err := accountutil.AccountState(core.sf, callerAddr)\n\tif err != nil {\n\t\treturn \"\", nil, status.Error(codes.InvalidArgument, err.Error())\n\t}\n\tif ctx, err = core.bc.Context(ctx); err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tif gasLimit == 0 || core.cfg.Genesis.BlockGasLimit < gasLimit {\n\t\tgasLimit = core.cfg.Genesis.BlockGasLimit\n\t}\n\tsc, _ = action.NewExecution(\n\t\tsc.Contract(),\n\t\tstate.Nonce+1,\n\t\tsc.Amount(),\n\t\tgasLimit,\n\t\tbig.NewInt(0), // ReadContract() is read-only, use 0 to prevent insufficient gas\n\t\tsc.Data(),\n\t)\n\tretval, receipt, err := core.sf.SimulateExecution(ctx, callerAddr, sc, core.dao.GetBlockHash)\n\tif err != nil {\n\t\treturn \"\", nil, status.Error(codes.Internal, err.Error())\n\t}\n\t// ReadContract() is read-only, if no error returned, we consider it a success\n\treceipt.Status = uint64(iotextypes.ReceiptStatus_Success)\n\tres := iotexapi.ReadContractResponse{\n\t\tData: hex.EncodeToString(retval),\n\t\tReceipt: receipt.ConvertToReceiptPb(),\n\t}\n\tif d, err := proto.Marshal(&res); err == nil {\n\t\tcore.readCache.Put(key, d)\n\t}\n\treturn res.Data, res.Receipt, nil\n}", "title": "" }, { "docid": "2defa418a28dbfa5e9a0083f9b482baf", "score": "0.54452163", "text": "func (seele *SeeleContract) GetContract(_contractId [32]byte) ([]byte, error) {\n\treturn seele.getFuncByteCode(\"getContract\", _contractId)\n}", "title": "" }, { "docid": "fefc6af73def818d9f28fe11fa382409", "score": "0.54420674", "text": "func (t *Tripay) GetCost(amount int,code PaymentChannelCode)([]byte, error) {\n\tvar cost struct{\n\t\tAmount int `query:\"amount\"`\n\t\tCode PaymentChannelCode `query:\"code,omitempty\"`\n\t}\n\tcost.Amount = amount\n\tcost.Code = code\n\tq, _ :=structToQuery(&cost)\n\turi := []byte(t.Host + \"/merchant/fee-calculator?\"+q)\n\treq := fasthttp.AcquireRequest()\n\tdefer fasthttp.ReleaseRequest(req)\n\tres := fasthttp.AcquireResponse()\n\tdefer fasthttp.ReleaseResponse(res)\n\treq.SetRequestURIBytes(uri)\n\treq.Header.AddBytesV(\"Authorization\", t.ApiKey)\n\tif err := fasthttp.Do(req, res); err != nil {\n\t\treturn nil, err\n\t}\n\treturn res.Body(), nil\n}", "title": "" }, { "docid": "a51bf4c52cc3780982722131c32e42e8", "score": "0.5438445", "text": "func (e *BIBOX) GetAccount() interface{} {\n\n\tparam := UserAsset{\n\t\tCmd: \"transfer/assets\",\n\t\tBody: UserAssetsBody{\n\t\t\tSelect: 1,\n\t\t},\n\t}\n\tparams := []UserAsset{}\n\tparams = append(params, param)\n\tcmds, _ := json.Marshal(&params)\n\n\tforms := []string{}\n\tcmdsItem := \"cmds=\" + string(cmds)\n\tkeyItem := \"apikey=\" + e.option.AccessKey\n\tsignItem := \"sign=\" + e.getSign(string(cmds))\n\tforms = append(forms, cmdsItem)\n\tforms = append(forms, keyItem)\n\tforms = append(forms, signItem)\n\n\tresp, err := post(e.host+\"transfer\", forms)\n\tif err != nil {\n\t\te.logger.Log(constant.ERROR, \"\", 0.0, 0.0, \"GetAccount() error, \", err)\n\t\treturn false\n\t}\n\n\tjsonResp, err := simplejson.NewJson(resp)\n\tif err != nil {\n\t\te.logger.Log(constant.ERROR, \"\", 0.0, 0.0, \"GetAccount() error, \", err)\n\t\treturn false\n\t}\n\n\tjsons := jsonResp.Get(\"result\").GetIndex(0)\n\tbalancesArray, err := jsons.Get(\"result\").Get(\"assets_list\").Array()\n\tif err != nil {\n\t\te.logger.Log(constant.ERROR, \"\", 0.0, 0.0, \"GetAccount() error, \", err)\n\t\treturn false\n\t}\n\n\tresult := map[string]float64{\n\t\t\"USDT\": 0,\n\t\t\"FrozenUSDT\": 0,\n\t\t\"BTC\": 0,\n\t\t\"FrozenBTC\": 0,\n\t\t\"ETH\": 0,\n\t\t\"FrozenETH\": 0,\n\t\t\"EOS\": 0,\n\t\t\"FrozenEOS\": 0,\n\t\t\"ONT\": 0,\n\t\t\"FrozenONT\": 0,\n\t\t\"QTUM\": 0,\n\t\t\"FrozenQTUM\": 0,\n\t}\n\tfor i, _ := range balancesArray {\n\t\tbalance := jsons.Get(\"result\").Get(\"assets_list\").GetIndex(i)\n\t\tsymbol := strings.ToUpper(balance.Get(\"coin_symbol\").MustString())\n\t\tavail := balance.Get(\"balance\").MustString()\n\t\tfreeze := balance.Get(\"freeze\").MustString()\n\n\t\tresult[symbol] = conver.Float64Must(avail)\n\t\tresult[\"Frozen\"+symbol] = conver.Float64Must(freeze)\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "7c29fc07683005ec10bb8281e2e8c93e", "score": "0.54328614", "text": "func (_Sdctsystem *SdctsystemCaller) GetUserBalance(opts *bind.CallOpts, x *big.Int, y *big.Int, token common.Address) (struct {\n\tCt [4]*big.Int\n\tNonce *big.Int\n}, error) {\n\tret := new(struct {\n\t\tCt [4]*big.Int\n\t\tNonce *big.Int\n\t})\n\tout := ret\n\terr := _Sdctsystem.contract.Call(opts, out, \"getUserBalance\", x, y, token)\n\treturn *ret, err\n}", "title": "" }, { "docid": "e537f05ba1aaa035f7a121e92dccca34", "score": "0.5409587", "text": "func get(stub shim.ChaincodeStubInterface, args []string) (string, error) {\n /*\n if len(args) != 1 {\n return \"\", fmt.Errorf(\"Incorrect arguments. Expecting a key\")\n }\n */\n // key\n var key = args[0] + \"-\" + args[1]\n value, err := stub.GetState(key)\n if err != nil {\n return \"\", fmt.Errorf(\"Failed to get asset: %s with error: %s\", key, err)\n }\n if value == nil {\n return \"\", fmt.Errorf(\"Asset not found: %s\", key)\n }\n cv := CV{}\n\tjson.Unmarshal(value, &cv)\n return cv.Company, nil\n}", "title": "" }, { "docid": "47053bc316cd089f770354288080566f", "score": "0.5401993", "text": "func (_PayFor *PayForCallerSession) GetBalanceContract() (*big.Int, error) {\n\treturn _PayFor.Contract.GetBalanceContract(&_PayFor.CallOpts)\n}", "title": "" }, { "docid": "0fdf51f46c367da3844585101281033a", "score": "0.5374599", "text": "func getCommission(apiKey, apiSecret string) (struct {\n\tSuccess bool\n\tFee float64\n}, error) {\n\tpath := fmt.Sprintf(\"%s/exchange/commission\", LiveCoinAPIURL)\n\n\tconstruct := url.Values{}\n\tmessage := construct.Encode()\n\n\theaders := map[string]string{\n\t\t\"API-Key\": apiKey,\n\t\t\"Sign\": createSignature(message, apiSecret),\n\t\t\"Content-Type\": \"application/x-www-form-urlencoded\",\n\t\t\"Content-Length\": strconv.Itoa(len(message)),\n\t}\n\n\tdata := struct {\n\t\tSuccess bool\n\t\tFee float64\n\t}{}\n\treturn data, sendPayload(\"GET\", path, headers, strings.NewReader(message), &data)\n}", "title": "" }, { "docid": "990c10c20e607cbc68b1e10cb5ef017f", "score": "0.5368784", "text": "func (api *Kraken) GetTradeBalance(baseAsset string) (TradeBalanceResponse, error) {\n\tdata := url.Values{}\n\tif baseAsset != \"\" {\n\t\tdata.Set(\"asset\", baseAsset)\n\t}\n\n\tresponse := TradeBalanceResponse{}\n\tif err := api.request(\"TradeBalance\", true, data, &response); err != nil {\n\t\treturn response, err\n\t}\n\treturn response, nil\n}", "title": "" }, { "docid": "f32f5bfe773808d04f6c0c9d26997a60", "score": "0.53659165", "text": "func (_PayFor *PayForSession) GetBalanceContract() (*big.Int, error) {\n\treturn _PayFor.Contract.GetBalanceContract(&_PayFor.CallOpts)\n}", "title": "" }, { "docid": "a265095ad79d9f86c01199c17341e9a5", "score": "0.5358433", "text": "func (p *contractPayment) GetBalance(account store.Account) (*big.Int, error) {\n\tif account == store.Account(\"\") {\n\t\treturn nil, errors.New(\"failed to get balance: empty account\")\n\t}\n\ttimer := time.Now()\n\tr, err := p.contract.Accounts(&bind.CallOpts{Pending: true}, common.HexToAddress(string(account)))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif r.TimeLocked.Cmp(zeroInt) != 0 {\n\t\treturn nil, ErrDepositTimelocked\n\t}\n\tlogger.Printf(\"Retrieved contract balance for %q in %s: %d\", account, time.Now().Sub(timer), r.Balance)\n\treturn r.Balance, nil\n}", "title": "" }, { "docid": "51b81665f5106b9d5d02de9be3fb0731", "score": "0.5357002", "text": "func Get(ctx context.Context, symbol string) (*finance.QuoteSummary, error) {\n\treturn getC().Get(ctx, symbol)\n}", "title": "" }, { "docid": "842b6278fca931e8f1362f343f45531b", "score": "0.5356096", "text": "func getBalance(apiKey, apiSecret, currency string) (BalanceResponse, error) {\n\tconstruct := url.Values{}\n\tconstruct.Add(\"currency\", currency)\n\tmessage := construct.Encode()\n\n\theaders := map[string]string{\n\t\t\"API-Key\": apiKey,\n\t\t\"Sign\": createSignature(message, apiSecret),\n\t}\n\n\tpath := fmt.Sprintf(\"%s/payment/balance?%s\", LiveCoinAPIURL, message)\n\tlog.Print(\"-- \", path)\n\tdata := BalanceResponse{}\n\treturn data, sendPayload(\"GET\", path, headers, nil, &data)\n}", "title": "" }, { "docid": "d5e76b021b6b85e683af0683d9fe7dcb", "score": "0.5336829", "text": "func (_Cozy *CozySession) GetFees() (*types.Transaction, error) {\n\treturn _Cozy.Contract.GetFees(&_Cozy.TransactOpts)\n}", "title": "" }, { "docid": "b31309c0180d450e65403f0514bb69b0", "score": "0.5336775", "text": "func (w *WS) GetCredit() (IP2ProxyCreditResult, error) {\n\tvar res IP2ProxyCreditResult\n\terr := w.checkParams()\n\n\tif err != nil {\n\t\treturn res, err\n\t}\n\n\tprotocol := \"https\"\n\n\tif !w.useSSL {\n\t\tprotocol = \"http\"\n\t}\n\n\tmyUrl := protocol + \"://\" + baseURL + \"?key=\" + w.apiKey + \"&check=true\"\n\n\tresp, err := http.Get(myUrl)\n\n\tif err != nil {\n\t\treturn res, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode == http.StatusOK {\n\t\tbodyBytes, err := ioutil.ReadAll(resp.Body)\n\n\t\tif err != nil {\n\t\t\treturn res, err\n\t\t}\n\n\t\terr = json.Unmarshal(bodyBytes, &res)\n\n\t\tif err != nil {\n\t\t\treturn res, err\n\t\t}\n\n\t\treturn res, nil\n\t}\n\n\treturn res, errors.New(\"Error HTTP \" + strconv.Itoa(int(resp.StatusCode)))\n}", "title": "" }, { "docid": "2706bc974cbde5acc7fe52039380c7d3", "score": "0.53246176", "text": "func (t *SimpleChaincode) tradeFunds(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {\nA:=args[0]\nB:=args[1]\nC:=args[2]\n\namount,_:=strconv.Atoi(C)\n\n//get the balances\nvar provider XOM\nvalueA, err := stub.GetState(A)\nerr=json.Unmarshal(valueA, &provider)\nCBX,err:=strconv.Atoi(provider.CurrentBal)\n\nvar customer Customer\nvalueB, err := stub.GetState(B)\nerr=json.Unmarshal(valueB, &customer)\nCBC,err:=strconv.Atoi(customer.CurrentBal)\n\n//now the trade\nCBC=CBC-amount\nCBX=CBX+amount\n\ncustomer.CurrentBal=strconv.Itoa(CBC)\nprovider.CurrentBal=strconv.Itoa(CBX)\n\na1,_:=json.Marshal(provider)\nerr = stub.PutState(A,[]byte(a1))\n\nb1,_:=json.Marshal(customer)\nerr = stub.PutState(B,[]byte(b1))\n\nif err != nil {\n return nil, err\n}\n\nreturn nil,nil\n}", "title": "" }, { "docid": "541310c2a82d9eb91099a6e37b698772", "score": "0.5314175", "text": "func (_ReserveContract *ReserveContractCallerSession) GetBalance(token common.Address) (*big.Int, error) {\n\treturn _ReserveContract.Contract.GetBalance(&_ReserveContract.CallOpts, token)\n}", "title": "" }, { "docid": "3e67329cdfaed5d4690f2efeba6ab184", "score": "0.53111845", "text": "func Get(params *stripe.BalanceParams) (*stripe.Balance, error) {\n\treturn getC().Get(params)\n}", "title": "" }, { "docid": "0d425283b9cdfaf0c4f9c12317870974", "score": "0.5307043", "text": "func (bc *BClient) GetPrice(ctx context.Context, address Address) (*big.Int, error) {\n\t/*\n\t\tno. Firstly, a cToken is worth significantly less than the underlying asset. This conversion is given by ‘exchangeRateCurrent’. To get the dollar value, you will need to get exchange rates from the oracle which get you to eth value. Then get the exchange rate to usdc to get dollar value.\n\t\tHere is the oracle address: 0xddc46a3b076aec7ab3fc37420a8edd2959764ec4\n\t\tYou need to fetch an exchange rate for your cToken, multiply by the underlying quantity and then divide the total by 1e18 to get eth value\n\t\tIf you want to get to $ value, just do the opposite with usdc. Fetch cUSDC exchange rate from oracle, multiply previous product by 1e18, then divide this by the usdc exchange rate. You should get usdc value\n\t*/\n\tswitch address {\n\tcase CompoundBAT:\n\t\tcontract, err := cbat.NewBindings(address.EthAddress(), bc.client)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn contract.ExchangeRateStored(nil)\n\tcase CompoundDAI:\n\t\tcontract, err := cdai.NewBindings(address.EthAddress(), bc.client)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn contract.ExchangeRateStored(nil)\n\tcase CompoundSAI:\n\t\tcontract, err := csai.NewBindings(address.EthAddress(), bc.client)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn contract.ExchangeRateStored(nil)\n\tcase CompoundETH:\n\t\tcontract, err := ceth.NewBindings(address.EthAddress(), bc.client)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn contract.ExchangeRateStored(nil)\n\tcase CompoundREP:\n\t\tcontract, err := crep.NewBindings(address.EthAddress(), bc.client)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn contract.ExchangeRateStored(nil)\n\tcase CompoundUSDC:\n\t\tcontract, err := cusdc.NewBindings(address.EthAddress(), bc.client)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn contract.ExchangeRateStored(nil)\n\tcase CompoundWBTC:\n\t\tcontract, err := cwbtc.NewBindings(address.EthAddress(), bc.client)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn contract.ExchangeRateStored(nil)\n\tcase CompoundZRX:\n\t\tcontract, err := czrx.NewBindings(address.EthAddress(), bc.client)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn contract.ExchangeRateStored(nil)\n\tdefault:\n\t\treturn nil, errors.New(\"invalid contract type\")\n\t}\n}", "title": "" }, { "docid": "2bf79543f185019296e970fb588ec728", "score": "0.53025633", "text": "func main() {\r\n\tcurve := ecc.NewSecp256K1()\r\n \tprK := new(big.Int)\r\n prK.SetString(constant.PrivateKeyStart,16)\r\n\r\n\tvar connection = web3.NewWeb3(providers.NewHTTPProvider(\"127.0.0.1:8501\", 10, false))\r\n\text := web3ext.NewWeb3Ext(connection.Provider)\r\n\r\n\tabi, err := ioutil.ReadFile(os.Args[1])\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t\tpanic(\"File io\")\r\n\t}\r\n\tcontract, err := ext.NewContract(abi)\r\n\r\n\tfor k,v := range(contract.Abi.Methods) {\r\n\t\tfmt.Printf(\"%x %20s %s\\n\",v.ID(),k,v.Sig())\r\n\t}\r\n\r\n\ttransaction := new(dto.TransactionParameters)\r\n\tcoinbase, err := connection.Eth.GetCoinbase()\r\n\ttransaction.From = coinbase\r\n\ttransaction.Gas = big.NewInt(4000000)\r\n\r\n\ttransaction.To = os.Args[2]\r\n\tv := \"\"\r\n\tresult, err := contract.Call(&v,transaction, \"name\")\r\n\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t} else {\r\n\t\tfmt.Println(\"name \",*result.(*string))\r\n\t}\r\n\r\n\tresult, err = contract.Call(&v,transaction, \"symbol\")\r\n\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t} else {\r\n\t\tfmt.Println(\"symbol\",*result.(*string))\r\n\t}\r\n\r\n\tfor i:=0;i<32;i++ {\r\n\t\tb := big.NewInt(0)\r\n\t\taddr := common.HexToAddress(curve.PrivateKey2Address(prK))\r\n\t\tresult, err = contract.Call(&b,transaction, \"balances\", addr)\r\n\r\n\t\tif err != nil {\r\n\t\t\tfmt.Println(err)\r\n\t\t} else {\r\n\t\t\tfmt.Printf(\"%5d. \",i)\r\n\t\t\tfmt.Println(\"balance of\",addr.Hex(),*result.(**big.Int))\r\n\t\t}\r\n\t\tprK.Add(prK,big.NewInt(1))\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "72fbaacbbf8cf492cf51c4ece0c27946", "score": "0.52900964", "text": "func (c *Client) getMemo(tx *btcjson.TxRawResult) (string, error) {\n\tvar opreturns string\n\tfor _, vout := range tx.Vout {\n\t\tif strings.HasPrefix(vout.ScriptPubKey.Asm, \"OP_RETURN\") {\n\t\t\topreturn := strings.Split(vout.ScriptPubKey.Asm, \" \")\n\t\t\topreturns += opreturn[1]\n\t\t}\n\t}\n\tdecoded, err := hex.DecodeString(opreturns)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"fail to decode OP_RETURN string\")\n\t}\n\treturn string(decoded), nil\n}", "title": "" }, { "docid": "3dac2ad28bda94a74b6d65214394d05f", "score": "0.5286227", "text": "func (_Sdctsystem *SdctsystemCallerSession) GetUserBalance(x *big.Int, y *big.Int, token common.Address) (struct {\n\tCt [4]*big.Int\n\tNonce *big.Int\n}, error) {\n\treturn _Sdctsystem.Contract.GetUserBalance(&_Sdctsystem.CallOpts, x, y, token)\n}", "title": "" }, { "docid": "c114a3273b9979a013c80d24dad9895f", "score": "0.52735215", "text": "func bindCash(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CashABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}", "title": "" }, { "docid": "c85f07b1fee6976d3a4dbb6e8a0af3ed", "score": "0.5272909", "text": "func DeployCash(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Cash, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CashABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CashBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Cash{CashCaller: CashCaller{contract: contract}, CashTransactor: CashTransactor{contract: contract}, CashFilterer: CashFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "cf31935a585a0abb5c2895998790e959", "score": "0.52698976", "text": "func (_Sdctsystem *SdctsystemSession) GetUserBalance(x *big.Int, y *big.Int, token common.Address) (struct {\n\tCt [4]*big.Int\n\tNonce *big.Int\n}, error) {\n\treturn _Sdctsystem.Contract.GetUserBalance(&_Sdctsystem.CallOpts, x, y, token)\n}", "title": "" }, { "docid": "3195628a9d539256471723a4b4ab7f0d", "score": "0.52692425", "text": "func ExampleCreditsClient_Get() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclientFactory, err := armconsumption.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := clientFactory.NewCreditsClient().Get(ctx, \"1234:5678\", \"2468\", nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\t// You could use response here. We use blank identifier for just demo purposes.\n\t_ = res\n\t// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// res.CreditSummary = armconsumption.CreditSummary{\n\t// \tName: to.Ptr(\"balanceSummary1\"),\n\t// \tType: to.Ptr(\"Microsoft.Consumption/credits/balanceSummary\"),\n\t// \tID: to.Ptr(\"/providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468/providers/Microsoft.Consumption/credits/balanceSummary1\"),\n\t// \tProperties: &armconsumption.CreditSummaryProperties{\n\t// \t\tBalanceSummary: &armconsumption.CreditBalanceSummary{\n\t// \t\t\tCurrentBalance: &armconsumption.Amount{\n\t// \t\t\t\tCurrency: to.Ptr(\"USD\"),\n\t// \t\t\t\tValue: to.Ptr[float64](100),\n\t// \t\t\t},\n\t// \t\t\tEstimatedBalance: &armconsumption.Amount{\n\t// \t\t\t\tCurrency: to.Ptr(\"USD\"),\n\t// \t\t\t\tValue: to.Ptr[float64](600),\n\t// \t\t\t},\n\t// \t\t},\n\t// \t\tBillingCurrency: to.Ptr(\"USD\"),\n\t// \t\tCreditCurrency: to.Ptr(\"USD\"),\n\t// \t\tExpiredCredit: &armconsumption.Amount{\n\t// \t\t\tCurrency: to.Ptr(\"USD\"),\n\t// \t\t\tValue: to.Ptr[float64](0),\n\t// \t\t},\n\t// \t\tPendingCreditAdjustments: &armconsumption.Amount{\n\t// \t\t\tCurrency: to.Ptr(\"USD\"),\n\t// \t\t\tValue: to.Ptr[float64](500),\n\t// \t\t},\n\t// \t\tPendingEligibleCharges: &armconsumption.Amount{\n\t// \t\t\tCurrency: to.Ptr(\"USD\"),\n\t// \t\t\tValue: to.Ptr[float64](0),\n\t// \t\t},\n\t// \t\tReseller: &armconsumption.Reseller{\n\t// \t\t\tResellerDescription: to.Ptr(\"Reseller information.\"),\n\t// \t\t\tResellerID: to.Ptr(\"/providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468/providers/Microsoft.Consumption/reseller/reseller1\"),\n\t// \t\t},\n\t// \t},\n\t// }\n}", "title": "" }, { "docid": "66b119f12b86c214c7bf33b5e7685065", "score": "0.52650875", "text": "func (_Controller *ControllerCaller) GetContract(opts *bind.CallOpts, _id [32]byte) (common.Address, error) {\n\tvar out []interface{}\n\terr := _Controller.contract.Call(opts, &out, \"getContract\", _id)\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "4b624c50ac1cc64f79baf396127f2a3d", "score": "0.5254201", "text": "func (network *Network) GetContract(chaincodeID string) *Contract {\n\treturn network.GetContractWithName(chaincodeID, \"\")\n}", "title": "" }, { "docid": "50733c20c974b6e0372a9b48eb4928b5", "score": "0.525341", "text": "func (_Cash *CashRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {\n\treturn _Cash.Contract.CashCaller.contract.Call(opts, result, method, params...)\n}", "title": "" }, { "docid": "6141cc5b35c150060cc0be077e721352", "score": "0.5249897", "text": "func (e *Bitmax) GetCoinsData() error {\n\tcoinsData := CoinsData{}\n\n\tstrRequestUrl := \"/api/v1/assets\"\n\tstrUrl := API_URL + strRequestUrl\n\n\tjsonCurrencyReturn := exchange.HttpGetRequest(strUrl, nil)\n\tif err := json.Unmarshal([]byte(jsonCurrencyReturn), &coinsData); err != nil {\n\t\treturn fmt.Errorf(\"%s Get Coins Json Unmarshal Err: %v %s\", e.GetName(), err, jsonCurrencyReturn)\n\t}\n\n\tfor _, data := range coinsData {\n\t\tc := &coin.Coin{}\n\t\tswitch e.Source {\n\t\tcase exchange.EXCHANGE_API:\n\t\t\tc = coin.GetCoin(data.AssetCode)\n\t\t\tif c == nil {\n\t\t\t\tc = &coin.Coin{}\n\t\t\t\tc.Code = data.AssetCode\n\t\t\t\tc.Name = data.AssetName\n\t\t\t\tcoin.AddCoin(c)\n\t\t\t}\n\t\tcase exchange.JSON_FILE:\n\t\t\tc = e.GetCoinBySymbol(data.AssetCode)\n\t\t}\n\n\t\tif c != nil {\n\t\t\tdeposit := true\n\t\t\twithdraw := true\n\t\t\tif data.Status == \"NotTrading\" || data.Status == \"NoTransaction\" {\n\t\t\t\tdeposit = false\n\t\t\t\twithdraw = false\n\t\t\t} else if data.Status == \"NoWithdraw\" {\n\t\t\t\twithdraw = false\n\t\t\t} else if data.Status == \"NoDeposit\" {\n\t\t\t\tdeposit = false\n\t\t\t}\n\t\t\tcoinConstraint := e.GetCoinConstraint(c)\n\t\t\tif coinConstraint == nil {\n\t\t\t\tcoinConstraint = &exchange.CoinConstraint{\n\t\t\t\t\tCoinID: c.ID,\n\t\t\t\t\tCoin: c,\n\t\t\t\t\tExSymbol: data.AssetCode,\n\t\t\t\t\tChainType: exchange.MAINNET,\n\t\t\t\t\tTxFee: data.WithdrawalFee,\n\t\t\t\t\tWithdraw: withdraw,\n\t\t\t\t\tDeposit: deposit,\n\t\t\t\t\tConfirmation: DEFAULT_CONFIRMATION,\n\t\t\t\t\tListed: DEFAULT_LISTED,\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcoinConstraint.ExSymbol = data.AssetCode\n\t\t\t\tcoinConstraint.TxFee = data.WithdrawalFee\n\t\t\t\tcoinConstraint.Withdraw = withdraw\n\t\t\t\tcoinConstraint.Deposit = deposit\n\t\t\t}\n\t\t\te.SetCoinConstraint(coinConstraint)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "995658951934f02e9d3b99c767f5cd8e", "score": "0.5242425", "text": "func (_Cozy *CozyTransactorSession) GetFees() (*types.Transaction, error) {\n\treturn _Cozy.Contract.GetFees(&_Cozy.TransactOpts)\n}", "title": "" }, { "docid": "ded30f5f3e375f1301ae14b8c41d6a56", "score": "0.5235151", "text": "func (_Cozy *CozyTransactor) GetFees(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Cozy.contract.Transact(opts, \"getFees\")\n}", "title": "" }, { "docid": "0541d3b9608469b8d5852c77d4ca1b09", "score": "0.5228778", "text": "func (s *SmartContract) Get(ctx contractapi.TransactionContextInterface, key string) (string, error) {\n\tvalue, err := ctx.GetStub().GetState(key)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get state from ledger: %w\", err)\n\t}\n\n\treturn string(value), nil\n}", "title": "" }, { "docid": "fd2b915e9495213b7e588509173d1967", "score": "0.5227949", "text": "func (st *ContractState) GetData(key []byte) ([]byte, error) {\n\tid := types.GetHashID(key)\n\tif entry := st.storage.get(id); entry != nil {\n\t\tif value := entry.Value(); value != nil {\n\t\t\treturn value.([]byte), nil\n\t\t}\n\t\treturn nil, nil\n\t}\n\treturn st.getInitialData(id[:])\n}", "title": "" }, { "docid": "6f23c30e85acbf745db7088e306f69eb", "score": "0.5224116", "text": "func GetSalary(contract *Contract, account string, priv *myCrypto.PrivateKey) (salary *big.Int, err error) {\n\t//fmt.Println(\"=====check the salary of\", account)\n\tsalaryEncrypted, err := contract.CheckSalary(nil, common.HexToAddress(account))\n\tif err != nil {\n\t\tlog.Fatalf(\"could not get salary: %v\", err)\n\t\treturn nil, err\n\t}\n\t//fmt.Println(\"log: the c,d of salary:\", salaryEncrypted.C, salaryEncrypted.D)\n\tzero := big.NewInt(0)\n\tif (salaryEncrypted.C.Cmp(zero) == 0) && (salaryEncrypted.D.Cmp(zero) == 0) {\n\t\treturn zero, nil\n\t}\n\t//No commit here, since there is no need to change chain state\n\n\tsalary, err = myCrypto.DecryptInt(priv, salaryEncrypted.C, salaryEncrypted.D)\n\tif err != nil {\n\t\tlog.Fatalf(\"could not decrypt balance: %v\", err)\n\t\treturn nil, err\n\t}\n\t//fmt.Println(\"=====Function GetSalary:\", account, salary)\n\treturn salary, nil\n}", "title": "" }, { "docid": "888f2b37868fb4dde54d05037c129184", "score": "0.5219933", "text": "func (btc *Backend) Contract(coinID []byte, redeemScript []byte) (asset.Contract, error) {\n\ttxHash, vout, err := decodeCoinID(coinID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error decoding coin ID %x: %w\", coinID, err)\n\t}\n\toutput, err := btc.output(txHash, vout, redeemScript)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcontract := &Contract{Output: output}\n\t// Verify contract and set refundAddress and swapAddress.\n\terr = btc.auditContract(contract)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn contract, nil\n}", "title": "" }, { "docid": "0d8beb67365ec488f4ac32599a9a85fb", "score": "0.52068436", "text": "func get(stub shim.ChaincodeStubInterface, args []string) (string, error) {\n if len(args) != 1 {\n return \"\", fmt.Errorf(\"Incorrect arguments. Expecting a key\")\n }\n value, err := stub.GetState(args[0])\n if err != nil {\n return \"\", fmt.Errorf(\"Failed to get asset: %s with error: %s\", args[0], err)\n }\n if value == nil {\n return \"\", fmt.Errorf(\"Asset not found: %s\", args[0])\n }\n return string(value), nil\n}", "title": "" }, { "docid": "5ebfa7c73c2ec5f3f4fb4c44daa4fdae", "score": "0.519953", "text": "func (p *OandaAPI) GetBalance() map[string]interface{} {\n\n\tif err, response := p.marketRequest(\"GET\", \"/v3/accounts/\"+p.config.Custom[\"account\"].(string), map[string]string{}); err != nil {\n\t\tlogger.Errorf(\"Fail to get account info:%v\", err)\n\t\treturn nil\n\t} else {\n\t\tvar values map[string]interface{}\n\t\tif err = json.Unmarshal(response, &values); err != nil {\n\t\t\tlogger.Errorf(\"Fail to parse the json:%v\", err)\n\t\t\treturn nil\n\t\t}\n\n\t\tif values[\"account\"] != nil {\n\t\t\tbalance, _ := strconv.ParseFloat(values[\"account\"].(map[string]interface{})[\"balance\"].(string), 64)\n\t\t\treturn map[string]interface{}{\n\t\t\t\t\"balance\": balance,\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b1f42cdc27c8d614ff9c1f01ebf29f51", "score": "0.51981425", "text": "func (eos EOS) GetCurrencyBalance(code, account, symbol string) ([]string, error) {\n\treqBody := map[string]interface{}{\n\t\t\"code\": code,\n\t\t\"account\": account,\n\t\t\"symbol\": symbol,\n\t}\n\n\treqBodyData, err := json.Marshal(reqBody)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trespBody, err := POST(eos.Config.NodeosURL+\"/v1/chain/get_currency_balance\", reqBodyData)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar balanceResponse []string\n\tif err = json.Unmarshal(respBody, &balanceResponse); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn balanceResponse, nil\n}", "title": "" }, { "docid": "0805f0075a7c272a7dc0ca660817b89e", "score": "0.51898015", "text": "func Get(params *BalanceParams) (*Balance, error) {\n\treturn getC().Get(params)\n}", "title": "" }, { "docid": "03af6473980bac04c6700e574fbeb750", "score": "0.51895463", "text": "func (t *assetChaincode) readDebit(stub shim.ChaincodeStubInterface, args []string) pb.Response {\r\n\tnew_id := args[0]\r\n\tdebit_key := DebitPrefix + new_id\r\n\r\n\tDebitAsBytes, err := stub.GetState(debit_key)\r\n\tif err != nil {\r\n\t\treturn shim.Error(\"Fail to get debit: \" + err.Error())\r\n\t}\r\n\tif DebitAsBytes == nil {\r\n\t\tfmt.Println(\"This debit doesn't exist: \" + new_id)\r\n\t\treturn shim.Error(\"This debit doesn't exist: \" + new_id)\r\n\t}\r\n\r\n\treturn shim.Success(DebitAsBytes)\r\n}", "title": "" }, { "docid": "a6a70d4d01ac2e86e77c92cb1f745ecc", "score": "0.51670164", "text": "func (c Client) Get(ctx context.Context, symbol string) (*finance.QuoteSummary, error) {\n\tif symbol == \"\" {\n\t\treturn nil, finance.CreateArgumentError()\n\t}\n\n\tif ctx == nil {\n\t\tctx = context.TODO()\n\t}\n\n\t// Build request.\n\tbody := &form.Values{}\n\t// form.AppendTo(body, params)\n\t// Set request meta data.\n\tbody.Set(\"region\", \"US\")\n\tbody.Set(\"corsDomain\", \"com.finance.yahoo\")\n\tbody.Set(\"formatted\", \"false\")\n\tbody.Set(\"lang\", \"en-US\")\n\tbody.Set(\"region\", \"US\")\n\n\t// Note: If these modules are expanded the QuoteSummary struct will also need to be\n\t// expanded to match.\n\tbody.Set(\"modules\", \"summaryProfile,financialData\")\n\n\tresp := response{}\n\terr := c.B.Call(\"v10/finance/quoteSummary/\"+symbol, body, &ctx, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp.Inner.Error != nil {\n\t\treturn nil, resp.Inner.Error\n\t}\n\n\tresult := resp.Inner.Results[0]\n\tif result == nil {\n\t\treturn nil, finance.CreateRemoteErrorS(\"no quote summary in response\")\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "ca38fedd7f3ff732c8700967d4b02cb5", "score": "0.5164278", "text": "func (c *LitRpcClient) GetContract(contractIndex uint64) (*lnutil.DlcContract, error) {\n\targs := new(litrpc.GetContractArgs)\n\targs.Idx = contractIndex\n\treply := new(litrpc.GetContractReply)\n\terr := c.rpcConn.Call(\"LitRPC.GetContract\", args, reply)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif reply.Contract == nil {\n\t\treturn nil, fmt.Errorf(\"No contract returned from server\")\n\t}\n\n\treturn reply.Contract, nil\n}", "title": "" }, { "docid": "598aea8fc6dee01c7ae9b645082c20f2", "score": "0.5158657", "text": "func (cryptoService) GetCurrency(ctx context.Context, symbol string) (string, error) {\n\tvar url string\n\tif symbol == \"all\" {\n\t\turl = \"https://api.demo.hitbtc.com/api/2/public/ticker\"\n\t} else if isSymbolValid(symbol) {\n\t\turl = fmt.Sprintf(\"https://api.hitbtc.com/api/2/public/ticker/\" + symbol)\n\t} else {\n\t\treturn string(\"Invalid Symbol \"), nil\n\t}\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer resp.Body.Close()\n\tresponsedata, err2 := ioutil.ReadAll(resp.Body)\n\tif err2 != nil {\n\t\tlog.Fatal(err2)\n\t}\n\treturn string(responsedata), nil\n}", "title": "" }, { "docid": "37a2b3f070e0693bfc3b76ad05f9f3b5", "score": "0.5157295", "text": "func (_Controller *ControllerCallerSession) GetContract(_id [32]byte) (common.Address, error) {\n\treturn _Controller.Contract.GetContract(&_Controller.CallOpts, _id)\n}", "title": "" }, { "docid": "73e20bc62e972ff569b3f8b8f1274c31", "score": "0.51515585", "text": "func (s SpacemeshGrpcService) GetBalance(ctx context.Context, in *pb.AccountId) (*pb.SimpleMessage, error) {\n\taddr := address.HexToAddress(in.Address)\n\n\tif s.StateApi.Exist(addr) != true {\n\t\treturn nil, fmt.Errorf(\"account does not exist\")\n\t}\n\n\tval := s.StateApi.GetBalance(addr)\n\n\treturn &pb.SimpleMessage{Value: val.String()}, nil\n}", "title": "" }, { "docid": "b2f73bec9159a38269d976c6e2ed907c", "score": "0.5149455", "text": "func (e *Hitbtc) GetCoinsData() error {\n\tcoinsData := CoinsData{}\n\n\tstrRequestUrl := \"/api/2/public/currency\"\n\tstrUrl := API_URL + strRequestUrl\n\n\tjsonCurrencyReturn := exchange.HttpGetRequest(strUrl, nil)\n\tif err := json.Unmarshal([]byte(jsonCurrencyReturn), &coinsData); err != nil {\n\t\treturn fmt.Errorf(\"%s Get Coins Json Unmarshal Err: %v %v\", e.GetName(), err, jsonCurrencyReturn)\n\t}\n\n\tfor _, data := range coinsData {\n\t\tc := &coin.Coin{}\n\t\tswitch e.Source {\n\t\tcase exchange.EXCHANGE_API:\n\t\t\tc = coin.GetCoin(data.ID)\n\t\t\tif c == nil {\n\t\t\t\tc = &coin.Coin{}\n\t\t\t\tc.Code = data.ID\n\t\t\t\tc.Name = data.FullName\n\t\t\t\tcoin.AddCoin(c)\n\t\t\t}\n\t\tcase exchange.JSON_FILE:\n\t\t\tc = e.GetCoinBySymbol(data.ID)\n\t\t}\n\n\t\tif c != nil {\n\t\t\ttxFee, _ := strconv.ParseFloat(data.PayoutFee, 64)\n\t\t\tcoinConstraint := e.GetCoinConstraint(c)\n\t\t\tif coinConstraint == nil {\n\t\t\t\tcoinConstraint = &exchange.CoinConstraint{\n\t\t\t\t\tCoinID: c.ID,\n\t\t\t\t\tCoin: c,\n\t\t\t\t\tExSymbol: data.ID,\n\t\t\t\t\tChainType: exchange.MAINNET,\n\t\t\t\t\tTxFee: txFee,\n\t\t\t\t\tWithdraw: data.PayoutEnabled,\n\t\t\t\t\tDeposit: data.PayinEnabled,\n\t\t\t\t\tConfirmation: data.PayinConfirmations,\n\t\t\t\t\tListed: !data.Delisted,\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcoinConstraint.ExSymbol = data.ID\n\t\t\t\tcoinConstraint.TxFee = txFee\n\t\t\t\tcoinConstraint.Withdraw = data.PayoutEnabled\n\t\t\t\tcoinConstraint.Deposit = data.PayinEnabled\n\t\t\t\tcoinConstraint.Confirmation = data.PayinConfirmations\n\t\t\t\tcoinConstraint.Listed = !data.Delisted\n\t\t\t}\n\t\t\te.SetCoinConstraint(coinConstraint)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "adc8dbad3e7c36cb33c2a7db66b59331", "score": "0.5149398", "text": "func (_Controller *ControllerSession) GetContract(_id [32]byte) (common.Address, error) {\n\treturn _Controller.Contract.GetContract(&_Controller.CallOpts, _id)\n}", "title": "" }, { "docid": "767fa98a35e1ba8a83c2331e8ca4ca5d", "score": "0.5140456", "text": "func (e *PublicEthAPI) GetBalance(address common.Address, blockNum BlockNumber) (*hexutil.Big, error) {\n\tctx := e.cliCtx.WithHeight(blockNum.Int64())\n\tres, _, err := ctx.QueryWithData(fmt.Sprintf(\"custom/%s/balance/%s\", types.ModuleName, address.Hex()), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar out types.QueryResBalance\n\te.cliCtx.Codec.MustUnmarshalJSON(res, &out)\n\tval, err := utils.UnmarshalBigInt(out.Balance)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn (*hexutil.Big)(val), nil\n}", "title": "" }, { "docid": "911eec9fea4a2175812711eb41174c28", "score": "0.5139753", "text": "func (s *Service) UpdateCashout(c *gin.Context) {\n\n\tvar t paymentTokens\n\tt.redisClient = s.Redis\n\n\tvar csh cashoutFields\n\n\tif err := c.ShouldBindJSON(&csh); err != nil {\n\t\tve := validationError{Message: err.Error(), Code: \"csh_err\"}\n\t\tc.JSON(http.StatusBadRequest, ve)\n\t\treturn\n\t}\n\tlog.Printf(\"the request is: %#v\", csh)\n\n\tif csh.Name == \"\" {\n\t\tve := validationError{Message: \"Empty namespace\", Code: \"csh_err\"}\n\t\tc.JSON(http.StatusBadRequest, ve)\n\t\treturn\n\t}\n\tif err := t.UpdateCashOut(csh.Name, csh); err != nil {\n\t\tve := validationError{Message: err.Error(), Code: \"csh_err\"}\n\t\tc.JSON(http.StatusBadRequest, ve)\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, gin.H{\"profile\": csh})\n\treturn\n}", "title": "" }, { "docid": "3265034caadf2b142a60ea57400eb3cf", "score": "0.5137553", "text": "func (api *PublicEthereumAPI) GetProof(address common.Address, storageKeys []string, block rpctypes.BlockNumber) (*rpctypes.AccountResult, error) {\n\theight := block.Int64()\n\tapi.logger.Debug(\"eth_getProof\", \"address\", address, \"keys\", storageKeys, \"number\", height)\n\n\tctx := rpctypes.ContextWithHeight(height)\n\tclientCtx := api.clientCtx.WithHeight(height)\n\n\t// query storage proofs\n\tstorageProofs := make([]rpctypes.StorageResult, len(storageKeys))\n\tfor i, key := range storageKeys {\n\t\thexKey := common.HexToHash(key)\n\t\tvalueBz, proof, err := api.queryClient.GetProof(clientCtx, evmtypes.StoreKey, evmtypes.StateKey(address, hexKey.Bytes()))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// check for proof\n\t\tvar proofStr string\n\t\tif proof != nil {\n\t\t\tproofStr = proof.String()\n\t\t}\n\n\t\tstorageProofs[i] = rpctypes.StorageResult{\n\t\t\tKey: key,\n\t\t\tValue: (*hexutil.Big)(new(big.Int).SetBytes(valueBz)),\n\t\t\tProof: []string{proofStr},\n\t\t}\n\t}\n\n\t// query EVM account\n\treq := &evmtypes.QueryAccountRequest{\n\t\tAddress: address.String(),\n\t}\n\n\tres, err := api.queryClient.Account(ctx, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// query account proofs\n\taccountKey := authtypes.AddressStoreKey(sdk.AccAddress(address.Bytes()))\n\t_, proof, err := api.queryClient.GetProof(clientCtx, authtypes.StoreKey, accountKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// check for proof\n\tvar accProofStr string\n\tif proof != nil {\n\t\taccProofStr = proof.String()\n\t}\n\n\tvar balance *big.Int\n\terr = balance.UnmarshalText([]byte(res.Balance))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &rpctypes.AccountResult{\n\t\tAddress: address,\n\t\tAccountProof: []string{accProofStr},\n\t\tBalance: (*hexutil.Big)(balance),\n\t\tCodeHash: common.BytesToHash(res.CodeHash),\n\t\tNonce: hexutil.Uint64(res.Nonce),\n\t\tStorageHash: common.Hash{}, // NOTE: Ethermint doesn't have a storage hash. TODO: implement?\n\t\tStorageProof: storageProofs,\n\t}, nil\n}", "title": "" }, { "docid": "56ece2c8b06e5928cfc2e2105b2a9af4", "score": "0.5119876", "text": "func NewCash(address common.Address, backend bind.ContractBackend) (*Cash, error) {\n\tcontract, err := bindCash(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Cash{CashCaller: CashCaller{contract: contract}, CashTransactor: CashTransactor{contract: contract}, CashFilterer: CashFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "a83047007621879e23a3788bd9414391", "score": "0.51043725", "text": "func (_Pricing *PricingCaller) GetCompactData(opts *bind.CallOpts, token common.Address) (*big.Int, *big.Int, [1]byte, [1]byte, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t\tret1 = new(*big.Int)\n\t\tret2 = new([1]byte)\n\t\tret3 = new([1]byte)\n\t)\n\tout := &[]interface{}{\n\t\tret0,\n\t\tret1,\n\t\tret2,\n\t\tret3,\n\t}\n\terr := _Pricing.contract.Call(opts, out, \"getCompactData\", token)\n\treturn *ret0, *ret1, *ret2, *ret3, err\n}", "title": "" }, { "docid": "4d2d103c12b8a6ace6dc48a90a0117d0", "score": "0.5104102", "text": "func (m Multichain) GetBalance(w http.ResponseWriter, r *http.Request) {\r\n\r\n\t// need Authorization header\r\n\tif len(r.Header[\"Authorization\"]) < 1 {\r\n\t\tw.WriteHeader(http.StatusInternalServerError)\r\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\r\n\t\tjson.NewEncoder(w).Encode(\"Missing Authorization header\")\r\n\t\treturn\r\n\t}\r\n\taddress := r.Header[\"Authorization\"][0]\r\n\r\n\tvar balance struct {\r\n\t\tBalance float64 `json:\"balance\"`\r\n\t}\r\n\tbalance.Balance = m.R.FetchBalance(address)\r\n\r\n\tw.Header().Set(\"Content-Type\", \"application/json\")\r\n\tjson.NewEncoder(w).Encode(balance)\r\n}", "title": "" }, { "docid": "1ffd7b506667f3eba5b0896eac420f22", "score": "0.5101325", "text": "func GetFees(c *rpcd.Client, currency string) (useFee, relayFee diviutil.Amount, err error) {\n\tvar netInfoResp struct {\n\t\tRelayFee float64 `json:\"relayfee\"`\n\t}\n\tvar walletInfoResp struct {\n\t\tPayTxFee float64 `json:\"paytxfee\"`\n\t}\n\tvar estimateResp struct {\n\t\tFeeRate float64 `json:\"feerate\"`\n\t}\n\n\tnetInfoRawResp, err := c.RawRequest(\"getnetworkinfo\", nil)\n\tif err == nil {\n\t\terr = json.Unmarshal(netInfoRawResp, &netInfoResp)\n\t\tif err != nil {\n\t\t\treturn 0, 0, err\n\t\t}\n\t}\n\twalletInfoRawResp, err := c.RawRequest(\"getwalletinfo\", nil)\n\tif err == nil {\n\t\terr = json.Unmarshal(walletInfoRawResp, &walletInfoResp)\n\t\tif err != nil {\n\t\t\treturn 0, 0, err\n\t\t}\n\t}\n\n\trelayFee, err = diviutil.NewAmount(netInfoResp.RelayFee)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tpayTxFee, err := diviutil.NewAmount(walletInfoResp.PayTxFee)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\t// Use user-set wallet fee when set and not lower than the network relay\n\t// fee.\n\tif payTxFee != 0 {\n\t\tmaxFee := payTxFee\n\t\tif relayFee > maxFee {\n\t\t\tmaxFee = relayFee\n\t\t}\n\t\treturn maxFee, relayFee, nil\n\t}\n\n\tfeeRPCMethod := \"estimatesmartfee\"\n\n\tparams := []json.RawMessage{[]byte(\"6\")}\n\testimateRawResp, err := c.RawRequest(feeRPCMethod, params)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\terr = json.Unmarshal(estimateRawResp, &estimateResp)\n\tif err == nil && estimateResp.FeeRate > 0 {\n\t\tuseFee, err = diviutil.NewAmount(estimateResp.FeeRate)\n\t\tif relayFee > useFee {\n\t\t\tuseFee = relayFee\n\t\t}\n\t\treturn useFee, relayFee, err\n\t}\n\n\tfmt.Println(\"warning: falling back to mempool relay fee policy\")\n\treturn relayFee, relayFee, nil\n}", "title": "" }, { "docid": "46fe5d3d285da0cda2a83dd3565dd378", "score": "0.5083538", "text": "func (sc *BankBranchContract) Get(ctx contractapi.TransactionContextInterface, key string) (*BankBranchObj, error) {\n\t\n existingObj, err := ctx.GetStub().GetState(key)\n if err != nil {\n return nil, err\n }\n\n if existingObj == nil {\n return nil, fmt.Errorf(\"Cannot read world state pair with key %s. Does not exist\", key)\n }\n\n\tbankBranchObj := new(BankBranchObj)\n\tif err := json.Unmarshal(existingObj, bankBranchObj); err != nil {\n\t\treturn nil, fmt.Errorf(\"Data retrieved from world state for key %s was not of type BankBranchObj\", key)\n\t}\n return bankBranchObj, nil\n}", "title": "" }, { "docid": "5f4f8352e012bcc52542052380aa0b2f", "score": "0.5078888", "text": "func (cl *CashLetter) GetCredits() []*Credit {\n\tif cl == nil {\n\t\treturn nil\n\t}\n\treturn cl.Credits\n}", "title": "" }, { "docid": "aa34177170517a109eb2852bd2381e01", "score": "0.5071711", "text": "func (c *LitRpcClient) GetFee(coinType uint32) (int64, error) {\n\targs := new(litrpc.FeeArgs)\n\targs.CoinType = coinType\n\treply := new(litrpc.FeeReply)\n\terr := c.rpcConn.Call(\"LitRPC.GetFee\", args, reply)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn reply.CurrentFee, nil\n}", "title": "" }, { "docid": "6ede0d4a395c26b962f4d4411d831681", "score": "0.506528", "text": "func (_ContractWrapper *ContractWrapperCaller) GetBalances(opts *bind.CallOpts, reserve common.Address, tokens []common.Address) ([]*big.Int, error) {\n\tvar (\n\t\tret0 = new([]*big.Int)\n\t)\n\tout := ret0\n\terr := _ContractWrapper.contract.Call(opts, out, \"getBalances\", reserve, tokens)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "a60310e9b818d33b42391028c9b2aa0b", "score": "0.50637424", "text": "func (c *ChannelClient) GetTotalCoins(in *types.ReqGetTotalCoins) (*types.ReplyGetTotalCoins, error) {\n\t//获取地址账户的余额通过account模块\n\tresp, err := c.accountdb.GetTotalCoins(c.QueueProtocolAPI, in)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "684e5c1d4ac1af6db7a2896cb1ea1e00", "score": "0.50631815", "text": "func (_Safe *SafeCaller) GetTransactionHash(opts *bind.CallOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, dataGas *big.Int, gasPrice *big.Int, gasToken common.Address, _nonce *big.Int) ([32]byte, error) {\n\tvar (\n\t\tret0 = new([32]byte)\n\t)\n\tout := ret0\n\terr := _Safe.contract.Call(opts, out, \"getTransactionHash\", to, value, data, operation, safeTxGas, dataGas, gasPrice, gasToken, _nonce)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "28f5a13390b49eb2a3400780aaffe7b8", "score": "0.50621647", "text": "func GetTransaction(w *wallet.Wallet, chainSvr *chain.Client, icmd interface{}) (interface{}, error) {\n\tcmd := icmd.(*btcjson.GetTransactionCmd)\n\n\ttxSha, err := wire.NewShaHashFromStr(cmd.Txid)\n\tif err != nil {\n\t\treturn nil, &btcjson.RPCError{\n\t\t\tCode: btcjson.ErrRPCDecodeHexString,\n\t\t\tMessage: \"Transaction hash string decode failed: \" + err.Error(),\n\t\t}\n\t}\n\n\tdetails, err := w.TxStore.TxDetails(txSha)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif details == nil {\n\t\treturn nil, &ErrNoTransactionInfo\n\t}\n\n\tsyncBlock := w.Manager.SyncedTo()\n\n\t// TODO: The serialized transaction is already in the DB, so\n\t// reserializing can be avoided here.\n\tvar txBuf bytes.Buffer\n\ttxBuf.Grow(details.MsgTx.SerializeSize())\n\terr = details.MsgTx.Serialize(&txBuf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO: Add a \"generated\" field to this result type. \"generated\":true\n\t// is only added if the transaction is a coinbase.\n\tret := btcjson.GetTransactionResult{\n\t\tTxID: cmd.Txid,\n\t\tHex: hex.EncodeToString(txBuf.Bytes()),\n\t\tTime: details.Received.Unix(),\n\t\tTimeReceived: details.Received.Unix(),\n\t\tWalletConflicts: []string{}, // Not saved\n\t\t//Generated: blockchain.IsCoinBaseTx(&details.MsgTx),\n\t}\n\n\tif details.Block.Height != -1 {\n\t\tret.BlockHash = details.Block.Hash.String()\n\t\tret.BlockTime = details.Block.Time.Unix()\n\t\tret.Confirmations = int64(confirms(details.Block.Height, syncBlock.Height))\n\t}\n\n\tvar (\n\t\tdebitTotal btcutil.Amount\n\t\tcreditTotal btcutil.Amount // Excludes change\n\t\toutputTotal btcutil.Amount\n\t\tfee btcutil.Amount\n\t\tfeeF64 float64\n\t)\n\tfor _, deb := range details.Debits {\n\t\tdebitTotal += deb.Amount\n\t}\n\tfor _, cred := range details.Credits {\n\t\tif !cred.Change {\n\t\t\tcreditTotal += cred.Amount\n\t\t}\n\t}\n\tfor _, output := range details.MsgTx.TxOut {\n\t\toutputTotal -= btcutil.Amount(output.Value)\n\t}\n\t// Fee can only be determined if every input is a debit.\n\tif len(details.Debits) == len(details.MsgTx.TxIn) {\n\t\tfee = debitTotal - outputTotal\n\t\tfeeF64 = fee.ToBTC()\n\t}\n\n\tif len(details.Debits) == 0 {\n\t\t// Credits must be set later, but since we know the full length\n\t\t// of the details slice, allocate it with the correct cap.\n\t\tret.Details = make([]btcjson.GetTransactionDetailsResult, 0, len(details.Credits))\n\t} else {\n\t\tret.Details = make([]btcjson.GetTransactionDetailsResult, 1, len(details.Credits)+1)\n\n\t\tret.Details[0] = btcjson.GetTransactionDetailsResult{\n\t\t\t// Fields left zeroed:\n\t\t\t// InvolvesWatchOnly\n\t\t\t// Account\n\t\t\t// Address\n\t\t\t// Vout\n\t\t\t//\n\t\t\t// TODO(jrick): Address and Vout should always be set,\n\t\t\t// but we're doing the wrong thing here by not matching\n\t\t\t// core. Instead, gettransaction should only be adding\n\t\t\t// details for transaction outputs, just like\n\t\t\t// listtransactions (but using the short result format).\n\t\t\tCategory: \"send\",\n\t\t\tAmount: (-debitTotal).ToBTC(), // negative since it is a send\n\t\t\tFee: &feeF64,\n\t\t}\n\t\tret.Fee = feeF64\n\t}\n\n\tcredCat := wallet.RecvCategory(details, syncBlock.Height).String()\n\tfor _, cred := range details.Credits {\n\t\t// Change is ignored.\n\t\tif cred.Change {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar addr string\n\t\t_, addrs, _, err := txscript.ExtractPkScriptAddrs(\n\t\t\tdetails.MsgTx.TxOut[cred.Index].PkScript, activeNet.Params)\n\t\tif err == nil && len(addrs) == 1 {\n\t\t\taddr = addrs[0].EncodeAddress()\n\t\t}\n\n\t\tret.Details = append(ret.Details, btcjson.GetTransactionDetailsResult{\n\t\t\t// Fields left zeroed:\n\t\t\t// InvolvesWatchOnly\n\t\t\t// Account\n\t\t\t// Fee\n\t\t\tAddress: addr,\n\t\t\tCategory: credCat,\n\t\t\tAmount: cred.Amount.ToBTC(),\n\t\t\tVout: cred.Index,\n\t\t})\n\t}\n\n\tret.Amount = creditTotal.ToBTC()\n\treturn ret, nil\n}", "title": "" }, { "docid": "fbeef8bee2da9d0d6a24a53e545e10c0", "score": "0.50592285", "text": "func (k *Kraken) GetBalance() (interface{}, error) {\n\treturn k.SendAuthenticatedHTTPRequest(krakenBalance, url.Values{})\n}", "title": "" }, { "docid": "0fe482441e90683bd9fadfc3d0fdf857", "score": "0.50584996", "text": "func (e *PublicEthAPI) GetProof(address common.Address, storageKeys []string, block BlockNumber) (*AccountResult, error) {\n\topts := client.ABCIQueryOptions{Height: int64(block), Prove: true}\n\tpath := fmt.Sprintf(\"custom/%s/%s/%s\", types.ModuleName, evm.QueryAccount, address.Hex())\n\tpRes, err := e.cliCtx.Client.ABCIQueryWithOptions(path, nil, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO: convert TM merkle proof to []string if needed in future\n\t// proof := pRes.Response.GetProof()\n\n\taccount := new(types.QueryAccount)\n\te.cliCtx.Codec.MustUnmarshalJSON(pRes.Response.GetValue(), &account)\n\n\tstorageProofs := make([]StorageResult, len(storageKeys))\n\tfor i, k := range storageKeys {\n\t\t// Get value for key\n\t\tvPath := fmt.Sprintf(\"custom/%s/%s/%s/%s\", types.ModuleName, evm.QueryStorage, address, k)\n\t\tvRes, err := e.cliCtx.Client.ABCIQueryWithOptions(vPath, nil, opts)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvalue := new(types.QueryResStorage)\n\t\te.cliCtx.Codec.MustUnmarshalJSON(vRes.Response.GetValue(), &value)\n\n\t\tstorageProofs[i] = StorageResult{\n\t\t\tKey: k,\n\t\t\tValue: (*hexutil.Big)(common.BytesToHash(value.Value).Big()),\n\t\t\tProof: []string{\"\"},\n\t\t}\n\t}\n\n\treturn &AccountResult{\n\t\tAddress: address,\n\t\tAccountProof: []string{\"\"}, // This shouldn't be necessary (different proof formats)\n\t\tBalance: (*hexutil.Big)(utils.MustUnmarshalBigInt(account.Balance)),\n\t\tCodeHash: common.BytesToHash(account.CodeHash),\n\t\tNonce: hexutil.Uint64(account.Nonce),\n\t\tStorageHash: common.Hash{}, // Ethermint doesn't have a storage hash\n\t\tStorageProof: storageProofs,\n\t}, nil\n}", "title": "" }, { "docid": "52d1daa757a3fccf2d5bfd3fb647171c", "score": "0.50525695", "text": "func (c *contractBvm) Invoke(rst byzcoin.ReadOnlyStateTrie, inst byzcoin.Instruction, coins []byzcoin.Coin) (sc []byzcoin.StateChange, cout []byzcoin.Coin, err error) {\n\tcout = coins\n\tvar darcID darc.ID\n\t_, _, _, darcID, err = rst.GetValues(inst.InstanceID.Slice())\n\tif err != nil {\n\t\treturn\n\t}\n\tes := c.ES\n\tswitch inst.Invoke.Command {\n\n\tcase \"display\":\n\t\taddressBuf := inst.Invoke.Args.Search(\"address\")\n\t\tif addressBuf == nil {\n\t\t\treturn nil, nil, errors.New(\"no address provided\")\n\t\t}\n\t\taddress := common.HexToAddress(string(addressBuf))\n\t\t_, db, err := getDB(es)\n\t\tif err !=nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tret := db.GetBalance(address)\n\t\tif ret == big.NewInt(0) {\n\t\t\tlog.LLvl1(address.Hex(), \"balance empty\")\n\t\t}\n\t\tlog.LLvl1( address.Hex(), \"balance\", ret ,\"wei\")\n\t\treturn nil, nil, nil\n\n\tcase \"credit\":\n\t\taddressBuf := inst.Invoke.Args.Search(\"address\")\n\t\tif addressBuf == nil {\n\t\t\treturn nil, nil, errors.New(\"no address provided\")\n\t\t}\n\t\taddress := common.HexToAddress(string(addressBuf))\n\t\tmemdb, db, err := getDB(es)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\t//By default credit, credits 5*1e18 wei. To change this, add a new parameter to the byzcoin transaction with the desired value\n\t\tdb.SetBalance(address, big.NewInt(1e18*5))\n\t\tlog.LLvl1(address.Hex(), \"credited 5 eth\")\n\n\t\t//Commits the general stateDb\n\t\tes.RootHash, err = db.Commit(true)\n\t\tif err != nil {\n\t\t\treturn nil, nil ,err\n\t\t}\n\n\t\t//Commits the low level trieDB\n\t\terr = db.Database().TrieDB().Commit(es.RootHash, true)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\t//Saves the general Ethereum State\n\t\tes.DbBuf, err = memdb.Dump()\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\t//Save the Ethereum structure\n\t\tesBuf, err := protobuf.Encode(&es)\n\t\tif err != nil {\n\t\t\treturn nil, nil , err\n\t\t}\n\t\tsc = []byzcoin.StateChange{\n\t\t\tbyzcoin.NewStateChange(byzcoin.Update, inst.InstanceID,\n\t\t\t\tContractBvmID, esBuf, darcID),\n\t\t}\n\n\tcase \"transaction\":\n\t\tmemdb, db, err := getDB(es)\n\t\tif err != nil{\n\t\t\treturn nil, nil, err\n\t\t}\n\t\ttxBuffer := inst.Invoke.Args.Search(\"tx\")\n\t\tif txBuffer == nil {\n\t\t\tlog.LLvl1(\"no transaction provided in byzcoin transaction\")\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tvar ethTx types.Transaction\n\t\terr = ethTx.UnmarshalJSON(txBuffer)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\ttransactionReceipt, err := sendTx(&ethTx, db)\n\t\tif err != nil {\n\t\t\tlog.ErrFatal(err)\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tif transactionReceipt.ContractAddress.Hex() != nilAddress.Hex() {\n\t\t\tlog.LLvl1(\"contract deployed at:\", transactionReceipt.ContractAddress.Hex(), \"tx status:\", transactionReceipt.Status, \"(0/1 fail/success)\", \"gas used:\", transactionReceipt.GasUsed, \"tx receipt:\", transactionReceipt.TxHash.Hex())\n\t\t} else {\n\t\t\tlog.LLvl1(\"tx status:\", transactionReceipt.Status, \"(0/1 fail/success)\", \"gas used:\", transactionReceipt.GasUsed, \"tx receipt:\", transactionReceipt.TxHash.Hex())\n\t\t}\n\n\n\t\t//Commits the general stateDb\n\t\tes.RootHash, err = db.Commit(true)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\t//Commits the low level trieDB\n\t\terr = db.Database().TrieDB().Commit(es.RootHash, true)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\t//Saves the general Ethereum State\n\t\tes.DbBuf, err = memdb.Dump()\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\t//Save the Ethereum structure\n\t\tesBuf, err := protobuf.Encode(&es)\n\t\tif err != nil {\n\t\t\treturn nil, nil , err\n\t\t}\n\t\tsc = []byzcoin.StateChange{\n\t\t\tbyzcoin.NewStateChange(byzcoin.Update, inst.InstanceID,\n\t\t\t\tContractBvmID, esBuf, darcID),\n\t\t}\n\tdefault :\n\t\terr = errors.New(\"Contract can only display, credit and receive transactions\")\n\t\treturn\n\n\t}\n\treturn\n}", "title": "" }, { "docid": "f524fdaaf8151098394439d10168bb34", "score": "0.50524706", "text": "func (chain *MockChain) GetSmartContract(addr multivacaddress.Address) *wire.SmartContract {\n\treturn nil\n}", "title": "" }, { "docid": "83a1e896af6015bcd079617e1159a61b", "score": "0.5041709", "text": "func (c *Client) GetBalance(account string, minConf int, includeWatchOnly bool) (float32, error) {\n\tvar balance float32\n\terr := c.runCommand(&balance, \"getbalance\", account, minConf, includeWatchOnly)\n\treturn balance, err\n}", "title": "" }, { "docid": "f638f2ecf99f14648356bd1a7c5b8a1f", "score": "0.5039608", "text": "func (eth *Eth) GetCoinbase() (string, error) {\n\n\tpointer := &dto.RequestResult{}\n\n\terr := eth.provider.SendRequest(pointer, \"eth_coinbase\", nil)\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn pointer.ToString()\n\n}", "title": "" }, { "docid": "0116f1703d6229c1a45b0b327650163b", "score": "0.50391966", "text": "func (_ReserveContract *ReserveContractSession) GetBalance(token common.Address) (*big.Int, error) {\n\treturn _ReserveContract.Contract.GetBalance(&_ReserveContract.CallOpts, token)\n}", "title": "" }, { "docid": "50e5beaf8a998ed9f7e2d0f78e97e6ff", "score": "0.5037307", "text": "func (_Safe *SafeCaller) GetTransactionHash(opts *bind.CallOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, dataGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) {\n\tvar (\n\t\tret0 = new([32]byte)\n\t)\n\tout := ret0\n\terr := _Safe.contract.Call(opts, out, \"getTransactionHash\", to, value, data, operation, safeTxGas, dataGas, gasPrice, gasToken, refundReceiver, _nonce)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "e66da44e6264172754a508408bc92246", "score": "0.50371236", "text": "func (b *MockBackend) GetBalance(p wallet.Address, a channel.Asset) *big.Int {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\treturn b.getBalance(p, a)\n}", "title": "" }, { "docid": "eeb8b08f458e4b4d53b3057d5e3fade8", "score": "0.50325567", "text": "func (c Client) GetCoin(ctx context.Context, id string) (*CoinRes, error) {\n\turl := fmt.Sprintf(\"%s/ticker/?id=%s\", c.BaseURL, id)\n\n\tres, err := c.getRequest(url, ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar coin []CoinRes\n\tif exErr := c.extractAndParseBody(*res, &coin); exErr != nil {\n\t\treturn nil, exErr\n\t}\n\n\treturn &coin[0], nil\n}", "title": "" }, { "docid": "c80b5cb444521a2b8e70d947fcbe56d3", "score": "0.5028882", "text": "func (c *BinaryGrpcServerImp) GetEthBalance(\n\tctx context.Context,\n\tin *api.EthBalanceParams,\n) (*api.EthBalanceResult, error) {\n\tvar r *api.EthBalanceResult\n\tmakeEthBalanceResult(&r, \"\", true, 0)\n\n\tif c.chainWrapper == nil {\n\t\te := \"invalid scry chain interface\"\n\t\tmakeEthBalanceResult(&r, e, false, 0)\n\t\treturn r, errors.New(e)\n\t}\n\n\tclient := scry.NewScryClient(in.Owner, c.chainWrapper)\n\tif client == nil {\n\t\te := \"failed to create scry client\"\n\t\tmakeEthBalanceResult(&r, e, false, 0)\n\t\treturn r, errors.New(e)\n\t}\n\n\tb, err := client.GetEth(\n\t\tcommon.HexToAddress(in.Owner),\n\t\tc.chainWrapper.Conn(),\n\t)\n\tif err != nil {\n\t\tmakeEthBalanceResult(&r, err.Error(), false, 0)\n\t\treturn r, err\n\t}\n\n\tmakeEthBalanceResult(&r, \"\", true, b.Int64())\n\treturn r, err\n}", "title": "" }, { "docid": "dfa74ca60ef0e00eb45ec6c54f0d837d", "score": "0.5024199", "text": "func (a *Client) GetMeCreditBalance(params *GetMeCreditBalanceParams, authInfo runtime.ClientAuthInfoWriter) (*GetMeCreditBalanceOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetMeCreditBalanceParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"GetMeCreditBalance\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/me/credit/balance\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &GetMeCreditBalanceReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*GetMeCreditBalanceOK), nil\n\n}", "title": "" }, { "docid": "fde6132587a3da85b81a3d889f6b3730", "score": "0.5021751", "text": "func (c *KAIHttpClient) CallGetBalance(params map[string]string, debug bool) (*InternalGetBalanceRS, error) {\n\n\t// call to KAI\n\t// params := make(map[string]string)\n\terr := c.Call(\"information\", \"get_balance\", params, debug)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// convert to struct\n\tvar vRS GetBalanceRS\n\n\terr = json.Unmarshal(c.KAIResponseBody, &vRS)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// make internal response\n\tvar resp *InternalGetBalanceRS\n\n\tresp, err = MakeInternalGetBalanceRS(vRS)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// send to caller\n\treturn resp, nil\n}", "title": "" }, { "docid": "37e2307c8cffcf8204e70d52a37eaac8", "score": "0.5021737", "text": "func (v Vault) GetCoin(asset common.Asset) common.Coin {\n\tfor _, coin := range v.Coins {\n\t\tif coin.Asset.Equals(asset) {\n\t\t\treturn coin\n\t\t}\n\t}\n\treturn common.NewCoin(asset, cosmos.ZeroUint())\n}", "title": "" }, { "docid": "5aa4bb2e2c8bae79541ccb9bd0de0644", "score": "0.50179505", "text": "func (_KyberFeeHandler *KyberFeeHandlerCaller) GetSanityRateContracts(opts *bind.CallOpts) ([]common.Address, error) {\n\tvar (\n\t\tret0 = new([]common.Address)\n\t)\n\tout := ret0\n\terr := _KyberFeeHandler.contract.Call(opts, out, \"getSanityRateContracts\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "ac90adc27a2248fa32e16a3d52130e16", "score": "0.50089806", "text": "func (eth *Eth) GetBalance(address string, defaultBlockParameter string) (*big.Int, error) {\n\n\tparams := make([]string, 2)\n\tparams[0] = address\n\tparams[1] = defaultBlockParameter\n\n\tpointer := &dto.RequestResult{}\n\n\terr := eth.provider.SendRequest(pointer, \"eth_getBalance\", params)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn pointer.ToBigInt()\n}", "title": "" }, { "docid": "911a69d4cb862ba8aa36c499c31b209f", "score": "0.500764", "text": "func (t *TradeWorkflowChaincode) getAccountBalance(stub shim.ChaincodeStubInterface, creatorOrg string, creatorCertIssuer string, args []string) pb.Response {\n\tvar entity, balanceKey, jsonResp string\n\tvar balanceBytes []byte\n\tvar err error\n\n\tif len(args) != 2 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 2: {Trade ID, Entity}\")\n\t}\n\n\tentity = strings.ToLower(args[1])\n\tif entity == \"seller\" {\n\t\t// Access control: Only an Exporter or Exporting Entity Org member can invoke this transaction\n\t\tif !t.testMode && !authenticateSellerOrg(creatorOrg, creatorCertIssuer) {\n\t\t\treturn shim.Error(\"Caller not a member of Seller Org. Access denied.\")\n\t\t}\n\t\tbalanceKey = selBalKey\n\t} else if entity == \"buyer\" {\n\t\t// Access control: Only an Importer Org member can invoke this transaction\n\t\tif !t.testMode && !authenticateBuyerOrg(creatorOrg, creatorCertIssuer) {\n\t\t\treturn shim.Error(\"Caller not a member of Buyer Org. Access denied.\")\n\t\t}\n\t\tbalanceKey = buyBalKey\n\t} else if entity == \"middleman\" {\n\t\t// Access control: Only an Importer Org member can invoke this transaction\n\t\tif !t.testMode && !authenticateMiddlemanOrg(creatorOrg, creatorCertIssuer) {\n\t\t\treturn shim.Error(\"Caller not a member of Middleman Org. Access denied.\")\n\t\t}\n\t\tbalanceKey = midBalKey\n\t} else if entity == \"warehouse\" {\n\t\t// Access control: Only an Importer Org member can invoke this transaction\n\t\tif !t.testMode && !authenticateWarehouseOrg(creatorOrg, creatorCertIssuer) {\n\t\t\treturn shim.Error(\"Caller not a member of Warehouse Org. Access denied.\")\n\t\t}\n\t\tbalanceKey = warBalKey\n\t} else if entity == \"carrier\" {\n\t\t// Access control: Only an Importer Org member can invoke this transaction\n\t\tif !t.testMode && !authenticateCarrierOrg(creatorOrg, creatorCertIssuer) {\n\t\t\treturn shim.Error(\"Caller not a member of Carrier Org. Access denied.\")\n\t\t}\n\t\tbalanceKey = carBalKey\n\t} else {\n\t\terr = errors.New(fmt.Sprintf(\"Invalid entity %s; Permissible values: {exporter, importer}\", args[1]))\n\t\treturn shim.Error(err.Error())\n\t}\n\n\t// Get the account balances from the ledger\n\tbalanceBytes, err = stub.GetState(balanceKey)\n\tif err != nil {\n\t\tjsonResp = \"{\\\"Error\\\":\\\"Failed to get state for \" + balanceKey + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\n\tif len(balanceBytes) == 0 {\n\t\tjsonResp = \"{\\\"Error\\\":\\\"No record found for \" + balanceKey + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\tjsonResp = \"{\\\"Balance\\\":\\\"\" + string(balanceBytes) + \"\\\"}\"\n\tfmt.Printf(\"Query Response:%s\\n\", jsonResp)\n\treturn shim.Success([]byte(jsonResp))\n}", "title": "" }, { "docid": "b8bd28378ac0ff98cb5c070c96079da3", "score": "0.5000521", "text": "func GetBalance(leader p2p.Peer, account string, done chan AccountBalanceMsg) {\n\turl := fmt.Sprintf(\"http://%s:%s/balance?key=%s\", leader.IP, leader.Port, account)\n\tvar player = new(Player)\n\tvar msg AccountBalanceMsg\n\n\terr := getClient(url, \"/balance\", player)\n\tif err != nil {\n\t\tmsg.Err = err\n\t} else if len(player.Balances) == 0 {\n\t\tmsg.Err = errors.New(\"no balance was returned\")\n\t} else {\n\t\tmsg.Balance = player.Balances[0]\n\t}\n\tdone <- msg\n}", "title": "" }, { "docid": "057e8f77e6b5b847caa8592840bb275c", "score": "0.49995634", "text": "func (spot *PoloniexSpot) GetCoinList() interface{} {\n\tparams := &url.Values{}\n\tparams.Set(\"command\", \"returnCurrencies\")\n\treturn spot.httpGet(\"/public\", params)\n}", "title": "" }, { "docid": "e11c30e945609c610c594e007ed33d6d", "score": "0.49990988", "text": "func (query *TransactionReceiptQuery) GetCost(client *Client) (Hbar, error) {\n\tif client == nil {\n\t\treturn Hbar{}, errNoClientProvided\n\t}\n\n\tvar err error\n\n\terr = query._ValidateNetworkOnIDs(client)\n\tif err != nil {\n\t\treturn Hbar{}, err\n\t}\n\n\tquery.timestamp = time.Now()\n\n\tfor range query.nodeAccountIDs.slice {\n\t\tpaymentTransaction, err := _QueryMakePaymentTransaction(TransactionID{}, AccountID{}, client.operator, Hbar{})\n\t\tif err != nil {\n\t\t\treturn Hbar{}, err\n\t\t}\n\t\tquery.paymentTransactions = append(query.paymentTransactions, paymentTransaction)\n\t}\n\n\tpb := query._Build()\n\tpb.TransactionGetReceipt.Header = query.pbHeader\n\n\tquery.pb = &services.Query{\n\t\tQuery: pb,\n\t}\n\n\tresp, err := _Execute(\n\t\tclient,\n\t\t&query.Query,\n\t\t_TransactionReceiptQueryShouldRetry,\n\t\t_CostQueryMakeRequest,\n\t\t_CostQueryAdvanceRequest,\n\t\t_QueryGetNodeAccountID,\n\t\t_TransactionReceiptQueryGetMethod,\n\t\t_TransactionReceiptQueryMapStatusError,\n\t\t_QueryMapResponse,\n\t\tquery._GetLogID(),\n\t\tquery.grpcDeadline,\n\t\tquery.maxBackoff,\n\t\tquery.minBackoff,\n\t\tquery.maxRetry,\n\t)\n\n\tif err != nil {\n\t\treturn Hbar{}, err\n\t}\n\n\tcost := int64(resp.(*services.Response).GetTransactionGetReceipt().Header.Cost)\n\treturn HbarFromTinybar(cost), nil\n}", "title": "" }, { "docid": "892bf91f0ebf7c96d87cf1a6de155a52", "score": "0.49877852", "text": "func (api *PublicEthereumAPI) GetBalance(address common.Address, blockNum rpctypes.BlockNumber) (*hexutil.Big, error) {\n\tapi.logger.Debug(\"eth_getBalance\", \"address\", address, \"block number\", blockNum)\n\n\treq := &evmtypes.QueryBalanceRequest{\n\t\tAddress: address.String(),\n\t}\n\n\tctx := api.ctx\n\tif !(blockNum == rpctypes.PendingBlockNumber || blockNum == rpctypes.LatestBlockNumber) {\n\t\t// wrap the context with the requested height\n\t\tctx = rpctypes.ContextWithHeight(blockNum.Int64())\n\t}\n\n\tres, err := api.queryClient.Balance(ctx, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar balance *big.Int\n\terr = balance.UnmarshalText([]byte(res.Balance))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif blockNum != rpctypes.PendingBlockNumber {\n\t\treturn (*hexutil.Big)(balance), nil\n\t}\n\n\t// update the address balance with the pending transactions value (if applicable)\n\tpendingTxs, err := api.backend.PendingTransactions()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, tx := range pendingTxs {\n\t\tif tx == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif tx.From == address {\n\t\t\tbalance = new(big.Int).Sub(balance, tx.Value.ToInt())\n\t\t}\n\t\tif *tx.To == address {\n\t\t\tbalance = new(big.Int).Add(balance, tx.Value.ToInt())\n\t\t}\n\t}\n\n\treturn (*hexutil.Big)(balance), nil\n}", "title": "" } ]
e9021d0a7a1eb26c0a5ac314344ab464
New to create new db connection.
[ { "docid": "e5f16289d4fcfb2acba278f932a58b7c", "score": "0.6148867", "text": "func New(address, name, user, password string, maxOpen, maxIdle, maxLife int) (*gorm.DB, error) {\n\t// Split host and port.\n\tsplit := strings.Split(address, \":\")\n\tif len(split) != 2 {\n\t\treturn nil, errors.ErrInvalidDBFormat\n\t}\n\n\t// Prepare dsn and open connection.\n\tdsn := fmt.Sprintf(\"host=%v port=%v dbname=%v user=%v password=%v sslmode=disable\", split[0], split[1], name, user, password)\n\tdb, err := gorm.Open(postgres.Open(dsn), &gorm.Config{\n\t\tAllowGlobalUpdate: true,\n\t\tLogger: logger.Default.LogMode(logger.Silent),\n\t\tNamingStrategy: schema.NamingStrategy{\n\t\t\tSingularTable: true,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttmp, err := db.DB()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Set basic config.\n\ttmp.SetMaxIdleConns(maxIdle)\n\ttmp.SetMaxOpenConns(maxOpen)\n\ttmp.SetConnMaxLifetime(time.Duration(maxLife) * time.Second)\n\n\treturn db, nil\n}", "title": "" } ]
[ { "docid": "0766db38bf9ce9b0fa648c5a9a50166d", "score": "0.74583215", "text": "func newDBConn(in *registry.Instance) (*gorm.DB, error) {\n\tsec := setting.Config.Section(\"database.\" + in.Name)\n\treturn gorm.Open(\"mysql\", fmt.Sprintf(\"%s:%s@tcp(%s)/rportal\", sec.Key(\"USER\"), sec.Key(\"PASSWORD\"), in.Address))\n}", "title": "" }, { "docid": "7a32281ea1d8c0c714c49f4ee5304d5d", "score": "0.73601687", "text": "func newDBConn(ops Options) (*ScyllaDB, error) {\n\tr, err := newScyllaDB(ScyllaDBOpts{\n\t\tKeySpaceName: ops.Keyspace,\n\t\tNodeIps: ops.Hosts,\n\t\tUsername: ops.Username,\n\t\tPassword: ops.Password,\n\t\tDebug: true,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r, nil\n}", "title": "" }, { "docid": "032a7129e84bd6ec0488fb1480efefbf", "score": "0.70954615", "text": "func createConnection() *sql.DB {\n\t//load .env file\n\terr := godotenv.Load(\".env\")\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error loading .env file\")\n\t}\n\n\t//open connection\n\tdb, err := sql.Open(\"postgres\", os.Getenv(\"POSTGRES_URL\"))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t//check connection\n\terr = db.Ping()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"DB Connection Success\")\n\t//return connection\n\treturn db\n}", "title": "" }, { "docid": "00ccdc0a70e2a6ef9597306d80c17f41", "score": "0.69928765", "text": "func createConnection() *sql.DB {\n\t// load .env file\n\terr := godotenv.Load(\".env\")\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error loading .env file\")\n\t}\n\n\t// Open the connection\n\tdb, err := sql.Open(\"postgres\", os.Getenv(\"POSTGRES_URL\"))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// check the connection\n\terr = db.Ping()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"Successfully connected!\")\n\t// return the connection\n\treturn db\n}", "title": "" }, { "docid": "5a2b30787e4c1cb44a7940000f4138b2", "score": "0.69470423", "text": "func newDB() (*DB, error) {\n\tif err := grnInit(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DB{}, nil\n}", "title": "" }, { "docid": "a2f312e8dd4b48a1e70b56e21a194ac3", "score": "0.6905023", "text": "func createConnection() *sql.DB {\n\t// local .env file\n\terr := godotenv.Load(\".env\")\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error loading .env file\")\n\t}\n\n\t// open the connection\n\tdb, err := sql.Open(\"postgres\", os.Getenv(\"POSTGRES_URL\"))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// check the connection\n\tif err = db.Ping(); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"Successfully connected!\")\n\t// return the connection\n\treturn db\n}", "title": "" }, { "docid": "d6db1de54d7f39a5747f278462192351", "score": "0.6892162", "text": "func createConnection() (io.Closer, error) {\n\tid := atomic.AddInt32(&idCounter, 1)\n\tlog.Println(\"Create: New Connection\", id)\n\treturn &dbConnection{id}, nil\n}", "title": "" }, { "docid": "80a067739d1b1ac8c20f838d85f96d85", "score": "0.6876724", "text": "func newPostgresDBConnection(debugMode bool) *gorm.DB {\n\tcfg := loadDBConfig()\n\tdsn := fmt.Sprintf(\"host=%s port=%s user=%s password=%s dbname=%s sslmode=%s\",\n\t\tcfg.Host, cfg.Port, cfg.Username, cfg.Password, cfg.DatabaseName, cfg.SSLMode)\n\n\tdb, err := gorm.Open(postgres.Open(dsn), buildGormConfig(debugMode))\n\tif err != nil {\n\t\tLogger.Fatal(\"Could not connect to DB %s\", err)\n\t}\n\n\treturn db\n}", "title": "" }, { "docid": "a308f090fb8f507a41fa73ea742dcb30", "score": "0.6852287", "text": "func initi() *DbConnection {\nvar conn DbConnection\nreturn &conn\n}", "title": "" }, { "docid": "7759d79b6bece276a27d1bb94718a775", "score": "0.6849997", "text": "func newDatabase() (*sqlx.DB, error) {\n\tusername := os.Getenv(\"PLAYOUT_DB_USER\")\n\tpassword := os.Getenv(\"PLAYOUT_DB_PASS\")\n\tdbName := os.Getenv(\"PLAYOUT_DB_NAME\")\n\tdbHost := os.Getenv(\"PLAYOUT_DB_HOST\")\n\tdbPort := os.Getenv(\"PLAYOUT_DB_PORT\")\n\n\tdbURI := fmt.Sprintf(\"dbname=%s host=%s user=%s password=%s port=%s sslmode=disable\", dbName, dbHost, username, password, dbPort) // Build connection string\n\n\tdb, err := sqlx.Open(\"postgres\", dbURI)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to connect to DB: %w\", err)\n\t}\n\terr = db.Ping()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to ping db: %w\", err)\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "341775e0e797ad36744f1e1a952c9cd4", "score": "0.6807644", "text": "func New(conn string) *db {\n\treturn &db{conn: conn}\n}", "title": "" }, { "docid": "b855a6def301527807ece4afdfa143f3", "score": "0.68012434", "text": "func New(db *sqlx.DB) *Conn {\n\treturn &Conn{db}\n}", "title": "" }, { "docid": "ab1f87291abe4648a64c9d67d556d385", "score": "0.6800965", "text": "func newDatabase(config *config.Database) (*gorm.DB, error) {\n\tdb, err := gorm.Open(config.Dialect, getInfo(config))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := initDatabase(db, config); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "a4433019b85498a67ece9a29f6a3b64c", "score": "0.6698407", "text": "func newSqliteRepoConnection() *repos.RepoConnection {\n\n\tsqliteDb, err := sql.Open(\"sqlite3\", sqliteFile)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Printf(\"NewSqliteRepoConnection > Connected to database ('%v').\\n\", sqliteFile)\n\trepoConn := repos.RepoConnection{Db: sqliteDb}\n\treturn &repoConn\n\n}", "title": "" }, { "docid": "9da44a94e92d3f8ff8d3a9856f19cb2e", "score": "0.6663467", "text": "func newDBConfig(user string, pass string, host string, port string, db string) *DBConfig {\n\treturn &DBConfig{user: user, pass: pass, host: host, port: port, db: db}\n}", "title": "" }, { "docid": "fda1bf4920eab338643a1aedb8e9e409", "score": "0.66326267", "text": "func NewDatabase(db *mongo.Database) *Database { return &Database{Database: db} }", "title": "" }, { "docid": "4727911e380c2ecd301fe891c1ecc9c9", "score": "0.65962166", "text": "func New(ctx context.Context, connString string) (Database, error) {\n\tcfg, err := pgxpool.ParseConfig(connString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconn, err := pgxpool.ConnectConfig(ctx, cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &database{\n\t\tctx: ctx,\n\t\tconn: conn,\n\t}, nil\n}", "title": "" }, { "docid": "bccfa551a22e30a188950a9914bde899", "score": "0.6547456", "text": "func New(c Config) (*sql.DB, error) {\n\tif !c.isValid() {\n\t\tfmt.Println(c)\n\t\treturn nil, errConfigInvalid\n\t}\n\n\tsslMode := \"disable\"\n\n\tq := make(url.Values)\n\tq.Set(\"sslmode\", sslMode)\n\tq.Set(\"timezone\", \"utc\")\n\n\tu := url.URL{\n\t\tScheme: \"postgres\",\n\t\tUser: url.UserPassword(c.User, c.Password),\n\t\tHost: c.Host,\n\t\tPath: c.Name,\n\t\tRawQuery: q.Encode(),\n\t}\n\n\tdb, err := sql.Open(driverName, u.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "530a69a6bed346e12493e8c06f94ca3c", "score": "0.6527989", "text": "func New(cfg *Config) (*Conn, error) {\n\td, err := gorm.Open(\n\t\tpostgres.Open(\n\t\t\tfmt.Sprintf(\n\t\t\t\t\"host=%s port=%d dbname=%s user=%s password=%s sslmode=disable\",\n\t\t\t\tcfg.Host,\n\t\t\t\tcfg.Port,\n\t\t\t\tcfg.Name,\n\t\t\t\tcfg.User,\n\t\t\t\tcfg.Password,\n\t\t\t),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Conn{\n\t\tDB: d,\n\t\tlogger: log.With().Str(\"package\", \"db\").Logger(),\n\t}, nil\n}", "title": "" }, { "docid": "0585fe8fdb09dc2e055a88163e924ae6", "score": "0.64719826", "text": "func New(connection string, timeout time.Duration) (Connection, error) {\n\tst := time.Now()\n\n\tfor {\n\t\tif time.Now().Sub(st) > timeout {\n\t\t\treturn nil, fmt.Errorf(\"Timeout connecting to the database\")\n\t\t}\n\t\tdb, err := sqlx.Connect(\"postgres\", connection)\n\t\tif err == nil {\n\t\t\treturn &PostgreSQL{db}, nil\n\t\t}\n\n\t\tlog.Println(\"Unable to connect to database\", err)\n\t\ttime.Sleep(5 * time.Second)\n\t}\n}", "title": "" }, { "docid": "88fbbcb29e6cc980b3950a306d717088", "score": "0.645439", "text": "func NewFromDB(db *sqlx.DB) Connection {\n\treturn Connection{DB: db, Active: true}\n}", "title": "" }, { "docid": "ad46e4d94b52d82ba3c1afb8e6d7e641", "score": "0.64386326", "text": "func createConnection(driver, dsn string) *Connection {\n\tvar testDSN string\n\tswitch driver {\n\tcase \"mysql\":\n\t\ttestDSN = os.Getenv(\"FJORD_TEST_MYSQL_DSN\")\n\tcase \"postgres\":\n\t\ttestDSN = os.Getenv(\"FJORD_TEST_POSTGRES_DSN\")\n\t}\n\tif testDSN != \"\" {\n\t\tdsn = testDSN\n\t}\n\tconn, err := Open(driver, dsn, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif err := conn.Ping(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tresetDB(conn)\n\treturn conn\n}", "title": "" }, { "docid": "89df42a8093564ef7752a35f2ab29e5d", "score": "0.64382446", "text": "func New() {\n\tvar err error\n\tconnectionString := GetDbString()\n\tDB, err = gorm.Open(\n\t\tconfig.DBDriver,\n\t\tconnectionString)\n\n\tif err != nil {\n\t\tpanic(\"failed to connect database\")\n\t}\n}", "title": "" }, { "docid": "1cb80b0623d12b83ef141f2c1cf6da03", "score": "0.6429085", "text": "func New() (*sql.DB, error) {\n\tconnStr := fmt.Sprintf(\n\t\t\"postgres://%s:%s@%s/%s?sslmode=%s\",\n\t\tcfg.user,\n\t\tcfg.password,\n\t\tcfg.address,\n\t\tcfg.name,\n\t\tcfg.sslMode,\n\t)\n\n\tdb, err := sql.Open(\"postgres\", connStr)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not connect to database\")\n\t}\n\n\tif err := ping(db); err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not ping database\")\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "6e36e52ff47bbea964dabec08c8f017f", "score": "0.6419417", "text": "func getDb() (*Conn, error) {\n db, err := New(\"localhost:45678\", \"\", \"\")\n if err != nil {\n log.Fatal(\"connect error, mysql not started?\")\n }\n return db, err\n}", "title": "" }, { "docid": "a1275ff52f9e690dafb1c7bb97aaa193", "score": "0.64126897", "text": "func newDB(t *testing.T) *sql.DB {\n\tdb, err := sql.Open(\"sqlite3\", \":memory:\")\n\tassert.NoError(t, err)\n\treturn db\n}", "title": "" }, { "docid": "e853c37459019289ffe6545b812205d4", "score": "0.6385341", "text": "func NewConnection(config *Config) (*DB, error) {\n\tclient, err := mongo.Connect(context.Background(), config.ConnectionURI)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Check the connection\n\terr = client.Ping(context.Background(), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tuserIndexOptions := options.Index()\n\tuserIndexOptions.SetUnique(true)\n\n\tusers := client.Database(config.DatabaseName).Collection(\"users\")\n\tusers.Indexes().CreateOne(context.Background(), mongo.IndexModel{\n\t\tKeys: bson.M{\n\t\t\t\"email\": 1,\n\t\t},\n\t\tOptions: userIndexOptions,\n\t})\n\n\tcollections := &Collections{\n\t\tusers: users,\n\t}\n\n\treturn &DB{\n\t\tconfig: config,\n\t\tclient: client,\n\t\tcollections: collections,\n\t}, nil\n}", "title": "" }, { "docid": "d42d757878847a7e3fe63db73d647b7c", "score": "0.637687", "text": "func New(config *Config) (*Database, error) {\n\tdbInfo := fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\tconfig.Host,\n\t\tconfig.Port,\n\t\tconfig.User,\n\t\tconfig.Password,\n\t\tconfig.Name)\n\n\tdatabase, err := sql.Open(config.Driver, dbInfo)\n\n\treturn &Database{database}, err\n}", "title": "" }, { "docid": "0d8e1f3b0a09319d917a752933bc7064", "score": "0.63723254", "text": "func New() *gorm.DB {\n\tdbConnString := fmt.Sprintf(\"postgres://%s:%s@%s:%s/%s?sslmode=%s\", user, pwd, url, port, dbName, sslmode)\n\tdb, err := gorm.Open(\"postgres\", dbConnString)\n\tutils.Must(err)\n\tdb.DB().SetMaxIdleConns(3)\n\tdb.LogMode(true)\n\terr = db.DB().Ping()\n\tutils.Must(err)\n\treturn db\n}", "title": "" }, { "docid": "0bf410cdc3faedf711295c41e53777ae", "score": "0.6365917", "text": "func New(driver, dataSource string) *sqlx.DB {\n\tdb, err := sqlx.Connect(driver, dataSource)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\treturn db\n}", "title": "" }, { "docid": "0c53bb53c8497694c1b7826221708973", "score": "0.6365514", "text": "func New() (Database, error) {\n\tconn, err := Connect()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\td := &database{\n\t\tconn: conn,\n\t}\n\treturn d, nil\n}", "title": "" }, { "docid": "2b27dc387a6e0a8dee58537c0c79ad29", "score": "0.6363179", "text": "func createDBPool(config utils.Config) *sql.DB {\n\tvar str string\n\n\tif config.Database.SSL {\n\n\t\tcaCert, _ := filepath.Abs(config.Database.CaCertPath)\n\t\tuserCert, _ := filepath.Abs(config.Database.UserCertPath)\n\t\tuserKey, _ := filepath.Abs(config.Database.UserKeyPath)\n\n\t\tstr = fmt.Sprintf(\"postgresql://%s:%s@%s:%s/%s?sslmode=verify-full&sslrootcert=%s&sslcert=%s&sslkey=%s\",\n\t\t\tconfig.Database.User,\n\t\t\tconfig.Database.Password,\n\t\t\tconfig.Database.Host,\n\t\t\tconfig.Database.Port,\n\t\t\tconfig.Database.Name,\n\t\t\tcaCert,\n\t\t\tuserCert,\n\t\t\tuserKey,\n\t\t)\n\n\t} else {\n\t\tstr = fmt.Sprintf(\"postgresql://%s:%s@%s:%s/%s?sslmode=disable\",\n\t\t\tconfig.Database.User,\n\t\t\tconfig.Database.Password,\n\t\t\tconfig.Database.Host,\n\t\t\tconfig.Database.Port,\n\t\t\tconfig.Database.Name,\n\t\t)\n\t}\n\n\tdb, err := sql.Open(\"postgres\", str)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\t//Check if the connection is successful by establishing a connection.\n\t//Retry upto 10 times if connection is not successful\n\tfor retryCount := 0; retryCount < 10; retryCount++ {\n\t\terr = db.Ping()\n\t\tif err == nil {\n\t\t\tlogrus.Info(\"database connection successful\")\n\t\t\treturn db\n\t\t}\n\n\t\tlogrus.Error(err)\n\t\tlogrus.Info(\"could not connect to database: retrying...\")\n\t\ttime.Sleep(time.Second)\n\t}\n\n\tpanic(\"could not connect to database\")\n\n}", "title": "" }, { "docid": "a616729f0b7e1dfe91b37395c456d4f4", "score": "0.63562596", "text": "func db_conn()(db *sql.DB){\n\tdb, err := sql.Open(\"mysql\", \"root:Password@(127.0.0.1:3306)/mydatabase\")\n\terr = db.Ping()\n \t if err != nil {\n\t log.Fatal(err) \n\t}\n\treturn db\n}", "title": "" }, { "docid": "0b523ddbb5d5ad15e61a114842d261d0", "score": "0.63492274", "text": "func open(e *Environment, once bool, env string, dbx *sqlx.DB, logger []*log.Logger) (*db, error) {\n\tvar cfg Environment\n\n\tif e == nil {\n\t\tcfg.Boot()\n\t\tif env != \"\" {\n\t\t\tcfg.Load(env)\n\t\t}\n\t} else {\n\t\tcfg = *e\n\t}\n\n\tif err := cfg.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tconn := &db{\n\t\tenv: cfg,\n\t\tm: &sync.Mutex{},\n\t}\n\n\tif once {\n\t\tm.Lock()\n\n\t\tm.Unlock()\n\t}\n\tconn.id, conn.dbx = createNewConnection(once, cfg.Alias)\n\n\tif conn.hasVerbose() {\n\t\tif n := len(logger); n > 0 {\n\t\t\tconn.logOut = logger[0]\n\n\t\t\tif n > 1 {\n\t\t\t\tconn.logErr = logger[1]\n\t\t\t}\n\t\t} else {\n\t\t\tprefix := fmt.Sprintf(\n\t\t\t\t\"(\\033[95;1m%s\\033[0m:%s@%s:%s - \\033[4m%s\\033[0m)\",\n\t\t\t\tconn.env.Driver,\n\t\t\t\tconn.env.User,\n\t\t\t\tconn.env.Host,\n\t\t\t\tconn.env.Port,\n\t\t\t\tconn.env.Alias,\n\t\t\t)\n\n\t\t\tconn.logOut = log.New(os.Stdout, fmt.Sprintf(\"%s ➜ \", prefix), 0)\n\t\t\tconn.logErr = log.New(os.Stderr, fmt.Sprintf(\"%s \\033[91m➜ \\033[1mERROR: \\033[0m \", prefix), 0)\n\t\t}\n\n\t\tif conn.env.DSN == \"\" {\n\t\t\tconn.logOut.Print(\"configured and ready\")\n\t\t\tconn.logOut.Printf(\"setting: %d MaxIdle | %d MaxOpen | %s MaxLifetime\", conn.env.MaxIdle, conn.env.MaxOpen, conn.env.MaxLifetime.String())\n\t\t}\n\t}\n\n\tif conn.env.Autoconnect {\n\t\tconn.Connect()\n\t}\n\n\treturn conn, nil\n}", "title": "" }, { "docid": "ff8cb1a0056e7365b4848c7389e562f8", "score": "0.63491964", "text": "func NewConnection(dbType, dbDSN string) (*DbConnection, error) {\n\tvar db *gorm.DB\n\tvar err error\n\tswitch dbType {\n\tcase \"postgres\":\n\t\tdb, err = gorm.Open(postgres.Open(dbDSN), &gorm.Config{})\n\tcase \"mysql\":\n\t\tdb, err = gorm.Open(mysql.Open(dbDSN), &gorm.Config{})\n\tdefault:\n\t\tdb, err = gorm.Open(sqlite.Open(dbDSN), &gorm.Config{})\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb.Logger.LogMode(logger.Info)\n\treturn &DbConnection{Db: db}, nil\n}", "title": "" }, { "docid": "8a384247b9b8afc3dd489e21f6a995c4", "score": "0.63486665", "text": "func NewDbConnection() (*sql.DB, error) {\n\tconn := &db.Connection{\n\t\tDbName: \"lab3\",\n\t\tUser: \"postgresql\",\n\t\tPassword: \"postgresql\",\n\t\tHost: \"localhost\",\n\t\tDisableSSL: true,\n\t}\n\treturn conn.Open()\n}", "title": "" }, { "docid": "d11c39cfdbf92f7556328f154eec479e", "score": "0.63483924", "text": "func New(dbname, user, password, host string, port int, ssl bool) (*DB, error) {\n\tlog.Info().Msg(fmt.Sprintf(\"Connecting to database %v\", dbname))\n\n\tconnectionString :=\n\t\tfmt.Sprintf(\"dbname=%s user=%s password=%s host=%s port=%d\", dbname, user, password, host, port)\n\tif !ssl {\n\t\tconnectionString = fmt.Sprintf(\"%s sslmode=disable\", connectionString)\n\t}\n\n\tdb, err := gorm.Open(\"postgres\", connectionString)\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"could not connect to database\")\n\t\treturn nil, err\n\t}\n\n\treturn &DB{db}, nil\n}", "title": "" }, { "docid": "d7d85a34964cd9f8c2928ca9145612f7", "score": "0.6334349", "text": "func (d *Database) NewDb(config cl.DatabaseConfig, applicationName string) {\n\n\t// Generate credentials\n\tcredentials := fmt.Sprintf(\"user=%s password=%s dbname=%s host=%s application_name=%s\", config.Username, config.Password, config.Database, config.Host, applicationName)\n\n\t//Open DATABASE\n\tvar err error\n\tlog.Println(\"Connecting to database...\")\n\td.Instance, err = sql.Open(\"postgres\", credentials)\n\tcl.ChkFatal(err)\n\td.Instance.SetMaxOpenConns(70)\n\tlog.Println(\"Connected to database!\")\n}", "title": "" }, { "docid": "7e11897f0ae84f5f18046ae1ed1e4d6c", "score": "0.6330903", "text": "func TSDBNew (hostName string, port int, userName string, password string) *TSDB {\n\treturn &TSDB{hostName, port, userName, password, \"ns\", nil, false}\n}", "title": "" }, { "docid": "22c46a7fe19bd41238dcbb11e71a56c6", "score": "0.6324594", "text": "func New(dbUrl string) Database {\n\tvar db Database\n\tvar err error\n\tdb.db, err = sql.Open(\"mysql\", dbUrl)\n\tif err != nil {\n\t\tlog.Fatal(\"Cannot connect to database:\", err)\n\t}\n\tdb.db.SetConnMaxLifetime(time.Minute * 3)\n\tdb.db.SetMaxOpenConns(50)\n\tdb.db.SetMaxIdleConns(5)\n\terr = db.db.Ping() // test the connection\n\tif err != nil {\n\t\tlog.Fatal(\"Cannot ping the database:\", err)\n\t}\n\treturn db\n}", "title": "" }, { "docid": "ec591f244473e9b71a40d27967592209", "score": "0.63244617", "text": "func New(c *domain.DBConfig) (*gorm.DB, error) {\n\tdsn := fmt.Sprintf(\n\t\t\"host=%s user=%s dbname=%s port=%s sslmode=%s password=%s \",\n\t\tc.Host,\n\t\tc.User,\n\t\tc.Name,\n\t\tc.Port,\n\t\tc.SslMode,\n\t\tc.Password,\n\t)\n\n\tdb, err := gorm.Open(postgres.Open(dsn), &gorm.Config{Logger: logger.Default.LogMode(getLogLevelFromString(c.LogLevel))})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn db, err\n}", "title": "" }, { "docid": "ee13ad6e7f89cd6533251659608a0651", "score": "0.63226384", "text": "func New(conf config.DBConfig) (*driver, error) {\n\tdbinfo := fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\tconf.Host, 5432, conf.User, conf.Password, conf.Name)\n\n\tdb, err := sql.Open(\"postgres\", dbinfo)\n\tif err != nil {\n\t\tlog.Printf(\"error opening connection to database %v\", err)\n\t\treturn nil, err\n\t}\n\n\tlog.Printf(\"Attempting to connect to the database\")\n\tconnect(db, MaxRetries)\n\tlog.Printf(\"Successfully connected to database\")\n\n\treturn &driver{db}, nil\n}", "title": "" }, { "docid": "87db8d58332eed7388b33e5de235c048", "score": "0.6321494", "text": "func CreateConnection(config Config) (*sql.DB, error) {\n\tpsqlInfo := fmt.Sprintf(\n\t\t\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\tconfig.Host,\n\t\tconfig.Port,\n\t\tconfig.User,\n\t\tconfig.Password,\n\t\tconfig.DBname,\n\t)\n\n\tvar db *sql.DB\n\tvar err error\n\n\topenAttempt := 0\n\tfor openAttempt <= maxAttempt {\n\t\topenAttempt++\n\n\t\tdb, err = sql.Open(\"postgres\", psqlInfo)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tfmt.Printf(\"Attempt %v to open db connection, error: %s; Try again in %d second(s)\\n\", openAttempt, err, sleepInSecond)\n\t\ttime.Sleep(sleepInSecond * time.Second)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpingAttempt := 0\n\tfor pingAttempt <= maxAttempt {\n\t\tpingAttempt++\n\n\t\terr = db.Ping()\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tfmt.Printf(\"Attempt %v to ping db, error: %s; Try again in %d second(s)\\n\", pingAttempt, err, sleepInSecond)\n\t\ttime.Sleep(sleepInSecond * time.Second)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "872b45adbd3c5fbfd107740cd64c2039", "score": "0.6320579", "text": "func New() *Database {\n\tdb := &Database{\n\t\tpsql: establishConnection(),\n\t\tMsgChan: make(chan model.Message),\n\t}\n\tgo db.databaseHandler()\n\tlog.Logger.Infof(\"Created a new Database instance\")\n\treturn db\n}", "title": "" }, { "docid": "e6528d9c723ddb100e867b2473120ad9", "score": "0.63148195", "text": "func Connect() (*DB, error) {\n\n\tif cdb == nil {\n\t\tfmt.Printf(\"Creating new DB connection\")\n\t\tdb, err := gorm.Open( \"postgres\", \"host=localhost port=5432 user=luxor dbname=luxor sslmode=disable password=luxor\")\n\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Could not connect to db: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\tcdb = &DB{Db: db}\n\t}\n\n\treturn cdb, nil\n}", "title": "" }, { "docid": "7085cf90d48c30ec4889554a4dbdaa38", "score": "0.6311662", "text": "func New(db *sql.DB, dbname string) *DB {\n\tdatabase = &DB{\n\t\tDBName: dbname,\n\t\tDatabase: db,\n\t}\n\treturn database\n}", "title": "" }, { "docid": "d8b6933f0ba4a3ae5149b6a247821c1d", "score": "0.63098955", "text": "func open() (*sql.DB, error) {\n\tconnSource := fmt.Sprintf(\n\t\t\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\tos.Getenv(\"DB_HOST\"),\n\t\tgetEnvInt(\"DB_PORT\"),\n\t\tos.Getenv(\"DB_USER\"),\n\t\tos.Getenv(\"DB_PASS\"),\n\t\tos.Getenv(\"DB_NAME\"),\n\t)\n\n\tconn, err := sql.Open(\"postgres\", connSource)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = conn.Ping(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn conn, nil\n}", "title": "" }, { "docid": "a67f0d52c54e04ce8a4b35b6c0090ade", "score": "0.63077056", "text": "func OpenConnectionDataBase() error {\n dsn := fmt.Sprintf(\n \"%s:%s@tcp(%s:%s)/%s\",\n config.Params.Maria.DBUser,\n config.Params.Maria.DBPass,\n config.Params.Maria.DBHost,\n config.Params.Maria.DBPort,\n config.Params.Maria.DBName,\n )\n database, err := sql.Open(`mysql`, dsn)\n if err != nil {\n return err\n }\n\n DB = database\n return database.Ping()\n}", "title": "" }, { "docid": "d28b9f86c0fc84d64920cdebd3dd01e6", "score": "0.6300474", "text": "func New() *Database {\n\tusername := os.Getenv(\"HANAZAWA_DB_USER\")\n\tpassword := os.Getenv(\"HANAZAWA_DB_PASSWORD\")\n\thost := os.Getenv(\"HANAZAWA_DB_HOST\")\n\tport := os.Getenv(\"HANAZAWA_DB_PORT\")\n\tpool := 5\n\tdb, err := sql.Open(\"mysql\", username+\":\"+password+\"@tcp(\"+host+\":\"+port+\")/hanazawa?charset=utf8mb4\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tdb.SetMaxIdleConns(pool)\n\tdb.SetMaxOpenConns(pool)\n\treturn &Database{\n\t\tConnection: db,\n\t}\n}", "title": "" }, { "docid": "0028d06876ba3172b8dffcc830368606", "score": "0.629202", "text": "func NewDB() *sql.DB {\n\tcfg := config.New()\n\tdb, err := sql.Open(\"mysql\", connStr(cfg))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdb.SetMaxOpenConns(10)\n\tdb.SetMaxIdleConns(5)\n\tdb.SetConnMaxLifetime(time.Hour)\n\treturn db\n}", "title": "" }, { "docid": "e66e21c9b838dca4819f970429c8ea30", "score": "0.62862784", "text": "func NewDB(c *models.Configurations) (*DB, error) {\n\t// open new daatabase connection\n\tdb, err := gorm.Open(\"postgres\", getDbURI(c))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// check if connection is properly established\n\tif err = db.DB().Ping(); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// return db wrapper\n\treturn &DB{db}, nil\n}", "title": "" }, { "docid": "419841d3b59f6646014614622f400c0a", "score": "0.6285411", "text": "func New(connString string) (*Db, error) {\n\tdb, err := sql.Open(\"postgres\", connString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Check that our connection is good\n\tif err := db.Ping(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Db{db}, nil\n}", "title": "" }, { "docid": "299edee2ee62041d65b1276f3365e881", "score": "0.62789077", "text": "func (factory *GORMDBClientFactory) CreateConnection(dbConfig map[string]string) (*gorm.DB, error) {\n\n\tconnMaxLifetime, err := time.ParseDuration(dbConfig[\"connmaxlifetime\"])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create DBClient, couldn't parse 'connmaxlifetime': %s\", err.Error())\n\t}\n\n\tmaxOpenConns, err := strconv.Atoi(dbConfig[\"maxopenconns\"])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create DBClient, couldn't parse 'maxopenconns': %s\", err.Error())\n\t}\n\n\tmaxIdleConns, err := strconv.Atoi(dbConfig[\"maxidleconns\"])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create DBClient, couldn't parse 'maxidleconns': %s\", err.Error())\n\t}\n\n\tconnString, err := factory.createConnString(dbConfig)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create DBClient, couldn't prepare connection string: %s\", err.Error())\n\t}\n\n\tdb, err := gorm.Open(factory.dialect, connString)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create DBClient, couldn't connect to db: %s\", err.Error())\n\t}\n\n\tdb.DB().SetConnMaxLifetime(connMaxLifetime)\n\tdb.DB().SetMaxOpenConns(maxOpenConns)\n\tdb.DB().SetMaxIdleConns(maxIdleConns)\n\tdb.SetLogger(log.DefaultLogger)\n\n\treturn db, nil\n}", "title": "" }, { "docid": "2469eba249e468fbb910c067d8c3115c", "score": "0.6278745", "text": "func Dial(config *conf.GlobalConfiguration) (*Connection, error) {\n\tif config.DB.Driver == \"\" && config.DB.URL != \"\" {\n\t\tu, err := url.Parse(config.DB.URL)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"parsing db connection url\")\n\t\t}\n\t\tconfig.DB.Driver = u.Scheme\n\t}\n\n\tif config.DB.Dialect == \"\" {\n\t\tconfig.DB.Dialect = config.DB.Driver\n\t}\n\tdb, err := gorm.Open(config.DB.Dialect, config.DB.Driver, config.DB.URL)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"opening database connection\")\n\t}\n\n\tif err := db.DB().Ping(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"checking database connection\")\n\t}\n\n\tdb.SetLogger(logger{logrus.WithField(\"db-connection\", config.DB.Driver)})\n\n\tif logrus.StandardLogger().Level == logrus.DebugLevel {\n\t\tdb.LogMode(true)\n\t}\n\n\tconn := &Connection{\n\t\tdb: db,\n\t}\n\n\treturn conn, nil\n}", "title": "" }, { "docid": "8680eab447a957458f54c8465b4c599c", "score": "0.6276956", "text": "func NewDataBase(cfg *config.Config) *sql.DB {\n\ts := cfg.Service\n\tpsqlInfo := fmt.Sprintf(psqlInfoFormatString,\n\t\ts.Host, s.Port, s.User, s.Password, s.Name)\n\tdb, err := sql.Open(driverName, psqlInfo)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = db.Ping()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tlog.Println(\"Successfully connected!\")\n\treturn db\n}", "title": "" }, { "docid": "7e48b3ce73846af7d6e3a1f2ba8c7c89", "score": "0.6274666", "text": "func newConnection(\n\tparentCtx context.Context,\n\tdebugLogger *log.Logger,\n\terrorLogger *log.Logger,\n\twrapped *bazilfuse.Conn) (c *Connection, err error) {\n\tc = &Connection{\n\t\tdebugLogger: debugLogger,\n\t\terrorLogger: errorLogger,\n\t\twrapped: wrapped,\n\t\tparentCtx: parentCtx,\n\t\tcancelFuncs: make(map[bazilfuse.RequestID]func()),\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a8de0c736fd03394cfbd95b26017c61d", "score": "0.6273615", "text": "func Open(server, port, dbName, user string, pass []byte) (db *Database, err error) {\n\tPrinter.Printf(printssx.Subtle, \"Opening database %s/%s\\n\", server, dbName)\n\topenStr := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&collation=utf8mb4_bin\", user, string(pass), server, port, dbName)\n\tsqlDB, erro := sql.Open(\"mysql\", openStr)\n\tif erro != nil {\n\t\treturn nil, NewError(\"DB Open\", openStr, erro)\n\t}\n\n\t// Pretty sure we need to do a simple query to ensure the db is connected\n\terro = sqlDB.Ping()\n\tif erro != nil {\n\t\tsqlDB.Close()\n\t\treturn nil, NewError(\"DB Ping\", \"\", erro)\n\t}\n\n\tsqlDB.SetMaxIdleConns(0)\n\tdb = &Database{name: dbName, sqlDB: sqlDB}\n\t//dbCatalog[server] = make(map[string]*Database)\n\tServerByName(server).dbCatalog[dbName] = db\n\treturn\n}", "title": "" }, { "docid": "6443375a390094fdb627a5b2eca0039b", "score": "0.6273192", "text": "func createNewConnection(once bool, alias string, dbx ...*sqlx.DB) (uint, **sqlx.DB) {\n\tm.Lock()\n\tdefer m.Unlock()\n\n\tif once {\n\t\tif i, ok := cm[alias]; ok && cp[i] != nil {\n\t\t\treturn i, &cp[i]\n\t\t}\n\t}\n\n\tcid := uint(len(cp))\n\tif len(dbx) > 0 {\n\t\tcp = append(cp, dbx[0])\n\t} else {\n\t\tcp = append(cp, nil)\n\t}\n\tif once {\n\t\tcm[alias] = cid\n\t}\n\n\treturn cid, &cp[cid]\n}", "title": "" }, { "docid": "cac755444dc9225237d29efab245a3c5", "score": "0.6267536", "text": "func (bb *Database) New() error {\n\tdb, err := bolt.Open(\"Utxos.db\", 0600, &bolt.Options{Timeout: 10 * time.Second})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbb.DB = db\n\n\treturn nil\n}", "title": "" }, { "docid": "c09ab902bd1e1cb98fb041dba248d884", "score": "0.6259341", "text": "func createDBClient(connStr string) (db *gorm.DB) {\n\n\tdb, err := gorm.Open(mysql.Open(connStr), &gorm.Config{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "cfe3f31c42ce8c0b1546369456398930", "score": "0.6257545", "text": "func Init(user, password, name, host, port, sslmode string, timeout, maxconn int) (*sql.DB, error) {\n\tmutex.Lock()\n\tdefer mutex.Unlock()\n\n\t// Try to close before reinit\n\tif db != nil {\n\t\tif err := db.Close(); err != nil {\n\t\t\tlog.Error(\"Cannot close connection to DB : %s\", err)\n\t\t}\n\t}\n\n\tvar err error\n\n\tdbDriver = \"postgres\"\n\tdbUser = user\n\tdbPassword = password\n\tdbName = name\n\tdbHost = host\n\tdbPort = port\n\tdbSSLMode = sslmode\n\tdbTimeout = timeout\n\tdbMaxConn = maxconn\n\n\tif dbUser == \"\" ||\n\t\tdbPassword == \"\" ||\n\t\tdbName == \"\" ||\n\t\tdbHost == \"\" ||\n\t\tdbPort == \"\" {\n\t\treturn nil, fmt.Errorf(\"Missing database infos\")\n\t}\n\n\tif SecretDBUser != \"\" {\n\t\tdbUser = SecretDBUser\n\t}\n\n\tif SecretDBPassword != \"\" {\n\t\tdbPassword = SecretDBPassword\n\t}\n\n\tif timeout < 200 || timeout > 15000 {\n\t\ttimeout = 3000\n\t}\n\n\t// connect_timeout in seconds\n\t// statement_timeout in milliseconds\n\t// yeah...\n\tdsn := fmt.Sprintf(\"user=%s password=%s dbname=%s host=%s port=%s sslmode=%s connect_timeout=10 statement_timeout=%d\", dbUser, dbPassword, dbName, dbHost, dbPort, dbSSLMode, timeout)\n\tdb, err = sql.Open(dbDriver, dsn)\n\tif err != nil {\n\t\tdb = nil\n\t\tlog.Error(\"Cannot open database: %s\", err)\n\t\treturn nil, err\n\t}\n\n\tif err = db.Ping(); err != nil {\n\t\tdb = nil\n\t\treturn nil, err\n\t}\n\n\tdb.SetMaxOpenConns(maxconn)\n\tdb.SetMaxIdleConns(int(maxconn / 2))\n\n\treturn db, nil\n}", "title": "" }, { "docid": "7e6e3999f36fe15fa996500d15dc3fe4", "score": "0.6255881", "text": "func NewConnection(uri string, seed func(db *sqlx.DB) error) (*Store, error) {\n\tconn, err := sqlx.Open(\"postgres\", uri)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, err\n\t}\n\n\terr = seed(conn)\n\tif err != nil {\n\t\tlog.Println(\"seed error\")\n\t\treturn nil, err\n\t}\n\n\treturn &Store{\n\t\tDB: conn,\n\t}, nil\n}", "title": "" }, { "docid": "9231fd242ba82a38e369dc5c3bd74e50", "score": "0.62553793", "text": "func NewDatabase(conf *config.Config) (*sqlx.DB, error) {\n\tswitch conf.DB.Type {\n\tcase \"sqlite3\":\n\n\t\tfmt.Println(\"DRIVER: \" + conf.DB.Driver)\n\t\tfmt.Println(\"CONN: \" + conf.DB.Conn)\n\n\t\tdb, err := sqlx.Open(conf.DB.Driver, conf.DB.Conn)\n\n\t\t// fmt.Println(db) //aca da el problema me parece...\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\terr = db.Ping()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn db, nil\n\tdefault:\n\t\treturn nil, errors.New(\"invalid database type\")\n\t}\n}", "title": "" }, { "docid": "5ed22f6fb138edec7eb963db11583de8", "score": "0.62534845", "text": "func newDatabase(s *Server) *Database {\n\treturn &Database{\n\t\tserver: s,\n\t\tusers: make(map[string]*DBUser),\n\t\tspaces: make(map[string]*ShardSpace),\n\t\tshards: make(map[uint64]*Shard),\n\t\tseries: make(map[string]*Series),\n\t}\n}", "title": "" }, { "docid": "561471da649140daee0fa3fdd9c65eac", "score": "0.6250966", "text": "func newMySQLConnection(meta *mySQLMetadata) (*sql.DB, error) {\n\tconnStr := metadataToConnectionStr(meta)\n\tdb, err := sql.Open(\"mysql\", connStr)\n\tif err != nil {\n\t\tmySQLLog.Error(err, fmt.Sprintf(\"Found error when opening connection: %s\", err))\n\t\treturn nil, err\n\t}\n\terr = db.Ping()\n\tif err != nil {\n\t\tmySQLLog.Error(err, fmt.Sprintf(\"Found error when pinging database: %s\", err))\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "e77e388f5099964704501130e6853539", "score": "0.625006", "text": "func Open(user, password, host, port, name, timezone, charset string, maxOpenConns, maxIdleConns int, maxLifetime time.Duration) error {\n\tdb, err := sql.Open(\n\t\t\"mysql\",\n\t\tuser+\":\"+password+\"@tcp(\"+host+\":\"+port+\")\"+\"/\"+name+\n\t\t\t\"?parseTime=true&loc=\"+timezone+\"&charset=\"+charset)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdb.SetMaxOpenConns(maxOpenConns)\n\tdb.SetMaxIdleConns(maxIdleConns)\n\tdb.SetConnMaxLifetime(maxLifetime * time.Minute)\n\n\tDB = db\n\n\treturn nil\n}", "title": "" }, { "docid": "58146e927e486ff9f23014962c4558db", "score": "0.62456065", "text": "func CreateConnection() (*sql.DB, bool) {\n\terr := godotenv.Load(\".env\") // load .env file\n\tvar postgresString string // store the string\n\tnukeDatabase := false\n\tif strings.ToLower(os.Getenv(\"USE_LOCAL_INSTANCE\")) == \"true\" { // use local postgres install\n\t\tpostgresString = os.Getenv(\"LOCAL_POSTGRES_URL\") // yes do\n\t\tif strings.ToLower(os.Getenv(\"NUKE_DATABASE\")) == \"true\" { // nuke database\n\t\t\tnukeDatabase = true\n\t\t}\n\t} else {\n\t\tpostgresString = os.Getenv(\"ALT_POSTGRES_URL\")\n\t}\n\tdb, err := sql.Open(\"postgres\", postgresString) // Open the connection\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = db.Ping() // check the connection\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Successfully connected!\")\n\treturn db, nukeDatabase // return the connection\n}", "title": "" }, { "docid": "859bccbe8ccbae89e73d9a9c37f24b07", "score": "0.62291664", "text": "func Open(cfg Config) *DB {\n\n\tdbinfo := fmt.Sprintf(\"host=%s user=%s password=%s dbname=%s sslmode=%s\",\n\t\tcfg.DBHost,\n\t\tcfg.DBUser,\n\t\tcfg.DBPass,\n\t\tcfg.DBName,\n\t\tcfg.DBSSLMode)\n\n\tlog.Infof(\"Opening connection to database (%s)\", cfg.DBHost)\n\n\tdb, err := sqlx.Connect(\"postgres\", dbinfo)\n\tif err != nil {\n\t\tpanic(\"Error connecting to database\")\n\t}\n\n\treturn &DB{DB: db}\n}", "title": "" }, { "docid": "7f9fa41adb19e8e79a682da6c0e5b5a4", "score": "0.6225495", "text": "func establishConnection() *sql.DB {\n\tdbSource, exists := os.LookupEnv(\"DB_SOURCE\")\n\tif exists {\n\t\tpsql, err := sql.Open(\"postgres\", dbSource)\n\t\tif err != nil {\n\t\t\tlog.Logger.Fatal(err)\n\t\t}\n\t\tlog.Logger.Infof(\"Opened a new DB connection\")\n\t\treturn psql\n\t} else {\n\t\tlog.Logger.Fatal(\"No DB_SOURCE in .env file\")\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "07de4d9da59c365675c9f67850eff2a5", "score": "0.62207544", "text": "func NewDB() *gorm.DB {\n\tvar db *gorm.DB\n\tgormCfg := &gorm.Config{\n\t\tNamingStrategy: &schema.NamingStrategy{\n\t\t\tTablePrefix: \"adaptor_\",\n\t\t},\n\t}\n\n\tif databaseType == \"mysql\" {\n\t\tmySQLConfig := &mysql.Config{\n\t\t\tUser: config.C.DB.User,\n\t\t\tPasswd: config.C.DB.Pass,\n\t\t\tNet: \"tcp\",\n\t\t\tAddr: fmt.Sprintf(\"%s:%d\", config.C.DB.Host, config.C.DB.Port),\n\t\t\tDBName: config.C.DB.Name,\n\t\t\tAllowNativePasswords: true,\n\t\t\tParseTime: true,\n\t\t\tLoc: time.Local,\n\t\t\tParams: map[string]string{\"charset\": \"utf8\"},\n\t\t\tTimeout: time.Second * 5,\n\t\t}\n\n\t\tretry := 10\n\t\tfor retry > 0 {\n\t\t\tvar err error\n\n\t\t\tdb, err = gorm.Open(gmysql.Open(mySQLConfig.FormatDSN()), gormCfg)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Errorf(\"open db connection failure %s, will retry\", err.Error())\n\t\t\t\ttime.Sleep(time.Second * 3)\n\t\t\t\tretry--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t} else {\n\t\tos.MkdirAll(databasePath, 0755)\n\t\tvar err error\n\t\tdatabaseFilePath := path.Join(databasePath, \"db.sqlite3\")\n\t\tdb, err = gorm.Open(sqlite.Open(databaseFilePath), gormCfg)\n\t\tif err != nil {\n\t\t\tlog.Fatalln(err)\n\t\t}\n\t}\n\tgdb = db\n\treturn db\n}", "title": "" }, { "docid": "a6d37fb70649db5392717649b3fe2b51", "score": "0.6216209", "text": "func CreateConnection() (*gorm.DB, error) {\n\n\tdb, err := gorm.Open(\n\t\t\"postgres\",\n\t\tfmt.Sprintf(\n\t\t\t\"host=%s user=%s dbname=%s sslmode=disable password=%s\",\n\t\t\tviper.GetString(\"database.host\"), viper.GetString(\"database.user\"), viper.GetString(\"database.name\"), viper.GetString(\"database.password\"),\n\t\t),\n\t)\n\n\treturn db, err\n}", "title": "" }, { "docid": "a0be52e7ccbad048dc2fba50ebb8100e", "score": "0.619406", "text": "func New() *gorm.DB {\n\t// Start a new connection with data source\n\tdb, err := gorm.Open(\"sqlite3\", \"./data/products.db\")\n\n\t// Check for errors\n\tif err != nil {\n\n\t\t// Output issues\n\t\tfmt.Println(\"Storage Error: \", err)\n\t}\n\n\t// Set number of connection\n\tdb.DB().SetMaxIdleConns(2)\n\n\t// DB setup for debugging\n\tdb.LogMode(true)\n\tdb.Debug()\n\n\treturn db\n}", "title": "" }, { "docid": "b9033528b1c37ae71d139c6f57eeb76d", "score": "0.6189692", "text": "func Connect(config configuration.Configuration) (*gorm.DB, error) {\n\tdb, err := gorm.Open(\"postgres\", PostgresConfigString(config))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstoreLogger.Info(\"Successfully connected to database\")\n\n\tif config.GetPostgresConnectionMaxIdle() > 0 {\n\t\tstoreLogger.Infof(\"Configured connection pool max idle %v\", config.GetPostgresConnectionMaxIdle())\n\t\tdb.DB().SetMaxIdleConns(config.GetPostgresConnectionMaxIdle())\n\t}\n\tif config.GetPostgresConnectionMaxOpen() > 0 {\n\t\tstoreLogger.Infof(\"Configured connection pool max open %v\", config.GetPostgresConnectionMaxOpen())\n\t\tdb.DB().SetMaxOpenConns(config.GetPostgresConnectionMaxOpen())\n\t}\n\n\tif config.GetDebugMode() {\n\t\tdb = db.Debug()\n\t}\n\n\trequest := &Request{}\n\tif !db.HasTable(request) {\n\t\tdb.CreateTable(request)\n\t}\n\n\tstats := &Statistics{}\n\tif !db.HasTable(stats) {\n\t\tdb.CreateTable(stats)\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "b47a432280914c27cb321bbb6d055827", "score": "0.6182064", "text": "func newDBStore() (Storage, error) {\n\n\tdataSourceName := fmt.Sprintf(\"%s:%s@tcp(%s)/%s?allowOldPasswords=1&tls=%s&sql_notes=false&timeout=%s&readTimeout=%s&writeTimeout=%s\",\n\t\tconfig.Configuration.DbUser,\n\t\tconfig.Configuration.DbPassphrase,\n\t\tconfig.Configuration.DbHost,\n\t\tconfig.Configuration.DbName,\n\t\tconfig.Configuration.DbSecure,\n\t\tconfig.Configuration.DbTimeout,\n\t\tconfig.Configuration.DbTimeout,\n\t\tconfig.Configuration.DbTimeout)\n\n\tdb, err := sql.Open(\"mysql\", dataSourceName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err = db.Ping(); err != nil {\n\t\treturn nil, err\n\t}\n\n\t//taken from https://github.com/go-sql-driver/mysql/issues/461\n\tdb.SetConnMaxLifetime(time.Minute * 5)\n\tdb.SetMaxIdleConns(2)\n\tdb.SetMaxOpenConns(2)\n\n\treturn &storage{db}, nil\n}", "title": "" }, { "docid": "2d24117e29672b03be6b66d768a7dfbb", "score": "0.6174786", "text": "func ConnectionDB() *gorm.DB {\n\tvar (\n\t\thost = \"localhost\"\n\t\tuser = \"reb\"\n\t\tpassword = \"ghost699\"\n\t\tname = \"reb\"\n\t)\n\tdbUri := fmt.Sprintf(\"host=%s user=%s dbname=%s sslmode=disable password=%s\", host, user, name, password)\n\n\tConn, err := gorm.Open(postgres.Open(dbUri), &gorm.Config{})\n\tif err != nil {\n\t\tlog.Fatalf(\"Error in connect the DB %v\", err)\n\t\treturn nil\n\t}\n\tif Conn.Error != nil {\n\t\tlog.Fatalln(\"Any Error in connect the DB \" + err.Error())\n\t\treturn nil\n\t}\n\tlog.Println(\"DB connected\")\n\treturn Conn\n}", "title": "" }, { "docid": "29849821e072af3073da686e958c225d", "score": "0.6167464", "text": "func NewConn(config config.Configuration) (*Conn, error) {\n\tdb, err := gorm.Open(config.Postgres.Driver,\n\t\t\"host=\"+config.Postgres.Host+\n\t\t\t\" port=\"+config.Postgres.Port+\n\t\t\t\" user=\"+config.Postgres.User+\n\t\t\t\" dbname=\"+config.Postgres.Name+\n\t\t\t\" password=\"+config.Postgres.Password+\n\t\t\t\" sslmode=disable\")\n\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"db connect failed...\")\n\t}\n\n\treturn &Conn{\n\t\tdb: db,\n\t}, nil\n}", "title": "" }, { "docid": "0dcb3f8fab050ce1f8a738b4cd505669", "score": "0.61637586", "text": "func New(cfg *config.Config) *pg.DB {\n\tpgOptions, err := pg.ParseURL(cfg.DatabaseURL)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdb := pg.Connect(pgOptions)\n\n\tif cfg.DatabaseDebug {\n\t\tdb.OnQueryProcessed(func(event *pg.QueryProcessedEvent) {\n\t\t\tquery, err := event.FormattedQuery()\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tlog.Printf(\"%s %s\", time.Since(event.StartTime), query)\n\t\t})\n\t}\n\n\t_, err = db.Exec(\"SELECT 1\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn db\n}", "title": "" }, { "docid": "800c661f5d9990067780e55cb376291f", "score": "0.6158902", "text": "func Init() *pg.DB {\n\tfmt.Println(\"Initialising DB Connection\")\n\t// connStr := \"user=commonwand password=commonwand dbname=commonwand sslmode=disable\"\n\tdb := dbConnect()\n\n\tfmt.Printf(\"%+v\\n\", db)\n\n\terr := createSchema(db)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn db\n}", "title": "" }, { "docid": "4b0749d51cb5c9718d1b114264b0d160", "score": "0.61543494", "text": "func (db *Database) Connect(ctx context.Context) (database.Database, error) {\n\tlock.Lock()\n\tdefer lock.Unlock()\n\tcountLock.Lock()\n\tdefer countLock.Unlock()\n\tndb := new(Database)\n\t*ndb = *db\n\tndb.ctx = ctx\n\tconnectionCount++\n\treturn ndb, nil\n}", "title": "" }, { "docid": "bca51e3f37af0bc9a7808ce610bdfa95", "score": "0.61528355", "text": "func Open(host, port, dbname, user, password string) (*DB, error) {\n\tdb, err := sqlx.Connect(\"pgx\",\n\t\tfmt.Sprintf(\"host=%s port=%s dbname=%s user=%s password=%s sslmode=disable\",\n\t\t\thost, port, dbname, user, password))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DB{DB: db}, nil\n}", "title": "" }, { "docid": "a5908f4e1fe68fbc9111396e99b7624c", "score": "0.6151091", "text": "func Open(t *testing.T) *db.DB {\n\tif *conn == \"\" {\n\t\tt.Skip(\"no database connection string provided\")\n\t}\n\n\tdb, err := db.Open(context.Background(), *conn)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tt.Cleanup(func() {\n\t\tif err := db.Close(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n\n\treturn db\n}", "title": "" }, { "docid": "722b402cdbc2a6ddf1169be4b3a96711", "score": "0.6145709", "text": "func New(connString string) (*sqlx.DB, error) {\n\tconfig, err := pgx.ParseConfig(connString)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdb := sqlx.NewDb(stdlib.OpenDB(*config), \"pgx\")\n\terr = db.Ping()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "17661d68cb8a40f6480fd7f681b027b3", "score": "0.6141676", "text": "func (s *Scanner) newConnection(t *zgrab2.ScanTarget, mgr *connectionManager, nossl bool) (*Connection, *zgrab2.ScanError) {\n\tvar conn net.Conn\n\tvar err error\n\t// Open a managed connection to the ScanTarget, register it for automatic cleanup\n\tif conn, err = t.Open(&s.Config.BaseFlags); err != nil {\n\t\treturn nil, zgrab2.DetectScanError(err)\n\t}\n\tmgr.addConnection(conn)\n\tsql := Connection{Target: t, Connection: conn, Config: s.Config}\n\tsql.IsSSL = false\n\tif !nossl && !s.Config.SkipSSL {\n\t\thasSSL, sslError := sql.RequestSSL()\n\t\tif sslError != nil {\n\t\t\treturn nil, sslError\n\t\t}\n\t\tif hasSSL {\n\t\t\tif err = s.DoSSL(&sql); err != nil {\n\t\t\t\treturn nil, zgrab2.NewScanError(zgrab2.SCAN_APPLICATION_ERROR, err)\n\t\t\t}\n\t\t\tsql.IsSSL = true\n\t\t}\n\t}\n\treturn &sql, nil\n}", "title": "" }, { "docid": "409e61c064aec129655fa12a38fea28a", "score": "0.61361194", "text": "func NewConnection(dbname string, cluster []string) (*dbx, error) {\n\tstore := getStore(cluster)\n\tdriver, err := driver.New(store, driver.WithLogFunc(logFunc))\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"failed to create dqlite driver\")\n\t}\n\tsql.Register(\"dqlite\", driver)\n\n\tdb, err := sql.Open(\"dqlite\", dbname)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"can't open database\")\n\t}\n\n\treturn &dbx{db}, nil\n}", "title": "" }, { "docid": "608ace37c72f75122afa9e2f6e9b56ea", "score": "0.6135926", "text": "func NewDB(username, password, host, database string, port int) *Manage {\n\t// db, err = sqlx.Connect(\"mysql-host\", \"username:password@tcp(mysql:3306)/whatvideo?charset=utf8&parseTime=True&loc=Local\")\n\tsqlInfo := fmt.Sprintf(\n\t\t\"%s:%s@tcp(%s:%d)/%s?charset=utf8&parseTime=True&loc=Local\",\n\t\tusername,\n\t\tpassword,\n\t\thost,\n\t\tport,\n\t\tdatabase,\n\t)\n\n\tvar dbx *sqlx.DB\n\tvar err error\n\tfor {\n\t\tdbx, err = sqlx.Connect(\"mysql\", sqlInfo)\n\n\t\tif err != nil {\n\t\t\tlog.Println(\"Connection Failed to Open\")\n\t\t} else {\n\t\t\tlog.Println(\"Connection Established\")\n\t\t\tbreak\n\t\t}\n\t\tfmt.Println(\"could not connect to database, waiting 3 second\")\n\t\ttime.Sleep(3 * time.Second)\n\t}\n\n\tvar m Manage\n\tm.DB = dbx\n\treturn &m\n}", "title": "" }, { "docid": "39e2a4e1e270ebdc9685d99fa8e9f2b8", "score": "0.6135423", "text": "func Open(cfg Config) (*sql.DB, error) {\n\n\tconn := fmt.Sprintf(\"host=%s port=%s user=%s password=%s dbname=%s sslmode=%s\", cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.DBName, cfg.TLSMode)\n\treturn sql.Open(\"postgres\", conn)\n}", "title": "" }, { "docid": "8b0c265264c33103f7e959cd55f42016", "score": "0.61290336", "text": "func createDbConnection() (client *mongo.Client) {\n\tdbuser, dbpass, dbhostname, _ := getDatabaseConfig()\n\turi := fmt.Sprintf(\"mongodb://%s:%s@%s\", dbuser, dbpass, dbhostname)\n\tclient, err := mongo.NewClient(options.Client().ApplyURI(uri))\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tctx, _ := context.WithTimeout(context.Background(), 10*time.Second)\n\terr = client.Connect(ctx)\n\t// Check the connection\n\tctx, _ = context.WithTimeout(context.Background(), 2*time.Second)\n\terr = client.Ping(ctx, readpref.Primary())\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Println(\"Connected to MongoDB!\")\n\n\treturn\n}", "title": "" }, { "docid": "7e9e7445d22fef8978382a10b625abf2", "score": "0.6116069", "text": "func Open(ctx context.Context, cfg Config) (*sqlx.DB, error) {\n\tsslMode := \"require\"\n\tif cfg.DisableTLS {\n\t\tsslMode = \"disable\"\n\t}\n\n\tq := make(url.Values)\n\tq.Set(\"sslmode\", sslMode)\n\tq.Set(\"timezone\", \"utc\")\n\tq.Set(\"connect_timeout\", strconv.Itoa(cfg.ConnectTimeout))\n\n\tu := url.URL{\n\t\tScheme: \"postgres\",\n\t\tUser: url.UserPassword(cfg.User, cfg.Password),\n\t\tHost: cfg.Host,\n\t\tPath: strings.ToLower(cfg.Name),\n\t\tRawQuery: q.Encode(),\n\t}\n\n\tdb, err := sqlx.Open(\"postgres\", u.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb.SetMaxIdleConns(cfg.MaxIdleConns)\n\tdb.SetMaxOpenConns(cfg.MaxOpenConns)\n\n\treturn db, StatusCheck(ctx, db)\n}", "title": "" }, { "docid": "5e6799edb0eea2e1dc7264cdab22f315", "score": "0.6108762", "text": "func (connection *Connection) Initialize(host, port, username, password, dbname string) (*sql.DB, error) {\n\tvar err error\n\tdataSourceName := fmt.Sprintf(\"host=%s port=%s user=%s password=%s database=%s\", host, port, username, password, dbname)\n\tconnection.DB, err = sql.Open(\"postgres\", dataSourceName)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = connection.DB.Ping()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn connection.DB, err\n}", "title": "" }, { "docid": "712210c32af069a96764e7863108a602", "score": "0.6107431", "text": "func CreateConnection(configFilepath string) *models.DbConnection {\n\tdbOptions := config.LoadDatabaseConfig(configFilepath)\n\tdb := pg.Connect(dbOptions)\n\treturn &models.DbConnection{Database: db}\n}", "title": "" }, { "docid": "4b7d8a19e92731d8cb923abc118931a4", "score": "0.6103876", "text": "func Open(config *config.Config) {\n\tpassword := decryptDbUserPassword(config.Database.Password)\n\n\thost := config.Database.Host + \":\" + strconv.FormatInt(config.Database.Port, 10)\n\turl := config.Database.Username + \":\" + password + \"@tcp(\" + host + \")/\" + config.Database.Database\n\n\tvar err error\n\tdbGorm, err = gorm.Open(mysql.Open(url), &gorm.Config{})\n\n\tif err != nil {\n\t\tpanic(err.Error)\n\t}\n\n\tdb, err := dbGorm.DB()\n\tif err != nil {\n\t\tpanic(err.Error)\n\t}\n\n\tdb.SetMaxIdleConns(10)\n\tdb.SetMaxOpenConns(10)\n\tdb.SetConnMaxLifetime(time.Hour)\n}", "title": "" }, { "docid": "196635b1244428739b5ac0d15fe0ef74", "score": "0.6096864", "text": "func (c *Connector) Open(ci *connection.Information) (connection.DB, error) {\n\treturn &DB{}, nil\n}", "title": "" }, { "docid": "4748b17fdce5ed13fd93b70ef3d284fd", "score": "0.60883445", "text": "func New(c *consul.Client) (*gorm.DB, func()) {\n\tpgAddress, pgPort, err := toolkit.GetServiceAddress(c, \"postgres\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tv, err := toolkit.GetConsulValueFromKey(c, \"db-networks\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tvar pg PG\n\terr = json.Unmarshal([]byte(v), &pg)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn toolkit.NewDB(toolkit.ToDS(pg.User, pg.Password, pgAddress, pgPort, \"postgres\", pg.DB))\n}", "title": "" }, { "docid": "a6a918f8825db480b2f362c21d45edba", "score": "0.60785145", "text": "func NewDB(dbKey string,\n\tconnectionString string,\n\tconfig *pgx.ConnConfig) *DB {\n\tif connectionString == \"\" && config == nil {\n\t\tpanic(\"must specify how to connect to the database\")\n\t}\n\n\tif connectionString == \"\" {\n\t\tconnectionString = stdlib.RegisterConnConfig(config)\n\t}\n\n\tdb3, err := sqldb.Open(\"pgx\", connectionString)\n\tif err != nil {\n\t\tpanic(\"Could not open database: \" + err.Error())\n\t}\n\terr = db3.Ping()\n\tif err != nil {\n\t\tpanic(\"Could not ping database \" + dbKey + \":\" + err.Error())\n\t}\n\n\tm := DB{\n\t\tDbHelper: sql2.NewSqlDb(dbKey, db3),\n\t}\n\treturn &m\n}", "title": "" }, { "docid": "1cd83b2353399d8acdcce4351d719d03", "score": "0.60704756", "text": "func NewConnection(db *sql.DB) *Connection {\n\treturn &Connection{\n\t\tdb: db,\n\t\ttablesEngine: \"InnoDB\",\n\t}\n}", "title": "" }, { "docid": "ff8b49d8cf44493e8ceb323867208de1", "score": "0.6067012", "text": "func New(ip, port, dbName, collectionName string) *DB {\n\treturn &DB{\n\t\tserver: ip + \":\" + port,\n\t\tdbName: dbName,\n\t\tcollectionName: collectionName,\n\t}\n}", "title": "" }, { "docid": "f8364d4214fcb9bcba725910e02d9a83", "score": "0.6066776", "text": "func dbConnect() *sql.DB {\n\tdbHost := getEnv(\"DB_HOST\", \"localhost\")\n\tdbDb := getEnv(\"DB_DB\", \"app\")\n\tdbUser := getEnv(\"DB_USER\", \"root\")\n\tdbPass := getEnv(\"DB_PASS\", \"root\")\n\tdbMode := getEnv(\"DB_MODE\", \"disable\")\n\n\tconnStr := fmt.Sprintf(\"postgres://%s:%s@%s/%s?sslmode=%s\", dbUser, dbPass, dbHost, dbDb, dbMode)\n\tdb, err := sql.Open(\"postgres\", connStr)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn db\n}", "title": "" }, { "docid": "2627d8ec98a8d17e0e139c16126226b6", "score": "0.606631", "text": "func NewConnection(baseUri string) (c *Connection, err error) {\n\n\turi := fmt.Sprintf(\"%v/db/data/\", baseUri) // WARNING: stupid, but trailing '/' is req with neo4j\n\n\tc = &Connection{httpClient: &http.Client{}, Uri: uri}\n\terr = c.connect(uri)\n\n\treturn\n}", "title": "" }, { "docid": "f305433f93b28197008c1ab01e9e886f", "score": "0.60653466", "text": "func Connect() *gorm.DB {\n\tvar sslmode string\n\tswitch os.Getenv(\"API_ENV\") {\n\tcase \"dev\":\n\t\tsslmode = \"disable\"\n\t\tbreak\n\tcase \"test\":\n\t\tsslmode = \"disable\"\n\t\tbreak\n\tdefault:\n\t\tsslmode = \"require\"\n\t}\n\n\tDb, err = gorm.Open(\"postgres\", fmt.Sprintf(\"host=%s port=%v user=%s dbname=%s password=%s sslmode=%s\",\n\t\tos.Getenv(\"POSTGRES_HOST\"),\n\t\tos.Getenv(\"POSTGRES_PORT\"),\n\t\tos.Getenv(\"POSTGRES_USER\"),\n\t\tos.Getenv(\"POSTGRES_DB\"),\n\t\tos.Getenv(\"POSTGRES_PASSWORD\"),\n\t\tsslmode,\n\t))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif os.Getenv(\"API_ENV\") == \"dev\" {\n\t\tDb.LogMode(true)\n\t}\n\n\treturn Db\n}", "title": "" }, { "docid": "ccbbf7e924655a82da968567935e9ca6", "score": "0.60641295", "text": "func newMysqlConnection() *prom.SqlConnect {\n\t// read from config or use default value\n\tdriver := \"mysql\"\n\ttimeoutMs := goapi.AppConfig.GetInt32(\"dao$boname__lower$.mysql.timeout\", 10000)\n\ttimezone := goapi.AppConfig.GetString(\"dao$boname__lower$.mysql.timezone\", \"Asia/Ho_Chi_Minh\")\n\tdsn := goapi.AppConfig.GetString(\"dao$boname__lower$.mysql.dsn\",\n\t\t\"test:test@tcp(localhost:3306)/test?charset=utf8mb4,utf8&parseTime=true&loc=\"+strings.Replace(timezone, \"/\", \"%2f\", -1))\n\tif sqlConnect, err := prom.NewSqlConnectWithFlavor(driver, dsn, int(timeoutMs), nil, prom.FlavorMySql); err != nil {\n\t\tpanic(err)\n\t} else if sqlConnect == nil {\n\t\tpanic(\"error creating [prom.SqlConnect] instance\")\n\t} else {\n\t\tloc, _ := time.LoadLocation(timezone)\n\t\tsqlConnect.SetLocation(loc)\n\t\treturn sqlConnect\n\t}\n}", "title": "" } ]
c5931b4549d3622a4b2e6f56d7ae0229
The parts of the JSON to match against using the `matchPattern`. Valid values are `ALL`, `KEY` and `VALUE`.
[ { "docid": "c7cf77c6c5dbb23828c88f55e4ff8384", "score": "0.0", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchScope() pulumi.StringOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBody) string {\n\t\treturn v.MatchScope\n\t}).(pulumi.StringOutput)\n}", "title": "" } ]
[ { "docid": "2190fc61fc7a1d89dcb462fe4b95d48b", "score": "0.5700485", "text": "func (o *ObjectURL) Match(key string) bool {\n\tif !o.filterRegex.MatchString(key) {\n\t\treturn false\n\t}\n\n\tisBatch := o.filter != \"\"\n\tif isBatch {\n\t\tv := parseBatch(o.Prefix, key)\n\t\to.relativePath = v\n\t\treturn true\n\t}\n\n\tv := parseNonBatch(o.Prefix, key)\n\to.relativePath = v\n\treturn true\n}", "title": "" }, { "docid": "4182fe92066adf3d48d16184477449dd", "score": "0.5631027", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "9ae292ac70f7266f983f3ba23811be0f", "score": "0.56297404", "text": "func ResponseJsonFieldPattern(field string, pattern string) TestOption {\n\treturn responseAssertion(func(t *testing.T, rr *httptest.ResponseRecorder) {\n\t\tresponseBody := rr.Body.Bytes()\n\n\t\tvar response map[string]interface{}\n\t\tif err := json.Unmarshal(responseBody, &response); err != nil {\n\t\t\tt.Errorf(\"Could not JSON parse response body: received\\n\\n%v\", rr.Body)\n\t\t}\n\n\t\tif actual, ok := response[field].(string); ok {\n\n\t\t\tif ok, _ := regexp.MatchString(pattern, actual); !ok {\n\t\t\t\tt.Errorf(\"Unexpected JSON field value for '%s': received '%s' expected pattern %s\", field, actual, pattern)\n\t\t\t}\n\t\t} else {\n\t\t\tt.Errorf(\"Unexepected missing or non-string JSON field value for '%s'\", field)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "18bb52b90c732c1db08e10a30c85bf56", "score": "0.5591453", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "876f496b05f86b673ffc3adc1aae52f8", "score": "0.55885994", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "02c43b1d853c12ddcac27c18a060bdb6", "score": "0.557995", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "48424bc6b951ed01511cbf6ff6064e39", "score": "0.55781", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "5bb1601d08451b1abfc16a4201db3fa2", "score": "0.55743796", "text": "func (p *JsonPairs) match(k string) string {\n\tfor _, j := range *p {\n\t\tif j.K == k {\n\t\t\treturn j.V\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "b5ccc969c78b09f956c44228d0762549", "score": "0.5571436", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "1824dc466e2d97685bef9dd6c88bf57e", "score": "0.55670476", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "b5e6e084a7ae46ff2c05b24197dd9c7f", "score": "0.55607307", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "41896d974a94e4f60642a8bea5631dff", "score": "0.5548011", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "a80b07cbcd381be81e54024c2230f8d3", "score": "0.5547495", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "d0514e39f7ab8c50e59ce54970811f97", "score": "0.554732", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "df7315accdca6223ccd658ca6764091c", "score": "0.5546193", "text": "func (JsonMatchScope) Values() []JsonMatchScope {\n\treturn []JsonMatchScope{\n\t\t\"ALL\",\n\t\t\"KEY\",\n\t\t\"VALUE\",\n\t}\n}", "title": "" }, { "docid": "22f8e087fd095b5c41e825b7e7c3bb04", "score": "0.5541401", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "e23983b1f4cbbae66282d51583f90167", "score": "0.5539657", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "e878a39bc0b39e3a313fcecaa70842f9", "score": "0.5537766", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "20ab8550a6254ffc606275ee1b3d9b64", "score": "0.55367744", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "929cc07d794927cbcbf66cc9255e6e94", "score": "0.553582", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "95e230bcb2bcf30486b08413f6d479a1", "score": "0.5531767", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "956118b2cb7c3eac9223185bb9e7cacf", "score": "0.5531339", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "4e9bd9ab1d282b94ef2a842ec5f3033f", "score": "0.55285335", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "9d78b210c793ad28da4128a35a4c5908", "score": "0.55279464", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "2d72ffa3e4cdc88d6363abcc0439082e", "score": "0.5526567", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "ccb9443d5691c8e6fc35edf390b52f2e", "score": "0.5524697", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "ab5a898502a12bffa2419bcff87015fd", "score": "0.5518202", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "f6fa46fe4275f24c21cb763f28b8e83e", "score": "0.55119896", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "ba30954cac964e81f5a1ea39cd3854d7", "score": "0.551077", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "48ca7f295a34bf68e7ca791b0d511950", "score": "0.55100167", "text": "func (o RuleGroupRuleStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() RuleGroupRuleStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v RuleGroupRuleStatementXssMatchStatementFieldToMatchJsonBody) RuleGroupRuleStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(RuleGroupRuleStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "1a47fca11873b38d25d7564e7d10dcdd", "score": "0.5507707", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "6f0646abf2fcfb522a8a144f2f9583ed", "score": "0.5501766", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "6e17e7360ea22e14e406b5689ce7cf63", "score": "0.5499632", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "063c5b31b78d8adaca18bf832975be7f", "score": "0.5489927", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "b9a598445113365d88ac931329d3e28e", "score": "0.5480689", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "f8beea340ec335e58b57c9eec62824d2", "score": "0.5474711", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "43d6f0c27a693947e223b7c369cf1b82", "score": "0.54666764", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "70ae73501c456d6dbbc4e3733cfa99fd", "score": "0.5454633", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "427a94980475fca3bf62f41123e24dc4", "score": "0.54456264", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "971251af81e2bec46277fd1eef75b24d", "score": "0.54440665", "text": "func (o WebAclRuleStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "d44f57e365ae29e56dadc87e01adbe63", "score": "0.54420346", "text": "func (o WebAclRuleStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "a1ad2e2da49c86f1b72cc8693328f1b7", "score": "0.54410183", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "eaec3f19770404e9f5bd90d27f959c6a", "score": "0.54390746", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "528fbd47e27083e3f62869854f196940", "score": "0.54381543", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "e485b4f6feaaad971313b3b02a1e37e0", "score": "0.54371697", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "45c82d855ba12b9ec6c6c298320e0be5", "score": "0.5436563", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "92d590c2637302c6f9591c0561707725", "score": "0.54354674", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "1dfcea3b8b545871e06a4b41b31fe5f9", "score": "0.542964", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "7d734df816f2b84d32d687682074839d", "score": "0.5426292", "text": "func (o WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "872663b8a4df5b2b34ebbb71ed736340", "score": "0.541872", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "d313c2988c26bcd01abdd4a5de2950f1", "score": "0.5416311", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "aefe1d24c90e6ef5e2ac4290908e55bc", "score": "0.5406928", "text": "func (o WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementAndStatementStatementNotStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "04351a2a6762426f6f2f72d5c5d1690b", "score": "0.5404982", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "bc91413e1b3eb6b9094840b5513eb526", "score": "0.5402766", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "d25669ab70f22986a294a023375deec9", "score": "0.5401481", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "dd483b9251e4f315821ddc627e581779", "score": "0.5385682", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "3f7b9a4b5a229789eea89788ea3de9f1", "score": "0.53853434", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "c66e288b55d20c9b0953446512a4db69", "score": "0.53841585", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "f4d52e0a31285cde051f9c59f3d1aa85", "score": "0.53781205", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "44b471fb8550662d9a671699849b9f86", "score": "0.5377781", "text": "func (o WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "dacfab35f838e9ad3de1fc586cdce7cc", "score": "0.5377117", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "392f445d9200f605ac3d846e9adbdcf6", "score": "0.5376754", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "eff61c0f0b5c2aac7db7e3bafb41ed90", "score": "0.5366262", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "11fa439d55c0fbf66ae027b5bf1e9921", "score": "0.53599817", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "8b890818832bc120eb3cbda8fc6d0202", "score": "0.5358804", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "136f9590a876399c889f5d07ae1f49a6", "score": "0.5357448", "text": "func (o WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "7179d9c4fe6882abc5040e17fbe5a1e9", "score": "0.53480107", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "44d2d8db20db1f983f857c1de95bef82", "score": "0.5345326", "text": "func (o RuleGroupRuleStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() RuleGroupRuleStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v RuleGroupRuleStatementSqliMatchStatementFieldToMatchJsonBody) RuleGroupRuleStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(RuleGroupRuleStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "25f57e9b46a8948a9ef15a1f82034f06", "score": "0.5343793", "text": "func (o WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "ba3d6dbca08369386dad4803b5b64c3e", "score": "0.53389686", "text": "func (o WebAclRuleStatementNotStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementNotStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementNotStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementNotStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementNotStatementStatementAndStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "ca8b95f3d1d9985d72bdf9fc976cd5cb", "score": "0.53147525", "text": "func (o WebAclRuleStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementNotStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "0b2b317751106f298a0caf9a04dfe2eb", "score": "0.5314299", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "f9724c9fe94fa5b3e9aeab137b38b82b", "score": "0.53134054", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementAndStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "a584f12e891358c8ed891399c0e3e0bf", "score": "0.5311009", "text": "func (o WebAclRuleStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "84c6dc47fc4aa8295fb7cdd551d903aa", "score": "0.5300109", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "8d829d2d4697aa9642edb706689268fc", "score": "0.5297546", "text": "func (o WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "79dd087e55e124f373f859f6db03f845", "score": "0.52918166", "text": "func (o BucketLifecycleRuleItemConditionResponseOutput) MatchesPattern() pulumi.StringOutput {\n\treturn o.ApplyT(func(v BucketLifecycleRuleItemConditionResponse) string { return v.MatchesPattern }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "3bb6e0bd2084a91ffdac34446e7d0bbd", "score": "0.5287173", "text": "func (o WebAclRuleStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "6da98fb982a638f186647eddf9f7b17d", "score": "0.52868533", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "baad509e41337b399ba9b03c616cb8e0", "score": "0.5284735", "text": "func (o WebAclRuleStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "442f7db1cc810089b90e3fba57fd05be", "score": "0.5281549", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "df741fe3a7004d4564349eca4abc49d9", "score": "0.52760345", "text": "func (o RuleGroupRuleStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() RuleGroupRuleStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v RuleGroupRuleStatementSizeConstraintStatementFieldToMatchJsonBody) RuleGroupRuleStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(RuleGroupRuleStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "1f9dfa50cce096e2f4f907f6c05b4906", "score": "0.52588934", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "b64c378389f8bb1997601cd6e1d8e808", "score": "0.52546835", "text": "func (o WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "08f692f91fa9a77af8ee982a39f81599", "score": "0.5249274", "text": "func (d *diffEncoderImpl) Matches(examplePatch []byte) error {\n\n\t//We match if the patch has a version string who is an int.\n\n\tvar probeStruct struct {\n\t\tGame []interface{}\n\t}\n\n\tif err := json.Unmarshal(examplePatch, &probeStruct); err != nil {\n\t\treturn errors.New(\"Unmarshal probe for Game as a list failed: \" + err.Error())\n\t}\n\n\treturn nil\n\n}", "title": "" }, { "docid": "cd6616c4528c51272fc8b6c69c64711f", "score": "0.5247331", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementOrStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementOrStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementOrStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementOrStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementOrStatementStatementAndStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "54ae66c4fb6861dcf633ebb3be9407dc", "score": "0.52468497", "text": "func (c *Command) Match(text string) (*proper.Properties, bool) {\n\tif c.expression == nil {\n\t\treturn nil, false\n\t}\n\n\tresult := strings.TrimSpace(c.expression.FindString(text))\n\tif len(result) == 0 {\n\t\treturn nil, false\n\t}\n\n\tparameters := make(map[string]string)\n\tresultTokens := strings.Fields(result)\n\tfor i, resultToken := range resultTokens {\n\t\tcommandToken := c.tokens[i]\n\t\tif !commandToken.IsParameter {\n\t\t\tcontinue\n\t\t}\n\n\t\tparameters[commandToken.Word] = resultToken\n\t}\n\treturn proper.NewProperties(parameters), true\n}", "title": "" }, { "docid": "75b8f79a31c89bc8ceaabddfe606d8fc", "score": "0.5233609", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementSqliMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "a4578d396a8b9e6e3beebe1d84318832", "score": "0.52335733", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "65835e25672040191ebb6352d2cc7ba0", "score": "0.52334577", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "d3fdcb45d422fa6d1d9e18b26148c19c", "score": "0.5232351", "text": "func (a *APIPath) Match(method, path string) (pathVars PathVars, ok bool) {\n\tif method != a.Method {\n\t\treturn\n\t}\n\tif len(path) > 0 && path[0] == '/' {\n\t\tpath = path[1:]\n\t}\n\tparts := strings.Split(path, \"/\")\n\tif len(parts) != len(a.PathParts) {\n\t\treturn\n\t}\n\n\tpathVars = make(map[string]string)\n\tfor i, p := range parts {\n\t\tapiPart := a.PathParts[i]\n\t\tif len(apiPart) > 1 && apiPart[0] == '{' && apiPart[len(apiPart)-1] == '}' {\n\t\t\t// This path part is a path variable\n\t\t\tpathVars[apiPart[1:len(apiPart)-1]] = p\n\t\t} else if p != apiPart {\n\t\t\t// If not a path variable, and they don't match, this path is incorrect\n\t\t\treturn nil, false\n\t\t}\n\t}\n\treturn pathVars, true\n}", "title": "" }, { "docid": "5c30b211aeba46df2a7eb62767b12d75", "score": "0.5214009", "text": "func (o WebAclRuleStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementOrStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "3c6954455389077f0eaac2d6d32fc314", "score": "0.5210586", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "c6e9ffaf0cc2437ab258232c02455387", "score": "0.51896113", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementByteMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "fde2f6269240f75b5ccc0ab3611be8d6", "score": "0.5179743", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "c9916c0de00373e4982a2e34ce8c97f1", "score": "0.5174085", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "5e054ad1559e1bf2a858c05f270aba7e", "score": "0.51726335", "text": "func matchBodyParams(requestObject *runtime.Unknown, endpoint *stats.Endpoint) error {\n\tif requestObject != nil {\n\t\tvar req interface{}\n\t\terr := json.Unmarshal(requestObject.Raw, &req)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tswitch r := req.(type) {\n\t\tcase []interface{}:\n\t\t\tfor _, v := range r {\n\t\t\t\terr = extractBodyParams(v, \"\", endpoint.Params.Body, endpoint.Params.Body.Root)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"Invalid requestObject '%s' for '%s %s'\", err, endpoint.Method, endpoint.Path)\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\terr = extractBodyParams(r, \"\", endpoint.Params.Body, endpoint.Params.Body.Root)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Invalid requestObject '%s' for '%s %s'\", err, endpoint.Method, endpoint.Path)\n\t\t\t}\n\t\t}\n\n\t} else if requestObject != nil {\n\t\tglog.Warningf(\"Request '%s %s' should not contain body params\", endpoint.Method, endpoint.Path)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7e224f42ef6ddddbb0ee296a171ff5c2", "score": "0.51687014", "text": "func divideIntoWhenMatchers(v myjson.Object) (myjson.Object,\n\tmap[string]myjson.ExtRegexp, map[string]myjson.ExtJSONMatcher) {\n\n\tdirect := make(myjson.Object)\n\tregexps := make(map[string]myjson.ExtRegexp)\n\tjsonMatchers := make(map[string]myjson.ExtJSONMatcher)\n\n\tfor name, rawValue := range v {\n\t\tvar normV myjson.Array\n\n\t\tfor _, rV := range ensureJSONArray(rawValue) { // divides normals and regexps\n\t\t\tswitch rV.(type) {\n\t\t\tcase myjson.ExtRegexp:\n\t\t\t\t_rV := rV.(myjson.ExtRegexp)\n\t\t\t\tif _, ok := regexps[name]; !ok { // only first @regexp is effective\n\t\t\t\t\tregexps[name] = _rV\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\tcase myjson.ExtJSONMatcher:\n\t\t\t\t_rV := rV.(myjson.ExtJSONMatcher)\n\t\t\t\tif _, ok := jsonMatchers[name]; !ok { // only first @json is effective\n\t\t\t\t\tjsonMatchers[name] = _rV\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnormV = append(normV, rV)\n\t\t}\n\n\t\tif len(normV) != 0 {\n\t\t\tdirect[name] = normV\n\t\t}\n\t}\n\n\treturn direct, regexps, jsonMatchers\n}", "title": "" }, { "docid": "f8a7459cda61982ddf5950f789d39612", "score": "0.5157039", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "9e6465f06cdc9a0a9989662456add7d2", "score": "0.5143749", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementXssMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementXssMatchStatementFieldToMatchJsonBody) WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementXssMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementXssMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" }, { "docid": "8ce19f9b9dae605c42a89372e83c7430", "score": "0.5139867", "text": "func (o WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) MatchPattern() WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBody) WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPattern {\n\t\treturn v.MatchPattern\n\t}).(WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementOrStatementStatementRegexMatchStatementFieldToMatchJsonBodyMatchPatternOutput)\n}", "title": "" } ]
2fd57d03c7036a6e44484cc8cbba0dd8
next reads the next operation from a SSE stream or block until one comes in.
[ { "docid": "27bf0c45a6e60532ba52bc7f73f6f5a8", "score": "0.6333613", "text": "func (d *decoder) next(op *Operation) (err error) {\n\t// Reset non reusable fields\n\top.Event = \"\"\n\top.Data = nil\n\n\tvar line string\n\tstarted := false\n\n\tfor {\n\t\tif line, err = d.ReadString('\\n'); err != nil {\n\t\t\terr = ErrConnectionClosed\n\t\t\tbreak\n\t\t}\n\t\tif line == \"\\n\" {\n\t\t\tif started {\n\t\t\t\t// Message is complete, send it\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tline = strings.TrimSuffix(line, \"\\n\")\n\t\tif strings.HasPrefix(line, \":\") {\n\t\t\t// Comment, ignore\n\t\t\tcontinue\n\t\t}\n\t\tstarted = true\n\t\tsections := strings.SplitN(line, \":\", 2)\n\t\tfield, value := sections[0], \"\"\n\t\tif len(sections) == 2 {\n\t\t\tvalue = strings.TrimPrefix(sections[1], \" \")\n\t\t}\n\t\tswitch field {\n\t\tcase \"id\":\n\t\t\top.ID = value\n\t\tcase \"event\":\n\t\t\top.Event = value\n\t\tcase \"data\":\n\t\t\t// The oplog does never return data on serveral lines\n\t\t\tif err = json.Unmarshal([]byte(value), &op.Data); err != nil {\n\t\t\t\terr = ErrInvalidEvent\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif err == nil && op.Event == \"\" {\n\t\terr = ErrIncompleteEvent\n\t}\n\tif !op.validate() {\n\t\terr = ErrInvalidEvent\n\t}\n\n\treturn\n}", "title": "" } ]
[ { "docid": "637944abd4656b9c54e55d0176528c90", "score": "0.7499936", "text": "func (eas *execAllStreamReceiver) Next() (IsOp_Operation, error) {\n\tfor {\n\t\tt, err := ReadValue(eas.s, eas.BufferSize)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch t[0] {\n\t\tcase TOp_Kv:\n\t\t\tkey, vr, err := eas.kvStreamReceiver.Next()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn &Op_KeyValue{\n\t\t\t\tKeyValue: &KeyValue{\n\t\t\t\t\tKey: &ValueSize{\n\t\t\t\t\t\tContent: bytes.NewBuffer(key),\n\t\t\t\t\t\tSize: len(key),\n\t\t\t\t\t},\n\t\t\t\t\tValue: &ValueSize{\n\t\t\t\t\t\tContent: vr,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, nil\n\t\tcase TOp_ZAdd:\n\t\t\tzr := &schema.ZAddRequest{}\n\t\t\tzaddm, err := ReadValue(eas.s, eas.BufferSize)\n\t\t\terr = proto.Unmarshal(zaddm, zr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.New(ErrUnableToReassembleExecAllMessage)\n\t\t\t}\n\t\t\treturn &Op_ZAdd{\n\t\t\t\tZAdd: zr,\n\t\t\t}, nil\n\t\tcase TOp_Ref:\n\t\t\treturn nil, errors.New(ErrRefOptNotImplemented)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "40e1802fe71e39d2ef7a3374d18d752c", "score": "0.6305768", "text": "func next(s streams.Stream) (streams.Stream, changes.Change) {\n\tnext, c := s.Next()\n\n\tfor next == nil {\n\t\tmust(s.Pull())\n\t\tnext, c = s.Next()\n\t}\n\treturn next, c\n}", "title": "" }, { "docid": "f304fd74f27e8e5e85bf95660bca8fa5", "score": "0.5872333", "text": "func (t *streamImpl) Next() bool {\n\tif t.finished {\n\t\treturn false\n\t}\n\tif !t.confirmed {\n\t\treturn true\n\t}\n\tif t.src.Next() {\n\t\tt.cur.File = t.src.File()\n\t\tt.cur.Value = t.src.Val()\n\t\tt.cur.Lin = t.src.Line()\n\t\tt.confirmed = false\n\t\treturn true\n\t}\n\tt.finished = true\n\treturn false\n}", "title": "" }, { "docid": "c86bf1ba4e7b761358fe3e381c4519d2", "score": "0.5807421", "text": "func (i *Inbox) Next(ctx context.Context) coldata.Batch {\n\tif i.done {\n\t\treturn coldata.ZeroBatch\n\t}\n\n\tctx = logtags.AddTag(ctx, \"streamID\", i.streamID)\n\n\tdefer func() {\n\t\t// Catch any panics that occur and close the errCh in order to not leak the\n\t\t// goroutine listening for context cancellation. errCh must still be closed\n\t\t// during normal termination.\n\t\tif err := recover(); err != nil {\n\t\t\ti.close()\n\t\t\tcolexecerror.InternalError(logcrash.PanicAsError(0, err))\n\t\t}\n\t}()\n\n\t// NOTE: It is very important to close i.errCh only when execution terminates\n\t// ungracefully or when DrainMeta has been called (which indicates a graceful\n\t// termination). DrainMeta will use the stream to read any remaining metadata\n\t// after Next returns a zero-length batch during normal execution.\n\tif err := i.maybeInit(ctx); err != nil {\n\t\t// An error occurred while initializing the Inbox and is likely caused by\n\t\t// the connection issues. It is expected that such an error can occur.\n\t\tcolexecerror.ExpectedError(err)\n\t}\n\n\ti.deserializationStopWatch.Start()\n\tdefer i.deserializationStopWatch.Stop()\n\tfor {\n\t\ti.deserializationStopWatch.Stop()\n\t\tm, err := i.stream.Recv()\n\t\ti.deserializationStopWatch.Start()\n\t\tatomic.AddInt64(&i.statsAtomics.numMessages, 1)\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\t// Done.\n\t\t\t\ti.close()\n\t\t\t\treturn coldata.ZeroBatch\n\t\t\t}\n\t\t\t// Note that here err can be stream's context cancellation. If it\n\t\t\t// was caused by the internal cancellation of the parallel\n\t\t\t// unordered synchronizer, it'll get swallowed by the synchronizer\n\t\t\t// goroutine. Regardless of the cause we want to propagate such\n\t\t\t// error in all cases so that the caller could decide on how to\n\t\t\t// handle it.\n\t\t\ti.errCh <- err\n\t\t\tcolexecerror.ExpectedError(err)\n\t\t}\n\t\tif len(m.Data.Metadata) != 0 {\n\t\t\tfor _, rpm := range m.Data.Metadata {\n\t\t\t\tmeta, ok := execinfrapb.RemoteProducerMetaToLocalMeta(ctx, rpm)\n\t\t\t\tif !ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif meta.Err != nil {\n\t\t\t\t\t// If an error was encountered, it needs to be propagated immediately.\n\t\t\t\t\t// All other metadata will simply be buffered and returned in\n\t\t\t\t\t// DrainMeta.\n\t\t\t\t\tcolexecerror.ExpectedError(meta.Err)\n\t\t\t\t}\n\t\t\t\ti.bufferedMeta = append(i.bufferedMeta, meta)\n\t\t\t}\n\t\t\t// Continue until we get the next batch or EOF.\n\t\t\tcontinue\n\t\t}\n\t\tif len(m.Data.RawBytes) == 0 {\n\t\t\t// Protect against Deserialization panics by skipping empty messages.\n\t\t\tcontinue\n\t\t}\n\t\tatomic.AddInt64(&i.statsAtomics.bytesRead, int64(len(m.Data.RawBytes)))\n\t\ti.scratch.data = i.scratch.data[:0]\n\t\tbatchLength, err := i.serializer.Deserialize(&i.scratch.data, m.Data.RawBytes)\n\t\tif err != nil {\n\t\t\tcolexecerror.InternalError(err)\n\t\t}\n\t\t// For now, we don't enforce any footprint-based memory limit.\n\t\t// TODO(yuzefovich): refactor this.\n\t\tconst maxBatchMemSize = math.MaxInt64\n\t\ti.scratch.b, _ = i.allocator.ResetMaybeReallocate(i.typs, i.scratch.b, batchLength, maxBatchMemSize)\n\t\tif err := i.converter.ArrowToBatch(i.scratch.data, batchLength, i.scratch.b); err != nil {\n\t\t\tcolexecerror.InternalError(err)\n\t\t}\n\t\tatomic.AddInt64(&i.statsAtomics.rowsRead, int64(i.scratch.b.Length()))\n\t\treturn i.scratch.b\n\t}\n}", "title": "" }, { "docid": "9a587a8e992f6ca81ce979a52f170165", "score": "0.5690421", "text": "func (s *Simulator) Next() {\n\tblockCreated := false\n\n\tfor _, op := range s.operations {\n\t\topReport := op.Exec(s, s.prevBlockTime)\n\t\tif msg := opReport.String(); msg != \"\" {\n\t\t\tif opReport.Executed {\n\t\t\t\ts.logger.Info(msg)\n\t\t\t} else {\n\t\t\t\ts.logger.Error(msg)\n\t\t\t}\n\t\t}\n\n\t\tif opReport.Executed {\n\t\t\tblockCreated = true\n\t\t}\n\t}\n\n\tif !blockCreated {\n\t\ts.beginBlock()\n\t\ts.endBlock()\n\t}\n\n\ts.defferQueue.Exec(s.prevBlockTime)\n}", "title": "" }, { "docid": "dd80e6dbf9ebe9f3db59e5b49ac036ae", "score": "0.5621691", "text": "func (it *OperationIterator) Next() (*longrunningpb.Operation, error) {\n\tvar item *longrunningpb.Operation\n\tif err := it.nextFunc(); err != nil {\n\t\treturn item, err\n\t}\n\titem = it.items[0]\n\tit.items = it.items[1:]\n\treturn item, nil\n}", "title": "" }, { "docid": "2fc0718168182cdf7f90973558365e58", "score": "0.5616939", "text": "func (s *Stream) Next() (*Tweet, error) {\n\n\t// simulate delay\n\ttime.Sleep(320 * time.Millisecond)\n\tif s.pos >= len(s.tweets) {\n\t\treturn &Tweet{}, ErrEOF\n\t}\n\n\ttweet := s.tweets[s.pos]\n\ts.pos++\n\n\treturn &tweet, nil\n}", "title": "" }, { "docid": "0b907cc3a2bef28b997207b29171818d", "score": "0.5614909", "text": "func (s *ChangeStream) Next() (ChangeList, error) {\n\tvar cl ChangeList\n\treturn cl, s.conn.Recv(&cl)\n}", "title": "" }, { "docid": "edb7e0e1f77ce909e9d180e1959018e8", "score": "0.55711854", "text": "func (s *Subscriber) Next() *ops.PushedMessage {\n\ts.bufferLock.Lock()\n\tdefer s.bufferLock.Unlock()\n\n\tif len(s.buffer) == 0 {\n\t\treturn nil\n\t}\n\n\tmsg := s.buffer[0]\n\n\tlen := len(s.buffer)\n\tcopy(s.buffer[:], s.buffer[1:])\n\ts.buffer[len-1] = nil\n\ts.buffer = s.buffer[:len-1]\n\n\treturn msg\n}", "title": "" }, { "docid": "57f476321b36d45d689b43f82c72e396", "score": "0.5557876", "text": "func (m *machine) Next() error {\n\tif m.p == m.pe && m.pe == m.eof {\n\t\treturn EOF\n\t}\n\n\tm.key = nil\n\tm.beginMetric = false\n\tm.finishMetric = false\n\n\treturn m.exec()\n}", "title": "" }, { "docid": "f70df592205f2c9ff256e02ec0b6c43e", "score": "0.5498427", "text": "func (d *Decoder) next() error {\nLoopEvt:\n\tfor {\n\t\ttok, err := d.dec.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tswitch tt := tok.(type) {\n\t\tcase xml.Comment:\n\t\t\t// skip\n\t\tcase xml.CharData:\n\t\t\t// skip\n\t\tcase xml.StartElement:\n\t\t\tswitch tt.Name.Local {\n\t\t\tcase \"event\":\n\t\t\t\td.evt = tt\n\t\t\t\tbreak LoopEvt\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c9dfd70252ed6488078b23b5daad427b", "score": "0.5390192", "text": "func (iter *iteratorSingle) Next() error {\n\terr := iter.sc.Next()\n\tif err != nil {\n\t\titer.op = 0\n\t\titer.k = nil\n\t\titer.v = nil\n\n\t\t// we DO want to return ErrIteratorDone here\n\t\treturn err\n\t}\n\n\titer.op, iter.k, iter.v = iter.sc.Current()\n\tif iter.op != OperationDel ||\n\t\titer.iteratorOptions.IncludeDeletions {\n\t\treturn nil\n\t}\n\n\treturn iter.Next()\n}", "title": "" }, { "docid": "b56f6b3609106828f4cf8e1b28e6677f", "score": "0.53742427", "text": "func (r *LSPRunner) readNext() ([]byte, error) {\n\tempty := EmptyMsg()\n\n\t// if already in incoming data, return it\n\tif r.incomingData.Contains(r.nextRead) {\n\t\tmsg, err := r.incomingData.Poll(r.nextRead)\n\t\tr.nextRead++\n\t\treturn msg.Payload, err\n\t}\n\n\tfor {\n\t\tmsg, err := r.rw.Read()\n\n\t\t// runner closed -> rw closed -> non-nil error\n\t\t// rw is closed either due to epoch timeout, or due to an explicit close()\n\t\tif err != nil {\n\t\t\treturn empty, err\n\t\t}\n\n\t\tif !r.keepEpochAlive(msg) { // we received data, so keep epoch alive\n\t\t\t// if keepEpochAlive() returns false, runner is in the post-stop stage,\n\t\t\t// then notify msgArrival channel used in post-stop stage\n\t\t\tr.notifyMsgArrival(msg)\n\t\t}\n\n\t\tif IsAck(msg) {\n\t\t\t// corner case. ignore it.\n\t\t\tif msg.SeqNum == 0 {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tr.receiveAck(msg)\n\t\t\t}\n\t\t} else if IsData(msg) {\n\t\t\t// the received data is what we want (i.e., it has 'nextRead' seqNum)\n\t\t\tif payload, err := r.receiveData(msg); err == nil {\n\t\t\t\treturn payload, nil\n\t\t\t} // otherwise continue reading the next message\n\t\t} else {\n\t\t\treturn empty, fmt.Errorf(\"only ack or data message is allowed\") // should never happen\n\t\t}\n\t}\n\n\treturn empty, fmt.Errorf(\"reading from closed LSPRunner\")\n}", "title": "" }, { "docid": "bdd6bbcb55126cf1acea63be87611151", "score": "0.53411573", "text": "func (s *lexStream) next() byte {\r\n\tret := s.peek()\r\n\ts.c++\r\n\tif ret == '\\n' {\r\n\t\ts.pos[len(s.pos)-1].line++\r\n\t}\r\n\treturn ret\r\n}", "title": "" }, { "docid": "0193a0a422cd552c7d9faa6f2ec00232", "score": "0.53409904", "text": "func (q *SimpleQueueBalancer) Next() (*mmg.FnMetadata, error) {\n\tq.Lock()\n\tnextStr := q.nextStrConnection\n\tq.Unlock()\n\n\tnext := mmg.FnMetadata{}\n\n\tif nextStr != \"\" {\n\t\tnext.Metadata = nextStr\n\t} else {\n\t\tq.Lock()\n\t\tif v := q.Clients.GetClientLessOverHeadClient(q.QName); v != nil {\n\t\t\tq.nextStrConnection = v.GetStrConnection()\n\t\t\tnext.Metadata = q.nextStrConnection\n\t\t}\n\t\tq.Unlock()\n\t}\n\treturn &next, nil\n}", "title": "" }, { "docid": "6ce227ba8bd80d555eb8eacded9a61c6", "score": "0.53260034", "text": "func (p *Parser) Next() (*agentmon.Measurement, bool) {\n\tbuf := p.buffer\n\n\tfor {\n\t\tline, rest := p.lineFrom(buf)\n\n\t\tif line != nil {\n\t\t\tp.buffer = rest\n\t\t\tm, _ := p.parseLine(line)\n\t\t\treturn m, true\n\t\t}\n\n\t\tif p.done {\n\t\t\tm, _ := p.parseLine(rest)\n\t\t\treturn m, false\n\t\t}\n\n\t\tidx := len(buf)\n\t\tend := idx\n\t\tend += p.maxReadSize\n\n\t\tif cap(buf) >= end {\n\t\t\tbuf = buf[:end]\n\t\t} else {\n\t\t\ttmp := buf\n\t\t\tbuf = make([]byte, end)\n\t\t\tcopy(buf, tmp)\n\t\t}\n\n\t\tn, err := p.reader.Read(buf[idx:])\n\t\tbuf = buf[:idx+n]\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\tlog.Printf(\"next: read: %s\", err)\n\t\t\t}\n\n\t\t\tp.done = true\n\n\t\t\tline, rest = p.lineFrom(buf)\n\t\t\tif line != nil {\n\t\t\t\tp.buffer = rest\n\t\t\t\tm, _ := p.parseLine(line)\n\t\t\t\treturn m, len(rest) > 0\n\t\t\t}\n\n\t\t\tif len(rest) > 0 {\n\t\t\t\tm, _ := p.parseLine(line)\n\t\t\t\treturn m, false\n\t\t\t}\n\n\t\t\treturn nil, false\n\t\t}\n\t}\n}", "title": "" }, { "docid": "de3898e6793a1d8e1513db89055d5a3d", "score": "0.53125066", "text": "func (a *Osc) Next() float32 {\n\tdefer a.Advance(1)\n\treturn a.Func(a.Voltage())\n}", "title": "" }, { "docid": "7fc792cfb770f8754163e5ebf9fb7b42", "score": "0.530416", "text": "func (r *RingReader) Next(ctx context.Context) *v1.Event {\n\tif r.c == nil {\n\t\tr.c = r.ring.readFrom(r.stop, r.idx)\n\t}\n\tselect {\n\tcase e := <-r.c:\n\t\tr.idx++\n\t\treturn e\n\tcase <-ctx.Done():\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "5cb858c0a33c73ac0513809537e948e4", "score": "0.5269154", "text": "func (self *commonZmqIterator) Next() bool {\n\terr := self.fetchNext()\n\tif err != nil {\n\t\tself.err = err\n\t\treturn false\n\t}\n\n\tif len(self.data) == 0 {\n\t\treturn false\n\t}\n\n\t// Pop and shift\n\tself.current, self.data = self.data[0], self.data[1:]\n\n\treturn true\n}", "title": "" }, { "docid": "b09dcc66f04c1d75b2c4107e6f92adf9", "score": "0.52505064", "text": "func (copy *urlCopy) next() *messages.Transfer {\n\tcopy.mutex.Lock()\n\tdefer copy.mutex.Unlock()\n\n\tif copy.transferIndex < len(copy.batch.Transfers) {\n\t\ttransfer := copy.batch.Transfers[copy.transferIndex]\n\t\tcopy.transferIndex++\n\t\treturn transfer\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9eba0c890e53e577bc7bc28ce6268f7b", "score": "0.5247442", "text": "func (us *UnionScanExec) Next(ctx context.Context, req *chunk.Chunk) error {\n\treq.GrowAndReset(us.maxChunkSize)\n\tmutableRow := chunk.MutRowFromTypes(retTypes(us))\n\tfor i, batchSize := 0, req.Capacity(); i < batchSize; i++ {\n\t\trow, err := us.getOneRow(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// no more data.\n\t\tif row == nil {\n\t\t\treturn nil\n\t\t}\n\t\tmutableRow.SetDatums(row...)\n\t\treq.AppendRow(mutableRow.ToRow())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3f47887cb58717eb6457c56712d6ee33", "score": "0.5233642", "text": "func (s *Source) stream(buffer al.Buffer) int {\n\tdecoded := s.decoder.Decode() //get more data\n\tif decoded > 0 {\n\t\tbuffer.BufferData(s.decoder.Format, s.decoder.Buffer, s.decoder.SampleRate)\n\t}\n\tif s.decoder.IsFinished() && s.IsLooping() {\n\t\ts.Rewind()\n\t}\n\treturn decoded\n}", "title": "" }, { "docid": "d0802947972dc7adcf7ab8fc1b551112", "score": "0.5220825", "text": "func (s SourceMap) Next(rt *rtpb.ReadToken, lastRow *mutator.LogMessage) *rtpb.ReadToken {\n\tif lastRow != nil {\n\t\t// There are more items in this shard.\n\t\treturn &rtpb.ReadToken{\n\t\t\tShardId: rt.ShardId,\n\t\t\tLowWatermark: lastRow.ID,\n\t\t}\n\t}\n\n\t// Advance to the next shard.\n\tnextShard, ok := s.NextShard(rt.ShardId)\n\tif !ok {\n\t\treturn &rtpb.ReadToken{} // Encodes to \"\"\n\t}\n\treturn &rtpb.ReadToken{\n\t\tShardId: nextShard,\n\t\tLowWatermark: s[nextShard].LowestWatermark,\n\t}\n}", "title": "" }, { "docid": "173f328d32aaa22497079dd67927d696", "score": "0.5214036", "text": "func (iter *Iterator) Next() {\n\n}", "title": "" }, { "docid": "d9eaa19dab992aa199ab7518f74735d8", "score": "0.5211548", "text": "func (rdr *Reader) Next() (*Event, error) {\n\treturn rdr.readFromBucket(true)\n}", "title": "" }, { "docid": "3614af4b60c3980ed532bc57fda70fd1", "score": "0.52048606", "text": "func (src *GCSSource) Next(ctx context.Context) (Runnable, error) {\n\tselect {\n\t// This allows exit if pendingChan is blocking.\n\tcase <-ctx.Done():\n\t\treturn nil, ctx.Err()\n\tcase next, ok := <-src.pendingChan:\n\t\t// This ensures that context expirations and errors are respected.\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tlog.Println(\"Context expired in Next\")\n\t\t\tmetrics.ActiveErrors.WithLabelValues(src.Label(), \"context expired in Next\").Inc()\n\t\t\treturn nil, ctx.Err()\n\t\tcase <-src.ctx.Done():\n\t\t\tlog.Println(src.ctx.Err())\n\t\t\treturn nil, src.ctx.Err()\n\t\tdefault:\n\t\t\tif ok {\n\t\t\t\treturn next, nil\n\t\t\t}\n\t\t\tdebug.Println(\"iterator.Done\")\n\t\t\treturn nil, iterator.Done\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ead69342a3bfc6cddac9ee16f5ac703d", "score": "0.5195334", "text": "func (r *Result) NextStreamSet(ctx context.Context) bool {\n\tif r.inactive() || r.setCh == nil {\n\t\treturn false\n\t}\n\tselect {\n\tcase s, ok := <-r.setCh:\n\t\tif !ok {\n\t\t\tr.err = *r.setChErr\n\t\t\treturn false\n\t\t}\n\t\tresult.Reset(&r.Scanner, s)\n\t\treturn true\n\n\tcase <-ctx.Done():\n\t\tif r.err == nil {\n\t\t\tr.err = ctx.Err()\n\t\t}\n\t\tresult.Reset(&r.Scanner, nil)\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "d1eff942a0b31217aabc70e8a386c019", "score": "0.517837", "text": "func (c *client) RequestSSEGet(ctx context.Context, path string, evCh chan<- SSEvent, mods ...RequestModifier) error {\n\tlabels := pprof.Labels(\"user-agent\", c.config.userAgent, \"path\", path, \"method\", \"GET\")\n\tctx = pprof.WithLabels(ctx, labels)\n\tpprof.SetGoroutineLabels(ctx)\n\n\turi := c.config.Host + path\n\tif strings.HasPrefix(path, \"http\") {\n\t\turi = path\n\t}\n\n\treq, err := http.NewRequest(http.MethodGet, uri, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor i := range mods {\n\t\tif mods[i] != nil {\n\t\t\tmods[i](req)\n\t\t}\n\t}\n\n\treq.Header.Set(\"Accept\", \"text/event-stream\")\n\treq.Header.Set(\"User-Agent\", c.config.userAgent)\n\treq.Header.Set(\"Connection\", \"close\")\n\treq.Header.Add(RequestedWithHeader, RequestedWithValue)\n\tif c.name != \"\" {\n\t\treq.Header.Add(RequestedNameHeader, c.name)\n\t}\n\tif c.isProvider {\n\t\treq.Header.Add(\"X-Provider-Name\", c.config.User)\n\t\treq.Header.Add(\"X-Provider-Token\", c.config.Token)\n\t}\n\n\tif c.config.Hash != \"\" {\n\t\tbasedHash := base64.StdEncoding.EncodeToString([]byte(c.config.Hash))\n\t\treq.Header.Set(AuthHeader, basedHash)\n\t}\n\tif c.config.User != \"\" && c.config.Token != \"\" {\n\t\treq.Header.Add(SessionTokenHeader, c.config.Token)\n\t\treq.SetBasicAuth(c.config.User, c.config.Token)\n\t}\n\n\tresp, err := c.HTTPSSEClient.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbr := bufio.NewReader(resp.Body)\n\tdefer resp.Body.Close() // nolint\n\n\tdelim := []byte{':', ' '}\n\n\tvar currEvent *SSEvent\n\tvar EOF bool\n\n\tfor !EOF {\n\t\tif ctx.Err() != nil {\n\t\t\treturn ctx.Err()\n\t\t}\n\n\t\tbs, err := br.ReadBytes('\\n')\n\n\t\tif err != nil {\n\t\t\tswitch err {\n\t\t\tcase io.EOF, io.ErrUnexpectedEOF, io.ErrClosedPipe:\n\t\t\t\tEOF = true\n\t\t\tdefault:\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif len(bs) < 2 {\n\t\t\tcontinue\n\t\t}\n\n\t\tspl := bytes.SplitN(bs, delim, 2)\n\n\t\tif len(spl) < 2 {\n\t\t\tcontinue\n\t\t}\n\n\t\tcurrEvent = &SSEvent{URI: uri}\n\t\tswitch string(spl[0]) {\n\t\tcase sseEvent:\n\t\t\tcurrEvent.Type = string(bytes.TrimSpace(spl[1]))\n\t\tcase sseData:\n\t\t\tcurrEvent.Data = bytes.NewBuffer(bytes.TrimSpace(spl[1]))\n\t\t\tevCh <- *currEvent\n\t\t}\n\n\t}\n\n\treturn nil\n\n}", "title": "" }, { "docid": "7fda70d973fbbdb84aeb0dbed651d053", "score": "0.5166415", "text": "func (c *FeedClient) Next() (map[string]interface{}, error) {\n\tvar message map[string]interface{}\n\terr := c.conn.ReadJSON(&message)\n\treturn message, err\n}", "title": "" }, { "docid": "4f88eb6d0b7fa87c7058e288b61647a6", "score": "0.51573944", "text": "func (g *Generator) Next() interface{} {\n\treturn <-g.out\n}", "title": "" }, { "docid": "b0f0d38ab584ea99b4912e1cd2c59081", "score": "0.51287264", "text": "func (s *MultiStream) loop() {\n\tdefer s.cleanup()\n\tfor {\n\t\tselect {\n\t\tcase <-s.shutdown: // in case of external shutdown\n\t\t\treturn\n\t\tcase err := <-s.streamer.Err(): // case of error coming from the streamer\n\t\t\ts.onError(err)\n\t\t\treturn\n\t\tcase block := <-s.streamer.Block(): // case a new block was forwarded\n\t\t\ts.onBlock(block)\n\t\tcase header := <-s.streamer.Header(): // case a new header was forwarded\n\t\t\ts.onHeader(header)\n\t\tcase tx := <-s.streamer.Transaction(): // case a new transaction is forwarded\n\t\t\ts.onTransaction(tx)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d2e67f5890bf45dd84495d868fb9db94", "score": "0.5121801", "text": "func (iter *receiveIter) simpleNext(rcb *runtimeControlBlock, state *receiveIterState) (more bool, err error) {\n\tvar res *types.MapValue\n\tvar isDup bool\n\n\tfor {\n\t\tres, err = state.scanner.next()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tif res == nil {\n\t\t\tbreak\n\t\t}\n\n\t\trcb.trace(1, \"receiveIter.simpleNext() : got result %v\", res)\n\n\t\tisDup, err = iter.checkDuplicate(rcb, state, res)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tif isDup {\n\t\t\tcontinue\n\t\t}\n\n\t\trcb.setRegValue(iter.resultReg, res)\n\t\treturn true, nil\n\t}\n\n\trcb.trace(1, \"receiveIter.simpleNext() : no result. Reached limit = %t\", rcb.reachedLimit)\n\n\tif rcb.reachedLimit {\n\t\treturn false, nil\n\t}\n\n\terr = state.done()\n\treturn false, err\n}", "title": "" }, { "docid": "9c742eccb27557417722ec39fed66863", "score": "0.51197624", "text": "func (iter *EncodedObjectSliceIter) Next() (plumbing.EncodedObject, error) {\n\tif len(iter.series) == 0 {\n\t\treturn nil, io.EOF\n\t}\n\n\tobj := iter.series[0]\n\titer.series = iter.series[1:]\n\n\treturn obj, nil\n}", "title": "" }, { "docid": "c62427b65fc59babcc23e7a7070aa9a6", "score": "0.51167464", "text": "func (cc *clientConn) readLoop() {\n\tdefer cc.t.removeClientConn(cc)\n\tdefer close(cc.readerDone)\n\n\tactiveRes := map[uint32]*clientStream{} // keyed by streamID\n\t// Close any response bodies if the server closes prematurely.\n\t// TODO: also do this if we've written the headers but not\n\t// gotten a response yet.\n\tdefer func() {\n\t\terr := cc.readerErr\n\t\tif err == io.EOF {\n\t\t\terr = io.ErrUnexpectedEOF\n\t\t}\n\t\tfor _, cs := range activeRes {\n\t\t\tcs.pw.CloseWithError(err)\n\t\t}\n\t}()\n\n\t// continueStreamID is the stream ID we're waiting for\n\t// continuation frames for.\n\tvar continueStreamID uint32\n\n\tfor {\n\t\tf, err := cc.fr.ReadFrame()\n\t\tif err != nil {\n\t\t\tcc.readerErr = err\n\t\t\treturn\n\t\t}\n\t\tlog.Printf(\"Transport received %v: %#v\", f.Header(), f)\n\n\t\tstreamID := f.Header().StreamID\n\n\t\t_, isContinue := f.(*ContinuationFrame)\n\t\tif isContinue {\n\t\t\tif streamID != continueStreamID {\n\t\t\t\tlog.Printf(\"Protocol violation: got CONTINUATION with id %d; want %d\", streamID, continueStreamID)\n\t\t\t\tcc.readerErr = ConnectionError(ErrCodeProtocol)\n\t\t\t\treturn\n\t\t\t}\n\t\t} else if continueStreamID != 0 {\n\t\t\t// Continue frames need to be adjacent in the stream\n\t\t\t// and we were in the middle of headers.\n\t\t\tlog.Printf(\"Protocol violation: got %T for stream %d, want CONTINUATION for %d\", f, streamID, continueStreamID)\n\t\t\tcc.readerErr = ConnectionError(ErrCodeProtocol)\n\t\t\treturn\n\t\t}\n\n\t\tif streamID%2 == 0 {\n\t\t\t// Ignore streams pushed from the server for now.\n\t\t\t// These always have an even stream id.\n\t\t\tcontinue\n\t\t}\n\t\tstreamEnded := false\n\t\tif ff, ok := f.(streamEnder); ok {\n\t\t\tstreamEnded = ff.StreamEnded()\n\t\t}\n\n\t\tcs := cc.streamByID(streamID, streamEnded)\n\t\tif cs == nil {\n\t\t\tlog.Printf(\"Received frame for untracked stream ID %d\", streamID)\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch f := f.(type) {\n\t\tcase *HeadersFrame:\n\t\t\tcc.nextRes = &http.Response{\n\t\t\t\tProto: \"HTTP/2.0\",\n\t\t\t\tProtoMajor: 2,\n\t\t\t\tHeader: make(http.Header),\n\t\t\t}\n\t\t\tcs.pr, cs.pw = io.Pipe()\n\t\t\tcc.hdec.Write(f.HeaderBlockFragment())\n\t\tcase *ContinuationFrame:\n\t\t\tcc.hdec.Write(f.HeaderBlockFragment())\n\t\tcase *DataFrame:\n\t\t\tlog.Printf(\"DATA: %q\", f.Data())\n\t\t\tcs.pw.Write(f.Data())\n\t\tcase *GoAwayFrame:\n\t\t\tcc.t.removeClientConn(cc)\n\t\t\tif f.ErrCode != 0 {\n\t\t\t\t// TODO: deal with GOAWAY more. particularly the error code\n\t\t\t\tlog.Printf(\"transport got GOAWAY with error code = %v\", f.ErrCode)\n\t\t\t}\n\t\t\tcc.setGoAway(f)\n\t\tdefault:\n\t\t\tlog.Printf(\"Transport: unhandled response frame type %T\", f)\n\t\t}\n\t\theadersEnded := false\n\t\tif he, ok := f.(headersEnder); ok {\n\t\t\theadersEnded = he.HeadersEnded()\n\t\t\tif headersEnded {\n\t\t\t\tcontinueStreamID = 0\n\t\t\t} else {\n\t\t\t\tcontinueStreamID = streamID\n\t\t\t}\n\t\t}\n\n\t\tif streamEnded {\n\t\t\tcs.pw.Close()\n\t\t\tdelete(activeRes, streamID)\n\t\t}\n\t\tif headersEnded {\n\t\t\tif cs == nil {\n\t\t\t\tpanic(\"couldn't find stream\") // TODO be graceful\n\t\t\t}\n\t\t\t// TODO: set the Body to one which notes the\n\t\t\t// Close and also sends the server a\n\t\t\t// RST_STREAM\n\t\t\tcc.nextRes.Body = cs.pr\n\t\t\tres := cc.nextRes\n\t\t\tactiveRes[streamID] = cs\n\t\t\tcs.resc <- resAndError{res: res}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cab444d9221130be4ba3a2056277fc0d", "score": "0.5113777", "text": "func (iter *OperationListIterator) Next() error {\n\treturn iter.NextWithContext(context.Background())\n}", "title": "" }, { "docid": "ce0c57fb8955e7a87914a47561254e81", "score": "0.5111927", "text": "func (o *FeedOperator) Next(context.Context) coldata.Batch {\n\treturn o.batch\n}", "title": "" }, { "docid": "20c6924e72ca05b4779d1d506fd8ae84", "score": "0.509846", "text": "func (obj *ResultSet) Next() interface{} {\n\tif obj.isOpen == false {\n\t\treturn nil\n\t}\n\tif len(obj.resultList) == 0 {\n\t\treturn nil\n\t} else if obj.currPos < (len(obj.resultList)-1) {\n\t\tobj.currPos++\n\t\treturn obj.resultList[obj.currPos]\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e6064ec0f7eede65e7b94bc1d69d2af4", "score": "0.50964963", "text": "func (q *query) next(fn func()) {\n\tselect {\n\tcase <-q.ctx.Done():\n\t\treturn\n\tdefault:\n\t\tfn()\n\t}\n}", "title": "" }, { "docid": "7263534c30812a6fe50502168e85a5ae", "score": "0.509393", "text": "func (s *nosupSource) Next() (string, error) {\n\treturn \"\", ErrNotSupported\n}", "title": "" }, { "docid": "cc0120fbf5f35424c0be066f4336e6f9", "score": "0.50881565", "text": "func (lex *lexer) next() instruction {\n\treturn <-lex.instructions\n}", "title": "" }, { "docid": "7ac5ce6b28ad6926887cc0f5439e989f", "score": "0.5083506", "text": "func (r *RestartableResultReader) Next() (*sqltypes.Result, error) {\n\tresult, err := r.output.Recv()\n\tif err != nil && err != io.EOF {\n\t\tr.logger.Infof(\"tablet=%v table=%v chunk=%v: Failed to read next rows from active streaming query. Trying to restart stream. Original Error: %v\", topoproto.TabletAliasString(r.tablet.Alias), r.td.Name, r.chunk, err)\n\t\t// Restart streaming query.\n\t\t// Note that we intentionally don't reset \"r.conn\" here. This restart\n\t\t// mechanism is only meant to fix transient problems which go away at the\n\t\t// next retry. For example, when MySQL killed the vttablet connection due\n\t\t// to net_write_timeout being reached.\n\t\tif err := r.startStream(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult, err = r.output.Recv()\n\t\tif err == nil || err == io.EOF {\n\t\t\tr.logger.Infof(\"tablet=%v table=%v chunk=%v: Successfully restarted streaming query with query '%v'.\", topoproto.TabletAliasString(r.tablet.Alias), r.td.Name, r.chunk, r.query)\n\t\t} else {\n\t\t\t// We won't retry a second time and fail for good.\n\t\t\t// TODO(mberlin): When we have a chunk pipeline restart mechanism,\n\t\t\t// mention that restart mechanism in the log here.\n\t\t\tr.logger.Infof(\"tablet=%v table=%v chunk=%v: Failed to restart streaming query with query '%v'. Error: %v\", topoproto.TabletAliasString(r.tablet.Alias), r.td.Name, r.chunk, r.query, err)\n\t\t}\n\t}\n\tif result != nil && len(result.Rows) > 0 {\n\t\tr.lastRow = result.Rows[len(result.Rows)-1]\n\t}\n\treturn result, err\n}", "title": "" }, { "docid": "ec165288e2bf3e61378720bbc2e5c9e7", "score": "0.50767434", "text": "func (so *SimpleOperation) NextOperation(sensorName string, elapsedTime time.Time) (time.Duration, float64, error) {\n\n\tif sensorMap, exist := so.Sensors[sensorName]; exist {\n\n\t\tfor _, v := range sensorMap {\n\n\t\t\t// Because we find the first value before an entry we need to fake\n\t\t\t// an entry before the first entry\n\t\t\tdummyTime := new(time.Time).Add(time.Second)\n\t\t\tif elapsedTime.Before(dummyTime) {\n\t\t\t\treturn time.Duration(time.Second), v.Value, nil\n\t\t\t}\n\n\t\t\tif !elapsedTime.After(v.Time) {\n\t\t\t\t// return next time value\n\t\t\t\treturn v.Time.Sub(elapsedTime), v.Value, nil\n\t\t\t}\n\t\t}\n\t\t// no next operation\n\t\treturn 0.0, 0.0, errors.New(errorMessages[E_NO_NEXT_OPERATION])\n\n\t}\n\t// sensor name unknown in recipe\n\terrString := fmt.Sprintf(\"%s : %s \", errorMessages[E_SENSOR_NOT_FOUND], sensorName)\n\treturn 0.0, 0.0, errors.New(errString)\n}", "title": "" }, { "docid": "c800cfbc086fa8ddf764611e5d2533da", "score": "0.50738776", "text": "func ReadNext(byteStream []byte) (*big.Int, int, error) {\n\tfor n := 0; n < len(byteStream); n++ {\n\t\t// if leftmost bit is zero\n\t\tif byteStream[n]&byte(128) == 0 {\n\t\t\tnumber, err := Decode(byteStream[:n+1])\n\t\t\treturn number, n + 1, err\n\t\t}\n\t}\n\treturn nil, -1, xerrors.New(\"exhausted input while searching for end of next zarith number\")\n}", "title": "" }, { "docid": "47035a5294f49b26a8bdb192bdfe1dba", "score": "0.507031", "text": "func (iter *ResponseWithContinuationArtifactSourceIterator) Next() error {\n\treturn iter.NextWithContext(context.Background())\n}", "title": "" }, { "docid": "df6c0c6a21f37455f37bd84ec32e810d", "score": "0.50674623", "text": "func (w *Watcher) Next() (*Position, *Error) {\n\tif w.closed {\n\t\terr := ErrWatcherClosed\n\n\t\treturn nil, &err\n\t}\n\n\tselect {\n\tcase pos := <-w.posChan:\n\t\treturn pos, nil\n\n\tcase err := <-w.errChan:\n\t\treturn nil, &err\n\t}\n}", "title": "" }, { "docid": "8e3cb6c74c82e9c9988108140ea1db81", "score": "0.50649655", "text": "func streamTest() {\n\ttestStream := &IntStream{\n\t\tstack: new(list.List),\n\t\tlastInt: 1,\n\t}\n\tnextNum := testStream.next()\n\tif nextNum != 2 {\n\t\tfmt.Println(\"error from stream.next in streamTest\")\n\t}\n\tcompressedNum := testStream.compressStream()\n\ttestStream.lastInt = 100\n\ttestStream.decompressStream(compressedNum)\n\tif testStream.lastInt != 2 {\n\t\tfmt.Println(\"error from compress/decompress stream in streamTest\")\n\t}\n\ttestStream.put(29)\n\tdata, err := testStream.MarshalBinary()\n\tif err != nil {\n\t\tfmt.Println(\"error from stream.MarshalBinary in streamTest\")\n\t}\n\ttestStream.stack = new(list.List)\n\terr = testStream.UnmarshalBinary(data)\n\tif err != nil {\n\t\tfmt.Println(\"error from stream.UnmarshalBinary in streamTest\")\n\t}\n\tnextNum = testStream.next()\n\tnextNextNum := testStream.next()\n\tif nextNum != 29 || nextNextNum != 3 {\n\t\tfmt.Println(\"error from stream.next after UnmarshalBinary in streamTest\")\n\t}\n\tfmt.Println(\"streamTest passed\")\n}", "title": "" }, { "docid": "e81f903d5523a2f609ff6454cb1dc186", "score": "0.50535315", "text": "func (g *sourceAddrHashEventLoopGroup) next(hashCode int) *eventloop {\n\treturn g.eventLoops[hashCode%g.size]\n}", "title": "" }, { "docid": "6cecee1a1ee7f2fcd16ae2e2103984c0", "score": "0.5047079", "text": "func stream(r io.ReadCloser, outFunc CallbackFunc, c chan error) {\n\ts := bufio.NewScanner(r)\n\tfor s.Scan() {\n\t\tif err := outFunc(s.Text()); err != nil {\n\t\t\tc <- err\n\t\t\treturn\n\t\t}\n\t}\n\tc <- nil\n}", "title": "" }, { "docid": "eaf3b246400bd813ee825a92d97e668f", "score": "0.5044572", "text": "func (s SyncIterator) Next() ([]string, error) {\n\tvar res syncRes\n\tres.Add(1)\n\ts.s.Next(&res)\n\tres.Wait()\n\tif err := AsError(res.r); err != nil {\n\t\tif CollectTrace {\n\t\t\terr = errorx.EnsureStackTrace(err.(*errorx.Error))\n\t\t}\n\t\treturn nil, err\n\t} else if res.r == nil {\n\t\treturn nil, ScanEOF\n\t} else {\n\t\treturn res.r.([]string), nil\n\t}\n}", "title": "" }, { "docid": "1089c5f5b7f8cb3ad8cbb36b1a5829e0", "score": "0.5042268", "text": "func (self *commonRestIterator) Next() bool {\n\terr := self.fetchNext()\n\tif err != nil {\n\t\tself.err = err\n\t\treturn false\n\t}\n\n\tif len(self.data) == 0 {\n\t\treturn false\n\t}\n\n\t// Pop and shift\n\tself.current, self.data = self.data[0], self.data[1:]\n\n\treturn true\n}", "title": "" }, { "docid": "9bfe7482f4d709146ee3bad34a71ee50", "score": "0.5037999", "text": "func (g *leastConnectionsEventLoopGroup) next(_ int) (el *eventloop) {\n\teventLoops := *g\n\tel = eventLoops[0]\n\tleastConnCount := el.loadConnCount()\n\tvar (\n\t\tcurEventLoop *eventloop\n\t\tcurConnCount int32\n\t)\n\tfor _, curEventLoop = range eventLoops[1:] {\n\t\tif curConnCount = curEventLoop.loadConnCount(); curConnCount < leastConnCount {\n\t\t\tleastConnCount = curConnCount\n\t\t\tel = curEventLoop\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "f63fb8d7fc0e8942ea5e7f79c42e4468", "score": "0.50331044", "text": "func (iter *ResponseWithContinuationCostInsightIterator) Next() error {\n\treturn iter.NextWithContext(context.Background())\n}", "title": "" }, { "docid": "88f0b5c351b4b4b4be07f4fd1bd54758", "score": "0.5031132", "text": "func (p *parsr) next() item {\n\tif p.peekCount > 0 {\n\t\tp.peekCount--\n\t} else {\n\t\tp.token[0] = p.lex.nextItem()\n\t}\n\treturn p.token[p.peekCount]\n}", "title": "" }, { "docid": "b952159d8290fa4a5c4272e2380673d4", "score": "0.50161725", "text": "func (s *Scanner) next() {\n\tif s.rdOffset < len(s.src) {\n\t\ts.offset = s.rdOffset\n\t\tr, w := rune(s.src[s.rdOffset]), 1\n\t\tswitch {\n\t\tcase r == 0:\n\t\t\ts.error(\"illegal character NUL\")\n\t\tcase r >= utf8.RuneSelf:\n\t\t\t// not ASCII\n\t\t\tr, w = utf8.DecodeRuneInString(s.src[s.rdOffset:])\n\t\t\tif r == utf8.RuneError && w == 1 {\n\t\t\t\ts.error(\"illegal UTF-8 encoding\")\n\t\t\t} else if r == bom && s.offset > 0 {\n\t\t\t\ts.error(\"illegal byte order mark\")\n\t\t\t}\n\t\t}\n\t\ts.rdOffset += w\n\t\ts.ch = r\n\t} else {\n\t\ts.offset = len(s.src)\n\t\ts.ch = eof\n\t}\n}", "title": "" }, { "docid": "0cf244f096ed2d226486f8d1de42be2a", "score": "0.5010563", "text": "func (t *ExtendedTransformRange) Next() (*datastream.Datapoint, error) {\n\tdp, err := t.Transform.Next()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif dp == nil {\n\t\treturn nil, nil\n\t}\n\t// Convert pipescript datapoint to datastream datapoint\n\treturn &datastream.Datapoint{Timestamp: dp.Timestamp, Data: dp.Data}, nil\n}", "title": "" }, { "docid": "7449e3fd90e31dacb860231a5d7bebe7", "score": "0.49968797", "text": "func (d *QuadDecoder) next() token {\n\tif d.peekCount > 0 {\n\t\td.peekCount--\n\t} else {\n\t\td.tokens[0] = d.l.nextToken()\n\t}\n\n\treturn d.tokens[d.peekCount]\n}", "title": "" }, { "docid": "dbe98f493169d12b15b4f8f108200bfc", "score": "0.4991784", "text": "func (d *Decoder) next() byte {\n\tif d.pos < d.end {\n\t\td.pos++\n\t\tif d.pos < d.end {\n\t\t\treturn d.data[d.pos]\n\t\t}\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "de862a8081f972b47b3d5bee6c59c8dc", "score": "0.4988413", "text": "func (s *SnmpServer) OnGetNext(oid string) *SnmpReply {\n\tlog.Debugf(\"GET NEXT: '%s'\", oid)\n\n\tif handler := s.getStatsHandler(oid); handler != nil {\n\t\treturn handler.GetNext(oid)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e0729878f09e4b12e1d2ab1e40cf65eb", "score": "0.49880108", "text": "func (self *commonZmqIterator) fetchNext() error {\n\tif len(self.data) > 0 {\n\t\treturn nil\n\t}\n\n\tif self.nextPagingControl == nil {\n\t\treturn nil\n\t}\n\n\tif self.err != nil {\n\t\treturn nil\n\t}\n\n\t// Do the ZMQ request\n\tt, requestMsg, responseMsg := self.impl.BuildRequest(self.nextPagingControl, self.sortControl)\n\terr := self.transport.doZmqRequest(t, requestMsg, responseMsg)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\t// Parse out the actual data\n\tself.data, err = self.impl.ParseProto(responseMsg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get the next paging info\n\tpagingResponse := responseMsg.(zmqPagingResponseGetter).GetPaging()\n\tif pagingResponse.Next == \"\" {\n\t\tself.nextPagingControl = nil\n\t} else {\n\t\tself.nextPagingControl = &client_list_control_pb2.ClientPagingControls{\n\t\t\tStart: pagingResponse.Next,\n\t\t\tLimit: self.nextPagingControl.Limit,\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "08b8c3185635581a4214c74e82ffd559", "score": "0.49834096", "text": "func (iter *ResponseWithContinuationCostIterator) Next() error {\n\treturn iter.NextWithContext(context.Background())\n}", "title": "" }, { "docid": "c2bc6d4aec6847e60654df0bc464d37f", "score": "0.4981796", "text": "func (s *nopSource) Next() (string, error) {\n\treturn s.val, nil\n}", "title": "" }, { "docid": "e1652632b4c1640527c7f8de630ebe46", "score": "0.49811542", "text": "func SSEHandler(w http.ResponseWriter, r *http.Request) {\n\tdefer recoverHandler(r)\n\n\tu, _ := url.Parse(r.URL.String())\n\tparams := u.Query()\n\ttoken, topicFN, pulsarURL, subName, subInitPos, subType, err := ConsumerConfigFromHTTPParts(util.AllowedPulsarURLs, &r.Header, mux.Vars(r), params)\n\tif err != nil {\n\t\tutil.ResponseErrorJSON(err, w, http.StatusUnprocessableEntity)\n\t\treturn\n\t}\n\n\t// Make sure that the writer supports flushing.\n\tflusher, ok := w.(http.Flusher)\n\tif !ok {\n\t\thttp.Error(w, \"Streaming unsupported\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"text/event-stream\")\n\tw.Header().Set(\"Cache-Control\", \"no-cache\")\n\tw.Header().Set(\"Connection\", \"keep-alive\")\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\") // allow connection from different domain\n\n\tclient, consumer, err := broker.GetPulsarClientConsumer(pulsarURL, token, topicFN, subName, subType, subInitPos)\n\tif err != nil {\n\t\tutil.ResponseErrorJSON(err, w, http.StatusInternalServerError)\n\t\treturn\n\t}\n\tdefer client.Close()\n\tdefer consumer.Close()\n\tif strings.HasPrefix(subName, model.NonResumable) {\n\t\tdefer consumer.Unsubscribe()\n\t}\n\n\tconsumChan := consumer.Chan()\n\tfor {\n\t\tselect {\n\t\tcase msg := <-consumChan:\n\t\t\t// log.Infof(\"received message %s on topic %s\", string(msg.Payload()), topicFN)\n\t\t\tconsumer.Ack(msg)\n\n\t\t\t// ledgerId, entryId, batchId, partitionIndex, reserved, consumerId\n\t\t\tfmt.Fprintf(w, strings.Replace(fmt.Sprintf(\"id: %v\\n\", msg.Message.ID()), \"&\", \"\", 1))\n\t\t\tfmt.Fprintf(w, \"data: %s\\n\\n\", msg.Payload())\n\t\t\tflusher.Flush()\n\t\tcase <-r.Context().Done():\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d6175bc9700eb633b3e65e77a0b45308", "score": "0.49727046", "text": "func (r *StreamOperator) Exec(drain chan<- error) {\n\tif r.input == nil {\n\t\tdrain <- fmt.Errorf(\"no input channel found\")\n\t\treturn\n\t}\n\n\tgo func() {\n\t\tdefer func() {\n\t\t\tutil.Log(r.log, \"stream operator closing\")\n\t\t\tclose(r.output)\n\t\t}()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase item, opened := <-r.input:\n\t\t\t\tif !opened {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\titemVal := reflect.ValueOf(item)\n\n\t\t\t\tswitch item.(type) {\n\t\t\t\tcase containers.Container:\n\t\t\t\t\titemSet := item.(containers.Container)\n\t\t\t\t\tfor _, subItem := range itemSet.Values() {\n\t\t\t\t\t\tr.output <- subItem\n\t\t\t\t\t}\n\t\t\t\tcase mapset.Set:\n\t\t\t\t\titemSet := item.(mapset.Set)\n\t\t\t\t\tfor subItem := range itemSet.Iter() {\n\t\t\t\t\t\tr.output <- subItem\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\titemType := reflect.TypeOf(item)\n\t\t\t\t\tswitch itemType.Kind() {\n\t\t\t\t\tcase reflect.Array, reflect.Slice:\n\t\t\t\t\t\tfor i := 0; i < itemVal.Len(); i++ {\n\t\t\t\t\t\t\tj := itemVal.Index(i)\n\t\t\t\t\t\t\tr.output <- j.Interface()\n\t\t\t\t\t\t}\n\t\t\t\t\tcase reflect.Map:\n\t\t\t\t\t\tfor _, key := range itemVal.MapKeys() {\n\t\t\t\t\t\t\tval := itemVal.MapIndex(key)\n\t\t\t\t\t\t\tr.output <- tuple.KV{key.Interface(), val.Interface()}\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tr.output <- item\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "f99cf52460f02ec1207189c40dcd7cba", "score": "0.4959211", "text": "func (bic *batchInfoCollector) Next(ctx context.Context) coldata.Batch {\n\tvar batch coldata.Batch\n\tbic.stopwatch.Start()\n\tbatch = bic.Operator.Next(ctx)\n\tbic.stopwatch.Stop()\n\tif batch.Length() > 0 {\n\t\tbic.mu.Lock()\n\t\tbic.mu.numBatches++\n\t\tbic.mu.numTuples += uint64(batch.Length())\n\t\tbic.mu.Unlock()\n\t}\n\treturn batch\n}", "title": "" }, { "docid": "94b36e415a06efc0b01c9649ba571f08", "score": "0.495398", "text": "func (s *remoteScanner) next() (mv *types.MapValue, err error) {\n\tmv = s.nextLocal()\n\tif mv != nil {\n\t\treturn mv, nil\n\t}\n\n\ts.results = nil\n\ts.nextResultPos = 0\n\n\tif !s.moreRemoteResults || s.rcb.reachedLimit {\n\t\treturn nil, nil\n\t}\n\n\terr = s.fetch()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(s.results) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tmv = s.results[s.nextResultPos]\n\ts.nextResultPos++\n\treturn mv, nil\n}", "title": "" }, { "docid": "04b1b733e0b0082e1cdc31ad1fa8558e", "score": "0.4949969", "text": "func (k *Kernel) Next() (string, error) {\n\tk.once.Do(k.init)\n\n\t// Return an error, when the source have been already stopped.\n\tif atomic.LoadInt32(&k.state) == stateStopped {\n\t\treturn \"\", ErrStopped\n\t}\n\n\t// The routines, used to generate UUIDs will be started only when\n\t// the first request will come in.\n\tif atomic.CompareAndSwapInt32(&k.state, stateIdle, stateStarted) {\n\t\tk.start()\n\t}\n\n\tentry := <-k.ids\n\treturn entry.value, entry.err\n}", "title": "" }, { "docid": "a2462bc5c71959b12dbdd37a09670ee2", "score": "0.49470004", "text": "func (d *TSDDecoder) Next() bool {\n\tif d.startTime+d.idx <= d.endTime {\n\t\td.idx++\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6aff14d48003ee48bef9c0763fb33d01", "score": "0.4943634", "text": "func (p *Poller) Next() bool {\n\tselect {\n\tcase mt := <-p.mods:\n\t\tif mt.IsZero() {\n\t\t\treturn false\n\t\t}\n\n\t\treturn true\n\tcase err := <-p.errs:\n\t\tp.last = err\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "de82299e67a35c0835ac4966ac3ecd05", "score": "0.49329922", "text": "func (a *VejstykkeIter) Next() (*Vejstykke, error) {\n\tv, ok := <-a.a\n\tif ok {\n\t\treturn &v, nil\n\t}\n\treturn nil, a.err\n}", "title": "" }, { "docid": "e303fd6cd2c23e260ec12a0feea9dae8", "score": "0.49320596", "text": "func (p *parser) next() {\n\t// nextFromLexer reads the next token from the lexer.\n\tnextFromLexer := func() lexer.Token {\n\t\treturn p.tokens.Next()\n\t}\n\n\t// nextFromLexer reads the next token from the buffer tokens, assuming there are buffered tokens.\n\tnextFromBuffer := func() lexer.Token {\n\t\ttoken := p.bufferedTokens[p.bufferPos]\n\t\tp.bufferPos++\n\t\tp.maybeTrimBuffer()\n\t\treturn token\n\t}\n\n\tfor {\n\t\tvar token lexer.Token\n\n\t\t// When the syntax has ambiguity, we need to process a series of tokens\n\t\t// multiple times. However, a token can only be consumed once from the lexer's\n\t\t// tokens channel. Therefore, in some circumstances, we need to buffer the tokens\n\t\t// from the lexer.\n\t\t//\n\t\t// Buffering tokens allows us to potentially \"replay\" the buffered tokens later,\n\t\t// for example to deal with syntax ambiguity\n\n\t\tif p.buffering {\n\n\t\t\t// If we need to buffer the next token\n\t\t\t// then read the token from the lexer and buffer it.\n\n\t\t\ttoken = nextFromLexer()\n\t\t\tp.bufferedTokens = append(p.bufferedTokens, token)\n\n\t\t} else if p.bufferPos < len(p.bufferedTokens) {\n\n\t\t\t// If we don't need to buffer the next token and there are tokens buffered before,\n\t\t\t// then read the token from the buffer.\n\n\t\t\ttoken = nextFromBuffer()\n\n\t\t} else {\n\t\t\t// Otherwise no need to buffer, and there is no buffered token,\n\t\t\t// then read the next token from the lexer.\n\t\t\ttoken = nextFromLexer()\n\t\t}\n\n\t\tif token.Is(lexer.TokenError) {\n\t\t\t// Report error token as error, skip.\n\t\t\terr := token.Value.(error)\n\t\t\tparseError, ok := err.(ParseError)\n\t\t\tif !ok {\n\t\t\t\tparseError = &SyntaxError{\n\t\t\t\t\tPos: token.StartPos,\n\t\t\t\t\tMessage: err.Error(),\n\t\t\t\t}\n\t\t\t}\n\t\t\tp.report(parseError)\n\t\t\tcontinue\n\t\t}\n\n\t\tp.current = token\n\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "ae5a8499c9eed61414e24f0a15d0a9c9", "score": "0.49308103", "text": "func (s *seriesSample) Next() bool {\n\tif s.offset+1 >= len(s.data) {\n\t\treturn false\n\t}\n\n\ts.offset++\n\n\treturn true\n}", "title": "" }, { "docid": "67cfadf2fdca6d6aab35694fdd270e71", "score": "0.49264333", "text": "func (iter *OperationStatusListIterator) Next() error {\n\treturn iter.NextWithContext(context.Background())\n}", "title": "" }, { "docid": "6f88dcecdf9a1adefc5c91be3fa73a35", "score": "0.49256086", "text": "func next() {\n\tif curElem != nil {\n\t\tcurElem = curElem.Next()\n\t}\n\tstepState()\n}", "title": "" }, { "docid": "f896404e75285bc60443e37327688a3f", "score": "0.49230632", "text": "func StreamLoadSi128(mem_addr *x86.M128i) (dst x86.M128i) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "6e7ad69a50f47d293fa9c30e289e7425", "score": "0.49207783", "text": "func (c *Cursor) Next(result interface{}) bool {\n\tc.mu.Lock()\n\n\t// Load more data if needed\n\tfor c.err == nil {\n\t\t// Check if response is closed/finished\n\t\tif len(c.buffer) == 0 && len(c.responses) == 0 && c.closed {\n\t\t\tc.err = errors.New(\"connection closed, cannot read cursor\")\n\t\t\tc.mu.Unlock()\n\t\t\treturn false\n\t\t}\n\t\tif len(c.buffer) == 0 && len(c.responses) == 0 && c.finished {\n\t\t\tc.mu.Unlock()\n\t\t\treturn false\n\t\t}\n\n\t\t// Start precomputing next batch\n\t\tif len(c.responses) == 1 && !c.finished {\n\t\t\tc.mu.Unlock()\n\t\t\tif err := c.session.asyncContinueQuery(c); err != nil {\n\t\t\t\tc.err = err\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tc.mu.Lock()\n\t\t}\n\n\t\t// If the buffer is empty fetch more results\n\t\tif len(c.buffer) == 0 {\n\t\t\tif len(c.responses) == 0 && !c.finished {\n\t\t\t\tc.mu.Unlock()\n\t\t\t\tif err := c.session.continueQuery(c); err != nil {\n\t\t\t\t\tc.err = err\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tc.mu.Lock()\n\t\t\t}\n\n\t\t\t// Load the new response into the buffer\n\t\t\tif len(c.responses) > 0 {\n\t\t\t\tvar err error\n\t\t\t\tc.buffer = c.responses[0].Responses\n\t\t\t\tif err != nil {\n\t\t\t\t\tc.err = err\n\t\t\t\t\tc.mu.Unlock()\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tc.responses = c.responses[1:]\n\t\t\t}\n\t\t}\n\n\t\t// If the buffer is no longer empty then move on otherwise\n\t\t// try again\n\t\tif len(c.buffer) > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif c.err != nil {\n\t\tc.mu.Unlock()\n\t\treturn false\n\t}\n\n\tvar data interface{}\n\tdata, c.buffer = c.buffer[0], c.buffer[1:]\n\n\tdata, err := recursivelyConvertPseudotype(data, c.opts)\n\tif err != nil {\n\t\tc.err = err\n\t\tc.mu.Unlock()\n\t\treturn false\n\t}\n\n\tc.mu.Unlock()\n\terr = encoding.Decode(result, data)\n\tif err != nil {\n\t\tc.mu.Lock()\n\t\tif c.err == nil {\n\t\t\tc.err = err\n\t\t}\n\t\tc.mu.Unlock()\n\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "8d51290b3f17eab04143cfdd4f6a854b", "score": "0.4908097", "text": "func (iter *OperationsListIterator) Next() error {\n\treturn iter.NextWithContext(context.Background())\n}", "title": "" }, { "docid": "8d51290b3f17eab04143cfdd4f6a854b", "score": "0.4908097", "text": "func (iter *OperationsListIterator) Next() error {\n\treturn iter.NextWithContext(context.Background())\n}", "title": "" }, { "docid": "c54b6ab8f347be076b6b452360c9e329", "score": "0.49066633", "text": "func (iter *ResponseWithContinuationScheduleIterator) Next() error {\n\treturn iter.NextWithContext(context.Background())\n}", "title": "" }, { "docid": "e94f570b2ecb12544f99dc42709eab10", "score": "0.49008724", "text": "func (i *BufioIterator) GetNext() (line []byte, input interface{}, err error) {\n\ti.mu.Lock()\n\tdefer i.mu.Unlock()\n\tline, err = i.reader.ReadBytes('\\n')\n\treturn bytes.TrimRight(line, \"\\n\"), line, err\n}", "title": "" }, { "docid": "802eff0f01dd1ae7cd45d1795924297a", "score": "0.49008098", "text": "func (w *tableWatcher) Next() (*Event, error) {\n\tfor {\n\t\tselect {\n\t\tcase res := <-w.resChan:\n\t\t\tswitch w.opts.Destination {\n\t\t\tcase \"*\", \"\":\n\t\t\t\treturn res, nil\n\t\t\tdefault:\n\t\t\t\tif w.opts.Destination == res.Route.Destination {\n\t\t\t\t\treturn res, nil\n\t\t\t\t}\n\t\t\t}\n\t\tcase <-w.done:\n\t\t\treturn nil, ErrWatcherStopped\n\t\t}\n\t}\n}", "title": "" }, { "docid": "19576d3ca27fb92e41128741410c11e2", "score": "0.49000004", "text": "func (pr *MessageReaderShortPrefix) ReadNext() (out []byte, n int, err error) {\nagain:\n\tif pr.bufPos >= pr.bufLen {\n\t\tn, err := io.ReadAtLeast(pr.rdr, pr.buf, 2)\n\t\tpr.bufLen = n\n\t\tpr.bufPos = 0\n\n\t\t// io.UnexpectedEOF is an error here - it means a short length read.\n\n\t\tif err == io.EOF {\n\t\t\treturn nil, 0, io.EOF // EOF is used to allow users to terminate the loop\n\t\t} else if err != nil {\n\t\t\treturn nil, 0, fmt.Errorf(\"iotools: messagereader read failed: %w\", err)\n\t\t} else if n == 0 {\n\t\t\treturn nil, 0, nil\n\t\t}\n\t}\n\n\tmsgLen := int(binary.LittleEndian.Uint16(pr.buf[pr.bufPos:]))\n\tpr.bufPos += 2\n\tif msgLen == 0 {\n\t\tgoto again\n\t}\n\n\tfor pr.bufPos+msgLen > pr.bufLen {\n\t\tleft := pr.bufLen - pr.bufPos\n\t\tcopy(pr.buf, pr.buf[pr.bufPos:pr.bufPos+left])\n\n\t\tn, err := pr.rdr.Read(pr.buf[left:])\n\t\tpr.bufLen = n + left\n\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tif pr.bufLen == 0 {\n\t\t\t\t\treturn nil, 0, io.EOF // EOF is used to allow users to terminate the loop\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn nil, 0, fmt.Errorf(\"iotools: messagereader read failed: %w\", err)\n\t\t\t}\n\n\t\t} else if n == 0 {\n\t\t\treturn nil, 0, nil\n\t\t}\n\n\t\tpr.bufPos = 0\n\t}\n\n\tif pr.bufLen < msgLen {\n\t\treturn nil, 0, fmt.Errorf(\"iotools: short message read; expected %d bytes, found %d\", msgLen, pr.bufLen)\n\t}\n\n\tout = pr.buf[pr.bufPos : pr.bufPos+msgLen]\n\tpr.bufPos += msgLen\n\treturn out, msgLen, nil\n}", "title": "" }, { "docid": "3b96595578d679c10047165c4caa3d20", "score": "0.48948503", "text": "func (s *byteIterator) Next() (interface{}, error) {\n\tif s.index < len(s.value) {\n\t\tres := s.value[s.index]\n\t\ts.index++\n\t\treturn res, nil\n\t}\n\treturn nil, fmt.Errorf(\"End of IteByte: %#v\", s)\n}", "title": "" }, { "docid": "a7a4e9a3e7f2c5e7fd3d24f3b2e1cf6c", "score": "0.4894037", "text": "func (m *MboxStream) nextLine() error {\n\tslice, err := m.r.ReadSlice('\\n')\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If slice is longer than the original prefetch, resize.\n\tif len(slice) <= cap(m.prefetch) {\n\t\tm.prefetch = m.prefetch[0:len(slice)]\n\t} else {\n\t\tm.prefetch = make([]byte, len(slice))\n\t}\n\tcopy(m.prefetch, slice)\n\tm.prefetchLength = len(m.prefetch)\n\tm.currentLine++\n\treturn nil\n}", "title": "" }, { "docid": "6002e16d0c90afeec1d283fd4ca57b62", "score": "0.4892157", "text": "func (p *program) next() error {\n\tinstruction := p.instructions[p.programCounter]\n\tswitch instruction.operation {\n\t// add argument value to accumulator and increment program counter\n\tcase acc:\n\t\tp.accumulator += instruction.argument\n\t\tp.programCounter++\n\t// add agument value to program counter to set up next instruction\n\tcase jmp:\n\t\tnextProgramCounter := p.programCounter + instruction.argument\n\t\tif nextProgramCounter < 0 || nextProgramCounter > len(p.instructions) {\n\t\t\terrMSg := fmt.Sprintf(\"jmp instruction #%d would create an invalid program state\", p.programCounter)\n\t\t\treturn errors.New(errMSg)\n\t\t}\n\t\tp.programCounter = nextProgramCounter\n\t// do nothing (increment program counter to next instruction)\n\tcase nop:\n\t\tp.programCounter++\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6dede3e523e66b6516c000c97aba5987", "score": "0.4891271", "text": "func (w *watcher) next() (*versioned.Event, *runtime.Unknown, error) {\n\tlength := make([]byte, 4)\n\tif _, err := io.ReadFull(w.r, length); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tbody := make([]byte, int(binary.BigEndian.Uint32(length)))\n\tif _, err := io.ReadFull(w.r, body); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"read frame body: %v\", err)\n\t}\n\n\tvar event versioned.Event\n\tif err := proto.Unmarshal(body, &event); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif event.Object == nil {\n\t\treturn nil, nil, fmt.Errorf(\"event had no underlying object\")\n\t}\n\n\tunknown, err := parseUnknown(event.Object.Raw)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn &event, unknown, nil\n}", "title": "" }, { "docid": "b216592da1326c38e646b5d288b1cb50", "score": "0.48840582", "text": "func (s *RiscVTokenStream) Next() (RiscVToken, error) {\n\ttoken, charsRead, err := s.getNextToken()\n\ts.updateCharsSinceLastNewline(&token, charsRead)\n\tif err == nil {\n\t\ts.charsSinceLastNewline += s.discardSkippableChars()\n\t}\n\treturn token, err\n}", "title": "" }, { "docid": "b1933bf878573cee495f6a341e44ebeb", "score": "0.48836136", "text": "func ReadNextSigned(byteStream []byte) (*big.Int, int, error) {\n\tfor n := 0; n < len(byteStream); n++ {\n\t\t// if leftmost bit is zero\n\t\tif byteStream[n]&byte(128) == 0 {\n\t\t\tnumber, err := DecodeSigned(byteStream[:n+1])\n\t\t\treturn number, n + 1, err\n\t\t}\n\t}\n\treturn nil, -1, xerrors.New(\"exhausted input while searching for end of next zarith number\")\n}", "title": "" }, { "docid": "a7109d3d461a551ceb37ebf562b27561", "score": "0.4871709", "text": "func (Server) AddStream(stream v1.Calculator_AddStreamServer) error {\n\tvar output float64\n\tvar number *v1.Number\n\tvar err error\n\tfor {\n\t\tselect {\n\t\tcase <-stream.Context().Done():\n\t\t\treturn stream.SendAndClose(&v1.Number{\n\t\t\t\tValue: output,\n\t\t\t})\n\t\tdefault:\n\t\t}\n\n\t\tnumber, err = stream.Recv()\n\t\tif err == io.EOF {\n\t\t\treturn stream.SendAndClose(&v1.Number{\n\t\t\t\tValue: output,\n\t\t\t})\n\t\t}\n\n\t\toutput += number.Value\n\t}\n}", "title": "" }, { "docid": "fb544ee26c39c68c9f61456fe5e98c63", "score": "0.4866392", "text": "func (r *enumSource) Next(ctx context.Context) bool {\n\tselect {\n\tcase <-r.done:\n\t\treturn false\n\tdefault:\n\t}\n\n\tif !r.queue.Empty() {\n\t\treturn true\n\t}\n\n\tt := time.NewTimer(r.timeout)\n\tdefer t.Stop()\n\n\tfor {\n\t\tselect {\n\t\tcase <-t.C:\n\t\t\tclose(r.done)\n\t\t\treturn false\n\t\tcase <-r.queue.Signal():\n\t\t\tif !r.queue.Empty() {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "acf3e7f07e5e8ed88a542b1fb317bd02", "score": "0.48638526", "text": "func (e *LoadDataActionExec) Next(ctx context.Context, _ *chunk.Chunk) error {\n\tsqlExec := e.Ctx().(sqlexec.SQLExecutor)\n\tuser := e.Ctx().GetSessionVars().User.String()\n\tjob := asyncloaddata.NewJob(e.jobID, sqlExec, user)\n\n\tswitch e.tp {\n\tcase ast.LoadDataCancel:\n\t\treturn job.CancelJob(ctx)\n\tcase ast.LoadDataDrop:\n\t\treturn job.DropJob(ctx)\n\tdefault:\n\t\treturn errors.Errorf(\"not implemented LOAD DATA action %v\", e.tp)\n\t}\n}", "title": "" }, { "docid": "810f4bf69886d2a995e625e57295d602", "score": "0.4863403", "text": "func (iter *MultiEncodedObjectIter) Next() (plumbing.EncodedObject, error) {\n\tif len(iter.iters) == 0 {\n\t\treturn nil, io.EOF\n\t}\n\n\tobj, err := iter.iters[0].Next()\n\tif err == io.EOF {\n\t\titer.iters[0].Close()\n\t\titer.iters = iter.iters[1:]\n\t\treturn iter.Next()\n\t}\n\n\treturn obj, err\n}", "title": "" }, { "docid": "0e68754163eac0ad4ef67ff96e7e14df", "score": "0.48627853", "text": "func (self *composeReader) Read() (second Operation, first Operation, err error) {\n // EOF?\n if self.stream1.IsEOF() && self.stream2.IsEOF() {\n return\n }\n // EOF Stream1?\n if self.stream1.IsEOF() {\n if self.stream2.ops[self.stream2.pos].Kind != InsertOp {\n err = errors.New(\"Streams have different length (1)\")\n return\n }\n first = self.stream2.Read(-1)\n return\n }\n // EOF Stream2?\n if self.stream2.IsEOF() {\n if self.stream1.ops[self.stream1.pos].Kind != InsertOp {\n err = errors.New(\"Streams have different length (2)\")\n return\n }\n second = self.stream1.Read(-1)\n return\n }\n // Insert of stream1 goes first\n if self.stream1.ops[self.stream1.pos].Kind == InsertOp {\n second = self.stream1.Read(-1)\n return\n }\n // Skip, Insert (of stream2) and Delete go together\n l := min(self.stream1.ops[self.stream1.pos].Len-self.stream1.inside, self.stream2.ops[self.stream2.pos].Len-self.stream2.inside)\n second = self.stream1.Read(l)\n first = self.stream2.Read(l)\n return\n}", "title": "" }, { "docid": "742d30fdf9c8e76f5ec4d0c80a10a7b5", "score": "0.48518", "text": "func (i *ipWatcher) Next() ([]*Update, error) {\n\tu, ok := <-i.updateChan\n\tif !ok {\n\t\treturn nil, errWatcherClose\n\t}\n\treturn []*Update{u}, nil\n}", "title": "" }, { "docid": "2ac651629c3ff189507eaa3a1718159a", "score": "0.48509052", "text": "func (it *ServiceIterator) Next() (*serviceusagepb.Service, error) {\n\tvar item *serviceusagepb.Service\n\tif err := it.nextFunc(); err != nil {\n\t\treturn item, err\n\t}\n\titem = it.items[0]\n\tit.items = it.items[1:]\n\treturn item, nil\n}", "title": "" }, { "docid": "ea4554e4cb1eb7bcb8aade23a67bb312", "score": "0.48464808", "text": "func (iter *ResponseWithContinuationVirtualNetworkIterator) Next() error {\n\treturn iter.NextWithContext(context.Background())\n}", "title": "" }, { "docid": "405142ac5f85100a37004bc7c52b1e7d", "score": "0.48461205", "text": "func (i *FSTIterator) Next() error {\n\treturn i.next(-1)\n}", "title": "" }, { "docid": "ca4bfcd009854509a37b6af577be63ec", "score": "0.48438743", "text": "func (s *Subscriber) Next() <-chan Message {\n\treturn s.msgChannel\n}", "title": "" }, { "docid": "cd53fe495bb34b9e05c46ce31d26db04", "score": "0.48370352", "text": "func (pr *MessageReaderBytePrefix) ReadNext() (out []byte, n int, err error) {\nagain:\n\tif pr.bufPos >= pr.bufLen {\n\t\tn, err := pr.rdr.Read(pr.buf)\n\t\tpr.bufLen = n\n\t\tpr.bufPos = 0\n\n\t\tif err == io.EOF {\n\t\t\treturn nil, 0, io.EOF // EOF is used to allow users to terminate the loop\n\t\t} else if err != nil {\n\t\t\treturn nil, 0, fmt.Errorf(\"iotools: messagereader read failed: %w\", err)\n\t\t} else if n == 0 {\n\t\t\treturn nil, 0, nil\n\t\t}\n\t}\n\n\tmsgLen := int(pr.buf[pr.bufPos])\n\tpr.bufPos++\n\tif msgLen == 0 {\n\t\tgoto again\n\t}\n\n\tfor pr.bufPos+msgLen > pr.bufLen {\n\t\tleft := pr.bufLen - pr.bufPos\n\t\tcopy(pr.buf, pr.buf[pr.bufPos:pr.bufPos+left])\n\n\t\tn, err := pr.rdr.Read(pr.buf[left:])\n\t\tpr.bufLen = n + left\n\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tif pr.bufLen == 0 {\n\t\t\t\t\treturn nil, 0, io.EOF // EOF is used to allow users to terminate the loop\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn nil, 0, fmt.Errorf(\"iotools: messagereader read failed: %w\", err)\n\t\t\t}\n\n\t\t} else if n == 0 {\n\t\t\treturn nil, 0, nil\n\t\t}\n\n\t\tpr.bufPos = 0\n\t}\n\n\tif pr.bufLen < msgLen {\n\t\treturn nil, 0, fmt.Errorf(\"iotools: short message read; expected %d bytes, found %d\", msgLen, pr.bufLen)\n\t}\n\n\tout = pr.buf[pr.bufPos : pr.bufPos+msgLen]\n\tpr.bufPos += msgLen\n\treturn out, msgLen, nil\n}", "title": "" }, { "docid": "2514facce773f949ae107ec7384bb3d7", "score": "0.48347068", "text": "func (r *Reader) Next() bool {\n\thdr := struct {\n\t\tSec uint32\n\t\tSubSec uint32\n\t\tLen uint32\n\t\tOrigLen uint32\n\t}{}\n\n\tif err := binary.Read(r.r, r.order, &hdr); err != nil {\n\t\tr.err = err\n\t\treturn false\n\t}\n\n\tbs := make([]byte, hdr.Len)\n\tif _, err := io.ReadFull(r.r, bs); err != nil {\n\t\tr.err = err\n\t\treturn false\n\t}\n\n\tr.pkt = &Packet{\n\t\tTimestamp: time.Unix(int64(hdr.Sec), r.tmult*int64(hdr.SubSec)),\n\t\tLength: int(hdr.OrigLen),\n\t\tBytes: bs,\n\t}\n\treturn true\n}", "title": "" }, { "docid": "20f53730130cece97e8d66a57a059568", "score": "0.48326454", "text": "func (s *Scanner) next() {\n\tif s.rdOffset < len(s.src) {\n\t\ts.pos.Offset = s.rdOffset\n\t\ts.pos.Column = s.rdOffset - s.lineOffset + 1\n\t\tif s.ch == '\\n' {\n\t\t\ts.lineOffset = s.rdOffset\n\t\t\ts.pos.Line++\n\t\t\ts.pos.Column = 1\n\t\t}\n\t\tr, w := rune(s.src[s.rdOffset]), 1\n\t\tswitch {\n\t\tcase r == 0:\n\t\t\ts.error(s.pos, \"illegal character NUL\")\n\t\tcase r >= 0x80:\n\t\t\t// not ASCII\n\t\t\tr, w = utf8.DecodeRune(s.src[s.rdOffset:])\n\t\t\tif r == utf8.RuneError && w == 1 {\n\t\t\t\ts.error(s.pos, \"illegal UTF-8 encoding\")\n\t\t\t} else if r == bom && s.pos.Offset > 0 {\n\t\t\t\ts.error(s.pos, \"illegal byte order mark\")\n\t\t\t}\n\t\t}\n\t\ts.rdOffset += w\n\t\ts.ch = r\n\t} else {\n\t\ts.pos.Offset = len(s.src)\n\t\ts.pos.Column++\n\t\tif s.ch == '\\n' {\n\t\t\ts.pos.Line++\n\t\t\ts.pos.Column = 1\n\t\t}\n\t\ts.ch = eof\n\t}\n}", "title": "" } ]
0b944a94044349e8f9273e5f9b6ab49d
TestAddFile tests adding af file
[ { "docid": "3e399f5f252e14de4f5c180595ee066c", "score": "0.760786", "text": "func TestAddFile(t *testing.T) {\n\t// obtain cwd\n\tcwd, err := os.Getwd()\n\tif err != nil {\n\t\tt.Errorf(\"Failed to get current working dir: %s\", err)\n\t}\n\n\t// path to our test data\n\tpath := _getPathToTests(t)\n\n\t// create a temporary folder for our tests\n\ttempPath, err := ioutil.TempDir(cwd, \"wpressTest\")\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create temporary folder %s\", err)\n\t}\n\n\t// make sure to clean after ourselves\n\tdefer os.Remove(tempPath)\n\tfilename := tempPath + string(os.PathSeparator) + \"output.wpress\"\n\tdefer os.Remove(filename)\n\n\tw, err := NewWriter(filename)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create a new Writer because %s\", err)\n\t}\n\n\t// create an array of the files that we want to add\n\tfilesToAdd := [...]string{\"logo.svg\", \"lipsum.txt\", \"logo3.png\"}\n\tfor _, file := range filesToAdd {\n\t\terr = w.AddFile(path + string(os.PathSeparator) + file)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Failed to add `%s` because: %s\", file, err)\n\t\t}\n\t}\n\n\t// close the archive\n\tw.Close()\n\n\t// verify that the file was created\n\tif _, err := os.Stat(filename); os.IsNotExist(err) {\n\t\tt.Errorf(\"The archive file was not created: %s\", filename)\n\t}\n\n\t// create a new reader instance with the archive we just created\n\tr, err := NewReader(filename)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create a new Reader instace: %s\", err)\n\t}\n\n\t// get the files inside the archive\n\tfilesCount, err := r.GetFilesCount()\n\tif err != nil {\n\t\tt.Errorf(\"Unable to get files count: %s\", err)\n\t}\n\t// see if all of our files were added\n\tif len(filesToAdd) != filesCount {\n\t\tt.Errorf(\n\t\t\t\"The archive contains %d files instead of %d\",\n\t\t\tfilesCount,\n\t\t\tlen(filesToAdd))\n\t}\n}", "title": "" } ]
[ { "docid": "9e289f80fb861d6fca9eeb67394f1fa8", "score": "0.72828853", "text": "func (r *Runner) AddTestFile(file string) error {\n\t_, err := r.vm.Run(file)\n\treturn err\n}", "title": "" }, { "docid": "6dc3af48821e5f7f300287885a241540", "score": "0.7167798", "text": "func (s *Suite) AddFile(contents string) {\n\ts.Files = append(s.Files, TestFile{\n\t\tName: fmt.Sprintf(\"_file%d.php\", len(s.Files)),\n\t\tData: []byte(contents),\n\t})\n}", "title": "" }, { "docid": "d5c7a5cbb9656fd3e05097f21fe75a15", "score": "0.7152643", "text": "func TestAddFileFields(t *testing.T) {\n\tt.Parallel()\n\toperator, logReceived, tempDir := newTestFileOperator(t, func(cfg *InputConfig) {\n\t\tcfg.IncludeFileName = true\n\t\tcfg.IncludeFilePath = true\n\t}, nil)\n\n\t// Create a file, then start\n\ttemp := openTemp(t, tempDir)\n\twriteString(t, temp, \"testlog\\n\")\n\n\trequire.NoError(t, operator.Start(testutil.NewMockPersister(\"test\")))\n\tdefer operator.Stop()\n\n\te := waitForOne(t, logReceived)\n\trequire.Equal(t, filepath.Base(temp.Name()), e.Attributes[\"log.file.name\"])\n\trequire.Equal(t, temp.Name(), e.Attributes[\"log.file.path\"])\n}", "title": "" }, { "docid": "3846898ba769fded5773c385fec0e879", "score": "0.6948026", "text": "func TestFileSystemWatcherAddFile(t *testing.T) {\n\t// Setup the test directory\n\tdir := makeTestDir(t)\n\tdefer os.RemoveAll(dir)\n\n\tfw, _ := NewFileSystemWatcher()\n\tdefer fw.Close()\n\n\tfilename := filepath.Join(dir, \"test.txt\")\n\n\t// Actually write the file\n\terr := ioutil.WriteFile(filename, []byte(\"test\"), 0700)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\terr = fw.AddFile(filename, AllOps)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tdone := make(chan struct{})\n\tfw.NotifyEvent(func(event *Event, err error) {\n\n\t\t// Make sure we send the done channel a signal at the end.\n\t\tdefer func() {\n\t\t\tdone <- struct{}{}\n\t\t}()\n\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif event == nil {\n\t\t\tt.Fatal(\"event should not be nil\")\n\t\t}\n\t\tif event.Name != filename {\n\t\t\tt.Fatalf(\"event does not have correct filename. Wanted %s got %s\", filename, event.Name)\n\t\t}\n\t})\n\n\t// Write the file again\n\tioutil.WriteFile(filename, []byte(\"test\"), 0700)\n\n\t// Wait until the event is caught and tested or we time out.\n\tselect {\n\tcase <-done:\n\t\treturn\n\tcase <-time.Tick(100 * time.Millisecond):\n\t\tt.Fatal(\"Timed out\")\n\t}\n\n}", "title": "" }, { "docid": "216b766ac9e9950191e36821e6dd5b08", "score": "0.6930051", "text": "func TestFileSystemWatcherAddFileNonExisting(t *testing.T) {\n\tfw, _ := NewFileSystemWatcher()\n\tdefer fw.Close()\n\tfilename := \"testfile.txt\"\n\terr := fw.AddFile(filename, AllOps)\n\tif err == nil {\n\t\tt.Fatal(\"AddFile should not allow adding of non-existing files\")\n\t}\n}", "title": "" }, { "docid": "5b5858cae20b2e266cb98c2cb4a23349", "score": "0.6648772", "text": "func (ta *testAPI) addNewFileAndModifyContents(t *testing.T, toEncrypt bool) {\n\tdat, err := ta.initSubtest(\"addNewFileAndModifyContents\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't initialize subtest dirs: %v\", err)\n\t}\n\tdefer os.RemoveAll(dat.testDir)\n\n\tdat.toEncrypt = toEncrypt\n\tdat.testUploadDir = filepath.Join(dat.testDir, \"modifyfile-upload\")\n\tdat.testMountDir = filepath.Join(dat.testDir, \"modifyfile-mount\")\n\tdat.files = make(map[string]fileInfo)\n\tdat.files[\"1.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(1, 10)}\n\tdat.files[\"five.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(2, 10)}\n\tdat.files[\"six.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(3, 10)}\n\n\tdat, err = ta.uploadAndMount(dat, t)\n\tif err != nil {\n\t\tt.Fatalf(\"Error during upload of files to swarm / mount of swarm dir: %v\", err)\n\t}\n\tdefer dat.swarmfs.Stop()\n\n\t// Create a new file in the root dir\n\tactualPath := filepath.Join(dat.testMountDir, \"2.txt\")\n\td, err1 := os.OpenFile(actualPath, os.O_RDWR|os.O_CREATE, os.FileMode(0665))\n\tif err1 != nil {\n\t\tt.Fatalf(\"Could not create file %s : %v\", actualPath, err1)\n\t}\n\tdefer d.Close()\n\t//write some random data into the file\n\tlog.Debug(\"file opened\")\n\tline1 := []byte(\"Line 1\")\n\t_, err = rand.Read(line1)\n\tif err != nil {\n\t\tt.Fatalf(\"Error writing random bytes to byte array: %v\", err)\n\t}\n\tlog.Debug(\"line read\")\n\t_, err = d.Write(line1)\n\tif err != nil {\n\t\tt.Fatalf(\"Error writing random bytes to file: %v\", err)\n\t}\n\tlog.Debug(\"line written\")\n\terr = d.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"Error closing file: %v\", err)\n\t}\n\tlog.Debug(\"file closed\")\n\n\t//unmount the hash on the mounted dir\n\tmi1, err2 := dat.swarmfs.Unmount(dat.testMountDir)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"Directory unmounted\")\n\n\t//mount on a different dir to see if modified file is correct\n\ttestMountDir2, err3 := addDir(dat.testDir, \"modifyfile-mount2\")\n\tif err3 != nil {\n\t\tt.Fatalf(\"Error creating mount dir2: %v\", err3)\n\t}\n\tdat.files[\"2.txt\"] = fileInfo{0700, 333, 444, line1}\n\t_ = mountDir(t, ta.api, dat.files, mi1.LatestManifest, testMountDir2)\n\tlog.Debug(\"Directory mounted again\")\n\n\tcheckFile(t, testMountDir2, \"2.txt\", line1)\n\tlog.Debug(\"file checked\")\n\n\t//unmount second dir\n\tmi2, err4 := dat.swarmfs.Unmount(testMountDir2)\n\tif err4 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err4)\n\t}\n\tlog.Debug(\"Directory unmounted again\")\n\n\t//mount again on original dir and modify the file\n\t//let's clean up the mounted dir first: remove...\n\terr = os.RemoveAll(dat.testMountDir)\n\tif err != nil {\n\t\tt.Fatalf(\"Error cleaning up mount dir: %v\", err)\n\t}\n\t//...and re-create\n\terr = os.MkdirAll(dat.testMountDir, 0777)\n\tif err != nil {\n\t\tt.Fatalf(\"Error re-creating mount dir: %v\", err)\n\t}\n\t//now remount\n\t_ = mountDir(t, ta.api, dat.files, mi2.LatestManifest, dat.testMountDir)\n\tlog.Debug(\"Directory mounted yet again\")\n\n\t//open the file....\n\tfd, err5 := os.OpenFile(actualPath, os.O_RDWR|os.O_APPEND, os.FileMode(0665))\n\tif err5 != nil {\n\t\tt.Fatalf(\"Could not create file %s : %v\", actualPath, err5)\n\t}\n\tdefer fd.Close()\n\tlog.Debug(\"file opened\")\n\t//...and modify something\n\tline2 := []byte(\"Line 2\")\n\t_, err = rand.Read(line2)\n\tif err != nil {\n\t\tt.Fatalf(\"Error modifying random bytes to byte array: %v\", err)\n\t}\n\tlog.Debug(\"line read\")\n\t_, err = fd.Seek(int64(len(line1)), 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Error seeking position for modification: %v\", err)\n\t}\n\t_, err = fd.Write(line2)\n\tif err != nil {\n\t\tt.Fatalf(\"Error modifying file: %v\", err)\n\t}\n\tlog.Debug(\"line written\")\n\terr = fd.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"Error closing modified file; %v\", err)\n\t}\n\tlog.Debug(\"file closed\")\n\n\t//unmount the modified directory\n\tmi3, err6 := dat.swarmfs.Unmount(dat.testMountDir)\n\tif err6 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err6)\n\t}\n\tlog.Debug(\"Directory unmounted yet again\")\n\n\t//now remount on a different dir and check that the modified file is ok\n\ttestMountDir4, err7 := addDir(dat.testDir, \"modifyfile-mount4\")\n\tif err7 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err7)\n\t}\n\tb := [][]byte{line1, line2}\n\tline1and2 := bytes.Join(b, []byte(\"\"))\n\tdat.files[\"2.txt\"] = fileInfo{0700, 333, 444, line1and2}\n\t_ = mountDir(t, ta.api, dat.files, mi3.LatestManifest, testMountDir4)\n\tlog.Debug(\"Directory mounted final time\")\n\n\tcheckFile(t, testMountDir4, \"2.txt\", line1and2)\n\t_, err = dat.swarmfs.Unmount(testMountDir4)\n\tif err != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err)\n\t}\n\tlog.Debug(\"subtest terminated\")\n}", "title": "" }, { "docid": "ff3b8aebf98cb5b1aa4adff1cb44279e", "score": "0.66202635", "text": "func TestFileSystemWatcherAddFileWithDirectory(t *testing.T) {\n\tfw, _ := NewFileSystemWatcher()\n\tdefer fw.Close()\n\tdir := \"./\"\n\terr := fw.AddFile(dir, AllOps)\n\tif err == nil {\n\t\tt.Fatal(\"AddFile should not allow adding of directories\")\n\t}\n}", "title": "" }, { "docid": "d730280c3cfa363d990499eff13d2bbe", "score": "0.6431218", "text": "func (s *TestSuite) TestAdd(c *C) {\n\t// given\n\texpected, _ := api.NewArtifact(\"puppetlabs\", \"stdlib\", \"4.5.1\", \"puppetlabs-stdlib-4.5.1.tar.gz\")\n\n\tcl := &client.AnvilRepoClient{Host: s.host}\n\n\t// when\n\tcreated, err := cl.AddArtifact(\"puppetlabs\", \"stdlib\", \"../puppetlabs-stdlib-4.5.1.tar.gz\")\n\n\t// then\n\tc.Assert(err, Equals, nil)\n\n\tc.Assert(expected, DeepEquals, &created)\n}", "title": "" }, { "docid": "82e2ffe15163768beed3b68a2e12f8f1", "score": "0.64170825", "text": "func (ta *testAPI) createNewFile(t *testing.T, toEncrypt bool) {\n\tdat, err := ta.initSubtest(\"createNewFile\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't initialize subtest dirs: %v\", err)\n\t}\n\tdefer os.RemoveAll(dat.testDir)\n\n\tdat.toEncrypt = toEncrypt\n\tdat.testUploadDir = filepath.Join(dat.testDir, \"create-upload1\")\n\tdat.testMountDir = filepath.Join(dat.testDir, \"create-mount\")\n\tdat.files = make(map[string]fileInfo)\n\tdat.files[\"1.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(1, 10)}\n\tdat.files[\"five.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(2, 10)}\n\tdat.files[\"six.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(3, 10)}\n\n\tdat, err = ta.uploadAndMount(dat, t)\n\tif err != nil {\n\t\tt.Fatalf(\"Error during upload of files to swarm / mount of swarm dir: %v\", err)\n\t}\n\tdefer dat.swarmfs.Stop()\n\n\t// Create a new file in the root dir and check\n\tactualPath := filepath.Join(dat.testMountDir, \"2.txt\")\n\td, err1 := os.OpenFile(actualPath, os.O_RDWR|os.O_CREATE, os.FileMode(0665))\n\tif err1 != nil {\n\t\tt.Fatalf(\"Could not open file %s : %v\", actualPath, err1)\n\t}\n\tdefer d.Close()\n\tlog.Debug(\"Opened file\")\n\tcontents := testutil.RandomBytes(1, 11)\n\tlog.Debug(\"content read\")\n\t_, err = d.Write(contents)\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't write contents: %v\", err)\n\t}\n\tlog.Debug(\"content written\")\n\terr = d.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't close file: %v\", err)\n\t}\n\tlog.Debug(\"file closed\")\n\n\tmi, err2 := dat.swarmfs.Unmount(dat.testMountDir)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"Directory unmounted\")\n\n\ttestMountDir2, err3 := addDir(dat.testDir, \"create-mount2\")\n\tif err3 != nil {\n\t\tt.Fatalf(\"Error creating mount dir2: %v\", err3)\n\t}\n\t// mount again and see if things are okay\n\tdat.files[\"2.txt\"] = fileInfo{0700, 333, 444, contents}\n\t_ = mountDir(t, ta.api, dat.files, mi.LatestManifest, testMountDir2)\n\tlog.Debug(\"Directory mounted again\")\n\n\tcheckFile(t, testMountDir2, \"2.txt\", contents)\n\t_, err2 = dat.swarmfs.Unmount(testMountDir2)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"subtest terminated\")\n}", "title": "" }, { "docid": "d68212a682cd786f00cd3b61a608b1b1", "score": "0.64136684", "text": "func TestAdd(t *testing.T) {\n\ttempdir, err := ioutil.TempDir(\"/tmp\", \"tarcache.TestAdd\")\n\tdefer os.RemoveAll(tempdir)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\toldDir, err := os.Getwd()\n\trtx.Must(err, \"Could not get working directory\")\n\trtx.Must(os.Chdir(tempdir), \"Could not chdir to the tempdir\")\n\tdefer os.Chdir(oldDir)\n\n\t// Make the data files, one small and one big.\n\tos.MkdirAll(\"a/b\", 0700)\n\tioutil.WriteFile(\"a/b/tinyfile\", []byte(\"abcdefgh\"), os.FileMode(0666))\n\tbigcontents := make([]byte, 2000)\n\trand.Read(bigcontents)\n\tioutil.WriteFile(\"a/b/bigfile\", bigcontents, os.FileMode(0666))\n\n\tuploader := fakeUploader{\n\t\trequestedRetries: 1,\n\t\texpectedDir: \"a/b\",\n\t}\n\tkv := &flagx.KeyValue{}\n\trtx.Must(kv.Set(\"MLAB.testkey=testvalue\"), \"Could not set key to value\")\n\t// Ignore the returned channel - this is a whitebox test.\n\tconfig := memoryless.Config{\n\t\tMin: 1 * time.Hour,\n\t\tExpected: 1 * time.Hour,\n\t\tMax: 1 * time.Hour,\n\t}\n\ttarCache, _ := New(filename.System(tempdir), \"testdata\", kv, bytecount.ByteCount(1*bytecount.Kilobyte), config, &uploader)\n\tif len(tarCache.currentTarfile) != 0 {\n\t\tt.Errorf(\"The file list should be of zero length and is not (%d != 0)\", len(tarCache.currentTarfile))\n\t}\n\t// Add the tiny file, which should not trigger an upload.\n\ttinyFile := filename.System(tempdir + \"/a/b/tinyfile\")\n\ttarCache.add(tinyFile)\n\t// Add the tiny file a second time, which should not do anything at all.\n\ttarCache.add(tinyFile)\n\tif len(tarCache.currentTarfile) == 0 {\n\t\tt.Errorf(\"The file should be of nonzero length and is not (%d == 0)\", len(tarCache.currentTarfile))\n\t}\n\tif uploader.calls != 0 {\n\t\tt.Error(\"uploader.calls should be zero \", uploader.calls)\n\t}\n\t// Add the big file, which should trigger an upload and file deletion.\n\tbigFile := filename.System(tempdir + \"/a/b/bigfile\")\n\ttarCache.add(bigFile)\n\tif uploader.calls == 0 {\n\t\tt.Error(\"uploader.calls should be >0 \")\n\t}\n\tif contents, err := ioutil.ReadFile(tempdir + \"/a/b/tinyfile\"); err == nil {\n\t\tt.Errorf(\"tinyfile was not deleted, but should have been - contents are %q\", string(contents))\n\t}\n\t// Ensure that the uploaded tarfile can be opened by tar and contains files of the correct size.\n\tioutil.WriteFile(\"tarfile.tgz\", uploader.contents, os.FileMode(0666))\n\tverifyTarfileContents(t, \"tarfile.tgz\",\n\t\t[]FileInTarfile{\n\t\t\t{name: \"a/b/tinyfile\", size: 8},\n\t\t\t{name: \"a/b/bigfile\", size: 2000}},\n\t\tmap[string]string{\n\t\t\t\"MLAB.datatype\": \"testdata\",\n\t\t\t\"MLAB.testkey\": \"testvalue\",\n\t\t})\n\t// Now add one more file to make sure that the cache still works after upload.\n\tioutil.WriteFile(tempdir+\"/tiny2\", []byte(\"12345678\"), os.FileMode(0666))\n\ttiny2File := filename.System(tempdir + \"/tiny2\")\n\tif len(tarCache.currentTarfile) != 0 {\n\t\tt.Errorf(\"Failed to clear the cache after upload (%v)\", len(tarCache.currentTarfile))\n\t\tfor k := range tarCache.currentTarfile {\n\t\t\tt.Errorf(\"%q should not be in the cache\", k)\n\t\t}\n\t}\n\ttarCache.add(tiny2File)\n\tif len(tarCache.currentTarfile) != 1 {\n\t\tt.Error(\"Failed to add the new file after upload\")\n\t}\n}", "title": "" }, { "docid": "97749d5f09ee3b7721f8006f07b60fe5", "score": "0.63347733", "text": "func TestHaveFile(t *testing.T) {\n\tfmt.Println(\"\\n----------------TestHaveFile----------------\")\n\n\tresult := HaveFile(\"Tests/test.txt\")\n\n\tif result {\n\t\tfmt.Println(\"Successfully Found 'test.txt'\")\n\t\tsuccessful++\n\t} else {\n\t\tt.Error(\"Could Not Find 'test.txt'\")\n\t}\n\n\tresult = HaveFile(\"Tests/non-existent.txt\")\n\n\tif !result {\n\t\tfmt.Println(\"Successfully Produced False For Non-Existent File\")\n\t\tsuccessful++\n\t} else {\n\t\tt.Error(\"Incorrectly Found A Non-Existent File\")\n\t}\n\n}", "title": "" }, { "docid": "fceb50a988eae9674b7a08edebf898fa", "score": "0.630676", "text": "func TestAddDirectory(t *testing.T) {\n\t// obtain cwd\n\tcwd, err := os.Getwd()\n\tif err != nil {\n\t\tt.Errorf(\"Failed to get current working dir: %s\", err)\n\t}\n\n\t// path to our test data\n\tpath := _getPathToTests(t)\n\n\t// create a temporary folder for our tests\n\ttempPath, err := ioutil.TempDir(cwd, \"wpressTest\")\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create temporary folder %s\", err)\n\t}\n\n\t// make sure to clean after ourselves\n\tdefer os.Remove(tempPath)\n\tfilename := tempPath + string(os.PathSeparator) + \"output.wpress\"\n\tdefer os.Remove(filename)\n\n\tw, err := NewWriter(filename)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create a new Writer because %s\", err)\n\t}\n\n\tw.AddDirectory(path)\n\n\tw.Close()\n\n\t// verify that the file was created\n\tif _, err := os.Stat(filename); os.IsNotExist(err) {\n\t\tt.Errorf(\"The archive file was not created: %s\", filename)\n\t}\n\n\t// create a new reader instance with the archive we just created\n\tr, err := NewReader(filename)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create a new Reader instace: %s\", err)\n\t}\n\n\t// get the files inside the archive\n\tfilesCount, err := r.GetFilesCount()\n\tif err != nil {\n\t\tt.Errorf(\"Unable to get files count: %s\", err)\n\t}\n\t// see if all of our files were added\n\tif 5 != filesCount {\n\t\tt.Errorf(\"The archive contains %d files instead of 5\", filesCount)\n\t}\n}", "title": "" }, { "docid": "4a145a570379b638c0dae5f01737c580", "score": "0.6295836", "text": "func CreateTestFile(file string, mode os.FileMode, content []byte, t *testing.T) {\n\t_, err := os.Stat(file)\n\tif !os.IsNotExist(err) {\n\t\tfmt.Printf(\"File already exists: %q\\n\", file)\n\t\treturn\n\t}\n\n\terr = ioutil.WriteFile(file, content, mode)\n\tCheck(err, t)\n\n\t_, err = os.Stat(file)\n\tif os.IsNotExist(err) {\n\t\tt.Fatalf(\"Creating file %q failed. Error: %q\\n\", file, err)\n\t} else {\n\t\tfmt.Printf(\"File created: %q\\n\", file)\n\t}\n}", "title": "" }, { "docid": "2c07d0a36419e5f431c6b9d01ee96a82", "score": "0.6295112", "text": "func TestFileRecord(t *testing.T) {\n\ttestFileRecord(t)\n}", "title": "" }, { "docid": "55a83d999ee56c248fce62c2f6e15abf", "score": "0.6295055", "text": "func TestUser_AppendFile3(t *testing.T) {\n\tuserlib.KeystoreClear()\n\tuserlib.DatastoreClear()\n\tu, err := InitUser(\"alice\", \"fubar\")\n\tif err != nil {\n\t\tt.Error(\"Failed to create user\", err)\n\t\treturn\n\t}\n\tt.Log(\"Loaded user\", u)\n\n\tv2 := []byte(\"yes a test\")\n\terr2 := u.AppendFile(\"file1\", v2)\n\tif err2 == nil {\n\t\tt.Error(\" appending to file1 which doesnt exist\", err2)\n\t}\n}", "title": "" }, { "docid": "fcbe810ad9bba91e3249b0afb2f8e148", "score": "0.62738967", "text": "func TestFileApi(t *testing.T){\n\tcases := []Command {\n\t\t{ \"\", \"\", \"testFile\", \"myTag\", GameData{ \"10\", \"100\" } },\n\t}\n\n\tvar cwd, _ = os.Getwd()\n\tlastSlash := strings.LastIndex(cwd, \"\\\\\")\n\t// the location will be the a new directory on the same level as the usual tmp\n\tFILES_PATH = cwd[:lastSlash] + \"/test_tmp/\"\n\n\tfor _, c := range cases {\n\t\tcreateFile := func(t *testing.T) {\n\t\t\tCreateFile(c.Filename)\n\t\t\tresult := CheckFile(c.Filename)\n\t\t\tif result == false {\n\t\t\t\tt.Log(\"Expected \" + c.Filename + \" to exist!\")\n\t\t\t\tt.Fail()\n\t\t\t}\n\t\t}\n\t\tcreateFile(t)\n\n\t\twriteReadFile := func(t *testing.T) {\n\t\t\tWriteFile(c.MakeSave(), c.Filename)\n\t\t\tresult := ReadFile(c.Filename)\n\t\t\tif result == \"\" {\n\t\t\t\tt.Log(\"Expected \" + c.MakeSave())\n\t\t\t\tt.Fail()\n\t\t\t}\n\t\t\tif result[:(len(result) - 1)] != c.MakeSave() {\n\t\t\t\tt.Log(\"Write failed.\")\n\t\t\t\tt.Log(\"Expected: \" + c.MakeSave())\n\t\t\t\tt.Log(\"Got: \" + result)\n\t\t\t\tt.Fail()\n\t\t\t}\n\t\t}\n\t\twriteReadFile(t)\n\n\t\tdeleteFile := func(t *testing.T) {\n\t\t\tDeleteFile(c.Filename)\n\t\t}\n\t\tdeleteFile(t)\n\n\t\tos.Remove(FILES_PATH) // delete the directory\n\t}\n}", "title": "" }, { "docid": "d49770215d23a22e3a23e17bac8f2088", "score": "0.6204119", "text": "func TestAddToMetainfo(t *testing.T) {\n\tfmt.Println(\"\\n----------------TestAddToMetainfo----------------\")\n\n\tParseMetainfo(mPath)\n\thasTest := false\n\ttLynk := lynxutil.GetLynk(lynks, \"Tests\")\n\n\ti := 0\n\tfor i < len(tLynk.Files) {\n\t\t//fmt.Print(files[i].name)\n\t\tif tLynk.Files[i].Name == \"test.txt\" {\n\t\t\t//fmt.Print(files[i].name)\n\t\t\thasTest = true\n\t\t}\n\t\ti++\n\t}\n\n\t// add test.txt to the metainfo\n\tresult := AddToMetainfo(\"test.txt\", mPath)\n\n\tif result != nil && !hasTest {\n\t\tt.Error(\"Test failed, expected no errors. Got \", result)\n\t} else {\n\t\tfmt.Println(\"Successfully Added To Metainfo\")\n\t\tsuccessful++\n\t}\n\n\tParseMetainfo(mPath)\n\n\t// check that test.txt is in the File struct list\n\ti = 0\n\tfor i < len(tLynk.Files) {\n\t\tif tLynk.Files[i].Name == \"test.txt\" {\n\t\t\thasTest = true\n\t\t}\n\t\ti++\n\t}\n\n\tif !hasTest {\n\t\tt.Error(\"test.txt was not added to metainfo.\")\n\t} else {\n\t\tfmt.Println(\"Successfully Added test.txt To Metainfo\")\n\t\tsuccessful++\n\t}\n\n\tresult = AddToMetainfo(\"test.txt\", mPath)\n\n\tif result == nil {\n\t\tt.Error(\"Test failed, expected failure due to duplicates. Got \", result)\n\t} else {\n\t\tfmt.Println(\"Successfully Avoided Adding Duplicates\")\n\t\tsuccessful++\n\t}\n}", "title": "" }, { "docid": "b403d83fdec7790e35c6d429ea47ded8", "score": "0.6187827", "text": "func (ta *testAPI) removeNewlyAddedFile(t *testing.T, toEncrypt bool) {\n\tdat, err := ta.initSubtest(\"removeNewlyAddedFile\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't initialize subtest dirs: %v\", err)\n\t}\n\tdefer os.RemoveAll(dat.testDir)\n\n\tdat.toEncrypt = toEncrypt\n\tdat.testUploadDir = filepath.Join(dat.testDir, \"removenew-upload\")\n\tdat.testMountDir = filepath.Join(dat.testDir, \"removenew-mount\")\n\tdat.files = make(map[string]fileInfo)\n\tdat.files[\"1.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(1, 10)}\n\tdat.files[\"five.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(2, 10)}\n\tdat.files[\"six.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(3, 10)}\n\n\tdat, err = ta.uploadAndMount(dat, t)\n\tif err != nil {\n\t\tt.Fatalf(\"Error during upload of files to swarm / mount of swarm dir: %v\", err)\n\t}\n\tdefer dat.swarmfs.Stop()\n\n\t// Add a a new file and remove it\n\tdirToCreate := filepath.Join(dat.testMountDir, \"one\")\n\terr = os.MkdirAll(dirToCreate, os.FileMode(0665))\n\tif err != nil {\n\t\tt.Fatalf(\"Error creating dir in mounted dir: %v\", err)\n\t}\n\tactualPath := filepath.Join(dirToCreate, \"2.txt\")\n\td, err1 := os.OpenFile(actualPath, os.O_RDWR|os.O_CREATE, os.FileMode(0665))\n\tif err1 != nil {\n\t\tt.Fatalf(\"Could not create file %s : %v\", actualPath, err1)\n\t}\n\tdefer d.Close()\n\tlog.Debug(\"file opened\")\n\tcontents := testutil.RandomBytes(1, 11)\n\tlog.Debug(\"content read\")\n\t_, err = d.Write(contents)\n\tif err != nil {\n\t\tt.Fatalf(\"Error writing random bytes to file: %v\", err)\n\t}\n\tlog.Debug(\"content written\")\n\terr = d.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"Error closing file: %v\", err)\n\t}\n\tlog.Debug(\"file closed\")\n\n\tcheckFile(t, dat.testMountDir, \"one/2.txt\", contents)\n\tlog.Debug(\"file checked\")\n\n\terr = os.Remove(actualPath)\n\tif err != nil {\n\t\tt.Fatalf(\"Error removing file: %v\", err)\n\t}\n\tlog.Debug(\"file removed\")\n\n\tmi, err2 := dat.swarmfs.Unmount(dat.testMountDir)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"Directory unmounted\")\n\n\ttestMountDir2, err3 := addDir(dat.testDir, \"removenew-mount2\")\n\tif err3 != nil {\n\t\tt.Fatalf(\"Error creating mount dir2: %v\", err3)\n\t}\n\t// mount again and see if things are okay\n\t_ = mountDir(t, ta.api, dat.files, mi.LatestManifest, testMountDir2)\n\tlog.Debug(\"Directory mounted again\")\n\n\tif dat.bzzHash != mi.LatestManifest {\n\t\tt.Fatalf(\"same contents different hash orig(%v): new(%v)\", dat.bzzHash, mi.LatestManifest)\n\t}\n\t_, err2 = dat.swarmfs.Unmount(testMountDir2)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"subtest terminated\")\n}", "title": "" }, { "docid": "82aa43fc432c673992387d2477d17803", "score": "0.6160948", "text": "func TestCreateSystemInfoFile2(t *testing.T) {\n\tfmt.Println(\"TestCreateSystemInfoFileWorks\")\n}", "title": "" }, { "docid": "4f07cfe49cf5d0d9735a711d7ee1cd7d", "score": "0.61494213", "text": "func (b *resultBatch) AddFile(f *entity.DataFile) {\n\tif b.check(f.UUID()) {\n\t\treturn\n\t}\n\tb.Files = append(b.Files, f)\n}", "title": "" }, { "docid": "2ef8328b90d5bce1a4cf07370dc8d716", "score": "0.6142394", "text": "func (c *Client) createTestFile(testID int, file *os.File, fileContents []byte) (*awsFileInfo, error) {\n\tfileName := file.Name()\n\tfileInfo, err := file.Stat()\n\n\tif err != nil {\n\t\treturn &awsFileInfo{}, err\n\t}\n\n\tmd5CheckSum := md5.Sum(fileContents)\n\thexDigest := hex.EncodeToString(md5CheckSum[:16])\n\n\tbody := uploadedFile{\n\t\tMimeType: mime.TypeByExtension(filepath.Ext(fileName)),\n\t\tSize: fileInfo.Size(),\n\t\tName: fileName,\n\t\tDigest: hexDigest,\n\t}\n\n\turl := \"tests/\" + strconv.Itoa(testID) + \"/files\"\n\treq, err := c.NewRequest(\"POST\", url, body)\n\tif err != nil {\n\t\treturn &awsFileInfo{}, err\n\t}\n\n\tawsInfo := &awsFileInfo{}\n\t_, err = c.Do(req, awsInfo)\n\treturn awsInfo, err\n}", "title": "" }, { "docid": "9721e973adb4e936aa42c9462214c024", "score": "0.61268985", "text": "func TestGetFile(t *testing.T) {\n\tfmt.Println(\"\\n----------------TestGetFile----------------\")\n\n\terr := getFile(\"test.txt\", mPath)\n\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t} else {\n\t\tfmt.Println(\"Successfully Got File 'test.txt'\")\n\t\tsuccessful++\n\t}\n\n\terr = getFile(\"non-existent.txt\", mPath)\n\n\tif err != nil {\n\t\tfmt.Println(\"Successfully Produced Non-Existent File Error\")\n\t\tsuccessful++\n\t} else {\n\t\tt.Error(err.Error())\n\t}\n\n}", "title": "" }, { "docid": "442653685cfca549667e4b97ba32c56f", "score": "0.609712", "text": "func TestPutBodyWithFileSchema(t *testing.T) {\n\treturn // early return to test compilation\n\n\tschema := sw.FileSchemaTestClass{\n\t\tFile: &sw.File{SourceURI: sw.PtrString(\"https://example.com/image.png\")},\n\t\tFiles: []sw.File{{SourceURI: sw.PtrString(\"https://example.com/image.png\")}}}\n\n\tr, err := client.FakeAPI.TestBodyWithFileSchema(context.Background()).Body(schema).Execute()\n\n\tif err != nil {\n\t\tt.Fatalf(\"Error while adding pet: %v\", err)\n\t}\n\tif r.StatusCode != 200 {\n\t\tt.Log(r)\n\t}\n}", "title": "" }, { "docid": "d55a0b1ec8ac4cb90fd0db35aedb9d8e", "score": "0.6079993", "text": "func testBuildFile(t testing.TB) {\n\t// To create a file\n\tfile := NewFile()\n\tfile.SetHeader(mockFileHeader())\n\n\t// To create a batch. Errors only if payment type is not supported.\n\tbatch, _ := NewBatch(mockBatchHeader())\n\n\t// To create an entry\n\tentry := mockPPDEntryDetail()\n\tentry.AddendaRecordIndicator = 1\n\n\t// To add one or more optional addenda records for an entry\n\taddendaPPD := NewAddenda05()\n\taddendaPPD.PaymentRelatedInformation = \"Currently string needs ASC X12 Interchange Control Structures\"\n\n\t// Add the addenda record to the detail entry\n\tentry.AddAddenda05(addendaPPD)\n\n\t// Entries are added to batches like so:\n\tbatch.AddEntry(entry)\n\n\t// When all of the Entries are added to the batch we must build it.\n\n\tif err := batch.Create(); err != nil {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n\n\t// And batches are added to files much the same way:\n\n\tfile.AddBatch(batch)\n\n\t// Now add a new batch for accepting payments on the web\n\n\tbatch, _ = NewBatch(mockBatchWEBHeader())\n\n\t// Add an entry and define if it is a single or recurring payment\n\t// The following is a reoccuring payment for $7.99\n\n\tentry = mockWEBEntryDetail()\n\tentry.AddendaRecordIndicator = 1\n\n\taddendaWEB := NewAddenda05()\n\taddendaWEB.PaymentRelatedInformation = \"Monthly Membership Subscription\"\n\n\t// Add the addenda record to the detail entry\n\tentry.AddAddenda05(addendaWEB)\n\n\t// Add the entry to the batch\n\tbatch.AddEntry(entry)\n\n\t// Now we must build this batch\n\tif err := batch.Create(); err != nil {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n\n\t// And add the second batch to the file\n\tfile.AddBatch(batch)\n\n\t// Once we added all our batches we must build the file\n\tif err := file.Create(); err != nil {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n\n\t// Finally we write the file to an io.Writer\n\tvar b bytes.Buffer\n\tw := NewWriter(&b)\n\tif err := w.Write(file); err != nil {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n\tw.Flush()\n}", "title": "" }, { "docid": "4a5f7cd4c47937068aac65e5972f3d51", "score": "0.60455996", "text": "func (jfs *jsonFileStorage) addFile(filename string, fileType extensions.Ext, tags []int, size int64, addTime time.Time) (id int) {\n\tfileInfo := File{Filename: filename,\n\t\tType: fileType,\n\t\tTags: tags,\n\t\tSize: size,\n\t\tAddTime: addTime,\n\t}\n\n\t// We need a special var for thread safety\n\tfileID := 0\n\n\tif fileInfo.Tags == nil {\n\t\tfileInfo.Tags = []int{} // https://github.com/tags-drive/core/issues/19\n\t}\n\n\tjfs.mutex.Lock()\n\tdefer jfs.mutex.Unlock()\n\n\t// Set id\n\tjfs.maxID++\n\tfileID = jfs.maxID\n\tfileInfo.ID = fileID\n\n\tjfs.files[jfs.maxID] = fileInfo\n\n\tatomic.AddUint32(jfs.changes, 1)\n\n\treturn fileID\n}", "title": "" }, { "docid": "4e7ee6ec2bc607af2141b52da8375419", "score": "0.6045023", "text": "func AddFile(filename string, username string, diskLocations []string) {\n // read configs from a file\n configs := GetConfigs() // TODO: can cache these while running\n\n // save file to system first\n // should pass in username here, and save into a directory titled <username>\n // in each respective drive\n\n // maybe better to add to database first, and then later groom the system\n // to make sure that the database doesn't have unecessary entries? either\n // is ok\n fileutils.SaveFile(filename, username, diskLocations, configs)\n\n // add file to database (diskLocations = location that the file was stored at)\n database.AddFileSpecsToDatabase(filename, username, diskLocations, configs)\n\n // fmt.Printf(\"Added file %s to system, for user %s\\n\", filename, username)\n}", "title": "" }, { "docid": "c7e77638c2f07bab9208ea0c264c4adf", "score": "0.6006464", "text": "func TestPutBodyWithFileSchema(t *testing.T) {\n\treturn // early return to test compilation\n\n\tschema := sw.FileSchemaTestClass{\n\t\tFile: &sw.File{SourceURI: sw.PtrString(\"https://example.com/image.png\")},\n\t\tFiles: []sw.File{{SourceURI: sw.PtrString(\"https://example.com/image.png\")}}}\n\n\tr, err := client.FakeAPI.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(schema).Execute()\n\n\tif err != nil {\n\t\tt.Fatalf(\"Error while adding pet: %v\", err)\n\t}\n\tif r.StatusCode != 200 {\n\t\tt.Log(r)\n\t}\n}", "title": "" }, { "docid": "2305937b2c888350f79c4360bb4561ec", "score": "0.5982938", "text": "func CreateTestFile(name string) {\n\trec := []byte(\"012345678Z\\nabcdZfghij\\nklmnopqrsZ\\n\")\n\n\tfh, err := os.Create(tfile)\n\tif err != nil {\n\t\tlog.Fatalf(\"testfile: %s\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tdefer fh.Close()\n\tfh.Write(rec)\n}", "title": "" }, { "docid": "595311073b334b7d843dc2118bfa2e5b", "score": "0.59602076", "text": "func (ta *testAPI) createNewFileInsideNewDirectory(t *testing.T, toEncrypt bool) {\n\tdat, err := ta.initSubtest(\"createNewFileInsideNewDirectory\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't initialize subtest dirs: %v\", err)\n\t}\n\tdefer os.RemoveAll(dat.testDir)\n\n\tdat.toEncrypt = toEncrypt\n\tdat.testUploadDir = filepath.Join(dat.testDir, \"createinsidenewdir-upload\")\n\tdat.testMountDir = filepath.Join(dat.testDir, \"createinsidenewdir-mount\")\n\tdat.files = make(map[string]fileInfo)\n\tdat.files[\"1.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(1, 10)}\n\n\tdat, err = ta.uploadAndMount(dat, t)\n\tif err != nil {\n\t\tt.Fatalf(\"Error during upload of files to swarm / mount of swarm dir: %v\", err)\n\t}\n\tdefer dat.swarmfs.Stop()\n\n\t// Create a new file inside a existing dir and check\n\tdirToCreate, err2 := addDir(dat.testMountDir, \"one\")\n\tif err2 != nil {\n\t\tt.Fatalf(\"Error creating mount dir2: %v\", err2)\n\t}\n\tactualPath := filepath.Join(dirToCreate, \"2.txt\")\n\td, err1 := os.OpenFile(actualPath, os.O_RDWR|os.O_CREATE, os.FileMode(0665))\n\tif err1 != nil {\n\t\tt.Fatalf(\"Could not create file %s : %v\", actualPath, err1)\n\t}\n\tdefer d.Close()\n\tlog.Debug(\"File opened\")\n\tcontents := testutil.RandomBytes(1, 11)\n\tlog.Debug(\"content read\")\n\t_, err = d.Write(contents)\n\tif err != nil {\n\t\tt.Fatalf(\"Error writing to file: %v\", err)\n\t}\n\tlog.Debug(\"content written\")\n\terr = d.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"Error closing file: %v\", err)\n\t}\n\tlog.Debug(\"File closed\")\n\n\tmi, err2 := dat.swarmfs.Unmount(dat.testMountDir)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"Directory unmounted\")\n\n\t// mount again and see if things are okay\n\tdat.files[\"one/2.txt\"] = fileInfo{0700, 333, 444, contents}\n\t_ = mountDir(t, ta.api, dat.files, mi.LatestManifest, dat.testMountDir)\n\tlog.Debug(\"Directory mounted again\")\n\n\tcheckFile(t, dat.testMountDir, \"one/2.txt\", contents)\n\t_, err2 = dat.swarmfs.Unmount(dat.testMountDir)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"subtest terminated\")\n}", "title": "" }, { "docid": "e04fc198f1bb85287817b67839db925f", "score": "0.5946479", "text": "func (b *Bag) AddFile(src string, dst string) error {\n\tfx, err := b.payload.Add(src, dst, b.Manifest)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tb.Manifest.Data[filepath.Join(\"data\", dst)] = fx\n\n\treturn err\n}", "title": "" }, { "docid": "7f10881ed2d7fa293899cb58f57009d8", "score": "0.59255636", "text": "func TestFileSystemWatcherAddFileOpFilter(t *testing.T) {\n\t// Setup the test directory\n\tdir := makeTestDir(t)\n\tdefer os.RemoveAll(dir)\n\n\tfw, _ := NewFileSystemWatcher()\n\tdefer fw.Close()\n\n\tfilename := filepath.Join(dir, \"test.txt\")\n\n\t// Actually write the file\n\terr := ioutil.WriteFile(filename, []byte(\"test\"), 0700)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\terr = fw.AddFile(filename, Chmod)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tdone := make(chan struct{})\n\tfw.NotifyEvent(func(event *Event, err error) {\n\t\t// Make sure we send the done channel a signal at the end.\n\t\tdefer func() {\n\t\t\tdone <- struct{}{}\n\t\t}()\n\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif event == nil {\n\t\t\tt.Fatal(\"event should not be nil\")\n\t\t}\n\t\tif event.Name != filename {\n\t\t\tt.Fatalf(\"event does not have correct filename. Wanted %s got %s\", filename, event.Name)\n\t\t}\n\t\tif event.Op&Chmod != Chmod {\n\t\t\tt.Fatal(\"Got wrong event:\", event.Op)\n\t\t}\n\t})\n\n\tdoFileOps(t, filename)\n\n\t// Wait until the event is caught and tested or we time out.\n\tselect {\n\tcase <-done:\n\t\treturn\n\tcase <-time.Tick(100 * time.Millisecond):\n\t\tt.Fatal(\"Timed out\")\n\t}\n\n}", "title": "" }, { "docid": "75478adaae50cf134de7f93f943213b3", "score": "0.59045094", "text": "func TestCopyExtFiles(t *testing.T) {\n\tdirpath, err := CreateDirWithFiles(12, Filename, Srt, \"\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer os.RemoveAll(dirpath)\n\n\tdestDirPath := dirpath + Separator + \"test\"\n\tos.Mkdir(destDirPath, 0755)\n\n\terr = CopyExtFiles(dirpath, destDirPath, Srt)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tavifiles, err := GetFiles(destDirPath, Srt)\n\tif len(avifiles) != 12 {\n\t\tt.Error(\"Could not get copied the files in created dir \", dirpath+\"/test\")\n\t}\n\n}", "title": "" }, { "docid": "147c91acb97481891dd0951cc398224b", "score": "0.5874472", "text": "func FileAdd(content *C.char, contentLen C.int, name *C.char) *C.char {\n\tsContent := C.GoBytes(unsafe.Pointer(content), contentLen)\n\n\tf, err := fs.New()\n\tif err != nil {\n\t\treturn nil\n\t}\n\tdefer f.Close()\n\n\tif _, err := f.Write(sContent); err != nil {\n\t\treturn nil\n\t}\n\tid, err := fs.Add(C.GoString(name), f.Name())\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn C.CString(id)\n}", "title": "" }, { "docid": "49c8f80b84fe6dd2ea862649db369dd4", "score": "0.5854443", "text": "func (s *Suite) AddNolintFile(contents string) {\n\ts.Files = append(s.Files, TestFile{\n\t\tName: fmt.Sprintf(\"_file%d.php\", len(s.Files)),\n\t\tData: []byte(contents),\n\t\tNolint: true,\n\t})\n}", "title": "" }, { "docid": "ae0bd7582a9ab591d5f297f6bcf91888", "score": "0.5853221", "text": "func TestFileHandlerSuccessCreateFile(t *testing.T) {\n\tfh := FileHandler{\n\t\tfileStorage: FileStorage{},\n\t}\n\tdefer os.Remove(\"report.json\")\n\n\t_, err := fh.Create(\"json\")\n\tif err != nil {\n\t\tt.Errorf(\"File was not created: %s\", err)\n\t}\n}", "title": "" }, { "docid": "3657f80f6038a0918cc52a2974c7620a", "score": "0.5848836", "text": "func (u *Unbound) AddTaFile(fname string) error {\n\tcfname := C.CString(fname)\n\tdefer C.free(unsafe.Pointer(cfname))\n\ti := C.ub_ctx_add_ta_file(u.ctx, cfname)\n\treturn newError(int(i))\n}", "title": "" }, { "docid": "797621ec0044119acb9e7751fc8e7d56", "score": "0.5812551", "text": "func (suite *PouchCommitSuite) TestCommitNewFile(c *check.C) {\n\tcname := \"TestCommitNewFile\"\n\timage := \"foo:newfile\"\n\n\tcommand.PouchRun(\"run\", \"--name\", cname, busyboxImage,\n\t\t\"/bin/sh\", \"-c\", \"echo a > /foo\").Assert(c, icmd.Success)\n\tdefer DelContainerForceMultyTime(c, cname)\n\n\tret := command.PouchRun(\"commit\", cname, image)\n\tret.Assert(c, icmd.Success)\n\timageID := strings.TrimSpace(ret.Stdout())\n\tdefer DelImageForceOk(c, image)\n\n\tnname := \"fromNewFile\"\n\tret = command.PouchRun(\"run\", \"--name\", nname, imageID, \"cat\", \"/foo\")\n\tret.Assert(c, icmd.Success)\n\tc.Assert(ret.Stdout(), check.Equals, \"a\\n\")\n\tDelContainerForceMultyTime(c, nname)\n}", "title": "" }, { "docid": "9f1c936922f5d739979a98ced7297e1c", "score": "0.5802759", "text": "func createTestFilesAndUploadToSwarm(t *testing.T, api *api.API, files map[string]fileInfo, uploadDir string, toEncrypt bool) string {\n\n\t//iterate the map\n\tfor fname, finfo := range files {\n\t\tactualPath := filepath.Join(uploadDir, fname)\n\t\tfilePath := filepath.Dir(actualPath)\n\n\t\t//create directory\n\t\terr := os.MkdirAll(filePath, 0777)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error creating directory '%v' : %v\", filePath, err)\n\t\t}\n\n\t\t//create file\n\t\tfd, err1 := os.OpenFile(actualPath, os.O_RDWR|os.O_CREATE, os.FileMode(finfo.perm))\n\t\tif err1 != nil {\n\t\t\tt.Fatalf(\"Error creating file %v: %v\", actualPath, err1)\n\t\t}\n\n\t\t//write content to file\n\t\t_, err = fd.Write(finfo.contents)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error writing to file '%v' : %v\", filePath, err)\n\t\t}\n\t\t/*\n\t\t\t\tNote @holisticode: It's not clear why the Chown command was added to the test suite.\n\t\t\t\tSome files are initialized with different permissions in the individual test,\n\t\t\t\tresulting in errors on Chown which were not checked.\n\t\t\t After adding the checks tests would fail.\n\n\t\t\t\tWhat's then the reason to have this check in the first place?\n\t\t\t\tDisabling for now\n\n\t\t\t err = fd.Chown(finfo.uid, finfo.gid)\n\t\t\t if err != nil {\n\t\t\t t.Fatalf(\"Error chown file '%v' : %v\", filePath, err)\n\t\t\t\t}\n\t\t*/\n\t\terr = fd.Chmod(os.FileMode(finfo.perm))\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error chmod file '%v' : %v\", filePath, err)\n\t\t}\n\t\terr = fd.Sync()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error sync file '%v' : %v\", filePath, err)\n\t\t}\n\t\terr = fd.Close()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error closing file '%v' : %v\", filePath, err)\n\t\t}\n\t}\n\n\t//upload directory to swarm and return hash\n\tbzzhash, err := Upload(uploadDir, \"\", api, toEncrypt)\n\tif err != nil {\n\t\tt.Fatalf(\"Error uploading directory %v: %vm encryption: %v\", uploadDir, err, toEncrypt)\n\t}\n\n\treturn bzzhash\n}", "title": "" }, { "docid": "63dcf1f29a69b38e8ac09c391b0d6e04", "score": "0.5800045", "text": "func AddFile(fileName, token string) error {\n\tSQL := database.prepare(\"insert into files values(?,?)\")\n\ttx := database.begin()\n\t_, err = tx.Stmt(SQL).Exec(fileName, token)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\ttx.Rollback()\n\t} else {\n\t\tlog.Println(tx.Commit())\n\t}\n\treturn err\n}", "title": "" }, { "docid": "fd6b782b43ceb2ec9c53b1810d87f54b", "score": "0.57921755", "text": "func (n *Node) addFile(fileKey string, file string) {\n\tn.disk.Add(fileKey, file)\n}", "title": "" }, { "docid": "70385911952843d70382beaf1e327711", "score": "0.57699615", "text": "func (r *Response) AddFile(file *TargetFile) {\n\n\tcntnt := string(file.Content)\n\t// create sample file\n\tf := &pluginpb.CodeGeneratorResponse_File{\n\t\tName: &file.Filename, // full qualified filename which will generated in :outputdir/\n\t\tContent: &cntnt,\n\t}\n\n\tr.File = append(r.File, f)\n}", "title": "" }, { "docid": "386f9c15863f877d07fb3a621f0d287a", "score": "0.5760114", "text": "func (c *Content) AddFile(dir, file string, data *[]byte) {\n\tc.folders.AddFile(path.Join(dir, file), data)\n\tif file == \"module.json\" {\n\t\tc.Module = *data\n\t\tc.modulePath = dir\n\t}\n}", "title": "" }, { "docid": "7e3ab98353ddaaa39394c11214c3a287", "score": "0.575502", "text": "func (ta *testAPI) createNewFileInsideDirectory(t *testing.T, toEncrypt bool) {\n\tdat, err := ta.initSubtest(\"createNewFileInsideDirectory\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't initialize subtest dirs: %v\", err)\n\t}\n\tdefer os.RemoveAll(dat.testDir)\n\n\tdat.toEncrypt = toEncrypt\n\tdat.testUploadDir = filepath.Join(dat.testDir, \"createinsidedir-upload\")\n\tdat.testMountDir = filepath.Join(dat.testDir, \"createinsidedir-mount\")\n\tdat.files = make(map[string]fileInfo)\n\tdat.files[\"one/1.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(1, 10)}\n\n\tdat, err = ta.uploadAndMount(dat, t)\n\tif err != nil {\n\t\tt.Fatalf(\"Error during upload of files to swarm / mount of swarm dir: %v\", err)\n\t}\n\tdefer dat.swarmfs.Stop()\n\n\t// Create a new file inside a existing dir and check\n\tdirToCreate := filepath.Join(dat.testMountDir, \"one\")\n\tactualPath := filepath.Join(dirToCreate, \"2.txt\")\n\td, err1 := os.OpenFile(actualPath, os.O_RDWR|os.O_CREATE, os.FileMode(0665))\n\tif err1 != nil {\n\t\tt.Fatalf(\"Could not create file %s : %v\", actualPath, err1)\n\t}\n\tdefer d.Close()\n\tlog.Debug(\"File opened\")\n\tcontents := testutil.RandomBytes(1, 11)\n\tlog.Debug(\"Content read\")\n\t_, err = d.Write(contents)\n\tif err != nil {\n\t\tt.Fatalf(\"Error writing random bytes into file %v\", err)\n\t}\n\tlog.Debug(\"Content written\")\n\terr = d.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"Error closing file %v\", err)\n\t}\n\tlog.Debug(\"File closed\")\n\n\tmi, err2 := dat.swarmfs.Unmount(dat.testMountDir)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"Directory unmounted\")\n\n\ttestMountDir2, err3 := addDir(dat.testDir, \"createinsidedir-mount2\")\n\tif err3 != nil {\n\t\tt.Fatalf(\"Error creating mount dir2: %v\", err3)\n\t}\n\t// mount again and see if things are okay\n\tdat.files[\"one/2.txt\"] = fileInfo{0700, 333, 444, contents}\n\t_ = mountDir(t, ta.api, dat.files, mi.LatestManifest, testMountDir2)\n\tlog.Debug(\"Directory mounted again\")\n\n\tcheckFile(t, testMountDir2, \"one/2.txt\", contents)\n\t_, err = dat.swarmfs.Unmount(testMountDir2)\n\tif err != nil {\n\t\tt.Fatalf(\"could not unmount %v\", dat.bzzHash)\n\t}\n\tlog.Debug(\"subtest terminated\")\n}", "title": "" }, { "docid": "9b3805f47baac2864ad51bb465730370", "score": "0.5754373", "text": "func TestGetFiles(t *testing.T) {\n\tdirpath, err := CreateDirWithFiles(12, Filename, Avi, \"\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer os.RemoveAll(dirpath)\n\n\tavifiles, err := GetFiles(dirpath, Avi)\n\n\tif len(avifiles) != 12 {\n\t\tt.Error(\"Could not get the files in dir \", dirpath)\n\t}\n}", "title": "" }, { "docid": "5b2c95fe58b18e9b0d1b83ccbe6bb072", "score": "0.5740878", "text": "func (self *FileSet) AddFile(filename, src string) int {\n\tbase := self.nextBase()\n\tfile := &File{\n\t\tname: filename,\n\t\tsrc: src,\n\t\tbase: base,\n\t}\n\tself.files = append(self.files, file)\n\tself.last = file\n\treturn base\n}", "title": "" }, { "docid": "5b2c95fe58b18e9b0d1b83ccbe6bb072", "score": "0.5740878", "text": "func (self *FileSet) AddFile(filename, src string) int {\n\tbase := self.nextBase()\n\tfile := &File{\n\t\tname: filename,\n\t\tsrc: src,\n\t\tbase: base,\n\t}\n\tself.files = append(self.files, file)\n\tself.last = file\n\treturn base\n}", "title": "" }, { "docid": "57062a41c165999137faaac625faae6c", "score": "0.57385916", "text": "func (n *Node) AddFile(descr string, file string) {\n\t_, _, key := genKeywordSignedKey(descr)\n\tn.addFile(key, file)\n}", "title": "" }, { "docid": "320b843015038fb42976c3554007d47c", "score": "0.5726517", "text": "func AddFile(fs *FS, fpath string, size int64, mod time.Time, mode os.FileMode, isDir bool, files []string, enc []byte) {\n\tif fs.m == nil {\n\t\tfs.m = make(map[string]*file)\n\t}\n\tfs.m[fpath] = &file{\n\t\tpath: fpath,\n\t\tsize: size,\n\t\tmodTime: mod,\n\t\tmode: mode,\n\t\tisDir: isDir,\n\t\tfiles: files,\n\t\tcontent: enc,\n\t}\n}", "title": "" }, { "docid": "f8a730a106222c7b7e06790edd2fbbf8", "score": "0.5722358", "text": "func TestUploadPhotoFile(t *testing.T) {\n\tvar (\n\t\tfileId = int64(986511829842923520)\n\t\taccessHash = int64(2540815227215546042)\n\t)\n\n\tfileData, err := file.MakeFileDataByLoad(fileId, accessHash)\n\tif err != nil {\n\t\tfmt.Errorf(\"not found <%d, %d>\", fileId, accessHash)\n\t\treturn\n\t}\n\n\tUploadPhotoFile(fileData.FileId, 1, fileData.FilePath, fileData.Ext, false)\n\tUploadPhotoFile(fileData.FileId, 2, fileData.FilePath, fileData.Ext, true)\n\n\t//func MakeFileDataByLoad(fileId, accessHash int64) (*fileData, error) {\n\t//\n\t//}\n}", "title": "" }, { "docid": "165857591c865af511f911aec1a624f5", "score": "0.5709368", "text": "func (ar *Archive) addFile(fd FileLike) {\n\t// Format the entry.\n\t// First, get its info.\n\tinfo, err := fd.Stat()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// mtime, uid, gid are all zero so repeated builds produce identical output.\n\tmtime := int64(0)\n\tuid := 0\n\tgid := 0\n\tar.a.AddEntry(archive.EntryNativeObj, info.Name(), mtime, uid, gid, info.Mode(), info.Size(), fd)\n}", "title": "" }, { "docid": "a297fbf2816e518a6629fe60c1a1965f", "score": "0.57018405", "text": "func testFileRecord(t testing.TB) {\n\tf := NewFile()\n\tf.SetHeader(mockFileHeader())\n\tif err := f.Header.Validate(); err != nil {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n\n\tif f.Header.ImmediateOriginName != \"My Bank Name\" {\n\t\tt.Errorf(\"FileParam value was not copied to file.Header\")\n\t}\n}", "title": "" }, { "docid": "2deeed973bc4cc8664b6d4a83dcb4da4", "score": "0.5700603", "text": "func TestAddFileResolvedFields(t *testing.T) {\n\tt.Parallel()\n\toperator, logReceived, tempDir := newTestFileOperator(t, func(cfg *InputConfig) {\n\t\tcfg.IncludeFileName = true\n\t\tcfg.IncludeFilePath = true\n\t\tcfg.IncludeFileNameResolved = true\n\t\tcfg.IncludeFilePathResolved = true\n\t}, nil)\n\n\t// Create temp dir with log file\n\tdir, err := ioutil.TempDir(\"\", \"\")\n\trequire.NoError(t, err)\n\n\tfile, err := ioutil.TempFile(dir, \"\")\n\trequire.NoError(t, err)\n\n\t// Create symbolic link in monitored directory\n\tsymLinkPath := filepath.Join(tempDir, \"symlink\")\n\terr = os.Symlink(file.Name(), symLinkPath)\n\trequire.NoError(t, err)\n\n\t// Populate data\n\twriteString(t, file, \"testlog\\n\")\n\n\t// Resolve path\n\treal, err := filepath.EvalSymlinks(file.Name())\n\trequire.NoError(t, err)\n\tresolved, err := filepath.Abs(real)\n\trequire.NoError(t, err)\n\n\trequire.NoError(t, operator.Start(testutil.NewMockPersister(\"test\")))\n\tdefer operator.Stop()\n\n\te := waitForOne(t, logReceived)\n\trequire.Equal(t, filepath.Base(symLinkPath), e.Attributes[\"log.file.name\"])\n\trequire.Equal(t, symLinkPath, e.Attributes[\"log.file.path\"])\n\trequire.Equal(t, filepath.Base(resolved), e.Attributes[\"log.file.name_resolved\"])\n\trequire.Equal(t, resolved, e.Attributes[\"log.file.path_resolved\"])\n\n\t// Clean up (linux based host)\n\t// Ignore error on windows host (The process cannot access the file because it is being used by another process.)\n\tos.RemoveAll(dir)\n}", "title": "" }, { "docid": "6885fcd3b30d5c04e86ec65505a65d54", "score": "0.56891185", "text": "func TestAdd(t *testing.T) {\n\tflavors.AddFlavor(\"test\", &flavor)\n\n\t_, err := flavors.GetFlavor(\"test\")\n\n\tif err != nil {\n\t\tt.Error(\"Just added template cannot be located\")\n\t}\n}", "title": "" }, { "docid": "58573937e6a7bc3168f806344a76f400", "score": "0.56710243", "text": "func runTestFile(t *testing.T, filepath string, expectValidFail bool, opts ...*Options) {\n\tcontent, err := ioutil.ReadFile(filepath)\n\tassert.Nil(t, err, \"ReadFile error for file %q: %v\", filepath, err)\n\n\tfileReqs, testCases := ParseTestFile(t, content, expectValidFail, opts...)\n\n\tmtOpts := mtest.NewOptions().\n\t\tRunOn(fileReqs...).\n\t\tCreateClient(false)\n\tmt := mtest.New(t, mtOpts)\n\n\tfor _, testCase := range testCases {\n\t\tmtOpts := mtest.NewOptions().\n\t\t\tRunOn(testCase.RunOnRequirements...).\n\t\t\tCreateClient(false)\n\n\t\tmt.RunOpts(testCase.Description, mtOpts, func(mt *mtest.T) {\n\t\t\tdefer func() {\n\t\t\t\t// catch panics from looking up elements and fail if it's unexpected\n\t\t\t\tif r := recover(); r != nil {\n\t\t\t\t\tif !expectValidFail {\n\t\t\t\t\t\tmt.Fatal(r)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}()\n\t\t\terr := testCase.Run(mt)\n\t\t\tif expectValidFail {\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tmt.Fatalf(\"expected test to error, got nil\")\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tmt.Fatal(err)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "10911cd427aa052fb1eaf041c6a95d0e", "score": "0.56643605", "text": "func TestBuildFile(t *testing.T) {\n\ttestBuildFile(t)\n}", "title": "" }, { "docid": "2e337113682df418752db7b29c8251c8", "score": "0.5658873", "text": "func TestNew(t *testing.T) {\n\t// Initialize new footprint file\n\tfp, err := footprint.New(dir, \"testnew.footprint\")\n\tif err != nil {\n\t\tt.Errorf(\"failed to init footprint: %v\", err)\n\t}\n\tt.Log(\"New Footprint:\", fp.Name())\n\tdefer os.Remove(fp.Name())\n\n\t// Detect if after adding a new file, we can see that change reflected in\n\t// the footprint.\n\texFile := newfile(t)\n\tdefer os.Remove(exFile.Name())\n\tif err := fp.Add(exFile); err != nil {\n\t\tt.Errorf(\"failed to add file: %v\", err)\n\t}\n\tif fp.Len() != 1 {\n\t\tt.Errorf(\"length should be 1, instead was: %d\", fp.Len())\n\t}\n\n\t// TODO: Sync to disk.\n}", "title": "" }, { "docid": "491ce8816cabc4657da8134afbdc7b1a", "score": "0.56520456", "text": "func Command_NewFile(script *rex.Script, params []*rex.Value) {\n\tif len(params) != 3 {\n\t\trex.ErrorParamCount(\"rubble:newfile\", \"3\")\n\t}\n\tstate := script.Host.FetchVariable(\"rubble:state\").Data.(*State)\n\n\tname := params[0].String()\n\tfor _, addon := range state.Addons {\n\t\tif addon.Name == name {\n\t\t\taddon.Files[params[1].String()] = NewAddonFile(params[1].String(), \"(from script: \"+state.CurrentFile+\") \", []byte(params[2].String()))\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "698b21cfef62ef1d3f0045369b3198fd", "score": "0.5651215", "text": "func writeFileToTestDir(fname, content string) {\n\ttestDirPath := \".\" + string(filepath.Separator) + TEST_DIR\n\ttestFilePath := testDirPath + string(filepath.Separator) + fname\n\n\t_ = os.MkdirAll(testDirPath, 0755)\n\t_ = ioutil.WriteFile(testFilePath, []byte(content), os.ModePerm)\n}", "title": "" }, { "docid": "3d09f1c1ce6d2e834acba419773b921b", "score": "0.56481206", "text": "func addFileTemplate(name, content string, overwrite bool) error {\n\t// Write the template to file.\n\tdir, err := fileTemplateDir()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn shared.WriteFileString(filepath.Join(dir, name), content, overwrite)\n}", "title": "" }, { "docid": "4ff71d8ccb82054c8d847eae88e19542", "score": "0.56471616", "text": "func TestFileSystemWatcherAddDirRecursive(t *testing.T) {\n\t// Setup the test directory\n\tdir := makeTestDir(t)\n\tdefer os.RemoveAll(dir)\n\n\tfw, _ := NewFileSystemWatcher()\n\tdefer fw.Close()\n\n\t// Create a subdirectory for testing recursive adds\n\tos.MkdirAll(filepath.Join(dir, \"sub\"), 0700)\n\t// Filter on .txt files and do it recursively\n\terr := fw.AddDir(dir, \"*.txt\", AllOps, true)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Setup the NotifyEvent function\n\tfilename := filepath.Join(dir, \"sub\", \"testfile.txt\")\n\tdone := make(chan struct{})\n\tisdone := false\n\tfw.NotifyEvent(func(event *Event, err error) {\n\t\tif isdone {\n\t\t\treturn\n\t\t}\n\t\t// Make sure we send the done channel a signal at the end.\n\t\tdefer func() {\n\t\t\tisdone = true\n\t\t\tdone <- struct{}{}\n\t\t}()\n\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif event == nil {\n\t\t\tt.Fatal(\"event should not be nil\")\n\t\t}\n\t\tif event.Name != filename {\n\t\t\tt.Fatalf(\"event does not have correct filename. Wanted %s got %s\", filename, event.Name)\n\t\t}\n\t})\n\n\t// Actually write the file\n\tioutil.WriteFile(filename, []byte(\"test\"), 0700)\n\n\t// Wait until the event is caught and tested or we time out.\n\tselect {\n\tcase <-done:\n\t\treturn\n\tcase <-time.Tick(100 * time.Millisecond):\n\t\tt.Fatal(\"Timed out\")\n\t}\n}", "title": "" }, { "docid": "638cb59930ad6eeb9f42bdfc2746c05e", "score": "0.56428117", "text": "func (c *Context) AddFile(name string, content []byte) error {\n\theader := &tar.Header{\n\t\tName: name,\n\t\tMode: 0600,\n\t\tSize: int64(len(content)),\n\t}\n\tif err := c.tw.WriteHeader(header); err != nil {\n\t\treturn errors.Wrapf(err, ErrTarHeaderWrite, header)\n\t}\n\tif _, err := c.tw.Write(content); err != nil {\n\t\treturn errors.Wrap(err, ErrTarFileWrite)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9356cabea60ed75270b8df267b8d1812", "score": "0.56410515", "text": "func TestCreateFile(t *testing.T) {\n\terr := m.RPCCreateFile(gfs.CreateFileArg{\"/test1.txt\"}, &gfs.CreateFileReply{})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\terr = m.RPCCreateFile(gfs.CreateFileArg{\"/test1.txt\"}, &gfs.CreateFileReply{})\n\tif err == nil {\n\t\tt.Error(\"the same file has been created twice\")\n\t}\n}", "title": "" }, { "docid": "d52208445a3a4ec4f951133214f7af48", "score": "0.56295717", "text": "func (ta *testAPI) appendFileContentsToEnd(t *testing.T, toEncrypt bool) {\n\tdat, err := ta.initSubtest(\"appendFileContentsToEnd\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't initialize subtest dirs: %v\", err)\n\t}\n\tdefer os.RemoveAll(dat.testDir)\n\n\tdat.toEncrypt = toEncrypt\n\tdat.testUploadDir = filepath.Join(dat.testDir, \"appendlargefile-upload\")\n\tdat.testMountDir = filepath.Join(dat.testDir, \"appendlargefile-mount\")\n\tdat.files = make(map[string]fileInfo)\n\n\tline1 := testutil.RandomBytes(1, 10)\n\n\tdat.files[\"1.txt\"] = fileInfo{0700, 333, 444, line1}\n\n\tdat, err = ta.uploadAndMount(dat, t)\n\tif err != nil {\n\t\tt.Fatalf(\"Error during upload of files to swarm / mount of swarm dir: %v\", err)\n\t}\n\tdefer dat.swarmfs.Stop()\n\n\tactualPath := filepath.Join(dat.testMountDir, \"1.txt\")\n\tfd, err4 := os.OpenFile(actualPath, os.O_RDWR|os.O_APPEND, os.FileMode(0665))\n\tif err4 != nil {\n\t\tt.Fatalf(\"Could not create file %s : %v\", actualPath, err4)\n\t}\n\tdefer fd.Close()\n\tlog.Debug(\"file opened\")\n\tline2 := testutil.RandomBytes(1, 5)\n\tlog.Debug(\"line read\")\n\t_, err = fd.Seek(int64(len(line1)), 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Error searching for position to append: %v\", err)\n\t}\n\t_, err = fd.Write(line2)\n\tif err != nil {\n\t\tt.Fatalf(\"Error appending: %v\", err)\n\t}\n\tlog.Debug(\"line written\")\n\terr = fd.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"Error closing file: %v\", err)\n\t}\n\tlog.Debug(\"file closed\")\n\n\tmi1, err5 := dat.swarmfs.Unmount(dat.testMountDir)\n\tif err5 != nil {\n\t\tt.Fatalf(\"Could not unmount %v \", err5)\n\t}\n\tlog.Debug(\"Directory unmounted\")\n\n\t// mount again and see if appended file is correct\n\tb := [][]byte{line1, line2}\n\tline1and2 := bytes.Join(b, []byte(\"\"))\n\tdat.files[\"1.txt\"] = fileInfo{0700, 333, 444, line1and2}\n\ttestMountDir2, err6 := addDir(dat.testDir, \"remount-mount2\")\n\tif err6 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err6)\n\t}\n\t_ = mountDir(t, ta.api, dat.files, mi1.LatestManifest, testMountDir2)\n\tlog.Debug(\"Directory mounted\")\n\n\tcheckFile(t, testMountDir2, \"1.txt\", line1and2)\n\n\t_, err = dat.swarmfs.Unmount(testMountDir2)\n\tif err != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err)\n\t}\n\tlog.Debug(\"subtest terminated\")\n}", "title": "" }, { "docid": "ad65971ac70e13454c9c70b33db15713", "score": "0.5625599", "text": "func TestFile(t *testing.T) { //nolint:gocyclo\n\tcontents := []string{\"v\", \"is\", \"for\", \"vanadium\"}\n\tfiles := make([]*os.File, len(contents))\n\td, err := os.MkdirTemp(\"\", \"multiparts\")\n\tif err != nil {\n\t\tt.Fatalf(\"MkdirTemp() failed: %v\", err)\n\t}\n\tdefer os.RemoveAll(d)\n\tcontentsSize := 0\n\tfor i, c := range contents {\n\t\tcontentsSize += len(c)\n\t\tfPath := filepath.Join(d, strconv.Itoa(i))\n\t\tif err := os.WriteFile(fPath, []byte(c), 0600); err != nil {\n\t\t\tt.Fatalf(\"WriteFile(%v) failed: %v\", fPath, err)\n\t\t}\n\t\tvar err error\n\t\tif files[i], err = os.Open(fPath); err != nil {\n\t\t\tt.Fatalf(\"Open(%v) failed: %v\", fPath, err)\n\t\t}\n\t}\n\tm, err := multipart.NewFile(\"bunnies\", files)\n\tif err != nil {\n\t\tt.Fatalf(\"NewFile failed: %v\", err)\n\t}\n\tdefer func() {\n\t\tif err := m.Close(); err != nil {\n\t\t\tt.Fatalf(\"Close failed: %v\", err)\n\t\t}\n\t}()\n\tstat, err := m.Stat()\n\tif err != nil {\n\t\tt.Fatalf(\"Stat failed: %v\", err)\n\t}\n\tif want, got := \"bunnies\", stat.Name(); want != got {\n\t\tt.Fatalf(\"Name returned %s, expected %s\", got, want)\n\t}\n\tif want, got := int64(contentsSize), stat.Size(); want != got {\n\t\tt.Fatalf(\"Size returned %d, expected %d\", got, want)\n\t}\n\tif want, got := strings.Join(contents, \"\"), read(t, m, 1024); want != got {\n\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t}\n\tif want, got := \"\", read(t, m, 1024); want != got {\n\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t}\n\tif pos, err := m.Seek(0, 0); err != nil {\n\t\tt.Fatalf(\"Seek failed: %v\", err)\n\t} else if want, got := int64(0), pos; want != got {\n\t\tt.Fatalf(\"Pos is %d, wanted %d\", got, want)\n\t}\n\tif want, got := strings.Join(contents, \"\"), read(t, m, 1024); want != got {\n\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t}\n\tif pos, err := m.Seek(0, 0); err != nil {\n\t\tt.Fatalf(\"Seek failed: %v\", err)\n\t} else if want, got := int64(0), pos; want != got {\n\t\tt.Fatalf(\"Pos is %d, wanted %d\", got, want)\n\t}\n\tfor _, c := range contents {\n\t\tif want, got := c, read(t, m, len(c)); want != got {\n\t\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t\t}\n\t}\n\tif want, got := \"\", read(t, m, 1024); want != got {\n\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t}\n\tif pos, err := m.Seek(1, 0); err != nil {\n\t\tt.Fatalf(\"Seek failed: %v\", err)\n\t} else if want, got := int64(1), pos; want != got {\n\t\tt.Fatalf(\"Pos is %d, wanted %d\", got, want)\n\t}\n\tif want, got := \"isfo\", read(t, m, 4); want != got {\n\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t}\n\tif pos, err := m.Seek(2, 1); err != nil {\n\t\tt.Fatalf(\"Seek failed: %v\", err)\n\t} else if want, got := int64(7), pos; want != got {\n\t\tt.Fatalf(\"Pos is %d, wanted %d\", got, want)\n\t}\n\tif want, got := \"anadi\", read(t, m, 5); want != got {\n\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t}\n\tif _, err := m.Seek(100, 1); err == nil {\n\t\tt.Fatalf(\"Seek expected to fail\")\n\t}\n\tif want, got := \"u\", read(t, m, 1); want != got {\n\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t}\n\tif pos, err := m.Seek(8, 2); err != nil {\n\t\tt.Fatalf(\"Seek failed: %v\", err)\n\t} else if want, got := int64(6), pos; want != got {\n\t\tt.Fatalf(\"Pos is %d, wanted %d\", got, want)\n\t}\n\tif want, got := \"vanad\", read(t, m, 5); want != got {\n\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t}\n\tif _, err := m.Seek(100, 2); err == nil {\n\t\tt.Fatalf(\"Seek expected to fail\")\n\t}\n\tif pos, err := m.Seek(9, 2); err != nil {\n\t\tt.Fatalf(\"Seek failed: %v\", err)\n\t} else if want, got := int64(5), pos; want != got {\n\t\tt.Fatalf(\"Pos is %d, wanted %d\", got, want)\n\t}\n\tif want, got := \"rvana\", read(t, m, 5); want != got {\n\t\tt.Fatalf(\"Read %v, wanted %v instead\", got, want)\n\t}\n\n\t// TODO(caprita): Add some auto-generated test cases where we seek/read\n\t// using various combinations of indices. These can be exhaustive or\n\t// randomized, the idea is to get better coverage.\n}", "title": "" }, { "docid": "95996a72f59bb16a10d0633d84547d2b", "score": "0.56122744", "text": "func removeTestFile(t *testing.T, name string) {\n\tif err := os.Remove(name); err != nil {\n\t\tt.Errorf(\"Error while removing test file : %s\", err.Error())\n\t}\n}", "title": "" }, { "docid": "fd72c409d98d305b90ccbeddb8b9a2ef", "score": "0.5608248", "text": "func (b *IndexBuilder) AddFile(name string, content []byte) error {\n\treturn b.Add(Document{Name: name, Content: content})\n}", "title": "" }, { "docid": "2dcfb5554b28006f219643576489c22b", "score": "0.5591274", "text": "func Add(file string, content []byte) {\n\tbox.Add(file, content)\n}", "title": "" }, { "docid": "02bd999fb78497ebf02764095142e772", "score": "0.5590913", "text": "func setUpFilesystemForTest(t *testing.T, fs Fs, files map[string]*testFile) {\n\tfor name, tf := range files {\n\t\tdir := path.Dir(name)\n\t\tif err := fs.MkdirAll(dir, tf.DirMode); err != nil {\n\t\t\tt.Fatalf(\"Couldn't set up test directory %q: %v\", dir, err)\n\t\t}\n\t\tf, err := fs.OpenFile(name, os.O_CREATE|os.O_WRONLY, tf.Mode)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Couldn't set up test with file %q: %v\", name, err)\n\t\t}\n\t\tif _, err := io.Copy(f, bytes.NewBuffer(tf.Content)); err != nil {\n\t\t\tt.Fatalf(\"Couldn't set content for test file %q: %v\", name, err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2b47fba1b5fc1f8dc6df59cb9eaf704f", "score": "0.55900574", "text": "func TestFileRoundTrip(t *testing.T, c Client, numFiles uint64) {\n\tmaxFiles := c.GetConfig().MaxFiles\n\ttestFiles := randChunk(numFiles)\n\n\t// Populate testFiles into the client\n\tfor stringSum, file := range testFiles {\n\t\tif err := c.PutFile([]byte(stringSum), []byte(file)); err != nil {\n\t\t\tt.Fatal(\"Failed to put test file: \", err)\n\t\t}\n\t}\n\n\t// Populate them all again, which should not return an error.\n\torderedFiles := make([]string, 0, numFiles)\n\tfor stringSum, file := range testFiles {\n\t\tif err := c.PutFile([]byte(stringSum), []byte(file)); err != nil {\n\t\t\tt.Fatal(\"Failed to put test file a second time: \", err)\n\t\t}\n\t\t// Make note of the order, for checking LRU behavior.\n\t\torderedFiles = append(orderedFiles, stringSum)\n\n\t\t// The granularity of the local LRU is only 1 second, because it uses\n\t\t// mtime to track which files are most recent. Sleep at the boundary of\n\t\t// the files we expect to be kept, so we ensure we know which ones will be\n\t\t// kept.\n\t\tif maxFiles > 0 && uint64(len(orderedFiles)) == numFiles-maxFiles {\n\t\t\ttime.Sleep(1 * time.Second)\n\t\t}\n\t}\n\tretainedFiles := orderedFiles\n\tif maxFiles != 0 && maxFiles < numFiles {\n\t\tretainedFiles = orderedFiles[numFiles-maxFiles:]\n\t}\n\n\t// Check all the files are returned by ListFiles\n\tfiles, err := c.ListFiles()\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to retrieve file map: %s\", err)\n\t}\n\tif len(files) < len(retainedFiles) {\n\t\tt.Errorf(\"ListFiles returned too few files:\")\n\t\tt.Errorf(\"want: %d, got: %d:\", len(retainedFiles), len(files))\n\t}\n\tif maxFiles > 0 && uint64(len(files)) > maxFiles {\n\t\tt.Errorf(\"ListFiles returned too many files:\")\n\t\tt.Errorf(\"want: %d, got: %d:\", len(retainedFiles), len(files))\n\t}\n\t// make searching to see which files weren't returned faster\n\treturnedFiles := make(map[string]bool, len(files))\n\tfor _, sum := range files {\n\t\treturnedFiles[string(sum)] = true\n\t}\n\n\t// check that the files returned are the ones expected\n\tfor _, stringSum := range retainedFiles {\n\t\tif !returnedFiles[stringSum] {\n\t\t\tt.Errorf(\"test file not returned: %x\", stringSum)\n\t\t}\n\t}\n\n\t// Check that the contents of the files can be retrived with GetFile\n\tfor _, stringSum := range retainedFiles {\n\t\treturnedChunk, err := c.GetFile([]byte(stringSum))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Failed to retrieve chunk %x: %s\", stringSum, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !bytes.Equal(returnedChunk, testFiles[stringSum]) {\n\t\t\tt.Errorf(\"returned chunk for %x does not match\", stringSum)\n\t\t\t//t.Errorf(\"got %x, want: %x\", returnedChunk, testFiles[stringSum])\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bc6b4aa09be2e65c7e0dd8d8d1e5d0dc", "score": "0.55820394", "text": "func TestFileWriter(t *testing.T) {\n\n\ttestDir, name := prepareTestDirAndName(t)\n\tt.Log(\"name of file is\", name)\n\n\twriter, err := NewFileWriter(name, &testChecker{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := writer.Close(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\twriter.Write([]byte(\"abc\"))\n\twriter.Write([]byte(\"d\"))\n\twriter.Write([]byte(\"efg\"))\n\tcheckNamesLength(t, testDir, 1)\n\tcheckFileContent(t, name, \"abcdefg\")\n\n\twriter.Write([]byte(\"1234\"))\n\tcheckNamesLength(t, testDir, 2)\n\tcheckFileContent(t, name, \"1234\")\n\tcheckFileContent(t, writer.nextName(), \"abcdefg\")\n\n\tif _, err = writer.Write([]byte(\"???\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "9227a4c7b5e124fbdd979c98e79396db", "score": "0.5578658", "text": "func (d *Deluge) CoreAddTorrentFile(fileName, fileDump string, options map[string]interface{}) (string, error) {\n\tresponse, err := d.sendJSONRequest(\"core.add_torrent_file\",\n\t\t[]interface{}{fileName, fileDump, options})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn response[\"result\"].(string), nil\n}", "title": "" }, { "docid": "6685b78c6061afb2a48f0853acfe7c28", "score": "0.5550816", "text": "func createFile() {\n f, err := os.Create(\"testfile1.txt\")\n u.ErrNil(err, \"Unable to create file\")\n defer f.Close()\n log.Printf(\"Created %s\\n\", f.Name())\n}", "title": "" }, { "docid": "db827837c50a4e607d815447e73643a2", "score": "0.5541848", "text": "func TestWithOpenedFile(t *testing.T) {\n\tf := openNextTestFile(t, true)\n\tdefer closeTestEntity(t, f)\n\tm, err := Open(f.Fd(), 0, uintptr(testDataLength), ModeReadWrite, 0)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer closeTestEntity(t, m)\n\tif _, err := m.WriteAt(testData, 0); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbuf := make([]byte, testDataLength)\n\tif _, err := m.ReadAt(buf, 0); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif bytes.Compare(buf, testData) != 0 {\n\t\tt.Fatalf(\"data must be %q, %v found\", testData, buf)\n\t}\n\tif err := m.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "bf6ef6bff0b115a1bf09310927e4307a", "score": "0.5538825", "text": "func (fconf *StFilesCnfg) AddFile(file multipart.File, addName string) {\n\tif addName != \"\" {\n\t\tf, err := os.OpenFile(fconf.Path+\"/\"+addName, os.O_WRONLY|os.O_CREATE, 0666)\n\t\t_checkErr(err)\n\t\tdefer f.Close()\n\t\tio.Copy(f, file)\n\t}\n}", "title": "" }, { "docid": "af0315b9ff1695a78c8e0aed1bfc2a40", "score": "0.55265623", "text": "func CreateFileForTests() *File {\n\t//variables:\n\tpath := \"/tmp\"\n\tdata := []byte(\"this is some data\")\n\tsizeInBytes := len(data)\n\tcreatedOn := time.Now().UTC()\n\n\tout := createFile(path, sizeInBytes, createdOn)\n\treturn out.(*File)\n}", "title": "" }, { "docid": "95c4c2803bfca5b369d2f42b5414cb3e", "score": "0.55186504", "text": "func TestFindAndParseTriggerFileNewFile(t *testing.T) {\n\ttestutils.SmallTest(t)\n\tb, cancel := getMockedDBBackup(t, nil)\n\tdefer cancel()\n\n\texec_testutils.Run(t, b.triggerDir, \"touch\", \"foo\")\n\tfile, attempts, err := b.findAndParseTriggerFile()\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"foo\", file)\n\tassert.Equal(t, 0, attempts)\n}", "title": "" }, { "docid": "918912c165606a51abb47073a7d4b3f8", "score": "0.55021834", "text": "func Add(name string, privileged bool, subDir string) (*File, error) {\n\tif err := CheckName(name); err != nil {\n\t\treturn nil, err\n\t}\n\t_, err := Get(name, subDir)\n\tif err == nil {\n\t\treturn nil, fmt.Errorf(\"instance %s already exists\", name)\n\t}\n\ti := &File{Name: name, Privileged: privileged}\n\ti.Path, err = getPath(privileged, \"\", subDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tjsonFile := name + \".json\"\n\ti.Path = filepath.Join(i.Path, name, jsonFile)\n\treturn i, nil\n}", "title": "" }, { "docid": "b75bc169c77aa6b32b7405aa5eb4478a", "score": "0.5501898", "text": "func TestProcessMain(t *testing.T) {\n a, _ := createTestProcessFiles(t, \"Phish\", []*TestProcessFiles{\n { \"2003/2003.07.17 Bonner Springs, KS/1-01 Chalk Dust Torture.flac\",\n &ffprobe.Tags{},\n },{\n \"cd1/file2.mp3\",\n &ffprobe.Tags{\n Album: \"2003.07.18 Alpine Valley, East Troy, WI\",\n Track: \"01\", Title: \"Axilla I\",\n },\n },\n })\n defer os.RemoveAll(filepath.Dir(a.Config.Dir))\n\n a.Config.Artist = \"Phish\"\n a.Config.Write = true\n a.Config.Force = true\n\n err := a.Process()\n\n // ensure no errors in process\n if err != nil {\n t.Errorf(\"Expected no error, got: %v\", err.Error())\n }\n\n // compare relative folder path & file name with expected result\n fileResults := []string{\n \"2003.07.18 Alpine Valley, East Troy, WI/01 Axilla I.mp3\",\n \"Phish/2003/2003.07.17 Bonner Springs, KS/01-01 Chalk Dust Torture.mp3\",\n }\n\n files := fsutil.FilesAudio(a.Config.Dir)\n if len(files) == 0 {\n t.Errorf(\"No resulting files found.\")\n }\n\n for x := range files {\n if files[x] != fileResults[x] {\n t.Errorf(\"Expected %v, got %v\", fileResults[x], files[x])\n }\n }\n\n // TODO: actually read & compare json data encoded within file\n}", "title": "" }, { "docid": "b403e8224a24686a90ca9c2813b17717", "score": "0.5496384", "text": "func (i *elasticAgentTARDarwinPackage) AddFiles(ctx context.Context, files []string) error {\n\treturn nil\n}", "title": "" }, { "docid": "3918eeebbaa0fd5060157bb939e73382", "score": "0.54893446", "text": "func (sfs *SuiteFS) TestReadFile(t *testing.T, testDir string) {\n\tvfs := sfs.vfsTest\n\n\tif !vfs.HasFeature(avfs.FeatBasicFs) {\n\t\t_, err := vfs.ReadFile(testDir)\n\t\tCheckPathError(t, \"ReadFile\", \"open\", testDir, avfs.ErrPermDenied, err)\n\n\t\treturn\n\t}\n\n\tdata := []byte(\"AAABBBCCCDDD\")\n\tpath := vfs.Join(testDir, \"TestReadFile.txt\")\n\n\tt.Run(\"ReadFile\", func(t *testing.T) {\n\t\trb, err := vfs.ReadFile(path)\n\t\tif err == nil {\n\t\t\tt.Errorf(\"ReadFile : want error to be %v, got nil\", avfs.ErrNoSuchFileOrDir)\n\t\t}\n\n\t\tif len(rb) != 0 {\n\t\t\tt.Errorf(\"ReadFile : want read bytes to be 0, got %d\", len(rb))\n\t\t}\n\n\t\tvfs = sfs.vfsSetup\n\n\t\tpath = sfs.ExistingFile(t, testDir, data)\n\n\t\tvfs = sfs.vfsTest\n\n\t\trb, err = vfs.ReadFile(path)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"ReadFile : want error to be nil, got %v\", err)\n\t\t}\n\n\t\tif !bytes.Equal(rb, data) {\n\t\t\tt.Errorf(\"ReadFile : want content to be %s, got %s\", data, rb)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "ef3583e8078f8a7354a543c340c41def", "score": "0.5488908", "text": "func filename(t *testing.T) string {\n\tname := t.Name()\n\tif strings.Contains(name, \"/\") { // If a subtest\n\t\tname = name[strings.LastIndex(t.Name(), \"/\")+1:]\n\t}\n\tname = strings.TrimPrefix(name, \"Test\")\n\treturn name + \".json\"\n}", "title": "" }, { "docid": "77e9507214f6199f1e6d99a28c6c3524", "score": "0.54805267", "text": "func testSingleFileGet(t *testing.T, tg *siatest.TestGroup) {\n\t// Grab the first of the group's renters\n\trenter := tg.Renters()[0]\n\t// Upload file, creating a piece for each host in the group\n\tdataPieces := uint64(1)\n\tparityPieces := uint64(len(tg.Hosts())) - dataPieces\n\tfileSize := 100 + siatest.Fuzz()\n\t_, _, err := renter.UploadNewFileBlocking(fileSize, dataPieces, parityPieces)\n\tif err != nil {\n\t\tt.Fatal(\"Failed to upload a file for testing: \", err)\n\t}\n\n\tfiles, err := renter.Files()\n\tif err != nil {\n\t\tt.Fatal(\"Failed to get renter files: \", err)\n\t}\n\n\tvar file modules.FileInfo\n\tfor _, f := range files {\n\t\tfile, err = renter.File(f.SiaPath)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"Failed to request single file\", err)\n\t\t}\n\t\tif file != f {\n\t\t\tt.Fatal(\"Single file queries does not match file previously requested.\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bf895995bbef98a9533f74812935cfb3", "score": "0.54786265", "text": "func TarFileAdd(path string, tarPath string) {\n\tlogging.Debug(fmt.Sprintf(\"Tar: adding %s as %s\", path, tarPath))\n\tstat, err := os.Stat(path)\n\tif err != nil {\n\t\tlogging.DebugError(fmt.Sprintf(\"%s ->\\t%v\", path, err))\n\t\treturn\n\t}\n\tmode := stat.Mode()\n\tif mode.IsRegular() == false {\n\t\tlogging.Debug(\"Not a regular file: \" + path)\n\t\treturn\n\t}\n\n\t/*\n\t Opening file and return if it does nt work (no permissions, etc)\n\t*/\n\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\tlogging.DebugError(string(err.Error()))\n\t\treturn\n\t}\n\t/*\n\t ignoring empty files (and devices)\n\t if not devices like /dev/urandom are reaad and it crashes \"fatal error: runtime: out of memory\"\n\t*/\n\n\tif stat.Size() == 0 {\n\t\tlogging.Debug(fmt.Sprint(\"Tar: ignored because it seems to be empty:\\t\" + path))\n\t\tf.Close()\n\t\twg.Done()\n\t\treturn\n\t}\n\t// xxxxxxxxxxxxxxx\n\t/*\n\t\tinfo, err := f.Stat()\n\t if err != nil {\n\t\t\tlogging.Error(path + \"\\t\" + err.Error())\n\t\t}\n\t\theader, err := tar.FileInfoHeader(info, path)\n\t*/\n\theader, err := tar.FileInfoHeader(stat, path)\n\tif err != nil {\n\t\tlogging.Error(path + \"\\t\" + err.Error())\n\t}\n\theader.Name = tarPath\n\ttarAdd(header, f)\n\n}", "title": "" }, { "docid": "fa0b0f3de29e1f61f6a5d20343c6e496", "score": "0.547698", "text": "func (m *Manager) AddFile(path string, content []byte) error {\n\tp, err := m.checkPath(path, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tm.createParentDir(filepath.Dir(p))\n\tm.entries[p] = &file{mode: m.FileMode, uid: os.Getuid(), gid: os.Getgid(), content: content}\n\treturn nil\n}", "title": "" }, { "docid": "2b75e6b99252ef59f102bb4ace8c3e48", "score": "0.5474567", "text": "func (f *FakeKubeClient) AddNetFile(namespace, name, filePath, fileData string) {\n\tcr := fmt.Sprintf(`{\n \"apiVersion\": \"k8s.cni.cncf.io/v1\",\n \"kind\": \"Network\",\n \"metadata\": {\n \"namespace\": \"%s\",\n \"name\": \"%s\"\n }\n}`, namespace, name)\n\tf.nets[fmt.Sprintf(\"/apis/k8s.cni.cncf.io/v1/namespaces/%s/\"+CRDPlural+\"/%s\", namespace, name)] = cr\n\n\terr := ioutil.WriteFile(filePath, []byte(fileData), 0600)\n\tgomega.Expect(err).NotTo(gomega.HaveOccurred())\n}", "title": "" }, { "docid": "6b9a29840b8e21d21fdbede9b552698d", "score": "0.54712325", "text": "func newfile(t *testing.T) *os.File {\n\tt.Helper()\n\tf, err := ioutil.TempFile(dir, \"file\")\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create temp file: %v\", err)\n\t}\n\n\tt.Log(\"Created file:\", f.Name())\n\treturn f\n}", "title": "" }, { "docid": "71dcd5ec6552648b73988e3664d92cbd", "score": "0.5470022", "text": "func TestNewContentFromFile(t *testing.T) {\n\tcases := []struct {\n\t\tname string\n\t\tkind string\n\t\tpath string\n\t\texpected any\n\t}{\n\t\t{\"Post\", \"post\", \"post/sample-1.md\", []string{`title = \"Post Arch title\"`, `test = \"test1\"`, \"date = \\\"2015-01-12T19:20:04-07:00\\\"\"}},\n\t\t{\"Post org-mode\", \"post\", \"post/org-1.org\", []string{`#+title: ORG-1`}},\n\t\t{\"Post, unknown content filetype\", \"post\", \"post/sample-1.pdoc\", false},\n\t\t{\"Empty date\", \"emptydate\", \"post/sample-ed.md\", []string{`title = \"Empty Date Arch title\"`, `test = \"test1\"`}},\n\t\t{\"Archetype file not found\", \"stump\", \"stump/sample-2.md\", []string{`title: \"Sample 2\"`}}, // no archetype file\n\t\t{\"No archetype\", \"\", \"sample-3.md\", []string{`title: \"Sample 3\"`}}, // no archetype\n\t\t{\"Empty archetype\", \"product\", \"product/sample-4.md\", []string{`title = \"SAMPLE-4\"`}}, // empty archetype front matter\n\t\t{\"Filenames\", \"filenames\", \"content/mypage/index.md\", []string{\"title = \\\"INDEX\\\"\\n+++\\n\\n\\nContentBaseName: mypage\"}},\n\t\t{\"Branch Name\", \"name\", \"content/tags/tag-a/_index.md\", []string{\"+++\\ntitle = 'Tag A'\\n+++\"}},\n\n\t\t{\"Lang 1\", \"lang\", \"post/lang-1.md\", []string{`Site Lang: en|Name: Lang 1|i18n: Hugo Rocks!`}},\n\t\t{\"Lang 2\", \"lang\", \"post/lang-2.en.md\", []string{`Site Lang: en|Name: Lang 2|i18n: Hugo Rocks!`}},\n\t\t{\"Lang nn file\", \"lang\", \"content/post/lang-3.nn.md\", []string{`Site Lang: nn|Name: Lang 3|i18n: Hugo Rokkar!`}},\n\t\t{\"Lang nn dir\", \"lang\", \"content_nn/post/lang-4.md\", []string{`Site Lang: nn|Name: Lang 4|i18n: Hugo Rokkar!`}},\n\t\t{\"Lang en in nn dir\", \"lang\", \"content_nn/post/lang-5.en.md\", []string{`Site Lang: en|Name: Lang 5|i18n: Hugo Rocks!`}},\n\t\t{\"Lang en default\", \"lang\", \"post/my-bundle/index.md\", []string{`Site Lang: en|Name: My Bundle|i18n: Hugo Rocks!`}},\n\t\t{\"Lang en file\", \"lang\", \"post/my-bundle/index.en.md\", []string{`Site Lang: en|Name: My Bundle|i18n: Hugo Rocks!`}},\n\t\t{\"Lang nn bundle\", \"lang\", \"content/post/my-bundle/index.nn.md\", []string{`Site Lang: nn|Name: My Bundle|i18n: Hugo Rokkar!`}},\n\t\t{\"Site\", \"site\", \"content/mypage/index.md\", []string{\"RegularPages .Site: 10\", \"RegularPages site: 10\"}},\n\t\t{\"Shortcodes\", \"shortcodes\", \"shortcodes/go.md\", []string{\n\t\t\t`title = \"GO\"`,\n\t\t\t\"{{< myshortcode >}}\",\n\t\t\t\"{{% myshortcode %}}\",\n\t\t\t\"{{</* comment */>}}\\n{{%/* comment */%}}\",\n\t\t}}, // shortcodes\n\t}\n\n\tc := qt.New(t)\n\n\tfor i, cas := range cases {\n\t\tcas := cas\n\n\t\tc.Run(cas.name, func(c *qt.C) {\n\t\t\tc.Parallel()\n\n\t\t\tmm := afero.NewMemMapFs()\n\t\t\tc.Assert(initFs(mm), qt.IsNil)\n\t\t\tcfg, fs := newTestCfg(c, mm)\n\t\t\tconf := testconfig.GetTestConfigs(fs.Source, cfg)\n\t\t\th, err := hugolib.NewHugoSites(deps.DepsCfg{Configs: conf, Fs: fs})\n\t\t\tc.Assert(err, qt.IsNil)\n\t\t\terr = create.NewContent(h, cas.kind, cas.path, false)\n\n\t\t\tif b, ok := cas.expected.(bool); ok && !b {\n\t\t\t\tif !b {\n\t\t\t\t\tc.Assert(err, qt.Not(qt.IsNil))\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tc.Assert(err, qt.IsNil)\n\n\t\t\tfname := filepath.FromSlash(cas.path)\n\t\t\tif !strings.HasPrefix(fname, \"content\") {\n\t\t\t\tfname = filepath.Join(\"content\", fname)\n\t\t\t}\n\n\t\t\tcontent := readFileFromFs(c, fs.Source, fname)\n\n\t\t\tfor _, v := range cas.expected.([]string) {\n\t\t\t\tfound := strings.Contains(content, v)\n\t\t\t\tif !found {\n\t\t\t\t\tc.Fatalf(\"[%d] %q missing from output:\\n%q\", i, v, content)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t}\n}", "title": "" }, { "docid": "0ef993a6c2c5d6fb90920eda5df8151d", "score": "0.5467406", "text": "func filename(t *testing.T) string {\n\tname := t.Name()\n\tif strings.Contains(name, \"/\") { // If a subtest\n\t\tname = strings.Replace(name, \"/\", \"_\", -1)\n\t}\n\tname = strings.TrimPrefix(name, \"Test\")\n\treturn name + \".json\"\n}", "title": "" }, { "docid": "507f2e9aefba4f083df465112f2809b0", "score": "0.54640365", "text": "func TestAddKustomizationFileAsResource(t *testing.T) {\n\tfSys := filesys.MakeEmptyDirInMemory()\n\ttestutils_test.WriteTestKustomization(fSys)\n\n\tcmd := newCmdAddResource(fSys)\n\targs := []string{konfig.DefaultKustomizationFileName()}\n\tassert.NoError(t, cmd.RunE(cmd, args))\n\n\tcontent, err := testutils_test.ReadTestKustomization(fSys)\n\tassert.NoError(t, err)\n\n\tassert.NotContains(t, string(content), konfig.DefaultKustomizationFileName())\n}", "title": "" }, { "docid": "ef9e23c92646584098507a4d4795e414", "score": "0.546394", "text": "func createTestSourceDir(srcDir string) error {\n\terr := os.MkdirAll(srcDir, os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create a test file inside the source directory\n\tfilePath := filepath.Join(srcDir, \"file1.txt\")\n\tfile, err := os.Create(filePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\t// Write some data to the test file\n\tdata := []byte(\"This is a test file.\")\n\t_, err = file.Write(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7cb15e21c17a027268de116dbe764b0c", "score": "0.545926", "text": "func (sfs *SuiteFS) TestWriteFile(t *testing.T, testDir string) {\n\tvfs := sfs.vfsTest\n\n\tif !vfs.HasFeature(avfs.FeatBasicFs) || vfs.HasFeature(avfs.FeatReadOnly) {\n\t\terr := vfs.WriteFile(testDir, []byte{0}, avfs.DefaultFilePerm)\n\t\tCheckPathError(t, \"WriteFile\", \"open\", testDir, avfs.ErrPermDenied, err)\n\n\t\treturn\n\t}\n\n\tdata := []byte(\"AAABBBCCCDDD\")\n\n\tt.Run(\"WriteFile\", func(t *testing.T) {\n\t\tpath := vfs.Join(testDir, \"WriteFile.txt\")\n\n\t\terr := vfs.WriteFile(path, data, avfs.DefaultFilePerm)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"WriteFile : want error to be nil, got %v\", err)\n\t\t}\n\n\t\trb, err := vfs.ReadFile(path)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"ReadFile : want error to be nil, got %v\", err)\n\t\t}\n\n\t\tif !bytes.Equal(rb, data) {\n\t\t\tt.Errorf(\"ReadFile : want content to be %s, got %s\", data, rb)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "a2ae32504bc29cbf054656588a27d68a", "score": "0.5456216", "text": "func (sfs *SuiteFS) TestSameFile(t *testing.T, testDir string) {\n\tvfs := sfs.vfsSetup\n\n\tif !vfs.HasFeature(avfs.FeatBasicFs) {\n\t\tif vfs.SameFile(nil, nil) {\n\t\t\tt.Errorf(\"SameFile : want SameFile to be false, got true\")\n\t\t}\n\n\t\treturn\n\t}\n\n\ttestDir1 := vfs.Join(testDir, \"dir1\")\n\ttestDir2 := vfs.Join(testDir, \"dir2\")\n\n\tsfs.SampleDirs(t, testDir1)\n\tfiles := sfs.SampleFiles(t, testDir1)\n\n\tsfs.SampleDirs(t, testDir2)\n\n\tt.Run(\"SameFileLink\", func(t *testing.T) {\n\t\tif !vfs.HasFeature(avfs.FeatHardlink) {\n\t\t\treturn\n\t\t}\n\n\t\tfor _, file := range files {\n\t\t\tpath1 := vfs.Join(testDir1, file.Path)\n\t\t\tpath2 := vfs.Join(testDir2, file.Path)\n\n\t\t\tinfo1, err := vfs.Stat(path1)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Stat %s : want error to be nil, got %v\", path1, err)\n\t\t\t}\n\n\t\t\terr = vfs.Link(path1, path2)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Link %s : want error to be nil, got %v\", path1, err)\n\t\t\t}\n\n\t\t\tinfo2, err := vfs.Stat(path2)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Stat %s : want error to be nil, got %v\", path1, err)\n\t\t\t}\n\n\t\t\tif !vfs.SameFile(info1, info2) {\n\t\t\t\tt.Fatalf(\"SameFile %s, %s : not same files\\n%v\\n%v\", path1, path2, info1, info2)\n\t\t\t}\n\n\t\t\terr = vfs.Remove(path2)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Remove %s : want error to be nil, got %v\", path2, err)\n\t\t\t}\n\t\t}\n\t})\n\n\tt.Run(\"SameFileSymlink\", func(t *testing.T) {\n\t\tif !vfs.HasFeature(avfs.FeatSymlink) {\n\t\t\treturn\n\t\t}\n\n\t\tfor _, file := range files {\n\t\t\tpath1 := vfs.Join(testDir1, file.Path)\n\t\t\tpath2 := vfs.Join(testDir2, file.Path)\n\n\t\t\tinfo1, err := vfs.Stat(path1)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Stat %s : want error to be nil, got %v\", path1, err)\n\t\t\t}\n\n\t\t\terr = vfs.Symlink(path1, path2)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"TestSymlink %s : want error to be nil, got %v\", path1, err)\n\t\t\t}\n\n\t\t\tinfo2, err := vfs.Stat(path2)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Stat %s : want error to be nil, got %v\", path1, err)\n\t\t\t}\n\n\t\t\tif !vfs.SameFile(info1, info2) {\n\t\t\t\tt.Fatalf(\"SameFile %s, %s : not same files\\n%v\\n%v\", path1, path2, info1, info2)\n\t\t\t}\n\n\t\t\tinfo3, err := vfs.Lstat(path2)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Stat %s : want error to be nil, got %v\", path1, err)\n\t\t\t}\n\n\t\t\tif vfs.SameFile(info1, info3) {\n\t\t\t\tt.Fatalf(\"SameFile %s, %s : not the same file\\n%v\\n%v\", path1, path2, info1, info3)\n\t\t\t}\n\n\t\t\terr = vfs.Remove(path2)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Remove %s : want error to be nil, got %v\", path2, err)\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "6392b9ca9fd8d25dcef655e5c714bef2", "score": "0.54453975", "text": "func (c *Compiler) AddFile(path string, r io.ReadCloser, size int64, force bool) error {\n\n\t_, base := filepath.Split(path)\n\terr := c.tree.Map(path, vio.CustomFile(vio.CustomFileArgs{\n\t\tName: base,\n\t\tSize: int(size),\n\t\tReadCloser: r,\n\t}))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b76a696a3d31696c746d4592658ce7b3", "score": "0.5443251", "text": "func (f FolderMap) AddFile(p string, data *[]byte) {\n\tdir, name := path.Split(p)\n\tfolder, _ := f.walk(dir, true)\n\tfolder.files[name] = data\n}", "title": "" }, { "docid": "a6b77dad0002bf513933afd3093cee16", "score": "0.54408324", "text": "func TestUploadFileNoFile(t *testing.T) {\n\ttestutils.SmallTest(t)\n\ttempdir, err := ioutil.TempDir(\"\", \"backups_test\")\n\tassert.NoError(t, err)\n\tdefer testutils.RemoveAll(t, tempdir)\n\n\tfilename := path.Join(tempdir, \"myfile.txt\")\n\n\tb, cancel := getMockedDBBackup(t, nil)\n\tdefer cancel()\n\n\tnow := time.Now()\n\tname := \"path/to/gsfile.txt\"\n\terr = uploadFile(b.ctx, filename, b.gsClient.Bucket(b.gsBucket), name, now)\n\tassert.Error(t, err)\n\tassert.Contains(t, err.Error(), \"Unable to read temporary backup file\")\n}", "title": "" }, { "docid": "b9842107d35d1237a8011ebd46e6289e", "score": "0.54329956", "text": "func TestAdd(t *testing.T) {\n\tfor _, test := range addResults {\n\t\tresult := Add(test.x, test.y)\n\t\tif result != test.expected {\n\t\t\tt.Fatal(\"Expected Result Not Given\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "33f9f1f38b6d4eebb227ccefc24c18a1", "score": "0.54226226", "text": "func (p *BBcAsset) AddFile(fileContent *[]byte) {\n\tp.AssetFileSize = uint32(binary.Size(fileContent))\n\tdigest := sha256.Sum256(*fileContent)\n\tp.AssetFileDigest = digest[:]\n}", "title": "" }, { "docid": "b594018f3b80fbe5b5abbe53af5aab3d", "score": "0.5413665", "text": "func TestIsFileExist1(t *testing.T) {\n\tisFileExist := IsFileExist(\"random-string\")\n\tif isFileExist {\n\t\tt.Errorf(\"Expected '%t' for a file that does not exist, got '%t' instead\\n\", false, true)\n\t}\n}", "title": "" }, { "docid": "5ce903c27aaee77c3c31829cc61962e0", "score": "0.5412769", "text": "func (publish *Impl) AddFile(filename string) (string, error) {\n\tcontents, err := utils.ReadFile(filename)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treader := strings.NewReader(string(contents))\n\thash, err := publish.shell.Add(reader)\n\treturn hash, err\n}", "title": "" }, { "docid": "e6bba7588d290d8000f564d5031086d3", "score": "0.5406675", "text": "func TestAdd(t *testing.T) {\n\tfmt.Println(\"TestAdd starting...\")\n\tfor _, dn := range addDNs {\n\t\taddReq := NewAddRequest(dn)\n\t\tfor _, attr := range addAttrs {\n\t\t\taddReq.AddAttribute(&attr)\n\t\t}\n\t\tfmt.Print(addReq)\n\t}\n\tfmt.Println(\"TestAdd finsished.\")\n}", "title": "" } ]
61af4e8de80287bf5ae8af1ce3314643
Write takes buffer p, performs XOR in a copy of the buffer and calls write on the underlying ReadWriter.
[ { "docid": "9ad479b639cb45ac7329a5d79ace4a17", "score": "0.6548004", "text": "func (s *ScrambleReadWriter) Write(p []byte) (n int, err error) {\n\tif cap(s.buffer) < cap(p) {\n\t\ts.buffer = make([]byte, 0, cap(p))\n\t} else {\n\t\ts.buffer = s.buffer[:0]\n\t}\n\tfor i := range p {\n\t\ts.buffer = append(s.buffer, p[i]^s.Key)\n\t}\n\treturn s.ReadWriter.Write(s.buffer)\n}", "title": "" } ]
[ { "docid": "db7abdab0e700cf2891ecf366ad9846b", "score": "0.6109522", "text": "func (b *Buffer) Write(p []byte) (n int, err error) {\n\tb.m.Lock()\n\tdefer b.m.Unlock()\n\treturn b.b.Write(p)\n}", "title": "" }, { "docid": "94dbcf5cf08ce4007ac8e3c218d1a1bb", "score": "0.610891", "text": "func (b *Buffer) Write(p []byte) (n int, err error) {\n\tb.buffer = append(b.buffer, p...)\n\tn = len(p)\n\treturn\n}", "title": "" }, { "docid": "85b9f89844d44d7d0b3642a2b0548cc2", "score": "0.6086536", "text": "func (b *Buffer) Write(p []byte) (n int, err error) {\n\tb.b = append(b.b, p...)\n\tb.j += len(p)\n\treturn len(p), nil\n}", "title": "" }, { "docid": "508a9d97143dd48f37663572114030a3", "score": "0.6085409", "text": "func (r *Writer) Write(p []byte) (n int, err error) {\n\tr.mx.Lock()\n\n\tif r.curr+len(p) > len(r.buf) {\n\t\tbuf := make([]byte, 2*len(r.buf)+len(p))\n\t\tcopy(buf, r.buf)\n\t\tr.buf = buf\n\t}\n\n\tcopy(r.buf[r.curr:], p)\n\tr.curr += len(p)\n\n\tr.mx.Unlock()\n\treturn\n}", "title": "" }, { "docid": "78dbca1a37deb7872a6899a8a5a37c36", "score": "0.60667944", "text": "func (b *DataBuffer) Write(p []byte) (n int, err error) {\n\tif b.ReadOnly {\n\t\tpanic(\"write operation not supported\")\n\t}\n\n\treturn b.Buffer.Write(p)\n}", "title": "" }, { "docid": "e2ad4f1847a314b956ae6a7d0a656434", "score": "0.60588455", "text": "func (b *readAtBuffer) Write(p []byte) (n int, err error) {\n\tn = copy(b.p, p)\n\tb.p = b.p[n:]\n\tif n < len(p) {\n\t\terr = errSpace\n\t}\n\treturn\n}", "title": "" }, { "docid": "77516b55be7aec132dcb7fbd5e75815e", "score": "0.6044496", "text": "func (b *buffer) Write(p []byte) (int, error) {\n\tb.data = append(b.data, p...)\n\treturn len(p), nil\n}", "title": "" }, { "docid": "a2295f8e451b5883bf15cb2fb7264ef0", "score": "0.6031152", "text": "func (b *Buffer) Write(p []byte) (int, error) {\n\tb.Lock()\n\tdefer b.Unlock()\n\treturn b.Buffer.Write(p)\n}", "title": "" }, { "docid": "3119832ebbbc1b81fdd7e79640fe6ab1", "score": "0.6005714", "text": "func (b *buffer) Write(p []byte) (n int, err error) {\n\tif len(p) == 0 {\n\t\treturn\n\t}\n\tvar m int\n\toff := b.top\n\tend := add(off, int64(len(p)))\n\tif end > b.writeLimit {\n\t\tm = int(b.writeLimit - off)\n\t\tp = p[:m]\n\t\terr = errWriteLimit\n\t}\n\tm = len(p) - len(b.data)\n\tif m > 0 {\n\t\toff += int64(m)\n\t\tp = p[m:]\n\t}\n\tfor len(p) > 0 {\n\t\tm = copy(b.data[b.index(off):], p)\n\t\toff += int64(m)\n\t\tp = p[m:]\n\t}\n\tn = int(off - b.top)\n\tb.setTop(off)\n\treturn n, err\n}", "title": "" }, { "docid": "e959c765cd6be1723024fd79dbc56a56", "score": "0.59924984", "text": "func (b *Buffer) Write(p []byte) (int, error) {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\treturn b.Buffer.Write(p)\n}", "title": "" }, { "docid": "2228fb0578cf466bc7114f25a1155b99", "score": "0.59495085", "text": "func (b *buffer) Write(p []byte) (n int, err error) {\n\tb.contents = append(b.contents, p...)\n\treturn len(p), nil\n}", "title": "" }, { "docid": "06e428d11a594e31f6ae7ef2c14f83b2", "score": "0.59489334", "text": "func (s *Buffer) Write(p []byte) (n int, err error) {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\treturn s.buffer.Write(p)\n}", "title": "" }, { "docid": "cb62cd55f57bb44e45e7af59e7c1b360", "score": "0.5945753", "text": "func (rw *OutputBuffer) Write(p []byte) (n int, err error) {\n\trw.Lock()\n\tn, err = rw.buf.Write(p) // and bytes.Buffer implements io.Writer\n\trw.Unlock()\n\treturn // implicit\n}", "title": "" }, { "docid": "f860993eb7f621c9988ce535754e0300", "score": "0.59246355", "text": "func (c *cbuf) Write(p []byte) (int, error) {\n\tif c.err != nil {\n\t\treturn 0, c.err\n\t}\n\thead, tail := c.split(p)\n\tn := c.n + len(tail)\n\tif n > len(c.buf) {\n\t\tx := n - len(c.buf)\n\t\tc.flush(c.buf[:x])\n\t\tcopy(c.buf[:], c.buf[x:])\n\t\tc.n -= x\n\t}\n\tif len(head) > 0 {\n\t\tc.flush(head)\n\t}\n\tcopy(c.buf[c.n:], tail)\n\tc.n = min(c.n+len(tail), len(c.buf))\n\treturn len(p), c.err\n}", "title": "" }, { "docid": "e4f7a2a1ca0efcf2082dd395edcbdd78", "score": "0.59163547", "text": "func (d *state) Write(p []byte) (written int, err error) {\n\tif d.state != spongeAbsorbing {\n\t\tpanic(\"sha3: write to sponge after read\")\n\t}\n\tif d.buf == nil {\n\t\td.buf = d.storage.asBytes()[:0]\n\t}\n\twritten = len(p)\n\n\tfor len(p) > 0 {\n\t\tif len(d.buf) == 0 && len(p) >= d.rate {\n\t\t\t// The fast path; absorb a full \"rate\" bytes of input and apply the permutation.\n\t\t\txorIn(d, p[:d.rate])\n\t\t\tp = p[d.rate:]\n\t\t\tkeccakF1600(&d.a)\n\t\t} else {\n\t\t\t// The slow path; buffer the input until we can fill the sponge, and then xor it in.\n\t\t\ttodo := d.rate - len(d.buf)\n\t\t\tif todo > len(p) {\n\t\t\t\ttodo = len(p)\n\t\t\t}\n\t\t\td.buf = append(d.buf, p[:todo]...)\n\t\t\tp = p[todo:]\n\n\t\t\t// If the sponge is full, apply the permutation.\n\t\t\tif len(d.buf) == d.rate {\n\t\t\t\td.permute()\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "dba62186b629763e78b096c4d8c79297", "score": "0.59140074", "text": "func (d *cmac) Write(p []byte) (n int, err os.Error) {\n\t// Xor input into ci.\n\tfor _, c := range p {\n\t\t// If ci is full, encrypt and start over.\n\t\tif d.p >= len(d.ci) {\n\t\t\td.c.Encrypt(d.ci, d.ci);\n\t\t\td.p = 0;\n\t\t}\n\t\td.ci[d.p] ^= c;\n\t\td.p++;\n\t}\n\treturn len(p), nil;\n}", "title": "" }, { "docid": "c449d1d013784fae3780f0001f8b88e8", "score": "0.58399945", "text": "func (rb *ringBuffer) Write(p []byte) (int, error) {\n\tfor _, b := range p {\n\t\trb.buffer[rb.wIndex] = b\n\t\trb.wIndex = (rb.wIndex + 1) & (ringBufferSize - 1)\n\t\tif rb.rIndex == rb.wIndex {\n\t\t\trb.rIndex = (rb.rIndex + 1) & (ringBufferSize - 1)\n\t\t}\n\t}\n\n\treturn len(p), nil\n}", "title": "" }, { "docid": "9313edcde0c73a9d55f6e7104ff5985e", "score": "0.5815656", "text": "func (b *Buffer) Write(p []byte) (n int, err error) {\n\tb.startWrite()\n\tm, ok := b.tryGrowByReslice(len(p))\n\tif !ok {\n\t\tm = b.grow(len(p))\n\t}\n\treturn copy(b.buf[m:], p), nil\n}", "title": "" }, { "docid": "8e01c0c6972a823828f78f27b31eeeb3", "score": "0.58066076", "text": "func (self *bufferImpl) Write(p []byte) (n int, err error) {\n\tif (self.offset + len64(p)) > len64(self.data) {\n\t\t// grow it up!\n\t\tcp := make([]byte, len(self.data) + len(p))\n\t\tcopy(cp, self.data)\n\t\tself.data = cp\n\t}\n\n\tcopy(self.data[self.offset:], p)\n\tn = len(p)\n\tself.offset += len64(p)\n\n\treturn\n}", "title": "" }, { "docid": "b82bb3c5b5cd13f23e9a91e7607eb8b6", "score": "0.56649065", "text": "func (b *buffer) Write(p []byte) (n int, err error) {\n\tm := b.Available()\n\tn = len(p)\n\tif m < n {\n\t\tn = m\n\t\tp = p[:m]\n\t\terr = ErrNoSpace\n\t}\n\tk := copy(b.data[b.front:], p)\n\tif k < n {\n\t\tcopy(b.data, p[k:])\n\t}\n\tb.front = b.addIndex(b.front, n)\n\treturn n, err\n}", "title": "" }, { "docid": "49ff7b26683cccc0972652f14ef30323", "score": "0.56465477", "text": "func (sb *seekableBuffer) Write(p []byte) (n int, err error) {\n\t// The current position we're already at is past the end of the data we\n\t// actually have. Extend our buffer up to our current position.\n\tif sb.position > len64(sb.data) {\n\t\textra := make([]byte, sb.position-len64(sb.data))\n\t\tsb.data = append(sb.data, extra...)\n\t}\n\n\tpositionFromEnd := len64(sb.data) - sb.position\n\ttailCount := positionFromEnd - len64(p)\n\n\tvar tailBytes []byte\n\tif tailCount > 0 {\n\t\ttailBytes = sb.data[len64(sb.data)-tailCount:]\n\t\tsb.data = append(sb.data[:sb.position], p...)\n\t} else {\n\t\tsb.data = append(sb.data[:sb.position], p...)\n\t}\n\n\tif tailBytes != nil {\n\t\tsb.data = append(sb.data, tailBytes...)\n\t}\n\n\tdataSize := len64(p)\n\tsb.position += dataSize\n\n\treturn int(dataSize), nil\n}", "title": "" }, { "docid": "2daa824a2fc6edef7e4470fa6cee3881", "score": "0.5631709", "text": "func (b *buf) Write(p []byte) (int, error) {\n\t*b = append(*b, p...)\n\treturn len(p), nil\n}", "title": "" }, { "docid": "72f5c12caccb20ee9df0088bf192d51b", "score": "0.5610275", "text": "func (d Digest128) Write(p []byte) Digest128 {\n\tn := len(p)\n\td.clen += n\n\n\tif d.tail > 0 {\n\t\t// Stick back pending bytes.\n\t\tnfree := d.Size() - d.tail // nfree ∈ [1, d.Size()-1].\n\t\tif len(p) <= nfree {\n\t\t\t// Everything can fit in buf\n\t\t\tfor i := 0; i < len(p); i++ {\n\t\t\t\td.buf[d.tail] = p[i]\n\t\t\t\td.tail++\n\t\t\t}\n\t\t\tif len(p) == int(nfree) {\n\t\t\t\td = d.bmixbuf()\n\t\t\t}\n\t\t\treturn d\n\t\t}\n\n\t\t// One full block can be formed.\n\t\tadd := p[:nfree]\n\t\tfor i := 0; i < len(add); i++ {\n\t\t\td.buf[d.tail] = add[i]\n\t\t\td.tail++\n\t\t}\n\n\t\t// Process the full block\n\t\td = d.bmixbuf()\n\n\t\tp = p[nfree:]\n\t}\n\n\td, tail := d.bmix(p)\n\n\t// Keep own copy of the 0 to Size()-1 pending bytes.\n\td.tail = len(tail)\n\tfor i := 0; i < d.tail; i++ {\n\t\td.buf[i] = tail[i]\n\t}\n\n\treturn d\n}", "title": "" }, { "docid": "5c2cd29762260b50b14ea1ec0a5e70f9", "score": "0.5592075", "text": "func (d *digest) Write(p []byte) (n int, err error) {\n\tfor i := 0; i < len(p); i++ {\n\t\td.crc = (d.crc >> 8) ^ d.tab[(int)(byte(d.crc)^p[i])&0xff]\n\t}\n\n\treturn len(p), nil\n}", "title": "" }, { "docid": "5b770de031fb99d1b327b71e4bc3a7d1", "score": "0.55661654", "text": "func (p *ByteBufferIO) Write(b []byte) (int, error) {\n\treturn p.buffer.WriteBinary(b)\n}", "title": "" }, { "docid": "14f802a7bcd7503f427ac124590c4f18", "score": "0.5561935", "text": "func (w *wsBufferWriter) Write(p []byte) (int, error) {\n\tw.mu.Lock()\n\tdefer w.mu.Unlock()\n\treturn w.buffer.Write(p)\n}", "title": "" }, { "docid": "6b5fd947210c97a5e3e80024d42f2a14", "score": "0.5553441", "text": "func (s *SafeByteBuffer) Write(p []byte) (n int, err error) {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\treturn s.buffer.Write(p)\n}", "title": "" }, { "docid": "6c73f00393d5769a7fba8da3666f48b9", "score": "0.55175394", "text": "func (r *RingBuffer) Write(p []byte) (n int, err error) {\n\tn = len(p)\n\tif n == 0 {\n\t\treturn 0, nil\n\t}\n\n\tfree := r.Free()\n\tif n > free {\n\t\tr.malloc(n - free)\n\t}\n\n\tif r.w >= r.r {\n\t\tc1 := r.size - r.w\n\t\tif c1 >= n {\n\t\t\tcopy(r.buf[r.w:], p)\n\t\t\tr.w += n\n\t\t} else {\n\t\t\tcopy(r.buf[r.w:], p[:c1])\n\t\t\tc2 := n - c1\n\t\t\tcopy(r.buf, p[c1:])\n\t\t\tr.w = c2\n\t\t}\n\t} else {\n\t\tcopy(r.buf[r.w:], p)\n\t\tr.w += n\n\t}\n\n\tif r.w == r.size {\n\t\tr.w = 0\n\t}\n\n\tr.isEmpty = false\n\n\treturn n, err\n}", "title": "" }, { "docid": "fc7865f48e02c0d96e018a732c0ba823", "score": "0.55171925", "text": "func (b *ByteBuffer) Write(p []byte) (int, error) {\n\tb.B = append(b.B, p...)\n\treturn len(p), nil\n}", "title": "" }, { "docid": "c0346248a2389f2509f1d977f537f1d5", "score": "0.5460391", "text": "func (w *Writer) Write(p []byte) (n int, err error)", "title": "" }, { "docid": "d9d88aba52b719d8bb4ba117126a2f95", "score": "0.5457408", "text": "func (b *Buffer) Write(p []byte) (n int, err error) {\n\tif b.file != nil {\n\t\treturn b.file.Write(p)\n\t}\n\treturn b.buf.Write(p)\n}", "title": "" }, { "docid": "b44c224a7555dc819ec1ad35c179a97a", "score": "0.5445306", "text": "func (w *Writer) Write(p []byte) (n int, err error) {\n\tif w.aes != nil {\n\t\treturn w.writeEncrypted(p)\n\t}\n\treturn w.writePlain(p)\n}", "title": "" }, { "docid": "dcdaa251b2f986946f2b683654724d9b", "score": "0.54436344", "text": "func (sw *secureWriter) Write(p []byte) (nn int, err error) {\n\tif len(p) == 0 {\n\t\treturn 0, nil\n\t}\n\n\tsw.lastNonce = sw.lastNonce + 1\n\tvar nonce [nonceLength]byte\n\tbinary.BigEndian.PutUint32(nonce[:], sw.lastNonce)\n\n\tout := box.Seal(nil, p, &nonce, sw.pub, sw.priv)\n\n\t// write nonce\n\terr = binary.Write(sw.w, binary.BigEndian, nonce)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// write length of the next message\n\terr = binary.Write(sw.w, binary.BigEndian, int16(len(out)))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// write encrypted message itself\n\t_, err = sw.w.Write(out)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn len(p), nil\n}", "title": "" }, { "docid": "4915a3b58110e3eb134ae98b422b6854", "score": "0.54227245", "text": "func (bf *BufferFile) Write(p []byte) (n int, err error) {\n\t// Do we have space?\n\tif available := cap(bf.buff) - bf.loc; available < len(p) {\n\t\t// How much should we expand by?\n\t\taddCap := cap(bf.buff)\n\t\tif addCap < len(p) {\n\t\t\taddCap = len(p)\n\t\t}\n\n\t\tnewBuff := make([]byte, len(bf.buff), cap(bf.buff)+addCap)\n\n\t\tcopy(newBuff, bf.buff)\n\n\t\tbf.buff = newBuff\n\t}\n\n\t// Write\n\tn = copy(bf.buff[bf.loc:cap(bf.buff)], p)\n\tbf.loc += n\n\tif len(bf.buff) < bf.loc {\n\t\tbf.buff = bf.buff[:bf.loc]\n\t}\n\n\treturn n, nil\n}", "title": "" }, { "docid": "62b113b05eddba23359f40318b98502c", "score": "0.54054487", "text": "func (bw *bitWriter) Write(p []byte) (int, error) {\n\tif bw.savedBits == 0 {\n\t\tn, err := bw.writer.Write(p)\n\t\tbw.written += int64(n)\n\t\treturn n, err\n\t}\n\tfor i, b := range p {\n\t\terr := bw.WriteByte(b)\n\t\tif err != nil {\n\t\t\treturn i, err\n\t\t}\n\t}\n\treturn len(p), nil\n}", "title": "" }, { "docid": "7ac3d932bcf4d5fa37cc408c44432ce4", "score": "0.53982395", "text": "func (d *digest) Write(p []byte) (nn int, err error) {\n\t//fmt.Printf(\"Getting %d bytes %x\\n\",len(p), p)\n\tnn = len(p)\n\t//d.len += uint64(nn)\n\n\t// If we have something left in the buffer\n\tif d.nx > 0 {\n\t\tn := uint8(len(p))\n\n\t\tvar i uint8\n\t\t// try to copy the rest n bytes free of the buffer into the buffer\n\t\t// then hash the buffer\n\n\t\tif (n + d.nx) > _Chunk {\n\t\t\tn = _Chunk - d.nx\n\t\t}\n\n\t\tfor i = 0; i < n; i++ {\n\t\t\t// copy n bytes to the buffer\n\t\t\td.x[d.nx+i] = p[i]\n\t\t}\n\n\t\td.nx += n\n\n\t\t// if we have exactly 1 block in the buffer then hash that block\n\t\tif d.nx == _Chunk {\n\t\t\tblock(d, d.x[0:_Chunk])\n\t\t\td.nx = 0\n\t\t}\n\n\t\tp = p[n:]\n\t}\n\n\timax := len(p) / _Chunk\n\t// For the rest, try hashing by the blocksize\n\tfor i := 0; i < imax; i++ {\n\t\tblock(d, p[:_Chunk])\n\t\tp = p[_Chunk:]\n\t}\n\n\t// Then stuff the rest that doesn't add up to a block to the buffer\n\tif len(p) > 0 {\n\t\td.nx = uint8(copy(d.x[:], p))\n\t\t//fmt.Printf(\"Length of p = %d, copied %d.\\n\", len(p), d.nx)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "de60d1ae867dd34aa73457ed48750e15", "score": "0.53945357", "text": "func (w *Writer) Write(p []byte) (int, error) {\n\tw.l.Lock()\n\tdefer w.l.Unlock()\n\tif w.w == nil {\n\t\treturn 0, io.EOF\n\t}\n\n\tsize := len(p)\n\tif w.b != nil {\n\t\tw.b.Write(p)\n\t\tp = w.b.Bytes()\n\t\tw.b = nil\n\t}\n\n\tb := new(bytes.Buffer)\n\tfor len(p) > 0 {\n\t\tn := bytes.IndexByte(p, '\\n')\n\t\tif n < 0 {\n\t\t\tw.b = new(bytes.Buffer)\n\t\t\tw.b.Write(p)\n\t\t\tbreak\n\t\t}\n\t\tb.Write(w.p)\n\t\tb.Write(p[:n+1])\n\t\tp = p[n+1:]\n\t}\n\n\tif b.Len() > 0 {\n\t\t_, err := b.WriteTo(w.w)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\treturn size, nil\n}", "title": "" }, { "docid": "b4965bf73298eced940f965032f3a2cb", "score": "0.53919685", "text": "func (buf *BufCloser) Write(p []byte) (int, error) {\n\treturn buf.buf.Write(p)\n}", "title": "" }, { "docid": "d37dc882bf36aff3ec837464d00ab61d", "score": "0.5391089", "text": "func (w *Writer) Write(p []byte) (n int, err error) {\n\treturn w.buf.Write(p)\n}", "title": "" }, { "docid": "e0459a9abceb7becc5a6452618dbd93f", "score": "0.5369127", "text": "func (w *ConWriter) Write(p []byte) (int, error) {\n\tif len(p) == 0 {\n\t\treturn 0, nil\n\t}\n\thdr, err := newBinHeader(len(p), false)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif _, err := hdr.WriteTo(w.w); err != nil {\n\t\treturn 0, err\n\t}\n\treturn w.w.Write(p)\n}", "title": "" }, { "docid": "7a4a1e1bd8580b6832ee4c2073445d33", "score": "0.5363928", "text": "func (e *Encoder) Write(p []byte) (n int, err error) {\n\tn, err = e.buf.Write(p)\n\tif err != nil {\n\t\treturn n, err\n\t}\n\n\te.count++\n\tif e.count >= e.blockLength {\n\t\tif err = e.writerBlock(); err != nil {\n\t\t\treturn n, err\n\t\t}\n\t}\n\n\treturn n, e.writer.Error\n}", "title": "" }, { "docid": "77dc381c176af54925298d382d2468c0", "score": "0.5348944", "text": "func (s Writer) Write(p []byte) (int, error) {\n\tnonce, err := newNonce()\n\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tenc := box.Seal(nil, p, &nonce, s.pub, s.priv)\n\t// tack the nonce onto the encrypted message\n\tencWithNonce := append(nonce[:], enc...)\n\n\tn, err := s.w.Write(encWithNonce)\n\n\t// return an error if the complete message wasn't written\n\t// this case also fulfills the contract that Write must return\n\t// an error if n < len(p) since len(encWithNonce) is guaranteed\n\t// to be greater than len(p)\n\tif n < len(encWithNonce) {\n\t\treturn n, ErrEncWrite\n\t}\n\n\treturn n, err\n}", "title": "" }, { "docid": "a64ad0ea6acdc55747251064e6f0585f", "score": "0.53329897", "text": "func (zw *Writer) Write(p []byte) (int, error) {\n\tpLen := len(p)\n\tif pLen == 0 {\n\t\treturn 0, nil\n\t}\n\n\tfor {\n\t\tn := copy(zw.inBufGo[zw.inBuf.size:cstreamInBufSize], p)\n\t\tzw.inBuf.size += C.size_t(n)\n\t\tp = p[n:]\n\t\tif len(p) == 0 {\n\t\t\t// Fast path - just copy the data to input buffer.\n\t\t\treturn pLen, nil\n\t\t}\n\t\tif err := zw.flushInBuf(); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "885e4dd1c05b76f39a1485b6a33fc647", "score": "0.53199196", "text": "func (w *fixedWriter) Write(p []byte) (n int, err error) {\n\tlenp := len(p)\n\tif w.pos+lenp > cap(w.b) {\n\t\treturn 0, io.ErrShortWrite\n\t}\n\tn = lenp\n\tw.pos += copy(w.b[w.pos:], p)\n\treturn\n}", "title": "" }, { "docid": "928d535e0f0d79b9bf1a5bfb2ef85cd9", "score": "0.53039294", "text": "func (b *BytePacketBuffer) Write(p []byte) (n int, err error) {\n\tfor _, byte := range p {\n\t\tpos := b.Pos()\n\t\terr := b.writePacketByte(byte)\n\t\tif err != nil {\n\t\t\treturn b.Pos() - pos, err\n\t\t}\n\t}\n\n\treturn b.Pos(), nil\n}", "title": "" }, { "docid": "cb70d98ab4441b639085c9e6e06e2a51", "score": "0.52949363", "text": "func (f *File) Write(p []byte) (n int, err error) {\n\tf.w.m.Lock()\n\tfor n != len(p) {\n\t\tvar nn int\n\t\tnn, err = f.sysrw(true, p[n:])\n\t\tn += nn\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\tf.w.m.Unlock()\n\treturn\n}", "title": "" }, { "docid": "0ed75b775ad34bcaa443e511f783b575", "score": "0.5293725", "text": "func (s *TestLogWriter) Write(p []byte) (count int, err error) {\n\ts.lock.Lock()\n\n\t// Copy the message into a fresh byte slice, otherwise we'll get problems with overwrites etc.\n\tdst := make([]byte, len(p))\n\tcopy(dst, p)\n\n\t// Append the copied buffer\n\ts.Buffer = append(s.Buffer, dst)\n\ts.lock.Unlock()\n\treturn\n}", "title": "" }, { "docid": "060468e7408c41a3006f847ee9490f61", "score": "0.5292521", "text": "func (sz *Writer) Write(p []byte) (int, error) {\n\tif sz.err != nil {\n\t\treturn 0, sz.err\n\t}\n\n\t_, sz.err = sz.bw.Write(p)\n\tif sz.err != nil {\n\t\treturn 0, sz.err\n\t}\n\n\treturn len(p), nil\n}", "title": "" }, { "docid": "9554450e937d96fff2fb14fac52e9e21", "score": "0.52841544", "text": "func (l *LogBuffer) Write(p []byte) (n int, err error) {\n\tlog.Printf(\"%s: %s\", l.prefix, p)\n\tl.buffer = append(l.buffer, p...)\n\treturn len(p), nil\n}", "title": "" }, { "docid": "514935c9714383955632596bccb038ae", "score": "0.5275271", "text": "func (b *WriteBuffer) Write(p []byte) (n int, err error) {\n\tresult := b.WriteBytes(p)\n\tif result > 0 {\n\t\treturn result, nil\n\t} else {\n\t\treturn result, &BaseError{\"Not enough space to write\"}\n\t}\n}", "title": "" }, { "docid": "1a876f37a10a1cb6639180be88602555", "score": "0.525072", "text": "func (b *Bytes) Write(p []byte) (int, error) {\n\t*b = append(*b, p...)\n\treturn len(p), nil\n}", "title": "" }, { "docid": "695279db429d55fe1a406088f821890b", "score": "0.52385056", "text": "func (this *RingBuffer) Write(p []byte) (int, error) {\n\tif this.done {\n\t\treturn 0, errors.New(\"This buffer has been marked as done. Use Reset() to reopen the buffer for writing\")\n\t}\n\n\tif len(p) > this.maxSize {\n\t\treturn -1, errors.New(\"Size to write exceeds the buffer size\")\n\t}\n\n\tthis.writeLock.L.Lock()\n\tthis.desiredWriteLock.Lock()\n\tthis.desiredWriteLength = len(p)\n\tthis.desiredWriteLock.Unlock()\n\n\tfor !this.isSafeToWrite(len(p)) {\n\t\tthis.writeLock.Wait()\n\t}\n\n\tn, err := this.Buffer.Write(p)\n\tif err != nil {\n\t\tthis.writeLock.L.Unlock()\n\t\treturn n, err\n\t}\n\tthis.writeLock.L.Unlock()\n\n\tthis.bufLock.Lock()\n\tthis.diff = this.diff + n\n\tthis.bufLock.Unlock()\n\n\tthis.desiredWriteLock.Lock()\n\tthis.desiredWriteLength = 0\n\tthis.desiredWriteLock.Unlock()\n\tthis.readLock.Signal()\n\n\treturn n, err\n}", "title": "" }, { "docid": "0ae91a8ab44ca1f6252841798e558c64", "score": "0.5235383", "text": "func (r *rwCounter) Write(p []byte) (int, error) {\r\n\tr.Lock()\r\n\tdefer r.Unlock()\r\n\tn, err := r.w.Write(p)\r\n\tif err == nil {\r\n\t\tr.n += int64(n)\r\n\t\tr.nops++\r\n\t}\r\n\treturn n, err\r\n}", "title": "" }, { "docid": "bddf3b1bbf84103c1c580f876cda262e", "score": "0.5231892", "text": "func (f *RedactingWriter) Write(p []byte) (int, error) {\n\tfReady, buffered := (f.target != nil), (f.targetBuf != nil)\n\n\tif !fReady && !buffered {\n\t\treturn 0, errors.New(\"No viable target defined\")\n\t}\n\n\tcleaned, err := log.CredentialsCleanerBytes(p)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tfor _, r := range f.r {\n\t\tif r.Regex != nil && r.ReplFunc != nil {\n\t\t\tcleaned = r.Regex.ReplaceAllFunc(cleaned, r.ReplFunc)\n\t\t}\n\t}\n\n\tvar n int\n\tif buffered {\n\t\tn, err = f.targetBuf.Write(cleaned)\n\t} else {\n\t\tn, err = f.target.Write(cleaned)\n\t}\n\n\tif n != len(cleaned) {\n\t\terr = io.ErrShortWrite\n\t}\n\n\treturn len(p), err\n}", "title": "" }, { "docid": "63a3cedf6c26d13c26d53986bec66ebf", "score": "0.5224714", "text": "func (writer *copyWriter) Write(p []byte) (n int, err error) {\n\twriter.lock.RLock()\n\tdefer writer.lock.RUnlock()\n\n\twriter.contents = append(writer.contents, p...)\n\treturn len(p), nil\n}", "title": "" }, { "docid": "e83360b4d37a4549a7c74f637067cc86", "score": "0.522056", "text": "func (buf *buffer) Write(c *quantumfs.Ctx, in []byte, offset uint32) uint32 {\n\tpanic(\"Error: The Write function of Buffer is not implemented\")\n}", "title": "" }, { "docid": "6e3ea6e4c1784667c81c7da153339161", "score": "0.5219887", "text": "func (b *Block) Write(p []byte) (int, error) {\n\tsizeP := len(p)\n\tsizeSrc := len(b.Source)\n\tn := 0\n\ti := 0\n\t// Overwrite our b.Source starting at b.Cursor until we need to\n\t// allocate a larger slice\n\tfor ; i < sizeP && b.Cursor < sizeSrc; i++ {\n\t\tb.Source[b.Cursor] = p[i]\n\t\tb.Cursor++\n\t\tn++\n\t}\n\t// If sizeP puts us past the end of b.Source, append until we're done\n\tfor ; i < sizeP; i++ {\n\t\tb.Source = append(b.Source, p[i])\n\t\tb.Cursor++\n\t\tn++\n\t}\n\treturn n, nil\n}", "title": "" }, { "docid": "3f7b28a628dfb04c45fb0730cc9d20a7", "score": "0.5210108", "text": "func (w *Writer) Write(p []byte) (int, error) {\n\tw.Lock()\n\tdefer w.Unlock()\n\n\ttotal := 0\n\tfor len(p) > 0 {\n\t\temit := true\n\t\ti := bytes.IndexByte(p, '\\n')\n\t\tif i < 0 {\n\t\t\t// No newline, we will buffer everything.\n\t\t\ti = len(p)\n\t\t\temit = false\n\t\t}\n\n\t\tn, err := w.buf.Write(p[:i])\n\t\tif err != nil {\n\t\t\treturn total, err\n\t\t}\n\t\ttotal += n\n\n\t\tp = p[i:]\n\n\t\tif emit {\n\t\t\t// Skip the newline, but still count it.\n\t\t\tp = p[1:]\n\t\t\ttotal++\n\n\t\t\tw.emit(w.buf.Bytes())\n\t\t\tw.buf.Reset()\n\t\t}\n\t}\n\n\treturn total, nil\n}", "title": "" }, { "docid": "e0a4b3904e814418a35e28e17c36a35c", "score": "0.5186485", "text": "func (bbw *blockingByteWriter) Write(p []byte) (int, error) {\n\tfor i, b := range p {\n\t\terr := bbw.WriteByte(b)\n\t\tif err != nil {\n\t\t\treturn i, err\n\t\t}\n\t}\n\treturn len(p), nil\n}", "title": "" }, { "docid": "d0a27a51e30366a082a707b87ef948c7", "score": "0.51791596", "text": "func (z *Writer) Write(p []byte) (int, error) {\n\tfmt.Println(\"Write!!!!\")\n\n\tif z.err != nil {\n\t\treturn 0, z.err\n\t}\n\n\tp2 := make([]byte, len(p))\n\tcopy(p2, p)\n\tif !bytes.Equal(p2, p) {\n\t\tfmt.Println(\"diff origin in Write!\")\n\t}\n\n\tvar n int\n\t// Write the GZIP header lazily.\n\tif !z.wroteHeader {\n\t\tz.wroteHeader = true\n\t\tz.buf = [10]byte{0: gzipID1, 1: gzipID2, 2: gzipDeflate}\n\t\tif z.Extra != nil {\n\t\t\tz.buf[3] |= 0x04\n\t\t}\n\t\tif z.Name != \"\" {\n\t\t\tz.buf[3] |= 0x08\n\t\t}\n\t\tif z.Comment != \"\" {\n\t\t\tz.buf[3] |= 0x10\n\t\t}\n\t\tif !bytes.Equal(p2, p) {\n\t\t\tfmt.Println(\"diff origin in Write1!\")\n\t\t}\n\t\tif z.ModTime.After(time.Unix(0, 0)) {\n\t\t\t// Section 2.3.1, the zero value for MTIME means that the\n\t\t\t// modified time is not set.\n\t\t\tle.PutUint32(z.buf[4:8], uint32(z.ModTime.Unix()))\n\t\t}\n\t\tif z.level == BestCompression {\n\t\t\tz.buf[8] = 2\n\t\t} else if z.level == BestSpeed {\n\t\t\tz.buf[8] = 4\n\t\t}\n\t\tz.buf[9] = z.OS\n\t\tif !bytes.Equal(p2, p) {\n\t\t\tfmt.Println(\"diff origin in Write1-5!\")\n\t\t}\n\t\t_, z.err = z.w.Write(z.buf[:10]) // ここ?\n\t\tfmt.Println(\"z.buf\", z.buf, z.buf[:10])\n\t\tif !bytes.Equal(p2, p) {\n\t\t\tfmt.Println(\"diff origin in Write2!\")\n\t\t}\n\t\tif diff := cmp.Diff(p2, p); diff != \"\" {\n\t\t\tfmt.Printf(\"got: %v,want: %v, diff: %s\\n\", p2, p, diff)\n\t\t}\n\t\t// if diff := cmp.Diff(string(p2), string(p)); diff != \"\" {\n\t\t// \tfmt.Printf(\"got: %v,want: %v, diff: %s\\n\", string(p2), string(p), diff)\n\t\t// }\n\t\tif z.err != nil {\n\t\t\treturn 0, z.err\n\t\t}\n\n\t\tif z.Extra != nil {\n\t\t\tz.err = z.writeBytes(z.Extra)\n\t\t\tif z.err != nil {\n\t\t\t\treturn 0, z.err\n\t\t\t}\n\t\t}\n\t\tif z.Name != \"\" {\n\t\t\tz.err = z.writeString(z.Name)\n\t\t\tif z.err != nil {\n\t\t\t\treturn 0, z.err\n\t\t\t}\n\t\t}\n\t\tif z.Comment != \"\" {\n\t\t\tz.err = z.writeString(z.Comment)\n\t\t\tif z.err != nil {\n\t\t\t\treturn 0, z.err\n\t\t\t}\n\t\t}\n\t\tif z.compressor == nil {\n\t\t\tz.compressor, _ = flate.NewWriter(z.w, z.level)\n\t\t}\n\t}\n\tif !bytes.Equal(p2, p) {\n\t\tfmt.Println(\"diff origin in Write3!\")\n\t}\n\n\tz.size += uint32(len(p))\n\tz.digest = crc32.Update(z.digest, crc32.IEEETable, p)\n\tn, z.err = z.compressor.Write(p)\n\n\tfmt.Println(\"koko\")\n\tif !bytes.Equal(p2, p) {\n\t\tfmt.Println(\"diff after in Write4!\")\n\t}\n\treturn n, z.err\n}", "title": "" }, { "docid": "0165107427445395ef1a68962f295790", "score": "0.51710683", "text": "func (b *buffer) Read(p []byte) (int, error) {\n\tvar err error\n\tn := copy(p, b.data[b.read:])\n\tb.read += n\n\tif b.read == len(b.data) {\n\t\terr = io.EOF\n\t}\n\treturn n, err\n}", "title": "" }, { "docid": "13e9d50130aa44277a70f83299702aee", "score": "0.5163716", "text": "func (w Writer) Write(p []byte) (n int, err error) {\n\treturn w.baseWriter.Write(p)\n}", "title": "" }, { "docid": "d4346698d532cc244f40fb57204c680d", "score": "0.5149572", "text": "func (f *FileRotator) writeToBuffer(p []byte) (int, error) {\n\tf.bufLock.Lock()\n\tdefer f.bufLock.Unlock()\n\treturn f.bufw.Write(p)\n}", "title": "" }, { "docid": "300dcaf49cc4c57128013b9e58293fec", "score": "0.51457417", "text": "func (g *DirectGateway) Write(wb *[]byte, n *int) error {\n\treturn ptyReadLock(g, func() (err error) {\n\t\t*n, err = g.pty.Write(*wb)\n\t\treturn\n\t})\n}", "title": "" }, { "docid": "279aaf7b197447bb50b1ba5d555609c5", "score": "0.51407146", "text": "func (st *TLpasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) WriteTo(_os *codec.Buffer) error {\n\tvar err error\n\n\terr = st.Data.WriteBlock(_os, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_ = err\n\n\treturn nil\n}", "title": "" }, { "docid": "2076e0571ac8bb1cc876c9d07c7fb5be", "score": "0.51159495", "text": "func execmBufferWrite(_ int, p *gop.Context) {\n\targs := p.GetArgs(2)\n\tret, ret1 := args[0].(*bytes.Buffer).Write(args[1].([]byte))\n\tp.Ret(2, ret, ret1)\n}", "title": "" }, { "docid": "e1d1c46bfc7b1ed81a2fdb4d10309646", "score": "0.51084673", "text": "func (b *Builder) Write(p []byte) (int, error) {\n\tb.buf = append(b.buf, p...)\n\treturn len(p), nil\n}", "title": "" }, { "docid": "1c9b83e69032fafdcf9b44a7a7d755bd", "score": "0.5101843", "text": "func (t *transport) Write(p []byte) (n int, err error) {\n\tn, err = t.buf.Write(p)\n\tt.LogBytes(client, n, err)\n\treturn\n}", "title": "" }, { "docid": "6c62ef9eceb537237223836804c3fd06", "score": "0.51001555", "text": "func (lb *LoggingBuffer) Write(p []byte) (int, error) {\n\tif lb.name != \"\" {\n\t\tfmt.Fprintf(lb.w, \"[%s] \", lb.name)\n\t}\n\n\tfmt.Fprintf(lb.w, \"[WRITE] %x\\n\", p)\n\treturn lb.rw.Write(p)\n}", "title": "" }, { "docid": "c530c12d2d8faa8c49c4ce570948caf3", "score": "0.509412", "text": "func (c *Codec) Write(p []byte) {\n\tc.buff.Write(p)\n}", "title": "" }, { "docid": "69ef9d8a95d9a27b671e16f774a383a1", "score": "0.5092397", "text": "func (m *Decoder) Write(addr int, p []byte) (n int, err error) {\n\treturn m.M.Write(addr, p)\n}", "title": "" }, { "docid": "ddd157501f17a17fdf11b57688cc2cff", "score": "0.5070885", "text": "func Write(p []byte) (n int, err error) {\n\treturn Global.Write(p)\n}", "title": "" }, { "docid": "d69f8b3c3920146efb3c2529a2574007", "score": "0.50650495", "text": "func (bc *BufferConn) Write(p []byte) (int, error) {\n\treturn bc.client.Write(p)\n}", "title": "" }, { "docid": "ccb83a430d2c046bbbbfd8ce27be163d", "score": "0.50571054", "text": "func (w *Writer) Write(p []byte) (n int, err error) {\n\tw.m.Lock()\n\tdefer w.m.Unlock()\n\n\twnd := w.limiter.currentWindow(w.streamId)\n\tif wnd > 0 {\n\t\tn = len(p)\n\t\tif n > wnd {\n\t\t\tn = wnd\n\t\t}\n\t\tp = p[:n]\n\t\tn, err = w.source.Write(p)\n\t\tw.limiter.consumeWindow(w.streamId, n)\n\t} else {\n\t\tif w.limiter.blocking {\n\t\t\ttime.Sleep(time.Duration(w.limiter.taktTime) * time.Millisecond)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "8419444dd51bf3e305a17626a8d3a0ef", "score": "0.50431424", "text": "func (rw *MemResponseWriter) Write(p []byte) (n int, err error) {\n\trw.Data = append(rw.Data, p...)\n\tn = len(p)\n\treturn\n}", "title": "" }, { "docid": "fce5b591ef5f6982975c4712a06e7655", "score": "0.50314146", "text": "func (b *Buffer) Read(p []byte) (n int, err error) {\n\tn = copy(p, b.buffer[b.readpos:])\n\tb.readpos += n\n\tif b.readpos == len(b.buffer) {\n\t\terr = io.EOF\n\t}\n\treturn\n}", "title": "" }, { "docid": "c6f52d0b0e8733f26e26456d95fff618", "score": "0.50214833", "text": "func (b *testBuff) Write(p []byte) (int, error) {\n\tb.writeCount++\n\treturn len(p), nil\n}", "title": "" }, { "docid": "354fc09546ce3c34775174cc0240468c", "score": "0.5015407", "text": "func (w Writer) Write(p []byte) (int, error) {\n\tif w.fil == nil {\n\t\treturn 0, nil\n\t}\n\n\tn, err := w.fil.Write(p)\n\tif err != nil {\n\t\treturn n, errors.WithStack(err)\n\t}\n\n\treturn n, nil\n}", "title": "" }, { "docid": "fefcadc295668ddff5fdcee93d0114c4", "score": "0.50131863", "text": "func (z *Zap) Write(p []byte) (n int, err error) {\n\tz.Debug(string(p))\n\treturn len(p), nil\n}", "title": "" }, { "docid": "ce9c90fa6f4fc2e3c5b7a4dace63cf51", "score": "0.5008557", "text": "func (w *CompressWriter) Write(p []byte) (int, error) {\n\tif w.compressionType == CompressNone {\n\t\treturn w.Writer.Write(p)\n\t}\n\n\tvar compressWriter io.WriteCloser\n\tvar err error\n\tbuf := newBuffer()\n\tdefer bufPool.Put(buf)\n\n\tswitch w.compressionType {\n\tcase CompressGzip:\n\t\tcompressWriter, err = gzip.NewWriterLevel(buf, w.compressionLevel)\n\tcase CompressZlib:\n\t\tcompressWriter, err = zlib.NewWriterLevel(buf, w.compressionLevel)\n\t}\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tif n, err := compressWriter.Write(p); err != nil {\n\t\t_ = compressWriter.Close()\n\t\treturn n, err\n\t}\n\t_ = compressWriter.Close()\n\n\treturn w.Writer.Write(buf.Bytes())\n}", "title": "" }, { "docid": "caadb8cb70f10620f6efea04b301a984", "score": "0.5005366", "text": "func (sw *secureWriter) Write(p []byte) (int, error) {\n\tn := len(p)\n\n\t// assert: 0 < n <= math.MaxUint16\n\tif n == 0 {\n\t\treturn 0, nil\n\t}\n\tif n > math.MaxUint16 {\n\t\treturn 0, fmt.Errorf(\"message too large: %d > %d\", n, math.MaxUint16)\n\t}\n\n\t// message struct\n\tvar size [4]byte\n\tvar nonce [24]byte\n\tvar body []byte\n\n\t// size\n\tbinary.BigEndian.PutUint32(size[:], uint32(box.Overhead+n))\n\t_, err := sw.writer.Write(size[:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// create nonce\n\t_, err = io.ReadFull(rand.Reader, nonce[:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t_, err = sw.writer.Write(nonce[:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// seal p into body\n\tbody = box.Seal(nil, p, &nonce, &sw.pub, &sw.priv)\n\t_, err = sw.writer.Write(body)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn n, err\n}", "title": "" }, { "docid": "9b9eaf770fb236626e71b92f8cb58258", "score": "0.4997154", "text": "func (e *encoder) writeBuffer(s *compiler.S, dst, src *codegen.Value) {\n\tsize := src.Index(0, compiler.BufSize).Load()\n\tbytes := src.Index(0, compiler.BufData).Load()\n\te.writeBytes(s, dst, size, bytes)\n}", "title": "" }, { "docid": "92c824a9be15bc4b77d4957ba8802275", "score": "0.49946797", "text": "func (l *ChanLogger) Write(p []byte) (int, error) {\n\tbuf := l.getBuffer()\n\tbuf = append(buf[:0], p...)\n\n\tl.recv <- buf\n\treturn len(buf), nil\n}", "title": "" }, { "docid": "024be4653b4dd7f5de5dcc0b3de9ab8a", "score": "0.4985966", "text": "func (b *memBuffer) write(p []byte) (n int) {\n\tif m, ok := b.grow(int64(len(p))); ok {\n\t\tn = copy(b.buf[m:], p)\n\t\tb.len += int64(n)\n\t}\n\treturn n\n}", "title": "" }, { "docid": "f988fa762cc0fc0833de1c1030795686", "score": "0.49838117", "text": "func (w *AgentWriter) Write(p []byte) (n int, err error) {\n\tif w.debug {\n\t\tfmt.Println(string(p))\n\t}\n\n // clears buffer when buffer size is reached\n // TODO: make buffer a FIFO queue instead\n\tif len(w.bytes) > buffersize {\n\t\tw.bytes = make([]byte, 0)\n\t}\n\n\tn = len(p)\n\tw.bytes = append(w.bytes, p...)\n\terr = nil\n\n\treturn n, err\n}", "title": "" }, { "docid": "9a937e2a84d89089d9d9b69b44153e3a", "score": "0.49809396", "text": "func (w *Writer) Write(p []byte) (n int, errRet error) {\n\tif w.err != nil {\n\t\treturn 0, w.err\n\t}\n\tif !w.wroteHeader {\n\t\tcopy(w.enc, magicChunk)\n\t\tif _, err := w.w.Write(w.enc[:len(magicChunk)]); err != nil {\n\t\t\tw.err = err\n\t\t\treturn n, err\n\t\t}\n\t\tw.wroteHeader = true\n\t}\n\tfor len(p) > 0 {\n\t\tvar uncompressed []byte\n\t\tif len(p) > maxUncompressedChunkLen {\n\t\t\tuncompressed, p = p[:maxUncompressedChunkLen], p[maxUncompressedChunkLen:]\n\t\t} else {\n\t\t\tuncompressed, p = p, nil\n\t\t}\n\t\tchecksum := crc(uncompressed)\n\n\t\t// Compress the buffer, discarding the result if the improvement\n\t\t// isn't at least 12.5%.\n\t\tchunkType := uint8(chunkTypeCompressedData)\n\t\tchunkBody, err := Encode(w.enc, uncompressed)\n\t\tif err != nil {\n\t\t\tw.err = err\n\t\t\treturn n, err\n\t\t}\n\t\tif len(chunkBody) >= len(uncompressed)-len(uncompressed)/8 {\n\t\t\tchunkType, chunkBody = chunkTypeUncompressedData, uncompressed\n\t\t}\n\n\t\tchunkLen := 4 + len(chunkBody)\n\t\tw.buf[0] = chunkType\n\t\tw.buf[1] = uint8(chunkLen >> 0)\n\t\tw.buf[2] = uint8(chunkLen >> 8)\n\t\tw.buf[3] = uint8(chunkLen >> 16)\n\t\tw.buf[4] = uint8(checksum >> 0)\n\t\tw.buf[5] = uint8(checksum >> 8)\n\t\tw.buf[6] = uint8(checksum >> 16)\n\t\tw.buf[7] = uint8(checksum >> 24)\n\t\tif _, err = w.w.Write(w.buf[:]); err != nil {\n\t\t\tw.err = err\n\t\t\treturn n, err\n\t\t}\n\t\tif _, err = w.w.Write(chunkBody); err != nil {\n\t\t\tw.err = err\n\t\t\treturn n, err\n\t\t}\n\t\tn += len(uncompressed)\n\t}\n\treturn n, nil\n}", "title": "" }, { "docid": "d8296a77272a06b45422c159d5fbe033", "score": "0.497088", "text": "func PartOneXOR(r io.Reader, w io.Writer) error {\n\tdatastream, err := io.ReadAll(r)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not read input: %w\", err)\n\t}\n\n\tstartOfPacket, err := findMarkerXOR(datastream, 4)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = fmt.Fprintf(w, \"%d\", startOfPacket)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not write answer: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bf44ade2661cc2ef5c9fbe410a4e6ce3", "score": "0.49665868", "text": "func xorbyte(dst *state, v byte, pos uint) {\n\tdst.bytes()[pos] ^= v\n}", "title": "" }, { "docid": "be748e704205c83810d0c982148e154d", "score": "0.49655724", "text": "func (p BufferedPipe) Write(bz []byte) (n int, err error) {\n\treturn p.Writer.Write(bz)\n}", "title": "" }, { "docid": "0a372ce5371044a6e86db6c16fd2910e", "score": "0.49643892", "text": "func (w *Writer) Write(p []byte) (n int, err error) {\n\tn, err = w.writer.Write(p)\n\tif err != nil {\n\t\treturn n, err\n\t}\n\terr = w.writer.Flush()\n\treturn n, err\n}", "title": "" }, { "docid": "0e1e54db76d5c1262980374e2ce9f7c6", "score": "0.4963002", "text": "func (b *Reader) Copy(p []byte) (n int, e error) {\n n = len(p)\n\n if b.w == b.r || n == 0 {\n return 0, nil\n }\n\n if n > b.w-b.r {\n n = b.w - b.r\n }\n\n copy(p[0:n], b.buf[b.r:])\n b.r += n\n return n, nil\n}", "title": "" }, { "docid": "85b922982621aaf0288165b442d58650", "score": "0.49502367", "text": "func (w *writeCloser) Write(p []byte) (int, error) {\n\tn, err := w.w.Write(p)\n\tif err != nil {\n\t\tw.err = err\n\t\treturn n, err\n\t}\n\n\t_, err = w.h.Write(p)\n\tif err != nil {\n\t\tw.err = err\n\t\treturn n, err\n\t}\n\n\treturn n, nil\n}", "title": "" }, { "docid": "a61204b5a5fd5634b2284bae599ad228", "score": "0.49487692", "text": "func (bin Binary) WriteBuffer(buffer *OutBuffer) error {\n\tbuffer.Append([]byte(bin)...)\n\treturn nil\n}", "title": "" }, { "docid": "31b41d44cade81c417660745488a6e06", "score": "0.49471617", "text": "func (w *Writer) Write(p []byte) (n int, err error) {\n\tif len(p) == 0 {\n\t\treturn 0, nil\n\t}\n\tw.mu.Lock()\n\tdefer w.mu.Unlock()\n\tif w.err != nil {\n\t\treturn 0, w.err\n\t}\n\tif len(w.buf) > 0 {\n\t\t// Goroutine has started, but is waiting for flush.\n\t\t// Append data to buffer without exceeding capacity.\n\t\tn = copy(w.buf[len(w.buf):cap(w.buf)], p)\n\t\tw.buf = w.buf[:len(w.buf)+n]\n\t\tp = p[n:]\n\t\tif len(w.buf) < cap(w.buf) {\n\t\t\t// Not enough data to trigger a flush.\n\t\t\treturn n, nil\n\t\t}\n\t\tw.flushLocked()\n\t\tif w.err != nil {\n\t\t\treturn n, w.err\n\t\t}\n\t}\n\t// No goroutine running. First, synchronously batch any data from the\n\t// beginning of the current write until the remaining data is less than the\n\t// buffer size.\n\tfor len(p) >= cap(w.buf) {\n\t\tvar nn int\n\t\tnn, w.err = w.w.Write(p[:cap(w.buf)])\n\t\tn += nn\n\t\tif err != nil {\n\t\t\tw.err = err\n\t\t\treturn n, w.err\n\t\t}\n\t\tp = p[nn:]\n\t}\n\t// Now the rest of the current write will fit inside the buffer.\n\tw.buf = append(w.buf, p...)\n\tn += len(p)\n\t// If the buffer has data, then we need to kick off a goroutine to write it.\n\tif len(w.buf) == 0 {\n\t\treturn n, nil\n\t}\n\tflushChan := make(chan struct{}, 1) // variable captured for AfterFunc\n\tw.flushChan = flushChan\n\tw.timer = time.AfterFunc(w.tafb, func() {\n\t\tselect {\n\t\tcase flushChan <- struct{}{}:\n\t\tdefault:\n\t\t\t// Already signaled.\n\t\t}\n\t})\n\tw.writeDone = make(chan struct{})\n\tgo w.backgroundWrite()\n\treturn n, nil\n}", "title": "" }, { "docid": "2a4722605941b496247abf0104091417", "score": "0.4938084", "text": "func (b *CopyBuffer) Read(p []byte) (int, error) {\n\tif b.Data == nil {\n\t\treturn 0, io.EOF\n\t}\n\t// Cap the end by the length of the data to avoid out of bounds.\n\tend := len(p) + b.Cursor\n\tif end > len(b.Data) {\n\t\tend = len(b.Data)\n\t}\n\t// Copy the data into the out buffer, advancing the cursor by the amount\n\t// copied.\n\tn := copy(p, b.Data[b.Cursor:end])\n\tb.Cursor += n\n\t// Reset the cursor once the buffer has been fully traversed.\n\tif b.Cursor >= len(b.Data) {\n\t\tb.Cursor = 0\n\t\treturn n, io.EOF\n\t}\n\treturn n, nil\n}", "title": "" }, { "docid": "20986d9eb023717c2c6cd4b073468836", "score": "0.49250215", "text": "func (bwr *BufferedWriterReader) Write(data []byte) (int, error) {\n\tn, err := bwr.buffer.Write(data)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn n, nil\n}", "title": "" }, { "docid": "31e2c61b182d540cffec8eb4f3c99be8", "score": "0.4919088", "text": "func (buf *Buffer) Overwrite(c byte) {\n\tif !buf.IsFull() {\n\t\tbuf.WriteByte(c)\n\t\treturn\n\t}\n\tbuf.buffer[buf.read] = c\n\tbuf.read = buf.mapIndex(buf.read + 1)\n}", "title": "" }, { "docid": "f26645341a65ad14e7a855b02f4319c7", "score": "0.49182385", "text": "func (pager *PagerWriter) Write(p []byte) (int, error) {\n\tif pager.Err != nil {\n\t\treturn 0, pager.Err\n\t}\n\tn, err := pager.stdin.Write(p)\n\tpager.Err = err\n\treturn n, err\n}", "title": "" }, { "docid": "61e0c9efd28b5c44d00f03406cb68eeb", "score": "0.4917262", "text": "func (this *Buffer) Write(b []byte) (int, error) {\n\treturn this.Buffer.Write(b)\n}", "title": "" }, { "docid": "91403abb43f402661bf5f5bb813caf22", "score": "0.49139807", "text": "func (b *Buffer) Overwrite(c byte) {\n\t// Need to update the index of the new oldest element if actually owerwriting\n\tif b.buf[b.next] != 0 {\n\t\tb.oldest = (b.oldest + 1) % len(b.buf)\n\t}\n\n\tb.buf[b.next] = c\n\tb.next = (b.next + 1) % len(b.buf)\n}", "title": "" } ]
d83f72e0f2a6a0e51189b2465a6a20ed
Pythonstyle modulus function (1 % 5 == 4, not 1)
[ { "docid": "1dfc9c03e3ecea841d114e73ca3a2ec1", "score": "0.77727395", "text": "func modulus(i int, m int) (r int) {\n\tr = i % m\n\tif r < 0 {\n\t\tr += m\n\t}\n\treturn\n}", "title": "" } ]
[ { "docid": "d643dc5bcfc1358e81281794ae7ebcf6", "score": "0.78021204", "text": "func mod(a, b int) int {\n\treturn (a%b + b) % b\n}", "title": "" }, { "docid": "d643dc5bcfc1358e81281794ae7ebcf6", "score": "0.78021204", "text": "func mod(a, b int) int {\n\treturn (a%b + b) % b\n}", "title": "" }, { "docid": "766c33793521ba52137883e5f09a8d28", "score": "0.77691126", "text": "func Mod(a int, b int) int {\n\treturn a % b\n}", "title": "" }, { "docid": "62f4350cc46751402c4c869274cb0c63", "score": "0.7666031", "text": "func Mod(a, b int) int {\n\treturn (a%b + b) % b\n}", "title": "" }, { "docid": "a1a2db2bf62cbaf1c73734515532729b", "score": "0.7628449", "text": "func mod(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}", "title": "" }, { "docid": "a1a2db2bf62cbaf1c73734515532729b", "score": "0.7628449", "text": "func mod(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}", "title": "" }, { "docid": "a1a2db2bf62cbaf1c73734515532729b", "score": "0.7628449", "text": "func mod(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}", "title": "" }, { "docid": "a1a2db2bf62cbaf1c73734515532729b", "score": "0.7628449", "text": "func mod(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}", "title": "" }, { "docid": "a1a2db2bf62cbaf1c73734515532729b", "score": "0.7628449", "text": "func mod(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}", "title": "" }, { "docid": "a1a2db2bf62cbaf1c73734515532729b", "score": "0.7628449", "text": "func mod(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}", "title": "" }, { "docid": "a1a2db2bf62cbaf1c73734515532729b", "score": "0.7628449", "text": "func mod(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}", "title": "" }, { "docid": "3ba740f7891696844a450ec7297f5cd5", "score": "0.76037306", "text": "func mod(a int, b int) int {\n m := a % b\n if a < 0 && b > 0 {\n m += b\n }\n return m\n}", "title": "" }, { "docid": "7c44a1bef50a1fdbf0a460ca135d0431", "score": "0.7460691", "text": "func pmod(x, y int) (int) {\n\treturn (x % y + y) % y\n}", "title": "" }, { "docid": "09a40f0298bc5246c9c148884a519269", "score": "0.7450721", "text": "func mod(a, b int) int {\n\treturn a - (b * (a / b))\n}", "title": "" }, { "docid": "2a12bc0cc83f34514c5a09ec7390a293", "score": "0.74167305", "text": "func mod(n, d int) int {\n\tans := n % d\n\tif ans < 0 {\n\t\tans += d\n\t}\n\treturn ans\n}", "title": "" }, { "docid": "d5b4506843d3f81ef63e2baff168904b", "score": "0.70584065", "text": "func modi(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}", "title": "" }, { "docid": "6b65cf1260113d8bf6b50f7e3bf7afb9", "score": "0.70472527", "text": "func mod(number int, length int) int {\n\tif number < 0 {\n\t\treturn mod(length+number, length)\n\t} else {\n\t\treturn number % length\n\t}\n}", "title": "" }, { "docid": "e70b25fecaf1d1b480b17c356e1c310e", "score": "0.7018143", "text": "func mod(a, b int) int {\n\treturn a - (b * int(math.Floor(float64(a)/float64(b))))\n}", "title": "" }, { "docid": "09b221d6396ad4f4b7b5424bfaeae291", "score": "0.69647264", "text": "func pmod(x, d int) int {\n\tx = x % d\n\tif x >= 0 {\n\t\treturn x\n\t}\n\tif d < 0 {\n\t\treturn x - d\n\t}\n\treturn x + d\n}", "title": "" }, { "docid": "dcd21bef8faec2b2b7eaf2de1a3e9376", "score": "0.6940115", "text": "func Remainder(x int, y int) int {\n\treturn x % y\n}", "title": "" }, { "docid": "f509ee12555c4502e621f3908ea29fc8", "score": "0.68757606", "text": "func ActualMod(x, y int) int {\n\treturn ((x % y) + y) % y\n}", "title": "" }, { "docid": "23d2a27f880156b5d09244124045a794", "score": "0.68543214", "text": "func modll(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}", "title": "" }, { "docid": "4938c3b6346ab54df7eea90b9e245a8d", "score": "0.68504286", "text": "func rotatingMod(a, b int) int {\n\tif b < 0 {\n\t\tb = -b\n\t}\n\tif a < 0 {\n\t\tif c := b + a%b; c == b {\n\t\t\treturn 0\n\t\t} else {\n\t\t\treturn c\n\t\t}\n\t} else {\n\t\treturn a % b\n\t}\n}", "title": "" }, { "docid": "b686ea2a3d70915c62a26db5a1b71b09", "score": "0.6820675", "text": "func Mod(i, n int) bool {\n\tif (i % n) == 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5609d3fef04c5c0258544c4d5ffe047c", "score": "0.6760632", "text": "func Modulus() *big.Int {\n\treturn new(big.Int).Set(&_modulus)\n}", "title": "" }, { "docid": "daf31b4efb9545ffc0359f716cdeac30", "score": "0.67552817", "text": "func Mod(i *Skalar, modulus *Skalar) *Skalar {\n\treturn (*Skalar)(new(big.Int).Mod((*big.Int)(i), (*big.Int)(modulus)))\n}", "title": "" }, { "docid": "82f6c57dd65d4b705be9b69a2a70359c", "score": "0.6672682", "text": "func ExpMod(x, e, p int64) int64 {\n\tr := int64(1)\n\tfor e != 0 {\n\t\tif e&1 != 0 {\n\t\t\tr = r * x % p\n\t\t}\n\t\tx = x * x % p\n\t\te >>= 1\n\t}\n\treturn r\n}", "title": "" }, { "docid": "32b12102274e111c361e76f54dfb539b", "score": "0.66309124", "text": "func mod(a float64, b float64) float64 {\n\treturn a - (b * math.Floor(a/b))\n}", "title": "" }, { "docid": "f33ea1c26ced59184b0614796b98a1e4", "score": "0.6609585", "text": "func mod(x, p uint64) uint64 {\n\tfor deg(x) >= deg(p) {\n\t\tshift := uint(deg(x) - deg(p))\n\n\t\tx = x ^ (p << shift)\n\t}\n\n\treturn x\n}", "title": "" }, { "docid": "ab929f72f44f02d1923df9630d132c1e", "score": "0.65903896", "text": "func ModExp(a, r, N int) int {\n\tif a == 0 {\n\t\treturn 0\n\t}\n\n\tif r == 0 {\n\t\treturn 1\n\t}\n\n\tp := a\n\tfor i := 1; i < r; i++ {\n\t\tp = (p * a) % N\n\t}\n\n\treturn p\n}", "title": "" }, { "docid": "6f5760c50847a237c772d947f104fcfa", "score": "0.6570928", "text": "func TestIntegerRemainder(t *testing.T) {\n\tdefer testPanic(t) // handle panics and syntax errors\n\tsetTestInstance(t) // update test instance for logging\n\tvar a int\n\tvar b int\n\tvar r int\n\n\tt.Log(\"GOAL: you should be able to work with the remainder (modulo) operator\")\n\ta = 7\n\tb = 2\n\tr = remainder(a, b)\n\tif r != 1 {\n\t\tt.Error(shouldBe(r, 1))\n\t}\n\n\ta = 6\n\tb = 2\n\tr = remainder(a, b)\n\tif r != 0 {\n\t\tt.Error(shouldBe(r, 0))\n\t}\n}", "title": "" }, { "docid": "3dbe6cd46d26b260d745b2bbf03531d3", "score": "0.64864075", "text": "func mod(h UA_UInt32, size UA_UInt32) UA_UInt32 {\n\treturn h % size\n}", "title": "" }, { "docid": "58a93d72a07bb0da68211b734e88f5bf", "score": "0.63684124", "text": "func posMod(x, y int) int {\n\tz := x % y\n\tif z < 0 {\n\t\tz = z + y\n\t}\n\treturn z\n}", "title": "" }, { "docid": "ec58271286fcb5d80654eafd46cc2e3f", "score": "0.6366783", "text": "func divMod(n, m int) (int, int) {\n\tquotient := n / m\n\tremainder := n - quotient*m\n\treturn quotient, remainder\n}", "title": "" }, { "docid": "e071b49b8c40e2060e169483625ab53c", "score": "0.63655984", "text": "func IMod(a, b int64) int64 {\n\treturn a - IFloorDiv(a, b) * b\n}", "title": "" }, { "docid": "da273e53434e4228655ce2141ee09038", "score": "0.63562083", "text": "func modulo(b, a interface{}) (interface{}, error) {\n\tav := reflect.ValueOf(a)\n\tbv := reflect.ValueOf(b)\n\n\tswitch av.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tswitch bv.Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\treturn av.Int() % bv.Int(), nil\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\t\treturn av.Int() % int64(bv.Uint()), nil\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"modulo: unknown type for %q (%T)\", bv, b)\n\t\t}\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\tswitch bv.Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\treturn int64(av.Uint()) % bv.Int(), nil\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\t\treturn av.Uint() % bv.Uint(), nil\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"modulo: unknown type for %q (%T)\", bv, b)\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"modulo: unknown type for %q (%T)\", av, a)\n\t}\n}", "title": "" }, { "docid": "d19232a57c706a9c71917bcbf0ae61b4", "score": "0.63395387", "text": "func justModNine(n string, k int32) int32 {\n\t// would be\n\t// rem := n * k % 9\n\t// if rem == 0 {\n\t// \treturn 9\n\t// }\n\t// return rem\n\treturn 0\n}", "title": "" }, { "docid": "4e22186b5d07cd1f8580e4433f2938ab", "score": "0.6313845", "text": "func mod(a, b interface{}) (int64, error) {\n\tav := reflect.ValueOf(a)\n\tbv := reflect.ValueOf(b)\n\tvar ai, bi int64\n\n\tswitch av.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tai = av.Int()\n\tdefault:\n\t\treturn 0, errors.New(\"Modulo operator can't be used with non integer value\")\n\t}\n\n\tswitch bv.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tbi = bv.Int()\n\tdefault:\n\t\treturn 0, errors.New(\"Modulo operator can't be used with non integer value\")\n\t}\n\n\tif bi == 0 {\n\t\treturn 0, errors.New(\"The number can't be divided by zero at modulo operation\")\n\t}\n\n\treturn ai % bi, nil\n}", "title": "" }, { "docid": "88f269738d152af596dcddbb511bae0f", "score": "0.6309455", "text": "func Divmod(a int, b int) (div int, mod int) {\n\treturn a / b, a % b\n}", "title": "" }, { "docid": "e14b9c8a5fea314216f0de75b775c04b", "score": "0.6295695", "text": "func pmod(x, y float64) float64 {\n\tr := math.Mod(x, y)\n\tif r < 0 {\n\t\tr += y\n\t}\n\treturn r\n}", "title": "" }, { "docid": "901edadab573ed18992e074a075553f7", "score": "0.6249192", "text": "func mod(a, b interface{}) (int64, error) {\n\tav := reflect.ValueOf(a)\n\tbv := reflect.ValueOf(b)\n\tvar err error\n\tif av.Kind() == reflect.String {\n\t\tav, err = stringToNumber(av)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\tif bv.Kind() == reflect.String {\n\t\tbv, err = stringToNumber(bv)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvar ai, bi int64\n\n\tswitch av.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tai = av.Int()\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\tai = int64(av.Uint()) //may overflow\n\tdefault:\n\t\treturn 0, errors.New(\"Modulo operator can't be used with non integer value\")\n\t}\n\n\tswitch bv.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tbi = bv.Int()\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\tbi = int64(bv.Uint()) //may overflow\n\tdefault:\n\t\treturn 0, errors.New(\"Modulo operator can't be used with non integer value\")\n\t}\n\n\tif bi == 0 {\n\t\treturn 0, errors.New(\"The number can't be divided by zero at modulo operation\")\n\t}\n\n\treturn ai % bi, nil\n}", "title": "" }, { "docid": "123b814f1c71a22331b4c57cad7356fe", "score": "0.62350786", "text": "func (v I2) Mod(k int) I2 { return I2{v.X % k, v.Y % k} }", "title": "" }, { "docid": "f48273caa8828b89bc07735da3897cb4", "score": "0.6230212", "text": "func EvaluateModulo(left, right reflect.Value) (reflect.Value, error) {\n\tswitch left.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tlv := left.Int()\n\t\tswitch right.Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\trv := right.Int()\n\t\t\treturn reflect.ValueOf(lv % rv), nil\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\t\trv := right.Uint()\n\t\t\treturn reflect.ValueOf(lv % int64(rv)), nil\n\t\tdefault:\n\t\t\treturn reflect.ValueOf(nil), fmt.Errorf(\"can not use data type of %s in modulo\", right.Kind().String())\n\t\t}\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\tlv := left.Uint()\n\t\tswitch right.Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\trv := right.Int()\n\t\t\treturn reflect.ValueOf(int64(lv) % rv), nil\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\t\trv := right.Uint()\n\t\t\treturn reflect.ValueOf(int64(lv) % int64(rv)), nil\n\t\tdefault:\n\t\t\treturn reflect.ValueOf(nil), fmt.Errorf(\"can not use data type of %s in modulo\", right.Kind().String())\n\t\t}\n\tdefault:\n\t\treturn reflect.ValueOf(nil), fmt.Errorf(\"can not use data type of %s in modulo\", left.Kind().String())\n\t}\n}", "title": "" }, { "docid": "5d807712d1e59104cfde5e773362c09d", "score": "0.62267184", "text": "func ComputeMod(sc *stmtctx.StatementContext, a, b Datum) (d Datum, err error) {\n\tswitch a.Kind() {\n\tcase KindInt64:\n\t\tx := a.GetInt64()\n\t\tswitch b.Kind() {\n\t\tcase KindInt64:\n\t\t\ty := b.GetInt64()\n\t\t\tif y == 0 {\n\t\t\t\treturn d, nil\n\t\t\t}\n\t\t\td.SetInt64(x % y)\n\t\t\treturn d, nil\n\t\tcase KindUint64:\n\t\t\ty := b.GetUint64()\n\t\t\tif y == 0 {\n\t\t\t\treturn d, nil\n\t\t\t} else if x < 0 {\n\t\t\t\td.SetInt64(-int64(uint64(-x) % y))\n\t\t\t\t// first is int64, return int64.\n\t\t\t\treturn d, nil\n\t\t\t}\n\t\t\td.SetInt64(int64(uint64(x) % y))\n\t\t\treturn d, nil\n\t\t}\n\tcase KindUint64:\n\t\tx := a.GetUint64()\n\t\tswitch b.Kind() {\n\t\tcase KindInt64:\n\t\t\ty := b.GetInt64()\n\t\t\tif y == 0 {\n\t\t\t\treturn d, nil\n\t\t\t} else if y < 0 {\n\t\t\t\t// first is uint64, return uint64.\n\t\t\t\td.SetUint64(x % uint64(-y))\n\t\t\t\treturn d, nil\n\t\t\t}\n\t\t\td.SetUint64(x % uint64(y))\n\t\t\treturn d, nil\n\t\tcase KindUint64:\n\t\t\ty := b.GetUint64()\n\t\t\tif y == 0 {\n\t\t\t\treturn d, nil\n\t\t\t}\n\t\t\td.SetUint64(x % y)\n\t\t\treturn d, nil\n\t\t}\n\tcase KindFloat64:\n\t\tx := a.GetFloat64()\n\t\tswitch b.Kind() {\n\t\tcase KindFloat64:\n\t\t\ty := b.GetFloat64()\n\t\t\tif y == 0 {\n\t\t\t\treturn d, nil\n\t\t\t}\n\t\t\td.SetFloat64(math.Mod(x, y))\n\t\t\treturn d, nil\n\t\t}\n\tcase KindMysqlDecimal:\n\t\tx := a.GetMysqlDecimal()\n\t\tswitch b.Kind() {\n\t\tcase KindMysqlDecimal:\n\t\t\ty := b.GetMysqlDecimal()\n\t\t\tto := new(MyDecimal)\n\t\t\terr = DecimalMod(x, y, to)\n\t\t\tif err != ErrDivByZero {\n\t\t\t\td.SetMysqlDecimal(to)\n\t\t\t} else {\n\t\t\t\t// div by zero returns nil without error.\n\t\t\t\terr = nil\n\t\t\t}\n\t\t\treturn d, err\n\t\t}\n\t}\n\t_, err = InvOp2(a.GetValue(), b.GetValue(), opcode.Mod)\n\treturn d, errors.Trace(err)\n}", "title": "" }, { "docid": "9eb8bff326efe60fa3def758c05de8fd", "score": "0.62080836", "text": "func fastMod(n uint32, m int) int {\n\treturn int((uint64(n) * uint64(m)) >> 32)\n}", "title": "" }, { "docid": "9eb8bff326efe60fa3def758c05de8fd", "score": "0.62080836", "text": "func fastMod(n uint32, m int) int {\n\treturn int((uint64(n) * uint64(m)) >> 32)\n}", "title": "" }, { "docid": "9eb8bff326efe60fa3def758c05de8fd", "score": "0.62080836", "text": "func fastMod(n uint32, m int) int {\n\treturn int((uint64(n) * uint64(m)) >> 32)\n}", "title": "" }, { "docid": "062061b20959d6380c3c24e890a30c59", "score": "0.6198792", "text": "func PowMod(a, b, m int64) int64 {\r\n\ta = a % m\r\n\tp := 1 % m\r\n\tfor b > 0 {\r\n\t\tif b&1 != 0 {\r\n\t\t\tp = (p * a) % m\r\n\t\t}\r\n\t\tb >>= 1\r\n\t\ta = (a * a) % m\r\n\t}\r\n\treturn p\r\n}", "title": "" }, { "docid": "7ab6647e707ecfeb52034ac4d235f83d", "score": "0.61853075", "text": "func MathMod(x int, mod int) int {\n\tout := x % mod\n\n\t// TODO: This is not a constant-time operation.\n\tif out < 0 {\n\t\tout = out + mod\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "2d72b5e9874826bfffa3af015c4c4e33", "score": "0.61839306", "text": "func D(n int64) int64 {\n\tif n == 1 {\n\t\treturn 0\n\t} else if n == 2 {\n\t\treturn 1\n\t}\n\tvar a int64 = 0\n\tvar b int64 = 1\n\tvar temp int64\n\tfor i := int64(3); i <= n; i++ {\n\t\ttemp = b\n\t\tb = (i-1)*(a+b) % MOD\n\t\ta = temp\n\t}\n\treturn b % MOD\n}", "title": "" }, { "docid": "5337b306389bfbb889b0f546fbf2d462", "score": "0.61824787", "text": "func NegMod(m, n int32) int32 {\n\n\treturn (m%n + n) % n\n}", "title": "" }, { "docid": "65a9accebba1acfc492dca056d9c6f06", "score": "0.6131535", "text": "func (t IntegerType) Mod(left, right Value) (Value, error) {\n\tif err := t.ensureHaveThisType(left, right); err != nil {\n\t\treturn nil, err\n\t}\n\n\tleftInteger := left.(IntegerValue).Value\n\trightInteger := right.(IntegerValue).Value\n\n\treturn NewInteger(leftInteger % rightInteger), nil\n}", "title": "" }, { "docid": "93b084d45c5b3b23265fb0c57a9e623f", "score": "0.61035264", "text": "func divmod(a int, b int) (int, int) {\n\tquotient := a / b\n\tremainder := a % b\n\treturn quotient, remainder\n}", "title": "" }, { "docid": "1c98417e5ed8342b9c20b845736f8ba8", "score": "0.60917425", "text": "func (e Exp) Mod(operand interface{}) Exp {\n\treturn naryOperator(moduloKind, e, operand)\n}", "title": "" }, { "docid": "382bc12ecb83556b226fcdbe412f4206", "score": "0.6085022", "text": "func (r Rand) Mod(n int) int {\n\tvar b big.Int\n\tb.SetBytes(r[:])\n\tb.Mod(&b, big.NewInt(int64(n)))\n\treturn int(b.Int64())\n}", "title": "" }, { "docid": "425db623eefa4a06e5910d44a3599980", "score": "0.6068484", "text": "func makedigfunc(div int) func(int) int {\n\treturn func(indig int) int {\n\t\treturn indig % div\n\t}\n}", "title": "" }, { "docid": "9f2ba5ce5e856f2e77b2a2abe568c4e2", "score": "0.6055696", "text": "func Mod(a, b *Integer) *Integer {\n\treturn new(big.Int).Mod(a, b)\n}", "title": "" }, { "docid": "ac6654310708ecd60ac68b5238439d4d", "score": "0.60463375", "text": "func (b *BarrettMu) Modulo(x bigint.BigInt) bigint.BigInt {\n\tq1 := bigint.BiDivideByRadixPower(x, b.k-1)\n\tq2 := bigint.BiMultiply(q1, b.mu)\n\tq3 := bigint.BiDivideByRadixPower(q2, b.k+1)\n\tr1 := bigint.BiModuloByRadixPower(x, b.k+1)\n\tr2term := bigint.BiMultiply(q3, b.modulus)\n\tr2 := bigint.BiModuloByRadixPower(r2term, b.k+1)\n\tr := bigint.BiSubtract(r1, r2)\n\tif r.IsNeg {\n\t\tr = bigint.BiAdd(r, b.bkplus1)\n\t}\n\trgtem := bigint.BiCompare(r, b.modulus) >= 0\n\tfor rgtem {\n\t\tr = bigint.BiSubtract(r, b.modulus)\n\t\trgtem = bigint.BiCompare(r, b.modulus) >= 0\n\t}\n\treturn r\n}", "title": "" }, { "docid": "4ed7657e529c2782644ef5b9a25f8f00", "score": "0.6041123", "text": "func PowMod(a, b, m int) int {\n\ta = a % m\n\tp := 1 % m\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp = (p * a) % m\n\t\t}\n\t\tb >>= 1\n\t\ta = (a * a) % m\n\t}\n\treturn p\n}", "title": "" }, { "docid": "4ed7657e529c2782644ef5b9a25f8f00", "score": "0.6041123", "text": "func PowMod(a, b, m int) int {\n\ta = a % m\n\tp := 1 % m\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp = (p * a) % m\n\t\t}\n\t\tb >>= 1\n\t\ta = (a * a) % m\n\t}\n\treturn p\n}", "title": "" }, { "docid": "6e74c4d6cb3ea94bc65167aafbd890c5", "score": "0.60330343", "text": "func Mod(f float64, n float64) float64 {\n\tlf := math.Abs(f)\n\tfor lf > n {\n\t\tlf = lf - n\n\t}\n\tif f < 0 {\n\t\tlf = -1. * lf\n\t}\n\treturn lf\n}", "title": "" }, { "docid": "7e6370b3b29ce6edf392686eddf0885a", "score": "0.60229653", "text": "func modularExponentiation(b, e, mod int64) int64 {\n\t// runs in O(log(n)) where n = e\n\t// uses expontentiation by squaring to speed up things\n\tif mod == 1 {\n\t\treturn 0\n\t}\n\tvar r int64 = 1\n\tb = b % mod\n\tfor e > 0 {\n\t\tif e&1 == 1 {\n\t\t\tr = (r * b) % mod\n\t\t}\n\t\te = e >> 1\n\t\tb = (b * b) % mod\n\t}\n\treturn r\n}", "title": "" }, { "docid": "31a0a127586caa8ecd054bde1fd0e756", "score": "0.6012633", "text": "func DivMod(dvdn, dvsr int) (q, r int) {\n\tr = dvdn\n\tfor r >= dvsr {\n\t\tq += 1\n\t\tr = r -dvsr\n\t}\n\treturn\n}", "title": "" }, { "docid": "5960d2380f8629c9c2abef78ab793c9d", "score": "0.5999829", "text": "func EuclideanMod(x, y int64) int64 {\n\tm := x % y\n\tif m < 0 {\n\t\treturn m + y\n\t}\n\treturn m\n}", "title": "" }, { "docid": "faef66c6822e794ea3a53d202703454a", "score": "0.59812087", "text": "func PowMod(a, b, m int) int {\n\tp := int(1)\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp = (p * a) % m\n\t\t}\n\n\t\tb >>= 1\n\t\ta = (a * a) % m\n\t}\n\treturn p\n}", "title": "" }, { "docid": "ba8ada51b9b7721bf08ab45fb3d6f30c", "score": "0.59724015", "text": "func d(num int) int {\r\n\r\n\tsum:=0\r\n\r\n\tfor i:=1; i<=num/2; i++ {\r\n\t\tif (num%i == 0){\r\n\t\t\tsum=sum+i\r\n\t\t} \r\n\t}\r\n\treturn sum\r\n}", "title": "" }, { "docid": "cf5f6fdf2298aff1d38e0a5ecdf43a55", "score": "0.5969099", "text": "func Div(n, d int) I2 { return I2{n % d, n / d} }", "title": "" }, { "docid": "4e597e3d60571b1872118bd3c818ee5b", "score": "0.5957454", "text": "func ModExp2(a, j, N int) int {\n\tif a == 0 {\n\t\treturn 0\n\t}\n\n\tif j == 0 {\n\t\treturn a % N\n\t}\n\n\tp := a\n\tfor i := 0; i < j; i++ {\n\t\tp = (p * p) % N\n\t}\n\n\treturn p\n}", "title": "" }, { "docid": "4bd16cd50a4f6bed07f4701d251cc25b", "score": "0.5925657", "text": "func main() {\n var number int\n \n number = 10\n \n for true {\n if isDivisible(number, 1, 20) == true {\n break\n }\n number += 10\n }\n \n fmt.Println(number)\n}", "title": "" }, { "docid": "f54423c0a58112fd2bd5a37bb6f461bc", "score": "0.5912075", "text": "func (i Uint) Mod(v Value) (Value, error) {\n\tif vv, ok := v.(Uint); ok {\n\t\tx := uint64(i)\n\t\ty := uint64(vv)\n\t\tif y == 0 {\n\t\t\treturn nil, fmt.Errorf(\"division by 0\")\n\t\t}\n\t\treturn Uint(x % y), nil\n\t}\n\treturn nil, ErrOperationNotDefined\n}", "title": "" }, { "docid": "bad378729e966f93aeb2bda3b84366f1", "score": "0.5906484", "text": "func step (x int, y int) int {\r\n for x != y {\r\n if x > y {\r\n if x % y == 0 {\r\n return y\r\n } \r\n x %= y\r\n }else {\r\n if y % x == 0 {\r\n return x\r\n } \r\n y %= x\r\n }\r\n }\r\n return x\r\n}", "title": "" }, { "docid": "de94415462574ba7d2cb8514446d2b5c", "score": "0.5902963", "text": "func (cpu *CPU) mod() {\n\ta := cpu.readAsRegister()\n\tb := cpu.readAsValue()\n\tc := cpu.readAsValue()\n\n\trem := b % c\n\tif rem >= addressSpace {\n\t\trem = rem % addressSpace\n\t}\n\tcpu.Registers[a] = rem\n}", "title": "" }, { "docid": "5bef43e2df3844727cc2edbdf1b636ca", "score": "0.5876466", "text": "func HashModN(s string, n int) int {\n\th := fnv.New32a()\n\th.Write([]byte(s))\n\treturn int(h.Sum32() % uint32(n))\n}", "title": "" }, { "docid": "83acbe5126c8e52f58e19b78eb85ca2b", "score": "0.5839055", "text": "func Mod(a, b *big.Int) *big.Int {\n\tx := dummy().Mod(a, b)\n\treturn x\n}", "title": "" }, { "docid": "cef247a3f93412e00d7a1e41f23167ab", "score": "0.5814261", "text": "func ModPow(base, exponent, modulo int) (result int) {\n\tresult = 1\n\tfor exponent > 0 {\n\t\tif exponent%2 == 1 {\n\t\t\tresult *= base\n\t\t\tif modulo > 1 {\n\t\t\t\tresult %= modulo\n\t\t\t}\n\t\t}\n\t\tbase *= base\n\t\tif modulo > 1 {\n\t\t\tbase %= modulo\n\t\t}\n\t\texponent /= 2\n\t}\n\treturn\n}", "title": "" }, { "docid": "c32e03f98d430b1d307a39f656774f98", "score": "0.58006144", "text": "func (i Int) Mod(i2 Int) Int {\n\tif i2.Sign() == 0 {\n\t\tpanic(\"division-by-zero\")\n\t}\n\treturn Int{mod(i.i, i2.i)}\n}", "title": "" }, { "docid": "4f87a63200176df366d3dadccb298b04", "score": "0.5794127", "text": "func mod2(h UA_UInt32, size UA_UInt32) UA_UInt32 {\n\treturn UA_UInt32((uint32_t((uint32((1 + uint32((uint32((uint32_t((h % (size - UA_UInt32((uint32_t((uint32((2)))))))))))))))))))\n}", "title": "" }, { "docid": "3c10487ac0d325ff0c6fde79c19a1c70", "score": "0.5784304", "text": "func opposite(d int) int {\n\treturn (d + 1) % 2\n}", "title": "" }, { "docid": "dfad633fef35575a814dee0a933bb4d1", "score": "0.57784605", "text": "func minMod(n int) (m int) {\n\tfor _, mod := range modulus {\n\t\tif n < mod.n {\n\t\t\treturn mod.m\n\t\t}\n\t}\n\tlog.Fatal(\"minMod\", n)\n\treturn -1\n}", "title": "" }, { "docid": "e26937990fe7e531a0cc6d3f71dff276", "score": "0.57776546", "text": "func main() {\n for i := 1; i <= 100; i++ {\n if math.Mod(float64(i), 3) == 0 && math.Mod(float64(i), 5) == 0 {\n fmt.Println(\"FizzBuzz\")\n continue\n }\n if math.Mod(float64(i), 3) == 0 {\n fmt.Println(\"Fizz\")\n continue\n }\n if math.Mod(float64(i), 5) == 0 {\n fmt.Println(\"Buzz\")\n continue\n }\n fmt.Println(i)\n }\n}", "title": "" }, { "docid": "2fdf6909b824c928d47cb8dbdd4e9ef5", "score": "0.5732775", "text": "func ModInv(x, n int64) int64 {\n\t// http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Computing_multiplicative_inverses_in_modular_structures\n\tt := int64(0)\n\tnewt := int64(1)\n\tr := n\n\tnewr := x\n\tfor newr != 0 {\n\t\tq := r / newr\n\t\tt, newt = newt, t-q*newt\n\t\tr, newr = newr, r-q*newr\n\t}\n\tif r > 1 {\n\t\tpanic(fmt.Sprintf(\"%d is uninvertible mod %d\", x, n))\n\t}\n\tif t < 0 {\n\t\tt += n\n\t}\n\treturn t\n}", "title": "" }, { "docid": "f80e0a69eacf48f1a02e5a359d5c3719", "score": "0.5716451", "text": "func IsDivisible(n, x, y int) bool {\n\treturn n%x == 0 && n%y == 0\n}", "title": "" }, { "docid": "86e7f556cec648ad3fe4d4f74ab77c4f", "score": "0.5706653", "text": "func (i BigInt) Mod(i2 BigInt) BigInt {\n\tif i2.Sign() == 0 {\n\t\tpanic(\"division-by-zero\")\n\t}\n\treturn BigInt{mod(i.i, i2.i)}\n}", "title": "" }, { "docid": "46d0dca9e0d9b66fa9d5037d479a90a8", "score": "0.5705138", "text": "func (d Decimal) Mod(d2 Decimal) Decimal {\n\tquo := d.Div(d2).Truncate(0)\n\treturn d.Sub(d2.Mul(quo))\n}", "title": "" }, { "docid": "6144266e7a860aa74a76b8d9e478a166", "score": "0.5703722", "text": "func mod_inv(a uint64) uint64 {\n\treturn mod_pow(a, MOD_P-2)\n}", "title": "" }, { "docid": "a418c05aaa436d4f0c375a28d1c476b5", "score": "0.57027864", "text": "func moduloInt64Checked(x, y int64) (int64, bool) {\n\t// In twos complement, negating MinInt64 would result in a valid of MaxInt64+1.\n\tif x == math.MinInt64 && y == -1 {\n\t\treturn 0, false\n\t}\n\treturn x % y, true\n}", "title": "" }, { "docid": "ff8eb134d94fa10fd4bf7ced1f5cef10", "score": "0.56946915", "text": "func div(a, b int) (q, r int) {\n\tq = a / b\n\tr = a % b\n\treturn\n\t\n}", "title": "" }, { "docid": "9415395f1545bb005ed027a74c0bb9d5", "score": "0.5688328", "text": "func (b *BarrettMu) PowMod(x bigint.BigInt, y bigint.BigInt) bigint.BigInt {\n\tresult := bigint.New(false)\n\tresult.Digits[0] = 1\n\ta := x\n\tk := y\n\tfor {\n\t\tif (k.Digits[0] & 1) != 0 {\n\t\t\tresult = b.MultiplyMod(result, a)\n\t\t}\n\t\tk = bigint.BiShiftRight(k, 1)\n\t\tif k.Digits[0] == 0 && bigint.BiHighIndex(k) == 0 {\n\t\t\tbreak\n\t\t}\n\t\ta = b.MultiplyMod(a, a)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "fb93b30cd9b3bcd77b29347ae3ccdcc9", "score": "0.5677645", "text": "func (m Mint) Mod() Mint {\n\treturn fmod(m)\n}", "title": "" }, { "docid": "568909b14942b0d66cef67815f2e5c33", "score": "0.5674211", "text": "func main() {\n for i := 1; i <= 100; i++ {\n if i % 3 == 0 {\n fmt.Println(i)\n }\n }\n}", "title": "" }, { "docid": "b0e89365484331ec3838f0144bda7398", "score": "0.5671627", "text": "func (x Int) Mod(y Int) Int {\n\tif x.big != nil || y.big != nil {\n\t\txb, yb := x.BigInt(), y.BigInt()\n\n\t\tvar quo, rem big.Int\n\t\tquo.QuoRem(xb, yb, &rem)\n\t\tif (xb.Sign() < 0) != (yb.Sign() < 0) && rem.Sign() != 0 {\n\t\t\trem.Add(&rem, yb)\n\t\t}\n\t\treturn MakeBigInt(&rem)\n\t}\n\trem := x.small % y.small\n\tif (x.small < 0) != (y.small < 0) && rem != 0 {\n\t\trem += y.small\n\t}\n\treturn Int{small: rem}\n}", "title": "" }, { "docid": "37d44cfa1f64c9c1ebbfc8d88df10769", "score": "0.566135", "text": "func (r *BIG) Mod(m1 *BIG) {\n\tm := NewBIGcopy(m1)\n\tsr := NewBIG()\n\tr.norm()\n\tif Comp(r, m) < 0 {\n\t\treturn\n\t}\n\n\tm.fshl(1)\n\tk := 1\n\n\tfor Comp(r, m) >= 0 {\n\t\tm.fshl(1)\n\t\tk++\n\t}\n\n\tfor k > 0 {\n\t\tm.fshr(1)\n\t\tsr.copy(r)\n\t\tsr.sub(m)\n\t\tsr.norm()\n\t\tr.cmove(sr, int(1-((sr.w[NLEN-1]>>uint(CHUNK-1))&1)))\n\n\t\tk--\n\t}\n}", "title": "" }, { "docid": "796640e1c3bd4f65e1527b0e738fb5e0", "score": "0.56326425", "text": "func ModInt64(a, b int64) (remainder int64, ok bool) {\n\tif b == 0 || (a == math.MinInt64 && b == -1) {\n\t\treturn 0, false\n\t}\n\treturn a % b, true\n}", "title": "" }, { "docid": "045ed1bf6eea3cdd7332e65ac6879922", "score": "0.56055826", "text": "func (F *FF) mod(c *FF) {\n\tvar k int = 1\n\n\tF.norm()\n\tif ff_comp(F, c) < 0 {\n\t\treturn\n\t}\n\n\tc.shl()\n\tfor ff_comp(F, c) >= 0 {\n\t\tc.shl()\n\t\tk++\n\t}\n\n\tfor k > 0 {\n\t\tc.shr()\n\t\tif ff_comp(F, c) >= 0 {\n\t\t\tF.sub(c)\n\t\t\tF.norm()\n\t\t}\n\t\tk--\n\t}\n}", "title": "" }, { "docid": "2f1618e315a1905ed1e6811562ab0b86", "score": "0.56041384", "text": "func multiply(x int64, y int64) int64 {\n\treturn x * y % MODULUS\n}", "title": "" }, { "docid": "2b4878cd0618c4bb4f995fd30a33460b", "score": "0.5600343", "text": "func modPow(b, p, m int32) int32 {\n\tpow := int64(1)\n\tb64 := int64(b)\n\tm64 := int64(m)\n\tbit := uint(30)\n\tfor 1<<bit&p == 0 {\n\t\tbit--\n\t}\n\tfor {\n\t\tpow *= pow\n\t\tif 1<<bit&p != 0 {\n\t\t\tpow *= b64\n\t\t}\n\t\tpow %= m64\n\t\tif bit == 0 {\n\t\t\tbreak\n\t\t}\n\t\tbit--\n\t}\n\treturn int32(pow)\n}", "title": "" }, { "docid": "39280a27bc13bcf2c41422abd18db639", "score": "0.5598614", "text": "func modularExponentiate(x, y, m int) (result int) {\n\tnegate := y < 0\n\tif negate {\n\t\ty = -y\n\t}\n\ty64 := uint64(y)\n\n\tresult = 1\n\tfor y64 != 0 {\n\t\tif (y64 & 1) != 0 {\n\t\t\tresult = modulus(result*x, m)\n\t\t}\n\t\tx = modulus(x*x, m)\n\t\ty64 = y64 >> 1\n\t}\n\n\tif negate {\n\t\tresult = modulus(-1*result, m)\n\t}\n\treturn\n}", "title": "" }, { "docid": "cd909f223e18835afa3b6a14fd8551c2", "score": "0.5587155", "text": "func sol2(nums []int, k int) bool {\n psmod := make(map[int]int)\n psmod[0] = -1 // index 0 (psmod では -1) からの累計が mod k == 0 になるケースのための番兵\n s := 0\n for i, n := range nums {\n s += n\n if k != 0 { // k == 0 の場合 ps[j] == s (j < i-1)が成り立つもの (つまり連続した 0) を探せば良い。psmod には単に累計を入れれば良い\n s = s % k\n }\n if j, ok := psmod[s]; ok { // 累計に対する mod k が同じということは、その間に k の倍数だけ増加しているということ。これが探したい答え\n if i - j > 1 { // psmod[i] には nums[i] を組み入れた値が入っているので、i - j が 2 以上離れていないといけない\n return true\n }\n } else { // すでに同値の psmod があり、それと 2 以上離れていない場合は更新しない。遠い方 (より左の方) で解消できればそれでよいし、更新するとその可能性をカバーできない\n psmod[s] = i\n }\n }\n return false\n}", "title": "" }, { "docid": "8884f9b69e9a3b034e9a7a806ce470d3", "score": "0.55779374", "text": "func IsDivisible(x int, frm int, to int) bool {\n\tcheck := true\n\tfor i := frm; i <= to; i++ {\n\t\tif x%i != 0 {\n\t\t\tcheck = false\n\t\t\tbreak\n\t\t}\n\t}\n\treturn check\n}", "title": "" }, { "docid": "dd5026b4b8de61e04821145a308495f8", "score": "0.5569474", "text": "func add(x int64, y int64) int64 {\n\treturn (x + y) % MODULUS\n}", "title": "" } ]
1cec8b1cc7c725bf8eadfec33da02a79
WriteToRequest writes these params to a swagger request
[ { "docid": "25a2a7336695f4907b84a87c3015e89e", "score": "0.0", "text": "func (o *ListsRemoveDuplicatesByListIDPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif err := r.SetBodyParam(o.Fields); err != nil {\n\t\treturn err\n\t}\n\n\t// path param list_id\n\tif err := r.SetPathParam(\"list_id\", swag.FormatInt32(o.ListID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "267ed5f2cd5517ffaa2fc13e86dc2200", "score": "0.72620404", "text": "func (o *GoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param guid\n\tif err := r.SetPathParam(\"guid\", o.GUID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "714f43ecbd74b76768485e75e9040879", "score": "0.7239197", "text": "func (o *GetAPIVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param resourceId\n\tif err := r.SetPathParam(\"resourceId\", o.ResourceID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c6f6c7e4ef5f519d648ca0b992dceeb1", "score": "0.71290636", "text": "func (o *EventExampleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param eventType\n\tif err := r.SetPathParam(\"eventType\", o.EventType); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Fields != nil {\n\n\t\t// query param fields\n\t\tvar qrFields string\n\t\tif o.Fields != nil {\n\t\t\tqrFields = *o.Fields\n\t\t}\n\t\tqFields := qrFields\n\t\tif qFields != \"\" {\n\t\t\tif err := r.SetQueryParam(\"fields\", qFields); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5a6b98a727439da827feeedfee28a755", "score": "0.7074339", "text": "func (o *CreateInputParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.JSONBody != nil {\n\t\tif err := r.SetBodyParam(o.JSONBody); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8fc591381d6db9bc605b9737eba38015", "score": "0.7052204", "text": "func (o *EndpointAccessUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt64(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7a4911a1368dd8e9e71b916a7c464285", "score": "0.7044064", "text": "func (o *BikePointGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "235d66a2d586ccca86809f44fb8c4318", "score": "0.7025917", "text": "func (o *GetActivationsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.timeout)\n\tvar res []error\n\n\tif o.Docs != nil {\n\n\t\t// query param docs\n\t\tvar qrDocs bool\n\t\tif o.Docs != nil {\n\t\t\tqrDocs = *o.Docs\n\t\t}\n\t\tqDocs := swag.FormatBool(qrDocs)\n\t\tif qDocs != \"\" {\n\t\t\tif err := r.SetQueryParam(\"docs\", qDocs); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Name != nil {\n\n\t\t// query param name\n\t\tvar qrName string\n\t\tif o.Name != nil {\n\t\t\tqrName = *o.Name\n\t\t}\n\t\tqName := qrName\n\t\tif qName != \"\" {\n\t\t\tif err := r.SetQueryParam(\"name\", qName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Since != nil {\n\n\t\t// query param since\n\t\tvar qrSince int64\n\t\tif o.Since != nil {\n\t\t\tqrSince = *o.Since\n\t\t}\n\t\tqSince := swag.FormatInt64(qrSince)\n\t\tif qSince != \"\" {\n\t\t\tif err := r.SetQueryParam(\"since\", qSince); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Skip != nil {\n\n\t\t// query param skip\n\t\tvar qrSkip int64\n\t\tif o.Skip != nil {\n\t\t\tqrSkip = *o.Skip\n\t\t}\n\t\tqSkip := swag.FormatInt64(qrSkip)\n\t\tif qSkip != \"\" {\n\t\t\tif err := r.SetQueryParam(\"skip\", qSkip); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Upto != nil {\n\n\t\t// query param upto\n\t\tvar qrUpto int64\n\t\tif o.Upto != nil {\n\t\t\tqrUpto = *o.Upto\n\t\t}\n\t\tqUpto := swag.FormatInt64(qrUpto)\n\t\tif qUpto != \"\" {\n\t\t\tif err := r.SetQueryParam(\"upto\", qUpto); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ccfb4b60f6974ac7c58efc6386e1a7b6", "score": "0.70013434", "text": "func (o *APIUpdateApikeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Apikey != nil {\n\t\tif err := r.SetBodyParam(o.Apikey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param apikey_id\n\tif err := r.SetPathParam(\"apikey_id\", swag.FormatInt64(o.ApikeyID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3e5b7dc8b31ec9afc33d79d7fcda64e2", "score": "0.69986963", "text": "func (o *PutDataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param accessOption\n\tqrAccessOption := o.AccessOption\n\tqAccessOption := qrAccessOption\n\tif qAccessOption != \"\" {\n\t\tif err := r.SetQueryParam(\"accessOption\", qAccessOption); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param data\n\tqrData := o.Data\n\tqData := qrData\n\tif qData != \"\" {\n\t\tif err := r.SetQueryParam(\"data\", qData); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param expectedVersion\n\tqrExpectedVersion := o.ExpectedVersion\n\tqExpectedVersion := qrExpectedVersion\n\tif qExpectedVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"expectedVersion\", qExpectedVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param path\n\tqrPath := o.Path\n\tqPath := qrPath\n\tif qPath != \"\" {\n\t\tif err := r.SetQueryParam(\"path\", qPath); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c1299b5d9293ca8c45ed41ea2227fa1c", "score": "0.6981006", "text": "func (o *ChangeTagParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param repository\n\tif err := r.SetPathParam(\"repository\", o.Repository); err != nil {\n\t\treturn err\n\t}\n\n\t// path param tag\n\tif err := r.SetPathParam(\"tag\", o.Tag); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "45492e614e107ac5271d1554ca8a8946", "score": "0.6971309", "text": "func (o *GetMaybeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param environment\n\tqrEnvironment := o.Environment\n\tqEnvironment := qrEnvironment\n\tif qEnvironment != \"\" {\n\t\tif err := r.SetQueryParam(\"environment\", qEnvironment); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4766c3c692c5fd2f8a3ff400634fab8c", "score": "0.69569653", "text": "func (o *ExtractionGetV1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param id\n\tqrID := o.ID\n\tqID := qrID\n\tif qID != \"\" {\n\n\t\tif err := r.SetQueryParam(\"id\", qID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.IncludeFiles != nil {\n\n\t\t// query param include_files\n\t\tvar qrIncludeFiles bool\n\n\t\tif o.IncludeFiles != nil {\n\t\t\tqrIncludeFiles = *o.IncludeFiles\n\t\t}\n\t\tqIncludeFiles := swag.FormatBool(qrIncludeFiles)\n\t\tif qIncludeFiles != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"include_files\", qIncludeFiles); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ccb5714576cdcc9ab5cfcc8af70e1479", "score": "0.6931449", "text": "func (o *AddSleepParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param date\n\tqrDate := o.Date\n\tqDate := qrDate.String()\n\tif qDate != \"\" {\n\t\tif err := r.SetQueryParam(\"date\", qDate); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param duration\n\tqrDuration := o.Duration\n\tqDuration := swag.FormatInt64(qrDuration)\n\tif qDuration != \"\" {\n\t\tif err := r.SetQueryParam(\"duration\", qDuration); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param startTime\n\tqrStartTime := o.StartTime\n\tqStartTime := qrStartTime\n\tif qStartTime != \"\" {\n\t\tif err := r.SetQueryParam(\"startTime\", qStartTime); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e8146bd23fb3c68d1adf7ca626874e1b", "score": "0.68989146", "text": "func (o *QueryPublishersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param api-version\n\tqrAPIVersion := o.APIVersion\n\tqAPIVersion := qrAPIVersion\n\tif qAPIVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"api-version\", qAPIVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param organization\n\tif err := r.SetPathParam(\"organization\", o.Organization); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "398301c3c55cedfe15ae1269b59a90b2", "score": "0.68928015", "text": "func (o *ListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param api-version\n\tqrAPIVersion := o.APIVersion\n\tqAPIVersion := qrAPIVersion\n\tif qAPIVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"api-version\", qAPIVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.MaxResults != nil {\n\n\t\t// query param maxResults\n\t\tvar qrMaxResults int32\n\t\tif o.MaxResults != nil {\n\t\t\tqrMaxResults = *o.MaxResults\n\t\t}\n\t\tqMaxResults := swag.FormatInt32(qrMaxResults)\n\t\tif qMaxResults != \"\" {\n\t\t\tif err := r.SetQueryParam(\"maxResults\", qMaxResults); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param organization\n\tif err := r.SetPathParam(\"organization\", o.Organization); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Result != nil {\n\n\t\t// query param result\n\t\tvar qrResult string\n\t\tif o.Result != nil {\n\t\t\tqrResult = *o.Result\n\t\t}\n\t\tqResult := qrResult\n\t\tif qResult != \"\" {\n\t\t\tif err := r.SetQueryParam(\"result\", qResult); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Status != nil {\n\n\t\t// query param status\n\t\tvar qrStatus string\n\t\tif o.Status != nil {\n\t\t\tqrStatus = *o.Status\n\t\t}\n\t\tqStatus := qrStatus\n\t\tif qStatus != \"\" {\n\t\t\tif err := r.SetQueryParam(\"status\", qStatus); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param subscriptionId\n\tif err := r.SetPathParam(\"subscriptionId\", o.SubscriptionID.String()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8d36271ded70bd4ce311a0e8bd75fff3", "score": "0.6889015", "text": "func (o *StatPathParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.timeout)\n\tvar res []error\n\n\tif o.OpID != nil {\n\n\t\t// header param Op-ID\n\t\tif err := r.SetHeaderParam(\"Op-ID\", *o.OpID); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\t// query param deviceID\n\tqrDeviceID := o.DeviceID\n\tqDeviceID := qrDeviceID\n\tif qDeviceID != \"\" {\n\t\tif err := r.SetQueryParam(\"deviceID\", qDeviceID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.FilterSpec != nil {\n\n\t\t// query param filterSpec\n\t\tvar qrFilterSpec string\n\t\tif o.FilterSpec != nil {\n\t\t\tqrFilterSpec = *o.FilterSpec\n\t\t}\n\t\tqFilterSpec := qrFilterSpec\n\t\tif qFilterSpec != \"\" {\n\t\t\tif err := r.SetQueryParam(\"filterSpec\", qFilterSpec); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param store\n\tqrStore := o.Store\n\tqStore := qrStore\n\tif qStore != \"\" {\n\t\tif err := r.SetQueryParam(\"store\", qStore); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4fdd27e1814a1af6fb91a74a563aae0f", "score": "0.68868345", "text": "func (o *CreatePacketGeneratorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.Generator != nil {\n\t\tif err := r.SetBodyParam(o.Generator); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3e88b542d71877e76714e23473c05230", "score": "0.6872372", "text": "func (o *GetProjectDeviceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param deviceId\n\tif err := r.SetPathParam(\"deviceId\", o.DeviceID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param projectId\n\tif err := r.SetPathParam(\"projectId\", o.ProjectID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "93318ed80ad68540a8f2507593f44c2c", "score": "0.68562156", "text": "func (o *CreateRuntimeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cc01d11813e8dc1214fdb15b5ba44d72", "score": "0.6849701", "text": "func (o *CreateAppParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param Authorization\n\tif err := r.SetHeaderParam(\"Authorization\", o.Authorization); err != nil {\n\t\treturn err\n\t}\n\n\tif o.CreateOrUpdateAppRequest != nil {\n\t\tif err := r.SetBodyParam(o.CreateOrUpdateAppRequest); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "44898e7b16df27ca5efa0d479288cbf3", "score": "0.6841271", "text": "func (o *CreateCodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param campaignId\n\tif err := r.SetPathParam(\"campaignId\", o.CampaignID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8daca62b82ff93dd48a280f02ec59120", "score": "0.68409634", "text": "func (o *PutIPAMvlansParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Description != nil {\n\n\t\t// form param description\n\t\tvar frDescription string\n\t\tif o.Description != nil {\n\t\t\tfrDescription = *o.Description\n\t\t}\n\t\tfDescription := frDescription\n\t\tif fDescription != \"\" {\n\t\t\tif err := r.SetFormParam(\"description\", fDescription); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Groups != nil {\n\n\t\t// form param groups\n\t\tvar frGroups string\n\t\tif o.Groups != nil {\n\t\t\tfrGroups = *o.Groups\n\t\t}\n\t\tfGroups := frGroups\n\t\tif fGroups != \"\" {\n\t\t\tif err := r.SetFormParam(\"groups\", fGroups); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt64(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Name != nil {\n\n\t\t// form param name\n\t\tvar frName string\n\t\tif o.Name != nil {\n\t\t\tfrName = *o.Name\n\t\t}\n\t\tfName := frName\n\t\tif fName != \"\" {\n\t\t\tif err := r.SetFormParam(\"name\", fName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Notes != nil {\n\n\t\t// form param notes\n\t\tvar frNotes string\n\t\tif o.Notes != nil {\n\t\t\tfrNotes = *o.Notes\n\t\t}\n\t\tfNotes := frNotes\n\t\tif fNotes != \"\" {\n\t\t\tif err := r.SetFormParam(\"notes\", fNotes); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Number != nil {\n\n\t\t// form param number\n\t\tvar frNumber string\n\t\tif o.Number != nil {\n\t\t\tfrNumber = *o.Number\n\t\t}\n\t\tfNumber := frNumber\n\t\tif fNumber != \"\" {\n\t\t\tif err := r.SetFormParam(\"number\", fNumber); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.SwitchID != nil {\n\n\t\t// form param switch_id\n\t\tvar frSwitchID string\n\t\tif o.SwitchID != nil {\n\t\t\tfrSwitchID = *o.SwitchID\n\t\t}\n\t\tfSwitchID := frSwitchID\n\t\tif fSwitchID != \"\" {\n\t\t\tif err := r.SetFormParam(\"switch_id\", fSwitchID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a2e6e8a44702f0c9a8a249f5ac365e12", "score": "0.683832", "text": "func (o *GetServiceRequestAttributeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID.String()); err != nil {\n\t\treturn err\n\t}\n\n\tif o.IncludeProcessGroupReferences != nil {\n\n\t\t// query param includeProcessGroupReferences\n\t\tvar qrIncludeProcessGroupReferences bool\n\t\tif o.IncludeProcessGroupReferences != nil {\n\t\t\tqrIncludeProcessGroupReferences = *o.IncludeProcessGroupReferences\n\t\t}\n\t\tqIncludeProcessGroupReferences := swag.FormatBool(qrIncludeProcessGroupReferences)\n\t\tif qIncludeProcessGroupReferences != \"\" {\n\t\t\tif err := r.SetQueryParam(\"includeProcessGroupReferences\", qIncludeProcessGroupReferences); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b0e860788d1002458a1800dd376f2308", "score": "0.6837619", "text": "func (o *GetPatientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param ID\n\tif err := r.SetPathParam(\"ID\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "991f0235898c9621dd28fb8a81e42edc", "score": "0.6836285", "text": "func (o *StopPointGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tvaluesIds := o.Ids\n\n\tjoinedIds := swag.JoinByFormat(valuesIds, \"\")\n\t// path array param ids\n\t// SetPathParam does not support variadric arguments, since we used JoinByFormat\n\t// we can send the first item in the array as it's all the items of the previous\n\t// array joined together\n\tif len(joinedIds) > 0 {\n\t\tif err := r.SetPathParam(\"ids\", joinedIds[0]); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.IncludeCrowdingData != nil {\n\n\t\t// query param includeCrowdingData\n\t\tvar qrIncludeCrowdingData bool\n\t\tif o.IncludeCrowdingData != nil {\n\t\t\tqrIncludeCrowdingData = *o.IncludeCrowdingData\n\t\t}\n\t\tqIncludeCrowdingData := swag.FormatBool(qrIncludeCrowdingData)\n\t\tif qIncludeCrowdingData != \"\" {\n\t\t\tif err := r.SetQueryParam(\"includeCrowdingData\", qIncludeCrowdingData); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "81f787bee3ff8a611a15961659d43630", "score": "0.6831626", "text": "func (o *PostRequestDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param extra\n\tif err := r.SetPathParam(\"extra\", o.Extra); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "61dd4057f56c1dc80da1ff80d064226c", "score": "0.68270516", "text": "func (o *UpdateWaterLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param amount\n\tqrAmount := o.Amount\n\tqAmount := qrAmount\n\tif qAmount != \"\" {\n\t\tif err := r.SetQueryParam(\"amount\", qAmount); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Unit != nil {\n\n\t\t// query param unit\n\t\tvar qrUnit string\n\t\tif o.Unit != nil {\n\t\t\tqrUnit = *o.Unit\n\t\t}\n\t\tqUnit := qrUnit\n\t\tif qUnit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"unit\", qUnit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param water-log-id\n\tif err := r.SetPathParam(\"water-log-id\", o.WaterLogID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5f108fbb4f079554f73aa9570394a438", "score": "0.682503", "text": "func (o *GetBuildTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Fields != nil {\n\n\t\t// query param fields\n\t\tvar qrFields string\n\t\tif o.Fields != nil {\n\t\t\tqrFields = *o.Fields\n\t\t}\n\t\tqFields := qrFields\n\t\tif qFields != \"\" {\n\t\t\tif err := r.SetQueryParam(\"fields\", qFields); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Locator != nil {\n\n\t\t// query param locator\n\t\tvar qrLocator string\n\t\tif o.Locator != nil {\n\t\t\tqrLocator = *o.Locator\n\t\t}\n\t\tqLocator := qrLocator\n\t\tif qLocator != \"\" {\n\t\t\tif err := r.SetQueryParam(\"locator\", qLocator); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fdb1995b078a083d8759e4f5d4355479", "score": "0.6821358", "text": "func (o *RepoAddTopícParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param owner\n\tif err := r.SetPathParam(\"owner\", o.Owner); err != nil {\n\t\treturn err\n\t}\n\n\t// path param repo\n\tif err := r.SetPathParam(\"repo\", o.Repo); err != nil {\n\t\treturn err\n\t}\n\n\t// path param topic\n\tif err := r.SetPathParam(\"topic\", o.Topic); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d584567a725d95abf7eab68c1c31c8c0", "score": "0.6817103", "text": "func (o *RecommendConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "85c8c57edd8a09e1648c9d334304f9d9", "score": "0.68144774", "text": "func (o *ModifyTokenInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif err := r.SetBodyParam(o.Info); err != nil {\n\t\treturn err\n\t}\n\n\t// path param symbol\n\tif err := r.SetPathParam(\"symbol\", o.Symbol); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d7e8dacfb68cbc587f5699fb2a31106b", "score": "0.68096536", "text": "func (o *GetAPI24DrivesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Authorization != nil {\n\n\t\t// header param Authorization\n\t\tif err := r.SetHeaderParam(\"Authorization\", *o.Authorization); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\tif o.XRequestID != nil {\n\n\t\t// header param X-Request-ID\n\t\tif err := r.SetHeaderParam(\"X-Request-ID\", *o.XRequestID); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\tif o.ContinuationToken != nil {\n\n\t\t// query param continuation_token\n\t\tvar qrContinuationToken string\n\t\tif o.ContinuationToken != nil {\n\t\t\tqrContinuationToken = *o.ContinuationToken\n\t\t}\n\t\tqContinuationToken := qrContinuationToken\n\t\tif qContinuationToken != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"continuation_token\", qContinuationToken); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Filter != nil {\n\n\t\t// query param filter\n\t\tvar qrFilter string\n\t\tif o.Filter != nil {\n\t\t\tqrFilter = *o.Filter\n\t\t}\n\t\tqFilter := qrFilter\n\t\tif qFilter != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"filter\", qFilter); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int32\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt32(qrLimit)\n\t\tif qLimit != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesNames := o.Names\n\n\tjoinedNames := swag.JoinByFormat(valuesNames, \"csv\")\n\t// query array param names\n\tif err := r.SetQueryParam(\"names\", joinedNames...); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Offset != nil {\n\n\t\t// query param offset\n\t\tvar qrOffset int32\n\t\tif o.Offset != nil {\n\t\t\tqrOffset = *o.Offset\n\t\t}\n\t\tqOffset := swag.FormatInt32(qrOffset)\n\t\tif qOffset != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"offset\", qOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesSort := o.Sort\n\n\tjoinedSort := swag.JoinByFormat(valuesSort, \"csv\")\n\t// query array param sort\n\tif err := r.SetQueryParam(\"sort\", joinedSort...); err != nil {\n\t\treturn err\n\t}\n\n\tif o.TotalItemCount != nil {\n\n\t\t// query param total_item_count\n\t\tvar qrTotalItemCount bool\n\t\tif o.TotalItemCount != nil {\n\t\t\tqrTotalItemCount = *o.TotalItemCount\n\t\t}\n\t\tqTotalItemCount := swag.FormatBool(qrTotalItemCount)\n\t\tif qTotalItemCount != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"total_item_count\", qTotalItemCount); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "13956e04d99cef38909d0d93ac20cbfb", "score": "0.6808726", "text": "func (o *GetWorkItemTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.DollarExpand != nil {\n\n\t\t// query param $expand\n\t\tvar qrNrDollarExpand string\n\t\tif o.DollarExpand != nil {\n\t\t\tqrNrDollarExpand = *o.DollarExpand\n\t\t}\n\t\tqNrDollarExpand := qrNrDollarExpand\n\t\tif qNrDollarExpand != \"\" {\n\t\t\tif err := r.SetQueryParam(\"$expand\", qNrDollarExpand); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param api-version\n\tqrAPIVersion := o.APIVersion\n\tqAPIVersion := qrAPIVersion\n\tif qAPIVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"api-version\", qAPIVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.AsOf != nil {\n\n\t\t// query param asOf\n\t\tvar qrAsOf strfmt.DateTime\n\t\tif o.AsOf != nil {\n\t\t\tqrAsOf = *o.AsOf\n\t\t}\n\t\tqAsOf := qrAsOf.String()\n\t\tif qAsOf != \"\" {\n\t\t\tif err := r.SetQueryParam(\"asOf\", qAsOf); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Fields != nil {\n\n\t\t// query param fields\n\t\tvar qrFields string\n\t\tif o.Fields != nil {\n\t\t\tqrFields = *o.Fields\n\t\t}\n\t\tqFields := qrFields\n\t\tif qFields != \"\" {\n\t\t\tif err := r.SetQueryParam(\"fields\", qFields); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param organization\n\tif err := r.SetPathParam(\"organization\", o.Organization); err != nil {\n\t\treturn err\n\t}\n\n\t// path param project\n\tif err := r.SetPathParam(\"project\", o.Project); err != nil {\n\t\treturn err\n\t}\n\n\t// path param type\n\tif err := r.SetPathParam(\"type\", o.Type); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7a02cfc3f4a07c770025d319bddcc1df", "score": "0.6804636", "text": "func (o *GetPreviewParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Encode != nil {\n\n\t\t// query param encode\n\t\tvar qrEncode string\n\t\tif o.Encode != nil {\n\t\t\tqrEncode = *o.Encode\n\t\t}\n\t\tqEncode := qrEncode\n\t\tif qEncode != \"\" {\n\t\t\tif err := r.SetQueryParam(\"encode\", qEncode); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param file\n\tif err := r.SetPathParam(\"file\", o.File); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5940b65e5af00119c7283fe5fffe54e3", "score": "0.67999566", "text": "func (o *HealthchechServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param appId\n\tif err := r.SetPathParam(\"appId\", o.AppID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2bda3a4eb2b79b81c7f70d45826c53da", "score": "0.6796876", "text": "func (o *GetWorkspaceUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID.String()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "da2df65aaf42c1e21d16058161739c7d", "score": "0.6794796", "text": "func (o *GetFlowDiffParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param bucketId\n\tif err := r.SetPathParam(\"bucketId\", o.BucketID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param flowId\n\tif err := r.SetPathParam(\"flowId\", o.FlowID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param versionA\n\tif err := r.SetPathParam(\"versionA\", swag.FormatInt32(o.VersionA)); err != nil {\n\t\treturn err\n\t}\n\n\t// path param versionB\n\tif err := r.SetPathParam(\"versionB\", swag.FormatInt32(o.VersionB)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1ddb4a305079c5f1d74ef6d2dd4cd34d", "score": "0.67945004", "text": "func (o *DeviceControlParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif err := r.SetBodyParam(o.Request); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "615b5b99ff4b9b4d9f5fb0bd5827fd56", "score": "0.67944634", "text": "func (o *AddWeightLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param date\n\tqrDate := o.Date\n\tqDate := qrDate.String()\n\tif qDate != \"\" {\n\t\tif err := r.SetQueryParam(\"date\", qDate); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Time != nil {\n\n\t\t// query param time\n\t\tvar qrTime string\n\t\tif o.Time != nil {\n\t\t\tqrTime = *o.Time\n\t\t}\n\t\tqTime := qrTime\n\t\tif qTime != \"\" {\n\t\t\tif err := r.SetQueryParam(\"time\", qTime); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param weight\n\tqrWeight := o.Weight\n\tqWeight := swag.FormatInt64(qrWeight)\n\tif qWeight != \"\" {\n\t\tif err := r.SetQueryParam(\"weight\", qWeight); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "017fd2ec18bdd05c3140f0b01ac1714a", "score": "0.67923486", "text": "func (o *AllUserAttributesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Fields != nil {\n\n\t\t// query param fields\n\t\tvar qrFields string\n\n\t\tif o.Fields != nil {\n\t\t\tqrFields = *o.Fields\n\t\t}\n\t\tqFields := qrFields\n\t\tif qFields != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"fields\", qFields); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Sorts != nil {\n\n\t\t// query param sorts\n\t\tvar qrSorts string\n\n\t\tif o.Sorts != nil {\n\t\t\tqrSorts = *o.Sorts\n\t\t}\n\t\tqSorts := qrSorts\n\t\tif qSorts != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"sorts\", qSorts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1a7d1fb249b8f9f8001928049ba8b0e6", "score": "0.67898434", "text": "func (o *SecurityAuditLogCollectionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Application != nil {\n\n\t\t// query param application\n\t\tvar qrApplication string\n\n\t\tif o.Application != nil {\n\t\t\tqrApplication = *o.Application\n\t\t}\n\t\tqApplication := qrApplication\n\t\tif qApplication != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"application\", qApplication); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.CommandID != nil {\n\n\t\t// query param command_id\n\t\tvar qrCommandID string\n\n\t\tif o.CommandID != nil {\n\t\t\tqrCommandID = *o.CommandID\n\t\t}\n\t\tqCommandID := qrCommandID\n\t\tif qCommandID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"command_id\", qCommandID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Fields != nil {\n\n\t\t// binding items for fields\n\t\tjoinedFields := o.bindParamFields(reg)\n\n\t\t// query array param fields\n\t\tif err := r.SetQueryParam(\"fields\", joinedFields...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Index != nil {\n\n\t\t// query param index\n\t\tvar qrIndex int64\n\n\t\tif o.Index != nil {\n\t\t\tqrIndex = *o.Index\n\t\t}\n\t\tqIndex := swag.FormatInt64(qrIndex)\n\t\tif qIndex != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"index\", qIndex); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Input != nil {\n\n\t\t// query param input\n\t\tvar qrInput string\n\n\t\tif o.Input != nil {\n\t\t\tqrInput = *o.Input\n\t\t}\n\t\tqInput := qrInput\n\t\tif qInput != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"input\", qInput); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Location != nil {\n\n\t\t// query param location\n\t\tvar qrLocation string\n\n\t\tif o.Location != nil {\n\t\t\tqrLocation = *o.Location\n\t\t}\n\t\tqLocation := qrLocation\n\t\tif qLocation != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"location\", qLocation); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.MaxRecords != nil {\n\n\t\t// query param max_records\n\t\tvar qrMaxRecords int64\n\n\t\tif o.MaxRecords != nil {\n\t\t\tqrMaxRecords = *o.MaxRecords\n\t\t}\n\t\tqMaxRecords := swag.FormatInt64(qrMaxRecords)\n\t\tif qMaxRecords != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"max_records\", qMaxRecords); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Message != nil {\n\n\t\t// query param message\n\t\tvar qrMessage string\n\n\t\tif o.Message != nil {\n\t\t\tqrMessage = *o.Message\n\t\t}\n\t\tqMessage := qrMessage\n\t\tif qMessage != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"message\", qMessage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.NodeName != nil {\n\n\t\t// query param node.name\n\t\tvar qrNodeName string\n\n\t\tif o.NodeName != nil {\n\t\t\tqrNodeName = *o.NodeName\n\t\t}\n\t\tqNodeName := qrNodeName\n\t\tif qNodeName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"node.name\", qNodeName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.NodeUUID != nil {\n\n\t\t// query param node.uuid\n\t\tvar qrNodeUUID string\n\n\t\tif o.NodeUUID != nil {\n\t\t\tqrNodeUUID = *o.NodeUUID\n\t\t}\n\t\tqNodeUUID := qrNodeUUID\n\t\tif qNodeUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"node.uuid\", qNodeUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.OrderBy != nil {\n\n\t\t// binding items for order_by\n\t\tjoinedOrderBy := o.bindParamOrderBy(reg)\n\n\t\t// query array param order_by\n\t\tif err := r.SetQueryParam(\"order_by\", joinedOrderBy...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.ReturnRecords != nil {\n\n\t\t// query param return_records\n\t\tvar qrReturnRecords bool\n\n\t\tif o.ReturnRecords != nil {\n\t\t\tqrReturnRecords = *o.ReturnRecords\n\t\t}\n\t\tqReturnRecords := swag.FormatBool(qrReturnRecords)\n\t\tif qReturnRecords != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"return_records\", qReturnRecords); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ReturnTimeout != nil {\n\n\t\t// query param return_timeout\n\t\tvar qrReturnTimeout int64\n\n\t\tif o.ReturnTimeout != nil {\n\t\t\tqrReturnTimeout = *o.ReturnTimeout\n\t\t}\n\t\tqReturnTimeout := swag.FormatInt64(qrReturnTimeout)\n\t\tif qReturnTimeout != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"return_timeout\", qReturnTimeout); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Scope != nil {\n\n\t\t// query param scope\n\t\tvar qrScope string\n\n\t\tif o.Scope != nil {\n\t\t\tqrScope = *o.Scope\n\t\t}\n\t\tqScope := qrScope\n\t\tif qScope != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"scope\", qScope); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SessionID != nil {\n\n\t\t// query param session_id\n\t\tvar qrSessionID string\n\n\t\tif o.SessionID != nil {\n\t\t\tqrSessionID = *o.SessionID\n\t\t}\n\t\tqSessionID := qrSessionID\n\t\tif qSessionID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"session_id\", qSessionID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.State != nil {\n\n\t\t// query param state\n\t\tvar qrState string\n\n\t\tif o.State != nil {\n\t\t\tqrState = *o.State\n\t\t}\n\t\tqState := qrState\n\t\tif qState != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"state\", qState); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SvmName != nil {\n\n\t\t// query param svm.name\n\t\tvar qrSvmName string\n\n\t\tif o.SvmName != nil {\n\t\t\tqrSvmName = *o.SvmName\n\t\t}\n\t\tqSvmName := qrSvmName\n\t\tif qSvmName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"svm.name\", qSvmName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Timestamp != nil {\n\n\t\t// query param timestamp\n\t\tvar qrTimestamp string\n\n\t\tif o.Timestamp != nil {\n\t\t\tqrTimestamp = *o.Timestamp\n\t\t}\n\t\tqTimestamp := qrTimestamp\n\t\tif qTimestamp != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"timestamp\", qTimestamp); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.User != nil {\n\n\t\t// query param user\n\t\tvar qrUser string\n\n\t\tif o.User != nil {\n\t\t\tqrUser = *o.User\n\t\t}\n\t\tqUser := qrUser\n\t\tif qUser != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"user\", qUser); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0674ae33be39c8b9ffa98efededb62de", "score": "0.6788291", "text": "func (o *GetDeploysParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.RequestBody != nil {\n\t\tif err := r.SetBodyParam(o.RequestBody); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3b8f32611d140e13933e6cf968b5a227", "score": "0.6786868", "text": "func (o *GetByDateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param access_key\n\tqrAccessKey := o.AccessKey\n\tqAccessKey := qrAccessKey\n\tif qAccessKey != \"\" {\n\n\t\tif err := r.SetQueryParam(\"access_key\", qAccessKey); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Base != nil {\n\n\t\t// query param base\n\t\tvar qrBase string\n\n\t\tif o.Base != nil {\n\t\t\tqrBase = *o.Base\n\t\t}\n\t\tqBase := qrBase\n\t\tif qBase != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"base\", qBase); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// path param date\n\tif err := r.SetPathParam(\"date\", o.Date.String()); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Symbols != nil {\n\n\t\t// binding items for symbols\n\t\tjoinedSymbols := o.bindParamSymbols(reg)\n\n\t\t// query array param symbols\n\t\tif err := r.SetQueryParam(\"symbols\", joinedSymbols...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9a12b0699ca86f315b0527b4f4bca7f8", "score": "0.6785725", "text": "func (o *GetAdapterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param idOrName\n\tif err := r.SetPathParam(\"idOrName\", o.IDOrName); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e738b136a9d0c0e482e362ec51862330", "score": "0.67769057", "text": "func (o *AdminUpdateTagParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\t// path param tagId\n\tif err := r.SetPathParam(\"tagId\", o.TagID); err != nil {\n\t\treturn err\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "079fb7df6ba22fa60cd5f560552f833f", "score": "0.67765653", "text": "func (o *PostModelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// form file param manifest\n\tif err := r.SetFileParam(\"manifest\", &o.Manifest); err != nil {\n\t\treturn err\n\t}\n\n\tif o.ModelDefinition != nil {\n\n\t\tif o.ModelDefinition != nil {\n\n\t\t\t// form file param model_definition\n\t\t\tif err := r.SetFileParam(\"model_definition\", o.ModelDefinition); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// query param version\n\tqrVersion := o.Version\n\tqVersion := qrVersion\n\tif qVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"version\", qVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24defd5101f4b4bc3cf33276599e21c7", "score": "0.67729586", "text": "func (o *PostWalletSiagkeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param encryptionpassword\n\tqrEncryptionpassword := o.Encryptionpassword\n\tqEncryptionpassword := qrEncryptionpassword\n\tif qEncryptionpassword != \"\" {\n\n\t\tif err := r.SetQueryParam(\"encryptionpassword\", qEncryptionpassword); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param keyfiles\n\tqrKeyfiles := o.Keyfiles\n\tqKeyfiles := qrKeyfiles\n\tif qKeyfiles != \"\" {\n\n\t\tif err := r.SetQueryParam(\"keyfiles\", qKeyfiles); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a47bc8412f9f3f52b57f350c95e081c4", "score": "0.67706305", "text": "func (o *TmchMarkDocumentInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\treturn err\n\t}\n\n\tvaluesKeys := o.Keys\n\n\tjoinedKeys := swag.JoinByFormat(valuesKeys, \"multi\")\n\t// query array param keys\n\tif err := r.SetQueryParam(\"keys\", joinedKeys...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8b2288723e869b3b454b8f3013b1df52", "score": "0.6768137", "text": "func (o *GetDevicesNameParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param device-name\n\tif err := r.SetPathParam(\"device-name\", o.DeviceName.String()); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Follow != nil {\n\n\t\t// query param follow\n\t\tvar qrFollow string\n\t\tif o.Follow != nil {\n\t\t\tqrFollow = *o.Follow\n\t\t}\n\t\tqFollow := qrFollow\n\t\tif qFollow != \"\" {\n\t\t\tif err := r.SetQueryParam(\"follow\", qFollow); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.IncludeCols != nil {\n\n\t\t// query param include_cols\n\t\tvar qrIncludeCols string\n\t\tif o.IncludeCols != nil {\n\t\t\tqrIncludeCols = *o.IncludeCols\n\t\t}\n\t\tqIncludeCols := qrIncludeCols\n\t\tif qIncludeCols != \"\" {\n\t\t\tif err := r.SetQueryParam(\"include_cols\", qIncludeCols); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c6f7634ad8baaf1b2d1bf3ae1259f7fb", "score": "0.676801", "text": "func (o *GetInstancesDocs2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param Authorization\n\tif err := r.SetHeaderParam(\"Authorization\", o.Authorization); err != nil {\n\t\treturn err\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt64(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif o.OperationID != nil {\n\n\t\t// query param operationId\n\t\tvar qrOperationID string\n\t\tif o.OperationID != nil {\n\t\t\tqrOperationID = *o.OperationID\n\t\t}\n\t\tqOperationID := qrOperationID\n\t\tif qOperationID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"operationId\", qOperationID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Version != nil {\n\n\t\t// query param version\n\t\tvar qrVersion string\n\t\tif o.Version != nil {\n\t\t\tqrVersion = *o.Version\n\t\t}\n\t\tqVersion := qrVersion\n\t\tif qVersion != \"\" {\n\t\t\tif err := r.SetQueryParam(\"version\", qVersion); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "658e495477bb4a353a2d8d0b03b43754", "score": "0.67672104", "text": "func (o *GetExtensionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tvaluesInclude := o.Include\n\n\tjoinedInclude := swag.JoinByFormat(valuesInclude, \"multi\")\n\t// query array param include[]\n\tif err := r.SetQueryParam(\"include[]\", joinedInclude...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f1351ad5bab1538e61b02ee7448ea4fd", "score": "0.6758796", "text": "func (o *GetMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Follow != nil {\n\n\t\t// query param follow\n\t\tvar qrFollow bool\n\t\tif o.Follow != nil {\n\t\t\tqrFollow = *o.Follow\n\t\t}\n\t\tqFollow := swag.FormatBool(qrFollow)\n\t\tif qFollow != \"\" {\n\t\t\tif err := r.SetQueryParam(\"follow\", qFollow); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param model_id\n\tif err := r.SetPathParam(\"model_id\", o.ModelID); err != nil {\n\t\treturn err\n\t}\n\n\tif o.SinceTime != nil {\n\n\t\t// query param since_time\n\t\tvar qrSinceTime string\n\t\tif o.SinceTime != nil {\n\t\t\tqrSinceTime = *o.SinceTime\n\t\t}\n\t\tqSinceTime := qrSinceTime\n\t\tif qSinceTime != \"\" {\n\t\t\tif err := r.SetQueryParam(\"since_time\", qSinceTime); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param version\n\tqrVersion := o.Version\n\tqVersion := qrVersion\n\tif qVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"version\", qVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ecd1ac91a6807570d03e2f8e7fb2af42", "score": "0.6755563", "text": "func (o *CreateVersionStageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param entity\n\tif err := r.SetPathParam(\"entity\", o.Entity); err != nil {\n\t\treturn err\n\t}\n\n\t// path param kind\n\tif err := r.SetPathParam(\"kind\", o.Kind); err != nil {\n\t\treturn err\n\t}\n\n\t// path param name\n\tif err := r.SetPathParam(\"name\", o.Name); err != nil {\n\t\treturn err\n\t}\n\n\t// path param owner\n\tif err := r.SetPathParam(\"owner\", o.Owner); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "886e6e4397db9b90a289068f23583085", "score": "0.67533094", "text": "func (o *GetReleaseTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3a5e389ab85823cbf20d3ec601cc0e44", "score": "0.6748013", "text": "func (o *PutThingsIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Thing != nil {\n\t\tif err := r.SetBodyParam(o.Thing); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e48da98438d1fcd6ae82e26917cb0be2", "score": "0.674463", "text": "func (o *GetFileParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param fid\n\tif err := r.SetPathParam(\"fid\", swag.FormatInt32(o.Fid)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7f97f1721b9e9667638eeeb94e44cbb2", "score": "0.67446005", "text": "func (o *GetTenantByAPIKeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.APIKey != nil {\n\n\t\t// query param apiKey\n\t\tvar qrAPIKey string\n\n\t\tif o.APIKey != nil {\n\t\t\tqrAPIKey = *o.APIKey\n\t\t}\n\t\tqAPIKey := qrAPIKey\n\t\tif qAPIKey != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"apiKey\", qAPIKey); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// header param WithProfilingInfo\n\tif o.WithProfilingInfo != nil && len(*o.WithProfilingInfo) > 0 {\n\t\tif err := r.SetHeaderParam(\"X-Killbill-Profiling-Req\", *o.WithProfilingInfo); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// header param withStackTrace\n\tif o.WithStackTrace != nil && *o.WithStackTrace {\n\t\tif err := r.SetQueryParam(\"withStackTrace\", \"true\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "39ba41ea43365f977621c6389f760c30", "score": "0.6742888", "text": "func (o *TestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param alarmCallbackId\n\tif err := r.SetPathParam(\"alarmCallbackId\", o.AlarmCallbackID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4e0f2d4f35f1627db0cd9dd36978c255", "score": "0.67411023", "text": "func (o *UpdateNetscanParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\treturn err\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt32(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Reason != nil {\n\n\t\t// query param reason\n\t\tvar qrReason string\n\t\tif o.Reason != nil {\n\t\t\tqrReason = *o.Reason\n\t\t}\n\t\tqReason := qrReason\n\t\tif qReason != \"\" {\n\t\t\tif err := r.SetQueryParam(\"reason\", qReason); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7af9deac56e9b2f4fd1f8a19994eb713", "score": "0.67348963", "text": "func (o *TeamUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt64(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "47019447480cfb53360c3ccc8994a924", "score": "0.67336875", "text": "func (o *InvoicePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.PaidAmount != nil {\n\n\t\t// query param paidAmount\n\t\tvar qrPaidAmount float64\n\t\tif o.PaidAmount != nil {\n\t\t\tqrPaidAmount = *o.PaidAmount\n\t\t}\n\t\tqPaidAmount := swag.FormatFloat64(qrPaidAmount)\n\t\tif qPaidAmount != \"\" {\n\t\t\tif err := r.SetQueryParam(\"paidAmount\", qPaidAmount); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.PaymentTypeID != nil {\n\n\t\t// query param paymentTypeId\n\t\tvar qrPaymentTypeID int32\n\t\tif o.PaymentTypeID != nil {\n\t\t\tqrPaymentTypeID = *o.PaymentTypeID\n\t\t}\n\t\tqPaymentTypeID := swag.FormatInt32(qrPaymentTypeID)\n\t\tif qPaymentTypeID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"paymentTypeId\", qPaymentTypeID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.SendToCustomer != nil {\n\n\t\t// query param sendToCustomer\n\t\tvar qrSendToCustomer bool\n\t\tif o.SendToCustomer != nil {\n\t\t\tqrSendToCustomer = *o.SendToCustomer\n\t\t}\n\t\tqSendToCustomer := swag.FormatBool(qrSendToCustomer)\n\t\tif qSendToCustomer != \"\" {\n\t\t\tif err := r.SetQueryParam(\"sendToCustomer\", qSendToCustomer); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "18347b836c8fd2eec8178d394e77e676", "score": "0.6726254", "text": "func (o *GetUsedByAppResourcesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.AppID != nil {\n\n\t\t// query param appId\n\t\tvar qrAppID int32\n\t\tif o.AppID != nil {\n\t\t\tqrAppID = *o.AppID\n\t\t}\n\t\tqAppID := swag.FormatInt32(qrAppID)\n\t\tif qAppID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"appId\", qAppID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param user\n\tif err := r.SetPathParam(\"user\", o.User); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c09bdc928ebd76442f89d2c36131f0e1", "score": "0.6722548", "text": "func (o *OutletsGetAllOutletsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Devid != nil {\n\n\t\t// query param devid\n\t\tvar qrDevid string\n\t\tif o.Devid != nil {\n\t\t\tqrDevid = *o.Devid\n\t\t}\n\t\tqDevid := qrDevid\n\t\tif qDevid != \"\" {\n\t\t\tif err := r.SetQueryParam(\"devid\", qDevid); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.MaxResults != nil {\n\n\t\t// query param max_results\n\t\tvar qrMaxResults int32\n\t\tif o.MaxResults != nil {\n\t\t\tqrMaxResults = *o.MaxResults\n\t\t}\n\t\tqMaxResults := swag.FormatInt32(qrMaxResults)\n\t\tif qMaxResults != \"\" {\n\t\t\tif err := r.SetQueryParam(\"max_results\", qMaxResults); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Signature != nil {\n\n\t\t// query param signature\n\t\tvar qrSignature string\n\t\tif o.Signature != nil {\n\t\t\tqrSignature = *o.Signature\n\t\t}\n\t\tqSignature := qrSignature\n\t\tif qSignature != \"\" {\n\t\t\tif err := r.SetQueryParam(\"signature\", qSignature); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Token != nil {\n\n\t\t// query param token\n\t\tvar qrToken string\n\t\tif o.Token != nil {\n\t\t\tqrToken = *o.Token\n\t\t}\n\t\tqToken := qrToken\n\t\tif qToken != \"\" {\n\t\t\tif err := r.SetQueryParam(\"token\", qToken); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "71f307d2465235bd21bbcba222a1e118", "score": "0.6713836", "text": "func (o *CreateLinkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Expiration != nil {\n\n\t\t// query param expiration\n\t\tvar qrExpiration int64\n\t\tif o.Expiration != nil {\n\t\t\tqrExpiration = *o.Expiration\n\t\t}\n\t\tqExpiration := swag.FormatInt64(qrExpiration)\n\t\tif qExpiration != \"\" {\n\t\t\tif err := r.SetQueryParam(\"expiration\", qExpiration); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param node\n\tif err := r.SetPathParam(\"node\", o.Node); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Password != nil {\n\n\t\t// query param password\n\t\tvar qrPassword string\n\t\tif o.Password != nil {\n\t\t\tqrPassword = *o.Password\n\t\t}\n\t\tqPassword := qrPassword\n\t\tif qPassword != \"\" {\n\t\t\tif err := r.SetQueryParam(\"password\", qPassword); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c2de48e420d6726d1868e44eabbc5a1d", "score": "0.6710904", "text": "func (o *FormatSeriesServiceUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param object.id\n\tif err := r.SetPathParam(\"object.id\", o.ObjectID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8981c6ce1ba8a990ed74c5e7b6ea53be", "score": "0.6706226", "text": "func (o *LunModifyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.DataOffset != nil {\n\n\t\t// query param data.offset\n\t\tvar qrDataOffset int64\n\n\t\tif o.DataOffset != nil {\n\t\t\tqrDataOffset = *o.DataOffset\n\t\t}\n\t\tqDataOffset := swag.FormatInt64(qrDataOffset)\n\t\tif qDataOffset != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"data.offset\", qDataOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tif o.Info != nil {\n\t\tif err := r.SetBodyParam(o.Info); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param uuid\n\tif err := r.SetPathParam(\"uuid\", o.UUID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "668e47281ee4e01d8dfc609948bc4c32", "score": "0.67059755", "text": "func (o *UpdateGatewayParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.UpdateGatewayBody != nil {\n\t\tif err := r.SetBodyParam(o.UpdateGatewayBody); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param gw\n\tif err := r.SetPathParam(\"gw\", o.Gw); err != nil {\n\t\treturn err\n\t}\n\n\t// path param tid\n\tif err := r.SetPathParam(\"tid\", o.Tid); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e041f5597bd21c39887f521be70dbd95", "score": "0.67036146", "text": "func (o *GetServiceCredentialSchemaForPlanParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param kind\n\tif err := r.SetPathParam(\"kind\", o.Kind); err != nil {\n\t\treturn err\n\t}\n\n\t// path param name\n\tif err := r.SetPathParam(\"name\", o.Name); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "236322786031fe119ec2a0757420db73", "score": "0.67025685", "text": "func (o *UpdateAttributeDefinitionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt64(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Resource != nil {\n\t\tif err := r.SetBodyParam(o.Resource); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8ef14a211f98cb945912c8ab267f46c9", "score": "0.6702023", "text": "func (o *GetHTTPCheckParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt32(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "338c3111f4812bd7752e00e66f90f16f", "score": "0.6699822", "text": "func (o *GetOverviewParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.TimeRange != nil {\n\n\t\t// query param timeRange\n\t\tvar qrTimeRange int64\n\t\tif o.TimeRange != nil {\n\t\t\tqrTimeRange = *o.TimeRange\n\t\t}\n\t\tqTimeRange := swag.FormatInt64(qrTimeRange)\n\t\tif qTimeRange != \"\" {\n\t\t\tif err := r.SetQueryParam(\"timeRange\", qTimeRange); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ad72403d9cd2d388105a72e30bc7a343", "score": "0.6692823", "text": "func (o *GetV1InfrastructuresParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.OmitFor != nil {\n\n\t\t// query param omit_for\n\t\tvar qrOmitFor string\n\n\t\tif o.OmitFor != nil {\n\t\t\tqrOmitFor = *o.OmitFor\n\t\t}\n\t\tqOmitFor := qrOmitFor\n\t\tif qOmitFor != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"omit_for\", qOmitFor); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Page != nil {\n\n\t\t// query param page\n\t\tvar qrPage int32\n\n\t\tif o.Page != nil {\n\t\t\tqrPage = *o.Page\n\t\t}\n\t\tqPage := swag.FormatInt32(qrPage)\n\t\tif qPage != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"page\", qPage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.PerPage != nil {\n\n\t\t// query param per_page\n\t\tvar qrPerPage int32\n\n\t\tif o.PerPage != nil {\n\t\t\tqrPerPage = *o.PerPage\n\t\t}\n\t\tqPerPage := swag.FormatInt32(qrPerPage)\n\t\tif qPerPage != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"per_page\", qPerPage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Query != nil {\n\n\t\t// query param query\n\t\tvar qrQuery string\n\n\t\tif o.Query != nil {\n\t\t\tqrQuery = *o.Query\n\t\t}\n\t\tqQuery := qrQuery\n\t\tif qQuery != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"query\", qQuery); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Type != nil {\n\n\t\t// query param type\n\t\tvar qrType string\n\n\t\tif o.Type != nil {\n\t\t\tqrType = *o.Type\n\t\t}\n\t\tqType := qrType\n\t\tif qType != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"type\", qType); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dabc2f25822ce27ebc74022a61b657a6", "score": "0.6692445", "text": "func (o *CreateMergeQueryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Fields != nil {\n\n\t\t// query param fields\n\t\tvar qrFields string\n\n\t\tif o.Fields != nil {\n\t\t\tqrFields = *o.Fields\n\t\t}\n\t\tqFields := qrFields\n\t\tif qFields != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"fields\", qFields); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aea114d64fd7cd1e12a5ac86216d71e2", "score": "0.66833526", "text": "func (o *AddDevicePropertyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param deviceId\n\tif err := r.SetPathParam(\"deviceId\", swag.FormatInt32(o.DeviceID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aceb1e876ac8c9eb509e4f81e569fa39", "score": "0.6677139", "text": "func (o *CloudStoreModifyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param aggregate.uuid\n\tif err := r.SetPathParam(\"aggregate.uuid\", o.AggregateUUID); err != nil {\n\t\treturn err\n\t}\n\tif o.Info != nil {\n\t\tif err := r.SetBodyParam(o.Info); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.ReturnTimeout != nil {\n\n\t\t// query param return_timeout\n\t\tvar qrReturnTimeout int64\n\n\t\tif o.ReturnTimeout != nil {\n\t\t\tqrReturnTimeout = *o.ReturnTimeout\n\t\t}\n\t\tqReturnTimeout := swag.FormatInt64(qrReturnTimeout)\n\t\tif qReturnTimeout != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"return_timeout\", qReturnTimeout); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// path param target.uuid\n\tif err := r.SetPathParam(\"target.uuid\", o.TargetUUID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f6cda6939ba2e393d627ed6ce8b8653d", "score": "0.6676354", "text": "func (o *GetSnapshotDepParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param btLocator\n\tif err := r.SetPathParam(\"btLocator\", o.BtLocator); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Fields != nil {\n\n\t\t// query param fields\n\t\tvar qrFields string\n\t\tif o.Fields != nil {\n\t\t\tqrFields = *o.Fields\n\t\t}\n\t\tqFields := qrFields\n\t\tif qFields != \"\" {\n\t\t\tif err := r.SetQueryParam(\"fields\", qFields); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param snapshotDepLocator\n\tif err := r.SetPathParam(\"snapshotDepLocator\", o.SnapshotDepLocator); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3b57b56adc38a1a2c7109e90317cc9e4", "score": "0.66757596", "text": "func (o *CreateCustomImageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.AccountID != nil {\n\n\t\t// query param accountId\n\t\tvar qrAccountID string\n\t\tif o.AccountID != nil {\n\t\t\tqrAccountID = *o.AccountID\n\t\t}\n\t\tqAccountID := qrAccountID\n\t\tif qAccountID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"accountId\", qAccountID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param name\n\tif err := r.SetPathParam(\"name\", o.Name); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aa07e79892a26d3abeab1fd71f55cf55", "score": "0.6670894", "text": "func (o *GetBillServicesFullParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param login\n\tqrLogin := o.Login\n\tqLogin := qrLogin\n\tif qLogin != \"\" {\n\t\tif err := r.SetQueryParam(\"login\", qLogin); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param pwd\n\tqrPwd := o.Pwd\n\tqPwd := qrPwd\n\tif qPwd != \"\" {\n\t\tif err := r.SetQueryParam(\"pwd\", qPwd); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a23593eb4378a012589a0bdcda2a0c71", "score": "0.6670338", "text": "func (o *MessagingServiceVersionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param addr\n\tqrAddr := o.Addr\n\tqAddr := qrAddr\n\tif qAddr != \"\" {\n\t\tif err := r.SetQueryParam(\"addr\", qAddr); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9537ed713adb771221a2875f21140a42", "score": "0.666377", "text": "func (o *PostAPIPublicV1UserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param X-VO-Api-Id\n\tif err := r.SetHeaderParam(\"X-VO-Api-Id\", o.XVOAPIID); err != nil {\n\t\treturn err\n\t}\n\n\t// header param X-VO-Api-Key\n\tif err := r.SetHeaderParam(\"X-VO-Api-Key\", o.XVOAPIKey); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "109cbecd30a79b032077ab75c2323020", "score": "0.66631514", "text": "func (o *GetPublicSecurityGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param name\n\tif err := r.SetPathParam(\"name\", o.Name); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "314d8da709aee3d44d6f8370b7184fd1", "score": "0.66508704", "text": "func (o *TestReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param organization\n\tif err := r.SetPathParam(\"organization\", o.Organization); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dde82ea10b44882cb49118c8deb72c35", "score": "0.66508293", "text": "func (o *IndexTagSetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Skip != nil {\n\n\t\t// query param skip\n\t\tvar qrSkip int32\n\t\tif o.Skip != nil {\n\t\t\tqrSkip = *o.Skip\n\t\t}\n\t\tqSkip := swag.FormatInt32(qrSkip)\n\t\tif qSkip != \"\" {\n\t\t\tif err := r.SetQueryParam(\"skip\", qSkip); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Take != nil {\n\n\t\t// query param take\n\t\tvar qrTake int32\n\t\tif o.Take != nil {\n\t\t\tqrTake = *o.Take\n\t\t}\n\t\tqTake := swag.FormatInt32(qrTake)\n\t\tif qTake != \"\" {\n\t\t\tif err := r.SetQueryParam(\"take\", qTake); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9cea941695ed8e9c88a2391b95657594", "score": "0.6650779", "text": "func (o *GetPrivateWithdrawParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param address\n\tqrAddress := o.Address\n\tqAddress := qrAddress\n\tif qAddress != \"\" {\n\t\tif err := r.SetQueryParam(\"address\", qAddress); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param amount\n\tqrAmount := o.Amount\n\tqAmount := swag.FormatFloat64(qrAmount)\n\tif qAmount != \"\" {\n\t\tif err := r.SetQueryParam(\"amount\", qAmount); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param currency\n\tqrCurrency := o.Currency\n\tqCurrency := qrCurrency\n\tif qCurrency != \"\" {\n\t\tif err := r.SetQueryParam(\"currency\", qCurrency); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Priority != nil {\n\n\t\t// query param priority\n\t\tvar qrPriority string\n\t\tif o.Priority != nil {\n\t\t\tqrPriority = *o.Priority\n\t\t}\n\t\tqPriority := qrPriority\n\t\tif qPriority != \"\" {\n\t\t\tif err := r.SetQueryParam(\"priority\", qPriority); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Tfa != nil {\n\n\t\t// query param tfa\n\t\tvar qrTfa string\n\t\tif o.Tfa != nil {\n\t\t\tqrTfa = *o.Tfa\n\t\t}\n\t\tqTfa := qrTfa\n\t\tif qTfa != \"\" {\n\t\t\tif err := r.SetQueryParam(\"tfa\", qTfa); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "069e38073e1fa0b5eb4b0d7422f1fa83", "score": "0.66506386", "text": "func (o *QueryScansParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param filter\n\tqrFilter := o.Filter\n\tqFilter := qrFilter\n\n\tif err := r.SetQueryParam(\"filter\", qFilter); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Offset != nil {\n\n\t\t// query param offset\n\t\tvar qrOffset int64\n\n\t\tif o.Offset != nil {\n\t\t\tqrOffset = *o.Offset\n\t\t}\n\t\tqOffset := swag.FormatInt64(qrOffset)\n\t\tif qOffset != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"offset\", qOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// query param sort\n\tqrSort := o.Sort\n\tqSort := qrSort\n\n\tif err := r.SetQueryParam(\"sort\", qSort); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "977b935c96af31f761997befaa5f5cf1", "score": "0.6646305", "text": "func (o *FrozenAllParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Addresses != nil {\n\n\t\t// binding items for addresses\n\t\tjoinedAddresses := o.bindParamAddresses(reg)\n\n\t\t// query array param addresses\n\t\tif err := r.SetQueryParam(\"addresses\", joinedAddresses...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.CoinIds != nil {\n\n\t\t// binding items for coin_ids\n\t\tjoinedCoinIds := o.bindParamCoinIds(reg)\n\n\t\t// query array param coin_ids\n\t\tif err := r.SetQueryParam(\"coin_ids\", joinedCoinIds...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.EndHeight != nil {\n\n\t\t// query param end_height\n\t\tvar qrEndHeight uint64\n\n\t\tif o.EndHeight != nil {\n\t\t\tqrEndHeight = *o.EndHeight\n\t\t}\n\t\tqEndHeight := swag.FormatUint64(qrEndHeight)\n\t\tif qEndHeight != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"end_height\", qEndHeight); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Height != nil {\n\n\t\t// query param height\n\t\tvar qrHeight uint64\n\n\t\tif o.Height != nil {\n\t\t\tqrHeight = *o.Height\n\t\t}\n\t\tqHeight := swag.FormatUint64(qrHeight)\n\t\tif qHeight != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"height\", qHeight); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StartHeight != nil {\n\n\t\t// query param start_height\n\t\tvar qrStartHeight uint64\n\n\t\tif o.StartHeight != nil {\n\t\t\tqrStartHeight = *o.StartHeight\n\t\t}\n\t\tqStartHeight := swag.FormatUint64(qrStartHeight)\n\t\tif qStartHeight != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"start_height\", qStartHeight); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7deb568b2efcc18175c87603dfb7426c", "score": "0.66451526", "text": "func (o *UpdateVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param owner\n\tif err := r.SetPathParam(\"owner\", o.Owner); err != nil {\n\t\treturn err\n\t}\n\n\t// path param project\n\tif err := r.SetPathParam(\"project\", o.Project); err != nil {\n\t\treturn err\n\t}\n\n\t// path param version.kind\n\tif err := r.SetPathParam(\"version.kind\", o.VersionKind); err != nil {\n\t\treturn err\n\t}\n\n\t// path param version.name\n\tif err := r.SetPathParam(\"version.name\", o.VersionName); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a0c3c318bc3fdc1c789092eaba5ab0f9", "score": "0.6643473", "text": "func (o *CatalogsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Query != nil {\n\n\t\t// query param query\n\t\tvar qrQuery string\n\t\tif o.Query != nil {\n\t\t\tqrQuery = *o.Query\n\t\t}\n\t\tqQuery := qrQuery\n\t\tif qQuery != \"\" {\n\t\t\tif err := r.SetQueryParam(\"query\", qQuery); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Sort != nil {\n\n\t\t// query param sort\n\t\tvar qrSort string\n\t\tif o.Sort != nil {\n\t\t\tqrSort = *o.Sort\n\t\t}\n\t\tqSort := qrSort\n\t\tif qSort != \"\" {\n\t\t\tif err := r.SetQueryParam(\"sort\", qSort); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "289516362bb53ca2fba5f97a4e549aef", "score": "0.6633983", "text": "func (o *PullRequestsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt64(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ffd49bcecf51405d20ef1218ad7833be", "score": "0.66324997", "text": "func (o *CloudTargetCollectionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.AccessKey != nil {\n\n\t\t// query param access_key\n\t\tvar qrAccessKey string\n\n\t\tif o.AccessKey != nil {\n\t\t\tqrAccessKey = *o.AccessKey\n\t\t}\n\t\tqAccessKey := qrAccessKey\n\t\tif qAccessKey != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"access_key\", qAccessKey); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.AuthenticationType != nil {\n\n\t\t// query param authentication_type\n\t\tvar qrAuthenticationType string\n\n\t\tif o.AuthenticationType != nil {\n\t\t\tqrAuthenticationType = *o.AuthenticationType\n\t\t}\n\t\tqAuthenticationType := qrAuthenticationType\n\t\tif qAuthenticationType != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"authentication_type\", qAuthenticationType); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.AzureAccount != nil {\n\n\t\t// query param azure_account\n\t\tvar qrAzureAccount string\n\n\t\tif o.AzureAccount != nil {\n\t\t\tqrAzureAccount = *o.AzureAccount\n\t\t}\n\t\tqAzureAccount := qrAzureAccount\n\t\tif qAzureAccount != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"azure_account\", qAzureAccount); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.CapURL != nil {\n\n\t\t// query param cap_url\n\t\tvar qrCapURL string\n\n\t\tif o.CapURL != nil {\n\t\t\tqrCapURL = *o.CapURL\n\t\t}\n\t\tqCapURL := qrCapURL\n\t\tif qCapURL != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"cap_url\", qCapURL); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.CertificateValidationEnabled != nil {\n\n\t\t// query param certificate_validation_enabled\n\t\tvar qrCertificateValidationEnabled bool\n\n\t\tif o.CertificateValidationEnabled != nil {\n\t\t\tqrCertificateValidationEnabled = *o.CertificateValidationEnabled\n\t\t}\n\t\tqCertificateValidationEnabled := swag.FormatBool(qrCertificateValidationEnabled)\n\t\tif qCertificateValidationEnabled != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"certificate_validation_enabled\", qCertificateValidationEnabled); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ClusterName != nil {\n\n\t\t// query param cluster.name\n\t\tvar qrClusterName string\n\n\t\tif o.ClusterName != nil {\n\t\t\tqrClusterName = *o.ClusterName\n\t\t}\n\t\tqClusterName := qrClusterName\n\t\tif qClusterName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"cluster.name\", qClusterName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ClusterUUID != nil {\n\n\t\t// query param cluster.uuid\n\t\tvar qrClusterUUID string\n\n\t\tif o.ClusterUUID != nil {\n\t\t\tqrClusterUUID = *o.ClusterUUID\n\t\t}\n\t\tqClusterUUID := qrClusterUUID\n\t\tif qClusterUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"cluster.uuid\", qClusterUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Container != nil {\n\n\t\t// query param container\n\t\tvar qrContainer string\n\n\t\tif o.Container != nil {\n\t\t\tqrContainer = *o.Container\n\t\t}\n\t\tqContainer := qrContainer\n\t\tif qContainer != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"container\", qContainer); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Fields != nil {\n\n\t\t// binding items for fields\n\t\tjoinedFields := o.bindParamFields(reg)\n\n\t\t// query array param fields\n\t\tif err := r.SetQueryParam(\"fields\", joinedFields...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.IpspaceName != nil {\n\n\t\t// query param ipspace.name\n\t\tvar qrIpspaceName string\n\n\t\tif o.IpspaceName != nil {\n\t\t\tqrIpspaceName = *o.IpspaceName\n\t\t}\n\t\tqIpspaceName := qrIpspaceName\n\t\tif qIpspaceName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"ipspace.name\", qIpspaceName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.IpspaceUUID != nil {\n\n\t\t// query param ipspace.uuid\n\t\tvar qrIpspaceUUID string\n\n\t\tif o.IpspaceUUID != nil {\n\t\t\tqrIpspaceUUID = *o.IpspaceUUID\n\t\t}\n\t\tqIpspaceUUID := qrIpspaceUUID\n\t\tif qIpspaceUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"ipspace.uuid\", qIpspaceUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.MaxRecords != nil {\n\n\t\t// query param max_records\n\t\tvar qrMaxRecords int64\n\n\t\tif o.MaxRecords != nil {\n\t\t\tqrMaxRecords = *o.MaxRecords\n\t\t}\n\t\tqMaxRecords := swag.FormatInt64(qrMaxRecords)\n\t\tif qMaxRecords != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"max_records\", qMaxRecords); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Name != nil {\n\n\t\t// query param name\n\t\tvar qrName string\n\n\t\tif o.Name != nil {\n\t\t\tqrName = *o.Name\n\t\t}\n\t\tqName := qrName\n\t\tif qName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"name\", qName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.OrderBy != nil {\n\n\t\t// binding items for order_by\n\t\tjoinedOrderBy := o.bindParamOrderBy(reg)\n\n\t\t// query array param order_by\n\t\tif err := r.SetQueryParam(\"order_by\", joinedOrderBy...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Owner != nil {\n\n\t\t// query param owner\n\t\tvar qrOwner string\n\n\t\tif o.Owner != nil {\n\t\t\tqrOwner = *o.Owner\n\t\t}\n\t\tqOwner := qrOwner\n\t\tif qOwner != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"owner\", qOwner); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Port != nil {\n\n\t\t// query param port\n\t\tvar qrPort int64\n\n\t\tif o.Port != nil {\n\t\t\tqrPort = *o.Port\n\t\t}\n\t\tqPort := swag.FormatInt64(qrPort)\n\t\tif qPort != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"port\", qPort); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ProviderType != nil {\n\n\t\t// query param provider_type\n\t\tvar qrProviderType string\n\n\t\tif o.ProviderType != nil {\n\t\t\tqrProviderType = *o.ProviderType\n\t\t}\n\t\tqProviderType := qrProviderType\n\t\tif qProviderType != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"provider_type\", qProviderType); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ReturnRecords != nil {\n\n\t\t// query param return_records\n\t\tvar qrReturnRecords bool\n\n\t\tif o.ReturnRecords != nil {\n\t\t\tqrReturnRecords = *o.ReturnRecords\n\t\t}\n\t\tqReturnRecords := swag.FormatBool(qrReturnRecords)\n\t\tif qReturnRecords != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"return_records\", qReturnRecords); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ReturnTimeout != nil {\n\n\t\t// query param return_timeout\n\t\tvar qrReturnTimeout int64\n\n\t\tif o.ReturnTimeout != nil {\n\t\t\tqrReturnTimeout = *o.ReturnTimeout\n\t\t}\n\t\tqReturnTimeout := swag.FormatInt64(qrReturnTimeout)\n\t\tif qReturnTimeout != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"return_timeout\", qReturnTimeout); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Scope != nil {\n\n\t\t// query param scope\n\t\tvar qrScope string\n\n\t\tif o.Scope != nil {\n\t\t\tqrScope = *o.Scope\n\t\t}\n\t\tqScope := qrScope\n\t\tif qScope != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"scope\", qScope); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Server != nil {\n\n\t\t// query param server\n\t\tvar qrServer string\n\n\t\tif o.Server != nil {\n\t\t\tqrServer = *o.Server\n\t\t}\n\t\tqServer := qrServer\n\t\tif qServer != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"server\", qServer); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ServerSideEncryption != nil {\n\n\t\t// query param server_side_encryption\n\t\tvar qrServerSideEncryption string\n\n\t\tif o.ServerSideEncryption != nil {\n\t\t\tqrServerSideEncryption = *o.ServerSideEncryption\n\t\t}\n\t\tqServerSideEncryption := qrServerSideEncryption\n\t\tif qServerSideEncryption != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"server_side_encryption\", qServerSideEncryption); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SnapmirrorUse != nil {\n\n\t\t// query param snapmirror_use\n\t\tvar qrSnapmirrorUse string\n\n\t\tif o.SnapmirrorUse != nil {\n\t\t\tqrSnapmirrorUse = *o.SnapmirrorUse\n\t\t}\n\t\tqSnapmirrorUse := qrSnapmirrorUse\n\t\tif qSnapmirrorUse != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"snapmirror_use\", qSnapmirrorUse); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SslEnabled != nil {\n\n\t\t// query param ssl_enabled\n\t\tvar qrSslEnabled bool\n\n\t\tif o.SslEnabled != nil {\n\t\t\tqrSslEnabled = *o.SslEnabled\n\t\t}\n\t\tqSslEnabled := swag.FormatBool(qrSslEnabled)\n\t\tif qSslEnabled != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"ssl_enabled\", qSslEnabled); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SvmName != nil {\n\n\t\t// query param svm.name\n\t\tvar qrSvmName string\n\n\t\tif o.SvmName != nil {\n\t\t\tqrSvmName = *o.SvmName\n\t\t}\n\t\tqSvmName := qrSvmName\n\t\tif qSvmName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"svm.name\", qSvmName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SvmUUID != nil {\n\n\t\t// query param svm.uuid\n\t\tvar qrSvmUUID string\n\n\t\tif o.SvmUUID != nil {\n\t\t\tqrSvmUUID = *o.SvmUUID\n\t\t}\n\t\tqSvmUUID := qrSvmUUID\n\t\tif qSvmUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"svm.uuid\", qSvmUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.URLStyle != nil {\n\n\t\t// query param url_style\n\t\tvar qrURLStyle string\n\n\t\tif o.URLStyle != nil {\n\t\t\tqrURLStyle = *o.URLStyle\n\t\t}\n\t\tqURLStyle := qrURLStyle\n\t\tif qURLStyle != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"url_style\", qURLStyle); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.UseHTTPProxy != nil {\n\n\t\t// query param use_http_proxy\n\t\tvar qrUseHTTPProxy bool\n\n\t\tif o.UseHTTPProxy != nil {\n\t\t\tqrUseHTTPProxy = *o.UseHTTPProxy\n\t\t}\n\t\tqUseHTTPProxy := swag.FormatBool(qrUseHTTPProxy)\n\t\tif qUseHTTPProxy != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"use_http_proxy\", qUseHTTPProxy); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Used != nil {\n\n\t\t// query param used\n\t\tvar qrUsed int64\n\n\t\tif o.Used != nil {\n\t\t\tqrUsed = *o.Used\n\t\t}\n\t\tqUsed := swag.FormatInt64(qrUsed)\n\t\tif qUsed != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"used\", qUsed); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.UUID != nil {\n\n\t\t// query param uuid\n\t\tvar qrUUID string\n\n\t\tif o.UUID != nil {\n\t\t\tqrUUID = *o.UUID\n\t\t}\n\t\tqUUID := qrUUID\n\t\tif qUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"uuid\", qUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "173977d290de1bb764b96cda4f2e38c0", "score": "0.66306597", "text": "func (o *QueryIOCsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.CreatedBy != nil {\n\n\t\t// query param created_by\n\t\tvar qrCreatedBy string\n\n\t\tif o.CreatedBy != nil {\n\t\t\tqrCreatedBy = *o.CreatedBy\n\t\t}\n\t\tqCreatedBy := qrCreatedBy\n\t\tif qCreatedBy != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"created_by\", qCreatedBy); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.DeletedBy != nil {\n\n\t\t// query param deleted_by\n\t\tvar qrDeletedBy string\n\n\t\tif o.DeletedBy != nil {\n\t\t\tqrDeletedBy = *o.DeletedBy\n\t\t}\n\t\tqDeletedBy := qrDeletedBy\n\t\tif qDeletedBy != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"deleted_by\", qDeletedBy); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.FromExpirationTimestamp != nil {\n\n\t\t// query param from.expiration_timestamp\n\t\tvar qrFromExpirationTimestamp string\n\n\t\tif o.FromExpirationTimestamp != nil {\n\t\t\tqrFromExpirationTimestamp = *o.FromExpirationTimestamp\n\t\t}\n\t\tqFromExpirationTimestamp := qrFromExpirationTimestamp\n\t\tif qFromExpirationTimestamp != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"from.expiration_timestamp\", qFromExpirationTimestamp); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.IncludeDeleted != nil {\n\n\t\t// query param include_deleted\n\t\tvar qrIncludeDeleted string\n\n\t\tif o.IncludeDeleted != nil {\n\t\t\tqrIncludeDeleted = *o.IncludeDeleted\n\t\t}\n\t\tqIncludeDeleted := qrIncludeDeleted\n\t\tif qIncludeDeleted != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"include_deleted\", qIncludeDeleted); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Policies != nil {\n\n\t\t// query param policies\n\t\tvar qrPolicies string\n\n\t\tif o.Policies != nil {\n\t\t\tqrPolicies = *o.Policies\n\t\t}\n\t\tqPolicies := qrPolicies\n\t\tif qPolicies != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"policies\", qPolicies); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ShareLevels != nil {\n\n\t\t// query param share_levels\n\t\tvar qrShareLevels string\n\n\t\tif o.ShareLevels != nil {\n\t\t\tqrShareLevels = *o.ShareLevels\n\t\t}\n\t\tqShareLevels := qrShareLevels\n\t\tif qShareLevels != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"share_levels\", qShareLevels); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Sources != nil {\n\n\t\t// query param sources\n\t\tvar qrSources string\n\n\t\tif o.Sources != nil {\n\t\t\tqrSources = *o.Sources\n\t\t}\n\t\tqSources := qrSources\n\t\tif qSources != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"sources\", qSources); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ToExpirationTimestamp != nil {\n\n\t\t// query param to.expiration_timestamp\n\t\tvar qrToExpirationTimestamp string\n\n\t\tif o.ToExpirationTimestamp != nil {\n\t\t\tqrToExpirationTimestamp = *o.ToExpirationTimestamp\n\t\t}\n\t\tqToExpirationTimestamp := qrToExpirationTimestamp\n\t\tif qToExpirationTimestamp != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"to.expiration_timestamp\", qToExpirationTimestamp); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Types != nil {\n\n\t\t// query param types\n\t\tvar qrTypes string\n\n\t\tif o.Types != nil {\n\t\t\tqrTypes = *o.Types\n\t\t}\n\t\tqTypes := qrTypes\n\t\tif qTypes != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"types\", qTypes); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Values != nil {\n\n\t\t// query param values\n\t\tvar qrValues string\n\n\t\tif o.Values != nil {\n\t\t\tqrValues = *o.Values\n\t\t}\n\t\tqValues := qrValues\n\t\tif qValues != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"values\", qValues); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5a8b32ee41f199ff9be9524a78c089bc", "score": "0.6626234", "text": "func (o *RegisterUsingPUTParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID.String()); err != nil {\n\t\treturn err\n\t}\n\tif o.NamespaceState != nil {\n\t\tif err := r.SetBodyParam(o.NamespaceState); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "609bd5831541bfb5a44d72917e8ef9c1", "score": "0.6625113", "text": "func (o *PatchDCParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Patch != nil {\n\t\tif err := r.SetBodyParam(o.Patch); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param dc\n\tif err := r.SetPathParam(\"dc\", o.DCToPatch); err != nil {\n\t\treturn err\n\t}\n\n\t// path param seed_name\n\tif err := r.SetPathParam(\"seed_name\", o.Seed); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9c4d797024f1a34e8e03832a1a0e791b", "score": "0.66206205", "text": "func (o *CreateWorkflowParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\t// query param op\n\tqrOp := o.Op\n\tqOp := qrOp\n\tif qOp != \"\" {\n\n\t\tif err := r.SetQueryParam(\"op\", qOp); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param workflow\n\tif err := r.SetPathParam(\"workflow\", o.Workflow); err != nil {\n\t\treturn err\n\t}\n\tif err := r.SetBodyParam(o.WorkflowData); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0154509d1d3c0a447f43a522dca9b469", "score": "0.6615323", "text": "func (o *CreateGetThumbnailsFormEncodedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.timeout)\n\tvar res []error\n\n\tif o.Accept != nil {\n\n\t\t// query param Accept\n\t\tvar qrAccept string\n\t\tif o.Accept != nil {\n\t\t\tqrAccept = *o.Accept\n\t\t}\n\t\tqAccept := qrAccept\n\t\tif qAccept != \"\" {\n\t\t\tif err := r.SetQueryParam(\"Accept\", qAccept); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.DefaultAllowed != nil {\n\n\t\t// query param defaultAllowed\n\t\tvar qrDefaultAllowed bool\n\t\tif o.DefaultAllowed != nil {\n\t\t\tqrDefaultAllowed = *o.DefaultAllowed\n\t\t}\n\t\tqDefaultAllowed := swag.FormatBool(qrDefaultAllowed)\n\t\tif qDefaultAllowed != \"\" {\n\t\t\tif err := r.SetQueryParam(\"defaultAllowed\", qDefaultAllowed); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d1313e5afc0e611bf35ece4edfb45c94", "score": "0.6613047", "text": "func (o *LunMapCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.AdditionalReportingNodeName != nil {\n\n\t\t// query param additional_reporting_node.name\n\t\tvar qrAdditionalReportingNodeName string\n\n\t\tif o.AdditionalReportingNodeName != nil {\n\t\t\tqrAdditionalReportingNodeName = *o.AdditionalReportingNodeName\n\t\t}\n\t\tqAdditionalReportingNodeName := qrAdditionalReportingNodeName\n\t\tif qAdditionalReportingNodeName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"additional_reporting_node.name\", qAdditionalReportingNodeName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.AdditionalReportingNodeUUID != nil {\n\n\t\t// query param additional_reporting_node.uuid\n\t\tvar qrAdditionalReportingNodeUUID string\n\n\t\tif o.AdditionalReportingNodeUUID != nil {\n\t\t\tqrAdditionalReportingNodeUUID = *o.AdditionalReportingNodeUUID\n\t\t}\n\t\tqAdditionalReportingNodeUUID := qrAdditionalReportingNodeUUID\n\t\tif qAdditionalReportingNodeUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"additional_reporting_node.uuid\", qAdditionalReportingNodeUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tif o.Info != nil {\n\t\tif err := r.SetBodyParam(o.Info); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.ReturnRecords != nil {\n\n\t\t// query param return_records\n\t\tvar qrReturnRecords bool\n\n\t\tif o.ReturnRecords != nil {\n\t\t\tqrReturnRecords = *o.ReturnRecords\n\t\t}\n\t\tqReturnRecords := swag.FormatBool(qrReturnRecords)\n\t\tif qReturnRecords != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"return_records\", qReturnRecords); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "57f85af3f84a000ed15a025ca5e36d89", "score": "0.6613045", "text": "func (o *ReplaceTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param api-version\n\tqrAPIVersion := o.APIVersion\n\tqAPIVersion := qrAPIVersion\n\tif qAPIVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"api-version\", qAPIVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param organization\n\tif err := r.SetPathParam(\"organization\", o.Organization); err != nil {\n\t\treturn err\n\t}\n\n\t// path param project\n\tif err := r.SetPathParam(\"project\", o.Project); err != nil {\n\t\treturn err\n\t}\n\n\t// path param team\n\tif err := r.SetPathParam(\"team\", o.Team); err != nil {\n\t\treturn err\n\t}\n\n\t// path param templateId\n\tif err := r.SetPathParam(\"templateId\", o.TemplateID.String()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "db6585320b6769f429be083d0934ca4c", "score": "0.6606277", "text": "func (o *EmployeeNextOfKinPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e237f7b2e1dd67873eed40e97b2f6686", "score": "0.6602107", "text": "func (o *FoodWeightNamesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param foodId\n\tif err := r.SetPathParam(\"foodId\", swag.FormatInt32(o.FoodID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f9972f2fff85fd89960fee32dc6bd16a", "score": "0.659938", "text": "func (o *GetSearchUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.After != nil {\n\n\t\t// query param after\n\t\tvar qrAfter int64\n\t\tif o.After != nil {\n\t\t\tqrAfter = *o.After\n\t\t}\n\t\tqAfter := swag.FormatInt64(qrAfter)\n\t\tif qAfter != \"\" {\n\t\t\tif err := r.SetQueryParam(\"after\", qAfter); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param environmentKey\n\tif err := r.SetPathParam(\"environmentKey\", o.EnvironmentKey); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Offset != nil {\n\n\t\t// query param offset\n\t\tvar qrOffset int64\n\t\tif o.Offset != nil {\n\t\t\tqrOffset = *o.Offset\n\t\t}\n\t\tqOffset := swag.FormatInt64(qrOffset)\n\t\tif qOffset != \"\" {\n\t\t\tif err := r.SetQueryParam(\"offset\", qOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param projectKey\n\tif err := r.SetPathParam(\"projectKey\", o.ProjectKey); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Q != nil {\n\n\t\t// query param q\n\t\tvar qrQ string\n\t\tif o.Q != nil {\n\t\t\tqrQ = *o.Q\n\t\t}\n\t\tqQ := qrQ\n\t\tif qQ != \"\" {\n\t\t\tif err := r.SetQueryParam(\"q\", qQ); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "82cc79a94484ea9c9be58e9f1c7eda0f", "score": "0.6596722", "text": "func (o *DescribeTCPLbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param tl\n\tif err := r.SetPathParam(\"tl\", o.Tl); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" } ]
cd85f6145d0dba4b817728dcdc57c513
DeleteUser delete an user from the DB
[ { "docid": "5fa97ae45ab8b20a1074963b0fbac896", "score": "0.0", "text": "func DeleteUser(uid string) (err *error) {\n\tdefer errz.Recover(err)\n\n\tdb, err := FetchDBFromCache()\n\terrz.Fatal(*err)\n\n\tstmt, e := db.Prepare(\"DELETE FROM users where uid=?\")\n\tif e != nil {\n\t\terr = &e\n\t\terrz.Fatal(*err)\n\t}\n\tstmt.Exec(uid)\n\n\treturn err\n}", "title": "" } ]
[ { "docid": "5a6c3c9399ab0a6a4c251e6082116075", "score": "0.8542848", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tdomainParts := strings.Split(r.Host, \".\")\n\n\tparams := mux.Vars(r)\n\tid := params[\"id\"]\n\n\tdb, _ := DBConnection(domainParts[0])\n\tdefer db.Close()\n\n\tvar user User\n\tdb.Where(\"id=?\", id).Find(&user)\n\n\tdb.Delete(&user)\n\n\tfmt.Fprintf(w, \"User succesfully deleted\")\n}", "title": "" }, { "docid": "0cebc87381a06b12fa448df412d625f7", "score": "0.8266623", "text": "func DeleteUser(user *User, id string) (err error) {\n\tconfig.DB.Where(\"id = ?\", id).Delete(user)\n\treturn nil\n}", "title": "" }, { "docid": "72279f4144b51037c3258d1a4f1c7ce4", "score": "0.8266456", "text": "func DeleteUser(user *User, id string) (err error) {\n\tConfig.DB.Where(\"id = ?\", id).Delete(user)\n\treturn nil\n}", "title": "" }, { "docid": "72279f4144b51037c3258d1a4f1c7ce4", "score": "0.8266456", "text": "func DeleteUser(user *User, id string) (err error) {\n\tConfig.DB.Where(\"id = ?\", id).Delete(user)\n\treturn nil\n}", "title": "" }, { "docid": "d8677d51477772ca5bec5541f4197e6c", "score": "0.82490206", "text": "func (uc UserController) DeleteUser(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n\tid := p.ByName(\"id\")\n\n\tif !bson.IsObjectIdHex(id) {\n\t\tw.WriteHeader(404)\n\t\treturn\n\t}\n\n\toid := bson.ObjectIdHex(id)\n\n\t// Delete user\n\t//if err := uc.session.DB(\"go-web-dev-db\").C(\"users\").RemoveId(oid); err != nil {\n\t//\tw.WriteHeader(404)\n\t//\treturn\n\t//}\n\n\tw.WriteHeader(http.StatusOK) // 200\n\tfmt.Fprint(w, \"Deleted user\", oid, \"\\n\")\n}", "title": "" }, { "docid": "386a8f2a2f18a97e0e4bd44502787557", "score": "0.8238305", "text": "func DeleteUser(user models.User, id string) (res structs.Response, err error) {\n\tconfig.DB.Where(\"id = ?\", id).Delete(&user)\n\tres.Message = \"user delete success\"\n\treturn\n}", "title": "" }, { "docid": "ee9fe6a0d0cbd3b3fb93e5fb24124939", "score": "0.8188945", "text": "func DeleteUser(id int64) (err error) {\n\to := orm.NewOrm()\n\tv := User{ID: id}\n\t// ascertain id exists in the database\n\tif err = o.Read(&v); err == nil {\n\t\t_, err = o.Delete(&User{ID: id})\n\t}\n\treturn\n}", "title": "" }, { "docid": "42823c3d18b767f2611fd010d40fb77e", "score": "0.8150947", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tif u.CheckMethodPath(\"DELETE\", u.CheckRoutes[\"user\"], w, r) {\n\t\treturn\n\t}\n\tuser := m.User{}\n\tv := mux.Vars(r)\n\tif len(v) != 1 || !u.IsStringInt(v[\"id\"]) {\n\t\thttp.Error(w, \"Bad request\", 400)\n\t\treturn\n\t}\n\tdb := u.GetConnection()\n\tif u.CheckErrorCode(db.First(&user, v[\"id\"]).Error, w) {\n\t\treturn\n\t}\n\tdb.Model(&user).Update(\"is_active\", false)\n}", "title": "" }, { "docid": "0761be779f1940b26a498e6c8e5f2a55", "score": "0.81484157", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\treq := rpc.DeleteRequest{UserId: ps.ByName(\"id\")}\n\tres, err := us.Delete(ctx, &req)\n\tThrowError(err)\n\tif res != nil {\n\t\tfmt.Fprint(w, \"Da xoa user voi id = \", res.UserId)\n\t}\n}", "title": "" }, { "docid": "f5cdea3a52da780e748078119648e0ac", "score": "0.81430775", "text": "func DeleteUser(db *gorm.DB, w http.ResponseWriter, r *http.Request) {\n\tvars := r.URL.Query()\n\tid, ok := strconv.Atoi(vars[\"u_id\"][0])\n\tif ok != nil {\n\t\trespondWithError(w, http.StatusBadRequest, \"Invalid User ID\")\n\t\treturn\n\t}\n\n\tp := models.User{ID: id}\n\tif GetUserByID(db, &p, w) == 0 {\n\t\treturn\n\t}\n\n\tif err := p.DeleteUser(db); err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\trespondWithJSON(w, http.StatusOK, map[string]string{\"result\": \"success\"})\n}", "title": "" }, { "docid": "2aee0c76a1bd9a1fada63f10e2876579", "score": "0.8101381", "text": "func (c *client) DeleteUser(id int64) error {\n\tlogrus.Tracef(\"Deleting user %d from the database\", id)\n\n\t// send query to the database\n\treturn c.Database.\n\t\tTable(constants.TableUser).\n\t\tExec(c.DML.UserService.Delete, id).Error\n}", "title": "" }, { "docid": "9107d49b6859f1318eb5ba974529f489", "score": "0.80976963", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tuserID, err := getUserID(r)\n\tif err != nil {\n\t\tresponses.Error(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\n\tuserIDfromToken, err := authentication.GetUserID(r)\n\tif err != nil {\n\t\tresponses.Error(w, http.StatusUnauthorized, err)\n\t\treturn\n\t}\n\n\tif userID != userIDfromToken {\n\t\tresponses.Error(w, http.StatusForbidden, errors.New(\"Invalid user\"))\n\t\treturn\n\t}\n\n\tdb, err := database.Connect()\n\tif err != nil {\n\t\tresponses.Error(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\tdefer db.Close()\n\n\trepository := repositories.NewUsersRepository(db)\n\tif err = repository.Delete(userID); err != nil {\n\t\tresponses.Error(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\n\tresponses.JSON(w, http.StatusNoContent, nil)\n}", "title": "" }, { "docid": "441b548aa12bfbcdcd45baf6748bdeac", "score": "0.80865246", "text": "func (db *MysqlDB) DeleteUser(id int) error {\n\tq := fmt.Sprintf(\"Delete from User where id ='%d'\", id)\n\t_, err := db.Query(q)\n\treturn err\n}", "title": "" }, { "docid": "9816274fbbfea0f050d9d15bf21853cc", "score": "0.8080052", "text": "func DeleteUser(db *sql.DB, id int) error {\n\t_, err := db.Exec(\"DELETE FROM users WHERE id=$1\", id)\n\treturn err\n}", "title": "" }, { "docid": "71004bf1ac9ea0f325af1872b31b8c95", "score": "0.8075851", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request, db *sql.DB) {\n\trespondWithError(w, http.StatusInternalServerError, fail, \"Not implemented\")\n}", "title": "" }, { "docid": "4d13259e65359e29622e85a54a7f209f", "score": "0.807465", "text": "func DeleteUser(id int64) (err error) {\n\to := orm.NewOrm()\n\to.Using(model.DbName)\n\tv := model.User{Id: id}\n\t// ascertain id exists in the database\n\tif err = o.Read(&v); err == nil {\n\t\tvar num int64\n\t\tif num, err = o.Delete(&model.User{Id: id}); err == nil {\n\t\t\tfmt.Println(\"Number of records deleted in database:\", num)\n\t\t\tcache.DelUser(id)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "87efacc97cbcaaacab966f0016c25304", "score": "0.8060443", "text": "func (r *repo) DeleteUser(id string) error {\n\t_, err := r.db.NamedExec(`delete from users where _id=:id`, map[string]interface{}{\n\t\t\"id\": id,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f240251cdec13a0e05f7ad5b550d9e8b", "score": "0.8044765", "text": "func (s *userssrvc) DeleteUser(ctx context.Context, p *users.DeleteUserPayload) (err error) {\n\ts.logger.Print(\"users.Delete\")\n\tstmt, err := s.DB.Prepare(\"DELETE FROM users WHERE id=?\")\n\tdefer stmt.Close()\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = stmt.Exec(p.ID)\n\tif err != nil {\n\t\treturn\n\t}\n\ts.logger.Printf(\"DELETE: Id: %s\", p.ID)\n\treturn\n}", "title": "" }, { "docid": "2744a035e04289c9fa39ff32fc20c430", "score": "0.8038212", "text": "func DeleteUser(c *gin.Context) {\n\tvar user Models.Store\n\tid := c.Params.ByName(\"id\")\n\terr := Models.DeleteUser(&user, id)\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusNotFound)\n\t} else {\n\t\tc.JSON(http.StatusOK, gin.H{\"id\" + id: \"is deleted\"})\n\t}\n}", "title": "" }, { "docid": "0de1d2dfdf45b3919c26c4699670fa63", "score": "0.8035129", "text": "func (user *User) Delete() *errors.RestErr {\n\tif err := usersdb.Client.Ping(); err != nil {\n\t\tpanic(err)\n\t}\n\tstmt, err := usersdb.Client.Prepare(queryDeleteUser)\n\tif err != nil {\n\t\treturn errors.InternalServerErr(err.Error())\n\t}\n\tdefer stmt.Close()\n\t_, deleteErr := stmt.Exec(user.ID)\n\tif deleteErr != nil {\n\t\treturn mysqlutils.ParseError(deleteErr)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "78674eb6f6e0291b96965919c44fedb4", "score": "0.8018095", "text": "func deleteUser(u *models.User, db *gorm.DB) error {\n\t//q := `delete from users where id=?;`\n\t//q := `update from users set delete_at = now() where id=?;`\n\t//err :=db.Delete(&u).GetErrors()\n\terr := db.Unscoped().Delete(u).GetErrors()\n\tif len(err) != 0 {\n\t\treturn errors.New(\"Erro al borrar\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "38ffba9798857e987c119bd5db39ae81", "score": "0.80124485", "text": "func (db *sqlstore) DeleteUser(user *models.User) error {\n\tquery := db.Rebind(\"DELETE FROM users WHERE id = ?\")\n\t_, err := db.Exec(query, user.ID)\n\treturn err\n}", "title": "" }, { "docid": "18c33d47068abd106a685ef28604f83b", "score": "0.8010999", "text": "func DeleteUser(username string) {\n\n\tvar user entity.User\n\terrors := db.Conn.Where(\"user_name = ?\", username).First(&user).GetErrors()\n\n\tfor _, err := range errors {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tdb.Conn.Delete(&user)\n}", "title": "" }, { "docid": "df4acba77bc9a06c9fc49c05ce6b5096", "score": "0.80052304", "text": "func DeleteUser(params users.DeleteUserParams) model.User {\n\tdb := dbpkg.Connect()\n\tdefer db.Close()\n\n\tvar user model.User\n\tuser.ID = params.ID\n\n\tdb.Delete(&user)\n\n\treturn user\n\n}", "title": "" }, { "docid": "00929fe70c72374b5fa8990646d74fa5", "score": "0.799777", "text": "func DeleteUser(id uint32) error {\n\tuser := UserModel{ID: id}\n\treturn DB.Self.Delete(&user).Error\n}", "title": "" }, { "docid": "b28b1934bdb406ab813d407fbfadc219", "score": "0.79887635", "text": "func (user *User) Delete() (err error) {\n\tstatement := \"delete from users where id = $1\"\n\tstmt, err := Db.Prepare(statement)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer stmt.Close()\n\n\t_, err = stmt.Exec(user.Id)\n\treturn\n}", "title": "" }, { "docid": "5c2f933db5084182dd5539482ca85fc1", "score": "0.79819846", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tuserIDParam := chi.URLParam(r, \"id\") // from a route like /users/{id}\n\tuserID, err := strconv.ParseUint(userIDParam, 10, 32)\n\tif err != nil {\n\t\t_response.Error(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\tdb, err := database.Connect()\n\tif err != nil {\n\t\t_response.Error(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\n\trepo := crud.NewRepositoryUsersCRUD(db)\n\n\tfunc(userRepository repository.UserRepository) {\n\t\t_, err := userRepository.Delete(uint32(userID))\n\t\tif err != nil {\n\t\t\t_response.Error(w, http.StatusUnprocessableEntity, err)\n\t\t\treturn\n\t\t}\n\t\tw.Header().Set(\"Entity\", fmt.Sprintf(\"%d\", userID))\n\t\t_response.JSON(w, http.StatusNoContent, \"\")\n\t}(repo)\n}", "title": "" }, { "docid": "fedec3d764b384d042b71f36951a0948", "score": "0.7978956", "text": "func DeleteUser(c *gin.Context) {\n\tvar user entities.User\n\tid := c.Params.ByName(\"id\")\n\terr := services.DeleteUser(&user, id)\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusNotFound)\n\t} else {\n\t\tc.JSON(http.StatusOK, gin.H{\"id\" + id: \"is deleted\"})\n\t}\n}", "title": "" }, { "docid": "207cf918772251e683b57ba8e5a7b2b5", "score": "0.7977731", "text": "func DeleteUser(c echo.Context) error {\n\tm := echo.Map{}\n\tif err := c.Bind(&m); err != nil {\n\t\treturn err\n\t}\n\tID := int64(m[\"id\"].(float64))\n\n\terr := db.DeleteUser(ID)\n\tif err != nil {\n\t\treturn c.JSON(http.StatusConflict, echo.Map{\n\t\t\t\"error\": \"error deleting user\",\n\t\t})\n\t}\n\n\treturn c.JSON(http.StatusOK, echo.Map{\n\t\t\"message\": \"ok\",\n\t})\n\n}", "title": "" }, { "docid": "fa2cd89105c88bf292336f46632a338d", "score": "0.79735595", "text": "func DeleteUser(c *gin.Context) {\n\n\tuserID := c.Param(\"id\")\n\n\tif bson.IsObjectIdHex(userID) != true {\n\t\tmessage := \"Invalid User ID \"\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"status\": http.StatusBadRequest, \"message\": message})\n\t\treturn\n\t}\n\n\terror := db.Collection.RemoveId(bson.ObjectIdHex(userID))\n\n\tif error != nil {\n\t\tmessage := \"User \" + error.Error()\n\t\tc.JSON(http.StatusNotFound, gin.H{\"status\": http.StatusNotFound, \"message\": message})\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, gin.H{\"status\": http.StatusOK, \"message\": \"User deleted successfully!\"})\n}", "title": "" }, { "docid": "50527e070355261a07659b65433ef287", "score": "0.79648304", "text": "func (ug *userGorm) Delete(user *User) error {\n\treturn ug.db.Delete(&User{Model: gorm.Model{ID: user.ID}}).Error\n\n}", "title": "" }, { "docid": "17c8affd0a63863988a7c6d2dee42d77", "score": "0.7963992", "text": "func Delete(u *types.User) error {\n\tdb := database.GetMySQLInstance()\n\treturn db.Close()\n\treturn db.Unscoped().Delete(u).Error\n}", "title": "" }, { "docid": "409aa806067bc8548ac124a9ce3df5c9", "score": "0.795795", "text": "func (a *App) DeleteUser(w http.ResponseWriter, r *http.Request) {\n\thandlers.DeleteUser(a.DB, w, r)\n}", "title": "" }, { "docid": "010d10bfe37c59d38653a01513d4f21e", "score": "0.7936196", "text": "func DeleteUser(c *gin.Context) {\n\tvar user model.User\n\tuserID := c.Param(\"id\")\n\n\t// Check exist user\n\terr := DB.First(&user, userID).Error\n\tif err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {\n\t\tLog.Debug(\"Getting error when check exist user\", \"error\", err.Error())\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"status\": http.StatusInternalServerError, \"message\": err.Error()})\n\t\treturn\n\t}\n\n\tif user.ID == 0 {\n\t\tc.JSON(http.StatusNotFound, gin.H{\"status\": http.StatusNotFound, \"message\": \"ID not found!\"})\n\t\treturn\n\t}\n\n\terr = DB.Delete(&user).Error\n\tif err != nil {\n\t\tLog.Debug(\"Getting error when delete user\", \"error\", err.Error())\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"status\": http.StatusInternalServerError, \"message\": err.Error()})\n\t\treturn\n\t}\n\n\t// Remove Cache Redis\n\tclient.Del(\"AllUser\")\n\tclient.Del(\"User\" + userID)\n\n\tc.JSON(http.StatusOK, gin.H{\"status\": http.StatusOK, \"message\": \"User deleted successfully!\"})\n}", "title": "" }, { "docid": "ac0386ffadaad3925072fdd6692900ae", "score": "0.79332966", "text": "func DeleteUser(c *gin.Context) {\n\tid := c.Params.ByName(\"id\")\n\tvar user Users\n\tretVal := db.Where(\"id=?\", id).Delete(&user)\n\tfmt.Println(retVal)\n\n\tc.JSON(http.StatusOK, user)\n\n}", "title": "" }, { "docid": "09084c7b4669dfbcb96cc2a0c115af76", "score": "0.7924841", "text": "func DeleteUser(c *fiber.Ctx) error {\n\tuserToken := c.Locals(\"user\").(*jwt.Token)\n\tclaims := userToken.Claims.(jwt.MapClaims)\n\tuserO := (claims[\"user\"].(map[string]interface{}))\n\n\tdb := database.DBConn\n\tid := c.Params(\"id\")\n\tuser := new(User)\n\tdb.First(&user, id)\n\n\tif len(user.Role) == 0 {\n\t\tfiberutils.SendJSONMessage(c, \"No User exists\", false, 404)\n\t\treturn nil\n\t}\n\n\tif userO[\"role\"] == \"admin\" || fmt.Sprintf(\"%v\", userO[\"id\"]) == fmt.Sprintf(\"%d\", user.Id) {\n\t\tdb.Delete(&user)\n\t\tfiberutils.SendJSONMessage(c, \"User Successfully Deleted\", true, 200)\n\t} else {\n\t\tfiberutils.SendJSONMessage(c, \"No permission to delete\", false, 401)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "eca3b75dce213216d1c0f5ddeaf390a1", "score": "0.79219836", "text": "func DeleteUser(c *gin.Context) {\r\n\tuserID, userErr := getUserID(c.Param(\"id\"))\r\n\tif userErr != nil {\r\n\t\tc.JSON(userErr.Status, userErr)\r\n\t\treturn\r\n\t}\r\n\r\n\tdeleteErr := services.UserService.DeleteUser(userID)\r\n\r\n\tif deleteErr != nil {\r\n\t\tc.JSON(deleteErr.Status, deleteErr)\r\n\t\treturn\r\n\t}\r\n\tc.JSON(http.StatusOK, gin.H{\r\n\t\t\"status\": 1,\r\n\t\t\"msg\": \"User deleted\",\r\n\t})\r\n\r\n}", "title": "" }, { "docid": "a41ecad237eea19f6743496304a24b6b", "score": "0.7915202", "text": "func (us UserStore) Delete(user *model.User) error {\n\tif user.UserID <= 0 {\n\t\treturn errors.New(\"User doesnt have a user_id\")\n\t}\n\tconst q = `DELETE FROM users WHERE user_id = $1`\n\tc, _ := context.WithDeadline(us.ctx, time.Now().Add(5*time.Second))\n\tif _, err := us.db.Exec(c, q, user.UserID); err != nil {\n\t\treturn errors.Wrap(err, \"Failed to delete user\")\n\t}\n\tuser.UserID = 0\n\treturn nil\n}", "title": "" }, { "docid": "0e5310fb7908c0bd1bdca1c60023ab18", "score": "0.791427", "text": "func (r *UserPostgres) DeleteUser(id int) error {\n\tlog.Printf(\"DB: Delete user start\")\n\tdefer log.Printf(\"DB: Delete user end\")\n\n\tsql := fmt.Sprintf(\"DELETE FROM %s WHERE id=$1\", usersTable)\n\n\t_, err := r.db.Exec(sql, id)\n\tif err != nil {\n\t\tlog.Printf(\"DB: Delete query: %v\", err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "12f969eb3d536075072b19c2bdd7c9ad", "score": "0.7911499", "text": "func (u *User) Delete(db *gorm.DB, user *gorsk.User) error {\n\treturn db.Delete(user).Error\n}", "title": "" }, { "docid": "b45933351e59c3c3eb8cb5d1f5263d97", "score": "0.7906095", "text": "func (server *Server) DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tuser := models.User{}\n\tuid, err := strconv.ParseUint(vars[\"id\"], 10, 32)\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\ttokenID, err := auth.ExtractTokenID(r)\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusUnauthorized, errors.New(\"Unauthorized\"))\n\t\treturn\n\t}\n\tif tokenID != 0 && tokenID != uint32(uid) {\n\t\tresponses.ERROR(w, http.StatusUnauthorized, errors.New(http.StatusText(http.StatusUnauthorized)))\n\t\treturn\n\t}\n\t_, err = user.DeleteAUser(server.DB, uint32(uid))\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\tw.Header().Set(\"Entity\", fmt.Sprintf(\"%d\", uid))\n\tresponses.JSON(w, http.StatusNoContent, \"\")\n}", "title": "" }, { "docid": "7ffc2d31a6eb232573e4df92d7e16752", "score": "0.7902492", "text": "func deleteUser(ctx context.Context, tx *Tx, id int) error {\n\t// Verify object exists.\n\tif user, err := findUserByID(ctx, tx, id); err != nil {\n\t\treturn err\n\t} else if user.ID != wtf.UserIDFromContext(ctx) {\n\t\treturn wtf.Errorf(wtf.EUNAUTHORIZED, \"You are not allowed to delete this user.\")\n\t}\n\n\t// Remove row from database.\n\tif _, err := tx.ExecContext(ctx, `DELETE FROM users WHERE id = ?`, id); err != nil {\n\t\treturn FormatError(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "283d5644a98c6d16f220151edb87d208", "score": "0.78972226", "text": "func (uh *UserHandler) DeleteUser(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tfmt.Println(\" i amabout to delete \")\n\tid, err := strconv.Atoi(ps.ByName(\"id\"))\n\tfmt.Println(id)\n\n\tif err != nil {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\thttp.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)\n\t\treturn\n\t}\n\n\t_, errs := uh.userService.DeleteUser(uint(id))\n\n\tif len(errs) > 0 {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\thttp.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusNoContent)\n\treturn\n}", "title": "" }, { "docid": "b97908e2b480cfb3a0e8795eeff2c8ea", "score": "0.789048", "text": "func (server *Server) DeleteUser(c *gin.Context) {\n\tvar w http.ResponseWriter = c.Writer\n\tvar r *http.Request = c.Request\n\n\tuser := models.User{}\n\n\tuid, err := strconv.ParseUint(c.Param(\"id\"), 10, 32)\n\tif err != nil {\n\t\tutils.ERROR(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\ttokenID, err := auth.ExtractTokenID(r)\n\tif err != nil {\n\t\tutils.ERROR(w, http.StatusUnauthorized, errors.New(\"Unauthorized\"))\n\t\treturn\n\t}\n\tif tokenID != 0 && tokenID != uint32(uid) {\n\t\tutils.ERROR(w, http.StatusUnauthorized, errors.New(http.StatusText(http.StatusUnauthorized)))\n\t\treturn\n\t}\n\t_, err = user.DeleteUser(server.DB, uint32(uid))\n\tif err != nil {\n\t\tutils.ERROR(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\tw.Header().Set(\"Entity\", fmt.Sprintf(\"%d\", uid))\n\tutils.JSON(w, http.StatusNoContent, \"\")\n}", "title": "" }, { "docid": "e5d00eb147eb25ab2e935c8d13ad138d", "score": "0.78791744", "text": "func (s *Store) Delete(ctx context.Context, usr user.User) error {\n\tdata := struct {\n\t\tUserID string `db:\"user_id\"`\n\t}{\n\t\tUserID: usr.ID.String(),\n\t}\n\n\tconst q = `\n\tDELETE FROM\n\t\tusers\n\tWHERE\n\t\tuser_id = :user_id`\n\n\tif err := db.NamedExecContext(ctx, s.log, s.db, q, data); err != nil {\n\t\treturn fmt.Errorf(\"namedexeccontext: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4da4ca26d057b1a7537bb5d6f4e92d4f", "score": "0.7877647", "text": "func DeleteUser(db *sql.DB, id int) (string, error) {\n\t//Delete user in table\n\tsqlStatement := `\n\tDELETE FROM users\n\tWHERE id=$1;`\n\t_, err := db.Exec(sqlStatement, id)\n\tif err != nil {\n\t\treturn \"User cannot be deleted, big error\", err\n\t}\n\n\treturn \"User deleted.\", err\n}", "title": "" }, { "docid": "d204ad13b8db07e4dc306c2661dbe119", "score": "0.7870828", "text": "func (m *MgoDL) DeleteUser(id string) error {\n\tif id == \"\" {\n\t\treturn fmt.Errorf(\"Error, invalid argument: id must be > 0\")\n\t}\n\n\tsess := m.Session.Copy()\n\tdefer sess.Close()\n\tif err := sess.DB(m.DBName).C(USER_COLLECTION).RemoveId(id); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "59f760d638631630885b6ba71c154eda", "score": "0.7867131", "text": "func DeleteUser(guid string) error {\n\tlog.Println(\"User: '\", guid, \"'\")\n\treturn db.Delete(&User{}, \"guid = ?\", guid).Error\n}", "title": "" }, { "docid": "8d571eac2d1bafb304c91911d3771ead", "score": "0.7863854", "text": "func DeleteUser(user string) (err error) {\n\t_, err = engine.ID(user).Delete(&User{})\n\treturn\n}", "title": "" }, { "docid": "ddac03306d5c724997d793e90afb7d5d", "score": "0.7863708", "text": "func (u *Users) DeleteUser(w http.ResponseWriter, r *http.Request) {\n\n\tu.l.Println(\"Handle DELETE User\")\n\n\tvars := mux.Vars(r)\n\tid, _ := strconv.ParseUint(vars[\"user\"], 10, 64)\n\t_, err := models.Delete(id)\n\tif err != nil {\n\t\tToJSON(w, err.Error(), http.StatusUnprocessableEntity)\n\t\treturn\n\t}\n\tToJSON(w, \"User deleted successfully!\", http.StatusCreated)\n}", "title": "" }, { "docid": "870c9e3113752c6ef2223e9fe0a459f7", "score": "0.7862579", "text": "func (c *Client) DeleteUser(uname string) error {\n\t_, err := c.HTTPRequest(Request{\n\t\tVerb: \"DELETE\",\n\t\tPath: \"/api/security/users/\" + uname,\n\t})\n\treturn err\n}", "title": "" }, { "docid": "44d13e03d21f0275009c9899c10d43d9", "score": "0.786234", "text": "func (user *User) Delete(tx *db.Transacao) error {\n\tvar filter db.Dados\n\tfilter = make(db.Dados)\n\tfilter[\"id\"] = user.ID\n\t_, err := db.Delete(tx, \"usuario\", filter)\n\treturn err\n}", "title": "" }, { "docid": "cdce1de0d2e1e18218b0cb56c6a929e8", "score": "0.78616726", "text": "func (u *UserStore) Delete(user model.User) error {\n\tif user.UserID == 0 {\n\t\treturn errors.New(\"User doesnt have a user_id\")\n\t}\n\tconst q = `DELETE FROM users WHERE user_id = ?`\n\tif _, err := u.db.Exec(q, user.UserID); err != nil {\n\t\treturn errors.Wrap(err, \"Failed to delete user\")\n\t}\n\tuser.UserID = 0\n\treturn nil\n}", "title": "" }, { "docid": "a521d6b0f5ee5b574b95686439d41052", "score": "0.78508866", "text": "func DeleteUser(w http.ResponseWriter, req *http.Request) {\n\tvars := mux.Vars(req)\n\tid := vars[\"id\"]\n\n\tif err := Remove(id); err != nil {\n\t\thandleError(err, \"Failed to remove user: %v\", w)\n\t\treturn\n\t}\n\n\tw.Write([]byte(\"OK\"))\n}", "title": "" }, { "docid": "bda434438e4deca9c0633c11f6df6b97", "score": "0.78486896", "text": "func DeleteUser(userID int64) {\n\tuser := &User{\n\t\tID: userID,\n\t}\n\n\t// form the statement\n\tstmt := fmt.Sprintf(\"DELETE %s WHERE id=:id\", userTable)\n\t_, err := mysqlDBHandler.Execute(stmt, user)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\n\tfmt.Println(\"User successfully deleted..\")\n}", "title": "" }, { "docid": "d1e681254ff75ec425dbc4aed0e5711d", "score": "0.7840428", "text": "func DeleteUser(id int64) error {\n\t_, err := RRdb.Prepstmt.DeleteUser.Exec(id)\n\tif err != nil {\n\t\tUlog(\"Error deleting User id=%d error: %v\\n\", id, err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "b671082e5d428b248298e4955842129b", "score": "0.78335524", "text": "func DeleteUser(c *gin.Context) {\n\tc.JSON(200, gin.H{\n\t\t\"success\": true,\n\t})\n\treturn\n}", "title": "" }, { "docid": "d5e5a402906c8ff9134b552c87f8c11c", "score": "0.7831415", "text": "func DeleteUser(db *sql.DB, userID string) error {\n\tvar err error\n\tvar ex *sql.Stmt\n\n\tex, err = db.Prepare(\"DELETE FROM memefy.user WHERE user_id = ?\")\n\t_, err = ex.Exec(userID)\n\tif err != nil {\n\t\terr := errors.New(\"failed to make a DB query\")\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2aafad03dc4c873dc27ecc9b4b30368f", "score": "0.7830825", "text": "func (u *User) Delete() (err error) {\n\tstatement := \"delete from users where id = ?\"\n\tstmt, err := Db.Prepare(statement)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer stmt.Close()\n\n\t_, err = stmt.Exec(u.Id)\n\treturn\n}", "title": "" }, { "docid": "b621518034c38a9a692b1f55ed4d5731", "score": "0.7823898", "text": "func (s Store) DeleteUser(username, password string) error {\n\treturn user.Delete(s.userCollection, username, password)\n}", "title": "" }, { "docid": "f7927ebe5e1cd1f454144f777392a150", "score": "0.7819328", "text": "func DeleteUser(id uint64) error {\n\tuser := UserModel{}\n\tuser.BaseModel.Id = id\n\treturn DB.Self.Delete(&user).Error\n}", "title": "" }, { "docid": "994c1dce5ee2e4c0b974458edd8a09d7", "score": "0.7810573", "text": "func DeleteUser(user *models.UserDB) error {\n\tcollection,session := GetCollection(Users_Collection_Name)\n\tdefer session.Close()\n\treturn collection.Remove(bson.M{\"_id\":user.Id})\n}", "title": "" }, { "docid": "c34b3da74f28394e4b7be17e4cdbd221", "score": "0.7804466", "text": "func DeleteUser(id uint) error {\n\ts := &Search{\n\t\tFields: []*Filed{\n\t\t\t{\n\t\t\t\tKey: \"id\",\n\t\t\t\tCondition: \"=\",\n\t\t\t\tValue: id,\n\t\t\t},\n\t\t},\n\t}\n\tu, err := GetUser(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif u.Username == \"username\" {\n\t\treturn errors.New(fmt.Sprintf(\"不能删除管理员 : %s \\n \", u.Username))\n\t}\n\n\tif err := libs.Db.Delete(u, id).Error; err != nil {\n\t\tcolor.Red(fmt.Sprintf(\"DeleteUserByIdErr:%s \\n \", err))\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d9d4715a62d234eedebe73cc3b30ce99", "score": "0.7803319", "text": "func DeleteUser(username string) (err error) {\n\ttx, err := database.GetTransaction()\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = tx.Exec(\n\t\t\"DELETE FROM Users WHERE username = ?\",\n\t\tusername,\n\t)\n\treturn\n}", "title": "" }, { "docid": "28400dadcb8ec66f6ae74291bdd3f203", "score": "0.7800092", "text": "func deleteUserById(id int) {\n\tfmt.Println(id)\n\tDB_user.Delete(&user{}, id)\n}", "title": "" }, { "docid": "adabf8b2d5567283c0064c4a17d346e4", "score": "0.7795925", "text": "func (u *User) Delete() error {\n\tctx, cancel := context.WithTimeout(context.Background(), dbTimeout)\n\tdefer cancel()\n\n\tstmt := `delete from users where id = $1`\n\n\t_, err := db.ExecContext(ctx, stmt, u.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "437651031a20bb51e3afbbdacd793f66", "score": "0.77898306", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request, params denco.Params) {\n\t// some actual stuff should happen in here\n}", "title": "" }, { "docid": "9cb3776f7fb30be6e50dfcfce404a662", "score": "0.7771117", "text": "func (u *Users) Delete(w http.ResponseWriter, r *http.Request) error {\n\tparamID := chi.URLParam(r, \"id\")\n\n\tid, err := strconv.Atoi(paramID)\n\tif err != nil {\n\t\tu.Log.Printf(\"ERROR : %+v\", err)\n\t\treturn errors.Wrap(err, \"type casting paramID\")\n\t}\n\n\tvar user models.User\n\tuser.ID = uint64(id)\n\terr = user.Get(r.Context(), u.Db)\n\tif err != nil {\n\t\tu.Log.Printf(\"ERROR : %+v\", err)\n\t\treturn errors.Wrap(err, \"Get user\")\n\t}\n\n\tisDelete, err := user.Delete(r.Context(), u.Db)\n\tif err != nil {\n\t\tu.Log.Printf(\"ERROR : %+v\", err)\n\t\treturn errors.Wrap(err, \"Delete user\")\n\t}\n\n\tif !isDelete {\n\t\terr = errors.New(\"error delete user\")\n\t\tu.Log.Printf(\"ERROR : %+v\", err)\n\t\treturn err\n\t}\n\n\treturn api.ResponseOK(w, nil, http.StatusNoContent)\n}", "title": "" }, { "docid": "ed5f23b81fb6af2ad57f785d8aeebd66", "score": "0.77586085", "text": "func (us *UserService) DeleteUser(username string) error {\n\t_, err := us.DB.Exec(\"DELETE from app_user where username = $1\", username)\n\treturn err\n}", "title": "" }, { "docid": "b74e635c120889d3f1aa93575b0b4a1d", "score": "0.7756712", "text": "func DeleteUser(c *gin.Context) {\n\tvalue, _ := c.Get(\"claims\")\n\tclaims := value.(*utils.Claims)\n\n\tdb, err := utils.DBConnect()\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\"error\": \"Failed to connect database\",\n\t\t})\n\t\treturn\n\t}\n\n\tuser := &models.User{\n\t\tID: claims.ID,\n\t}\n\n\terr = user.Delete(db)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\"error\": \"Failed to delete user\",\n\t\t})\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"message\": \"Success\",\n\t})\n\treturn\n}", "title": "" }, { "docid": "7b1f00afaefcda9f78e0cb5961c97eb5", "score": "0.7754829", "text": "func (repo *DBRepo) DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tid, _ := strconv.Atoi(chi.URLParam(r, \"id\"))\n\t_ = repo.DB.DeleteUser(id)\n\trepo.App.Session.Put(r.Context(), \"flash\", \"User deleted\")\n\thttp.Redirect(w, r, \"/admin/users\", http.StatusSeeOther)\n}", "title": "" }, { "docid": "cd1c5f022812e60affb1bc5d2c889c85", "score": "0.77543306", "text": "func DeleteUser(ID int64) error {\n\tq := \"DELETE FROM usertable WHERE id=$1\"\n\ttx := db.MustBegin()\n\ttx.MustExec(q, ID)\n\terr := tx.Commit()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fbe7e456029697b8c175e0cd9b324935", "score": "0.7742766", "text": "func (am *AuthManager) DeleteUser(ctx context.Context, token *models.JWT) (*models.Nothing, error) {\n\treturn &models.Nothing{}, nil\n}", "title": "" }, { "docid": "9d9aaa26aa33fb7cab5b5e1ff0b72513", "score": "0.7734309", "text": "func (u *AuthUser) Delete() error {\n\tif u.IsPaymaster {\n\t\treturn errors.New(\"ERROR: This user is a paymaster. Please execute SetPaymaster to other user.\")\n\t}\n\tdelurl := fmt.Sprintf(\"/%v/userlist/del/%v\", u.botId, u.id)\n\trequest, _ := http.NewRequest(\"POST\", fmt.Sprintf(\"https://admin-official.line.me%v\", delurl), nil)\n\trequest.Header.Set(\"Content-Type\", \"text/plain;charset=UTF-8\")\n\trequest.Header.Set(\"X-CSRF-Token\", u.xrt)\n\tresponse, _ := u.client.Do(request)\n\tdefer response.Body.Close()\n\treturn nil\n}", "title": "" }, { "docid": "2cbd395263241c2440ec64abb2f826ef", "score": "0.7720549", "text": "func (ds *DataBase) DeleteUser(username string) error {\n\t_, err := ds.db.Exec(ds.db.Rebind(\"DELETE FROM users WHERE username=?\"), username)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%w : %s\", data.ErrSql, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bdda09d22f85adcf3bc7819ab832ecda", "score": "0.77179503", "text": "func (u *User) Delete(db XODB) error {\n\tvar err error\n\n\t// if doesn't exist, bail\n\tif !u._exists {\n\t\treturn nil\n\t}\n\n\t// if deleted, bail\n\tif u._deleted {\n\t\treturn nil\n\t}\n\n\t// sql query\n\tconst sqlstr = `DELETE FROM ms.user WHERE Id = ?`\n\n\t// run query\n\tXOLog(sqlstr, u.Id)\n\t_, err = db.Exec(sqlstr, u.Id)\n\tif err != nil {\n\t\tXOLogErr(err)\n\t\treturn err\n\t}\n\n\t// set deleted\n\tu._deleted = true\n\n\tOnUser_AfterDelete(u)\n\n\treturn nil\n}", "title": "" }, { "docid": "207c3977eeaec4f2f1bbb468522e88e6", "score": "0.77154887", "text": "func DeleteUser(c *gin.Context) {\n\tf := li.GetFile()\n\tvar err error\n\tvar standardLogger = li.NewLogger()\n\tstandardLogger.SetOutput(f)\n\tuserID, err := strconv.ParseUint(c.Param(\"id\"), 10, 64)\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": constants.Errors().InvalidID})\n\t\treturn\n\t}\n\tuser, err := users.GetUserWithID(uint64(userID))\n\tif err == gorm.ErrRecordNotFound {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": constants.Errors().IDNotInRecords})\n\t\treturn\n\t} else if err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": constants.Errors().InternalError})\n\t\tstandardLogger.InternalServerError(err.Error())\n\t\treturn\n\t}\n\n\terr = users.DeleteUser(user)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": constants.Errors().InternalError})\n\t\tstandardLogger.InternalServerError(err.Error())\n\t\treturn\n\t}\n\tlogs.AddLogs(constants.InfoLog, fmt.Sprintf(\"User with email %s deleted\", user.Email))\n\tc.JSON(http.StatusOK, gin.H{\"status\": \"ok\"})\n}", "title": "" }, { "docid": "d6729e1d3bf86d1fee161e3c19974a05", "score": "0.7714951", "text": "func (dal *impl) DeleteUser(tx util.Transaction, userID string) error {\n\t_, err := tx.Exec(deleteUser, userID)\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1a8044d94bb332ea007c26a9eff5d255", "score": "0.7694184", "text": "func Delete(c *gin.Context) {\n\n\tuserId, idErr := getUserId(c.Param(\"user_id\"))\n\n\tif idErr != nil {\n\t\tc.JSON(idErr.Status, idErr)\n\t\treturn\n\t}\n\n\tif err := services.UsersService.DeleteUser(userId); err != nil {\n\t\tc.JSON(err.Status, err)\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, map[string]string{\"status\": \"deleted\"})\n\n}", "title": "" }, { "docid": "c4d8689fd54f0034509e31d2089be6f9", "score": "0.76925534", "text": "func (tm *TaskDataMapperPostgreSQL) UserDelete(u *User) error {\n\n // if the user has never been saved then no work to here\n if !tm.loaded {\n return nil\n }\n\n // delete this user\n _, err := dbExec(env, \"DELETE FROM users WHERE id = $1\", u.GetId())\n if err != nil {\n err = errors.New(fmt.Sprintf(\"tdmp.Delete(): Unable to remove user %s with id %d: %s\", u.GetEmail(), u.GetId(), err))\n return err\n }\n\n // clean in-memory tm structures\n tm.loaded = false\n return nil\n}", "title": "" }, { "docid": "8644879e0b94057057f421586360d75b", "score": "0.7681591", "text": "func (a *app) deleteUser(id string) {\n\ta.db.Exec(\"DELETE FROM credential WHERE id = $1\", id)\n}", "title": "" }, { "docid": "914c6149dba88f33149f878fc7ad2349", "score": "0.76813745", "text": "func DeleteUser(email string, db *sqlx.DB) error {\n\t_, err := db.Query(\"DELETE from users where email=$1\", email)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "710edbeb3fdc8a9ec0f969705aa40156", "score": "0.7679665", "text": "func (db *Local) DeleteUser(id int) error {\n\tdb.Lock()\n\tdefer db.Unlock()\n\t_, ok := db.users[id]\n\tif !ok {\n\t\treturn model.ErrNotFound\n\t}\n\tdelete(db.users, id)\n\treturn nil\n}", "title": "" }, { "docid": "f8499f5f71a44d0161d9e838dd16fffe", "score": "0.7670398", "text": "func DeleteUser(c *fiber.Ctx) {\n\tuserID, userErr := getUserID(c.Params(\"user_id\"))\n\tif userErr != nil {\n\t\tc.Status(userErr.Status)\n\t\tc.JSON(userErr)\n\t\treturn\n\t}\n\n\tif err := services.UserServices.DeleteUser(userID); err != nil {\n\t\tc.Status(userErr.Status)\n\t\tc.JSON(userErr)\n\t\treturn\n\t}\n\n\tc.Status(http.StatusOK)\n\tc.JSON(map[string]string{\"Status\": \"success\"})\n}", "title": "" }, { "docid": "1d0fc0c6bc4e9dfbb7cbab60d5205155", "score": "0.766481", "text": "func (b CassandraAuthBackend) DeleteUser(username string) error {\n session := b.session\n //Probably a better way to do this in one query\n if _, err := b.User(username); err != nil {\n if err = session.Query(`DELETE from users WHERE username = ?`, username).Exec(); err != nil {\n log.Fatal(\"DeleteUser: \"+err.Error())\n return err\n }\n } else {\n return ErrDeleteNull\n }\n return nil\n}", "title": "" }, { "docid": "fe70f0e125d47ff18537bf32a71def35", "score": "0.7661995", "text": "func UserDelete(u models.User, m *models.Message) {\n\tm.Code = http.StatusBadRequest\n\tif u.ID <= 0 {\n\t\tm.Message = \"especifique usuario\"\n\t\treturn\n\t}\n\tdb := configuration.GetConnection()\n\tdefer db.Close()\n\ttx := db.Begin()\n\tvar err error\n\tm.Message = \"no se pudo Borrado Usuario\"\n\tfor _, tel := range u.UserTel {\n\t\terr = deleteUserTel(&tel, tx)\n\t\tif err != nil {\n\t\t\ttx.Rollback()\n\t\t\treturn\n\t\t}\n\t}\n\terr = getUser(&u, tx)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn\n\t}\n\terr = deleteUser(&u, tx)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn\n\t}\n\ttx.Commit()\n\tm.Code = http.StatusOK\n\tm.Message = \"Usuario Borrado\"\n\tm.Data = u\n}", "title": "" }, { "docid": "6b4b293490f150afb0941162d256d50b", "score": "0.7661349", "text": "func (u *User) Delete(db XODB) error {\n\tvar err error\n\n\t// if doesn't exist, bail\n\tif !u._exists {\n\t\treturn nil\n\t}\n\n\t// if deleted, bail\n\tif u._deleted {\n\t\treturn nil\n\t}\n\n\t// sql query\n\tconst sqlstr = `DELETE FROM public.users WHERE id = $1`\n\n\t// run query\n\tXOLog(sqlstr, u.ID)\n\t_, err = db.Exec(sqlstr, u.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// set deleted\n\tu._deleted = true\n\n\treturn nil\n}", "title": "" }, { "docid": "29c23fb5a759cd47d01ac9acc758702d", "score": "0.7661129", "text": "func (h *Handler) DeleteUser(targetID uint) error {\n\tif row := h.DB.Where(\"user_id = ?\", targetID).Delete(models.User{}).RowsAffected; row == 0 {\n\t\treturn errors.New(\"User does not exist in DB\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a539820abe1ca1bb6ab51800508a9f3f", "score": "0.7660156", "text": "func DeleteUser(c *gin.Context) {\n\tuserID, userErr := getUserID(c.Param(\"user_id\"))\n\tif userErr != nil {\n\t\tc.JSON(http.StatusNotFound, userErr)\n\t\treturn\n\t}\n\n\tif deleteErr := services.UserService.DeleteUser(userID); deleteErr != nil {\n\t\tc.JSON(deleteErr.Status, deleteErr)\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, map[string]string{\"status\": \"deleted\"})\n}", "title": "" }, { "docid": "cda6047333adf4f007bfb94deebbbc90", "score": "0.76449573", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tlog.Print(\"DeleteUser called\")\n\tparams := mux.Vars(r)\n\tuserid, _ := strconv.Atoi(params[\"userid\"])\n\terr := business.DeleteUser(userid)\n\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusNotFound)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "a318d857ac753f03ee6166cfb021d9c0", "score": "0.76429546", "text": "func (e Endpoints) DeleteUser(ctx context.Context, id string) (deleteResp *models.DeleteUserResp, err error) {\n\trequest := DeleteUserRequest{Id: id}\n\tresponse, err := e.DeleteUserEndpoint(ctx, request)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn response.(DeleteUserResponse).DeleteResp, response.(DeleteUserResponse).Err\n}", "title": "" }, { "docid": "02e6d18c48991d5f6c595018028670a5", "score": "0.7640566", "text": "func (handler *restHandler) deleteUser(w http.ResponseWriter, r *http.Request) {\n\tid := chi.URLParam(r, \"id\")\n\tuser, _ := models.FindPlanetUser(r.Context(), handler.db, id)\n\n\tif user != nil {\n\t\tgroups, err := user.GroupPlanetGroups().All(r.Context(), handler.db)\n\t\tif err != nil {\n\t\t\twriteErr(w, err, http.StatusInternalServerError)\n\t\t}\n\t\tuser.RemoveGroupPlanetGroups(r.Context(), handler.db, groups...)\n\t\t_, err = user.Delete(r.Context(), handler.db)\n\t\tif err != nil {\n\t\t\twriteErr(w, err, http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t}\n\tw.WriteHeader(http.StatusNotFound)\n}", "title": "" }, { "docid": "101d5f676c6f5e79ea1d72ea185d113f", "score": "0.7638878", "text": "func (user *User) Delete() (err error) {\n\tcollection := client.Database(dbname).Collection(\"users\")\n\tfilter := bson.M{\"uuid\": user.UUID}\n\t_, err = collection.DeleteOne(context.Background(), filter)\n\treturn\n}", "title": "" }, { "docid": "6ad3733f69ba070ebec1819e40880b4e", "score": "0.7638052", "text": "func (ug *userGorm) Delete(id uint) error {\n\tuser := User{Model: gorm.Model{ID: id}}\n\treturn ug.db.Delete(&user).Error\n}", "title": "" }, { "docid": "56a53f7305937525df9abd77408f3a12", "score": "0.76354766", "text": "func (i instrument) DeleteUser(w http.ResponseWriter, r *http.Request) {\n\ti.next.DeleteUser(w, r)\n}", "title": "" }, { "docid": "2a4bf2eee03dbb254bbeb29ecb08e6d5", "score": "0.76280195", "text": "func (f *MySQLRepository) DeleteUser(ID string) error {\n\tstmt, err := f.db.Prepare(\"DELETE FROM User where ID = ? LIMIT 1\")\n\tdefer stmt.Close()\n\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Could not understand the statement\")\n\t}\n\n\t_, err = stmt.Exec(ID)\n\n\treturn errors.Wrap(err, \"Could not delete the user\")\n}", "title": "" }, { "docid": "a3635ac709b5d75c2754d0c345e8ef77", "score": "0.7627356", "text": "func Delete(w http.ResponseWriter, r *http.Request) {\n\n\tuid := r.Context().Value(\"uid\").(string)\n\n\terr := models.DeleteUser(uid)\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to delete user: %v\", err)\n\t\tresponses.ERROR(w, http.StatusInternalServerError, err)\n\t} else {\n\t\tresponses.JSON(w, http.StatusNoContent, nil)\n\t}\n}", "title": "" }, { "docid": "31304042a7d65f61ec97da33da301ff1", "score": "0.76187336", "text": "func Delete(c *gin.Context) {\n\tuserID, err := getUserIDParam(c.Param(\"user_id\"))\n\tif err != nil {\n\t\tc.JSON(err.Status, err)\n\t\treturn\n\t}\n\tuserErr := service.UserService.DeleteUser(userID)\n\tif userErr != nil {\n\t\tc.JSON(userErr.Status, userErr)\n\t\treturn\n\t}\n\tc.JSON(http.StatusOK, map[string]string{\"status\": \"deleted\"})\n}", "title": "" }, { "docid": "478b9181b1004f534d7f065d2ec47ede", "score": "0.76136154", "text": "func (u *User) Delete(db *gorm.DB) error {\n\terr := db.Delete(&u).Error\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b46913a7c0009e1ec7a5be4320fa3bbc", "score": "0.7613515", "text": "func (a *UserAPI) deleteUser(rc *wrapper.RequestContext, w http.ResponseWriter, r *http.Request) {\n\tuserID := rc.GetUserID()\n\tif _, err := a.App.DeleteUser(userID); err != nil {\n\t\trc.SetError(\"User object get failed.\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\trc.SetAppResponse(\"{'response': 'OK'}\", http.StatusOK)\n}", "title": "" }, { "docid": "4b1c40cc44e195d2c911434bac006696", "score": "0.7605055", "text": "func (m *DBRepo) DeleteUser(id int) error {\n\tctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)\n\tdefer cancel()\n\n\tstmt := `update users set deleted_at = $1 where id = $2`\n\n\t_, err := m.DB.ExecContext(ctx, stmt, time.Now(), id)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" } ]
24c4de204e3df365f1f881a534f9ff80
END OF YOUTUBE //////////////// Printers
[ { "docid": "15900d325e7474a2ba2682355908c184", "score": "0.0", "text": "func videosHandler(videoChan chan ytvideo.YTVideo, tPoolNum chan int) {\n\tvideo := <-videoChan\n\t<-tPoolNum // get a turn in the pool\n\tdefer consumeThread(tPoolNum) // to give turn to other threads\n\tif debugOutput {\n\t\tlog.Println(\"Handling video %v\", video.Id)\n\t}\n\tytdl := YoutubeDl{}\n\tytdl.Path = \"/go/src/app/srts\"\n\terr := ytdl.DownloadVideo(video.Id)\n\tif err != nil {\n\t\tlog.Printf(\"%v\", err)\n\t}\n\tStoreValue(video)\n\tgetVideoSuggestions(video.Id, videoChan, \"12\", tPoolNum)// 12 is a random token that works as initial value\n}", "title": "" } ]
[ { "docid": "561fd732c829c934a91c8c3413d383a7", "score": "0.68706053", "text": "func main() {\n\tp := NewPrinterProxy(\"Emily's printer\")\n\tfmt.Println(\"The current printer is \" + p.GetPrinterName() + \".\")\n\tp.SetPrinterName(\"William's printer\")\n\tfmt.Println(\"The current printer is \" + p.GetPrinterName() + \".\")\n\tp.Output(\"Nice to meet you.\")\n}", "title": "" }, { "docid": "8615ee6b2f9d7cfdfa94fa8ea9f6d4f9", "score": "0.60742307", "text": "func (p *Proxy) Print(w io.Writer) {\n\tvar entry []string\n\n\tdata := [][]string{}\n\n\tfor _, item := range p.entries {\n\t\tif item.Curl == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tentry = []string{}\n\n\t\tt := time.Unix(item.TsChecked, 0)\n\n\t\tentry = append(entry, item.Country)\n\t\tentry = append(entry, item.Curl)\n\t\tentry = append(entry, fmt.Sprintf(\"%.2f\", item.Speed))\n\t\tentry = append(entry, time.Since(t).String())\n\n\t\tif item.Get {\n\t\t\tentry = append(entry, \"\\x1b[48;5;010m░░\\x1b[0m\")\n\t\t} else {\n\t\t\tentry = append(entry, \"\\x1b[48;5;009m░░\\x1b[0m\")\n\t\t}\n\n\t\tif item.Post {\n\t\t\tentry = append(entry, \"\\x1b[48;5;010m░░\\x1b[0m\")\n\t\t} else {\n\t\t\tentry = append(entry, \"\\x1b[48;5;009m░░\\x1b[0m\")\n\t\t}\n\n\t\tif item.Cookies {\n\t\t\tentry = append(entry, \"\\x1b[48;5;010m░░\\x1b[0m\")\n\t\t} else {\n\t\t\tentry = append(entry, \"\\x1b[48;5;009m░░\\x1b[0m\")\n\t\t}\n\n\t\tif item.Referer {\n\t\t\tentry = append(entry, \"\\x1b[48;5;010m░░\\x1b[0m\")\n\t\t} else {\n\t\t\tentry = append(entry, \"\\x1b[48;5;009m░░\\x1b[0m\")\n\t\t}\n\n\t\tif item.UserAgent {\n\t\t\tentry = append(entry, \"\\x1b[48;5;010m░░\\x1b[0m\")\n\t\t} else {\n\t\t\tentry = append(entry, \"\\x1b[48;5;009m░░\\x1b[0m\")\n\t\t}\n\n\t\tif item.AnonymityLevel == 1 {\n\t\t\tentry = append(entry, \"\\x1b[48;5;010m░░\\x1b[0m\")\n\t\t} else {\n\t\t\tentry = append(entry, \"\\x1b[48;5;009m░░\\x1b[0m\")\n\t\t}\n\n\t\tdata = append(data, entry)\n\t}\n\n\ttable := tablewriter.NewWriter(w)\n\ttable.SetHeader([]string{\n\t\t\"Country\",\n\t\t\"cURL\",\n\t\t\"Speed\",\n\t\t\"Uptime\",\n\t\t\"G\", // get: bool - supports GET requests\n\t\t\"P\", // post: bool - supports POST requests\n\t\t\"C\", // cookies: bool - supports cookies\n\t\t\"R\", // referer: bool - supports 'referer' header\n\t\t\"U\", // userAgent: bool - supports 'user-agent' header\n\t\t\"A\", // anonymityLevel: int - 1:anonymous, 0:notanonymous\n\t})\n\tfor _, v := range data {\n\t\ttable.Append(v)\n\t}\n\ttable.Render()\n\n\tif len(data) > 0 {\n\t\tfmt.Fprintln(w, \"G - supports GET requests\")\n\t\tfmt.Fprintln(w, \"P - supports POST requests\")\n\t\tfmt.Fprintln(w, \"C - supports cookies\")\n\t\tfmt.Fprintln(w, \"R - supports 'referer' header\")\n\t\tfmt.Fprintln(w, \"U - supports 'user-agent' header\")\n\t\tfmt.Fprintln(w, \"A - 1:anonymous, 0:notanonymous\")\n\t}\n}", "title": "" }, { "docid": "0c70270b4101b2fc5ecfa6bcbfad9f45", "score": "0.6008012", "text": "func (b Brother8840D) xPrinting(aStr string) string {\n b.pages = aStr\n return aStr\n}", "title": "" }, { "docid": "5599755e47944e722a3392bc24793164", "score": "0.59527135", "text": "func main() {\n\tbackgroundPrint()\n\n}", "title": "" }, { "docid": "0c343bbe84711743a740f2cfd65c2bc5", "score": "0.59208286", "text": "func GoPrint() {\n\tfmt.Println(\"We're Gophers and about to publish\")\n}", "title": "" }, { "docid": "09c01056902f2f77cd7d370d7a6e3853", "score": "0.5869242", "text": "func Print(w http.ResponseWriter, r *http.Request) {\n\treprint := r.URL.Query().Get(\"reprint\")\n\tson := r.URL.Query().Get(\"son\")\n\n\tdata, err := getPDF(r.Context(), son)\n\tif err != nil {\n\t\tlog.Println(fmt.Errorf(\"error fetching pdf: %w\", err))\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tlog.Print(len(data))\n\n\tid, err := printPDF(r.Context(), son, reprint, data)\n\tif err != nil {\n\t\tlog.Println(fmt.Errorf(\"error publishing msg: %w\", err))\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tfmt.Fprintf(w, \"{\\\"messageID\\\":%v}\", id)\n}", "title": "" }, { "docid": "7cdfbf490f9d27f56905e330925a30cb", "score": "0.58569646", "text": "func (hplj HPLaserJet1000) Printing(aStr string) string{\n hplj.pages = aStr\n return aStr\n}", "title": "" }, { "docid": "fb31edc9c99ded86dc052165784f0dba", "score": "0.58253133", "text": "func request_printer(answer []string) {\n\tfor i := 1; i <= len(answer); i++ {\n\t\tfmt.Println(i, \":\", answer[i])\n\t}\n}", "title": "" }, { "docid": "00a0deeb644fec88ce9a49b86b5e1f77", "score": "0.5810551", "text": "func (o *Model) Printers(mods ...qm.QueryMod) printerQuery {\n\tvar queryMods []qm.QueryMod\n\tif len(mods) != 0 {\n\t\tqueryMods = append(queryMods, mods...)\n\t}\n\n\tqueryMods = append(queryMods,\n\t\tqm.Where(\"\\\"printer\\\".\\\"model_id\\\"=?\", o.ID),\n\t)\n\n\tquery := Printers(queryMods...)\n\tqueries.SetFrom(query.Query, \"\\\"printer\\\"\")\n\n\tif len(queries.GetSelect(query.Query)) == 0 {\n\t\tqueries.SetSelect(query.Query, []string{\"\\\"printer\\\".*\"})\n\t}\n\n\treturn query\n}", "title": "" }, { "docid": "486fe24128c006f0c3097d87bf4b4034", "score": "0.5711406", "text": "func printPlotter(ax, ay, az, gx, gy, gz, t int32) {\n\tif SHOW_ACCELERATION {\n\t\tfmt.Printf(\"AX:%f, AY:%f, AZ:%f,\", axis(ax, 0), axis(ay, 0), axis(az, 0))\n\t}\n\tif SHOW_ROTATION {\n\t\tfmt.Printf(\"GX:%f, GY:%f, GZ:%f,\", axis(gx, cal[0]), axis(gy, cal[1]), axis(gz, cal[2]))\n\t}\n\tif SHOW_TEMPERATURE {\n\t\tfmt.Printf(\"T:%f\", float32(t)/1000)\n\t}\n\tprintln()\n}", "title": "" }, { "docid": "10cf3a510f81da8da3222dba3d8240f4", "score": "0.57096875", "text": "func (c *Canon123) Printing(aStr string) string{\n c.pages = aStr\n return aStr\n}", "title": "" }, { "docid": "daac961f2cc3399d8d80b6ad2216b738", "score": "0.56926674", "text": "func (r Report) Print() {\n\tfmt.Println(ReportStart)\n\tmatched := r.outOfDateCount + r.heldBackCount + r.upToDateCount + r.aheadCount\n\tbehindP := int(math.Floor(float64(r.outOfDateCount) / float64(matched) * 100.0))\n\theldP := int(math.Floor(float64(r.heldBackCount) / float64(matched) * 100.0))\n\tokP := int(math.Floor(float64(r.upToDateCount) / float64(matched) * 100.0))\n\taheadP := int(math.Floor(float64(r.aheadCount) / float64(matched) * 100.0))\n\tfmt.Printf(ReportSummary, behindP, heldP, okP, aheadP,\n\t\tr.outOfDateCount, r.heldBackCount, r.upToDateCount, r.aheadCount,\n\t\tr.unmatchedCount, len(r.failed), matched+r.unmatchedCount+len(r.failed))\n\tfmt.Println(ReportMatchHeader)\n\tfor _, release := range r.matched {\n\t\tvar color string\n\t\tswitch release.Status {\n\t\tcase db.StatusOutOfDate:\n\t\t\tcolor = \"behind\"\n\t\tcase db.StatusHeldBack:\n\t\t\tcolor = \"held\"\n\t\tcase db.StatusAhead:\n\t\t\tcolor = \"ahead\"\n\t\tdefault:\n\t\t\tcolor = \"ok\"\n\t\t}\n\t\tfmt.Printf(ReportMatchRow, release.Package, release.Current, color, release.Latest, release.Source, release.Source)\n\t}\n\tfmt.Println(ReportTableClose)\n\tfmt.Println(ReportUnmatchedHeader)\n\thosts := make([]string, 0)\n\tfor host := range r.unmatched {\n\t\thosts = append(hosts, host)\n\t}\n\tsort.Strings(hosts)\n\tfor _, host := range hosts {\n\t\tfmt.Printf(ReportUnmatchedSectionStart, host)\n\t\tfor _, release := range r.unmatched[host] {\n\t\t\tfmt.Printf(ReportUnmatchedRow, release.Package, release.Current, release.Source, release.Source)\n\t\t}\n\t\tfmt.Println(ReportUnmatchedSectionStop)\n\t}\n\tfmt.Println(ReportUnmatchedClose)\n}", "title": "" }, { "docid": "77794fd4c55864d1fc3a9ef3ccf38a34", "score": "0.5686915", "text": "func (p *Privet) UpdatePrinter(diff *lib.PrinterDiff) error {\n\t// API never needs to be updated\n\n\tonline := false\n\tif diff.Printer.GCPID != \"\" {\n\t\tonline = true\n\t}\n\n\t// TODO once we add local-only support we should hide the append behind an if ! local-only\n\tvar localDefaultDisplayName = diff.Printer.DefaultDisplayName\n\tlocalDefaultDisplayName = fmt.Sprintf(\"%s (local)\", localDefaultDisplayName)\n\n\treturn p.zc.updatePrinterTXT(diff.Printer.GCPID, localDefaultDisplayName, p.gcpBaseURL, diff.Printer.GCPID, online)\n}", "title": "" }, { "docid": "9d1fcea80e2cf31933c97eb69c69ce03", "score": "0.56865466", "text": "func Print_paper (share Paper) {\n\n\tfmt.Println(share.Share, share.Company, share.Value, share.Fluctuation)\n}", "title": "" }, { "docid": "db9e1139a5da57325e1922ba422f351c", "score": "0.5663172", "text": "func (arp *arp) print() {\n\tif arp.teo.param.ShowPeersStatF {\n\t\tfmt.Print(arp.sprint())\n\t}\n}", "title": "" }, { "docid": "8ad1c11b524f4d86c1c1d3a3a898aa52", "score": "0.5659851", "text": "func (s stats) print() {\n\t// check whether to print header/footer (each printer has it's own check)\n\tif s.txBytes == 0 && len(s.responses) == 0 && len(s.requests) == 0 {\n\t\treturn\n\t}\n\tfmt.Println(\"---------------------------------------\")\n\ts.printRequest()\n\ts.printResponse()\n\ts.printTxBytes()\n\tfmt.Println(\"=======================================\")\n}", "title": "" }, { "docid": "e537cb7516506612b5554ad170878e7b", "score": "0.56324124", "text": "func (o *OldPrinter) Print(s string) string {\n\treturn fmt.Sprintf(\"Legacy Printer: %s\", s)\n}", "title": "" }, { "docid": "c116d5dee9eff1b8a75ff631443ed4ee", "score": "0.5631915", "text": "func PrintPods() {\n\tcmd := exec.Command(\"kubectl\", \"get\", \"pods\", \"-A\", \"-o\", \"wide\")\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tlogf.FromContext(nil).Error(err, \"Failed to get pods\")\n\t\treturn\n\t}\n\tlog := logg.New(GinkgoWriter, \"\", 0)\n\tlog.Println(\"=============================\")\n\tlog.Printf(\"Pods:\\n %s\\n\", out)\n}", "title": "" }, { "docid": "f9cb74e9b1b1d54b62bb452594f250cb", "score": "0.5625438", "text": "func getPrinter() (mcResourcePrinter, error) {\n\topt := make(printer.Options)\n\tof := getOutputFormat()\n\n\t// Initialize color mode\n\tswitch viper.GetString(\"color\") {\n\tcase \"on\", \"true\", \"yes\", \"force\":\n\t\topt[\"color_mode\"] = \"on\"\n\tcase \"off\", \"false\", \"no\":\n\t\topt[\"color_mode\"] = \"off\"\n\tdefault:\n\t\topt[\"color_mode\"] = \"auto\"\n\t}\n\n\tif of == \"theme\" {\n\t\tif outputTheme != \"\" {\n\t\t\topt[\"name\"] = outputTheme\n\t\t} else {\n\t\t\topt[\"name\"] = viper.GetString(\"default_theme\")\n\t\t}\n\t\topt[\"template_directory\"] = viper.GetString(\"template_directory\")\n\t} else if of == \"template\" {\n\t\topt[\"template\"] = outputTemplate\n\t\tif outputTemplateFile != \"\" {\n\t\t\ttmpl, err := readTemplate(outputTemplateFile, viper.GetString(\"template_directory\"))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\topt[\"template\"] = string(tmpl)\n\t\t}\n\t}\n\tvar mcrp mcPrinter\n\tp, err := printer.NewPrinter(of, opt)\n\tif err != nil {\n\t\treturn &mcrp, err\n\t}\n\tmcrp.ResourcePrinter = p\n\treturn &mcrp, nil\n}", "title": "" }, { "docid": "10013470a0a1afc31e2e0488276d744c", "score": "0.56150603", "text": "func (o *Output) Printer(reader io.ReadCloser) {\n\tsc := bufio.NewScanner(reader)\nloop:\n\tfor {\n\t\tfor sc.Scan() {\n\t\t\ttext := sc.Text()\n\t\t\tif (len(o.ServerList) > 1 && !o.DisableHeader) || o.EnableHeader {\n\t\t\t\toPrompt := o.GetPrompt()\n\t\t\t\tfmt.Printf(\"%s %s\\n\", oPrompt, text)\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"%s\\n\", text)\n\t\t\t}\n\t\t}\n\n\t\tif sc.Err() == io.ErrClosedPipe {\n\t\t\tbreak loop\n\t\t}\n\n\t\tselect {\n\t\tcase <-time.After(50 * time.Millisecond):\n\t\t\tcontinue\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cdb40cdc53fa0572b3f8699d9b4dfe90", "score": "0.5587602", "text": "func printer4(msgs ...string) {\n\tfor _, msg := range msgs {\n\t\tfmt.Printf(\"%s\\n\", msg)\n\t}\n}", "title": "" }, { "docid": "6bd82719e01e1edfdb9caefe8cf7e8ed", "score": "0.5521803", "text": "func (an *AnagramDispatcher) PrintAll(printer Printer) {\n\tfor _, anagram := range an.wmap {\n\t\tprinter.PrintAnagram(anagram)\n\t}\n}", "title": "" }, { "docid": "d41776fd996d1edea0e4735d02248f79", "score": "0.55039364", "text": "func (deck Deck) print() {\n\tfor index, card := range deck {\n\t\tfmt.Println(index, card)\n\t}\n\n\tfmt.Println(\"-------------\")\n}", "title": "" }, { "docid": "29a3af7d35fb73363d65c84dfc316fe9", "score": "0.5498086", "text": "func StringPrinter(s string) {\n\tfmt.Println(s)\n}", "title": "" }, { "docid": "14e564a749886f21032e24ff76a6f7e1", "score": "0.54904926", "text": "func printer(c <-chan string) {\n\tfor {\n\t\tmsg := <-c\n\t\tfmt.Println(msg)\n\t\ttime.Sleep(time.Second * 1)\n\t}\n}", "title": "" }, { "docid": "14e564a749886f21032e24ff76a6f7e1", "score": "0.54904926", "text": "func printer(c <-chan string) {\n\tfor {\n\t\tmsg := <-c\n\t\tfmt.Println(msg)\n\t\ttime.Sleep(time.Second * 1)\n\t}\n}", "title": "" }, { "docid": "2b52186ad09f6f31045d37ccafc54e0f", "score": "0.5469098", "text": "func NewPrinter(opt *ListDisplayOptions) *Printer {\n\treturn &Printer{\n\t\topt: opt,\n\t}\n}", "title": "" }, { "docid": "533bcc8e09edd902e4c38a1138e21b8f", "score": "0.54634213", "text": "func (p *Pipeline) Print() {\n\tfor _, stage := range p.Stages {\n\t\tif stage.Session != \"\" {\n\t\t\tres, _ := p.RServer.Get(stage.Session, \"\")\n\t\t\tstage.Output = string(res)\n\t\t}\n\t\tstage.Print()\n\t\tfmt.Println()\n\t}\n}", "title": "" }, { "docid": "85838153b6acb238b6a584af2d5c128b", "score": "0.5415072", "text": "func printOutput() {\n\n\tfmt.Printf(\"\\n\\n\")\n\tfor _, files := range fileCollection.fileList {\n\t\tfiles.colors.name.Printf(\"%v\", files.fullName)\n\t\tfmt.Printf(\" : \")\n\t\tfiles.colors.mode.Printf(\"%v\\n\", files.mode)\n\t\tfmt.Printf(\"%v : \", files.fileType)\n\t\tfiles.colors.size.Printf(\"%v\\n\", files.size)\n\t\tfiles.colors.modTime.Printf(\"%v\\n\\n\", files.modTime)\n\t}\n\n}", "title": "" }, { "docid": "e1eecde717b3f73f072b915f0f9e2b32", "score": "0.5407074", "text": "func (d deck) print() {\n\tfmt.Println(d.toString())\n}", "title": "" }, { "docid": "39465fd5f4f929940da5e5ad9d6bd4c8", "score": "0.5389977", "text": "func NewPrinter(log logger.Log) *Printer {\n\tp := new(Printer)\n\tif log != nil {\n\t\tp.Output = logger.ShimWriter{\n\t\t\tContext: context.Background(),\n\t\t\tLog: log,\n\t\t\tEventProvider: func(contents []byte) logger.Event {\n\t\t\t\treturn logger.NewMessageEvent(\"statsd\", strings.TrimSpace(string(contents)))\n\t\t\t},\n\t\t}\n\t} else {\n\t\tp.Output = os.Stdout\n\t}\n\treturn p\n}", "title": "" }, { "docid": "ed1a49dcd451d34f235e06c237661bb4", "score": "0.5374837", "text": "func PrintPVCs() {\n\tcmd := exec.Command(\"kubectl\", \"get\", \"pvc\", \"-A\", \"-o\", \"wide\")\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tlogf.FromContext(nil).Error(err, \"Failed to get pvcs\")\n\t\treturn\n\t}\n\tlog := logg.New(GinkgoWriter, \"\", 0)\n\tlog.Println(\"=============================\")\n\tlog.Printf(\"PVCs:\\n %s\\n\", out)\n}", "title": "" }, { "docid": "c5cd44a6e11cb42bc5b8f5662168b9ea", "score": "0.5348045", "text": "func Print(format string, a ...interface{}) {\n\tdefaultPrinter.Print(format, a...)\n}", "title": "" }, { "docid": "844cdaed13120ffd9ba996406503ba94", "score": "0.5341916", "text": "func DevPrint(inputs ...interface{}) {\n\tif Flags.Dev {\n\t\tfmt.Println(inputs...)\n\t}\n}", "title": "" }, { "docid": "7dc7b73159676cbee47bfaa872d011fc", "score": "0.53396416", "text": "func (b *GameBoard) Print(w io.Writer) error {\n\t/* Fill in this Function */\n\treturn nil\n}", "title": "" }, { "docid": "fba40b85d8f4aa95f1f7d16bb61ce986", "score": "0.53343314", "text": "func Fprint(writer io.Writer, a ...interface{}) {\n\tif !Output {\n\t\treturn\n\t}\n\n\tvar ret string\n\tvar printed bool\n\n\tfor _, bar := range ActiveProgressBarPrinters {\n\t\tif bar.IsActive && bar.Writer == writer {\n\t\t\tret += sClearLine()\n\t\t\tret += Sprinto(a...)\n\t\t\tprinted = true\n\t\t}\n\t}\n\n\tfor _, spinner := range activeSpinnerPrinters {\n\t\tif spinner.IsActive && spinner.Writer == writer {\n\t\t\tret += sClearLine()\n\t\t\tret += Sprinto(a...)\n\t\t\tprinted = true\n\t\t}\n\t}\n\n\tif !printed {\n\t\tret = color.Sprint(Sprint(a...))\n\t}\n\n\tif writer != nil {\n\t\tcolor.Fprint(writer, Sprint(ret))\n\t} else {\n\t\tcolor.Print(Sprint(ret))\n\t}\n\n\t// Refresh all progressbars in case they were overwritten previously. Reference: #302\n\tfor _, bar := range ActiveProgressBarPrinters {\n\t\tif bar.IsActive {\n\t\t\tbar.UpdateTitle(bar.Title)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b554ca235e62577e90ae11f31bd89064", "score": "0.5322823", "text": "func Print(args ...interface{}) {\n\tResetOutHandler()\n\tstd.Print(args...)\n}", "title": "" }, { "docid": "8eef9c200a5fdc7c3ff09bd9a23cb0db", "score": "0.5321523", "text": "func ShowAllStreamers() {\n\tstreamers, err := ReadStreamersFromFile()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\tos.Exit(0)\n\t}\n\n\tfmt.Println(\"Your streams are currently :\")\n\n\tfor i, streamer := range streamers {\n\n\t\terr := UpdateStreamerStatus(&streamer)\n\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Can't find user %s \\n\", streamer.Name)\n\t\t\tcontinue\n\t\t}\n\n\t\tif streamer.Status == \"offline\" {\n\t\t\tfmt.Printf(\"[%2d] %-16s %-7s\", i, streamer.Name, streamer.Category)\n\t\t\tcolor.Red(streamer.Status)\n\t\t} else {\n\t\t\tgreen := color.New(color.FgGreen).SprintFunc()\n\t\t\tfmt.Printf(\"[%2d] %-16s %-7s %-7s %s \\n\", i, streamer.Name, streamer.Category, green(streamer.Status), streamer.CurrentTitle)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6a8b665f47e1df683e5e5e23337b8f54", "score": "0.52939993", "text": "func Print(textToPrint string) {\n\tPrintLayer(commonResource.layerAlias, textToPrint)\n}", "title": "" }, { "docid": "7ea35f3bbaff391fef1bdbbe5625360b", "score": "0.52934945", "text": "func (movie *Movie) PrintString() string {\n\treturn fmt.Sprintf(\"%s - external ID %s - internal ID %s\", movie.Show.Title, movie.ExternalID, movie.ID)\n}", "title": "" }, { "docid": "0a4c75b382340c04d19fa749b8353c5a", "score": "0.5291773", "text": "func Printer(profile, accessKey, secretKey string) {\n\tfmt.Printf(\"\\n[%v]\\n%v = %v\\n%v = %v\\n\\n\", green.Sprintf(profile), red.Sprintf(\"aws_access_key_id\"), bold.Sprintf(accessKey), red.Sprintf(\"aws_secret_access_key\"), bold.Sprintf(secretKey))\n}", "title": "" }, { "docid": "5679cfa7168acf6aa22354455a7958c0", "score": "0.52781785", "text": "func Print(args ...interface{}) {\n\ts := Format(args...)\n\tfmt.Println(s)\n}", "title": "" }, { "docid": "30c673c99be5376f4ced062719ffc04f", "score": "0.5269043", "text": "func printRunes(p printer, rs []rune) error {\n\tfor _, r := range rs {\n\t\tif err := printRune(p, r); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "74bfa7c21abe058033f3a49b8acb84df", "score": "0.5260757", "text": "func printResults(data interface{}) {\n\n\tswitch printerType {\n\n\tcase \"json\":\n\t\tif data == nil {\n\t\t\tfmt.Println(\"{}\")\n\t\t\treturn\n\t\t}\n\t\tj, err := json.MarshalIndent(data, \"\", \" \")\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(string(j))\n\n\tcase \"yaml\":\n\t\tif data == nil {\n\t\t\tfmt.Println(\"---\")\n\t\t\treturn\n\t\t}\n\t\ty, err := yaml.Marshal(data)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(string(y))\n\n\tdefault:\n\t\tif data == nil {\n\t\t\tfmt.Println(\"No data found\")\n\t\t\treturn\n\t\t}\n\n\t\t// Print app.CLIError\n\t\tif cliError, ok := data.(CLIError); ok {\n\t\t\tdata := [][]string{\n\t\t\t\t[]string{cliError.Message},\n\t\t\t}\n\t\t\theader := []string{\"CLI Error\"}\n\t\t\tprintTableResults(data, header)\n\t\t\treturn\n\t\t}\n\n\t\t// Print apl.APLError\n\t\tif aplError, ok := data.(apl.APIError); ok {\n\t\t\tdata := [][]string{\n\t\t\t\t[]string{strconv.Itoa(aplError.StatusCode), aplError.Message},\n\t\t\t}\n\t\t\theader := []string{\"Status Code\", \"Message\"}\n\t\t\tprintTableResults(data, header)\n\t\t\treturn\n\t\t}\n\n\t\t// Print apl.CreateResult\n\t\tif createResult, ok := data.(apl.CreateResult); ok {\n\t\t\tvar result string\n\t\t\tswitch createResult.Data.(type) {\n\t\t\tcase string:\n\t\t\t\tresult = createResult.Data.(string)\n\t\t\tdefault:\n\t\t\t\tj, err := json.MarshalIndent(createResult.Data, \"\", \" \")\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tresult = string(j)\n\t\t\t}\n\t\t\tdata := [][]string{[]string{result}}\n\t\t\theader := []string{\"Result\"}\n\t\t\tprintTableResults(data, header)\n\t\t\treturn\n\t\t}\n\n\t\t// Print apl.ModifyOutput\n\t\tif modifyResult, ok := data.(apl.ModifyResult); ok {\n\t\t\tdata := [][]string{\n\t\t\t\t[]string{\n\t\t\t\t\tstrconv.Itoa(modifyResult.Skipped),\n\t\t\t\t\tstrconv.Itoa(modifyResult.Deleted),\n\t\t\t\t\tstrconv.Itoa(modifyResult.Unchanged),\n\t\t\t\t\tstrconv.Itoa(modifyResult.Errors),\n\t\t\t\t\tstrconv.Itoa(modifyResult.Replaced),\n\t\t\t\t\tstrconv.Itoa(modifyResult.Inserted),\n\t\t\t\t},\n\t\t\t}\n\t\t\theader := []string{\"Skipped\", \"Deleted\", \"Unchanged\", \"Errors\", \"Replaced\", \"Inserted\"}\n\t\t\tprintTableResults(data, header)\n\t\t\treturn\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "fdd499b66db0e4a8e6bbee905001cdd1", "score": "0.5258279", "text": "func (d deck) print() {\n\n\tfor _, card := range d { \t\t\t// loop through cards in the deck\n\n\t\tfmt.Println(card) \t\t\t\t// print card\n\t}\n}", "title": "" }, { "docid": "00ed1a7700f4ff40b3b1d172432fa2d0", "score": "0.52561563", "text": "func printOutputHeader() {\n\tfmt.Println(\"\")\n\tfmt.Println(\"FreeTAXII Server\")\n\tfmt.Println(\"Copyright, Bret Jordan\")\n\tfmt.Println(\"Version:\", Version)\n\tif Build != \"\" {\n\t\tfmt.Println(\"Build:\", Build)\n\t}\n\tfmt.Println(\"\")\n}", "title": "" }, { "docid": "080c127398390ee3e1a033e280729ce8", "score": "0.5247196", "text": "func (dev * DeviceInfo) Print() {\n\tfmt.Printf(\"Path: %s\\n\", dev.Path)\n\tfmt.Printf(\" Vendor : 0x%04x \\\"%s\\\"\\n\", dev.VendorID, dev.ManufacturerStr)\n\tfmt.Printf(\" Product: 0x%04x \\\"%s\\\"\\n\", dev.ProductID, dev.ProductStr)\n\tfmt.Printf(\" Serial: \\\"%s\\\"\\n\", dev.SerialNumber)\n\tfmt.Printf(\" Release: %d\\n\", dev.ReleaseNumber)\n\tfmt.Printf(\" UsagePage: %d\\n\", dev.UsagePage)\n\tfmt.Printf(\" Usage: %d\\n\", dev.Usage)\n\tfmt.Printf(\" InterfaceNumber: %d\\n\", dev.InterfaceNumber)\t\t\n}", "title": "" }, { "docid": "6eb0b9b096771f49fd23672d0246a8f9", "score": "0.52411693", "text": "func (di pdfDocInfo) print() {\n\tfmt.Printf(\"Filename: %s\\n\", di.Filename)\n\tfmt.Printf(\" Pages: %d\\n\", di.NumPages)\n\tfmt.Printf(\" Title: %s\\n\", di.Title)\n\tfmt.Printf(\" Author: %s\\n\", di.Author)\n\tfmt.Printf(\" Subject: %s\\n\", di.Subject)\n\tfmt.Printf(\" Keywords: %s\\n\", di.Keywords)\n\tfmt.Printf(\" Creator: %s\\n\", di.Creator)\n\tfmt.Printf(\" Producer: %s\\n\", di.Producer)\n\tfmt.Printf(\" CreationDate: %s\\n\", di.CreationDate)\n\tfmt.Printf(\" ModDate: %s\\n\", di.ModDate)\n\tfmt.Printf(\" Trapped: %s\\n\", di.Trapped)\n}", "title": "" }, { "docid": "a1e3ba46effe9f75ed20a98397eee733", "score": "0.5237185", "text": "func (s Stream) Print() string {\n\tvar b bytes.Buffer\n\tfor _, snap := range s.Snapshots {\n\t\tfmt.Fprintf(&b, \"%s\", snap.Print())\n\t}\n\treturn string(b.Bytes())\n}", "title": "" }, { "docid": "0f06b4031e9102758258f47eb8790f1e", "score": "0.5236152", "text": "func (cmd *Command) doprint(attachments []*Attachment) {\n\n\tif attachments == nil {\n\t\tcmd.logpad(\"Printing\", \"Nothing to do\")\n\t\treturn\n\t}\n\n\tcups := ipp.NewCUPSClient(\"localhost\", 631, \"\", \"\", false)\n\n\tfor _, attachment := range attachments {\n\n\t\tcmd.logpad(\"Printing\", attachment.File)\n\n\t\tif cmd.DryRun {\n\t\t\tcmd.logverb(\"JobID\", \"123456\")\n\t\t\tcontinue\n\t\t}\n\n\t\tjob, err := cups.PrintFile(attachment.File, cmd.cfg.Cups.Printer, map[string]interface{}{})\n\t\tif err != nil {\n\t\t\tcmd.logverb(\"JobID\", err.Error())\n\t\t\tcontinue\n\t\t}\n\n\t\tcmd.logverb(\"JobID\", job)\n\t}\n}", "title": "" }, { "docid": "22f348d745ede40db50cf7268f654ebd", "score": "0.5227791", "text": "func PrintEvents() {\n\tcmd := exec.Command(\"kubectl\", \"get\", \"events\", \"-A\", \"-o\", \"custom-columns=LastSeen:.lastTimestamp,From:.source.component,Type:.type,Reason:.reason,Message:.message\", \"--sort-by=.lastTimestamp\")\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tlogf.FromContext(nil).Error(err, \"Failed to get events\")\n\t\treturn\n\t}\n\tlog := logg.New(GinkgoWriter, \"\", 0)\n\tlog.Println(\"=============================\")\n\tlog.Printf(\"Last events:\\n %s\\n\", out)\n}", "title": "" }, { "docid": "d37ca494f33196c1f46c4b866398c52e", "score": "0.5219087", "text": "func PP(args ...interface{}) {\n\tpp.Println(args...)\n}", "title": "" }, { "docid": "f7db8be57ead4f88e2b3f27cc0832a46", "score": "0.5217139", "text": "func printer(value string) {\n\tfmt.Println(value)\n}", "title": "" }, { "docid": "9c43123a935b6f60c03d2b8402778269", "score": "0.52136695", "text": "func PrintEpisodeList(ep []subscription.Episode) {\n\tfmt.Println()\n\tfor index, episode := range ep {\n\t\tfmt.Printf(\"\\t[%d] [%s]\\n\", index+1, episode.Title)\n\t}\n\tfmt.Println()\n}", "title": "" }, { "docid": "39a4bee826eea9980069f89d05f3f173", "score": "0.52133524", "text": "func Print(data interface{}) (err error) {\n\tif err = ensureGlobalOutput(); err != nil {\n\t\treturn err\n\t}\n\n\tswitch globalOutput.format {\n\tcase FormatJSON:\n\t\terr = globalOutput.json(data)\n\tcase FormatYAML:\n\t\terr = globalOutput.yaml(data)\n\tdefault:\n\t\terr = globalOutput.json(data)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "a7605d38693607c360e3b33ddd616157", "score": "0.52110785", "text": "func printPersos(persos []*Perso) {\n\tfor _, perso := range persos {\n\t\tfmt.Printf(\"[%d] %d,%d : %d\\n\", perso.Type, perso.CurrentSquare.X, perso.CurrentSquare.Y, perso.Health)\n\t}\n}", "title": "" }, { "docid": "572c307df25a83edfd7e88260836b08b", "score": "0.5206272", "text": "func (s *Scheduler) Print() {\n\tfmt.Println(\"Ready list contents\")\n\tfor e := s.listOfReadyThreads.Front(); e != nil; e = e.Next() {\n\t\tfmt.Printf(\"%q, \", e.Value)\n\t}\n\tfmt.Println(\"\")\n}", "title": "" }, { "docid": "21209927aefdc77cda581d0dc3ae89a2", "score": "0.5204857", "text": "func (s *Screen) Print(x, y int, fg, bg termbox.Attribute, msg string) {\n\tfor _, c := range msg {\n\t\ttermbox.SetCell(x, y, c, fg, bg)\n\t\tx++\n\t}\n}", "title": "" }, { "docid": "ff4444ad9287a097391e262ec53b5cf1", "score": "0.52010417", "text": "func (tc *torrentContext) printTorrents() {\n\tif tc.torrents == nil {\n\t\tlog.Fatal(\"There are no torrents\")\n\t}\n\tfor k, v := range *tc.torrents {\n\t\tprintTorrentName(k, v)\n\t}\n}", "title": "" }, { "docid": "2acf48bc8632be8f5b3aa6ef42475c1f", "score": "0.5198588", "text": "func Print() {\n\n\tfmt.Println(\"Exploring Methods: \")\n\tlang1 := language{\n\t\tname: \"Hindi\",\n\t\tcountry: \"India\",\n\t}\n\n\tlang1.speak() // Usage is similar to instance methods in other languages\n}", "title": "" }, { "docid": "d8967601d1664c6097938a6a3378e037", "score": "0.5198491", "text": "func (d deck) print() {\n\tfor _, card := range d {\n\t\tfmt.Println(card)\n\t}\n}", "title": "" }, { "docid": "19b4bc41dbbb26af65b68edc5ff51d14", "score": "0.51787895", "text": "func BuiltinPrint(args ...object.Object) object.Object {\n\tfor _, a := range args {\n\t\tfmt.Printf(\"%s \", a.Inspect())\n\t}\n\n\tfmt.Print(\"\\n\")\n\treturn &object.Null{}\n}", "title": "" }, { "docid": "f284631d9fe6e9c15ca7c826b0723162", "score": "0.5177622", "text": "func (p *YamlPrinter) PrintDevices(devices []model.DeviceInfo, w io.Writer) error {\n\tif err := writeAsYml(devices, w); err != nil {\n\t\treturn errors.Wrap(err, \"Failed to write devices yaml\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "15ee8dbf23d41a7c80b30a29f70b3484", "score": "0.5171397", "text": "func (d deck) print() {\n\tfor index, card := range d {\n\t\tfmt.Println(index+1, card)\n\t}\n}", "title": "" }, { "docid": "10edf6831e2ddd67db2c3b50fddd9c01", "score": "0.51689386", "text": "func Prints(level string, color bool, fh *os.File) SpewFunc {\n\tf := func(a interface{}) {\n\t\ttext := trimReturn(spew.Sdump(a))\n\t\tfmt.Println(composit(\"spew:\", level, color))\n\t\tfmt.Println(\"\\r\"+text)\n\t\tif fh != nil {\n\t\t\t_, loc, line, _ := runtime.Caller(2)\n\t\t\tout := Entry{time.Now(), level, fmt.Sprint(loc, \":\", line), text}\n\t\t\tj, err := json.Marshal(out)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"logging error:\", err)\n\t\t\t}\n\t\t\t_, _ = fmt.Fprint(fh, string(j)+\",\")\n\t\t}\n\t}\n\treturn &f\n}", "title": "" }, { "docid": "18815c4ccfd10c7775b993551641414c", "score": "0.5168555", "text": "func (s *BasejvmBasicListener) EnterPrintlist(ctx *PrintlistContext) {}", "title": "" }, { "docid": "921d972ac7c5502b21d12295cc9e1a24", "score": "0.51683867", "text": "func printer(w [9]string) {\n\tfor _, word := range w {\n\t\tfmt.Printf(\"%s \", word)\n\t}\n\tfmt.Printf(\"\\n\")\n\n\tw[2] = \"Blue\" // This change will not affect the caller\n}", "title": "" }, { "docid": "973ac5a272c6a11d02ce24b46c8fe9e7", "score": "0.51656675", "text": "func GetPrinter(format, formatArgument string) (ResourcePrinter, bool, error) {\n\tvar printer ResourcePrinter\n\tswitch format {\n\tcase \"json\":\n\t\tprinter = &JSONPrinter{}\n\tcase \"yaml\":\n\t\tprinter = &YAMLPrinter{}\n\tcase \"name\":\n\t\tprinter = &NamePrinter{\n\t\t\tTyper: runtime.ObjectTyperToTyper(api.Scheme),\n\t\t\tDecoder: api.Codecs.UniversalDecoder(),\n\t\t}\n\tcase \"template\", \"go-template\":\n\t\tif len(formatArgument) == 0 {\n\t\t\treturn nil, false, fmt.Errorf(\"template format specified but no template given\")\n\t\t}\n\t\tvar err error\n\t\tprinter, err = NewTemplatePrinter([]byte(formatArgument))\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"error parsing template %s, %v\\n\", formatArgument, err)\n\t\t}\n\tcase \"templatefile\", \"go-template-file\":\n\t\tif len(formatArgument) == 0 {\n\t\t\treturn nil, false, fmt.Errorf(\"templatefile format specified but no template file given\")\n\t\t}\n\t\tdata, err := ioutil.ReadFile(formatArgument)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"error reading template %s, %v\\n\", formatArgument, err)\n\t\t}\n\t\tprinter, err = NewTemplatePrinter(data)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"error parsing template %s, %v\\n\", string(data), err)\n\t\t}\n\tcase \"jsonpath\":\n\t\tif len(formatArgument) == 0 {\n\t\t\treturn nil, false, fmt.Errorf(\"jsonpath template format specified but no template given\")\n\t\t}\n\t\tvar err error\n\t\tprinter, err = NewJSONPathPrinter(formatArgument)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"error parsing jsonpath %s, %v\\n\", formatArgument, err)\n\t\t}\n\tcase \"jsonpath-file\":\n\t\tif len(formatArgument) == 0 {\n\t\t\treturn nil, false, fmt.Errorf(\"jsonpath file format specified but no template file file given\")\n\t\t}\n\t\tdata, err := ioutil.ReadFile(formatArgument)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"error reading template %s, %v\\n\", formatArgument, err)\n\t\t}\n\t\tprinter, err = NewJSONPathPrinter(string(data))\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"error parsing template %s, %v\\n\", string(data), err)\n\t\t}\n\tcase \"custom-columns\":\n\t\tvar err error\n\t\tif printer, err = NewCustomColumnsPrinterFromSpec(formatArgument, api.Codecs.UniversalDecoder()); err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\tcase \"custom-columns-file\":\n\t\tfile, err := os.Open(formatArgument)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"error reading template %s, %v\\n\", formatArgument, err)\n\t\t}\n\t\tif printer, err = NewCustomColumnsPrinterFromTemplate(file, api.Codecs.UniversalDecoder()); err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\tcase \"wide\":\n\t\tfallthrough\n\tcase \"\":\n\t\treturn nil, false, nil\n\tdefault:\n\t\treturn nil, false, fmt.Errorf(\"output format %q not recognized\", format)\n\t}\n\treturn printer, true, nil\n}", "title": "" }, { "docid": "cf865b498697d8e5df8db8162d9128ed", "score": "0.5164787", "text": "func ModPrint() {\n\tfmt.Println(\"You're succeed\")\n\tfmt.Println(\"Now Update\")\n\tGoPrint()\n}", "title": "" }, { "docid": "04af29839e80e8a528c236587df96a09", "score": "0.51617354", "text": "func (d *dplMgr) PrintDplChannels(dplIP string, dplPort int) error {\n\tcmdSpec := fmt.Sprintf(\"%s -m ch -a %s -p %d list\", d.DplmgrPath, dplIP, dplPort)\n\t_, output := d.RunCmdInDocker(cmdSpec)\n\tlogger.Info(output)\n\treturn nil\n}", "title": "" }, { "docid": "16f699c7f2162f771b7f205d523d63e7", "score": "0.51339746", "text": "func (p *Privet) AddPrinter(printer lib.Printer, getPrinter func() (lib.Printer, bool)) error {\n\tgetProximityToken := func(user string) ([]byte, int, error) { return p.getProximityToken(printer.GCPID, user) }\n\tapi, err := newPrivetAPI(printer.GCPID, p.gcpBaseURL, p.xsrf, &p.jc, p.jobs, getPrinter, getProximityToken, p.createTempFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tonline := false\n\tif printer.GCPID != \"\" {\n\t\tonline = true\n\t}\n\n\t// TODO once we add local-only support we should hide the append behind an if ! local-only\n\tvar localDefaultDisplayName = printer.DefaultDisplayName\n\tlocalDefaultDisplayName = fmt.Sprintf(\"%s (local)\", localDefaultDisplayName)\n\terr = p.zc.addPrinter(printer.GCPID, printer.Name, api.port(), localDefaultDisplayName, p.gcpBaseURL, printer.GCPID, online)\n\tif err != nil {\n\t\tapi.quit()\n\t\treturn err\n\t}\n\n\tp.apisMutex.Lock()\n\tdefer p.apisMutex.Unlock()\n\n\tp.apis[printer.GCPID] = api\n\n\treturn nil\n}", "title": "" }, { "docid": "1d284d181637b083d15abef7569b31f9", "score": "0.5126759", "text": "func PrintEventWatcher(context context.Context, watcher Watcher, format string, writer io.Writer) {\n\teventChan, _ := watcher.Watch(context)\n\tfor events := range eventChan {\n\t\tfor _, e := range events {\n\t\t\tPrintEvents(writer, format, *e)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "942b4bb460b687ca5ae118e7c702ebee", "score": "0.5120477", "text": "func printNICs(tsv bool, nics ...*crimson.NIC) {\n\tif len(nics) > 0 {\n\t\tp := newStdoutPrinter(tsv)\n\t\tdefer p.Flush()\n\t\tif !tsv {\n\t\t\tp.Row(\"Name\", \"Machine\", \"MAC Address\", \"Switch\", \"Port\")\n\t\t}\n\t\tfor _, n := range nics {\n\t\t\tp.Row(n.Name, n.Machine, n.MacAddress, n.Switch, n.Switchport)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9e8a775f16113eac26b3f7619d561c0f", "score": "0.5114675", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "065b563fdd4e457ff47023aa3bf26b4d", "score": "0.5113299", "text": "func (d deck) print() {\n\tfor i, card := range d {\n\t\tprintln(i, card)\n\t}\n}", "title": "" }, { "docid": "f03615bc30229cf2895b291be8d655df", "score": "0.51131743", "text": "func (i *Image) PrintName() string {\n\tname := fmt.Sprintf(\"%s/%s:%s\", i.BuildOrg, i.Name, i.Tag)\n\treturn name\n}", "title": "" }, { "docid": "9d819b1c894b3b4100d46f64263d894e", "score": "0.5111551", "text": "func (arp *arp) sprint() (str string) {\n\n\tvar num = 0 // number of body line\n\tconst numadd = 6 // add lines to scroll aria\n\tconst clearl = \"\\033[2K\" // clear line terminal code\n\tvar line = clearl + strings.Repeat(\"-\", 80) + \"\\n\"\n\n\t// Header\n\tstr = \"\\0337\" + // save cursor position\n\t\t\"\\033[0;0H\" + // set cursor to the top\n\t\t//\"\\033[?7l\" + // does not wrap\n\t\tline +\n\t\tclearl + \" # Peer | Mod | Version | IP | Port | Triptime / midle\\n\" +\n\t\tline\n\n\t// Body\n\tkeys := arp.sort()\n\tfor _, peer := range keys {\n\t\tpeerArp, ok := arp.find(peer)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tnum++\n\t\tvar port int\n\t\tvar ip string\n\t\tvar triptime, triptimeMidle float32\n\t\tif peerArp.mode == -1 {\n\t\t\t// \\TODO get connected IP and Port\n\t\t\tport = arp.teo.param.Port\n\t\t} else {\n\t\t\ttriptime, triptimeMidle = peerArp.tcd.GetTriptime()\n\t\t\taddr := peerArp.tcd.GetAddr()\n\t\t\tip = addr.IP.String()\n\t\t\tport = addr.Port\n\t\t}\n\t\tstr += fmt.Sprintf(clearl+\"%3d %s%-15s%s %3d %9s %-15s %7d %8.3f / %-8.3f\\n\",\n\t\t\tnum, // num\n\t\t\tteokeys.ANSIGreen, // (color begin)\n\t\t\tpeer, // peer name\n\t\t\tteokeys.ANSINone, // (color end)\n\t\t\tpeerArp.mode, // mod\n\t\t\tpeerArp.version, // teonet version\n\t\t\tip, // ip\n\t\t\tport, // port\n\t\t\ttriptime, // triptime\n\t\t\ttriptimeMidle, // triptime midle\n\t\t)\n\t}\n\n\t// Footer\n\tstr += line + fmt.Sprintf(\"\"+\n\t\tclearl+\"\\n\"+ // clear line\n\t\t//clearl+\"\\n\"+ // clear line\n\t\t\"\\033[%d;r\"+ // set scroll mode\n\t\t\"\\0338\", // restore cursor position\n\t\tnum+numadd,\n\t)\n\n\treturn\n}", "title": "" }, { "docid": "07957cab86364e2d4474b9314a015c9a", "score": "0.5109175", "text": "func PrintAppInformation() {\n\tfmt.Print(\"\\033[32m***********************************************************\\033[0m\\n\")\n\tfmt.Print(\"\\033[32m* Doki Doki Literature Club Plus Asset Decrypter *\\033[0m\\n\")\n\tfmt.Print(\"\\033[32m* Author: AimerNeige *\\033[0m\\n\")\n\tfmt.Print(\"\\033[32m* Github: github.com/AimerNeige/DDLC-Plus-Asset-Decrypter *\\033[0m\\n\")\n\tfmt.Print(\"\\033[32m* Refer: github.com/MlgmXyysd/DDLC-Plus-Asset-Decrypter *\\033[0m\\n\")\n\tfmt.Print(\"\\033[32m* Email: aimer.neige.soft@gmail.com *\\033[0m\\n\")\n\tfmt.Print(\"\\033[32m***********************************************************\\033[0m\\n\")\n}", "title": "" }, { "docid": "3218b1963878aea70310131b80566be0", "score": "0.51091164", "text": "func (d deck) print() {\n\t//2\n\tfor i, card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "28e3b196b930d25677291fa42e68fa0b", "score": "0.5108867", "text": "func (vsp *VersionShortPrinter) Print(r io.Reader, w io.Writer) {\n\tscanner := bufio.NewScanner(r)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tsplitted := strings.Split(line, \": \")\n\t\tkey, val := splitted[0], splitted[1]\n\t\tfmt.Fprintf(w, \"%s: %s\\n\",\n\t\t\tcolor.Apply(key, getColorByKeyIndent(0, 2, vsp.DarkBackground)),\n\t\t\tcolor.Apply(val, getColorByValueType(val, vsp.DarkBackground)),\n\t\t)\n\t}\n}", "title": "" }, { "docid": "8ae399b903ce4a2dd3ce5573163137dd", "score": "0.5106976", "text": "func (sprinter *formatSprinter) Print(args ...interface{}) {\n\tmessage := fmt.Sprint(args...)\n\tsprinter.insertMessage(message)\n}", "title": "" }, { "docid": "7db9548150293449deb98a2647bc16db", "score": "0.51035756", "text": "func Print(args ...interface{}) {\n\tstd.Print(args...)\n}", "title": "" }, { "docid": "7db9548150293449deb98a2647bc16db", "score": "0.51035756", "text": "func Print(args ...interface{}) {\n\tstd.Print(args...)\n}", "title": "" }, { "docid": "7db9548150293449deb98a2647bc16db", "score": "0.51035756", "text": "func Print(args ...interface{}) {\n\tstd.Print(args...)\n}", "title": "" }, { "docid": "fef1be0d8cefd0c0374d1c4ace128981", "score": "0.50896525", "text": "func Print(str string) {\n\tdefaultOut.Print(str)\n}", "title": "" }, { "docid": "1e81fbe61b54be85e419f1cbde580a1b", "score": "0.508883", "text": "func (d deck) print() {\n\t// loop the slice\n\tfor i,card := range d {\n\t\tfmt.Println(i, card)\n\t}\n}", "title": "" }, { "docid": "9caa5e72831843270255e4721f18686d", "score": "0.50863683", "text": "func PrintEvents(writer io.Writer, format string, content interface{}) {\n\tif format == \"yaml\" {\n\t\tPrintAsYAML(writer, content)\n\t} else { //default\n\t\tPrintAsJSON(writer, content)\n\t}\n}", "title": "" }, { "docid": "876c6bc4733ffd5e06cfea7fb219ba37", "score": "0.5081869", "text": "func NotePrint(args ...interface{}) {\n\tcolorPrint(noteColor, args...)\n}", "title": "" }, { "docid": "f56cc88f49734835773865d770cd943d", "score": "0.50801486", "text": "func (combo PlayerCombination) print() string {\n\tif len(combo.Kickers) == 0 {\n\t\treturn fmt.Sprintf(\"%v with cards %v\\n\", getCombinationName(combo.CombinationID), combo.Data)\n\t}\n\treturn fmt.Sprintf(\"%v with cards %v and with kickers %v\\n\", getCombinationName(combo.CombinationID), combo.Data, combo.Kickers)\n}", "title": "" }, { "docid": "b709320b8d1429cf039a226bf1ebf9e0", "score": "0.5078577", "text": "func (l *Leaderboard) Print() {\n\tfmt.Println(\"=================================================\")\n\tl.mux.Lock()\n\tfmt.Println(\"[ Least:\", l.least, \"]\")\n\tfor i := 0; i < len(l.entries); i++ {\n\t\tfmt.Println(l.entries[i].name, \"|\", l.entries[i].target, \"|\", l.entries[i].extra)\n\t}\n\tl.mux.Unlock()\n\tfmt.Println(\"=================================================\")\n}", "title": "" }, { "docid": "22133bce092c985b24a6ec3a1adf290a", "score": "0.5073443", "text": "func (w worker) PrintAll() error {\n\tfor k, _ := range w.jobs {\n\t\tif err := w.Print(k); err != nil {\n\t\t\treturn fmt.Errorf(\"Error in PrintAll(): %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "20ddf7a4fe1ccc1c852738f5481ae4df", "score": "0.50691867", "text": "func PrintPodcastList(subs []subscription.Subscription) {\n\tfmt.Println()\n\tfor _, podcast := range subs {\n\t\tfmt.Printf(\"\\t[%s] %s (%d known episodes, updated %s ago)\\n\", podcast.Tag, podcast.Name, len(podcast.Episodes), time.Since(podcast.UpdatedAt).String())\n\t}\n\tfmt.Println()\n}", "title": "" } ]
290d29ab220948b879c002f5695bbc48
GetAuthenticationUserOk returns a tuple with the AuthenticationUser field value if set, nil otherwise and a boolean to check if the value has been set.
[ { "docid": "a108507c19e715d31ade31ccc45646c5", "score": "0.8167005", "text": "func (o *ScanDomainForRecordsRequestProviderConfig) GetAuthenticationUserOk() (*string, bool) {\n\tif o == nil || o.AuthenticationUser == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AuthenticationUser, true\n}", "title": "" } ]
[ { "docid": "7962515872bc0784942ec00065b6df4e", "score": "0.6967087", "text": "func (o *PortalConnectionDetails) GetUserOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.User, true\n}", "title": "" }, { "docid": "58fed4d3c642729dc0d22dc77f7df96e", "score": "0.6793755", "text": "func (o *AuthorizationAllOf) GetUserOk() (*string, bool) {\n\tif o == nil || o.User == nil {\n\t\treturn nil, false\n\t}\n\treturn o.User, true\n}", "title": "" }, { "docid": "8942e7bde368157e99e1ffc83dc7b809", "score": "0.6751689", "text": "func (o *PluginConfig) GetUserOk() (*PluginConfigUser, bool) {\n\tif o == nil || o.User == nil {\n\t\treturn nil, false\n\t}\n\treturn o.User, true\n}", "title": "" }, { "docid": "a599c6a76d3445a32ac67bbd76f86f0d", "score": "0.67451346", "text": "func (o *IncomeVerificationPrecheckRequest) GetUserOk() (*IncomeVerificationPrecheckUser, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.User.Get(), o.User.IsSet()\n}", "title": "" }, { "docid": "9ce516e50abd1db6f6c11baf3496a413", "score": "0.6507925", "text": "func (o *AuthorizationAllOfLinks) GetUserOk() (*string, bool) {\n\tif o == nil || o.User == nil {\n\t\treturn nil, false\n\t}\n\treturn o.User, true\n}", "title": "" }, { "docid": "8be9e369051812c2667930ba0cc93c87", "score": "0.6430005", "text": "func (o *CreateCronjobParams) GetUserOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.User, true\n}", "title": "" }, { "docid": "421115f4a36b19981f0c5a9ff248c9cc", "score": "0.6370863", "text": "func (o *WebRTCUserState) GetUserIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.UserId, true\n}", "title": "" }, { "docid": "89b6f19822193a85cd3d5be4efc7af2e", "score": "0.6364839", "text": "func (o *InternetProxyChangeRequest) GetUserOk() (*string, bool) {\n\tif o == nil || o.User == nil {\n\t\treturn nil, false\n\t}\n\treturn o.User, true\n}", "title": "" }, { "docid": "13d0320fad0b0b2e165481923f47594c", "score": "0.63500226", "text": "func (o *AuthenticationModel) GetAuthenticationProviderOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.AuthenticationProvider, true\n}", "title": "" }, { "docid": "7113a9cb14d5ecffac269a050e8f0e27", "score": "0.6342788", "text": "func (o *MicrosoftGraphAlertHistoryState) GetUserOk() (string, bool) {\n\tif o == nil || o.User == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.User, true\n}", "title": "" }, { "docid": "2a6a8a5f05b47099423fc35ec60b5f05", "score": "0.6314254", "text": "func (o *JiraNotificationConfigAllOf) GetUsernameOk() (*string, bool) {\n\tif o == nil || o.Username == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Username, true\n}", "title": "" }, { "docid": "3e749bc1e9f53c1c35d5b79b43380114", "score": "0.6302083", "text": "func (o *IamIdpReference) GetMultiFactorAuthenticationOk() (*bool, bool) {\n\tif o == nil || o.MultiFactorAuthentication == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MultiFactorAuthentication, true\n}", "title": "" }, { "docid": "b7150287e071c4fa3259d4c6896b03f0", "score": "0.6268239", "text": "func (o *ConnectUserRequest) GetUsernameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Username, true\n}", "title": "" }, { "docid": "8faf6310df55d24876e6e5e0c9026b54", "score": "0.6265942", "text": "func (o *IamApiKey) GetUserOk() (*IamUserRelationship, bool) {\n\tif o == nil || o.User == nil {\n\t\treturn nil, false\n\t}\n\treturn o.User, true\n}", "title": "" }, { "docid": "f76fd1daf5ee8d7a72a49d2436187e31", "score": "0.6256469", "text": "func (o *PrincipalOut) GetUsernameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Username, true\n}", "title": "" }, { "docid": "7b85297e280f6dd7d067e45eaf195d9a", "score": "0.62322176", "text": "func (o *BeaconUserCreateRequest) GetUserOk() (*BeaconUserRequestData, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.User, true\n}", "title": "" }, { "docid": "15fb2417b6768e9e60b7299eaa38ac65", "score": "0.6230115", "text": "func (o *UserCore) GetUsernameOk() (*string, bool) {\n\tif o == nil || o.Username == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Username, true\n}", "title": "" }, { "docid": "48fc1611d1a493b3537f6fc56bd7d068", "score": "0.62206453", "text": "func (o *AnsibleTowerNotificationConfigAllOf) GetUsernameOk() (*string, bool) {\n\tif o == nil || o.Username == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Username, true\n}", "title": "" }, { "docid": "25977b4ecb3d7a290fc572387a16b0dd", "score": "0.62112397", "text": "func (o *LoginSpec) GetUsernameOk() (*string, bool) {\n\tif o == nil || o.Username == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Username, true\n}", "title": "" }, { "docid": "0660114f15200d05d75eceb6fc39728c", "score": "0.62072366", "text": "func (o *ThingCreateResponseCredentialsMqttData) GetUsernameOk() (*string, bool) {\n\tif o == nil || o.Username == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Username, true\n}", "title": "" }, { "docid": "7a98f5f8c52f8f3796927dccbecdd1e2", "score": "0.6167249", "text": "func (o *ViewUserAvailability) GetUserOk() (*ViewRelationship, bool) {\n\tif o == nil || o.User == nil {\n\t\treturn nil, false\n\t}\n\treturn o.User, true\n}", "title": "" }, { "docid": "f647af978cd380ac35c8152d16f17102", "score": "0.6164074", "text": "func (o *ServiceNowNotificationConfig) GetUsernameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Username, true\n}", "title": "" }, { "docid": "5d54f2c65a069eb9ddfd7a605f8769a7", "score": "0.61428607", "text": "func (o *ScanDomainForRecordsRequestProviderConfig) HasAuthenticationUser() bool {\n\tif o != nil && o.AuthenticationUser != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8602bb9c7982bbc6749cd8829ff04dd6", "score": "0.6137671", "text": "func (o *UpdateMonitorRequestPatchHttpConfigurationDigestAuth) GetUsernameOk() (*string, bool) {\n\tif o == nil || o.Username == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Username, true\n}", "title": "" }, { "docid": "f8164b05ee01c24336b63f893ac0e797", "score": "0.60661584", "text": "func (o *ApplianceDeviceClaim) GetUsernameOk() (*string, bool) {\n\tif o == nil || o.Username == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Username, true\n}", "title": "" }, { "docid": "f6a0dbfd5bdf505e2fb6cb9781eda5d4", "score": "0.60561967", "text": "func (o *VolumeProperties) GetUserDataOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\n\treturn o.UserData, true\n}", "title": "" }, { "docid": "dc6e1574edca19b9d42790a102ce78c0", "score": "0.6055627", "text": "func (o *IdentityUser) GetStatusOk() (*IdentityUserStatus, bool) {\n\tif o == nil || o.Status == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Status, true\n}", "title": "" }, { "docid": "16b060b493c2b42e4eef15c3cbe1e49f", "score": "0.60425204", "text": "func (o *ViewUserAvailability) GetUserIdOk() (*int32, bool) {\n\tif o == nil || o.UserId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserId, true\n}", "title": "" }, { "docid": "659629a0a44c4651e72a828e9e29263b", "score": "0.60397285", "text": "func (o *UserAllOf) GetUserIdOk() (*interface{}, bool) {\n\tif o == nil || o.UserId == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.UserId, true\n}", "title": "" }, { "docid": "649c28aff61e3795f8408d0334f4ef1e", "score": "0.6019885", "text": "func (o *AuthorizationAllOf) GetUserIDOk() (*string, bool) {\n\tif o == nil || o.UserID == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserID, true\n}", "title": "" }, { "docid": "505605ea6d9e6a28290280e906b6c00c", "score": "0.6019711", "text": "func (o *UpdateBankConnectionParams) GetMultiStepAuthenticationOk() (*MultiStepAuthenticationCallback, bool) {\n\tif o == nil || o.MultiStepAuthentication == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MultiStepAuthentication, true\n}", "title": "" }, { "docid": "3be65807b90ba59d0e363ed894a37f4d", "score": "0.60012484", "text": "func (o *RegistryConfigurationRequest) GetRegistryUserOk() (*string, bool) {\n\tif o == nil || o.RegistryUser == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RegistryUser, true\n}", "title": "" }, { "docid": "9d0618d590ab0e1ce919eb26aafb99a0", "score": "0.5995888", "text": "func (o *ApplianceRemoteFileImport) GetUsernameOk() (*string, bool) {\n\tif o == nil || o.Username == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Username, true\n}", "title": "" }, { "docid": "d7e01b8dc7a37e45aaac4fbdd5aa1549", "score": "0.59556675", "text": "func (o *AddUserRequest) GetUsernameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Username, true\n}", "title": "" }, { "docid": "51d1f64a073c2fa37112ce88eb70d02b", "score": "0.5939245", "text": "func (o *IamUserSetting) GetUserIdOrEmailOk() (*string, bool) {\n\tif o == nil || o.UserIdOrEmail == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserIdOrEmail, true\n}", "title": "" }, { "docid": "e344544ef45dec9419b6d2ef1f198322", "score": "0.593879", "text": "func (o *UserMfaData) GetUserNameOk() (*string, bool) {\n\tif o == nil || o.UserName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserName, true\n}", "title": "" }, { "docid": "6aa68a09a69bd1730dd90c99866c50b0", "score": "0.5911632", "text": "func (o *InlineResponse200122Activity) GetUseridOk() (*string, bool) {\n\tif o == nil || o.Userid == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Userid, true\n}", "title": "" }, { "docid": "32d8792d0af58b29ad2cd04b60e644f7", "score": "0.58940476", "text": "func (o *UserAllOf) GetIsActiveOk() (*interface{}, bool) {\n\tif o == nil || o.IsActive == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.IsActive, true\n}", "title": "" }, { "docid": "ad483943a1f891ba5d659219bb367e73", "score": "0.5892627", "text": "func (o *License) GetIsSingleUserOk() (*bool, bool) {\n\tif o == nil || o.IsSingleUser == nil {\n\t\treturn nil, false\n\t}\n\treturn o.IsSingleUser, true\n}", "title": "" }, { "docid": "012a0ab19ec26f2bd50a73298127a14f", "score": "0.5874866", "text": "func (o *IdentityUser) GetIdOk() (*string, bool) {\n\tif o == nil || o.Id == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Id, true\n}", "title": "" }, { "docid": "b5a0d950704534f89483d6c949099bf8", "score": "0.58726203", "text": "func (o *ScanDomainForRecordsRequestProviderConfig) GetAuthenticationUser() string {\n\tif o == nil || o.AuthenticationUser == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.AuthenticationUser\n}", "title": "" }, { "docid": "a9b3282f4b2cb055246a2727d08005a7", "score": "0.5869445", "text": "func (o *PipelineTriggerActor) GetLoginOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Login, true\n}", "title": "" }, { "docid": "5a92e6552c2a00532e922aae7025d8f9", "score": "0.5832853", "text": "func (o *StandardAccountCreateSpec) GetUsernameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Username, true\n}", "title": "" }, { "docid": "4fe9d559070376ba1c7cab6d470a68bd", "score": "0.58184534", "text": "func (o *IamUserSetting) GetUserUniqueIdentifierOk() (*string, bool) {\n\tif o == nil || o.UserUniqueIdentifier == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserUniqueIdentifier, true\n}", "title": "" }, { "docid": "3a8391dc1b51d47a1000e39b9647d6f4", "score": "0.57810843", "text": "func (o *MQTTPOSTBody) GetUsernameOk() (*string, bool) {\n\tif o == nil || o.Username == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Username, true\n}", "title": "" }, { "docid": "6ef2db81e8441ef7fe34cb0eca2c08db", "score": "0.5754157", "text": "func GetUser(ctx context.Context) (string, bool) {\n\t// This value was saved in the context by the auth interceptor\n\tu, ok := ctx.Value(ContextUsernameKey).(string)\n\treturn u, ok\n}", "title": "" }, { "docid": "59c70ffa0a3520bcecf0b25332a6b582", "score": "0.5754142", "text": "func (o *UserAdminResponse) GetUsernameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Username, true\n}", "title": "" }, { "docid": "d647e452540ac3a8e8568f73fcdf8ae7", "score": "0.5739513", "text": "func CheckAuthentication(r *http.Request) (models.User, bool) {\n\t// Tutorial used from http://austingwalters.com/building-a-web-server-in-go-web-cookies/\n\tcookie, err := r.Cookie(\"Session\")\n\tif err != nil {\n\t\treturn models.User{}, false\n\t}\n\n\tusername, sessionId := processCookie(cookie.Value)\n\tuser, err := GetUser(username)\n\tif err != nil {\n\t\treturn models.User{}, false\n\t}\n\treturn user, sessionId == user.Session && len(user.Session) > 0\n}", "title": "" }, { "docid": "91aa7d98eeec2860a11c2d3d1b244ad3", "score": "0.5720563", "text": "func (o *MicrosoftGraphUserInstallStateSummary) GetUserNameOk() (string, bool) {\n\tif o == nil || o.UserName == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.UserName, true\n}", "title": "" }, { "docid": "d2587f785cbc160c8d5f267e7c616982", "score": "0.57090163", "text": "func (o *InlineResponse20086) GetCreatedByUserIdOk() (*string, bool) {\n\tif o == nil || o.CreatedByUserId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CreatedByUserId, true\n}", "title": "" }, { "docid": "f98c4a47ca7814a14dfae1fb1e16c7b2", "score": "0.57049084", "text": "func (o *UserAdminResponse) GetIsActiveOk() (*bool, bool) {\n\tif o == nil || IsNil(o.IsActive) {\n\t\treturn nil, false\n\t}\n\treturn o.IsActive, true\n}", "title": "" }, { "docid": "b21e1cbbc300a0ad54c8133a595b1565", "score": "0.5686885", "text": "func (o *PostOrganizationsOrganizationIdUsersUser) GetPasswordOk() (*string, bool) {\n\tif o == nil || o.Password == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Password, true\n}", "title": "" }, { "docid": "1602de35d3afc541d2d92f220a4e7eca", "score": "0.5683992", "text": "func (o *LdapCertificateProvider) GetCertificateUserAttributeOk() (*string, bool) {\n\tif o == nil || o.CertificateUserAttribute == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CertificateUserAttribute, true\n}", "title": "" }, { "docid": "303c495ef40e8ccae4c7eb28501fc587", "score": "0.56468654", "text": "func (o *LdapCertificateProvider) GetUsernameAttributeOk() (*string, bool) {\n\tif o == nil || o.UsernameAttribute == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UsernameAttribute, true\n}", "title": "" }, { "docid": "33e222305178cd7083406f64562c242e", "score": "0.56316483", "text": "func (o *UserAllOf) GetIsOwnerOk() (*interface{}, bool) {\n\tif o == nil || o.IsOwner == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.IsOwner, true\n}", "title": "" }, { "docid": "97456e6b2dae31cc1a12fe3fb7219c0e", "score": "0.56285405", "text": "func (o *UserPreferenceBody) GetIsActiveOk() (*bool, bool) {\n\tif o == nil || o.IsActive == nil {\n\t\treturn nil, false\n\t}\n\treturn o.IsActive, true\n}", "title": "" }, { "docid": "cc083d846668860480d58a825380c433", "score": "0.5627377", "text": "func (o *InlineResponse20083People) GetUserTypeOk() (*string, bool) {\n\tif o == nil || o.UserType == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserType, true\n}", "title": "" }, { "docid": "770bded1df379f68a601eb87af9dae55", "score": "0.56174356", "text": "func (a *Auth) CheckAuthenticated(w http.ResponseWriter, r *http.Request) (User, bool) {\n\tuser, ok := r.Context().Value(\"user\").(User)\n\n\tif !ok {\n\t\treturn nil, false\n\t}\n\n\treturn user, ok\n}", "title": "" }, { "docid": "41d7cca8576fde06e0b0fae4d2a52c08", "score": "0.55966496", "text": "func GetUser(ctx context.Context) (string, bool) {\n\t// log.Println(ctx.Value(tokenInfoKey))\n\tif tokenInfo, ok := ctx.Value(tokenInfoKey).(*pbauthorize.AuthorizeResponse); ok {\n\t\tif len(tokenInfo.User) > 0 {\n\t\t\treturn tokenInfo.User, true\n\t\t} else if len(tokenInfo.UserId) > 0 {\n\t\t\treturn tokenInfo.UserId, true\n\t\t}\n\t}\n\treturn \"\", false\n}", "title": "" }, { "docid": "0ee50f3ad2a99eae87c6d09f324cec8a", "score": "0.5590982", "text": "func (o *InlineResponse20025Links) GetCreatedByUserIdOk() (*string, bool) {\n\tif o == nil || o.CreatedByUserId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CreatedByUserId, true\n}", "title": "" }, { "docid": "86a20d80dcfb14077e021ba3bee862d7", "score": "0.5586291", "text": "func (o *V1VirtualMachineSpec) GetUserDataOk() (*string, bool) {\n\tif o == nil || o.UserData == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserData, true\n}", "title": "" }, { "docid": "b6a8d105a2d2349b435f35b2b6d5562c", "score": "0.5583006", "text": "func (o *User) GetAuthMethodOk() (string, bool) {\n\tif o == nil || o.AuthMethod == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.AuthMethod, true\n}", "title": "" }, { "docid": "4554ad6d46a26b1643d0dd0a24248a41", "score": "0.55751884", "text": "func (o *InlineResponse20083People) GetUserNameOk() (*string, bool) {\n\tif o == nil || o.UserName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserName, true\n}", "title": "" }, { "docid": "1faa71b3e88ff0bf7f33be558b98776f", "score": "0.5564936", "text": "func (o *IdentityUserIdentity) GetIdOk() (*string, bool) {\n\tif o == nil || o.Id == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Id, true\n}", "title": "" }, { "docid": "7c88f4745db1b1bc41b793f81f8874dd", "score": "0.55393976", "text": "func (ctx *VerifySignupUserContext) OK(r *GoaLocalUser) error {\n\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.local.user+json\")\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 200, r)\n}", "title": "" }, { "docid": "e661325525b66560d59ecd6ffc544da8", "score": "0.55301684", "text": "func (o *UserCore) GetIsFederatedOk() (*bool, bool) {\n\tif o == nil || o.IsFederated == nil {\n\t\treturn nil, false\n\t}\n\treturn o.IsFederated, true\n}", "title": "" }, { "docid": "d0422cde89a72b2a7c6f0e05e72d1ace", "score": "0.5506525", "text": "func (o *PeopleIdJsonPerson) GetUserNameOk() (*string, bool) {\n\tif o == nil || o.UserName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserName, true\n}", "title": "" }, { "docid": "a0cb821cd2d44dbd2b48a3a42f7ef385", "score": "0.5495006", "text": "func (UserService) VerifyAndReturnUserInfo(dto dto.LoginDto) (bool, model.User) {\n\tuserModel := userDao.GetByUserName(dto.Username)\n\tif login.VerifyPassword(dto.Password, userModel) {\n\t\treturn true, userModel\n\t}\n\treturn false, model.User{}\n}", "title": "" }, { "docid": "36dced2e6540e814d5fc0e4df800172f", "score": "0.54916364", "text": "func (o *AddUserRequest) GetPasswordOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Password, true\n}", "title": "" }, { "docid": "a1c406f75a79bad0c7685c725161c99a", "score": "0.54829484", "text": "func (o *IdentityUserIdentity) GetIdentityIdOk() (*string, bool) {\n\tif o == nil || o.IdentityId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.IdentityId, true\n}", "title": "" }, { "docid": "b3241ed6487d8be6a75de97a845e271a", "score": "0.5480999", "text": "func (o *IdentityUser) GetPhoneNumberOk() (*string, bool) {\n\tif o == nil || o.PhoneNumber == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PhoneNumber, true\n}", "title": "" }, { "docid": "3ab0878f6d1dc71fa51369c2b9fd7b82", "score": "0.5470121", "text": "func (o *InlineResponse20023Invoice) GetCreatedByUserIdOk() (*string, bool) {\n\tif o == nil || o.CreatedByUserId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CreatedByUserId, true\n}", "title": "" }, { "docid": "8b091b7bef163091641f6363983d595d", "score": "0.5468128", "text": "func (o *UserCore) GetLastLoginOk() (*string, bool) {\n\tif o == nil || o.LastLogin == nil {\n\t\treturn nil, false\n\t}\n\treturn o.LastLogin, true\n}", "title": "" }, { "docid": "c8da2c4dbde0fe594288084339230392", "score": "0.54662704", "text": "func (o *UserCore) GetEnabledOk() (*bool, bool) {\n\tif o == nil || o.Enabled == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Enabled, true\n}", "title": "" }, { "docid": "70125559b576a84858c9b17f5459f10e", "score": "0.545415", "text": "func (db *Database) AuthenticateUser(username, password string, opts map[string]interface{}) (map[string]interface{}, bool, error) {\n\tdb.mu.RLock()\n\tdefer db.mu.RUnlock()\n\tusername = strings.ToLower(username)\n\tif _, exists := db.RefUsername[username]; !exists {\n\t\treturn nil, false, fmt.Errorf(\"username does not exist\")\n\t}\n\tuser := db.RefUsername[username]\n\tif user == nil {\n\t\treturn nil, false, fmt.Errorf(\"user associated with the username is nil\")\n\t}\n\tif err := user.VerifyPassword(password); err != nil {\n\t\treturn nil, false, fmt.Errorf(\"invalid password\")\n\t}\n\tuserMap := make(map[string]interface{})\n\tuserMap[\"sub\"] = username\n\tif email := user.GetMailClaim(); email != \"\" {\n\t\tuserMap[\"mail\"] = email\n\t}\n\tif name := user.GetNameClaim(); name != \"\" {\n\t\tuserMap[\"name\"] = name\n\t}\n\tif roles := user.GetRolesClaim(); roles != \"\" {\n\t\tuserMap[\"roles\"] = roles\n\t}\n\tif opts == nil {\n\t\treturn userMap, true, nil\n\t}\n\tif len(opts) == 0 {\n\t\treturn userMap, true, nil\n\t}\n\tfor k, v := range opts {\n\t\tswitch k {\n\t\tcase \"require_mfa\":\n\t\t\tswitch v.(type) {\n\t\t\tcase bool:\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tuserData := user.GetMfaConfigurationMetadata()\n\t\t\t\t\tif _, exists := userMap[\"metadata\"]; !exists {\n\t\t\t\t\t\tuserMap[\"metadata\"] = userData\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmetadata := userMap[\"metadata\"].(map[string]interface{})\n\t\t\t\t\t\tfor nk, nv := range userData {\n\t\t\t\t\t\t\tmetadata[nk] = nv\n\t\t\t\t\t\t}\n\t\t\t\t\t\tuserMap[\"metadata\"] = metadata\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn userMap, true, nil\n}", "title": "" }, { "docid": "5bcf2344fed55f36e183c68aaea1fc4f", "score": "0.5453669", "text": "func (o *PatchedTableWebhookUpdateRequest) GetUseUserFieldNamesOk() (*bool, bool) {\n\tif o == nil || IsNil(o.UseUserFieldNames) {\n\t\treturn nil, false\n\t}\n\treturn o.UseUserFieldNames, true\n}", "title": "" }, { "docid": "756c86abc06970ab14a7a83d6b117d2f", "score": "0.5446526", "text": "func (o *RiskRisk) GetCreatedByUserIdOk() (*int32, bool) {\n\tif o == nil || o.CreatedByUserId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CreatedByUserId, true\n}", "title": "" }, { "docid": "e965c59e81599df278f7d3ebcb43fc12", "score": "0.54414994", "text": "func NewGetCurrentUserOK() *GetCurrentUserOK {\n\n\treturn &GetCurrentUserOK{}\n}", "title": "" }, { "docid": "2f0ce9a5ecffc20148ab9f725cd83c19", "score": "0.54289573", "text": "func (o *InlineResponse20017Expenses) GetCreatedByUserIdOk() (*string, bool) {\n\tif o == nil || o.CreatedByUserId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CreatedByUserId, true\n}", "title": "" }, { "docid": "78e71dddb62d4313159f6adb7f3ac4ac", "score": "0.5428931", "text": "func (this User) IsAuth(AppToken string, accessLevel int8, url string) (User, error) {\n\treturn User{}, nil\n}", "title": "" }, { "docid": "f0b6a527effbe95a8311436906fc6ef6", "score": "0.54255843", "text": "func (o *IamUserSetting) GetAllowUiSessionRecordingOk() (*bool, bool) {\n\tif o == nil || o.AllowUiSessionRecording == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AllowUiSessionRecording, true\n}", "title": "" }, { "docid": "a6c6b75da5fe1c26faa56ee6465a1067", "score": "0.54238796", "text": "func (o *IpEvent) GetSrcUserOk() (*string, bool) {\n\tif o == nil || o.SrcUser == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SrcUser, true\n}", "title": "" }, { "docid": "6d7bcb5ef80fbf3142c560e674c6cbd4", "score": "0.5415245", "text": "func (o *Systemuser) GetSystemuserNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.SystemuserName, true\n}", "title": "" }, { "docid": "ede7b9bcc6233e16c8e7444924f465c6", "score": "0.54060674", "text": "func (*OpenconfigSystem_System_Aaa_Authentication_Users_User) IsYANGGoStruct() {}", "title": "" }, { "docid": "ede7b9bcc6233e16c8e7444924f465c6", "score": "0.54060674", "text": "func (*OpenconfigSystem_System_Aaa_Authentication_Users_User) IsYANGGoStruct() {}", "title": "" }, { "docid": "123b96c43865d069dbeb6243480f7543", "score": "0.54052263", "text": "func (o *RetrieveUserOK) IsSuccess() bool {\n\treturn true\n}", "title": "" }, { "docid": "ede7b9bcc6233e16c8e7444924f465c6", "score": "0.54049104", "text": "func (*OpenconfigSystem_System_Aaa_Authentication_Users_User) IsYANGGoStruct() {}", "title": "" }, { "docid": "6bd9dd1907a389b8df198ca334bc0e56", "score": "0.5399172", "text": "func (o *UserAllOf) GetFullNameOk() (*interface{}, bool) {\n\tif o == nil || o.FullName == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.FullName, true\n}", "title": "" }, { "docid": "2ea210fe3cbea5b75b3a933824c90303", "score": "0.53963447", "text": "func (o *Host) GetUserLevelOk() (*string, bool) {\n\tif o == nil || o.UserLevel == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserLevel, true\n}", "title": "" }, { "docid": "b23bce9f411ef674cc7dd6c3cd7207db", "score": "0.5395711", "text": "func (o *GroupEntities) GetUsersOk() (*GroupMembers, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Users, true\n}", "title": "" }, { "docid": "7d4ff6a0983359d9886d865a519b9050", "score": "0.5372265", "text": "func (o *PrincipalOut) GetIsActiveOk() (*bool, bool) {\n\tif o == nil || o.IsActive == nil {\n\t\treturn nil, false\n\t}\n\treturn o.IsActive, true\n}", "title": "" }, { "docid": "4810d70d6a09db4fcd7c0c4ad963bbb4", "score": "0.5371433", "text": "func (o *NiatelemetrySmartLicenseAllOf) GetAuthStatusOk() (*string, bool) {\n\tif o == nil || o.AuthStatus == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AuthStatus, true\n}", "title": "" }, { "docid": "5dc4382960b3f94343bf3761e28597c2", "score": "0.5366576", "text": "func (o *UserPreferenceBody) GetValueOk() (*string, bool) {\n\tif o == nil || o.Value == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Value, true\n}", "title": "" }, { "docid": "4c1338b6bd575e5206b21426589ab55b", "score": "0.5359663", "text": "func NewGetUserOK() *GetUserOK {\n\treturn &GetUserOK{}\n}", "title": "" }, { "docid": "4c1338b6bd575e5206b21426589ab55b", "score": "0.5359663", "text": "func NewGetUserOK() *GetUserOK {\n\treturn &GetUserOK{}\n}", "title": "" }, { "docid": "033532403d42bb81a5c93754b2d8b677", "score": "0.5356745", "text": "func (o *PasswordProfile) GetPasswordOk() (*string, bool) {\n\tif o == nil || o.Password == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Password, true\n}", "title": "" }, { "docid": "1e53b4d1b473f6a44dcea8a9e600e8d3", "score": "0.53415984", "text": "func (o *ViewCustomFieldProject) GetCreatedByOk() (*int32, bool) {\n\tif o == nil || o.CreatedBy == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CreatedBy, true\n}", "title": "" }, { "docid": "97d89e68f17ebca2f9f317dc62af8e67", "score": "0.53349215", "text": "func GetAuthsUserOK(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.UserController, userID *string) (http.ResponseWriter, *app.AuthStatus) {\n\t// Setup service\n\tvar (\n\t\tlogBuf bytes.Buffer\n\t\tresp interface{}\n\n\t\trespSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }\n\t)\n\tif service == nil {\n\t\tservice = goatest.Service(&logBuf, respSetter)\n\t} else {\n\t\tlogger := log.New(&logBuf, \"\", log.Ltime)\n\t\tservice.WithLogger(goa.NewLogger(logger))\n\t\tnewEncoder := func(io.Writer) goa.Encoder { return respSetter }\n\t\tservice.Encoder = goa.NewHTTPEncoder() // Make sure the code ends up using this decoder\n\t\tservice.Encoder.Register(newEncoder, \"*/*\")\n\t}\n\n\t// Setup request context\n\trw := httptest.NewRecorder()\n\tquery := url.Values{}\n\tif userID != nil {\n\t\tsliceVal := []string{*userID}\n\t\tquery[\"userID\"] = sliceVal\n\t}\n\tu := &url.URL{\n\t\tPath: fmt.Sprintf(\"/api/v1/user/user/authstat\"),\n\t\tRawQuery: query.Encode(),\n\t}\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\tpanic(\"invalid test \" + err.Error()) // bug\n\t}\n\tprms := url.Values{}\n\tif userID != nil {\n\t\tsliceVal := []string{*userID}\n\t\tprms[\"userID\"] = sliceVal\n\t}\n\tif ctx == nil {\n\t\tctx = context.Background()\n\t}\n\tgoaCtx := goa.NewContext(goa.WithAction(ctx, \"UserTest\"), rw, req, prms)\n\tgetAuthsCtx, _err := app.NewGetAuthsUserContext(goaCtx, req, service)\n\tif _err != nil {\n\t\te, ok := _err.(goa.ServiceError)\n\t\tif !ok {\n\t\t\tpanic(\"invalid test data \" + _err.Error()) // bug\n\t\t}\n\t\tt.Errorf(\"unexpected parameter validation error: %+v\", e)\n\t\treturn nil, nil\n\t}\n\n\t// Perform action\n\t_err = ctrl.GetAuths(getAuthsCtx)\n\n\t// Validate response\n\tif _err != nil {\n\t\tt.Fatalf(\"controller returned %+v, logs:\\n%s\", _err, logBuf.String())\n\t}\n\tif rw.Code != 200 {\n\t\tt.Errorf(\"invalid response status code: got %+v, expected 200\", rw.Code)\n\t}\n\tvar mt *app.AuthStatus\n\tif resp != nil {\n\t\tvar _ok bool\n\t\tmt, _ok = resp.(*app.AuthStatus)\n\t\tif !_ok {\n\t\t\tt.Fatalf(\"invalid response media: got variable of type %T, value %+v, expected instance of app.AuthStatus\", resp, resp)\n\t\t}\n\t\t_err = mt.Validate()\n\t\tif _err != nil {\n\t\t\tt.Errorf(\"invalid response media type: %s\", _err)\n\t\t}\n\t}\n\n\t// Return results\n\treturn rw, mt\n}", "title": "" }, { "docid": "38b1d6efd43d75603969421c35652ed8", "score": "0.5330215", "text": "func (o *IdentityUser) GetEmailOk() (*string, bool) {\n\tif o == nil || o.Email == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Email, true\n}", "title": "" }, { "docid": "1301e5e164422aea8a58c8afa0f5f180", "score": "0.53228766", "text": "func (o *InlineResponse200122Activity) GetForusernameOk() (*string, bool) {\n\tif o == nil || o.Forusername == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Forusername, true\n}", "title": "" } ]
12568355931bfed710cb94cd34d971bc
TestCallNonScenarioActions runs the scenario multiple times. The first time, it runs with no errors. In subsequent runs, it specifies that each stub in the sequence should raise an error and verifies the results.
[ { "docid": "9e99e624dbfa4a10ff20d320a9d72269", "score": "0.6998986", "text": "func TestCallNonScenarioActions(t *testing.T) {\n\tscenTest := NonScenarioActionsTest{}\n\ttesttools.RunScenarioTests(&scenTest, t)\n}", "title": "" } ]
[ { "docid": "df84c8bc90e7bc0d7177783c904bc8b1", "score": "0.6248122", "text": "func CallNonScenarioActions(sdkConfig aws.Config, ) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tlog.Println(r)\n\t\t}\n\t}()\n\n\tiamClient := iam.NewFromConfig(sdkConfig)\n\taccountWrapper := AccountWrapper{IamClient: iamClient}\n\tgroupWrapper := GroupWrapper{IamClient: iamClient}\n\tpolicyWrapper := PolicyWrapper{IamClient: iamClient}\n\troleWrapper:= RoleWrapper{IamClient: iamClient}\n\tuserWrapper:= UserWrapper{IamClient: iamClient}\n\n\tpwPolicy, err := accountWrapper.GetAccountPasswordPolicy()\n\tif err != nil {\n\t\tvar apiError smithy.APIError\n\t\tif errors.As(err, &apiError) {\n\t\t\tswitch apiError.(type) {\n\t\t\tcase *types.NoSuchEntityException:\n\t\t\t\tlog.Printf(\"No password policy is expected if none has been set.\")\n\t\t\tdefault:\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlog.Printf(\"Policy min length: %v\\n\", pwPolicy.MinimumPasswordLength)\n\t}\n\n\tproviders, err := accountWrapper.ListSAMLProviders()\n\tif err != nil {panic(err)}\n\tfor _, prov := range providers {\n\t\tlog.Println(*prov.Arn)\n\t}\n\n\tgroups, err := groupWrapper.ListGroups(maxThings)\n\tif err != nil {panic(err)}\n\tfor _, group := range groups {\n\t\tlog.Println(*group.GroupName)\n\t}\n\n\tpolicies, err := policyWrapper.ListPolicies(maxThings)\n\tif err != nil {panic(err)}\n\tfor _, pol := range policies {\n\t\tlog.Println(*pol.PolicyName)\n\t}\n\n\tpolicy, err := policyWrapper.GetPolicy(policyArn)\n\tif err != nil {panic(err)}\n\tlog.Println(*policy.Arn)\n\n\troles, err := roleWrapper.ListRoles(maxThings)\n\tif err != nil {panic(err)}\n\tfor _, r := range roles {\n\t\tlog.Println(*r.RoleName)\n\t}\n\n\trole, err := roleWrapper.GetRole(roleName)\n\tif err != nil {panic(err)}\n\tlog.Println(*role.RoleName)\n\n\tsvcRole, err := roleWrapper.CreateServiceLinkedRole(\"batch.amazonaws.com\", \"test\")\n\tif err != nil {panic(err)}\n\tlog.Println(*svcRole.RoleName)\n\n\terr = roleWrapper.DeleteServiceLinkedRole(*svcRole.RoleName)\n\tif err != nil {panic(err)}\n\n\trPols, err := roleWrapper.ListRolePolicies(roleName)\n\tif err != nil {panic(err)}\n\tfor _, rPol := range rPols {\n\t\tlog.Println(rPol)\n\t}\n\n\tusers, err := userWrapper.ListUsers(maxThings)\n\tif err != nil {panic(err)}\n\tfor _, user := range users {\n\t\tlog.Println(user.UserName)\n\t}\n\n\tlog.Printf(\"Thanks for watching!\")\n}", "title": "" }, { "docid": "e05f12d07ba9b84b2e31bf1ff83e5388", "score": "0.5657377", "text": "func TestTriggerSequenceNonExistingService(t *testing.T) {\n\n\tcredentialmanager.MockAuthCreds = true\n\tprojectName := \"hello-world\"\n\tsequenceName := \"hello\"\n\tts := httptest.NewServer(\n\t\thttp.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tw.Header().Add(\"Content-Type\", \"application/json\")\n\t\t\tw.WriteHeader(200)\n\t\t\tif strings.Contains(r.RequestURI, \"/v1/metadata\") {\n\t\t\t\tdefer r.Body.Close()\n\t\t\t\tw.Write([]byte(metadataMockResponse))\n\t\t\t\treturn\n\t\t\t} else if strings.Contains(r.RequestURI, \"service\") {\n\t\t\t\tres := fmt.Sprintf(getSvcMockResponseSequence, \"helloservice\")\n\t\t\t\tw.Write([]byte(res))\n\t\t\t\treturn\n\t\t\t} else if strings.Contains(r.RequestURI, \"/controlPlane/v1/project/\") {\n\t\t\t\tres := fmt.Sprintf(getProjectMockResponseSequence, projectName, \"demo\", \"dev\")\n\t\t\t\tw.Write([]byte(res))\n\t\t\t\treturn\n\t\t\t}\n\t\t}),\n\t)\n\tdefer ts.Close()\n\tt.Setenv(\"MOCK_SERVER\", ts.URL)\n\n\ttests := []struct {\n\t\tservice string\n\t\twantErr bool\n\t}{\n\t\t{\n\t\t\tservice: \"demo-service\",\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tservice: \"helloservice\",\n\t\t\twantErr: false,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(\"\", func(t *testing.T) {\n\t\t\tcmd := fmt.Sprintf(\"trigger sequence %s --project=%s --service=%s --stage=%s --mock\",\n\t\t\t\tsequenceName,\n\t\t\t\tprojectName,\n\t\t\t\ttt.service,\n\t\t\t\t\"dev\",\n\t\t\t)\n\t\t\t_, err := executeActionCommandC(cmd)\n\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"wanted error: %t, got: %v\", tt.wantErr, err)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "4b505a33c66a54e2526d0144417cf676", "score": "0.5434302", "text": "func TestTriggerSequenceNonExistingProject(t *testing.T) {\n\n\tconst nonExistingProject = \"myproj\"\n\n\tcredentialmanager.MockAuthCreds = true\n\tts := httptest.NewServer(\n\t\thttp.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tw.Header().Add(\"Content-Type\", \"application/json\")\n\t\t\tw.WriteHeader(400)\n\t\t\tres := fmt.Sprintf(getProjectMockResponseSequenceNotFound, nonExistingProject)\n\t\t\tw.Write([]byte(res))\n\t\t}),\n\t)\n\tdefer ts.Close()\n\tt.Setenv(\"MOCK_SERVER\", ts.URL)\n\n\ttests := []struct {\n\t\tproject string\n\t\twantErr bool\n\t}{\n\t\t{\n\t\t\tproject: nonExistingProject,\n\t\t\twantErr: true,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(\"\", func(t *testing.T) {\n\t\t\tcmd := fmt.Sprintf(\"trigger sequence %s --project=%s --service=mysvc --stage=%s --mock\",\n\t\t\t\ttt.project,\n\t\t\t\t\"hello\",\n\t\t\t\t\"dev\")\n\t\t\t_, err := executeActionCommandC(cmd)\n\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"wanted error: %t, got: %v\", tt.wantErr, err)\n\t\t\t}\n\t\t\tmsg := fmt.Sprintf(\"%v\", err)\n\t\t\tif !strings.Contains(msg, \"Project not found\") {\n\t\t\t\tt.Errorf(\"wanted project not found\")\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "da9c295247d9c6fc347f76a72bc83a6a", "score": "0.5418316", "text": "func Test_Failing(t *testing.T) {\n\tfor idx, testcase := range []struct {\n\t\tfailer func(ctx goka.Context)\n\t}{\n\t\t// panics explicitly\n\t\t{\n\t\t\tfailer: func(ctx goka.Context) {\n\t\t\t\tpanic(\"some panic\")\n\t\t\t},\n\t\t},\n\n\t\t// fails for nil pointer dereference\n\t\t{\n\t\t\tfailer: func(ctx goka.Context) {\n\t\t\t\tvar nilPointer *int\n\t\t\t\t_ = *nilPointer\n\t\t\t},\n\t\t},\n\n\t\t// explicit context fail\n\t\t{\n\t\t\tfailer: func(ctx goka.Context) {\n\t\t\t\tctx.Fail(fmt.Errorf(\"failing callback\"))\n\t\t\t},\n\t\t},\n\t\t// div-by-zero\n\t\t{\n\t\t\tfailer: func(ctx goka.Context) {\n\t\t\t\tvar x int\n\t\t\t\t_ = 123 / x\n\t\t\t},\n\t\t},\n\t\t// wrong regex\n\t\t{\n\t\t\tfailer: func(ctx goka.Context) {\n\t\t\t\t_ = regexp.MustCompile(`)`)\n\t\t\t},\n\t\t},\n\t} {\n\t\tt.Run(fmt.Sprintf(\"failing-test-%d\", idx), func(t *testing.T) {\n\t\t\tgkt := tester.New(t)\n\n\t\t\t// create a new processor, registering the tester\n\t\t\tproc, _ := goka.NewProcessor([]string{}, goka.DefineGroup(\"group\",\n\t\t\t\tgoka.Inputs(goka.StringsToStreams(\"input\", \"input2\", \"input3\", \"input4\"), new(codec.String), func(ctx goka.Context, msg interface{}) {\n\t\t\t\t\ttestcase.failer(ctx)\n\t\t\t\t}),\n\t\t\t),\n\t\t\t\tgoka.WithTester(gkt),\n\t\t\t)\n\n\t\t\tvar (\n\t\t\t\tdone = make(chan struct{})\n\t\t\t\trunError error\n\t\t\t)\n\t\t\t// start it\n\t\t\tgo func() {\n\t\t\t\tdefer close(done)\n\t\t\t\trunError = proc.Run(context.Background())\n\t\t\t}()\n\n\t\t\t// send some message\n\t\t\tgkt.Consume(\"input\", \"key\", \"some-message\")\n\n\t\t\t<-done\n\t\t\trequire.Error(t, runError)\n\t\t\tlog.Printf(\"Reported (expected) error for test %d: %v\", idx, runError)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "fcc47d33109519476281b4c201f5cf2b", "score": "0.53399515", "text": "func TestCheckImageListFail(t *testing.T) {\n\tsafeClient.client = &mockClient{listFail: true}\n\n\tvar err error\n\n\tcapture.All(func() {\n\t\t_, err = checkImageExists(\"opensuse\", \"bar\")\n\t})\n\n\tif err == nil {\n\t\tt.Fatal(\"Error did not occur\")\n\t}\n}", "title": "" }, { "docid": "388d73e038c86bc4c9e033fb52036638", "score": "0.5315074", "text": "func (f *FakeRuntime) AssertCalls(calls []string) bool {\n\tf.Lock()\n\tdefer f.Unlock()\n\treturn f.assertList(calls, f.CalledFunctions)\n}", "title": "" }, { "docid": "3432830dc30b3bb22e13d6141e341d91", "score": "0.5303291", "text": "func TestErrors(t *testing.T) {\n\tinitState(t)\n\tname := \"entity-1\"\n\tcommands := []int{handleUmUserCommand, handleUmGroupCommand, handleUmResourceCommand, handlePermissionCommand}\n\n\tfor _, idx := range commands {\n\t\turl := listener + enServicePath + fmt.Sprintf(cr.ConvertCommandToRequest(urlCommands[idx]), name)\n\t\texeCommandCheckRes(t, cr.HTTPPutStr, url, http.StatusCreated, \"\", cr.StringMessage{Str: cr.GetMessageStr})\n\t\texeCommandCheckRes(t, cr.HTTPPutStr, url, http.StatusPreconditionFailed, \"\", cr.StringMessage{Str: cr.GetMessageStr})\n\t\texeCommandCheckRes(t, cr.HTTPDeleteStr, url, http.StatusNoContent, \"\", cr.StringMessage{Str: cr.GetMessageStr})\n\t\texeCommandCheckRes(t, cr.HTTPDeleteStr, url, http.StatusNotFound, \"\", cr.Error{Code: http.StatusNotFound})\n\t\tif idx != handlePermissionCommand {\n\t\t\texeCommandCheckRes(t, cr.HTTPGetStr, url, http.StatusNotFound, \"\", cr.Error{Code: http.StatusNotFound})\n\t\t}\n\t}\n\n\tinitState(t)\n\tsetGroup(t, listener)\t\n\turl := listener + enServicePath + fmt.Sprintf(cr.ConvertCommandToRequest(urlCommands[addToGroupCommand]), groupsName[0], userIDToken, \"undef user\")\n\texeCommandCheckRes(t, cr.HTTPPutStr, url, http.StatusPreconditionFailed, \"\", cr.StringMessage{Str: cr.GetMessageStr})\n\texeCommandCheckRes(t, cr.HTTPDeleteStr, url, http.StatusPreconditionFailed, \"\", cr.StringMessage{Str: cr.GetMessageStr})\n}", "title": "" }, { "docid": "6f984c97199a4fe746703c529bacac11", "score": "0.529026", "text": "func RunNilMultiTest(data interface{}, testFunc func() error, canPanic bool) (total, failed int, errs []error) {\n\ttestfn := func() error {\n\t\tif !canPanic {\n\t\t\tdefer func() {\n\t\t\t\tif r := recover(); r != nil {\n\t\t\t\t\terr := fmt.Errorf(\"Panic happened: %v\", r)\n\t\t\t\t\terrs = append(errs, err)\n\t\t\t\t\tfailed++\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\t\ttotal++\n\t\terr := testAndGen(data, testFunc)\n\t\tif err != nil {\n\t\t\terrs = append(errs, err)\n\t\t\tfailed++\n\t\t}\n\t\treturn nil // we want to continue with next test\n\t}\n\n\terr := testAndGen(data, testfn)\n\tif err != nil { // out of test function error\n\t\terrs = append(errs, err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "ab0f0fa5741c25a11d4d4d59eee0bbb7", "score": "0.519145", "text": "func TestRunDefault(t *testing.T) {\n\ttestCases := []struct {\n\t\targs []string\n\t\tfunctionName string\n\t}{\n\t\t{nil, \"Generate\"},\n\t\t{[]string{}, \"Generate\"},\n\t\t{[]string{\"-file-server\"}, \"RunFileServer\"},\n\t\t{[]string{\"-server\"}, \"Host\"},\n\t\t{[]string{\"-file-server\", \"-server\"}, \"RunFileServer\"},\n\t\t{[]string{\"-blah\"}, \"\"},\n\t\t{[]string{\"-file-server\", \"-blah\"}, \"\"},\n\t}\n\tfor testCaseIndex, tc := range testCases {\n\t\tcontext := test.NewContext(t).SetFields(test.ContextFields{\n\t\t\t\"index\": testCaseIndex,\n\t\t\t\"args\": tc.args,\n\t\t\t\"functionName\": tc.functionName,\n\t\t})\n\n\t\tcontroller := gomock.NewController(t)\n\t\tapp := mocks.NewMockApp(controller)\n\t\texpect := app.EXPECT()\n\n\t\texpect.GeneratedPath().Return(\"the_generated\")\n\t\texpect.FileServerPort().Return(999)\n\t\texpect.ServerPort().Return(100)\n\n\t\tmap[string]func() *gomock.Call{\n\t\t\t\"\": func() *gomock.Call { return nil },\n\t\t\t\"Generate\": expect.Generate,\n\t\t\t\"RunFileServer\": expect.RunFileServer,\n\t\t\t\"Host\": expect.Host,\n\t\t}[tc.functionName]()\n\n\t\tcontext.AssertError(Run(\"random name\", app, tc.args), \"Run\")\n\n\t\tt.Log(context.FieldsString())\n\t\tcontroller.Finish()\n\t}\n}", "title": "" }, { "docid": "85c6e33d579b8be60b3eccef4ec4fe6b", "score": "0.5190015", "text": "func Test_Start_sfnserviceerror_UnblocksAndCancellsContext(t *testing.T) {\n\n\theartbeatFrequency := 1 * time.Millisecond\n\ttype handler func(interface{}, struct{}) (interface{}, error)\n\ttype testCase struct {\n\t\tBuildTestCase func(*gomock.Controller) (*mock_sfn.MockSFNAPI, handler)\n\t}\n\n\ttestCases := map[string]testCase{\n\t\t\"GetActivityTaskReturnsAnError\": testCase{\n\t\t\tfunc(c *gomock.Controller) (*mock_sfn.MockSFNAPI, handler) {\n\t\t\t\tsfnapi := mock_sfn.NewMockSFNAPI(c)\n\t\t\t\tsfnapi.EXPECT().GetActivityTask(gomock.Any()).AnyTimes().Return(nil, errors.New(\"testError\"))\n\t\t\t\thandler := func(interface{}, struct{}) (interface{}, error) {\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\t\t\t\treturn sfnapi, handler\n\t\t\t},\n\t\t},\n\t\t\"SendTaskSuccessReturnsAnError\": testCase{\n\t\t\tfunc(c *gomock.Controller) (*mock_sfn.MockSFNAPI, handler) {\n\t\t\t\tsfnapi := mock_sfn.NewMockSFNAPI(c)\n\t\t\t\ttestHandlerInputEvent, _ := json.Marshal(struct{}{})\n\t\t\t\tsfnapi.EXPECT().GetActivityTask(gomock.Any()).AnyTimes().Return(&sfn.GetActivityTaskOutput{\n\t\t\t\t\tInput: aws.String(string(testHandlerInputEvent)),\n\t\t\t\t\tTaskToken: aws.String(\"testToken\"),\n\t\t\t\t}, nil)\n\t\t\t\tsfnapi.EXPECT().SendTaskSuccess(gomock.Any()).AnyTimes().Return(nil, errors.New(\"testError\"))\n\t\t\t\thandler := func(interface{}, struct{}) (interface{}, error) {\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\t\t\t\treturn sfnapi, handler\n\t\t\t},\n\t\t},\n\t\t\"SendTaskFailureReturnsAnError\": testCase{\n\t\t\tfunc(c *gomock.Controller) (*mock_sfn.MockSFNAPI, handler) {\n\t\t\t\tsfnapi := mock_sfn.NewMockSFNAPI(c)\n\t\t\t\ttestHandlerInputEvent, _ := json.Marshal(struct{}{})\n\t\t\t\tsfnapi.EXPECT().GetActivityTask(gomock.Any()).AnyTimes().Return(&sfn.GetActivityTaskOutput{\n\t\t\t\t\tInput: aws.String(string(testHandlerInputEvent)),\n\t\t\t\t\tTaskToken: aws.String(\"testToken\"),\n\t\t\t\t}, nil)\n\t\t\t\tsfnapi.EXPECT().SendTaskFailure(gomock.Any()).AnyTimes().Return(nil, errors.New(\"testerror\"))\n\t\t\t\thandler := func(interface{}, struct{}) (interface{}, error) {\n\t\t\t\t\treturn nil, errors.New(\"error to trigger SendTaskFailure call\")\n\t\t\t\t}\n\t\t\t\treturn sfnapi, handler\n\t\t\t},\n\t\t},\n\t\t\"SendTaskHeartbeatReturnsAnError\": testCase{\n\t\t\tfunc(c *gomock.Controller) (*mock_sfn.MockSFNAPI, handler) {\n\t\t\t\tsfnapi := mock_sfn.NewMockSFNAPI(c)\n\t\t\t\ttestHandlerInputEvent, _ := json.Marshal(struct{}{})\n\t\t\t\tsfnapi.EXPECT().GetActivityTask(gomock.Any()).AnyTimes().Return(&sfn.GetActivityTaskOutput{\n\t\t\t\t\tInput: aws.String(string(testHandlerInputEvent)),\n\t\t\t\t\tTaskToken: aws.String(\"testToken\"),\n\t\t\t\t}, nil)\n\t\t\t\tsfnapi.EXPECT().SendTaskSuccess(gomock.Any()).AnyTimes().Return(nil, nil)\n\t\t\t\tsfnapi.EXPECT().SendTaskHeartbeat(gomock.Any()).AnyTimes().Return(nil, errors.New(\"testerror\"))\n\t\t\t\thandler := func(interface{}, struct{}) (interface{}, error) {\n\t\t\t\t\t// wait for a bit to allow a heartbeat to occur.\n\t\t\t\t\ttime.Sleep(10 * heartbeatFrequency)\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\t\t\t\treturn sfnapi, handler\n\t\t\t},\n\t\t},\n\t}\n\n\tfor testName, tc := range testCases {\n\t\tlog.Printf(\"Starting test case: %v\", testName)\n\t\tcontroller := gomock.NewController(t)\n\t\tdefer controller.Finish()\n\t\tdefer func() {\n\t\t\tt.Logf(\"Failed test case: %v\", testName)\n\t\t}()\n\n\t\tsfnapi, handler := tc.BuildTestCase(controller)\n\n\t\ttask := pollable.NewTask(handler, \"arn\", \"workername\", heartbeatFrequency, sfnapi)\n\n\t\tctx := cancellablecontext.New(context.Background())\n\t\ttask.Start(ctx)\n\t\t<-task.Started()\n\n\t\t// pause for a moment to give the poller a chance to register a call.\n\t\ttime.Sleep(250 * time.Millisecond)\n\n\t\t<-task.Done()\n\t\t<-ctx.Done()\n\t}\n}", "title": "" }, { "docid": "931a0275327841a7b2070cac80897d8b", "score": "0.51875997", "text": "func TestRunnerErr(t *testing.T) {\n\tfuncs := []runner.Runnable{goFunc(0, true), goFunc(1, true), goFunc(2, false)}\n\trun := runner.New(funcs)\n\n\terr := run.Start()\n\tif err != nil {\n\t\tt.Error(\"Failed to start: \", err)\n\t}\n\n\ttime.Sleep(time.Second)\n\n\trun.Stop()\n\n\terr = run.Start()\n\tif err == nil {\n\t\tt.Error(\"Should fail to start.\")\n\t}\n\ttime.Sleep(time.Second)\n\n\trun.Stop()\n}", "title": "" }, { "docid": "244d0f38e5c5043eae1aff32abc54263", "score": "0.5175709", "text": "func Test_postWorkflowRunAsyncFailedHandler(t *testing.T) {\n\tapi, db, router := newTestAPI(t)\n\n\tu, pass := assets.InsertAdminUser(t, db)\n\tkey := sdk.RandomString(10)\n\tproj := assets.InsertTestProject(t, db, api.Cache, key, key)\n\n\tvcsServer := sdk.ProjectVCSServerLink{\n\t\tProjectID: proj.ID,\n\t\tName: \"github\",\n\t}\n\tvcsServer.Set(\"token\", \"foo\")\n\tvcsServer.Set(\"secret\", \"bar\")\n\trequire.NoError(t, repositoriesmanager.InsertProjectVCSServerLink(context.TODO(), db, &vcsServer))\n\n\t//First pipeline\n\tpip := sdk.Pipeline{\n\t\tProjectID: proj.ID,\n\t\tProjectKey: proj.Key,\n\t\tName: \"pip1\",\n\t}\n\trequire.NoError(t, pipeline.InsertPipeline(api.mustDB(), &pip))\n\n\t// Create Application\n\tapp := sdk.Application{\n\t\tName: sdk.RandomString(10),\n\t\tProjectID: proj.ID,\n\t\tRepositoryFullname: \"foo/myrepo\",\n\t\tVCSServer: \"github\",\n\t\tRepositoryStrategy: sdk.RepositoryStrategy{\n\t\t\tConnectionType: \"ssh\",\n\t\t},\n\t}\n\trequire.NoError(t, application.Insert(db, *proj, &app))\n\trequire.NoError(t, repositoriesmanager.InsertForApplication(db, &app))\n\n\tw := sdk.Workflow{\n\t\tName: \"test_1\",\n\t\tProjectID: proj.ID,\n\t\tProjectKey: proj.Key,\n\t\tWorkflowData: sdk.WorkflowData{\n\t\t\tNode: sdk.Node{\n\t\t\t\tName: \"root\",\n\t\t\t\tType: sdk.NodeTypePipeline,\n\t\t\t\tContext: &sdk.NodeContext{\n\t\t\t\t\tPipelineID: pip.ID,\n\t\t\t\t\tApplicationID: app.ID,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tproj2, err := project.Load(context.TODO(), api.mustDB(), proj.Key, project.LoadOptions.WithApplications, project.LoadOptions.WithPipelines, project.LoadOptions.WithGroups, project.LoadOptions.WithIntegrations)\n\trequire.NoError(t, err)\n\n\trequire.NoError(t, workflow.Insert(context.TODO(), db, api.Cache, *proj2, &w))\n\tw1, err := workflow.Load(context.TODO(), api.mustDB(), api.Cache, *proj, \"test_1\", workflow.LoadOptions{})\n\trequire.NoError(t, err)\n\n\tallSrv, err := services.LoadAll(context.TODO(), db)\n\trequire.NoError(t, err)\n\tfor _, s := range allSrv {\n\t\tif err := services.Delete(db, &s); err != nil {\n\t\t\tt.Fatalf(\"unable to delete service: %v\", err)\n\t\t}\n\t}\n\n\t// Prepare service mocks\n\tmockVCSSservice, _ := assets.InsertService(t, db, t.Name()+\"_VCS\", sdk.TypeVCS)\n\tdefer func() { _ = services.Delete(db, mockVCSSservice) }()\n\tmockRepoService, _ := assets.InsertService(t, db, t.Name()+\"_REPOSITORIES\", sdk.TypeRepositories)\n\tdefer func() { _ = services.Delete(db, mockRepoService) }()\n\tmockHookService, _ := assets.InsertService(t, db, t.Name()+\"_HOOKS\", sdk.TypeHooks)\n\tdefer func() { _ = services.Delete(db, mockHookService) }()\n\n\t//This is a mock for the repositories service\n\tservices.HTTPClient = mock(\n\t\tfunc(r *http.Request) (*http.Response, error) {\n\t\t\tt.Logf(\"[MOCK] %s %v\", r.Method, r.URL)\n\t\t\tbody := new(bytes.Buffer)\n\t\t\tw := new(http.Response)\n\t\t\tenc := json.NewEncoder(body)\n\t\t\tw.Body = io.NopCloser(body)\n\n\t\t\tswitch r.URL.String() {\n\t\t\tcase \"/operations/123\":\n\t\t\t\tope := sdk.Operation{\n\t\t\t\t\tUUID: \"123\",\n\t\t\t\t\tStatus: sdk.OperationStatusDone,\n\t\t\t\t}\n\t\t\t\tif err := enc.Encode(ope); err != nil {\n\t\t\t\t\treturn writeError(w, err)\n\t\t\t\t}\n\t\t\tcase \"/vcs/github/webhooks\":\n\t\t\t\tres := struct {\n\t\t\t\t\tWebhooksSupported bool `json:\"webhooks_supported\"`\n\t\t\t\t\tWebhooksDisabled bool `json:\"webhooks_disabled\"`\n\t\t\t\t\tWebhooksIcon string `json:\"webhooks_icon\"`\n\t\t\t\t}{\n\t\t\t\t\tWebhooksDisabled: false,\n\t\t\t\t\tWebhooksIcon: \"\",\n\t\t\t\t\tWebhooksSupported: true,\n\t\t\t\t}\n\t\t\t\tif err := enc.Encode(res); err != nil {\n\t\t\t\t\treturn writeError(w, err)\n\t\t\t\t}\n\t\t\tcase \"/vcs/github/repos/foo/myrepo\":\n\t\t\t\tr := sdk.VCSRepo{\n\t\t\t\t\tSSHCloneURL: \"ssh:/cloneurl\",\n\t\t\t\t\tHTTPCloneURL: \"http:/cloneurl\",\n\t\t\t\t}\n\t\t\t\tif err := enc.Encode(r); err != nil {\n\t\t\t\t\treturn writeError(w, err)\n\t\t\t\t}\n\t\t\tcase \"/vcs/github/repos/foo/myrepo/hooks\":\n\t\t\t\th := sdk.VCSHook{}\n\t\t\t\th.Name = \"hook\"\n\t\t\t\tif err := enc.Encode(h); err != nil {\n\t\t\t\t\treturn writeError(w, err)\n\t\t\t\t}\n\t\t\tcase \"/vcs/github/repos/foo/myrepo/pullrequests?state=open\":\n\t\t\t\tvcsPRs := []sdk.VCSPullRequest{}\n\t\t\t\tif err := enc.Encode(vcsPRs); err != nil {\n\t\t\t\t\treturn writeError(w, err)\n\t\t\t\t}\n\t\t\tcase \"/vcs/github/repos/foo/myrepo/pullrequests\":\n\t\t\t\tpr := sdk.VCSPullRequest{\n\t\t\t\t\tTitle: \"blabla\",\n\t\t\t\t\tURL: \"myurl\",\n\t\t\t\t\tID: 1,\n\t\t\t\t}\n\t\t\t\tif err := enc.Encode(pr); err != nil {\n\t\t\t\t\treturn writeError(w, err)\n\t\t\t\t}\n\t\t\tcase \"/vcs/github/repos/foo/myrepo/pullrequests/1\":\n\t\t\t\treturn writeError(w, fmt.Errorf(\"error for test\"))\n\t\t\tcase \"/task/bulk\":\n\t\t\t\thooks := map[string]sdk.NodeHook{}\n\t\t\t\thooks[\"123\"] = sdk.NodeHook{\n\t\t\t\t\tUUID: \"123\",\n\t\t\t\t}\n\t\t\t\tfor k, h := range hooks {\n\t\t\t\t\tif h.HookModelName == sdk.RepositoryWebHookModelName {\n\t\t\t\t\t\tcfg := hooks[k].Config\n\t\t\t\t\t\tcfg[\"webHookURL\"] = sdk.WorkflowNodeHookConfigValue{\n\t\t\t\t\t\t\tValue: \"http://lolcat.local\",\n\t\t\t\t\t\t\tConfigurable: false,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err := enc.Encode(hooks); err != nil {\n\t\t\t\t\treturn writeError(w, err)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn writeError(w, sdk.NewError(sdk.ErrServiceUnavailable,\n\t\t\t\t\tfmt.Errorf(\"route %s must not be called\", r.URL.String()),\n\t\t\t\t))\n\t\t\t}\n\t\t\treturn w, nil\n\t\t},\n\t)\n\n\t// Migrate as code\n\tope := sdk.Operation{\n\t\tUUID: \"123\",\n\t\tSetup: sdk.OperationSetup{\n\t\t\tPush: sdk.OperationPush{\n\t\t\t\tUpdate: false,\n\t\t\t},\n\t\t},\n\t}\n\ted := ascode.EntityData{\n\t\tFromRepo: \"ssh://cloneurl\",\n\t\tName: w1.Name,\n\t\tID: w1.ID,\n\t\tType: ascode.WorkflowEvent,\n\t\tOperationUUID: ope.UUID,\n\t}\n\n\tascode.UpdateAsCodeResult(context.TODO(), api.mustDB(), api.Cache, sdk.NewGoRoutines(context.TODO()), *proj, *w1, app, ed, u)\n\n\t// Prepare request\n\turi := router.GetRoute(\"POST\", api.postWorkflowRunHandler, map[string]string{\n\t\t\"key\": proj.Key,\n\t\t\"permWorkflowNameAdvanced\": w1.Name,\n\t})\n\treq := assets.NewAuthentifiedRequest(t, u, pass, \"POST\", uri, &sdk.WorkflowRunPostHandlerOption{})\n\trec := httptest.NewRecorder()\n\trouter.Mux.ServeHTTP(rec, req)\n\trequire.Equal(t, 202, rec.Code)\n\n\tlastRun, err := workflow.LoadLastRun(context.Background(), api.mustDB(), proj.Key, w.Name, workflow.LoadRunOptions{})\n\ttest.NoError(t, err)\n\twaitCraftinWorkflow(t, api, db, lastRun.ID)\n\n\tcpt := 0\n\tfor {\n\t\tt.Logf(\"Attempt getWorkflowRunHandler #%d\", cpt)\n\t\tvarsGet := map[string]string{\n\t\t\t\"key\": proj.Key,\n\t\t\t\"permWorkflowNameAdvanced\": w1.Name,\n\t\t\t\"number\": \"1\",\n\t\t}\n\t\turiGet := router.GetRoute(\"GET\", api.getWorkflowRunHandler, varsGet)\n\t\treqGet := assets.NewAuthentifiedRequest(t, u, pass, \"GET\", uriGet, nil)\n\t\trecGet := httptest.NewRecorder()\n\t\trouter.Mux.ServeHTTP(recGet, reqGet)\n\t\trequire.Equal(t, 200, recGet.Code)\n\t\tvar wrGet sdk.WorkflowRun\n\t\trecGetBody := recGet.Body.Bytes()\n\t\trequire.NoError(t, json.Unmarshal(recGetBody, &wrGet))\n\n\t\tif sdk.StatusIsTerminated(wrGet.Status) {\n\t\t\tassert.Equal(t, sdk.StatusFail, wrGet.Status)\n\t\t\tassert.Equal(t, 1, len(wrGet.Infos))\n\t\t\tif len(wrGet.Infos) == 1 {\n\t\t\t\tassert.Equal(t, wrGet.Infos[0].Message.ID, sdk.MsgWorkflowError.ID)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tcpt++\n\t\tif cpt > 10 {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(time.Second)\n\t}\n\n\tt.FailNow()\n}", "title": "" }, { "docid": "101f9ce8128534608f24f30ecedce163", "score": "0.51724404", "text": "func TestThrotteSignalsOnceInterceptor() fsm.DecisionInterceptor {\n\tthrottledSignals := make(map[string]*fsm.SignalInfo)\n\treturn &fsm.FuncInterceptor{\n\t\tBeforeDecisionFn: func(decision *swf.PollForDecisionTaskOutput, ctx *fsm.FSMContext, outcome *fsm.Outcome) {\n\t\t\tfor _, h := range decision.Events {\n\t\t\t\tif *h.EventId <= *decision.PreviousStartedEventId {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif *h.EventType == swf.EventTypeSignalExternalWorkflowExecutionFailed {\n\t\t\t\t\tif info, found := throttledSignals[*h.SignalExternalWorkflowExecutionFailedEventAttributes.WorkflowId]; found {\n\t\t\t\t\t\th.SignalExternalWorkflowExecutionFailedEventAttributes.WorkflowId = &info.WorkflowId\n\t\t\t\t\t\t//rewrite workflow not found to throttling.\n\t\t\t\t\t\th.SignalExternalWorkflowExecutionFailedEventAttributes.Cause = S(swf.SignalExternalWorkflowExecutionFailedCauseSignalExternalWorkflowExecutionRateExceeded)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t},\n\t\tAfterDecisionFn: func(decision *swf.PollForDecisionTaskOutput, ctx *fsm.FSMContext, outcome *fsm.Outcome) {\n\t\t\tfor _, d := range outcome.Decisions {\n\t\t\t\tswitch *d.DecisionType {\n\t\t\t\tcase swf.DecisionTypeSignalExternalWorkflowExecution:\n\t\t\t\t\tsignalWF := *d.SignalExternalWorkflowExecutionDecisionAttributes.WorkflowId\n\t\t\t\t\tsignalName := *d.SignalExternalWorkflowExecutionDecisionAttributes.SignalName\n\t\t\t\t\tthrottle := fmt.Sprintf(\"fail-on-purpose-%s-%s\", signalWF, signalName)\n\t\t\t\t\tif _, found := throttledSignals[throttle]; !found {\n\t\t\t\t\t\t//if we havent failed the signal yet, add it and swap the workflow id so it will fail\n\t\t\t\t\t\tthrottledSignals[throttle] = &fsm.SignalInfo{WorkflowId: signalWF, SignalName: signalName}\n\t\t\t\t\t\td.SignalExternalWorkflowExecutionDecisionAttributes.WorkflowId = S(throttle)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//we are retrying after the forced failure, remove it\n\t\t\t\t\t\tdelete(throttledSignals, throttle)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t},\n\t}\n}", "title": "" }, { "docid": "cfc1062864107e6f118cc35b9eabce9c", "score": "0.50942546", "text": "func (c *fakeController) runTests(t *testing.T, requests []request) {\n\tfor i, x := range requests {\n\t\tmethod := http.MethodGet\n\t\tif x.Method != \"\" {\n\t\t\tmethod = x.Method\n\t\t}\n\n\t\tbody := bytes.NewBuffer([]byte{})\n\t\tif x.AdmissionReview != nil {\n\t\t\tencoded, err := json.Marshal(x.AdmissionReview)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.NotEmpty(t, encoded)\n\t\t\tbody.Write(encoded)\n\t\t}\n\n\t\treq, err := http.NewRequest(method, c.server.URL+x.URI, body)\n\t\trequire.NoError(t, err, \"case %d should not have thrown error: %s\", i, err)\n\t\trequire.NotNil(t, req, \"case %d response should not be nil\", i)\n\t\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\t\tresp, err := http.DefaultClient.Do(req)\n\t\trequire.NoError(t, err, \"case %d should not have thrown error: %s\", i, err)\n\t\trequire.NotNil(t, resp, \"case %d response should not be nil\", i)\n\t\tcontent, err := ioutil.ReadAll(resp.Body)\n\t\trequire.NoError(t, err, \"case %d unable to read content, error: %s\", i, err)\n\n\t\tif x.ExpectedCode != 0 {\n\t\t\tassert.Equal(t, x.ExpectedCode, resp.StatusCode, \"case %d, expected: %d, got: %d\", i, x.ExpectedCode, resp.StatusCode)\n\t\t}\n\t\tif x.ExpectedContent != \"\" {\n\t\t\tassert.Equal(t, x.ExpectedContent, string(content), \"case %d, expected: %s, got: %s\", i, x.ExpectedContent, string(content))\n\t\t}\n\t\tif x.ExpectedStatus != nil {\n\t\t\tstatus := &admission.AdmissionReview{}\n\t\t\tif err := json.Unmarshal(content, status); err != nil {\n\t\t\t\tt.Errorf(\"case %d, unable to decode responce, error: %s\", i, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tassert.Equal(t, *x.ExpectedStatus, status.Status)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5a3559e30d56cda7e94072c04dd92d4d", "score": "0.50871015", "text": "func (c *APITestCase) Run() string {\n\tLogger.Printf(\"Test case [%s] START...\", c.CaseName)\n\tif c.TargetStatusCode != 0 {\n\t\tLogger.Printf(\"Expect response http code : [%d]\", c.TargetStatusCode)\n\t}\n\tif c.TargetBody != nil && c.TargetBody != \"\" {\n\t\tbodyStr, err := json.MarshalIndent(c.TargetBody, \"\", \"\\t\")\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tLogger.Printf(\"Expect response http body : \\n%s\\n\", bodyStr)\n\t}\n\tLogger.SetFlags(0)\n\tLogger.Printf(\"----->SEND : %s\", c.Req.ToString())\n\tstartTime := time.Now()\n\tstatusCode, body, err := c.Req.Invoke()\n\tduration := time.Since(startTime)\n\tLogger.Printf(\"----->RECEIVE %d in %d ms : \", statusCode, duration.Nanoseconds()/1e6)\n\tif body != nil && len(body) > 0 {\n\t\tLogger.Printf(\"%s\\n\", string(body))\n\t}\n\tLogger.SetFlags(log.LstdFlags | log.Lshortfile)\n\tif err != nil {\n\t\tif !c.AllowFail {\n\t\t\tLogger.Printf(\"Test case [%s] FAILED !!!\", c.CaseName)\n\t\t\tLogger.Println(\"allowFail = false,exit\")\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tLogger.Printf(\"Expect [%d] and Get [%d]\", c.TargetStatusCode, statusCode)\n\tif c.TargetStatusCode != 0 && statusCode != c.TargetStatusCode {\n\t\tFailCases = append(FailCases, c.CaseName)\n\t\tif statusCode == 0 {\n\t\t\tlog.Printf(\"Case [%-40s] TIMEOUT !!!\", c.CaseName)\n\t\t\tLogger.Printf(\"Test case [%s] TIMEOUT !!!\", c.CaseName)\n\t\t} else {\n\t\t\tlog.Printf(\"Case [%-40s] FAILED !!!\", c.CaseName)\n\t\t\tLogger.Printf(\"Test case [%s] FAILED !!!\", c.CaseName)\n\t\t}\n\t\tif !c.AllowFail {\n\t\t\tlog.Println(\"AllowFail = false,exit\")\n\t\t\tLogger.Println(\"allowFail = false,exit\")\n\t\t\tpanic(string(body))\n\t\t}\n\t} else {\n\t\tlog.Printf(\"Case [%-40s] SUCCESS\", c.CaseName)\n\t\tLogger.Printf(\"Test case [%s] SUCCESS\", c.CaseName)\n\t}\n\tLogger.Println(\"==================================================\")\n\treturn string(body)\n}", "title": "" }, { "docid": "b55cb973a144eda1e2e8559633a916a6", "score": "0.5060661", "text": "func AssertConcurrent(t *testing.T, fn func() error, amount int) {\n\teg := errgroup.Group{}\n\tfor i := 0; i < amount; i++ {\n\t\teg.Go(fn)\n\t}\n\terr := eg.Wait()\n\tassert.NoError(t, err)\n}", "title": "" }, { "docid": "6af599e77c6937198e0144d24b441896", "score": "0.50208646", "text": "func runAllAfterFail(cs *scope, testName string) {\n\tif _, ok := afterFailedStatus[testName]; ok {\n\t\t// AfterFailcalls are already executed in the children\n\t\treturn\n\t}\n\n\tif testFailed(testName) && len(cs.afterFail) > 0 {\n\t\tGinkgoPrint(\"===================== TEST FAILED =====================\")\n\t\tfor _, body := range cs.afterFail {\n\t\t\tbody()\n\t\t}\n\t\tGinkgoPrint(\"===================== Exiting AfterFailed =====================\")\n\t}\n\n\tif cs.parent != nil {\n\t\trunAllAfterFail(cs.parent, testName)\n\t}\n}", "title": "" }, { "docid": "ca6b12e6565e5153e9c0a9cf5b36d32a", "score": "0.50192875", "text": "func TestInvoke_Case2(t *testing.T) {\n\tSmartContract := new(SmartContract)\n\tstub := shim.NewMockStub(\"SmartContract\", SmartContract)\n\n\tcheckInit(t, stub, [][]byte{[]byte(\"init\")})\n\tcheckInvoke(t, stub, [][]byte{[]byte(\"Create\"),\n\t\t[]byte(\"user01\"),\n\t\t[]byte(\"홍길동\")})\n\tcheckInvoke(t, stub, [][]byte{[]byte(\"Create\"),\n\t\t[]byte(\"user02\"),\n\t\t[]byte(\"유관순\")})\n\tcheckState(t, stub, \"user01\", \"홍길동\")\n\tcheckState(t, stub, \"user02\", \"유관순\")\n}", "title": "" }, { "docid": "aa616d001ee2a6064e7766bee5972f54", "score": "0.50168556", "text": "func TestHandlers_StateError(t *testing.T) {\n\th := NewHandlers(brokenApiMgr)\n\th.manager = mockApiManager.MockBrokenApiManager{}\n\trr := requestFixture(h.Application, \"GET\", \"/app?name=test\", nil)\n\tif rr.Code == http.StatusOK {\n\t\tt.Fatalf(\"Wrong status code: want %d but got %d\", rr.Code, http.StatusOK)\n\t}\n\n\th = NewHandlers(apiMgr)\n\th.manager = mockApiManager.MockApiManager{}\n\trr = requestFixture(h.Application, \"GET\", \"/app\", nil)\n\tif rr.Code == http.StatusOK {\n\t\tt.Fatalf(\"Wrong status code: want %d but got %d\", rr.Code, http.StatusOK)\n\t}\n}", "title": "" }, { "docid": "574ae920eacfdc4a4e3f1cd0f3e716f0", "score": "0.49916008", "text": "func (s *eventualSuccessSuite) TestEventuallySucceeds() {\n\tctx, cancel := context.WithTimeout(context.Background(), time.Second*10)\n\tdefer cancel()\n\n\tnumErrors := 0\n\tfor {\n\t\tselect {\n\t\tcase record := <-s.logs:\n\t\t\tmsg := strings.ToLower(record.msg)\n\t\t\tif strings.Contains(msg, \"error acquiring shard\") {\n\t\t\t\tnumErrors++\n\t\t\t\ttaggedAsRetryable := false\n\t\t\t\tfor _, tg := range record.tags {\n\t\t\t\t\tif tg == tag.IsRetryable(true) {\n\t\t\t\t\t\ttaggedAsRetryable = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ts.True(taggedAsRetryable, \"logged error should be tagged as retryable\")\n\t\t\t} else if strings.Contains(msg, \"acquired shard\") {\n\t\t\t\ts.Equal(1, numErrors, \"should succeed after one error\")\n\t\t\t\treturn\n\t\t\t} else if strings.Contains(msg, \"couldn't acquire shard\") {\n\t\t\t\ts.FailNow(\"should not fail to acquire shard\")\n\t\t\t}\n\t\tcase <-ctx.Done():\n\t\t\ts.FailNow(\"timed out waiting for retry\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b79a3a92c5a87f4941e2483337d59974", "score": "0.49887303", "text": "func (mr *MockRecorderServerMockRecorder) BatchCreateTestExonerations(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"BatchCreateTestExonerations\", reflect.TypeOf((*MockRecorderServer)(nil).BatchCreateTestExonerations), arg0, arg1)\n}", "title": "" }, { "docid": "4ccf5ca22985d41eb6b5dc74b5585fec", "score": "0.4987893", "text": "func TestGenerateTasks(t *testing.T) {\n\ttestCases := []GenerateTasksCase{\n\t\t{\n\t\t\tSuccessCount: 0,\n\t\t\tErrorCount: 0,\n\t\t},\n\t\t{\n\t\t\tSuccessCount: 1,\n\t\t\tErrorCount: 0,\n\t\t},\n\t\t{\n\t\t\tSuccessCount: 3,\n\t\t\tErrorCount: 0,\n\t\t},\n\t\t{\n\t\t\tSuccessCount: 0,\n\t\t\tErrorCount: 1,\n\t\t},\n\t\t{\n\t\t\tSuccessCount: 0,\n\t\t\tErrorCount: 5,\n\t\t},\n\t\t{\n\t\t\tSuccessCount: 1,\n\t\t\tErrorCount: 1,\n\t\t},\n\t\t{\n\t\t\tSuccessCount: 3,\n\t\t\tErrorCount: 5,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\ttasks := GenerateTasks(testCase.SuccessCount, testCase.ErrorCount)\n\t\tactualSuccessCount := 0\n\t\tactualErrorCount := 0\n\t\tfor _, task := range tasks {\n\t\t\tif task() != nil {\n\t\t\t\tactualErrorCount++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tactualSuccessCount++\n\t\t}\n\t\tassert.Equalf(t, testCase.SuccessCount, actualSuccessCount, \"Success counts are different\")\n\t\tassert.Equalf(t, testCase.ErrorCount, actualErrorCount, \"Error counts are different\")\n\t}\n\n}", "title": "" }, { "docid": "6d769ea06db04d91c638b2be0c4ef5ca", "score": "0.4984735", "text": "func TestSleepLoop(t *testing.T) {\n\t// Must be non-zero, but low to avoid slow tests.\n\tconst sleepInterval = 1 * time.Millisecond\n\n\tt.Run(\"CanceledBeforeStart\", func(t *testing.T) {\n\t\tctx, cancel := context.WithCancel(testlog.WithTB(context.Background(), t))\n\t\tcancel()\n\t\tncalls := 0\n\t\twant := errors.New(\"bork\")\n\t\tf := func() error {\n\t\t\tncalls++\n\t\t\treturn want\n\t\t}\n\t\tgot := Do(ctx, \"calling a function\", constBackoff(sleepInterval), f)\n\t\tif !errors.Is(got, want) {\n\t\t\tt.Errorf(\"Do = %v; want %v\", got, want)\n\t\t}\n\t\tif ncalls != 1 {\n\t\t\tt.Errorf(\"f called %d times; want 1 time\", ncalls)\n\t\t}\n\t})\n\n\tt.Run(\"CanceledDuringFirstRun\", func(t *testing.T) {\n\t\tctx, cancel := context.WithCancel(testlog.WithTB(context.Background(), t))\n\t\tncalls := 0\n\t\twant := errors.New(\"bork\")\n\t\tf := func() error {\n\t\t\tncalls++\n\t\t\tcancel()\n\t\t\treturn want\n\t\t}\n\t\tgot := Do(ctx, \"calling a function\", constBackoff(sleepInterval), f)\n\t\tif !errors.Is(got, want) {\n\t\t\tt.Errorf(\"Do = %v; want %v\", got, want)\n\t\t}\n\t\tif ncalls != 1 {\n\t\t\tt.Errorf(\"f called %d times; want 1 time\", ncalls)\n\t\t}\n\t})\n\n\tt.Run(\"CanceledDuringSecondRun\", func(t *testing.T) {\n\t\tctx, cancel := context.WithCancel(testlog.WithTB(context.Background(), t))\n\t\tncalls := 0\n\t\twant := errors.New(\"bork\")\n\t\tf := func() error {\n\t\t\tncalls++\n\t\t\tif ncalls >= 2 {\n\t\t\t\tcancel()\n\t\t\t}\n\t\t\treturn want\n\t\t}\n\t\tgot := Do(ctx, \"calling a function\", constBackoff(sleepInterval), f)\n\t\tif !errors.Is(got, want) {\n\t\t\tt.Errorf(\"Do = %v; want %v\", got, want)\n\t\t}\n\t\tif ncalls != 2 {\n\t\t\tt.Errorf(\"f called %d times; want 2 times\", ncalls)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "40940295d5d91a186d1aee4d1fb6f521", "score": "0.49767372", "text": "func (mock *ISequenceAbortedHookMock) OnSequenceAbortedCalls() []struct {\n\tEvent scmodels.EventScope\n} {\n\tvar calls []struct {\n\t\tEvent scmodels.EventScope\n\t}\n\tmock.lockOnSequenceAborted.RLock()\n\tcalls = mock.calls.OnSequenceAborted\n\tmock.lockOnSequenceAborted.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "57ded20392e489a2f01ea3b104c9cf4d", "score": "0.49722055", "text": "func TestTriggerSequence(t *testing.T) {\n\n\tcredentialmanager.MockAuthCreds = true\n\n\treceivedEvent := make(chan bool)\n\tts := httptest.NewServer(\n\t\thttp.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tw.Header().Add(\"Content-Type\", \"application/json\")\n\t\t\tw.WriteHeader(200)\n\t\t\tif strings.Contains(r.RequestURI, \"v1/event\") {\n\t\t\t\tdefer r.Body.Close()\n\t\t\t\tbytes, err := ioutil.ReadAll(r.Body)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"could not read received event payload: %s\", err.Error())\n\t\t\t\t}\n\t\t\t\tevent := &apimodels.KeptnContextExtendedCE{}\n\t\t\t\tif err := json.Unmarshal(bytes, event); err != nil {\n\t\t\t\t\tt.Errorf(\"could not decode received event: %s\", err.Error())\n\t\t\t\t}\n\t\t\t\tif *event.Type != keptnv2.GetTriggeredEventType(\"dev.hello\") {\n\t\t\t\t\tt.Errorf(\"did not receive correct event: %s\", err.Error())\n\t\t\t\t}\n\t\t\t\tgo func() {\n\t\t\t\t\treceivedEvent <- true\n\t\t\t\t}()\n\t\t\t} else if strings.Contains(r.RequestURI, \"/v1/metadata\") {\n\t\t\t\tdefer r.Body.Close()\n\t\t\t\tw.Write([]byte(metadataMockResponse))\n\t\t\t\treturn\n\t\t\t} else if strings.Contains(r.RequestURI, \"service\") {\n\t\t\t\tres := fmt.Sprintf(getSvcMockResponseSequence, \"demo\")\n\t\t\t\tw.Write([]byte(res))\n\t\t\t\treturn\n\t\t\t} else if strings.Contains(r.RequestURI, \"/controlPlane/v1/project/\") {\n\t\t\t\tres := fmt.Sprintf(getProjectMockResponseSequence, \"hello-world\", \"demo\", \"dev\")\n\t\t\t\tw.Write([]byte(res))\n\t\t\t\treturn\n\t\t\t}\n\t\t}),\n\t)\n\tdefer ts.Close()\n\n\tt.Setenv(\"MOCK_SERVER\", ts.URL)\n\n\tcmd := fmt.Sprintf(\"trigger sequence %s --project=%s --service=%s --stage=%s --labels=key1=value1,key2=value2 --mock\", \"hello\", \"hello-world\", \"demo\", \"dev\")\n\t_, err := executeActionCommandC(cmd)\n\n\tif err != nil {\n\t\tt.Errorf(unexpectedErrMsg, err)\n\t}\n\n\tselect {\n\tcase <-receivedEvent:\n\t\tt.Log(\"event has been sent successfully\")\n\t\tbreak\n\tcase <-time.After(5 * time.Second):\n\t\tt.Error(\"event was not sent\")\n\t}\n}", "title": "" }, { "docid": "f759c5c838622b155ff928dc5013bd63", "score": "0.4957353", "text": "func TestResyncErr3(t *testing.T) {\n\t// Setup\n\tctx, connection, plugin := aclTestSetup(t, false)\n\tdefer aclTestTeardown(connection, plugin)\n\n\tctx.MockReplies([]*vppcallmock.HandleReplies{\n\t\t{\n\t\t\tName: (&acl_api.ACLDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.ACLDetails{\n\t\t\t\tACLIndex: 0,\n\t\t\t\tTag: []byte(\"acl3\"),\n\t\t\t\tCount: 1,\n\t\t\t\tR: []acl_api.ACLRule{{IsPermit: 1}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.ACLInterfaceListDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.ACLInterfaceListDetails{\n\t\t\t\tSwIfIndex: 1,\n\t\t\t\tCount: 2,\n\t\t\t\tNInput: 1,\n\t\t\t\tAcls: []uint32{0, 2},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.MacipACLDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.MacipACLDetails{\n\t\t\t\tACLIndex: 0,\n\t\t\t\tTag: []byte(\"acl4\"),\n\t\t\t\tCount: 2,\n\t\t\t\tR: []acl_api.MacipACLRule{{IsPermit: 0}, {IsPermit: 2}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.MacipACLInterfaceListDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.MacipACLInterfaceListDetails{\n\t\t\t\tSwIfIndex: 1,\n\t\t\t\tCount: 1,\n\t\t\t\tAcls: []uint32{1},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.ACLDel{}).GetMessageName(),\n\t\t\tPing: false,\n\t\t\tMessage: &acl_api.ACLDelReply{},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.MacipACLDel{}).GetMessageName(),\n\t\t\tPing: false,\n\t\t\tMessage: &acl_api.MacipACLDelReply{},\n\t\t},\n\t\t// wrong msg\n\t\t{\n\t\t\tName: (&acl_api.ACLAddReplace{}).GetMessageName(),\n\t\t\tPing: false,\n\t\t\tMessage: &acl_api.MacipACLAddReplaceReply{},\n\t\t},\n\t})\n\n\terr := plugin.Resync(acls)\n\tExpect(err).To(Not(BeNil()))\n\n\t// old acls have been removed, but no new added - wrong msg during configure\n\tExpect(plugin.GetL3L4AclIfIndexes().GetMapping().ListNames()).To(HaveLen(0))\n\tExpect(plugin.GetL2AclIfIndexes().GetMapping().ListNames()).To(HaveLen(0))\n}", "title": "" }, { "docid": "718ce1567b599b471532b2d5512d2db2", "score": "0.49536735", "text": "func (_m *Store) MarkSystemRanUnitTests() {\n\t_m.Called()\n}", "title": "" }, { "docid": "a955883581358ffa906f7a46e618eea4", "score": "0.49532664", "text": "func TestTraceAcrossRPCsLateForce(t *testing.T) {\n\tctx, shutdown, idp := initForTest(t)\n\tdefer shutdown()\n\n\trecord := runCallChain(t, ctx, idp, false, true)\n\n\texpectSequence(t, *record, []string{\n\t\t\": c0-end\",\n\t\t\"<rpc.Client>\\\"c1\\\".Run\",\n\t\t\"c1.Run: c1-end\",\n\t\t\"<rpc.Client>\\\"c2\\\".Run\",\n\t\t\"c2.Run: c2-begin, c2-end\",\n\t})\n}", "title": "" }, { "docid": "03acfe4fd288303da6678ba856e3371d", "score": "0.49382165", "text": "func (v *Scenario) Run(handle *Handle) {\n\n\tdefer func() {\n\t\tif err := recover(); err != nil {\n\t\t\tv.Status = G2T_STATUS_FAIL\n\t\t\texception := err.(*Exception)\n\t\t\tfor _, step := range v.Steps[exception.Step.Id+1:] {\n\t\t\t\tstep.Skip()\n\t\t\t}\n\t\t}\n\t}()\n\n\thandle.Scenario = v\n\n\tlog.Infof(\" \")\n\tlog.Infof(\"----------------------------------------\")\n\tlog.Infof(\"%s.%s\", handle.Feature.Name, v.Name)\n\tlog.Infof(\"----------------------------------------\")\n\n\tfor _, step := range v.Steps {\n\t\tstep.Run(handle)\n\t}\n\tv.Status = G2T_STATUS_PASS\n}", "title": "" }, { "docid": "32896e153e3f3cad10ffeea0767d43cc", "score": "0.49254182", "text": "func TestFailureScenarios(t *testing.T) {\n\t// Create a new database to run tests against.\n\tdbPath := filepath.Join(os.TempDir(), \"ffldb-failurescenarios\")\n\t_ = os.RemoveAll(dbPath)\n\tidb, err := database.Create(dbType, dbPath, blockDataNet)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create test database (%s) %v\", dbType, err)\n\t\treturn\n\t}\n\tdefer os.RemoveAll(dbPath)\n\tdefer idb.Close()\n\n\t// Create a test context to pass around.\n\ttc := &testContext{\n\t\tt: t,\n\t\tdb: idb,\n\t\tfiles: make(map[uint32]*lockableFile),\n\t\tmaxFileSizes: make(map[uint32]int64),\n\t}\n\n\t// Change the maximum file size to a small value to force multiple flat\n\t// files with the test data set and replace the file-related functions\n\t// to make use of mock files in memory. This allows injection of\n\t// various file-related errors.\n\tstore := idb.(*db).store\n\tstore.maxBlockFileSize = 1024 // 1KiB\n\tstore.openWriteFileFunc = func(fileNum uint32) (filer, error) {\n\t\tif file, ok := tc.files[fileNum]; ok {\n\t\t\t// \"Reopen\" the file.\n\t\t\tfile.Lock()\n\t\t\tmock := file.file.(*mockFile)\n\t\t\tmock.Lock()\n\t\t\tmock.closed = false\n\t\t\tmock.Unlock()\n\t\t\tfile.Unlock()\n\t\t\treturn mock, nil\n\t\t}\n\n\t\t// Limit the max size of the mock file as specified in the test\n\t\t// context.\n\t\tmaxSize := int64(-1)\n\t\tif maxFileSize, ok := tc.maxFileSizes[fileNum]; ok {\n\t\t\tmaxSize = maxFileSize\n\t\t}\n\t\tfile := &mockFile{maxSize: maxSize}\n\t\ttc.files[fileNum] = &lockableFile{file: file}\n\t\treturn file, nil\n\t}\n\tstore.openFileFunc = func(fileNum uint32) (*lockableFile, error) {\n\t\t// Force error when trying to open max file num.\n\t\tif fileNum == ^uint32(0) {\n\t\t\treturn nil, makeDbErr(database.ErrDriverSpecific,\n\t\t\t\t\"test\", nil)\n\t\t}\n\t\tif file, ok := tc.files[fileNum]; ok {\n\t\t\t// \"Reopen\" the file.\n\t\t\tfile.Lock()\n\t\t\tmock := file.file.(*mockFile)\n\t\t\tmock.Lock()\n\t\t\tmock.closed = false\n\t\t\tmock.Unlock()\n\t\t\tfile.Unlock()\n\t\t\treturn file, nil\n\t\t}\n\t\tfile := &lockableFile{file: &mockFile{}}\n\t\ttc.files[fileNum] = file\n\t\treturn file, nil\n\t}\n\tstore.deleteFileFunc = func(fileNum uint32) error {\n\t\tif file, ok := tc.files[fileNum]; ok {\n\t\t\tfile.Lock()\n\t\t\tfile.file.Close()\n\t\t\tfile.Unlock()\n\t\t\tdelete(tc.files, fileNum)\n\t\t\treturn nil\n\t\t}\n\n\t\tstr := fmt.Sprintf(\"file %d does not exist\", fileNum)\n\t\treturn makeDbErr(database.ErrDriverSpecific, str, nil)\n\t}\n\n\t// Load the test blocks and save in the test context for use throughout\n\t// the tests.\n\tblocks, err := loadBlocks(t, blockDataFile, blockDataNet)\n\tif err != nil {\n\t\tt.Errorf(\"loadBlocks: Unexpected error: %v\", err)\n\t\treturn\n\t}\n\ttc.blocks = blocks\n\n\t// Test various failures paths when writing to the block files.\n\tif !testWriteFailures(tc) {\n\t\treturn\n\t}\n\n\t// Test various file-related issues such as closed and missing files.\n\tif !testBlockFileErrors(tc) {\n\t\treturn\n\t}\n\n\t// Test various corruption scenarios.\n\ttestCorruption(tc)\n}", "title": "" }, { "docid": "809e549d6d5bb90017d69ffa10f94076", "score": "0.49096933", "text": "func TestOkPanics(t *testing.T) {\n\tfunc() { // errDidNotCallNewShell\n\t\tsh := gosh.Shell{}\n\t\tdefer func() { neq(t, recover(), nil) }()\n\t\tsh.Ok()\n\t}()\n\tfunc() { // errShellErrIsNotNil\n\t\tsh := gosh.NewShell(t)\n\t\tsh.ContinueOnError = true\n\t\tdefer sh.Cleanup()\n\t\tsh.Err = errFake\n\t\tdefer func() { neq(t, recover(), nil) }()\n\t\tsh.Ok()\n\t}()\n\tfunc() { // errAlreadyCalledCleanup\n\t\tsh := gosh.NewShell(t)\n\t\tsh.ContinueOnError = true\n\t\tsh.Cleanup()\n\t\tdefer func() { neq(t, recover(), nil) }()\n\t\tsh.Ok()\n\t}()\n}", "title": "" }, { "docid": "f605913c68defcb17e4d7bd4558cdc86", "score": "0.48973304", "text": "func TestFailOnceActivityInterceptor() activity.ActivityInterceptor {\n\tmutex := sync.Mutex{}\n\ttried := map[string]bool{}\n\treturn &activity.FuncInterceptor{\n\t\tAfterTaskFn: func(t *swf.PollForActivityTaskOutput, result interface{}, err error) (interface{}, error) {\n\t\t\tmutex.Lock()\n\t\t\tdefer mutex.Unlock()\n\n\t\t\tif err != nil || tried[*t.ActivityId] {\n\t\t\t\tLog.Printf(\"interceptor.test.fail-once at=passthrough activity-id=%q\", *t.ActivityId)\n\t\t\t\treturn result, err\n\t\t\t}\n\n\t\t\ttried[*t.ActivityId] = true\n\t\t\tmsg := fmt.Sprintf(\"interceptor.test.fail-once at=fail activity-id=%q\", *t.ActivityId)\n\t\t\tLog.Println(msg)\n\t\t\treturn nil, fmt.Errorf(msg)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "107326e1dc59452a128075a2333571c7", "score": "0.48899773", "text": "func RunTests(t logr.Logger, cfgData ConfigFile) {\n\tresources := createTestData(cfgData.Data)\n\tfor _, rs := range resources {\n\t\trs := rs\n\t\ttests := rs.Tests\n\t\ttestsKeys := sortedResources(tests)\n\n\t\tprompt := promptui.Select{\n\t\t\tLabel: fmt.Sprintf(\"quit, run or skip tests against: %v?\", rs.Host),\n\t\t\tItems: []string{\"Run\", \"Skip\", \"Quit\"},\n\t\t\tTemplates: customPromptTemplate(rs.Host),\n\t\t}\n\n\t\t_, resp, err := prompt.Run()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Prompt failed %v\\n\", err)\n\t\t\treturn\n\t\t}\n\t\tif resp == \"Skip\" {\n\t\t\tcontinue\n\t\t} else if resp == \"Quit\" {\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"========\", \"Start of tests against:\", rs.Host, \"========\")\n\t\tfor _, key := range testsKeys {\n\t\t\tkey := key\n\n\t\t\tstepName := tests[key]\n\t\t\tt.V(1).Info(\"debugging\", \"nextStep\", fmt.Sprintf(\"%v\", stepName))\n\t\t\tprompt := promptui.Select{\n\t\t\t\tLabel: fmt.Sprintf(\"quit, run or skip step: %v?\", key),\n\t\t\t\tItems: []string{\"Run\", \"Skip\", \"Quit\"},\n\t\t\t\tTemplates: customPromptTemplate(stepName.Want.Description),\n\t\t\t}\n\n\t\t\t_, resp, err := prompt.Run()\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"Prompt failed %v\\n\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif resp == \"Skip\" {\n\t\t\t\tcontinue\n\t\t\t} else if resp == \"Quit\" {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfmt.Printf(\"============ running test: %v ============\\n\", key)\n\t\t\twhatAmI := func(i interface{}) (*v1.StatusResponse, error) {\n\t\t\t\tvar got *v1.StatusResponse\n\t\t\t\tvar err error\n\t\t\t\tswitch act := i.(type) {\n\t\t\t\tcase v1.PowerAction:\n\t\t\t\t\tgot, err = runMachinePowerClient(rs, act, cfgData.Server)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\tcase v1.BootDevice:\n\t\t\t\t\tgot, err = runMachineBootDevClient(rs, act, cfgData.Server)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\tcase *v1.CreateUserRequest:\n\t\t\t\t\tgot, err = runBMCCreateUserClient(rs, act, cfgData.Server)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\tcase *v1.DeleteUserRequest:\n\t\t\t\t\tgot, err = runBMCDeleteUserClient(rs, act, cfgData.Server)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, fmt.Errorf(\"case not found for %T\", act)\n\t\t\t\t}\n\t\t\t\treturn got, nil\n\t\t\t}\n\t\t\tsuccessful := color.GreenString(\"PASS\")\n\t\t\tvar diff string\n\t\t\tgot, err := whatAmI(stepName.Action)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(err)\n\t\t\t\tsuccessful = color.RedString(\"FAIL\")\n\t\t\t\tgoto COMPLETE\n\t\t\t}\n\t\t\tif got == nil {\n\t\t\t\tlog.Printf(\"got nil: %v, expected: %v\", got, stepName.Want)\n\t\t\t\tsuccessful = color.RedString(\"FAIL\")\n\t\t\t\tgoto COMPLETE\n\t\t\t}\n\t\t\tgot.Result = strings.ToLower(got.Result)\n\t\t\tdiff = cmp.Diff(stepName.Want, got, cmpopts.IgnoreMapEntries(func(key, i interface{}) bool { return key == \"id\" }), protocmp.Transform())\n\t\t\tif diff != \"\" {\n\t\t\t\tlog.Println(diff)\n\t\t\t\tsuccessful = color.RedString(\"FAIL\")\n\t\t\t}\n\t\tCOMPLETE:\n\t\t\tfmt.Printf(\"============ %v: completed test: %v ============\\n\", successful, stepName.Want.Description)\n\t\t}\n\t\tfmt.Println()\n\t\tfmt.Println(\"========\", \"End of tests against:\", rs.Host, \"========\")\n\t}\n}", "title": "" }, { "docid": "b8994485a9b1cf715705b60a50f7d337", "score": "0.48868915", "text": "func fail() {\n\tfmt.Println(\"====== Integration tests failed ======\")\n\tos.Exit(0)\n}", "title": "" }, { "docid": "0ce04933924299c1b979798964181a48", "score": "0.48838884", "text": "func (fh *FailHttpImmediately) Execute() []error {\n for _, step := range fh.steps {\n err := step.Runner()\n if err != nil {\n fh.resp.WriteHeader(step.FailCode)\n fh.resp.Write(step.FailMsg(err))\n return []error{err}\n }\n }\n\n fh.resp.WriteHeader(fh.succCode)\n fh.resp.Write(fh.succMsg)\n return []error{}\n}", "title": "" }, { "docid": "00731cf9211ca634c85ad74aaf7c2edd", "score": "0.48789966", "text": "func TestIterativeStateSyncIndividual(t *testing.T) { testIterativeStateSync(t, 1) }", "title": "" }, { "docid": "41948c3f94dc64a5f6f1bb165d31bf21", "score": "0.487774", "text": "func TestNoLogError(t *testing.T) {\n\tstdout := &bytes.Buffer{}\n\tstderr := &bytes.Buffer{}\n\tintegration.ProgramTest(t, &integration.ProgramTestOptions{\n\t\tDir: filepath.Join(\"go\", \"go-exit-error\"),\n\t\tDependencies: []string{\n\t\t\t\"github.com/pulumi/pulumi/sdk/v3\",\n\t\t},\n\t\tStdout: stdout,\n\t\tStderr: stderr,\n\t\tQuick: true,\n\t\tExpectFailure: true,\n\t\tExtraRuntimeValidation: func(t *testing.T, stackInfo integration.RuntimeValidationStackInfo) {\n\t\t\terrorCount := strings.Count(stderr.String()+stdout.String(), \" error: \")\n\n\t\t\t// ensure ` error: ` is only being shown once by the program\n\t\t\tassert.Equal(t, 1, errorCount)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "5e40d77f11ca69dd782de17b97f956ef", "score": "0.48726213", "text": "func Test_fsmS_testAgent(t *testing.T) {\n\t// Forces the mocked agent to fail with HTTP 400 in the first call to lead fsm to retry once\n\tvar serverGaveErrorOnFirstCall bool\n\n\tserver := getTestServer(func(w http.ResponseWriter, r *http.Request) {\n\t\tif serverGaveErrorOnFirstCall {\n\t\t\tw.WriteHeader(http.StatusOK)\n\t\t} else {\n\t\t\tserverGaveErrorOnFirstCall = true\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t}\n\t})\n\n\tdefer server.Close()\n\n\tsurl := server.URL\n\tu, err := url.Parse(surl)\n\n\tassert.NoError(t, err)\n\n\tres := make(chan bool, 1)\n\n\tr := &fsmS{\n\t\tagentComm: newAgentCommunicator(u.Hostname(), u.Port(), &fromS{EntityID: \"12345\"}, defaultLogger),\n\t\tfsm: f.NewFSM(\n\t\t\t\"announced\",\n\t\t\tf.Events{\n\t\t\t\t{Name: eTest, Src: []string{\"announced\"}, Dst: \"ready\"},\n\t\t\t},\n\t\t\tf.Callbacks{\n\t\t\t\t\"ready\": func(_ context.Context, event *f.Event) {\n\t\t\t\t\tres <- true\n\t\t\t\t},\n\t\t\t}),\n\t\tretriesLeft: maximumRetries,\n\t\texpDelayFunc: func(retryNumber int) time.Duration {\n\t\t\treturn 0\n\t\t},\n\t\tlogger: defaultLogger,\n\t}\n\n\tr.testAgent(context.Background(), &f.Event{})\n\n\tassert.True(t, <-res)\n\t// after a successful request, retriesLeft is reset to maximumRetries\n\tassert.Equal(t, maximumRetries, r.retriesLeft)\n}", "title": "" }, { "docid": "9612eb6e70df703c85630a0879031837", "score": "0.48629028", "text": "func (m *MockAuthcodeRequestDAOService) CheckMultipleUserSubmissions(email string) (bool, error) {\n\tret := m.ctrl.Call(m, \"CheckMultipleUserSubmissions\", email)\n\tret0, _ := ret[0].(bool)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "e861ecf11ac0d69042a5e9d6db806adc", "score": "0.48572347", "text": "func TestSendCall(t *testing.T) {\n\tfakeAppState := newAppState()\n\tourVm := NewVM(fakeAppState, DefaultDynamicMemoryProvider, newParams(), Zero256, nil)\n\n\t// Create accounts\n\taccount1 := &Account{\n\t\tAddress: Int64ToWord256(100),\n\t}\n\taccount2 := &Account{\n\t\tAddress: Int64ToWord256(101),\n\t}\n\taccount3 := &Account{\n\t\tAddress: Int64ToWord256(102),\n\t}\n\n\t// account1 will call account2 which will trigger CALL opcode to account3\n\taddr := account3.Address.Postfix(20)\n\tcontractCode := callContractCode(addr)\n\n\t//----------------------------------------------\n\t// account2 has insufficient balance, should fail\n\t_, err := runVMWaitError(ourVm, account1, account2, addr, contractCode, 1000)\n\tassert.Error(t, err, \"Expected insufficient balance error\")\n\n\t//----------------------------------------------\n\t// give account2 sufficient balance, should pass\n\taccount2.Balance = 100000\n\t_, err = runVMWaitError(ourVm, account1, account2, addr, contractCode, 1000)\n\tassert.NoError(t, err, \"Should have sufficient balance\")\n\n\t//----------------------------------------------\n\t// insufficient gas, should fail\n\n\taccount2.Balance = 100000\n\t_, err = runVMWaitError(ourVm, account1, account2, addr, contractCode, 100)\n\tassert.Error(t, err, \"Expected insufficient gas error\")\n}", "title": "" }, { "docid": "4862f6bc082beb393abadb17952c2d90", "score": "0.48539883", "text": "func TestOneStep3(t *testing.T) {\n\tfor i := 1; i <= len(testOneRobot); i++ {\n\t\tlog := make(chan string)\n\t\tnMsg := make(chan int)\n\t\tgo logMon(log, nMsg, t)\n\t\tact := make(chan Action3)\n\t\trep := make(chan []Step3Robot)\n\t\tgo Room3(\n\t\t\tRect{Pos{1, 1}, Pos{2, 2}},\n\t\t\t[]Step3Robot{{\"Robbie\", testOneRobot[0].Step2Robot}},\n\t\t\tact, rep, log)\n\t\tscr := \"\"\n\t\tfor j := 1; j < i; j++ {\n\t\t\tscr += string(testOneRobot[j].cmd)\n\t\t}\n\t\tt.Logf(\"Script %q\", scr)\n\t\tgo StartRobot3(\"Robbie\", scr, act, log)\n\t\tpls := <-rep\n\t\tlastTest := testOneRobot[i-1]\n\t\tif len(pls) != 1 {\n\t\t\tt.Fatalf(\"Got report on %d robots, want 1.\", len(pls))\n\t\t}\n\t\tpl := pls[0]\n\t\tif pl.Name != \"Robbie\" {\n\t\t\tt.Fatalf(`Got report for robot %q, want report for \"Robbie\".`,\n\t\t\t\tpl.Name)\n\t\t}\n\t\tda := pl.Step2Robot\n\t\twant := lastTest.Step2Robot\n\t\tif da.Pos != want.Pos {\n\t\t\tt.Fatalf(\"Script %q, Pos = %v, want %v\", scr, da.Pos, want.Pos)\n\t\t}\n\t\tif da.Dir != want.Dir {\n\t\t\tt.Fatalf(\"Script %q, Dir = %v, want %v\", scr, da.Dir, want.Dir)\n\t\t}\n\t\tclose(log)\n\t\tif n := <-nMsg; n != lastTest.nMsg {\n\t\t\tt.Errorf(\"%d sim messages logged, want %d.\", n, lastTest.nMsg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "838ac33d5ac9fce6fc9b1e0e00c99cfd", "score": "0.48538357", "text": "func (a *Action) Fail(s ...interface{}) {\n\ta.fail()\n\ta.test.Fail(s...)\n}", "title": "" }, { "docid": "7fc324f8b125afa22c746a1f891025b6", "score": "0.48499745", "text": "func TestFileManyUnreliable(test *testing.T) {\n\tif onlyBenchmarks || !runOldTests {\n\t\treturn\n\t}\n\truntime.GOMAXPROCS(4)\n\n\tfmt.Printf(\"\\nTest: Many instances, unreliable RPC ...\")\n\n\tconst numServers = 3\n\tvar paxosServers []*Paxos = make([]*Paxos, numServers)\n\tvar paxosPorts []string = make([]string, numServers)\n\tdefer cleanup(paxosServers)\n\n\t// Make ports for servers\n\tfor i := 0; i < numServers; i++ {\n\t\tpaxosPorts[i] = makePort(\"manyUnreliable\", i)\n\t}\n\tfor i := 0; i < numServers; i++ {\n\t\tpaxosServers[i] = Make(paxosPorts, i, nil, false, \"\")\n\t\tpaxosServers[i].unreliable = true\n\t}\n\tfor i := 0; i < numServers; i++ {\n\t\tpaxosServers[i].Start(0, 0)\n\t}\n\n\tconst numInstances = 50\n\t// Start a bunch of sequences, but only 3 active at a time\n\tfor seq := 1; seq < numInstances; seq++ {\n\t\t// only 3 active instances, to limit the\n\t\t// number of file descriptors.\n\t\tfor seq >= 3 && numDecided(test, paxosServers, seq-3) < numServers {\n\t\t\ttime.Sleep(20 * time.Millisecond)\n\t\t}\n\t\tfor i := 0; i < numServers; i++ {\n\t\t\tpaxosServers[i].Start(seq, (seq*10)+i)\n\t\t}\n\t}\n\n\t// Wait for decisions\n\tfor {\n\t\tdone := true\n\t\tfor seq := 1; seq < numInstances; seq++ {\n\t\t\tif numDecided(test, paxosServers, seq) < numServers {\n\t\t\t\tdone = false\n\t\t\t}\n\t\t}\n\t\tif done {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(100 * time.Millisecond)\n\t}\n\n\tfmt.Printf(\"\\n\\tPassed\")\n}", "title": "" }, { "docid": "0a76955d8ab123bd735d5ce0d44c3e52", "score": "0.48475355", "text": "func TestRun(t *testing.T) {\n\tfor _, tc := range runTC {\n\t\tactualExitCode := run(tc.args)\n\t\tassert.Equal(t, tc.expExitCode, actualExitCode)\n\t}\n}", "title": "" }, { "docid": "e4e86e7961a28e3f3b11b9fbdfcc49f3", "score": "0.48366407", "text": "func (xs Cases) Run(t *testing.T) {\n\tfor _, x := range xs {\n\t\tt.Run(x.Name, func(t *testing.T) {\n\t\t\tctrl := gomock.NewController(t)\n\t\t\tdefer ctrl.Finish()\n\n\t\t\tc := MockClient{\n\t\t\t\tMockCompute: mockcompute.NewMockComputeClient(ctrl),\n\t\t\t\tMockAdmin: mockadmin.NewMockIamClient(ctrl),\n\t\t\t\tMockResourceManager: mockresourcemanager.NewMockResourceManagerClient(ctrl),\n\t\t\t\tMockRdb: mockrdb.NewMockRdbClient(ctrl),\n\t\t\t}\n\t\t\tx.Mock(&c)\n\n\t\t\tcmd := x.Cmd(x.Value, &c)\n\n\t\t\tvar stdout bytes.Buffer\n\t\t\tcmd.SetOut(&stdout)\n\n\t\t\tcmd.SetArgs(x.Args)\n\n\t\t\terr := cmd.Execute()\n\n\t\t\tx.Check(t, stdout.String(), err)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "7d2cbb3f169febf300662c4dad905423", "score": "0.48350576", "text": "func TestResyncErr1(t *testing.T) {\n\t// Setup\n\tctx, connection, plugin := aclTestSetup(t, false)\n\tdefer aclTestTeardown(connection, plugin)\n\n\tctx.MockReplies([]*vppcallmock.HandleReplies{\n\t\t{\n\t\t\tName: (&acl_api.ACLDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.ACLDetails{\n\t\t\t\tACLIndex: 0,\n\t\t\t\tTag: []byte(\"acl3\"),\n\t\t\t\tCount: 1,\n\t\t\t\tR: []acl_api.ACLRule{{IsPermit: 1}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.ACLInterfaceListDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.ACLInterfaceListDetails{\n\t\t\t\tSwIfIndex: 1,\n\t\t\t\tCount: 2,\n\t\t\t\tNInput: 1,\n\t\t\t\tAcls: []uint32{0, 2},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.MacipACLDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.MacipACLDetails{\n\t\t\t\tACLIndex: 0,\n\t\t\t\tTag: []byte(\"acl4\"),\n\t\t\t\tCount: 2,\n\t\t\t\tR: []acl_api.MacipACLRule{{IsPermit: 0}, {IsPermit: 2}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.MacipACLInterfaceListDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.MacipACLInterfaceListDetails{\n\t\t\t\tSwIfIndex: 1,\n\t\t\t\tCount: 1,\n\t\t\t\tAcls: []uint32{1},\n\t\t\t},\n\t\t},\n\t\t// wrong msg\n\t\t{\n\t\t\tName: (&acl_api.ACLDel{}).GetMessageName(),\n\t\t\tPing: false,\n\t\t\tMessage: &acl_api.MacipACLDelReply{},\n\t\t},\n\t})\n\n\tplugin.GetL3L4AclIfIndexes().RegisterName(\"acl3\", 1, nil)\n\tplugin.GetL2AclIfIndexes().RegisterName(\"acl4\", 1, nil)\n\n\terr := plugin.Resync(acls)\n\tExpect(err).ToNot(BeNil())\n\n\tExpect(plugin.GetL3L4AclIfIndexes().GetMapping().ListNames()).To(HaveLen(0))\n\tExpect(plugin.GetL2AclIfIndexes().GetMapping().ListNames()).To(HaveLen(0))\n\n\t// Old ACLs should be removed during resync\n\t_, _, found := plugin.GetL3L4AclIfIndexes().LookupIdx(\"acl3\")\n\tExpect(found).To(BeFalse())\n\t_, _, found = plugin.GetL2AclIfIndexes().LookupIdx(\"acl4\")\n\tExpect(found).To(BeFalse())\n}", "title": "" }, { "docid": "5cd664d900bd8ca605298292658b50cd", "score": "0.48329103", "text": "func TestResyncErr2(t *testing.T) {\n\t// Setup\n\tctx, connection, plugin := aclTestSetup(t, false)\n\tdefer aclTestTeardown(connection, plugin)\n\n\tctx.MockReplies([]*vppcallmock.HandleReplies{\n\t\t{\n\t\t\tName: (&acl_api.ACLDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.ACLDetails{\n\t\t\t\tACLIndex: 0,\n\t\t\t\tTag: []byte(\"acl3\"),\n\t\t\t\tCount: 1,\n\t\t\t\tR: []acl_api.ACLRule{{IsPermit: 1}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.ACLInterfaceListDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.ACLInterfaceListDetails{\n\t\t\t\tSwIfIndex: 1,\n\t\t\t\tCount: 2,\n\t\t\t\tNInput: 1,\n\t\t\t\tAcls: []uint32{0, 2},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.MacipACLDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.MacipACLDetails{\n\t\t\t\tACLIndex: 0,\n\t\t\t\tTag: []byte(\"acl4\"),\n\t\t\t\tCount: 2,\n\t\t\t\tR: []acl_api.MacipACLRule{{IsPermit: 0}, {IsPermit: 2}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.MacipACLInterfaceListDump{}).GetMessageName(),\n\t\t\tPing: true,\n\t\t\tMessage: &acl_api.MacipACLInterfaceListDetails{\n\t\t\t\tSwIfIndex: 1,\n\t\t\t\tCount: 1,\n\t\t\t\tAcls: []uint32{1},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: (&acl_api.ACLDel{}).GetMessageName(),\n\t\t\tPing: false,\n\t\t\tMessage: &acl_api.ACLDelReply{},\n\t\t},\n\t\t// wrong msg\n\t\t{\n\t\t\tName: (&acl_api.MacipACLDel{}).GetMessageName(),\n\t\t\tPing: false,\n\t\t\tMessage: &acl_api.ACLDelReply{},\n\t\t},\n\t})\n\n\tplugin.GetL3L4AclIfIndexes().RegisterName(\"acl3\", 1, nil)\n\tplugin.GetL2AclIfIndexes().RegisterName(\"acl4\", 1, nil)\n\n\terr := plugin.Resync(acls)\n\tExpect(err).ToNot(BeNil())\n\n\t// Both ACLs were removed\n\tExpect(plugin.GetL3L4AclIfIndexes().GetMapping().ListNames()).To(HaveLen(0))\n\tExpect(plugin.GetL2AclIfIndexes().GetMapping().ListNames()).To(HaveLen(0))\n\n\t// All old ACLs should be removed from mapping s\n\t_, _, found := plugin.GetL3L4AclIfIndexes().LookupIdx(\"acl3\")\n\tExpect(found).To(BeFalse())\n\t_, _, found = plugin.GetL2AclIfIndexes().LookupIdx(\"acl4\")\n\tExpect(found).To(BeFalse())\n}", "title": "" }, { "docid": "79daabedbf474ebea5ba910a56e8cb1a", "score": "0.4828403", "text": "func (g *Generator) Fail(msgs ...string) {\n\ts := strings.Join(msgs, \" \")\n\tlog.Print(\"graphqlc-gen-test: error:\", s)\n\tos.Exit(1)\n}", "title": "" }, { "docid": "261dc8aee85f702732195c210780716b", "score": "0.48234636", "text": "func TestInvokeInvalidFunction(t *testing.T) {\n\tlocalAddress := address1\n\tidentity := newMockIdentity()\n\tsProp, identityDeserializer := newMockSignedProposal(identity)\n\n\targs := [][]byte{}\n\tstub := newMockStub(identity, identityDeserializer, msp1, discovery.NetworkMember{Endpoint: localAddress})\n\tif res := stub.MockInvokeWithSignedProposal(\"txID\", args, sProp); res.Status == shim.OK {\n\t\tt.Fatal(\"mscc invoke expecting error for invalid number of args\")\n\t}\n\n\targs = [][]byte{[]byte(\"invalid\")}\n\tif res := stub.MockInvokeWithSignedProposal(\"txID\", args, sProp); res.Status == shim.OK {\n\t\tt.Fatal(\"mscc invoke expecting error for invalid function\")\n\t}\n}", "title": "" }, { "docid": "c1f55de4cf376e1d51f57f952248986b", "score": "0.48175186", "text": "func (scenTest *NonScenarioActionsTest) RunSubTest(stubber *testtools.AwsmStubber) {\n\tCallNonScenarioActions(*stubber.SdkConfig)\n}", "title": "" }, { "docid": "34fcee93f474ea979005f97945b11a4e", "score": "0.48154944", "text": "func testFailPrepare() {\n\tpt.n++\n\tpt.cmdNum++\n\n\t// Prepare Phase\n\tpArgs := paxosrpc.PrepareArgs{pt.n, pt.cmdNum}\n\tvar pReply paxosrpc.PrepareReply\n\n\tfor _, c := range pt.servers {\n\t\terr := c.Call(\"PaxosServer.Prepare\", &pArgs, &pReply)\n\n\t\tif err != nil {\n\t\t\tLOGE.Println(\"Failed To Connect to Servers\", err)\n\t\t\treturn\n\t\t}\n\n\t\tif pReply.Status != paxosrpc.OK {\n\t\t\tLOGE.Println(\"FAIL: Prepare should return OK\")\n\t\t\tfailCount++\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Retry Prepare Phase\n\tpArgs.N--\n\tfor _, c := range pt.servers {\n\t\terr := c.Call(\"PaxosServer.Prepare\", &pArgs, &pReply)\n\n\t\tif err != nil {\n\t\t\tLOGE.Println(\"Failed To Connect to Servers\", err)\n\t\t\treturn\n\t\t}\n\n\t\tif pReply.Status == paxosrpc.OK {\n\t\t\tLOGE.Println(\"FAIL: Prepare should return Reject\")\n\t\t\tfailCount++\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"PASS\")\n\tpassCount++\n}", "title": "" }, { "docid": "d28f040e8c5d1fcafa8f842dc463542a", "score": "0.48103964", "text": "func RunAutomaticTests() {\n\tfmt.Printf(\"Create Nodes Map.\\n\")\n\tlog.Printf(\"Create Nodes Map.\\n\")\n\tCreateNodesMap()\n\tfmt.Printf(\"Start InfraStructure.\\n\")\n\tlog.Printf(\"Start InfraStructure.\\n\")\n\tgo runMixNetWithoutClients()\n\ttime.Sleep(2*time.Second)\n\n\tfirstClientName := \"201\"\n\tsecondClientName := \"202\"\n\tserverName := \"001\"\n\tnumberOfTestMsgs := 10\n\tfirstTestSuccededPipe := make(chan bool)\n\tsecondTestSuccededPipe := make(chan bool)\n\n\tfmt.Printf(\"Send Messages from clients to servers.\\n\")\n\tlog.Printf(\"Send Messages from clients to servers.\\n\")\n\tgo testMixNet(firstClientName, serverName, numberOfTestMsgs, firstTestSuccededPipe)\n\ttime.Sleep(time.Second)\n\n\tgo testMixNet(secondClientName, serverName, numberOfTestMsgs, secondTestSuccededPipe)\n\n\tfirstTestSucceded := <- firstTestSuccededPipe\n\tsecondTestSucceded := <- secondTestSuccededPipe\n\n\tif firstTestSucceded && secondTestSucceded{\n\t\tfmt.Printf(\"--------------------Automatic Tests--------------------\\n\" +\n\t\t\t\"Test completed succesfully\\n\")\n\t}\n}", "title": "" }, { "docid": "a8db25367effb645892ede104feb1edd", "score": "0.48079926", "text": "func TestScenario(t *testing.T) {\n\n\tt.Skip(\"skipping test\")\n\n\trr := &demoRandomResult{\n\t\tmsecStdDev: 50.0,\n\t\tmsecMean: 200.0,\n\t\terrPerc: 50,\n\t}\n\tws, wts := scenario(t, 5, 2, 100, 90, rr)\n\tctx := context.Background()\n\n\tout, err := Execute(ctx, ws, wts, All)\n\tif err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\n\tdemoResults := []*demoResult{}\n\tfor res := range out {\n\t\tdres := res.(*demoResult)\n\n\t\tif !errors.Is(dres.err, context.Canceled) || (dres.TimeEnd.Sub(dres.TimeStart).Milliseconds() > 10) {\n\t\t\tdemoResults = append(demoResults, dres)\n\t\t}\n\n\t}\n\n\tmsg, _ := json.MarshalIndent(demoResults, \"\", \" \")\n\n\terr = ioutil.WriteFile(\"/tmp/quote_demo.json\", msg, 0644)\n\tif err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\t// fmt.Println(string(msg))\n\n\t// t.FailNow()\n}", "title": "" }, { "docid": "6634d66ccab69028e46e5aae650302c5", "score": "0.48033535", "text": "func AwaitAllErrors(e chan *Invocation, count int) (bool, []*Invocation) {\n\terrs := []*Invocation{}\n\tok := true\n\tfor i := 0; i < count; i++ {\n\t\tselect {\n\t\tcase err := <-e:\n\t\t\tif err != nil {\n\t\t\t\tok = false\n\t\t\t}\n\t\t\terrs = append(errs, err)\n\t\t}\n\t}\n\treturn ok, errs\n}", "title": "" }, { "docid": "e5921965436a3b1fc6f477c80fa4763b", "score": "0.48025328", "text": "func TestCreateServiceInstanceWithProvisionFailure(t *testing.T) {\n\tfor tn, state := range map[string]struct {\n\t\torphanMitigation bool\n\t\tprovisionResponseStatusCode int\n\t\tfirstFailedReason string\n\t\torphanMitigationReason string\n\t\tfailReason string\n\t\tnonHTTPResponseError error\n\t}{\n\t\t\"Status OK\": {\n\t\t\torphanMitigation: false,\n\t\t\tprovisionResponseStatusCode: http.StatusOK,\n\t\t\tfirstFailedReason: \"ProvisionCallFailed\",\n\t\t},\n\t\t\"Status Created\": {\n\t\t\torphanMitigation: true,\n\t\t\tprovisionResponseStatusCode: http.StatusCreated,\n\t\t\tfirstFailedReason: \"StartingInstanceOrphanMitigation\",\n\t\t},\n\t\t\"Other 2xx\": {\n\t\t\torphanMitigation: true,\n\t\t\tprovisionResponseStatusCode: http.StatusNoContent,\n\t\t\tfirstFailedReason: \"StartingInstanceOrphanMitigation\",\n\t\t},\n\t\t\"3XX\": {\n\t\t\torphanMitigation: false,\n\t\t\tprovisionResponseStatusCode: http.StatusMultipleChoices,\n\t\t\tfirstFailedReason: \"ProvisionCallFailed\",\n\t\t},\n\t\t\"Status Request Timeout\": {\n\t\t\torphanMitigation: false,\n\t\t\tprovisionResponseStatusCode: http.StatusRequestTimeout,\n\t\t\tfirstFailedReason: \"ProvisionCallFailed\",\n\t\t},\n\t\t\"400\": {\n\t\t\torphanMitigation: false,\n\t\t\tprovisionResponseStatusCode: http.StatusBadRequest,\n\t\t\tfirstFailedReason: \"ProvisionCallFailed\",\n\t\t\tfailReason: \"ClusterServiceBrokerReturnedFailure\",\n\t\t},\n\t\t\"Other 4XX\": {\n\t\t\torphanMitigation: false,\n\t\t\tprovisionResponseStatusCode: http.StatusForbidden,\n\t\t\tfirstFailedReason: \"ProvisionCallFailed\",\n\t\t},\n\t\t\"5XX\": {\n\t\t\torphanMitigation: true,\n\t\t\tprovisionResponseStatusCode: http.StatusInternalServerError,\n\t\t\tfirstFailedReason: \"StartingInstanceOrphanMitigation\",\n\t\t},\n\t\t\"Non url transport error\": {\n\t\t\torphanMitigation: false,\n\t\t\tnonHTTPResponseError: fmt.Errorf(\"non-url error\"),\n\t\t\tfirstFailedReason: \"ErrorCallingProvision\",\n\t\t},\n\t\t\"Non timeout url error\": {\n\t\t\torphanMitigation: false,\n\t\t\tnonHTTPResponseError: &url.Error{\n\t\t\t\tOp: \"Put\",\n\t\t\t\tURL: \"https://fakebroker.com/v2/service_instances/instance_id\",\n\t\t\t\tErr: fmt.Errorf(\"non-timeout error\"),\n\t\t\t},\n\t\t\tfirstFailedReason: \"ErrorCallingProvision\",\n\t\t},\n\t\t\"Network timeout\": {\n\t\t\torphanMitigation: true,\n\t\t\tnonHTTPResponseError: &url.Error{\n\t\t\t\tOp: \"Put\",\n\t\t\t\tURL: \"https://fakebroker.com/v2/service_instances/instance_id\",\n\t\t\t\tErr: TimeoutError(\"timeout error\"),\n\t\t\t},\n\t\t\tfirstFailedReason: \"StartingInstanceOrphanMitigation\",\n\t\t\torphanMitigationReason: \"ErrorCallingProvision\",\n\t\t},\n\t} {\n\t\tt.Run(tn, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\t// GIVEN\n\t\t\tct := newControllerTest(t)\n\t\t\tdefer ct.TearDown()\n\n\t\t\trequire.NoError(t, ct.CreateSimpleClusterServiceBroker())\n\t\t\trequire.NoError(t, ct.WaitForReadyBroker())\n\n\t\t\tblockDeprovisioning := make(chan bool)\n\n\t\t\t// WHEN\n\t\t\tif state.nonHTTPResponseError != nil {\n\t\t\t\tct.SetCustomErrorReactionForProvisioningToOSBClient(state.nonHTTPResponseError)\n\t\t\t} else {\n\t\t\t\tct.SetErrorReactionForProvisioningToOSBClient(state.provisionResponseStatusCode)\n\t\t\t}\n\t\t\tct.SetErrorReactionForDeprovisioningToOSBClient(http.StatusInternalServerError, blockDeprovisioning)\n\t\t\trequire.NoError(t, ct.CreateServiceInstance())\n\n\t\t\t// THEN\n\t\t\t// Wait for the provision to fail\n\t\t\tcondition := v1beta1.ServiceInstanceCondition{\n\t\t\t\tType: v1beta1.ServiceInstanceConditionReady,\n\t\t\t\tStatus: v1beta1.ConditionFalse,\n\t\t\t\tReason: state.firstFailedReason,\n\t\t\t}\n\t\t\trequire.NoError(t, ct.WaitForInstanceCondition(condition))\n\n\t\t\t// In original test next step is making sure that the latest generation has been observed\n\t\t\t// it means `ObservedGeneration` parameters should be equal 1, here `ObservedGeneration` is equal 0\n\t\t\t// because in original test apiserver is used and its functionality set `instance.Generation` to 1\n\t\t\t// inside file `pkg/registry/servicecatalog/instance/strategy.go` method `PrepareForCreate()`.\n\t\t\t// In this test the `instance.Generation` is not update so in `pkg/controller/controller_instance.go`\n\t\t\t// in method `reconcileServiceInstanceAdd` will not increase `ObservedGeneration` value\n\t\t\t// because `instance.Status.ObservedGeneration != instance.Generation` condition is not met\n\n\t\t\t// If the provision failed with a terminating failure\n\t\t\tif state.failReason != \"\" {\n\t\t\t\tcondition = v1beta1.ServiceInstanceCondition{\n\t\t\t\t\tType: v1beta1.ServiceInstanceConditionFailed,\n\t\t\t\t\tStatus: v1beta1.ConditionTrue,\n\t\t\t\t\tReason: state.failReason,\n\t\t\t\t}\n\t\t\t\trequire.NoError(t, ct.WaitForInstanceCondition(condition))\n\t\t\t\tassert.Zero(t, ct.NumberOfOSBDeprovisionCalls())\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Assert that the orphan mitigation reason was set correctly\n\t\t\tif state.orphanMitigation {\n\t\t\t\tct.AssertServiceInstanceOrphanMitigationStatus(t, true)\n\t\t\t\tblockDeprovisioning <- false\n\n\t\t\t\tcondition = v1beta1.ServiceInstanceCondition{\n\t\t\t\t\tType: v1beta1.ServiceInstanceConditionReady,\n\t\t\t\t\tStatus: v1beta1.ConditionUnknown,\n\t\t\t\t\tReason: \"DeprovisionCallFailed\",\n\t\t\t\t}\n\t\t\t\trequire.NoError(t, ct.WaitForInstanceCondition(condition))\n\t\t\t} else {\n\t\t\t\tcondition = v1beta1.ServiceInstanceCondition{\n\t\t\t\t\tType: v1beta1.ServiceInstanceConditionOrphanMitigation,\n\t\t\t\t\tStatus: v1beta1.ConditionFalse,\n\t\t\t\t}\n\t\t\t\tct.AssertServiceInstanceHasNoCondition(t, condition)\n\t\t\t\tct.AssertServiceInstanceOrphanMitigationStatus(t, false)\n\t\t\t}\n\n\t\t\tct.SetSuccessfullyReactionForProvisioningToOSBClient()\n\t\t\tct.SetSuccessfullyReactionForDeprovisioningToOSBClient()\n\n\t\t\t// Wait for the instance to be provisioned successfully\n\t\t\tcondition = v1beta1.ServiceInstanceCondition{\n\t\t\t\tType: v1beta1.ServiceInstanceConditionReady,\n\t\t\t\tStatus: v1beta1.ConditionTrue,\n\t\t\t\tReason: \"ProvisionedSuccessfully\",\n\t\t\t}\n\t\t\trequire.NoError(t, ct.WaitForInstanceCondition(condition))\n\n\t\t\t// Assert that the observed generation is up-to-date, that orphan mitigation is not in progress,\n\t\t\t// and that the instance is not in a failed state.\n\t\t\tct.AssertObservedGenerationIsCorrect(t)\n\t\t\tct.AssertServiceInstanceOrphanMitigationStatus(t, false)\n\t\t\tcondition = v1beta1.ServiceInstanceCondition{\n\t\t\t\tType: v1beta1.ServiceInstanceConditionFailed,\n\t\t\t\tStatus: v1beta1.ConditionFalse,\n\t\t\t}\n\t\t\tct.AssertServiceInstanceHasNoCondition(t, condition)\n\t\t\tassert.NotZero(t, ct.NumberOfOSBProvisionCalls())\n\t\t})\n\t}\n}", "title": "" }, { "docid": "d1606b040e9a3d947119e0fe0e8d0060", "score": "0.4796033", "text": "func assertBlockReception(expectedSequencesPerChannel map[string]int, orderers []*nwo.Orderer, p *nwo.Peer, n *nwo.Network) {\n\tdefer GinkgoRecover()\n\tassertReception := func(channelName string, blockSeq int) {\n\t\tfor _, orderer := range orderers {\n\t\t\twaitForBlockReception(orderer, p, n, channelName, blockSeq)\n\t\t}\n\t}\n\n\tfor channelName, blockSeq := range expectedSequencesPerChannel {\n\t\tassertReception(channelName, blockSeq)\n\t}\n}", "title": "" }, { "docid": "3a82ac9499c57a26f730378782e77f27", "score": "0.47828054", "text": "func (f *FakeRuntime) AssertCallCounts(funcName string, expectedCount int) bool {\n\tf.Lock()\n\tdefer f.Unlock()\n\tactualCount := 0\n\tfor _, c := range f.CalledFunctions {\n\t\tif funcName == c {\n\t\t\tactualCount += 1\n\t\t}\n\t}\n\tif expectedCount != actualCount {\n\t\tf.T.Errorf(\"AssertCallCounts: expected %s to be called %d times, but was actually called %d times.\", funcName, expectedCount, actualCount)\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "62bd1072636da0a0cb9e0d665dad4260", "score": "0.47790915", "text": "func (s *scenario) Run() {\n\tdefer func() { // catch a test panicking\n\t\tif err := recover(); err != nil {\n\t\t\ts.a.Error(fmt.Sprintf(\"Test panicked: %v\", err))\n\t\t}\n\t}()\n\tdefer s.cleanup()\n\n\t// setup runner\n\tazcopyDir, err := os.MkdirTemp(\"\", \"\")\n\tif err != nil {\n\t\ts.a.Error(err.Error())\n\t\treturn\n\t}\n\tazcopyRan := false\n\tdefer func() {\n\t\tif os.Getenv(\"AZCOPY_E2E_LOG_OUTPUT\") == \"\" {\n\t\t\ts.a.Assert(os.RemoveAll(azcopyDir), equals(), nil)\n\t\t\treturn // no need, just delete logdir\n\t\t}\n\n\t\terr := os.MkdirAll(os.Getenv(\"AZCOPY_E2E_LOG_OUTPUT\"), os.ModePerm|os.ModeDir)\n\t\tif err != nil {\n\t\t\ts.a.Assert(err, equals(), nil)\n\t\t\treturn\n\t\t}\n\t\tif azcopyRan && s.a.Failed() {\n\t\t\ts.uploadLogs(azcopyDir)\n\t\t\ts.a.(*testingAsserter).t.Log(\"uploaded logs for job \" + s.state.result.jobID.String() + \" as an artifact\")\n\t\t}\n\t}()\n\n\t// setup scenario\n\t// First, validate the accounts make sense for the source/dests\n\tif s.srcAccountType.IsBlobOnly() {\n\t\ts.a.Assert(s.fromTo.From(), equals(), common.ELocation.Blob())\n\t}\n\n\tif s.destAccountType.IsBlobOnly() {\n\t\ts.a.Assert(s.destAccountType, notEquals(), EAccountType.StdManagedDisk(), \"Upload is not supported in MD testing yet\")\n\t\ts.a.Assert(s.destAccountType, notEquals(), EAccountType.OAuthManagedDisk(), \"Upload is not supported in MD testing yet\")\n\t\ts.a.Assert(s.fromTo.To(), equals(), common.ELocation.Blob())\n\t}\n\n\t// setup\n\ts.assignSourceAndDest() // what/where are they\n\ts.state.source.createLocation(s.a, s)\n\ts.state.dest.createLocation(s.a, s)\n\ts.state.source.createFiles(s.a, s, true)\n\ts.state.dest.createFiles(s.a, s, false)\n\tif s.a.Failed() {\n\t\treturn // setup failed. No point in running the test\n\t}\n\n\t// call pre-run hook\n\tif !s.runHook(s.hs.beforeRunJob) {\n\t\treturn\n\t}\n\n\t// execute\n\tazcopyRan = true\n\ts.runAzCopy(azcopyDir)\n\tif s.a.Failed() {\n\t\treturn // execution failed. No point in running validation\n\t}\n\n\t// resume if needed\n\tif s.needResume {\n\t\ttx, err := s.state.result.GetTransferList(common.ETransferStatus.Cancelled(), azcopyDir)\n\t\ts.a.AssertNoErr(err, \"Failed to get transfer list for Cancelled\")\n\t\ts.a.Assert(len(tx), equals(), len(s.p.debugSkipFiles), \"Job cancel didn't completely work\")\n\n\t\tif !s.runHook(s.hs.beforeResumeHook) {\n\t\t\treturn\n\t\t}\n\n\t\ts.resumeAzCopy(azcopyDir)\n\t}\n\tif s.a.Failed() {\n\t\treturn // resume failed. No point in running validation\n\t}\n\n\t// check\n\ts.validateTransferStates(azcopyDir)\n\tif s.a.Failed() {\n\t\treturn // no point in doing more validation\n\t}\n\n\tif !s.p.destNull {\n\t\ts.validateProperties()\n\t\tif s.a.Failed() {\n\t\t\treturn // no point in doing more validation\n\t\t}\n\n\t\tif s.validate&eValidate.AutoPlusContent() != 0 {\n\t\t\ts.validateContent()\n\t\t}\n\t}\n\n\ts.runHook(s.hs.afterValidation)\n}", "title": "" }, { "docid": "9e49ba4f731eb2825bd741d4a2546824", "score": "0.47666338", "text": "func ShouldCrash(testName string, try func(), fail func()) {\n\tif os.Getenv(\"SHOULD_CRASH\") == \"1\" {\n\t\ttry()\n\t\tos.Exit(0)\n\t}\n\tcmd := exec.Command(os.Args[0], \"-test.run=\"+testName)\n\tcmd.Env = append(os.Environ(), \"SHOULD_CRASH=1\")\n\terr := cmd.Run()\n\tif e, ok := err.(*exec.ExitError); ok && !e.Success() {\n\t\treturn\n\t}\n\tfail()\n}", "title": "" }, { "docid": "5106690c15f3f2fecb41a0ea202b2714", "score": "0.47622123", "text": "func TestAddAndGet(t *testing.T) {\n\tConvey(\"Adding multiple actions in parallel to getting statistics succeeds.\\n\", t, func() {\n\t\t// Kick off one add client.\n\t\tc1 := make(chan error)\n\t\tvar err1 error\n\t\tgo func() {\n\t\t\t// Notify the caller when we're done, no matter how we end up.\n\t\t\tdefer func() {c1 <- err1}()\n\n\t\t\tfor i := 0; i < 10; i++ {\n\t\t\t\t// Function under test.\n\t\t\t\terr1 = Add(action2)\n\t\t\t\tif err1 != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\n\t\t// Kick off another add client.\n\t\tc2 := make(chan error)\n\t\tvar err2 error\n\t\tgo func() {\n\t\t\t// Notify the caller when we're done, no matter how we end up.\n\t\t\tdefer func() {c2 <- err2}()\n\n\t\t\tfor i := 0; i < 10; i++ {\n\t\t\t\t// Function under test.\n\t\t\t\terr2 = Add(action3)\n\t\t\t\tif err2 != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\n\t\t// Kick off a get client.\n\t\tc3 := make(chan string)\n\t\tvar report string\n\t\tgo func() {\n\t\t\t// Notify the caller when we're done, no matter how we end up.\n\t\t\tdefer func() {c3 <- report}()\n\n\t\t\tfor i := 0; i < 5; i++ {\n\t\t\t\t// Function under test.\n\t\t\t\treport = GetStats()\n\t\t\t\ttime.Sleep(time.Microsecond)\n\t\t\t}\n\t\t}()\n\n\t\t// Wait for clients to finish.\n\t\t<- c1\n\t\t<- c2\n\t\t<- c3\n\n\t\tSo(err1, ShouldBeNil)\n\t\tSo(err2, ShouldBeNil)\n\t\tSo(len(actions), ShouldEqual, 20)\n\n\t\t// One last request of the report.\n\t\treport = GetStats()\n\n\t\t// No order to JSON lists.\n\t\t// ShouldEqual() returns \"\" when successful.\n\t\tif ShouldEqual(report, `[\n {\n \"action\": \"jump\",\n \"avg\": 200\n },\n {\n \"action\": \"run\",\n \"avg\": 75\n }\n]`) != \"\" {\n\t\t\tif ShouldEqual(report, `[\n {\n \"action\": \"run\",\n \"avg\": 75\n },\n {\n \"action\": \"jump\",\n \"avg\": 200\n }\n]`) != \"\" {\n\t\t\t\tSo(report, ShouldEqual, `[\n {\n \"action\": \"jump\",\n \"avg\": 200\n },\n {\n \"action\": \"run\",\n \"avg\": 75\n }\n]`)\n\t\t\t}\n\t\t}\n})\n\n\t// Clean up from these tests.\n\tactions = nil\n}", "title": "" }, { "docid": "0b0129f34770b688c0e53a78f9340066", "score": "0.47616938", "text": "func TestProvisionInstanceWithRetries(t *testing.T) {\n\tfor name, tc := range map[string]struct {\n\t\tisOrphanMitigation bool\n\t\tstatusCode int\n\t}{\n\t\t\"With orphan mitigation\": {\n\t\t\tisOrphanMitigation: true,\n\t\t\tstatusCode: http.StatusInternalServerError,\n\t\t},\n\t\t\"Without orphan mitigation\": {\n\t\t\tisOrphanMitigation: false,\n\t\t\tstatusCode: http.StatusUnauthorized,\n\t\t},\n\t} {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tct := newControllerTest(t)\n\t\t\tdefer ct.TearDown()\n\t\t\t// configure first provision response with HTTP error\n\t\t\tct.SetFirstOSBProvisionReactionsHTTPError(1, tc.statusCode)\n\t\t\trequire.NoError(t, ct.CreateSimpleClusterServiceBroker())\n\t\t\trequire.NoError(t, ct.WaitForReadyBroker())\n\n\t\t\t// WHEN\n\t\t\tassert.NoError(t, ct.CreateServiceInstance())\n\n\t\t\t// THEN\n\t\t\tassert.NoError(t, ct.WaitForReadyInstance())\n\t\t\tif tc.isOrphanMitigation {\n\t\t\t\tassert.NotZero(t, ct.NumberOfOSBDeprovisionCalls())\n\t\t\t} else {\n\t\t\t\tassert.Zero(t, ct.NumberOfOSBDeprovisionCalls())\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "40d4971c451ff182574634f96a2b52c4", "score": "0.4741132", "text": "func TestGetMultiplePagesFailureURI(t *testing.T) {\n\tclient := newPagingClient(t)\n\tpager := client.NewGetMultiplePagesFailureURIPager(nil)\n\tcount := 0\n\tfor pager.More() {\n\t\tpage, err := pager.NextPage(context.Background())\n\t\tif err != nil {\n\t\t\tif !reflect.ValueOf(page).IsZero() {\n\t\t\t\tt.Fatal(\"expected empty payload\")\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tcount++\n\t}\n\tif r := cmp.Diff(count, 1); r != \"\" {\n\t\tt.Fatal(r)\n\t}\n}", "title": "" }, { "docid": "a4b3ccdfe36d4216a76e08f03be75efa", "score": "0.47377422", "text": "func (m *MockTortoise) OnMalfeasance(arg0 types.NodeID) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"OnMalfeasance\", arg0)\n}", "title": "" }, { "docid": "1c3e6c204355c517be7de84d44358d1a", "score": "0.47365117", "text": "func (res *Response) callBefore() {\n\tfor i := len(res.beforeFuncs) - 1; i >= 0; i-- {\n\t\tres.beforeFuncs[i](res)\n\t}\n}", "title": "" }, { "docid": "284a96f9b31d13cb03408de8248e8de4", "score": "0.47331583", "text": "func testFailingChannel(net *lntest.NetworkHarness, t *harnessTest) {\n\tctxb := context.Background()\n\n\tconst (\n\t\tpaymentAmt = 10000\n\t)\n\n\tchanAmt := lnd.MaxFundingAmount\n\n\t// We'll introduce Carol, which will settle any incoming invoice with a\n\t// totally unrelated preimage.\n\tcarol := net.NewNode(t.t, \"Carol\", []string{\"--hodl.bogus-settle\"})\n\tdefer shutdownAndAssert(net, t, carol)\n\n\t// Let Alice connect and open a channel to Carol,\n\tnet.ConnectNodes(t.t, net.Alice, carol)\n\tchanPoint := openChannelAndAssert(\n\t\tt, net, net.Alice, carol,\n\t\tlntest.OpenChannelParams{\n\t\t\tAmt: chanAmt,\n\t\t},\n\t)\n\n\t// With the channel open, we'll create a invoice for Carol that Alice\n\t// will attempt to pay.\n\tpreimage := bytes.Repeat([]byte{byte(192)}, 32)\n\tinvoice := &lnrpc.Invoice{\n\t\tMemo: \"testing\",\n\t\tRPreimage: preimage,\n\t\tValue: paymentAmt,\n\t}\n\tctxt, _ := context.WithTimeout(ctxb, defaultTimeout)\n\tresp, err := carol.AddInvoice(ctxt, invoice)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to add invoice: %v\", err)\n\t}\n\tcarolPayReqs := []string{resp.PaymentRequest}\n\n\t// Wait for Alice to receive the channel edge from the funding manager.\n\terr = net.Alice.WaitForNetworkChannelOpen(chanPoint)\n\tif err != nil {\n\t\tt.Fatalf(\"alice didn't see the alice->carol channel before \"+\n\t\t\t\"timeout: %v\", err)\n\t}\n\n\t// Send the payment from Alice to Carol. We expect Carol to attempt to\n\t// settle this payment with the wrong preimage.\n\terr = completePaymentRequests(\n\t\tnet.Alice, net.Alice.RouterClient, carolPayReqs, false,\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to send payments: %v\", err)\n\t}\n\n\t// Since Alice detects that Carol is trying to trick her by providing a\n\t// fake preimage, she should fail and force close the channel.\n\tvar predErr error\n\terr = wait.Predicate(func() bool {\n\t\tpendingChansRequest := &lnrpc.PendingChannelsRequest{}\n\t\tctxt, _ = context.WithTimeout(ctxb, defaultTimeout)\n\t\tpendingChanResp, err := net.Alice.PendingChannels(ctxt,\n\t\t\tpendingChansRequest)\n\t\tif err != nil {\n\t\t\tpredErr = fmt.Errorf(\"unable to query for pending \"+\n\t\t\t\t\"channels: %v\", err)\n\t\t\treturn false\n\t\t}\n\t\tn := len(pendingChanResp.WaitingCloseChannels)\n\t\tif n != 1 {\n\t\t\tpredErr = fmt.Errorf(\"expected to find %d channels \"+\n\t\t\t\t\"waiting close, found %d\", 1, n)\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}, defaultTimeout)\n\tif err != nil {\n\t\tt.Fatalf(\"%v\", predErr)\n\t}\n\n\t// Mine a block to confirm the broadcasted commitment.\n\tblock := mineBlocks(t, net, 1, 1)[0]\n\tif len(block.Transactions) != 2 {\n\t\tt.Fatalf(\"transaction wasn't mined\")\n\t}\n\n\t// The channel should now show up as force closed both for Alice and\n\t// Carol.\n\terr = wait.Predicate(func() bool {\n\t\tpendingChansRequest := &lnrpc.PendingChannelsRequest{}\n\t\tctxt, _ = context.WithTimeout(ctxb, defaultTimeout)\n\t\tpendingChanResp, err := net.Alice.PendingChannels(ctxt,\n\t\t\tpendingChansRequest)\n\t\tif err != nil {\n\t\t\tpredErr = fmt.Errorf(\"unable to query for pending \"+\n\t\t\t\t\"channels: %v\", err)\n\t\t\treturn false\n\t\t}\n\t\tn := len(pendingChanResp.WaitingCloseChannels)\n\t\tif n != 0 {\n\t\t\tpredErr = fmt.Errorf(\"expected to find %d channels \"+\n\t\t\t\t\"waiting close, found %d\", 0, n)\n\t\t\treturn false\n\t\t}\n\t\tn = len(pendingChanResp.PendingForceClosingChannels)\n\t\tif n != 1 {\n\t\t\tpredErr = fmt.Errorf(\"expected to find %d channel \"+\n\t\t\t\t\"pending force close, found %d\", 1, n)\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}, defaultTimeout)\n\tif err != nil {\n\t\tt.Fatalf(\"%v\", predErr)\n\t}\n\n\terr = wait.Predicate(func() bool {\n\t\tpendingChansRequest := &lnrpc.PendingChannelsRequest{}\n\t\tctxt, _ = context.WithTimeout(ctxb, defaultTimeout)\n\t\tpendingChanResp, err := carol.PendingChannels(ctxt,\n\t\t\tpendingChansRequest)\n\t\tif err != nil {\n\t\t\tpredErr = fmt.Errorf(\"unable to query for pending \"+\n\t\t\t\t\"channels: %v\", err)\n\t\t\treturn false\n\t\t}\n\t\tn := len(pendingChanResp.PendingForceClosingChannels)\n\t\tif n != 1 {\n\t\t\tpredErr = fmt.Errorf(\"expected to find %d channel \"+\n\t\t\t\t\"pending force close, found %d\", 1, n)\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}, defaultTimeout)\n\tif err != nil {\n\t\tt.Fatalf(\"%v\", predErr)\n\t}\n\n\t// Carol will use the correct preimage to resolve the HTLC on-chain.\n\t_, err = waitForTxInMempool(net.Miner.Client, minerMempoolTimeout)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to find Carol's resolve tx in mempool: %v\", err)\n\t}\n\n\t// Mine enough blocks for Alice to sweep her funds from the force\n\t// closed channel.\n\t_, err = net.Miner.Client.Generate(defaultCSV - 1)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to generate blocks: %v\", err)\n\t}\n\n\t// Wait for the sweeping tx to be broadcast.\n\t_, err = waitForTxInMempool(net.Miner.Client, minerMempoolTimeout)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to find Alice's sweep tx in mempool: %v\", err)\n\t}\n\n\t// Mine the sweep.\n\t_, err = net.Miner.Client.Generate(1)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to generate blocks: %v\", err)\n\t}\n\n\t// No pending channels should be left.\n\terr = wait.Predicate(func() bool {\n\t\tpendingChansRequest := &lnrpc.PendingChannelsRequest{}\n\t\tctxt, _ = context.WithTimeout(ctxb, defaultTimeout)\n\t\tpendingChanResp, err := net.Alice.PendingChannels(ctxt,\n\t\t\tpendingChansRequest)\n\t\tif err != nil {\n\t\t\tpredErr = fmt.Errorf(\"unable to query for pending \"+\n\t\t\t\t\"channels: %v\", err)\n\t\t\treturn false\n\t\t}\n\t\tn := len(pendingChanResp.PendingForceClosingChannels)\n\t\tif n != 0 {\n\t\t\tpredErr = fmt.Errorf(\"expected to find %d channel \"+\n\t\t\t\t\"pending force close, found %d\", 0, n)\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}, defaultTimeout)\n\tif err != nil {\n\t\tt.Fatalf(\"%v\", predErr)\n\t}\n}", "title": "" }, { "docid": "00a85a454fdb3595ae461d355218985d", "score": "0.47320035", "text": "func (c *Client) TestRunAbortAll(organisationUID string) (bool, string, error) {\n\tpayload := url.Values{}\n\tpayload.Add(\"organisation_uid\", organisationUID)\n\n\treq, err := http.NewRequest(\"POST\", c.APIEndpoint+\"/test_runs/abort_all\", strings.NewReader(payload.Encode()))\n\tif err != nil {\n\t\treturn false, \"\", err\n\t}\n\n\tresp, err := c.doRequestRaw(req)\n\tif err != nil {\n\t\treturn false, \"\", err\n\t}\n\n\tdefer close(resp.Body)\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn false, \"\", err\n\t}\n\n\treturn resp.StatusCode < 400, string(body), nil\n}", "title": "" }, { "docid": "454a89c97e81645a604901d77e953431", "score": "0.47307348", "text": "func TestTraceAcrossRPCs(t *testing.T) {\n\tctx, shutdown, idp := initForTest(t)\n\tdefer shutdown()\n\n\tvtrace.ForceCollect(ctx, 0)\n\trecord := runCallChain(t, ctx, idp, false, false)\n\n\texpectSequence(t, *record, []string{\n\t\t\": c0-begin, c0-end\",\n\t\t\"<rpc.Client>\\\"c1\\\".Run\",\n\t\t\"c1.Run: c1-begin, c1-end\",\n\t\t\"<rpc.Client>\\\"c2\\\".Run\",\n\t\t\"c2.Run: c2-begin, c2-end\",\n\t})\n}", "title": "" }, { "docid": "5dd2a3354ae44e8c3524a42cc24f93e5", "score": "0.47301382", "text": "func (c *common) Fail() {\n\tif c.parent != nil {\n\t\tc.parent.Fail()\n\t}\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\t// c.done needs to be locked to synchronize checks to c.done in parent tests.\n\tif c.done {\n\t\tpanic(\"Fail in goroutine after \" + c.name + \" has completed\")\n\t}\n\tc.failed = true\n}", "title": "" }, { "docid": "3145ecfa3593742ca54d12437ba9d93c", "score": "0.47282255", "text": "func Run(t *testing.T, s Spec) {\n\tt.Run(s.Name, func(t *testing.T) {\n\t\tif s.BeforeAll != nil {\n\t\t\ts.BeforeAll(t)\n\t\t}\n\n\t\tvar caseGroup sync.WaitGroup\n\t\tfor _, testCase := range s.It {\n\t\t\tcaseGroup.Add(1)\n\t\t\tgo func(tc Case) {\n\t\t\t\tif s.BeforeEach != nil {\n\t\t\t\t\ts.BeforeEach(t)\n\t\t\t\t}\n\n\t\t\t\tt.Run(tc.Name, func(t *testing.T) {\n\t\t\t\t\tif tc.Expectation != nil {\n\t\t\t\t\t\ttc.Expectation(t)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt.SkipNow()\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\tif s.AfterEach != nil {\n\t\t\t\t\ts.AfterEach(t)\n\t\t\t\t}\n\n\t\t\t\tcaseGroup.Done()\n\t\t\t}(testCase)\n\t\t}\n\t\tcaseGroup.Wait()\n\n\t\tvar childGroup sync.WaitGroup\n\t\tfor _, nextDesc := range s.AndWhen {\n\t\t\tchildGroup.Add(1)\n\t\t\tgo func(ns Spec) {\n\t\t\t\tRun(t, ns)\n\t\t\t\tchildGroup.Done()\n\t\t\t}(nextDesc)\n\t\t}\n\t\tchildGroup.Wait()\n\n\t\tif s.AfterAll != nil {\n\t\t\ts.AfterAll(t)\n\t\t}\n\n\t})\n}", "title": "" }, { "docid": "976c902b4da7c7ef3c67bdee7e801b47", "score": "0.4727321", "text": "func TestMultipleQueriesPerTransactionWithFailure(t *testing.T) {\n\tt.Skip()\n\n\ta := assert.New(t)\n\ttx, err := defaultDB().Begin()\n\ta.Nil(err)\n\tdefer tx.Rollback()\n\n\twg := sync.WaitGroup{}\n\twg.Add(3)\n\n\ta.NotNil(defaultDB().Connection)\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\thasRows, err := defaultDB().Invoke(OptTx(tx)).Query(\"select * from bench_object\").Any()\n\t\ta.NotNil(err)\n\t\ta.False(hasRows)\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\thasRows, err := defaultDB().Invoke(OptTx(tx)).Query(\"select * from bench_object\").Any()\n\t\ta.NotNil(err)\n\t\ta.False(hasRows)\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\thasRows, err := defaultDB().Invoke(OptTx(tx)).Query(\"select * from bench_object\").Any()\n\t\ta.NotNil(err)\n\t\ta.False(hasRows)\n\t}()\n\n\twg.Wait()\n\thasRows, err := defaultDB().Invoke(OptTx(tx)).Query(\"select * from bench_object\").Any()\n\n\ta.NotNil(err)\n\ta.False(hasRows)\n}", "title": "" }, { "docid": "5f5b3f14b470cc799fbaf19c62d389d0", "score": "0.47260147", "text": "func FailWithToggle(message string, callerSkip ...int) {\n\tGinkgoPrint(\"FAIL: \" + message)\n\n\tif len(callerSkip) > 0 {\n\t\tcallerSkip[0] = callerSkip[0] + 1\n\t}\n\n\tif failEnabled {\n\t\tginkgo.Fail(message, callerSkip...)\n\t}\n\n\ttestName := ginkgo.CurrentGinkgoTestDescription().FullTestText\n\tafterEachFailed[testName] = true\n\n\tafterEachCB[testName] = func() {\n\t\tginkgo.Fail(message, callerSkip...)\n\t}\n}", "title": "" }, { "docid": "295fd6289b6545047e96aefe2c9502c3", "score": "0.4716807", "text": "func ChannelDataPlaneFailureTestRunner(\n\tctx context.Context,\n\tt *testing.T,\n\tchannelTestRunner testlib.ComponentsTestRunner,\n\toptions ...testlib.SetupClientOption,\n) {\n\ttestCases := []struct {\n\t\tstatusCode int\n\t\tsenderFn func(c *testlib.Client, senderName string, channelName string, channel metav1.TypeMeta, eventId string, responseSink string)\n\t\teventId string\n\t}{{\n\t\tstatusCode: http.StatusMethodNotAllowed,\n\t\tsenderFn: func(c *testlib.Client, senderName string, channelName string, channel metav1.TypeMeta, eventId string, responseSink string) {\n\t\t\tc.SendRequestToAddressable(\n\t\t\t\tctx,\n\t\t\t\tsenderName,\n\t\t\t\tchannelName,\n\t\t\t\t&channel,\n\t\t\t\tmap[string]string{\n\t\t\t\t\t\"ce-specversion\": \"1.0\",\n\t\t\t\t\t\"ce-type\": \"example\",\n\t\t\t\t\t\"ce-source\": \"http://localhost\",\n\t\t\t\t\t\"ce-id\": eventId,\n\t\t\t\t\t\"content-type\": \"application/json\",\n\t\t\t\t},\n\t\t\t\t\"{}\",\n\t\t\t\tsender.WithMethod(\"PUT\"),\n\t\t\t\tsender.WithResponseSink(responseSink),\n\t\t\t)\n\t\t},\n\t}, {\n\t\tstatusCode: http.StatusBadRequest,\n\t\tsenderFn: func(c *testlib.Client, senderName string, channelName string, channel metav1.TypeMeta, eventId string, responseSink string) {\n\t\t\tc.SendRequestToAddressable(\n\t\t\t\tctx,\n\t\t\t\tsenderName,\n\t\t\t\tchannelName,\n\t\t\t\t&channel,\n\t\t\t\tmap[string]string{\n\t\t\t\t\t\"ce-specversion\": \"10.0\", // <-- Spec version not existing\n\t\t\t\t\t\"ce-type\": \"example\",\n\t\t\t\t\t\"ce-source\": \"http://localhost\",\n\t\t\t\t\t\"ce-id\": eventId,\n\t\t\t\t\t\"content-type\": \"application/json\",\n\t\t\t\t},\n\t\t\t\t\"{}\",\n\t\t\t\tsender.WithResponseSink(responseSink),\n\t\t\t)\n\t\t},\n\t}}\n\n\tchannelTestRunner.RunTests(t, testlib.FeatureBasic, func(t *testing.T, channel metav1.TypeMeta) {\n\t\tfor _, tc := range testCases {\n\t\t\tt.Run(\"expecting-\"+strconv.Itoa(tc.statusCode), func(t *testing.T) {\n\t\t\t\tchannelDataPlaneFailureTest(ctx, t, channel, tc.senderFn, tc.statusCode, options...)\n\t\t\t})\n\t\t}\n\t})\n}", "title": "" }, { "docid": "086e4edc0920a0e2188454c569e61906", "score": "0.47142664", "text": "func TestRoleSetupRun_Idempotency(t *testing.T) {\n\troleSetup, err := NewRoleSetup(&RoleSetupConfig{})\n\trequire.NoError(t, err)\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tt.Cleanup(cancel)\n\n\tuser, err := types.NewUser(\"alice\")\n\trequire.NoError(t, err)\n\tevents := &mockEvents{}\n\taccessAndIdentity := &mockAccessAndIdentity{\n\t\tuser: user,\n\t\tcallCounts: make(map[string]int),\n\t\tevents: events,\n\t}\n\tcertManager := &mockCertManager{}\n\n\t_, err = roleSetup.Run(ctx, accessAndIdentity, certManager, &clusters.Cluster{URI: uri.NewClusterURI(\"foo\")})\n\trequire.NoError(t, err)\n\n\t_, err = roleSetup.Run(ctx, accessAndIdentity, certManager, &clusters.Cluster{URI: uri.NewClusterURI(\"foo\")})\n\trequire.NoError(t, err)\n\n\trequire.Equal(t, 1, accessAndIdentity.callCounts[\"UpsertRole\"], \"expected two runs to update the role only once\")\n\trequire.Equal(t, 1, accessAndIdentity.callCounts[\"UpdateUser\"], \"expected two runs to update the user only once\")\n}", "title": "" }, { "docid": "dbdb33a8950b968de91ec4bed84eb22d", "score": "0.47133464", "text": "func (m *Mocktortoise) OnMalfeasance(arg0 types.NodeID) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"OnMalfeasance\", arg0)\n}", "title": "" }, { "docid": "e6dc511bc1e6a9bf3e6996ada790fe3b", "score": "0.47100702", "text": "func Test_describeServiceHandler(t *testing.T) {\n\tcx := newTestContext(t, \"describeService_Tab\")\n\tfor _, tc := range describeService_Tab {\n\t\tdescribeServiceHandler_Checker(cx, &tc)\n\t\tcx.bump()\t// increment testno.\n\t}\n}", "title": "" }, { "docid": "fd1e3f08a6b6a8b2c6b2865f55dcb64b", "score": "0.47023883", "text": "func main() {\n\t// check(1) // err expected, cannot stream in captive core\n\tcheckLedgers := []uint32{2, 3, 62, 63, 64, 65, 126, 127, 128}\n\tfor _, ledger := range checkLedgers {\n\t\tok := check(ledger)\n\t\tif !ok {\n\t\t\tpanic(\"test failed error\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "90c2fb80200c3da307d64742a00366a0", "score": "0.47001734", "text": "func (r *Runner) runAllTasks() (err error) {\n\tdefer func() {\n\t\tr.fixture.TearDown()\n\t\tif err == nil {\n\t\t\t// update recipe's status if there was **no** error\n\t\t\terr = r.updateRecipeWithRetries()\n\t\t}\n\t}()\n\n\tr.validateSchema()\n\tif r.RecipeStatus.Phase == types.RecipeStatusInvalidSchema {\n\t\t// Log the error & return\n\t\t//\n\t\t// NOTE:\n\t\t//\tThis does not need to be bubbled up as error. Setting\n\t\t// phase will handle this invalid schema.\n\t\tklog.Errorf(\n\t\t\t\"Will skip execution: Invalid schema: Recipe %q / %q: %s\",\n\t\t\tr.Recipe.GetNamespace(),\n\t\t\tr.Recipe.GetName(),\n\t\t\tr.FieldPathValidationResult.Error(),\n\t\t)\n\t\treturn nil\n\t}\n\n\t// initialise the fields that can be set irrespective of Recipe\n\t// being run or not\n\tr.RecipeStatus.TaskCount = &types.TaskCount{\n\t\tTotal: len(r.Recipe.Spec.Tasks),\n\t}\n\n\t// first thing to do even before running the Recipe is to\n\t// verify if this Recipe is eligible to run\n\teligible, err := r.isRunEligible()\n\tif err != nil {\n\t\treturn errors.Wrapf(\n\t\t\terr,\n\t\t\t\"Eligibility check failed: Recipe %q / %q: Status %q %q\",\n\t\t\tr.Recipe.Namespace,\n\t\t\tr.Recipe.Name,\n\t\t\tr.Recipe.Status.Phase,\n\t\t\tr.Recipe.Status.Reason,\n\t\t)\n\t}\n\tif !eligible {\n\t\t// Recipe may not be eligible during initial reconciliation\n\t\t// attempts. So logging this at verbose level is fine.\n\t\tklog.V(2).Infof(\n\t\t\t\"Will skip execution: Not eligibile: Recipe %q / %q\",\n\t\t\tr.Recipe.GetNamespace(),\n\t\t\tr.Recipe.GetName(),\n\t\t)\n\t\t// Setting exact phase helps in subsequent execution, e.g. unlocking\n\t\t// this recipe\n\t\tr.RecipeStatus.Phase = types.RecipeStatusNotEligible\n\t\t// Short description\n\t\tr.RecipeStatus.Reason = \"Did not meet eligibility criteria\"\n\t\t// Long description has the remedy\n\t\tr.RecipeStatus.Message =\n\t\t\t\"Remedy: Wait for next reconciliation(s) or modify spec.eligible criteria\"\n\t\t// All tasks are skipped\n\t\tr.RecipeStatus.TaskCount.Skipped = len(r.Recipe.Spec.Tasks)\n\t\treturn nil\n\t}\n\n\tvar start = time.Now()\n\tfor idx, task := range r.Recipe.Spec.Tasks {\n\t\tvar failFastRule types.FailFastRule\n\t\tif task.FailFast != nil {\n\t\t\tfailFastRule = task.FailFast.When\n\t\t}\n\t\ttr := &TaskRunner{\n\t\t\tBaseRunner: BaseRunner{\n\t\t\t\tFixture: r.fixture,\n\t\t\t\tTaskIndex: idx + 1,\n\t\t\t\tTaskName: task.Name,\n\t\t\t\tRetry: r.Retry,\n\t\t\t\tFailFastRule: failFastRule,\n\t\t\t},\n\t\t\tTask: task,\n\t\t}\n\t\tgot, err := tr.Run()\n\t\tif err != nil {\n\t\t\t// We discontinue executing next tasks\n\t\t\t// if current task execution resulted in\n\t\t\t// error\n\t\t\treturn errors.Wrapf(\n\t\t\t\terr,\n\t\t\t\t\"Task failed: Index %d: Name %q: Recipe %q / %q\",\n\t\t\t\tidx+1,\n\t\t\t\ttask.Name,\n\t\t\t\tr.Recipe.Namespace,\n\t\t\t\tr.Recipe.Name,\n\t\t\t)\n\t\t}\n\t\tr.RecipeStatus.TaskResults[task.Name] = got\n\t\tif got.Phase == types.TaskStatusFailed {\n\t\t\t// Run subsequent tasks even if current task failed\n\t\t\tr.RecipeStatus.TaskCount.Failed++\n\t\t}\n\t\tif got.Phase == types.TaskStatusWarning {\n\t\t\t// Run subsequent tasks even if current task has warnings\n\t\t\tr.RecipeStatus.TaskCount.Warning++\n\t\t}\n\t}\n\n\t// time taken for this recipe to run all its tasks\n\tduration := time.Since(start)\n\tr.RecipeStatus.ExecutionTime = &types.ExecutionTime{\n\t\tValueInSeconds: duration.Seconds(),\n\t\tReadableValue: duration.Round(time.Millisecond).String(),\n\t}\n\n\t// set other fields of the status\n\tif r.RecipeStatus.TaskCount.Failed > 0 {\n\t\t// recipe is set to failed if any of its tasks resulted in failure\n\t\tr.RecipeStatus.Phase = types.RecipeStatusFailed\n\t} else {\n\t\tr.RecipeStatus.Phase = r.mayBePassedOrCompletedStatus()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c6a79d45e7f16dec42ce67b54ac38c97", "score": "0.46981323", "text": "func testCorruption(tc *testContext) bool {\n\tif !resetDatabase(tc) {\n\t\treturn false\n\t}\n\n\t// Insert the first block into the mock file.\n\terr := tc.db.Update(func(tx database.Tx) error {\n\t\terr := tx.StoreBlock(tc.blocks[0])\n\t\tif err != nil {\n\t\t\ttc.t.Errorf(\"StoreBlock: unexpected error: %v\", err)\n\t\t\treturn errSubTestFail\n\t\t}\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tif err != errSubTestFail {\n\t\t\ttc.t.Errorf(\"Update: unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t}\n\n\t// Ensure corruption is detected by intentionally modifying the bytes\n\t// stored to the mock file and reading the block.\n\tblock0Bytes, _ := tc.blocks[0].Bytes()\n\tblock0Hash := tc.blocks[0].Hash()\n\ttests := []struct {\n\t\toffset uint32\n\t\tfixChecksum bool\n\t\twantErrCode database.ErrorCode\n\t}{\n\t\t// One of the network bytes. The checksum needs to be fixed so\n\t\t// the invalid network is detected.\n\t\t{2, true, database.ErrDriverSpecific},\n\n\t\t// The same network byte, but this time don't fix the checksum\n\t\t// to ensure the corruption is detected.\n\t\t{2, false, database.ErrCorruption},\n\n\t\t// One of the block length bytes.\n\t\t{6, false, database.ErrCorruption},\n\n\t\t// Random header byte.\n\t\t{17, false, database.ErrCorruption},\n\n\t\t// Random transaction byte.\n\t\t{90, false, database.ErrCorruption},\n\n\t\t// Random checksum byte.\n\t\t{uint32(len(block0Bytes)) + 10, false, database.ErrCorruption},\n\t}\n\terr = tc.db.View(func(tx database.Tx) error {\n\t\tdata := tc.files[0].file.(*mockFile).data\n\t\tfor i, test := range tests {\n\t\t\t// Corrupt the byte at the offset by a single bit.\n\t\t\tdata[test.offset] ^= 0x10\n\n\t\t\t// Fix the checksum if requested to force other errors.\n\t\t\tfileLen := len(data)\n\t\t\tvar oldChecksumBytes [4]byte\n\t\t\tcopy(oldChecksumBytes[:], data[fileLen-4:])\n\t\t\tif test.fixChecksum {\n\t\t\t\ttoSum := data[:fileLen-4]\n\t\t\t\tcksum := crc32.Checksum(toSum, castagnoli)\n\t\t\t\tbinary.BigEndian.PutUint32(data[fileLen-4:], cksum)\n\t\t\t}\n\n\t\t\ttestName := fmt.Sprintf(\"FetchBlock (test #%d): \"+\n\t\t\t\t\"corruption\", i)\n\t\t\t_, err := tx.FetchBlock(block0Hash)\n\t\t\tif !checkDbError(tc.t, testName, err, test.wantErrCode) {\n\t\t\t\treturn errSubTestFail\n\t\t\t}\n\n\t\t\t// Reset the corrupted data back to the original.\n\t\t\tdata[test.offset] ^= 0x10\n\t\t\tif test.fixChecksum {\n\t\t\t\tcopy(data[fileLen-4:], oldChecksumBytes[:])\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tif err != errSubTestFail {\n\t\t\ttc.t.Errorf(\"View: unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "6b27e4898064aa5740babf90e84f435e", "score": "0.46970615", "text": "func (t *AcceptanceTest) runActions() {\n\tvar wg sync.WaitGroup\n\n\tfor at, fs := range t.actions {\n\t\tts := t.opts.expandTime(at)\n\t\twg.Add(len(fs))\n\n\t\tfor _, f := range fs {\n\t\t\tgo func(f func()) {\n\t\t\t\ttime.Sleep(time.Until(ts))\n\t\t\t\tf()\n\t\t\t\twg.Done()\n\t\t\t}(f)\n\t\t}\n\t}\n\n\twg.Wait()\n}", "title": "" }, { "docid": "30e31fa32b9c15659f6b840912712274", "score": "0.46955767", "text": "func Test_Speculate(t *testing.T) {\n\tet := NewRateLimit(3, 100*time.Millisecond)\n\n\tsuccessChan := make(chan bool)\n\ttimeout := time.After(120 * time.Millisecond)\n\n\tbegin := time.Now()\n\t// trigger two quick errors followed by a long, non-error task\n\tgo func() {\n\t\tTaskError(t, et, 1, 0, 0)\n\t\tTaskError(t, et, 2, 0, 0)\n\t\tsuccessChan <- true\n\t\tTaskClean(t, et, 3, 0, 200*time.Millisecond)\n\t}()\n\n\tselect {\n\tcase <-successChan:\n\tcase <-timeout:\n\t\tt.Errorf(\"speculate setup tasks failed to complete.\")\n\t\treturn\n\t}\n\n\tTaskClean(t, et, -1, 0, 0)\n\tif time.Since(begin) < 100*time.Millisecond {\n\t\tt.Errorf(\"speculate not holding up tasks\")\n\t} else {\n\t\tt.Logf(\"speculate held up as expected\")\n\t}\n\n\tbegin = time.Now()\n\tTaskClean(t, et, -1, 0, 0)\n\tif time.Since(begin) > 10*time.Millisecond {\n\t\tt.Errorf(\"speculate incorrectly holding up tasks\")\n\t} else {\n\t\tt.Logf(\"speculate stopped as expected\")\n\t}\n\n}", "title": "" }, { "docid": "e8151dd3a39aeb503e51a502ee290b20", "score": "0.46951574", "text": "func testFailAccept() {\n\tpt.n++\n\tpt.cmdNum++\n\n\t// Prepare Phase\n\tpArgs := paxosrpc.PrepareArgs{pt.n, pt.cmdNum}\n\tvar pReply paxosrpc.PrepareReply\n\n\tfor _, c := range pt.servers {\n\t\terr := c.Call(\"PaxosServer.Prepare\", &pArgs, &pReply)\n\n\t\tif err != nil {\n\t\t\tLOGE.Println(\"Failed To Connect to Servers\", err)\n\t\t\treturn\n\t\t}\n\n\t\tif pReply.Status != paxosrpc.OK {\n\t\t\tLOGE.Println(\"FAIL: Prepare should return OK\")\n\t\t\tfailCount++\n\t\t\treturn\n\t\t}\n\t}\n\n\tpt.n++\n\tpt.cmdNum++\n\n\t// New Prepare Phase\n\tpArgs = paxosrpc.PrepareArgs{pt.n, pt.cmdNum}\n\n\tfor _, c := range pt.servers {\n\t\terr := c.Call(\"PaxosServer.Prepare\", &pArgs, &pReply)\n\n\t\tif err != nil {\n\t\t\tLOGE.Println(\"Failed To Connect to Servers\", err)\n\t\t\treturn\n\t\t}\n\n\t\tif pReply.Status != paxosrpc.OK {\n\t\t\tLOGE.Println(\"FAIL: Prepare should return OK\")\n\t\t\tfailCount++\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Accept Phase\n\tcmd := paxosrpc.Command{\n\t\tCommandNumber: pt.cmdNum,\n\t\tType: paxosrpc.Init,\n\t\tPlayer: \"testNormal\",\n\t\tHostport: *master, //Dummy port\n\t}\n\taArgs := paxosrpc.AcceptArgs{\n\t\tN: pt.n - 1,\n\t\tCommand: cmd,\n\t}\n\tvar aReply paxosrpc.AcceptReply\n\tfor _, c := range pt.servers {\n\t\terr := c.Call(\"PaxosServer.Accept\", &aArgs, &aReply)\n\n\t\tif err != nil {\n\t\t\tLOGE.Println(\"Failed To Connect to Servers\", err)\n\t\t\treturn\n\t\t}\n\n\t\tif aReply.Status == paxosrpc.OK {\n\t\t\tLOGE.Println(\"FAIL: Accept should return Reject (There was a prepare with greater n)\")\n\t\t\tfailCount++\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"PASS\")\n\tpassCount++\n}", "title": "" }, { "docid": "bf8119f70d67241e9ce8e1a76fbbc3e9", "score": "0.4693746", "text": "func TestRetryOperation(t *testing.T) {\n\tcount := 0\n\n\terrOutcome := Retry(10, func() error {\n\t\tcount++\n\t\tif count < 5 {\n\t\t\treturn NewConcurrencyFault(\"dummy-key\", int64(count))\n\t\t}\n\n\t\treturn nil\n\t})\n\n\tassert.Nil(t, errOutcome, \"The retry should not return an error.\")\n\tassert.Equal(t, 5, count, \"The count should be 5 at the end of the test.\")\n}", "title": "" }, { "docid": "4b14f747a0f0949324704af6ef05fab7", "score": "0.46863174", "text": "func TestRunExeWithSampleFcall(t *testing.T) {\n\tfile, err := os.Open(\"sample/fcall.exe\")\n\tif err != nil {\n\t\tt.Errorf(\"%+v\", err)\n\t}\n\texitCode, _, err := RunExe(file)\n\tif err != nil {\n\t\tt.Errorf(\"%+v\", err)\n\t}\n\tif exitCode != 7 {\n\t\tt.Errorf(\"expect exitCode to be %d but actual %d\", 7, exitCode)\n\t}\n}", "title": "" }, { "docid": "33fa01bdb86b0e5625f1d67313c5feb3", "score": "0.4685221", "text": "func (m *MockTxn) Else(arg0 ...clientv3.Op) clientv3.Txn {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{}\n\tfor _, a := range arg0 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"Else\", varargs...)\n\tret0, _ := ret[0].(clientv3.Txn)\n\treturn ret0\n}", "title": "" }, { "docid": "74e0b666d71a8617c4ba44bba24dab80", "score": "0.4676732", "text": "func TestRecoveryWithFailedJobBatches(t *testing.T) {\n\tvar err error\n\tvar jobStatesAll = []pb_job.JobState{\n\t\tpb_job.JobState_PENDING,\n\t\tpb_job.JobState_RUNNING,\n\t\tpb_job.JobState_FAILED,\n\t}\n\tcount = 0\n\n\tctx := context.Background()\n\n\tfor i := 0; i < 50; i++ {\n\t\t_, err = createJob(ctx, pb_job.JobState_PENDING, pb_job.JobState_SUCCEEDED)\n\t\tassert.NoError(t, err)\n\t}\n\n\tfor i := 0; i < 50; i++ {\n\t\t_, err = createJob(ctx, pb_job.JobState_RUNNING, pb_job.JobState_SUCCEEDED)\n\t\tassert.NoError(t, err)\n\t}\n\n\terr = RecoverJobsByState(\n\t\tctx, scope, csStore, jobStatesAll, recoverTaskRandomly, false, false)\n\tassert.Error(t, err)\n}", "title": "" }, { "docid": "f2d96bcc7079e5f5f0b539a9cd269790", "score": "0.46752584", "text": "func testCatchup() {\n\t// No need to test \"catching up\" with single server\n\tif len(pt.servers) == 1 {\n\t\tfmt.Println(\"PASS\")\n\t\tpassCount++\n\t\treturn\n\t}\n\n\tnumServers := len(pt.servers)\n\n\tpt.n++\n\tpt.cmdNum++\n\n\tcmd1 := paxosrpc.Command{\n\t\tCommandNumber: pt.cmdNum,\n\t\tType: paxosrpc.Init,\n\t\tPlayer: \"testCatchup1\",\n\t\tHostport: *master,\n\t}\n\n\tcommitCmd(cmd1, pt.n, pt.cmdNum, pt.servers[0:len(pt.servers)/2+1], numServers)\n\tpt.n += 30 // Just to be safe :)\n\tpt.cmdNum++\n\n\tcmd2 := paxosrpc.Command{\n\t\tCommandNumber: pt.cmdNum,\n\t\tType: paxosrpc.Init,\n\t\tPlayer: \"testCatchup2\",\n\t\tHostport: *master,\n\t}\n\n\tcommitCmd(cmd2, pt.n, pt.cmdNum, pt.servers[len(pt.servers)/2:len(pt.servers)], numServers)\n\tpt.n += 30\n\tpt.cmdNum++\n\n\tcmd3 := paxosrpc.Command{\n\t\tCommandNumber: pt.cmdNum,\n\t\tType: paxosrpc.NOP,\n\t}\n\n\tcommitCmd(cmd3, pt.n, pt.cmdNum, pt.servers, numServers)\n\n\t// Wait for servers to sync up\n\ttime.Sleep(5 * time.Second)\n\n\tpt.n += 30\n\tcheckCommited(cmd1, pt.n, pt.servers)\n\tpt.n += 30\n\tcheckCommited(cmd2, pt.n, pt.servers)\n\tpt.n += 30\n\tcheckCommited(cmd3, pt.n, pt.servers)\n\n\tfmt.Println(\"PASS\")\n\tpassCount++\n}", "title": "" }, { "docid": "9e54e83606576446766bec466a2f732b", "score": "0.4670146", "text": "func (s *smokeTest) RunMultiple(wg *sync.WaitGroup, testCase testRunner) {\n\tdefer wg.Done()\n\ts.TestRunner(testCase)\n}", "title": "" }, { "docid": "5e0c82000701eb0ce7eae3c2b4c09339", "score": "0.46648127", "text": "func TestWebhooks(t *testing.T) {\n\tt.Parallel()\n\t//nolint\n\ttype args struct {\n\t\tname string\n\t\tdl checker.DetailLogger\n\t\tr *checker.WebhooksData\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs args\n\t\twant checker.CheckResult\n\t\twantErr bool\n\t}{\n\t\t{\n\t\t\tname: \"r nil\",\n\t\t\targs: args{\n\t\t\t\tname: \"test_webhook_check_pass\",\n\t\t\t\tdl: &scut.TestDetailLogger{},\n\t\t\t},\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname: \"no webhooks\",\n\t\t\targs: args{\n\t\t\t\tname: \"no webhooks\",\n\t\t\t\tdl: &scut.TestDetailLogger{},\n\t\t\t\tr: &checker.WebhooksData{},\n\t\t\t},\n\t\t\twant: checker.CheckResult{\n\t\t\t\tScore: checker.MaxResultScore,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"1 webhook with secret\",\n\t\t\targs: args{\n\t\t\t\tname: \"1 webhook with secret\",\n\t\t\t\tdl: &scut.TestDetailLogger{},\n\t\t\t\tr: &checker.WebhooksData{\n\t\t\t\t\tWebhooks: []clients.Webhook{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPath: \"https://github.com/owner/repo/settings/hooks/1234\",\n\t\t\t\t\t\t\tID: 1234,\n\t\t\t\t\t\t\tUsesAuthSecret: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: checker.CheckResult{\n\t\t\t\tScore: 10,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"1 webhook with no secret\",\n\t\t\targs: args{\n\t\t\t\tname: \"1 webhook with no secret\",\n\t\t\t\tdl: &scut.TestDetailLogger{},\n\t\t\t\tr: &checker.WebhooksData{\n\t\t\t\t\tWebhooks: []clients.Webhook{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPath: \"https://github.com/owner/repo/settings/hooks/1234\",\n\t\t\t\t\t\t\tID: 1234,\n\t\t\t\t\t\t\tUsesAuthSecret: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: checker.CheckResult{\n\t\t\t\tScore: 0,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"many webhooks with no secret and with secret\",\n\t\t\targs: args{\n\t\t\t\tname: \"many webhooks with no secret and with secret\",\n\t\t\t\tdl: &scut.TestDetailLogger{},\n\t\t\t\tr: &checker.WebhooksData{\n\t\t\t\t\tWebhooks: []clients.Webhook{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPath: \"https://github.com/owner/repo/settings/hooks/1234\",\n\t\t\t\t\t\t\tID: 1234,\n\t\t\t\t\t\t\tUsesAuthSecret: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPath: \"https://github.com/owner/repo/settings/hooks/1111\",\n\t\t\t\t\t\t\tID: 1111,\n\t\t\t\t\t\t\tUsesAuthSecret: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPath: \"https://github.com/owner/repo/settings/hooks/4444\",\n\t\t\t\t\t\t\tID: 4444,\n\t\t\t\t\t\t\tUsesAuthSecret: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPath: \"https://github.com/owner/repo/settings/hooks/3333\",\n\t\t\t\t\t\t\tID: 3333,\n\t\t\t\t\t\t\tUsesAuthSecret: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPath: \"https://github.com/owner/repo/settings/hooks/2222\",\n\t\t\t\t\t\t\tID: 2222,\n\t\t\t\t\t\t\tUsesAuthSecret: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: checker.CheckResult{\n\t\t\t\tScore: 6,\n\t\t\t},\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\ttt := tt\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tgot := Webhooks(tt.args.name, tt.args.dl, tt.args.r)\n\t\t\tif tt.wantErr {\n\t\t\t\tif got.Error == nil {\n\t\t\t\t\tt.Errorf(\"Webhooks() error = %v, wantErr %v\", got.Error, tt.wantErr)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif got.Score != tt.want.Score {\n\t\t\t\t\tt.Errorf(\"Webhooks() = %v, want %v\", got.Score, tt.want.Score)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "0be8c4ee07c869493d212e8f948f3472", "score": "0.46636528", "text": "func TestRunBacktesttestCancelAllOrder(t *testing.T) {\n\tb := &testCancelAllMystrat{}\n\n\tdata := pine.OHLCVTestData(time.Now(), 3, 5*60*1000)\n\tdata[0].C = 14\n\tdata[1].L = 13\n\tdata[1].C = 13\n\tdata[2].L = 10\n\tdata[2].C = 10\n\tseries, _ := pine.NewOHLCVSeries(data)\n\n\tres, err := RunBacktest(series, b)\n\tif err != nil {\n\t\tt.Fatal(errors.Wrap(err, \"error runbacktest\"))\n\t}\n\n\tif res.TotalClosedTrades != 0 {\n\t\tt.Errorf(\"Expected total trades to be 0 but got %d\", res.TotalClosedTrades)\n\t}\n}", "title": "" }, { "docid": "fe9e97d17b2ab94a4d53256c99a669f9", "score": "0.46620497", "text": "func (mock *ISequenceTaskEventHookMock) OnSequenceTaskEventCalls() []struct {\n\tKeptnContextExtendedCE apimodels.KeptnContextExtendedCE\n} {\n\tvar calls []struct {\n\t\tKeptnContextExtendedCE apimodels.KeptnContextExtendedCE\n\t}\n\tmock.lockOnSequenceTaskEvent.RLock()\n\tcalls = mock.calls.OnSequenceTaskEvent\n\tmock.lockOnSequenceTaskEvent.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "2b66772d9ca66c8056307257e73829c7", "score": "0.4661564", "text": "func TestIterativeRandomStateSyncIndividual(t *testing.T) { testIterativeRandomStateSync(t, 1) }", "title": "" }, { "docid": "012f0a626d7baa1929ddf1d50a2e3c56", "score": "0.46610576", "text": "func TestInvalidArguments(t *testing.T) {\n\tfor i, command := range invalidCommands {\n\t\tcmd := exec.Command(\"go\", append(commandBaseArgs, command...)...)\n\t\tif err := cmd.Run(); err == nil || err.Error() != \"exit status 1\" {\n\t\t\tt.Errorf(\"error invalid return status for command %v. Expecting failure exit status!\", i)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "54e582f58fd8adbd762548d275595c69", "score": "0.46610364", "text": "func TestInterrupt(t *testing.T) {\n\n\tfor _, tt := range interruptests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\n\t\t\tunderTest := tt.actor\n\n\t\t\t// Run the actor.\n\t\t\terrors := make(chan error)\n\t\t\tgo func(a actor.Actor) {\n\t\t\t\terrors <- a.Execute()\n\t\t\t}(underTest)\n\n\t\t\t// Signal for the actor to stop\n\t\t\tunderTest.Interrupt(nil)\n\n\t\t\tselect {\n\t\t\tcase <-errors:\n\t\t\t\treturn\n\t\t\tcase <-time.After(1 * time.Second):\n\t\t\t}\n\n\t\t\tt.Error(\"actor didn't shut down in response to interrupt\")\n\n\t\t})\n\t}\n}", "title": "" }, { "docid": "cea37701164d8e677e676afd6d35a939", "score": "0.46597922", "text": "func fail(rate int) {\n\tfor {\n\t\ttime.Sleep(100 * time.Millisecond)\n\t\tn := rand.Intn(100)\n\t\tif rate > n {\n\t\t\tlog.Println(\"Random Failure\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "54e1eb53cb52985343683215b00de944", "score": "0.4657321", "text": "func (ctx *Context) RunTests(ctxT *testing.T) *Context {\n\tallSkipped := true\n\n\tctx.validate()\n\n\tfor _, spec := range ctx.specs {\n\n\t\tvar hookErr error\n\t\tif hookErr = ctx.beforeSpec.run(\"before spec\"); hookErr != nil {\n\t\t\tspec.skipAllScenarios()\n\t\t\tspec.result = panicked\n\t\t}\n\n\t\tctxT.Run(spec.path+\"/\"+spec.name, func(specT *testing.T) {\n\t\t\tif hookErr != nil {\n\t\t\t\tspecT.FailNow()\n\t\t\t}\n\n\t\t\tspec.run(specT)\n\n\t\t\tif !specT.Skipped() {\n\t\t\t\tallSkipped = false\n\t\t\t}\n\n\t\t\tif hookErr = ctx.afterSpec.run(\"after spec\"); hookErr != nil {\n\t\t\t\tspec.result = panicked\n\t\t\t\tspecT.Fail()\n\n\t\t\t}\n\t\t})\n\t}\n\n\tctx.log.writeToConsole()\n\tctx.log.writeToFile()\n\n\tif allSkipped {\n\t\tctxT.SkipNow()\n\t}\n\n\treturn ctx\n}", "title": "" }, { "docid": "4ec057808fd735c59f4587e51f99ca67", "score": "0.46525392", "text": "func (t *AcceptanceTest) Run() {\n\terrc := make(chan error)\n\n\tfor _, am := range t.amc.ams {\n\t\tam.errc = errc\n\t\tdefer func(am *Alertmanager) {\n\t\t\tam.Terminate()\n\t\t\tam.cleanup()\n\t\t\tt.Logf(\"stdout:\\n%v\", am.cmd.Stdout)\n\t\t\tt.Logf(\"stderr:\\n%v\", am.cmd.Stderr)\n\t\t}(am)\n\t}\n\n\terr := t.amc.Start()\n\tif err != nil {\n\t\tt.T.Fatal(err)\n\t}\n\n\t// Set the reference time right before running the test actions to avoid\n\t// test failures due to slow setup of the test environment.\n\tt.opts.baseTime = time.Now()\n\n\tgo t.runActions()\n\n\tvar latest float64\n\tfor _, coll := range t.collectors {\n\t\tif l := coll.latest(); l > latest {\n\t\t\tlatest = l\n\t\t}\n\t}\n\n\tdeadline := t.opts.expandTime(latest)\n\n\tselect {\n\tcase <-time.After(time.Until(deadline)):\n\t\t// continue\n\tcase err := <-errc:\n\t\tt.Error(err)\n\t}\n}", "title": "" }, { "docid": "6b85be50debac6c597ea4df39d2d4d6a", "score": "0.46513155", "text": "func TestRecoveryWithFailedJobBatches(t *testing.T) {\n\tvar err error\n\tvar jobID *peloton.JobID\n\tvar activeJobs []*peloton.JobID\n\n\tcount = 0\n\tctx := context.Background()\n\n\tfor i := 0; i < 50; i++ {\n\t\tjobID, err = createJob(ctx, pb_job.JobState_PENDING, pb_job.JobState_SUCCEEDED)\n\t\tassert.NoError(t, err)\n\t\tactiveJobs = append(activeJobs, jobID)\n\t}\n\n\tfor i := 0; i < 50; i++ {\n\t\tjobID, err = createJob(ctx, pb_job.JobState_RUNNING, pb_job.JobState_SUCCEEDED)\n\t\tassert.NoError(t, err)\n\t\tactiveJobs = append(activeJobs, jobID)\n\t}\n\n\terr = RecoverActiveJobs(\n\t\tctx, scope, activeJobsOps, jobConfigOps, jobRuntimeOps, recoverFailTaskRandomly)\n\tassert.Error(t, err)\n\n\tfor _, jobID := range activeJobs {\n\t\t// Delete these jobIDs from active jobs table to clear the state for\n\t\t// next tests\n\t\terr = activeJobsOps.Delete(ctx, jobID)\n\t\tassert.NoError(t, err)\n\t}\n}", "title": "" }, { "docid": "9a87a82e58afe8f97cc64d002a2c609f", "score": "0.46467343", "text": "func (m mockService) Call() error {\n\trandomSleep()\n\treturn randomError()\n}", "title": "" }, { "docid": "35f4469958c14a67d5b91adcfe0ac4c3", "score": "0.46419114", "text": "func TestBlankRun(t *testing.T) {\n\tdefer func() {\n\t\texitAdvice = os.Exit\n\t}()\n\texitAdvice = func(code int) {}\n\tmain()\n}", "title": "" }, { "docid": "04b7ce76832ac186abe729eccbcb6acd", "score": "0.4640687", "text": "func (m *LocalNodeProfileMock) ValidateCallCounters() {\n\n\tif !m.GetAnnouncementSignatureFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetAnnouncementSignature\")\n\t}\n\n\tif !m.GetDeclaredPowerFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetDeclaredPower\")\n\t}\n\n\tif !m.GetDefaultEndpointFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetDefaultEndpoint\")\n\t}\n\n\tif !m.GetIndexFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetIndex\")\n\t}\n\n\tif !m.GetIntroductionFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetIntroduction\")\n\t}\n\n\tif !m.GetNodePublicKeyFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetNodePublicKey\")\n\t}\n\n\tif !m.GetNodePublicKeyStoreFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetNodePublicKeyStore\")\n\t}\n\n\tif !m.GetOpModeFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetOpMode\")\n\t}\n\n\tif !m.GetPrimaryRoleFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetPrimaryRole\")\n\t}\n\n\tif !m.GetShortNodeIDFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetShortNodeID\")\n\t}\n\n\tif !m.GetSignatureVerifierFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetSignatureVerifier\")\n\t}\n\n\tif !m.GetSpecialRolesFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetSpecialRoles\")\n\t}\n\n\tif !m.GetStartPowerFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.GetStartPower\")\n\t}\n\n\tif !m.HasIntroductionFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.HasIntroduction\")\n\t}\n\n\tif !m.IsAcceptableHostFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.IsAcceptableHost\")\n\t}\n\n\tif !m.IsJoinerFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.IsJoiner\")\n\t}\n\n\tif !m.LocalNodeProfileFinished() {\n\t\tm.t.Fatal(\"Expected call to LocalNodeProfileMock.LocalNodeProfile\")\n\t}\n\n}", "title": "" } ]
6edeed1bc71213b42e0dbd70f2dba06f
IDsX is like IDs, but panics if an error occurs.
[ { "docid": "f6d38719ee24b1bc07027ed4c3b89c8c", "score": "0.68651974", "text": "func (cq *CommentQuery) IDsX(ctx context.Context) []string {\n\tids, err := cq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" } ]
[ { "docid": "09a8223cc2442adabd3063e9639b7310", "score": "0.7437816", "text": "func (pdq *PingDetectorQuery) IDsX(ctx context.Context) []int {\n\tids, err := pdq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "741ff3c3f04984e54ce4915712648123", "score": "0.74272853", "text": "func (hdrq *HTTPDetectorResultQuery) IDsX(ctx context.Context) []int {\n\tids, err := hdrq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "91badf79ae7f96471c61cf7b259ce842", "score": "0.7389583", "text": "func (pq *PatientrightsQuery) IDsX(ctx context.Context) []int {\n\tids, err := pq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "156cf9634259619cfaa059cba1d981c9", "score": "0.7384234", "text": "func (dpq *DevicePlatformQuery) IDsX(ctx context.Context) []int {\n\tids, err := dpq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "8c3ac758d266c7784e1b376f8966f9ba", "score": "0.7340263", "text": "func (dq *DeviceQuery) IDsX(ctx context.Context) []int32 {\n\tids, err := dq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "8c03ccbdd658eef9efc7cd2f68134eb7", "score": "0.7328415", "text": "func (uarq *UserActiveRecordQuery) IDsX(ctx context.Context) []string {\n\tids, err := uarq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "452c51e23a0d54838b3d10090f85a766", "score": "0.7323164", "text": "func (dmq *DeathMannerQuery) IDsX(ctx context.Context) []int {\n\tids, err := dmq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "07651b57996c9836ce4d44fefdec4719", "score": "0.7322296", "text": "func (dqq *DNSBLQueryQuery) IDsX(ctx context.Context) []uuid.UUID {\n\tids, err := dqq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "2749f43a32db34a731d8cedf6b7841d1", "score": "0.7319363", "text": "func (sdiq *SysDictItemQuery) IDsX(ctx context.Context) []string {\n\tids, err := sdiq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "73ae402f5bda967c713ac2e8b124512b", "score": "0.7304006", "text": "func (siq *ServiceInfoQuery) IDsX(ctx context.Context) []int64 {\n\tids, err := siq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "00ed18e4707c058c1aead514c2f60eef", "score": "0.7293227", "text": "func (sq *ShopQuery) IDsX(ctx context.Context) []int {\n\tids, err := sq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "71ef4bcac3b083fd089af1e9c02bf166", "score": "0.7277218", "text": "func (mq *MusicQuery) IDsX(ctx context.Context) []int {\n\tids, err := mq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "3575212545d061331754c2437cae5877", "score": "0.72663486", "text": "func (ismq *ImplicitSkippedMessageQuery) IDsX(ctx context.Context) []int {\n\tids, err := ismq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "0a317191e6307767da06a27d8ebfaf42", "score": "0.7251751", "text": "func (pq *PCQuery) IDsX(ctx context.Context) []string {\n\tids, err := pq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "96bde1c68da34aab8ae25ab366451f29", "score": "0.72516936", "text": "func (lq *LimitpointQuery) IDsX(ctx context.Context) []int {\n\tids, err := lq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "e6d121c41db6a40f91c3f21dad498613", "score": "0.7248232", "text": "func (giq *GroupInfoQuery) IDsX(ctx context.Context) []int {\n\tids, err := giq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "2a03f4188a94ddadafd92a042ee6f234", "score": "0.7228907", "text": "func (srq *SysRoleQuery) IDsX(ctx context.Context) []string {\n\tids, err := srq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "0ff580edc18cb69336af86542139e7e1", "score": "0.72239184", "text": "func (trq *TradeRecordQuery) IDsX(ctx context.Context) []int {\n\tids, err := trq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "d9810c953604d6de9368b98eda905390", "score": "0.71956784", "text": "func (bq *BouncerQuery) IDsX(ctx context.Context) []int {\n\tids, err := bq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "ee4e49dae93e1b61956a55a81139a2a9", "score": "0.7192808", "text": "func (biq *BinaryItemQuery) IDsX(ctx context.Context) []int {\n\tids, err := biq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "f731b587d3969cf9210e639145b26d04", "score": "0.71907943", "text": "func (ciq *CarInspectionQuery) IDsX(ctx context.Context) []int {\n\tids, err := ciq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "bc781b1ca9400812b390e131cf2842c0", "score": "0.71824086", "text": "func (ruq *RoleUKMQuery) IDsX(ctx context.Context) []int {\n\tids, err := ruq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "d775147de08e6382a00fb4e5a2a42424", "score": "0.717959", "text": "func (gq *GroupsQuery) IDsX(ctx context.Context) []int {\n\tids, err := gq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "abe0267a8be4f080019a26b701f964ec", "score": "0.71779996", "text": "func (oq *OrganizationQuery) IDsX(ctx context.Context) []int {\n\tids, err := oq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "62e18741bf029a51e27dd7776c7868d7", "score": "0.71773344", "text": "func (epq *ExitPointQuery) IDsX(ctx context.Context) []int {\n\tids, err := epq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "cb4c39452d87b0c6b33b9dc7ceca1923", "score": "0.7163532", "text": "func (bq *BlockQuery) IDsX(ctx context.Context) []uuid.UUID {\n\tids, err := bq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "27f317eea64202b498cbe32678a71b8b", "score": "0.71466434", "text": "func (ntdmq *NetTopologyDeviceMapQuery) IDsX(ctx context.Context) []int {\n\tids, err := ntdmq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "acfdda6008bb135bd81b7240066cb38c", "score": "0.7136522", "text": "func (dq *DividendQuery) IDsX(ctx context.Context) []int {\n\tids, err := dq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "5957b2e1fed4485afecee0386066d032", "score": "0.7126583", "text": "func (rq *ReplyQuery) IDsX(ctx context.Context) []uint64 {\n\tids, err := rq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "47b67ff8269c29cdd2f0c3f5daa93c2b", "score": "0.71215326", "text": "func (srq *StatusReserveQuery) IDsX(ctx context.Context) []int {\n\tids, err := srq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "3647c023992402df42e092bf5f6e88ee", "score": "0.7116834", "text": "func (fq *FileimportQuery) IDsX(ctx context.Context) []int {\n\tids, err := fq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "78851d9c062649824f723b1a12ded0e8", "score": "0.7113424", "text": "func (pq *PointpendinglbtransactionQuery) IDsX(ctx context.Context) []int {\n\tids, err := pq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "1c05f9c52c5ab5ea02034b756af48735", "score": "0.711019", "text": "func (eq *EntityQuery) IDsX(ctx context.Context) []int {\n\tids, err := eq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "13629e18e6a2eb6f2c3c9df49dbf407d", "score": "0.71079373", "text": "func (ppq *PoolPropertiesQuery) IDsX(ctx context.Context) []int {\n\tids, err := ppq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "eb2bb3b37244237618abd0c06717253d", "score": "0.707991", "text": "func (ptq *PostThumbnailQuery) IDsX(ctx context.Context) []int {\n\tids, err := ptq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "2c738d40c1812d9bd4d7ef91da0ea4b8", "score": "0.704949", "text": "func (aq *AccountQuery) IDsX(ctx context.Context) []sid.ID {\n\tids, err := aq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "ec70dd157db3e7dce2eb433a402802bc", "score": "0.7007837", "text": "func (oumq *OrgUnitMemberQuery) IDsX(ctx context.Context) []int {\n\tids, err := oumq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "7fab97f7f6b83ea444ae1eb6125ba316", "score": "0.69957757", "text": "func (wq *WalletQuery) IDsX(ctx context.Context) []uuid.UUID {\n\tids, err := wq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "1d691058e7cd90e9d72583519f1e3696", "score": "0.6993161", "text": "func (rtq *RequestTargetQuery) IDsX(ctx context.Context) []uuid.UUID {\n\tids, err := rtq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "8b50d8b2100709b17f5dbdeb159cdd1c", "score": "0.69510543", "text": "func (woq *WorkOrderQuery) IDsX(ctx context.Context) []string {\n\tids, err := woq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "f7137351a68ddf010c5403703e047ab7", "score": "0.69375086", "text": "func (paq *PostAttachmentQuery) IDsX(ctx context.Context) []int {\n\tids, err := paq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "305e084a1422c0bbb13f5f2b56f2418a", "score": "0.69224095", "text": "func (fq *FormulaQuery) IDsX(ctx context.Context) []int {\n\tids, err := fq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "0bc68216cad356a0d081ddaa8982f018", "score": "0.6919854", "text": "func (pq *PropertyQuery) IDsX(ctx context.Context) []string {\n\tids, err := pq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "939268c049f24dbba44821d7e1925ec1", "score": "0.6798602", "text": "func (mcq *MstCustomerQuery) IDsX(ctx context.Context) []int {\n\tids, err := mcq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "31260d5daa95c201bf802c25da9ed482", "score": "0.6795996", "text": "func (wodq *WorkOrderDefinitionQuery) IDsX(ctx context.Context) []string {\n\tids, err := wodq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "01b99af2b13ff7552dcde05cac253867", "score": "0.67605907", "text": "func (bcq *BaselineCategoryQuery) IDsX(ctx context.Context) []int {\n\tids, err := bcq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "a6bf6378feb766bfc9f0f4852e574ddc", "score": "0.675696", "text": "func (gbq *GroupBudgetQuery) IDsX(ctx context.Context) []uuid.UUID {\n\tids, err := gbq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "b4b5bd5597d6fe1acbb9c028ec1d96b6", "score": "0.6751788", "text": "func (clcdq *CheckListCategoryDefinitionQuery) IDsX(ctx context.Context) []int {\n\tids, err := clcdq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "f72ffc65f9897e5ec87e619a2dd77f3c", "score": "0.6526768", "text": "func (cbq *ClubBranchQuery) IDsX(ctx context.Context) []int {\n\tids, err := cbq.IDs(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "85680f309df940b417b1534dcf03b58a", "score": "0.63675565", "text": "func (dqs *DNSBLQuerySelect) IntsX(ctx context.Context) []int {\n\tv, err := dqs.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "c27b39e1e773b83c807a41b2440545e1", "score": "0.63541776", "text": "func (ps *PatientrightsSelect) IntsX(ctx context.Context) []int {\n\tv, err := ps.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "b633c935273d07b8292a5155bc1df73e", "score": "0.63213193", "text": "func (uars *UserActiveRecordSelect) IntsX(ctx context.Context) []int {\n\tv, err := uars.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "0629fbde2507969c3d571e84f58e22a7", "score": "0.62549525", "text": "func (dms *DeathMannerSelect) IntsX(ctx context.Context) []int {\n\tv, err := dms.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "31bcf05a136c01c786ff5ba932afe0d1", "score": "0.623041", "text": "func (rus *RoleUKMSelect) IntsX(ctx context.Context) []int {\n\tv, err := rus.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "a6c6197539ee5c0aa01c253a68184fea", "score": "0.62247324", "text": "func (isms *ImplicitSkippedMessageSelect) IntsX(ctx context.Context) []int {\n\tv, err := isms.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "71df698fab9361970d5ceb9419d03f5c", "score": "0.62112904", "text": "func (gs *GroupsSelect) IntsX(ctx context.Context) []int {\n\tv, err := gs.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "5efbad704e87d0c39eae52f33e6781eb", "score": "0.62086695", "text": "func (os *OrganizationSelect) IntsX(ctx context.Context) []int {\n\tv, err := os.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "68c7046ed9470a1e972d71b4049584ff", "score": "0.6182454", "text": "func (sdis *SysDictItemSelect) IntsX(ctx context.Context) []int {\n\tv, err := sdis.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "2d02608aaa6c1fa744301da95fcdf5f4", "score": "0.61706626", "text": "func (srs *SysRoleSelect) IntsX(ctx context.Context) []int {\n\tv, err := srs.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "4fbfd738731522a4ae2bfd383c4af4ec", "score": "0.61701727", "text": "func (sis *ServiceInfoSelect) IntsX(ctx context.Context) []int {\n\tv, err := sis.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "cbfc351ae8917d1720f07cd5bc10c40f", "score": "0.6130616", "text": "func (dps *DevicePlatformSelect) IntsX(ctx context.Context) []int {\n\tv, err := dps.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "0982c2d48d3dbde6539d7edc6afd7f5a", "score": "0.61010045", "text": "func (s *selector) IntsX(ctx context.Context) []int {\n\tv, err := s.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "2d7e95388707d4fc704bdb3049438816", "score": "0.6077437", "text": "func (pgb *PatientrightsGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := pgb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "0a4f9edd85a2f12a1a014344c80e6c09", "score": "0.6059545", "text": "func (ps *PatientrightsSelect) IntX(ctx context.Context) int {\n\tv, err := ps.Int(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "3747fbc2ab598c76f7d238a7725b2093", "score": "0.6047634", "text": "func (dqgb *DNSBLQueryGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := dqgb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "017e610b1d18ab3ad35049f4dcfbb0f1", "score": "0.60444504", "text": "func (ls *LimitpointSelect) IntsX(ctx context.Context) []int {\n\tv, err := ls.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "c83cff37e98699e83af873c8e6a9239f", "score": "0.6041219", "text": "func (ms *MusicSelect) IntsX(ctx context.Context) []int {\n\tv, err := ms.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "ba5fb670389eeb3d278c146483d97702", "score": "0.60316545", "text": "func (dpgb *DevicePlatformGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := dpgb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "158428930b7891570749ca81cdf94f93", "score": "0.60311335", "text": "func (dqs *DNSBLQuerySelect) IntX(ctx context.Context) int {\n\tv, err := dqs.Int(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "566f020a09089b5619b7d07d7e9c121a", "score": "0.6025743", "text": "func (srgb *SysRoleGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := srgb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "56d575ef47ea3d941772d871a8dbe461", "score": "0.6009623", "text": "func (dms *DeathMannerSelect) IntX(ctx context.Context) int {\n\tv, err := dms.Int(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "43ce3b482a42d5714f817d72c6884d68", "score": "0.60001314", "text": "func (pas *PostAttachmentSelect) IntsX(ctx context.Context) []int {\n\tv, err := pas.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "958f2cc66b2f56909088c3198ecd36c2", "score": "0.599167", "text": "func (isms *ImplicitSkippedMessageSelect) IntX(ctx context.Context) int {\n\tv, err := isms.Int(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "53784108b5e86b79808505082a331726", "score": "0.59833825", "text": "func (sdis *SysDictItemSelect) IntX(ctx context.Context) int {\n\tv, err := sdis.Int(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "df6c4d04ef0dfeba6a63ba522f7d6171", "score": "0.5978793", "text": "func (cis *CarInspectionSelect) IntsX(ctx context.Context) []int {\n\tv, err := cis.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "ce62f3dd5e14d9615188d11eee0ac08e", "score": "0.59673434", "text": "func (clcds *CheckListCategoryDefinitionSelect) IntsX(ctx context.Context) []int {\n\tv, err := clcds.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "300088caaa47b75b26e53b3a91c812c7", "score": "0.5964975", "text": "func (bs *BouncerSelect) IntsX(ctx context.Context) []int {\n\tv, err := bs.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "7803dd9056eee71f6e34efc7aa6def2b", "score": "0.5958902", "text": "func (fs *FileimportSelect) IntsX(ctx context.Context) []int {\n\tv, err := fs.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "da7462b50a83d3c61b21bb7379fb5e70", "score": "0.5958307", "text": "func (pts *PostThumbnailSelect) IntsX(ctx context.Context) []int {\n\tv, err := pts.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "4d8435c6cf434872c18e700dd7a53851", "score": "0.595534", "text": "func (srs *StatusReserveSelect) IntsX(ctx context.Context) []int {\n\tv, err := srs.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "ff66f9ac3fde5f7762e32bd5e75385a0", "score": "0.5953483", "text": "func (oums *OrgUnitMemberSelect) IntsX(ctx context.Context) []int {\n\tv, err := oums.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "b7321f9ec612cb29f67067a1cd7cbb3c", "score": "0.59479815", "text": "func (bis *BinaryItemSelect) IntsX(ctx context.Context) []int {\n\tv, err := bis.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "05ee7f9845c895d49fb23b60d0bba2b6", "score": "0.5934631", "text": "func (sis *ServiceInfoSelect) IntX(ctx context.Context) int {\n\tv, err := sis.Int(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "62fe1279034a6d7d24752a9afbd4a23f", "score": "0.5894369", "text": "func (fs *FormulaSelect) IntsX(ctx context.Context) []int {\n\tv, err := fs.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "4f3d70f8a14adfbe1bfdf06bc979fb7e", "score": "0.589402", "text": "func (ps *PropertySelect) IntsX(ctx context.Context) []int {\n\tv, err := ps.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "f994bfe2a4b175889bd7c1cd89855f29", "score": "0.5881309", "text": "func (sdigb *SysDictItemGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := sdigb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "df78c2475b1cd1e8ad3037ea04bd58b2", "score": "0.58679", "text": "func (uargb *UserActiveRecordGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := uargb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "5f8c98c347688d08a0887bf7c188e195", "score": "0.586788", "text": "func (rugb *RoleUKMGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := rugb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "488ddec57e270ee66aafa320b729b400", "score": "0.5865618", "text": "func (dmgb *DeathMannerGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := dmgb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "4332675d49b20ecf750baca017c5a0e6", "score": "0.5860726", "text": "func (ntdms *NetTopologyDeviceMapSelect) IntsX(ctx context.Context) []int {\n\tv, err := ntdms.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "e1b762e1b949ac5b190f79233ed65322", "score": "0.585701", "text": "func (mcs *MstCustomerSelect) IntsX(ctx context.Context) []int {\n\tv, err := mcs.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "1b3d6be70a17e278dd59ab21efb434cd", "score": "0.5851181", "text": "func (sigb *ServiceInfoGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := sigb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "50969cd4b5fc1140e0bab6b3a995406a", "score": "0.58351076", "text": "func (dps *DevicePlatformSelect) IntX(ctx context.Context) int {\n\tv, err := dps.Int(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "eaff8b176e7f3fc3efb1e067a6429c66", "score": "0.5819581", "text": "func (pps *PoolPropertiesSelect) IntsX(ctx context.Context) []int {\n\tv, err := pps.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "806fa08be49411e2b4c328cc2c6abf9d", "score": "0.5813084", "text": "func (wos *WorkOrderSelect) IntsX(ctx context.Context) []int {\n\tv, err := wos.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "f807139b76d7919e963b7f81846ed520", "score": "0.5811631", "text": "func (srs *SysRoleSelect) IntX(ctx context.Context) int {\n\tv, err := srs.Int(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "8911e5423090b6197949d3c2d06a81ea", "score": "0.57831144", "text": "func (srgb *StatusReserveGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := srgb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "bd791061238f9f1614e6ca4fe9c91f0b", "score": "0.5775173", "text": "func (ntdms *NetTopologyDeviceMapSelect) IntX(ctx context.Context) int {\n\tv, err := ntdms.Int(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "99d180fa94a4c6f156312b666cf45c1e", "score": "0.5756702", "text": "func (lgb *LimitpointGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := lgb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "c1839e2c9e9f2444b5fe458801764c13", "score": "0.5750867", "text": "func (ismgb *ImplicitSkippedMessageGroupBy) IntsX(ctx context.Context) []int {\n\tv, err := ismgb.Ints(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" } ]
9cad454d8226a49858cb8529368c0b95
isAddendaSequence check multiple errors on addenda records in the batch entries
[ { "docid": "90efba35edc73c010677584fa0051cd5", "score": "0.84147483", "text": "func (batch *Batch) isAddendaSequence() error {\n\tfor _, entry := range batch.Entries {\n\n\t\tif entry.Addenda02 != nil {\n\t\t\tif entry.AddendaRecordIndicator != 1 {\n\t\t\t\treturn batch.Error(\"AddendaRecordIndicator\", ErrBatchAddendaIndicator)\n\t\t\t}\n\t\t}\n\t\tif len(entry.Addenda05) > 0 {\n\t\t\t// addenda without indicator flag of 1\n\t\t\tif entry.AddendaRecordIndicator != 1 {\n\t\t\t\treturn batch.Error(\"AddendaRecordIndicator\", ErrBatchAddendaIndicator)\n\t\t\t}\n\t\t\tlastSeq := -1\n\t\t\t// check if sequence is ascending\n\t\t\tfor _, a := range entry.Addenda05 {\n\t\t\t\t// sequences don't exist in NOC or Return addenda\n\n\t\t\t\tif a.SequenceNumber < lastSeq {\n\t\t\t\t\treturn batch.Error(\"SequenceNumber\", NewErrBatchAscending(lastSeq, a.SequenceNumber))\n\t\t\t\t}\n\t\t\t\tlastSeq = a.SequenceNumber\n\t\t\t\t// check that we are in the correct Entry Detail\n\t\t\t\tif !(a.EntryDetailSequenceNumberField() == entry.TraceNumberField()[8:]) {\n\t\t\t\t\treturn batch.Error(\"TraceNumber\", NewErrBatchAscending(lastSeq, a.SequenceNumber))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif entry.Addenda98 != nil {\n\t\t\tif entry.AddendaRecordIndicator != 1 {\n\t\t\t\treturn batch.Error(\"AddendaRecordIndicator\", ErrBatchAddendaIndicator)\n\t\t\t}\n\t\t}\n\t\tif entry.Addenda98Refused != nil {\n\t\t\tif entry.AddendaRecordIndicator != 1 {\n\t\t\t\treturn batch.Error(\"AddendaRecordIndicator\", ErrBatchAddendaIndicator)\n\t\t\t}\n\t\t}\n\t\tif entry.Addenda99 != nil {\n\t\t\tif entry.AddendaRecordIndicator != 1 {\n\t\t\t\treturn batch.Error(\"AddendaRecordIndicator\", ErrBatchAddendaIndicator)\n\t\t\t}\n\t\t}\n\t\tif entry.Addenda99Dishonored != nil {\n\t\t\tif entry.AddendaRecordIndicator != 1 {\n\t\t\t\treturn batch.Error(\"AddendaRecordIndicator\", ErrBatchAddendaIndicator)\n\t\t\t}\n\t\t}\n\t\tif entry.Addenda99Contested != nil {\n\t\t\tif entry.AddendaRecordIndicator != 1 {\n\t\t\t\treturn batch.Error(\"AddendaRecordIndicator\", ErrBatchAddendaIndicator)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "9d35f5c39e59c434c9553e49e09a5f93", "score": "0.6727176", "text": "func TestBatchATXInvalidAddenda(t *testing.T) {\n\ttestBatchATXInvalidAddenda(t)\n}", "title": "" }, { "docid": "791b8b1ab9f853328a3ee0344944f9cc", "score": "0.6502423", "text": "func TestBatchSHRInvalidAddenda(t *testing.T) {\n\ttestBatchSHRInvalidAddenda(t)\n}", "title": "" }, { "docid": "ce67f84916e48ff685dd0eabfa98437b", "score": "0.63995683", "text": "func testBatchATXInvalidAddenda(t testing.TB) {\n\tmockBatch := NewBatchATX(mockBatchATXHeader())\n\tmockBatch.AddEntry(mockATXEntryDetail())\n\taddenda05 := mockAddenda05()\n\taddenda05.TypeCode = \"63\"\n\tmockBatch.GetEntries()[0].AddAddenda05(addenda05)\n\terr := mockBatch.Create()\n\tif !base.Match(err, ErrAddendaTypeCode) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "69b7a86fc68d9f02f903c187cb1f0554", "score": "0.61840343", "text": "func testBatchSHRInvalidAddenda(t testing.TB) {\n\tmockBatch := NewBatchSHR(mockBatchSHRHeader())\n\tmockBatch.AddEntry(mockSHREntryDetail())\n\taddenda02 := mockAddenda02()\n\taddenda02.TypeCode = \"63\"\n\tmockBatch.GetEntries()[0].Addenda02 = addenda02\n\tmockBatch.Entries[0].AddendaRecordIndicator = 1\n\terr := mockBatch.Create()\n\tif !base.Match(err, ErrAddendaTypeCode) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "feca168b7117c7e8e1ac09a4232e8b9f", "score": "0.6138032", "text": "func testBatchATXAddendaRecords(t testing.TB) {\n\tbh := NewBatchHeader()\n\tbh.ServiceClassCode = CreditsOnly\n\tbh.StandardEntryClassCode = ATX\n\tbh.CompanyName = \"Payee Name\"\n\tbh.CompanyIdentification = \"231380104\"\n\tbh.CompanyEntryDescription = \"ACH ATX\"\n\tbh.ODFIIdentification = \"23138010\"\n\n\tentry := NewEntryDetail()\n\tentry.TransactionCode = CheckingZeroDollarRemittanceCredit\n\tentry.SetRDFI(\"121042882\")\n\tentry.DFIAccountNumber = \"744-5678-99\"\n\tentry.Amount = 0\n\tentry.SetOriginalTraceNumber(\"121042880000001\")\n\tentry.SetCATXAddendaRecords(565)\n\tentry.SetCATXReceivingCompany(\"Receiver Company\")\n\tentry.SetTraceNumber(mockBatchATXHeader().ODFIIdentification, 1)\n\tentry.DiscretionaryData = \"01\"\n\tentry.Category = CategoryForward\n\tentry.AddendaRecordIndicator = 1\n\n\tmockBatch := NewBatchATX(bh)\n\tmockBatch.AddEntry(entry)\n\n\tfor i := 0; i < 565; i++ {\n\t\tmockBatch.GetEntries()[0].AddAddenda05(mockAddenda05())\n\t}\n\n\terr := mockBatch.Create()\n\t// TODO: are we expecting there to be an error here?\n\tif !base.Match(err, nil) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "a1351b481540d3a6f9c35cd7790488af", "score": "0.61339754", "text": "func TestBatchATXInvalidAddend02(t *testing.T) {\n\tmockBatch := NewBatchATX(mockBatchATXHeader())\n\tentry := mockATXEntryDetail()\n\tentry.Addenda02 = mockAddenda02()\n\tmockBatch.AddEntry(entry)\n\terr := mockBatch.Create()\n\tif !base.Match(err, ErrBatchAddendaCategory) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "9e0d233c89e5100342c28eb094eee0c6", "score": "0.61246127", "text": "func (batch *Batch) isSequenceAscending() error {\n\tif !batch.IsADV() {\n\t\tlastSeq := \"0\"\n\t\tfor _, entry := range batch.Entries {\n\t\t\tif batch.validateOpts == nil || !batch.validateOpts.CustomTraceNumbers {\n\t\t\t\tif entry.TraceNumber <= lastSeq {\n\t\t\t\t\treturn batch.Error(\"TraceNumber\", NewErrBatchAscending(lastSeq, entry.TraceNumber))\n\t\t\t\t}\n\t\t\t}\n\t\t\tlastSeq = entry.TraceNumber\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6fbdde3944eca96a7e047aa6aa38def0", "score": "0.6069354", "text": "func testBatchATXAddendaCount(t testing.TB) {\n\tmockBatch := mockBatchATX(t)\n\tmockBatch.GetEntries()[0].AddendaRecordIndicator = 1\n\tmockBatch.GetEntries()[0].AddAddenda05(mockAddenda05())\n\terr := mockBatch.Create()\n\tif !base.Match(err, NewErrBatchExpectedAddendaCount(2, 1)) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "e3187ed0478066eb32ec50177f462707", "score": "0.59798944", "text": "func TestBatchATXAddendaRecords(t *testing.T) {\n\ttestBatchATXAddendaRecords(t)\n}", "title": "" }, { "docid": "ca583866778f6e8388046e15032414a6", "score": "0.5864843", "text": "func (batch *Batch) isBatchEntryCount() error {\n\tentryCount := 0\n\n\tif !batch.IsADV() {\n\t\tfor _, entry := range batch.Entries {\n\t\t\tentryCount += 1 + entry.addendaCount()\n\t\t}\n\t\tif entryCount != batch.Control.EntryAddendaCount {\n\t\t\tif batch.validateOpts != nil && batch.validateOpts.UnequalAddendaCounts {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn batch.Error(\"EntryAddendaCount\",\n\t\t\t\tNewErrBatchCalculatedControlEquality(entryCount, batch.Control.EntryAddendaCount))\n\t\t}\n\t} else {\n\t\tfor _, entry := range batch.ADVEntries {\n\t\t\tentryCount++\n\t\t\tif entry.Addenda99 != nil {\n\t\t\t\tentryCount++\n\t\t\t}\n\t\t}\n\t\tif entryCount != batch.ADVControl.EntryAddendaCount {\n\t\t\tif batch.validateOpts != nil && batch.validateOpts.UnequalAddendaCounts {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn batch.Error(\"EntryAddendaCount\",\n\t\t\t\tNewErrBatchCalculatedControlEquality(entryCount, batch.ADVControl.EntryAddendaCount))\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "47ec5bcbc061b4ed4593fe054a9eb772", "score": "0.5851566", "text": "func CheckIfSeqExists(db *sql.Conn) (bool, error) {\n\tvar count int\n\tconst query = \"SELECT COUNT(1) as c FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='SEQUENCE'\"\n\trow := db.QueryRowContext(context.Background(), query)\n\terr := row.Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Annotatef(err, \"sql: %s\", query)\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "11afc66874190c4556e43dbfce27a187", "score": "0.5844124", "text": "func AddStartAndCheckJobBatchFail() {\n\tstartAndCheckJobBatchFails.Inc()\n}", "title": "" }, { "docid": "fed75d777c5271b4d080bf0892056ab2", "score": "0.5827127", "text": "func testBatchSHRInvalidAddendum(t testing.TB) {\n\tmockBatch := NewBatchSHR(mockBatchSHRHeader())\n\tmockBatch.AddEntry(mockSHREntryDetail())\n\tmockBatch.GetEntries()[0].Addenda02 = mockAddenda02()\n\tmockBatch.GetEntries()[0].AddAddenda05(mockAddenda05())\n\tmockBatch.Entries[0].AddendaRecordIndicator = 1\n\terr := mockBatch.Create()\n\tif !base.Match(err, ErrBatchAddendaCategory) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "44cb67baff82fe11618176e62f19fe25", "score": "0.5756712", "text": "func testBatchSHRAddendaCount(t testing.TB) {\n\tmockBatch := mockBatchSHR(t)\n\tmockBatch.GetEntries()[0].Addenda02 = mockAddenda02()\n\terr := mockBatch.Create()\n\t// TODO: are we not expecting any errors here?\n\tif !base.Match(err, nil) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "61335d28014b2fa3bdb98f250ae56f25", "score": "0.5649997", "text": "func testBatchATXZeroAddendaRecords(t testing.TB) {\n\tbh := NewBatchHeader()\n\tbh.ServiceClassCode = CreditsOnly\n\tbh.StandardEntryClassCode = ATX\n\tbh.CompanyName = \"Payee Name\"\n\tbh.CompanyIdentification = \"231380104\"\n\tbh.CompanyEntryDescription = \"ACH ATX\"\n\tbh.ODFIIdentification = \"23138010\"\n\n\tentry := NewEntryDetail()\n\tentry.TransactionCode = CheckingZeroDollarRemittanceCredit\n\tentry.SetRDFI(\"121042882\")\n\tentry.DFIAccountNumber = \"744-5678-99\"\n\tentry.Amount = 0\n\tentry.SetOriginalTraceNumber(\"121042880000001\")\n\tentry.SetCATXAddendaRecords(1)\n\tentry.SetCATXReceivingCompany(\"Receiver Company\")\n\tentry.SetTraceNumber(mockBatchATXHeader().ODFIIdentification, 1)\n\tentry.DiscretionaryData = \"01\"\n\tentry.AddAddenda05(mockAddenda05())\n\tentry.AddendaRecordIndicator = 1\n\tentry.Category = CategoryForward\n\n\tmockBatch := NewBatchATX(bh)\n\tmockBatch.AddEntry(entry)\n\n\terr := mockBatch.Create()\n\t// TODO: are we not expecting any errors here?\n\tif !base.Match(err, nil) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "1937bc8291b116b0b7990a1657a3f59d", "score": "0.5634792", "text": "func (s *Sequence) IsEnd() {\n\ts.t.Helper()\n\tif s.index < len(s.calls) {\n\t\ts.t.Fatalf(\"there are non-proceeded calles: %+v\", s.calls[s.index:])\n\t}\n}", "title": "" }, { "docid": "78edffec8c8e3c60c67778893f3a14bb", "score": "0.5594664", "text": "func verifyChangesSequencesIgnoreOrder(changes []*ChangeEntry, sequences []uint64) bool {\n\n\tfor _, seq := range sequences {\n\t\tmatchingSequence := false\n\t\tfor _, change := range changes {\n\t\t\tlog.Printf(\"Change entry sequenceID = %d:%d:%d\", change.Seq.LowSeq, change.Seq.TriggeredBy, change.Seq.Seq)\n\t\t\tif change.Seq.Seq == seq {\n\t\t\t\tmatchingSequence = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !matchingSequence {\n\t\t\tlog.Printf(\"verifyChangesSequencesIgnorerder: sequenceID %d missing in changes\", seq)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "3dd5a6dbf774ccbe185239426d53b9f0", "score": "0.55906904", "text": "func verifyChangesFullSequences(changes []*ChangeEntry, sequences []string) bool {\n\tif len(changes) != len(sequences) {\n\t\tlog.Printf(\"verifyChangesFullSequences: changes size (%v) not equals to sequences size (%v)\",\n\t\t\tlen(changes), len(sequences))\n\t\treturn false\n\t}\n\tfor index, seq := range sequences {\n\t\tif changes[index].Seq.String() != seq {\n\t\t\tlog.Printf(\"verifyChangesFullSequences: sequence mismatch at index %v, changes=%s, sequences=%s\",\n\t\t\t\tindex, changes[index].Seq.String(), seq)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "3740b62bd5c2ded615be6de0e3a80e7e", "score": "0.5588812", "text": "func verifyChangesSequences(changes []*ChangeEntry, sequences []uint64) bool {\n\tif len(changes) != len(sequences) {\n\t\tlog.Printf(\"verifyChangesSequences: changes size (%v) not equals to sequences size (%v)\",\n\t\t\tlen(changes), len(sequences))\n\t\treturn false\n\t}\n\tfor index, seq := range sequences {\n\t\tif changes[index].Seq.Seq != seq {\n\t\t\tlog.Printf(\"verifyChangesSequences: sequence mismatch at index %v, changes=%d, sequences=%d\",\n\t\t\t\tindex, changes[index].Seq.Seq, seq)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "6bfe608cf71c17dbbe6a5981b6917c4e", "score": "0.55649114", "text": "func testBatchATXAddenda10000(t testing.TB) {\n\n\tbh := NewBatchHeader()\n\tbh.ServiceClassCode = CreditsOnly\n\tbh.StandardEntryClassCode = ATX\n\tbh.CompanyName = \"Payee Name\"\n\tbh.CompanyIdentification = \"231380104\"\n\tbh.CompanyEntryDescription = \"ACH ATX\"\n\tbh.ODFIIdentification = \"23138010\"\n\n\tentry := NewEntryDetail()\n\tentry.TransactionCode = CheckingZeroDollarRemittanceCredit\n\tentry.SetRDFI(\"121042882\")\n\tentry.DFIAccountNumber = \"744-5678-99\"\n\tentry.Amount = 0\n\tentry.SetOriginalTraceNumber(\"121042880000001\")\n\tentry.SetCATXAddendaRecords(9999)\n\tentry.SetCATXReceivingCompany(\"Receiver Company\")\n\tentry.SetTraceNumber(mockBatchATXHeader().ODFIIdentification, 1)\n\tentry.DiscretionaryData = \"01\"\n\tentry.Category = CategoryForward\n\n\tmockBatch := NewBatchATX(bh)\n\tmockBatch.AddEntry(entry)\n\tmockBatch.GetEntries()[0].AddendaRecordIndicator = 1\n\n\tfor i := 0; i < 10000; i++ {\n\t\tmockBatch.GetEntries()[0].AddAddenda05(mockAddenda05())\n\n\t}\n\terr := mockBatch.Create()\n\tif !base.Match(err, NewErrBatchAddendaCount(10000, 9999)) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n\n}", "title": "" }, { "docid": "f0d5650ed98189c6fdc971f4a36c56c0", "score": "0.55314314", "text": "func testBatchATXAddendaCountZero(t testing.TB) {\n\tmockBatch := NewBatchATX(mockBatchATXHeader())\n\tmockBatch.AddEntry(mockATXEntryDetail())\n\t//mockBatch.GetEntries()[0].Addenda05[0].\n\terr := mockBatch.Create()\n\t// TODO: are we expecting there to be an error here?\n\tif !base.Match(err, nil) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "6c20921994e89dd55bc4feea8f5a1fbb", "score": "0.5511592", "text": "func TestBatchATXZeroAddendaRecords(t *testing.T) {\n\ttestBatchATXZeroAddendaRecords(t)\n}", "title": "" }, { "docid": "9cb8ccb2c22c114a623ca9a04c94f484", "score": "0.54714084", "text": "func (me TxsdKeycomboAction) IsSeq() bool { return me == \"seq\" }", "title": "" }, { "docid": "23b01f18f1c9116f424f393cd84e2ce5", "score": "0.5463916", "text": "func (ppbo PutPropertyBatchOperation) AsCheckSequencePropertyBatchOperation() (*CheckSequencePropertyBatchOperation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "d39377c196d72deb56b7c72830d8736f", "score": "0.5460261", "text": "func AddStartAndCheckJobBatchSuccess() {\n\tstartAndCheckJobBatchSucceeds.Inc()\n}", "title": "" }, { "docid": "5c310929d7887b8260c2df885788fe17", "score": "0.5403922", "text": "func TestBatchATXAddendaCount(t *testing.T) {\n\ttestBatchATXAddendaCount(t)\n}", "title": "" }, { "docid": "6c1f1d1c7999f2a1ebeac09979d380db", "score": "0.54015", "text": "func (v Values) IsSequence() bool {\n\treturn len(v) > 0\n}", "title": "" }, { "docid": "e6c6223045acb5adddf547ede9aa3881", "score": "0.5398868", "text": "func testIATEDAddendaRecords(t testing.TB) {\n\tiatEd := mockIATEntryDetail()\n\tiatEd.AddendaRecords = 0\n\terr := iatEd.Validate()\n\tif !base.Match(err, ErrConstructor) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "2ba5cd04f0b3c2e773736157f32974fa", "score": "0.5379658", "text": "func (batch *Batch) verify() error {\n\t// No entries in batch\n\tif len(batch.Entries) <= 0 && len(batch.ADVEntries) <= 0 {\n\t\treturn batch.Error(\"entries\", ErrBatchNoEntries)\n\t}\n\t// verify field inclusion in all the records of the batch.\n\tif err := batch.isFieldInclusion(); err != nil {\n\t\t// convert the field error in to a batch error for a consistent api\n\t\treturn batch.Error(\"FieldError\", err)\n\t}\n\n\tif !batch.IsADV() {\n\t\t// validate batch header and control codes are the same\n\t\tif (batch.validateOpts == nil || !batch.validateOpts.UnequalServiceClassCode) &&\n\t\t\tbatch.Header.ServiceClassCode != batch.Control.ServiceClassCode {\n\t\t\treturn batch.Error(\"ServiceClassCode\",\n\t\t\t\tNewErrBatchHeaderControlEquality(batch.Header.ServiceClassCode, batch.Control.ServiceClassCode))\n\t\t}\n\t\t// Company Identification in the batch header and control must match if bypassCompanyIdentificationMatch is not enabled.\n\t\tif batch.Header.CompanyIdentification != batch.Control.CompanyIdentification &&\n\t\t\t!(batch.validateOpts != nil && batch.validateOpts.BypassCompanyIdentificationMatch) {\n\t\t\treturn batch.Error(\"CompanyIdentification\",\n\t\t\t\tNewErrBatchHeaderControlEquality(batch.Header.CompanyIdentification, batch.Control.CompanyIdentification))\n\t\t}\n\n\t\t// Control ODFIIdentification must be the same as batch header\n\t\tif batch.Header.ODFIIdentification != batch.Control.ODFIIdentification {\n\t\t\treturn batch.Error(\"ODFIIdentification\",\n\t\t\t\tNewErrBatchHeaderControlEquality(batch.Header.ODFIIdentification, batch.Control.ODFIIdentification))\n\t\t}\n\t\t// batch number header and control must match\n\t\tif batch.Header.BatchNumber != batch.Control.BatchNumber {\n\t\t\treturn batch.Error(\"BatchNumber\",\n\t\t\t\tNewErrBatchHeaderControlEquality(batch.Header.BatchNumber, batch.Control.BatchNumber))\n\t\t}\n\t} else {\n\t\tif (batch.validateOpts == nil || !batch.validateOpts.UnequalServiceClassCode) &&\n\t\t\tbatch.Header.ServiceClassCode != batch.ADVControl.ServiceClassCode {\n\t\t\treturn batch.Error(\"ServiceClassCode\",\n\t\t\t\tNewErrBatchHeaderControlEquality(batch.Header.ServiceClassCode, batch.ADVControl.ServiceClassCode))\n\t\t}\n\t\t// Control ODFIIdentification must be the same as batch header\n\t\tif batch.Header.ODFIIdentification != batch.ADVControl.ODFIIdentification {\n\t\t\treturn batch.Error(\"ODFIIdentification\",\n\t\t\t\tNewErrBatchHeaderControlEquality(batch.Header.ODFIIdentification, batch.ADVControl.ODFIIdentification))\n\t\t}\n\t\t// batch number header and control must match\n\t\tif batch.Header.BatchNumber != batch.ADVControl.BatchNumber {\n\t\t\treturn batch.Error(\"BatchNumber\",\n\t\t\t\tNewErrBatchHeaderControlEquality(batch.Header.BatchNumber, batch.ADVControl.BatchNumber))\n\t\t}\n\t}\n\n\tif err := batch.isBatchEntryCount(); err != nil {\n\t\treturn err\n\t}\n\tif batch.validateOpts == nil || !batch.validateOpts.CustomTraceNumbers {\n\t\tif err := batch.isSequenceAscending(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := batch.isBatchAmount(); err != nil {\n\t\treturn err\n\t}\n\tif err := batch.isEntryHash(); err != nil {\n\t\treturn err\n\t}\n\tif err := batch.isOriginatorDNE(); err != nil {\n\t\treturn err\n\t}\n\tif batch.validateOpts == nil || !batch.validateOpts.CustomTraceNumbers {\n\t\tif err := batch.isTraceNumberODFI(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := batch.isAddendaSequence(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := batch.isCategory(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b8d91e89d2b487298b314f6eebdb4987", "score": "0.5364995", "text": "func testBatchSHRAddendaCountZero(t testing.TB) {\n\tmockBatch := NewBatchSHR(mockBatchSHRHeader())\n\tmockBatch.AddEntry(mockSHREntryDetail())\n\tmockAddenda02 := mockAddenda02()\n\tmockBatch.GetEntries()[0].Addenda02 = mockAddenda02\n\tmockBatch.Entries[0].AddendaRecordIndicator = 1\n\terr := mockBatch.Validate()\n\tif !base.Match(err, NewErrBatchHeaderControlEquality(\"225\", \"200\")) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "f104aa770a1d4e102330b8a8bb8c5425", "score": "0.532486", "text": "func sequenceIsOrdered(array []Ball) bool {\n\tfor index := 0; index < len(array)-1; index++ {\n\t\tif array[index] >= array[index+1] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "b7237c561cdcf159e5bec05fbfb0c57d", "score": "0.5324787", "text": "func (c SeqEnd) IsSeqEnd() bool {\n\treturn true\n}", "title": "" }, { "docid": "2b9064dfc1f4b85c4a1ba687ba65e2a5", "score": "0.53200823", "text": "func (e *ErrExecution) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "954847faaf5ef80a3b4c5e7782897b7c", "score": "0.53168404", "text": "func (e *ErrInvalidInstanceContent) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "aeba74ecd82cde3010eebeefc7258ee8", "score": "0.53083193", "text": "func (iss *ISS) epochFinished() bool {\n\n\t// TODO: Instead of checking all sequence numbers every time,\n\t// remember the last sequence number of the epoch and compare it to iss.nextDeliveredSN\n\tfor _, orderer := range iss.orderers {\n\t\tfor _, sn := range orderer.Segment().SeqNrs {\n\t\t\tif iss.commitLog[sn] == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "6f407908886fbd2d1fecae90e4e06910", "score": "0.52982044", "text": "func (b *LockoutBatcher) hasSequencerLockout() bool {\n\treturn b.lockoutExpiresAt.After(time.Now())\n}", "title": "" }, { "docid": "b39d3a0f773d7b8a15a4882f104358f4", "score": "0.52831", "text": "func (x *flex_counter_ref_entry) is_valid() bool { return x.index != 0 }", "title": "" }, { "docid": "1f35509d8778f407cc29ec3d67a29426", "score": "0.527158", "text": "func (pbo PropertyBatchOperation) AsCheckSequencePropertyBatchOperation() (*CheckSequencePropertyBatchOperation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "48b483b51526dd5d72534f4eae1d63e2", "score": "0.5270191", "text": "func (d *DiscordBot) UpdateSequence(seq int) bool {\n\td.seqLock.Lock()\n\tdefer d.seqLock.Unlock()\n\n\tif seq < d.lastSequence {\n\t\treturn false\n\t}\n\td.lastSequence = seq\n\treturn true\n}", "title": "" }, { "docid": "24e82a44a69abfd54787eee7d3cad223", "score": "0.52569985", "text": "func BenchmarkBatchATXInvalidAddenda(b *testing.B) {\n\tb.ReportAllocs()\n\tfor i := 0; i < b.N; i++ {\n\t\ttestBatchATXInvalidAddenda(b)\n\t}\n}", "title": "" }, { "docid": "0f8d26791469d9134bf60dac02b1b069", "score": "0.52528584", "text": "func (e *ErrInvalidInstance) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "69017d10d885d7298d4157763fe2545e", "score": "0.52514845", "text": "func (i *BulkAddJob) IsSequential() bool {\n\treturn true\n}", "title": "" }, { "docid": "751f3f1885c2d23269a2a97c319b4987", "score": "0.5247542", "text": "func (r *Reader) parseAddenda() error {\n\tr.recordName = \"Addenda\"\n\n\tif r.currentBatch == nil {\n\t\treturn ErrAddendaOutside\n\t}\n\tif len(r.currentBatch.GetEntries()) == 0 {\n\t\treturn ErrAddendaOutside\n\t}\n\tentryIndex := len(r.currentBatch.GetEntries()) - 1\n\tentry := r.currentBatch.GetEntries()[entryIndex]\n\n\tswitch sec := r.currentBatch.GetHeader().StandardEntryClassCode; sec {\n\tcase ppd:\n\t\tif entry.AddendaRecordIndicator == 1 {\n\t\t\taddenda := Addenda{}\n\t\t\taddenda.Parse(r.line)\n\t\t\tif err := addenda.Validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tr.currentBatch.GetEntries()[entryIndex].AddAddenda(addenda)\n\t\t} else {\n\t\t\treturn ErrAddendaNoIndicator\n\t\t}\n\t// case \"CCD\":\n\tdefault:\n\t\treturn errors.New(\"Support for addenda of SEC(standard entry class): \" +\n\t\t\tsec + \", has not been implemented\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0621eba923252c14ad1abe96191cd258", "score": "0.5245957", "text": "func (cepbo CheckExistsPropertyBatchOperation) AsCheckSequencePropertyBatchOperation() (*CheckSequencePropertyBatchOperation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "29bdd812c64d7139020a19f7bc53df83", "score": "0.52445084", "text": "func TestBatchATXAddenda10000(t *testing.T) {\n\ttestBatchATXAddenda10000(t)\n}", "title": "" }, { "docid": "21f3c6c255b2c69f3db5dad2c5e24e58", "score": "0.52345717", "text": "func (o *ViewCalendarEvent) HasSequence() bool {\n\tif o != nil && o.Sequence != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1d4c32e8e4174b237407cb4db71a72a3", "score": "0.5190551", "text": "func SequenceExists(numbers, seq []int) bool {\n\tn := len(numbers)\n\ts := len(seq)\n\n\tif s > n {\n\t\treturn false\n\t}\n\tif s == 0 {\n\t\treturn false\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif numbers[i] == seq[0] && isContainSeq(numbers[i:], seq) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "1f05a1a34e2a96b3963fc3de6a50927b", "score": "0.5190222", "text": "func (batch *Batch) isFieldInclusion() error {\n\tif err := batch.Header.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\tif !batch.IsADV() {\n\t\tfor _, entry := range batch.Entries {\n\t\t\tif err := entry.Validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif entry.Addenda02 != nil {\n\t\t\t\tif err := entry.Addenda02.Validate(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor _, addenda05 := range entry.Addenda05 {\n\t\t\t\tif err := addenda05.Validate(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif entry.Addenda98 != nil {\n\t\t\t\tif err := entry.Addenda98.Validate(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif entry.Addenda98Refused != nil {\n\t\t\t\tif err := entry.Addenda98Refused.Validate(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif entry.Addenda99 != nil {\n\t\t\t\tif err := entry.Addenda99.Validate(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif entry.Addenda99Dishonored != nil {\n\t\t\t\tif err := entry.Addenda99Dishonored.Validate(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif entry.Addenda99Contested != nil {\n\t\t\t\tif err := entry.Addenda99Contested.Validate(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn batch.Control.Validate()\n\t}\n\t// ADV File/Batch\n\tfor _, entry := range batch.ADVEntries {\n\t\tif err := entry.Validate(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif entry.Addenda99 != nil {\n\t\t\tif err := entry.Addenda99.Validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn batch.ADVControl.Validate()\n}", "title": "" }, { "docid": "8b233a8b8d03f87a761e5b1175d43345", "score": "0.51740175", "text": "func TestBatchATXAddendum99(t *testing.T) {\n\tmockBatch := NewBatchATX(mockBatchATXHeader())\n\tmockBatch.AddEntry(mockATXEntryDetail())\n\tmockAddenda99 := mockAddenda99()\n\tmockAddenda99.TypeCode = \"05\"\n\tmockBatch.GetEntries()[0].Category = CategoryReturn\n\tmockBatch.GetEntries()[0].Addenda99 = mockAddenda99\n\terr := mockBatch.Create()\n\tif !base.Match(err, ErrAddendaTypeCode) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "a180492b0fb1acdca7a41efa1ff2de09", "score": "0.516648", "text": "func TestBatchSHRInvalidAddendum(t *testing.T) {\n\ttestBatchSHRInvalidAddendum(t)\n}", "title": "" }, { "docid": "23b0e88fbf9ceeb633834ce5ce444887", "score": "0.51652884", "text": "func hasBlockingErr(errs field.ErrorList) (bool, *field.Error) {\n\tfor _, err := range errs {\n\t\tif err.Type == field.ErrorTypeRequired || err.Type == field.ErrorTypeTooLong || err.Type == field.ErrorTypeTooMany || err.Type == field.ErrorTypeTypeInvalid {\n\t\t\treturn true, field.Invalid(nil, nil, \"some validation rules were not checked because the object was invalid; correct the existing errors to complete validation\")\n\t\t}\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "1ad502dad72f5f23300ad9883cc6d549", "score": "0.51535934", "text": "func isRollbackEvent(e *api.Event) (bool, string) {\n\trollbackEventReasons := []string{deploymentutil.RollbackRevisionNotFound, deploymentutil.RollbackTemplateUnchanged, deploymentutil.RollbackDone}\n\tfor _, reason := range rollbackEventReasons {\n\t\tif e.Reason == reason {\n\t\t\tif reason == deploymentutil.RollbackDone {\n\t\t\t\treturn true, \"rolled back\"\n\t\t\t}\n\t\t\treturn true, fmt.Sprintf(\"skipped rollback (%s: %s)\", e.Reason, e.Message)\n\t\t}\n\t}\n\treturn false, \"\"\n}", "title": "" }, { "docid": "383e3618754782291c52ce93aa88b040", "score": "0.51533175", "text": "func (e *ErrInvalidRequest) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "8c9e9d8bbdc83abff5227e9092729f02", "score": "0.5143769", "text": "func (dpbo DeletePropertyBatchOperation) AsCheckSequencePropertyBatchOperation() (*CheckSequencePropertyBatchOperation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "301f5b17931824a6db4db52aba83f40c", "score": "0.51376915", "text": "func (e *ErrInconsistent) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "c7696413506b49f515cb2632aa01cd1d", "score": "0.5128471", "text": "func (bundle *Bundle) isComplete() bool {\n\treturn uint64(len(bundle.txs)) == bundle.lastIndex+1\n}", "title": "" }, { "docid": "0f815de625a227da72dfc974fd43150d", "score": "0.5120418", "text": "func BenchmarkBatchSHRInvalidAddenda(b *testing.B) {\n\tb.ReportAllocs()\n\tfor i := 0; i < b.N; i++ {\n\t\ttestBatchSHRInvalidAddenda(b)\n\t}\n}", "title": "" }, { "docid": "23c87a343ad4f0ac033a8378cd23c2fb", "score": "0.5119436", "text": "func (e *ErrSyntax) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "c67abcc023e90114f5032e0df29163b9", "score": "0.5114144", "text": "func TestBatchATXAddendaCountZero(t *testing.T) {\n\ttestBatchATXAddendaCountZero(t)\n}", "title": "" }, { "docid": "66d3ceeccddfb62f6b334781f94bd2bf", "score": "0.51074654", "text": "func TestInvalidSequenceToken(t *testing.T) {\n\tcw := &logsAPIFake{}\n\te := NewEventer(cw, testGroup, testStream)\n\n\te.Event(typ, k, 0)\n\te.sync()\n\tcw.incrNextSequence()\n\te.Event(typ, k, 1)\n\te.sync()\n\te.Event(typ, k, 2)\n\te.sync()\n\te.Close()\n\n\tevents := cw.logEvents()\n\tif 3 < len(events) {\n\t\tt.Fatalf(\"more events sent to CloudWatch than were logged: 3 < %d\", len(events))\n\t}\n\tif len(events) < 2 {\n\t\tt.Errorf(\"did not successfully re-sync sequence token\")\n\t}\n\tassertOrdered(t, events)\n}", "title": "" }, { "docid": "d77f703667b81cafd78733b96f9c3893", "score": "0.5084913", "text": "func (e *errorCore) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\tif err != nil {\n\t\te.lock.Lock()\n\t\tdefer e.lock.Unlock()\n\n\t\tif e.consequences == nil {\n\t\t\te.consequences = []error{}\n\t\t}\n\t\te.consequences = append(e.consequences, err)\n\t}\n\treturn e\n}", "title": "" }, { "docid": "cdd1f2dbf48a4e55f09fc0f5f3b8392e", "score": "0.5081605", "text": "func TestBatchSHRAddendaCount(t *testing.T) {\n\ttestBatchSHRAddendaCount(t)\n}", "title": "" }, { "docid": "bde159ee1e9855d805584763c60da10a", "score": "0.50766844", "text": "func (p *BatchingProducer) failBatch(batchWrapper *pubsubBatchWithReceipts, err error) {\n\tfor _, ctx := range batchWrapper.ctxArr {\n\t\tp.getProduceProcessInfo(ctx).setErr(err)\n\t}\n\n\t// ensure once failed, we won't touch the batch anymore\n\tp.clearBatch(batchWrapper)\n}", "title": "" }, { "docid": "18f1ab9107b647b718a8621ec1417316", "score": "0.50645226", "text": "func (s *stageImpl) EndsInAccumulate() bool {\n\treturn len(s.frames) > 0 && s.frames[len(s.frames)-1].taskType == sif.AccumulateTaskType\n}", "title": "" }, { "docid": "511b27a4d771dee5c9182ff6344faa27", "score": "0.505936", "text": "func (rel *Release) hasFailed() bool {\n\tlog.Debug(\"checking if release has previously failed\")\n\to := orm.NewOrm()\n\tfail := History{}\n\tif rel.Id != \"\" {\n\t\to.QueryTable(&History{}).Filter(\"rel_id\", rel.Id).Filter(\"action\", STATE_FAILED).One(&fail)\n\t} else {\n\t\to.QueryTable(&History{}).Filter(\"link\", rel.Link).Filter(\"action\", STATE_FAILED).One(&fail)\n\t}\n\n\tif fail.Id != 0 {\n\t\tlog.Debug(\"release failed previously, skipping\")\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "24d4aa78ff80b730c1c8a653218cf81b", "score": "0.5050285", "text": "func (a *AuditMarshaller) detectMissing(seq int) {\n\tif seq > a.lastSeq+1 && a.lastSeq != 0 {\n\t\t// We likely leap frogged over a msg, wait until the next sequence to make sure\n\t\tfor i := a.lastSeq + 1; i < seq; i++ {\n\t\t\ta.missed[i] = true\n\t\t}\n\t}\n\n\tfor missedSeq := range a.missed {\n\t\tif missedSeq == seq {\n\t\t\tlag := a.lastSeq - missedSeq\n\t\t\tif lag > a.worstLag {\n\t\t\t\ta.worstLag = lag\n\t\t\t}\n\n\t\t\tif a.logOutOfOrder {\n\t\t\t\tel.Println(\"Got sequence\", missedSeq, \"after\", lag, \"messages. Worst lag so far\", a.worstLag, \"messages\")\n\t\t\t}\n\t\t\tdelete(a.missed, missedSeq)\n\t\t} else if seq-missedSeq > a.maxOutOfOrder {\n\t\t\tel.Printf(\"Likely missed sequence %d, current %d, worst message delay %d\\n\", missedSeq, seq, a.worstLag)\n\t\t\tdelete(a.missed, missedSeq)\n\t\t}\n\t}\n\n\tif seq > a.lastSeq {\n\t\t// Keep track of the largest sequence\n\t\ta.lastSeq = seq\n\t}\n}", "title": "" }, { "docid": "e5939d41807f2f5aab26bf64f92360d8", "score": "0.5024979", "text": "func (e *ErrInvalidParameter) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "13c766a364d8ecfe40cc5172687cb84d", "score": "0.5018016", "text": "func testEDAddAddenda99(t testing.TB) {\n\tentry := mockEntryDetail()\n\tentry.Addenda99 = mockAddenda99()\n\tentry.Category = CategoryReturn\n\tentry.AddendaRecordIndicator = 1\n\tif entry.Category != CategoryReturn {\n\t\tt.Error(\"Addenda99 added and isReturn is false\")\n\t}\n\tif entry.AddendaRecordIndicator != 1 {\n\t\tt.Error(\"Addenda99 added and record indicator is not 1\")\n\t}\n\n}", "title": "" }, { "docid": "603429b11e8379fca72669401c13052e", "score": "0.50168806", "text": "func TestSequenceBatch(t *testing.T) {\n\tleaves := []trillian.LogLeaf{getLeaf42()}\n\tupdatedLeaves := []trillian.LogLeaf{testLeaf16}\n\tparams := testParameters{dequeueLimit: 1, shouldCommit: true,\n\t\tdequeuedLeaves: leaves, latestSignedRoot: &testRoot16,\n\t\tupdatedLeaves: &updatedLeaves, merkleNodesSet: &updatedNodes, merkleNodesSetTreeRevision: 6,\n\t\tstoreSignedRoot: &expectedSignedRoot}\n\tc := createTestContext(params)\n\n\tc.sequencer.SequenceBatch(1)\n\n\tc.mockStorage.AssertExpectations(t)\n}", "title": "" }, { "docid": "1d81a69e4b52de98665cb8598b5c92d2", "score": "0.50130564", "text": "func (m *multi) add(calls []hrpc.Call) bool {\n\tm.calls = append(m.calls, calls...)\n\treturn len(m.calls) >= m.size\n}", "title": "" }, { "docid": "510d7be631998d748102c65aab223d42", "score": "0.5006295", "text": "func (o *ViewCalendarEvent) GetSequenceOk() (*ViewRelationship, bool) {\n\tif o == nil || o.Sequence == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Sequence, true\n}", "title": "" }, { "docid": "d4dfe68b5ade7b9ab81ed20b120be4e9", "score": "0.49999666", "text": "func (gpbo GetPropertyBatchOperation) AsCheckSequencePropertyBatchOperation() (*CheckSequencePropertyBatchOperation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "628615f687956a93d52aafed472181b7", "score": "0.49928436", "text": "func (e *ErrTimeout) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) { // do nothing\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "5b0a57527851810d20d2c77759a23f10", "score": "0.49918598", "text": "func (sce StartedChaosEvent) AsValidationFailedChaosEvent() (*ValidationFailedChaosEvent, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "f80baa45ba39dc01566053ae77b68c0c", "score": "0.49803966", "text": "func (tx *metatx) mustNextSequence(key []byte) (id uint64) {\n\t// Retrieve the previous value, if it exists.\n\tif v := tx.Bucket([]byte(\"Meta\")).Get(key); v != nil {\n\t\tid = btou64(v)\n\t}\n\tid++\n\n\t// Save the new value.\n\t// This panics on error because keys are hardcoded this shouldn't fail.\n\tif err := tx.Bucket([]byte(\"Meta\")).Put(key, u64tob(id)); err != nil {\n\t\tpanic(\"next seq: \" + err.Error())\n\t}\n\treturn\n}", "title": "" }, { "docid": "70c22957ebb0f330ad43d343c5069405", "score": "0.49759355", "text": "func testFileEntryAddenda(t testing.TB) {\n\tfile := mockFilePPD(t)\n\n\t// more entries than the file control\n\tfile.Control.EntryAddendaCount = 5\n\terr := file.Validate()\n\tif err != NewErrFileCalculatedControlEquality(\"EntryAddendaCount\", 1, 5) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "1c6e9c2533946104c6bece82bb31321a", "score": "0.4975743", "text": "func (batch *Batch) build() error {\n\t// Requires a valid BatchHeader\n\tif err := batch.Header.Validate(); err != nil {\n\t\treturn err\n\t}\n\tif len(batch.Entries) <= 0 && len(batch.ADVEntries) <= 0 {\n\t\treturn batch.Error(\"entries\", ErrBatchNoEntries)\n\t}\n\t// Create record sequence numbers\n\tentryCount := 0\n\tseq := 1\n\n\tif !batch.IsADV() {\n\t\tfor i, entry := range batch.Entries {\n\t\t\tentryCount += 1 + entry.addendaCount()\n\n\t\t\tcurrentTraceNumberODFI, err := strconv.Atoi(entry.TraceNumberField()[:8])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tbatchHeaderODFI, err := strconv.Atoi(batch.Header.ODFIIdentificationField()[:8])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Add a sequenced TraceNumber if one is not already set. Have to keep original trance number Return and NOC entries\n\t\t\tif currentTraceNumberODFI != batchHeaderODFI {\n\t\t\t\tif opts := batch.validateOpts; opts == nil {\n\t\t\t\t\tentry.SetTraceNumber(batch.Header.ODFIIdentification, seq)\n\t\t\t\t} else {\n\t\t\t\t\t// Automatically set the TraceNumber if we are validating Origin and don't have custom trace numbers\n\t\t\t\t\tif !opts.BypassOriginValidation && !opts.CustomTraceNumbers {\n\t\t\t\t\t\tentry.SetTraceNumber(batch.Header.ODFIIdentification, seq)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tseq++\n\t\t\taddendaSeq := 1\n\t\t\tfor _, a := range entry.Addenda05 {\n\t\t\t\t// sequences don't exist in NOC or Return addenda\n\t\t\t\ta.SequenceNumber = addendaSeq\n\t\t\t\ta.EntryDetailSequenceNumber = batch.parseNumField(batch.Entries[i].TraceNumberField()[8:])\n\t\t\t\taddendaSeq++\n\t\t\t}\n\t\t}\n\n\t\t// build a BatchControl record\n\t\tbc := NewBatchControl()\n\t\tbc.ServiceClassCode = batch.Header.ServiceClassCode\n\t\tbc.CompanyIdentification = batch.Header.CompanyIdentification\n\t\tbc.ODFIIdentification = batch.Header.ODFIIdentification\n\t\tbc.BatchNumber = batch.Header.BatchNumber\n\t\tbc.EntryAddendaCount = entryCount\n\t\tbc.EntryHash = batch.calculateEntryHash()\n\t\tbc.TotalCreditEntryDollarAmount, bc.TotalDebitEntryDollarAmount = batch.calculateBatchAmounts()\n\t\tbatch.Control = bc\n\t} else {\n\t\tfor i, entry := range batch.ADVEntries {\n\t\t\tentryCount++\n\n\t\t\tif entry.Addenda99 != nil {\n\t\t\t\tentryCount++\n\t\t\t}\n\t\t\t// Set Sequence Number\n\t\t\tbatch.ADVEntries[i].SequenceNumber = seq\n\n\t\t\tseq++\n\n\t\t\tif seq > 9999 {\n\t\t\t\treturn batch.Error(\"SequenceNumber\", ErrBatchADVCount)\n\t\t\t}\n\t\t}\n\t\t// build a BatchADVControl record\n\t\tbcADV := NewADVBatchControl()\n\t\tbcADV.ServiceClassCode = batch.Header.ServiceClassCode\n\t\tbcADV.ACHOperatorData = batch.Header.CompanyName\n\t\tbcADV.ODFIIdentification = batch.Header.ODFIIdentification\n\t\tbcADV.BatchNumber = batch.Header.BatchNumber\n\t\tbcADV.EntryAddendaCount = entryCount\n\t\tbcADV.EntryHash = batch.calculateEntryHash()\n\t\tbcADV.TotalCreditEntryDollarAmount, bcADV.TotalDebitEntryDollarAmount = batch.calculateADVBatchAmounts()\n\t\tbatch.ADVControl = bcADV\n\t}\n\treturn batch.upsertOffsets()\n}", "title": "" }, { "docid": "58a46fa22bb3e6672165343c265ec0c9", "score": "0.49717945", "text": "func (cvpbo CheckValuePropertyBatchOperation) AsCheckSequencePropertyBatchOperation() (*CheckSequencePropertyBatchOperation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "d42805e45cb253fa5180bdb031139fb5", "score": "0.49616274", "text": "func (e ErrInvalidInstance) AddConsequence(err error) error {\n\te.ErrCore = e.ErrCore.Reset(e.ErrCore.AddConsequence(err))\n\treturn e\n}", "title": "" }, { "docid": "a8f3307cb7809d2975385957124aea32", "score": "0.4959114", "text": "func (seq Sequence) Validate(hmms []HMM) ValidationResult {\n\tvalidationResult := ValidationResult{}\n\n\tif seq.ID == \"\" {\n\t\tvalidationResult.Add(\"ID\", \"Sequence must have an ID\")\n\t}\n\n\tif len(seq.HMMIDs) == 0 {\n\t\tvalidationResult.Add(\"HMMIDs\", \"No HMM Ids given\")\n\t}\n\n\t// verify that the HMMs which the sequence tests against, exists\n\thmmIDs := hmmIDsToStringSlice(hmms)\n\tfor _, seqHMMID := range seq.HMMIDs {\n\t\tif !isInStringSlice(seqHMMID, hmmIDs) {\n\t\t\tvalidationResult.Add(\"HMMIDs\",\n\t\t\t\tfmt.Sprintf(\"HMM with ID '%s' does not exist\", seqHMMID))\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// verify that the unique observation symbols do exist in all HMMs\n\t// the sequence is testing against\n\tfor _, symbol := range seq.Observations {\n\t\tfor _, hmm := range hmms {\n\t\t\t// test only against the target HMMs\n\t\t\tif !isInStringSlice(hmm.ID, seq.HMMIDs) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !isInObservationSlice(symbol, hmm.V) {\n\t\t\t\tvalidationResult.Add(\"Observations\",\n\t\t\t\t\tfmt.Sprintf(\"Symbol '%q' doesn't exists in target HMMs\", symbol))\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn validationResult\n}", "title": "" }, { "docid": "010e2fee41d0e9bd97f91eb5d86eb4b8", "score": "0.49576652", "text": "func addPayloadTasks(client api.ECSClient, cluster, containerInstanceArn string, payload *ecsacs.PayloadMessage, taskEngine engine.TaskEngine) bool {\n\t// verify thatwe were able to work with all tasks in this payload so we know whether to ack the whole thing or not\n\tallTasksOk := true\n\n\tvalidTasks := make([]*api.Task, 0, len(payload.Tasks))\n\tfor _, task := range payload.Tasks {\n\t\tif task == nil {\n\t\t\tlog.Crit(\"Recieved nil task\", \"messageId\", *payload.MessageId)\n\t\t\tallTasksOk = false\n\t\t\tcontinue\n\t\t}\n\t\tapiTask, err := api.TaskFromACS(task, payload)\n\t\tif err != nil {\n\t\t\thandleUnrecognizedTask(client, cluster, containerInstanceArn, task, err, payload)\n\t\t\tallTasksOk = false\n\t\t\tcontinue\n\t\t}\n\t\tvalidTasks = append(validTasks, apiTask)\n\t}\n\t// Add 'stop' transitions first to allow seqnum ordering to work out\n\t// Because a 'start' sequence number should only be proceeded if all 'stop's\n\t// of the same sequence number have completed, the 'start' events need to be\n\t// added after the 'stop' events are there to block them.\n\tstoppedAddedOk := addStoppedTasks(validTasks, taskEngine)\n\tnonstoppedAddedOk := addNonstoppedTasks(validTasks, taskEngine)\n\tif !stoppedAddedOk || !nonstoppedAddedOk {\n\t\tallTasksOk = false\n\t}\n\treturn allTasksOk\n}", "title": "" }, { "docid": "3b1cc6392f2b23a49a0b0eec53aea4de", "score": "0.49561134", "text": "func (o *ViewCalendarEvent) HasSequenceId() bool {\n\tif o != nil && o.SequenceId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "70192afe250732b2c5b947000143911f", "score": "0.49480954", "text": "func (e markError) As(target any) bool {\n\tif errors.As(e.err, target) {\n\t\treturn true\n\t}\n\tfor _, err := range e.marks {\n\t\tif errors.As(err, target) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "838f82ec99935134138a582896b5331b", "score": "0.49453992", "text": "func (o *ViewCalendarEvent) GetSequenceIdOk() (*int32, bool) {\n\tif o == nil || o.SequenceId == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SequenceId, true\n}", "title": "" }, { "docid": "967723352f48040599f308e18a07d01d", "score": "0.49430352", "text": "func needsChange(rf *Raft, entries []LogElement, startingIdx int) bool {\n\tif entries == nil || len(entries) == 0 {\n\t\treturn false\n\t}\n\n\tif startingIdx+len(entries) >= len(rf.Log) {\n\t\treturn true\n\t}\n\n\tfor i := 0; i < len(entries); i++ {\n\t\tif rf.Log[i+startingIdx].Term != entries[i].Term || rf.Log[i+startingIdx].Command != entries[i].Command {\n\t\t\tif rf.CommitIndex >= i+startingIdx {\n\t\t\t\tfmt.Printf(\"PROBLEM(%d): Old Command(%d) Old Term(%d), New Command(%d) New Term(%d)\\n\", startingIdx, rf.Log[i+startingIdx].Command, rf.Log[i+startingIdx].Term, entries[i].Command, entries[i].Term)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c05536bba076b3f44d3e193ef061c870", "score": "0.49423423", "text": "func AddConsequence(err error, cons error) error {\n\tif err != nil {\n\t\tconseq, ok := err.(consequencer)\n\t\tif ok {\n\t\t\tif cons != nil {\n\t\t\t\tnerr := conseq.AddConsequence(cons)\n\t\t\t\treturn nerr\n\t\t\t}\n\t\t\treturn conseq\n\t\t}\n\t\tif cons != nil {\n\t\t\tlogrus.Errorf(\"trying to add error [%s] to existing error [%s] but failed\", cons, err)\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "37830d31487d18464c5716bfb48b4f16", "score": "0.49348557", "text": "func (e ErrInconsistent) AddConsequence(err error) error {\n\te.ErrCore = e.ErrCore.Reset(e.ErrCore.AddConsequence(err))\n\treturn e\n}", "title": "" }, { "docid": "69bab5358bd4f59cbb73d533bccfcf89", "score": "0.49314603", "text": "func (e ErrInvalidInstanceContent) AddConsequence(err error) error {\n\te.ErrCore = e.ErrCore.Reset(e.ErrCore.AddConsequence(err))\n\treturn e\n}", "title": "" }, { "docid": "f46fe709ed23469f5205eb81f9ca68fd", "score": "0.49274933", "text": "func TestBatchEmitterEventsOrderFailure(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"Skipping test in short mode\")\n\t}\n\twriter := &mocks.SavingWriter{}\n\trunner := runner{\n\t\tclient: ndt7.NewClient(clientName, clientVersion),\n\t\temitter: emitter.Batch{Writer: writer},\n\t}\n\trunner.client.MLabNSClient.BaseURL = \"\\t\" // URL parser error\n\tcode := runner.runSubtest(\n\t\tcontext.Background(),\n\t\t\"download\",\n\t\trunner.client.StartDownload,\n\t\trunner.emitter.OnDownloadEvent,\n\t)\n\tif code == 0 {\n\t\tt.Fatal(\"expected nonzero return code here\")\n\t}\n\tnumLines := len(writer.Data)\n\tif numLines != 3 {\n\t\tt.Fatal(\"expected at exactly three lines\")\n\t}\n\tfor lineno, data := range writer.Data {\n\t\tvar m struct {\n\t\t\tKey string `json:\"key\"`\n\t\t}\n\t\terr := json.Unmarshal(data, &m)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tfmt.Printf(\"%d - %s\\n\", lineno, m.Key)\n\t\tif lineno == 0 {\n\t\t\tif m.Key != \"status.measurement_start\" {\n\t\t\t\tt.Fatal(\"unexpected first key\")\n\t\t\t}\n\t\t} else if lineno == 1 {\n\t\t\tif m.Key != \"failure.measurement\" {\n\t\t\t\tt.Fatal(\"unexpected second key\")\n\t\t\t}\n\t\t} else if lineno == 2 {\n\t\t\tif m.Key != \"status.measurement_done\" {\n\t\t\t\tt.Fatal(\"unexpected third key\")\n\t\t\t}\n\t\t} else {\n\t\t\tt.Fatal(\"invalid index\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1c4de5038de72dbec08229faf009bc1b", "score": "0.49176928", "text": "func (m *MockJournal_MultipleRows) Next() bool {\n\tm.RowNumber++\n\tif m.RowNumber < 3 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "939728acbe269b598dfd643d79a70d4a", "score": "0.49165076", "text": "func (e *ErrDuplicate) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "fa7a463fa6339b696b3c0102c62b0e3f", "score": "0.49121037", "text": "func isTheFirstOrLastCompletedInAMinor(entryIndex int, h []configv1.UpdateHistory, maxHistorySize int) bool {\n\tif h[entryIndex].State == configv1.PartialUpdate {\n\t\treturn false\n\t}\n\tif entryIndex == 0 || entryIndex == maxHistorySize {\n\t\treturn true\n\t}\n\tnextIdx := findNextOlderCompleted(entryIndex, h)\n\tif nextIdx == entryIndex || !sameMinorVersion(h[entryIndex], h[nextIdx]) {\n\t\treturn true\n\t}\n\tnextIdx = findNextNewerCompleted(entryIndex, h)\n\tif nextIdx == entryIndex || !sameMinorVersion(h[entryIndex], h[nextIdx]) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "41c86775aceeb4e671a0a8e0fb3e6330", "score": "0.48971626", "text": "func validEvent(args []string) bool {\n\tvar set []string\n\tfor _, e := range args {\n\t\tif e == \"limit\" || e == \"msg\" {\n\t\t\tset = append(set, e)\n\t\t}\n\t}\n\tif len(set) != 2 {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "56049f6f5d2144fcb889b0bdb188bff5", "score": "0.48925066", "text": "func (e *ErrNotAvailable) AddConsequence(err error) Error {\n\tif e == err || e == Cause(err) {\n\t\treturn e\n\t}\n\t_ = e.errorCore.AddConsequence(err)\n\treturn e\n}", "title": "" }, { "docid": "6d870105944b3b46b81a7632f833c2e8", "score": "0.48918197", "text": "func (rs *retryingSink) proceed() bool {\n\treturn rs.failures.recent < rs.failures.threshold ||\n\t\ttime.Now().UTC().After(rs.failures.last.Add(rs.failures.backoff))\n}", "title": "" }, { "docid": "41812459c6038145164163062bdabb2b", "score": "0.48891842", "text": "func testBatchATXInvalidBuild(t testing.TB) {\n\tmockBatch := mockBatchATX(t)\n\tmockBatch.GetHeader().ServiceClassCode = 3\n\terr := mockBatch.Create()\n\tif !base.Match(err, ErrServiceClass) {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n}", "title": "" }, { "docid": "c26e3bd11de571e9e0630f8e6aadbeea", "score": "0.488824", "text": "func endsWithIncompleteTxn(stmts parser.StatementList) bool {\n\ttxnStarted := false\n\tfor _, stmt := range stmts {\n\t\tswitch stmt.(type) {\n\t\tcase *parser.BeginTransaction:\n\t\t\ttxnStarted = true\n\t\tcase *parser.CommitTransaction, *parser.RollbackTransaction:\n\t\t\ttxnStarted = false\n\t\t}\n\t}\n\treturn txnStarted\n}", "title": "" }, { "docid": "527b826fa2301679851c4dbaf3989270", "score": "0.4883394", "text": "func validArray(d *json.Decoder, t Type) bool {\n\n\ttok, err := d.Token()\n\tif err != nil {\n\t\tif t.Optional && err == io.EOF {\n\t\t\t// no token at all, but it's optional so that's okay\n\t\t\treturn true\n\t\t}\n\t\tlog.Printf(\"validation failed: array: got error: %s\\n\", err)\n\t\treturn false\n\t}\n\n\tif delim, ok := tok.(json.Delim); !ok || delim != json.Delim('[') {\n\t\tlog.Printf(\"validation failed: array: unexpected delimiter: %s\\n\", delim)\n\t\treturn false\n\t}\n\n\t// schedule the consumption of the ending ']'\n\tdefer d.Token()\n\n\tfor d.More() {\n\t\tif t.Items == nil {\n\t\t\tlog.Println(\"validation failed: array: array is not empty\")\n\t\t\treturn false\n\t\t}\n\t\tif ok := valid(d, *t.Items); !ok {\n\t\t\tlog.Println(\"validation failed: array: invalid sub-element\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n\n}", "title": "" }, { "docid": "f1ab95e4dfaeb50467616fe3b06f87d0", "score": "0.4875574", "text": "func (le RunLogEvent) Validate() bool {\n\tel := le.Log\n\tjid := jobIDFromHexEncodedTopic(el)\n\tif jid != le.JobSpec.ID && jobIDFromImproperEncodedTopic(el) != le.JobSpec.ID {\n\t\tlogger.Errorw(fmt.Sprintf(\"Run Log didn't have matching job ID: %v != %v\", jid, le.JobSpec.ID), le.ForLogger()...)\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "3dc100c77d22801993f11eef8d7b3546", "score": "0.48726454", "text": "func assertEventSequence(t *testing.T, got []event.Event, expected ...event.Event) {\n\tt.Helper()\n\tif len(expected) == 0 {\n\t\tif len(got) > 0 {\n\t\t\tt.Errorf(\"unexpected events: %v\", eventsToString(got))\n\t\t}\n\t\treturn\n\t}\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"expected %s events, got %s\", eventsToString(expected), eventsToString(got))\n\t}\n}", "title": "" } ]
263e81bac432659b0b6fedce434d464b
ConnectGetHostname is the go wrapper for REMOTE_PROC_CONNECT_GET_HOSTNAME.
[ { "docid": "18ffb50a9ced47b9c3f5a40e7bc53ce3", "score": "0.79219246", "text": "func (l *Libvirt) ConnectGetHostname() (rHostname string, err error) {\n\tvar buf []byte\n\n\tvar r response\n\tr, err = l.requestStream(59, constants.Program, buf, nil, nil)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Return value unmarshaling\n\ttpd := typedParamDecoder{}\n\tct := map[string]xdr.TypeDecoder{\"libvirt.TypedParam\": tpd}\n\trdr := bytes.NewReader(r.Payload)\n\tdec := xdr.NewDecoderCustomTypes(rdr, 0, ct)\n\t// Hostname: string\n\t_, err = dec.Decode(&rHostname)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" } ]
[ { "docid": "15afff7deb7d501db5b6bfa134a4acd9", "score": "0.68428415", "text": "func (rc RequestCall) GetHostname() string {\n\treturn strings.Split(rc.Request.Host, \":\")[0]\n}", "title": "" }, { "docid": "b1c65b3dae5f6731b210d06081c01430", "score": "0.66898394", "text": "func GetHostname(self *C.PyObject, args *C.PyObject) *C.PyObject {\n\thostname, err := util.GetHostname()\n\tif err != nil {\n\t\tlog.Warnf(\"Error getting hostname: %s\\n\", err)\n\t\thostname = \"\"\n\t}\n\n\tcStr := C.CString(hostname)\n\tpyStr := C.PyString_FromString(cStr)\n\tC.free(unsafe.Pointer(cStr))\n\treturn pyStr\n}", "title": "" }, { "docid": "4e33a9553f8e21f6969ae74f50f6023c", "score": "0.65757334", "text": "func GetHostName() string {\n\treturn os.Getenv(\"HOSTNAME\")\n}", "title": "" }, { "docid": "44aa6e2deacd52a0ecea627b9bf799e8", "score": "0.6567153", "text": "func (s *WindowsDesktopServiceV3) GetHostname() string {\n\treturn s.Spec.Hostname\n}", "title": "" }, { "docid": "a5fef264fd386bfc75bcfa3dd9470ef6", "score": "0.6552462", "text": "func GetHostname() (string, error) {\n\thostnameData, err := GetHostnameData()\n\treturn hostnameData.Hostname, err\n}", "title": "" }, { "docid": "f535cb80e6daa6d2025b920a90bcca93", "score": "0.65334934", "text": "func (m *Message) GetHostname() string {\n\tif m.Lambda != nil {\n\t\treturn m.Lambda.ARN\n\t}\n\thname, err := hostname.Get(context.TODO())\n\tif err != nil {\n\t\t// this scenario is not likely to happen since\n\t\t// the agent cannot start without a hostname\n\t\thname = \"unknown\"\n\t}\n\treturn hname\n}", "title": "" }, { "docid": "51d10cd8c664f2c5b470285e1fcc2b40", "score": "0.64052737", "text": "func (n *Namespace) GetHostName(cmd *exec.Cmd) {\n\tcmd.SysProcAttr = &syscall.SysProcAttr{\n\t\tCloneflags: syscall.CLONE_NEWUTS,\n\t}\n}", "title": "" }, { "docid": "ce1472ac737c25558aca323380813557", "score": "0.63958544", "text": "func (f *FastURL) GetHostname() []byte {\n\treturn f.hostname\n}", "title": "" }, { "docid": "0c497fda7548f8ef49481f4b7a9a1c64", "score": "0.63690305", "text": "func GetHostname(host ...string) string {\n\tif len(host) > 0 && strings.TrimSpace(host[0]) != \"\" {\n\t\tif h, ok := hostHostList[host[0]]; ok {\n\t\t\treturn h\n\t\t}\n\t\tstr := GetCmdStr(\"host %s\", host[0])\n\t\th := \"\"\n\t\tif strings.Contains(str, \"has address\") {\n\t\t\th = GetCmdStr(\"host %s|awk '{print $1}'\", host[0])\n\t\t\thostHostList[host[0]] = h\n\t\t} else if strings.Contains(str, \"domain name pointer\") {\n\t\t\th = strings.TrimSuffix(GetCmdStr(\"host %s|awk '{print $5}'\", host[0]), \".\")\n\t\t\thostHostList[host[0]] = h\n\t\t}\n\t\treturn h\n\t}\n\tif chostname == \"\" {\n\t\th, err := os.Hostname()\n\t\tif err != nil {\n\t\t\tchostname = GetCmdStr(\"hostname\")\n\t\t} else {\n\t\t\tchostname = h\n\t\t}\n\t}\n\treturn chostname\n}", "title": "" }, { "docid": "07375ab7bdc7e126898a749f823151b8", "score": "0.6352151", "text": "func GetHostname() string {\n\tname, err := os.Hostname()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn name\n}", "title": "" }, { "docid": "4b3284ba5b64274f4db2b1b2b705ebb8", "score": "0.63479674", "text": "func (o *NSQProducer) GetHostname() string {\n\tif o == nil || o.Hostname == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Hostname\n}", "title": "" }, { "docid": "dcd140039952ded9224a519f665df02c", "score": "0.6330127", "text": "func (p *ProxyForward) GetHostname() string {\n\tif p.Hostname != \"\" {\n\t\treturn p.Hostname\n\t}\n\n\treturn p.Name\n}", "title": "" }, { "docid": "fc3f36926490ec8e394ad0a3f91d83f3", "score": "0.6307701", "text": "func GetHostname(hostname string) (string, error) {\n\tif hostname != \"\" {\n\t\treturn hostname, nil\n\t}\n\treturn os.Hostname()\n}", "title": "" }, { "docid": "e16720eb900ba4bb813b5e77a3390aab", "score": "0.62544924", "text": "func GetHostnameData() (HostnameData, error) {\n\tcacheHostnameKey := cache.BuildAgentKey(\"hostname\")\n\tif cacheHostname, found := cache.Cache.Get(cacheHostnameKey); found {\n\t\treturn cacheHostname.(HostnameData), nil\n\t}\n\n\tvar hostName string\n\tvar err error\n\tvar provider string\n\n\t// try the name provided in the configuration file\n\tconfigName := config.Datadog.GetString(\"hostname\")\n\terr = validate.ValidHostname(configName)\n\tif err == nil {\n\t\thostnameData := saveHostnameData(cacheHostnameKey, configName, HostnameProviderConfiguration)\n\t\tif !isHostnameCanonicalForIntake(configName) && !config.Datadog.GetBool(\"hostname_force_config_as_canonical\") {\n\t\t\t_ = log.Warnf(\"Hostname '%s' defined in configuration will not be used as the in-app hostname. For more information: https://dtdg.co/agent-hostname-force-config-as-canonical\", configName)\n\t\t}\n\t\treturn hostnameData, err\n\t}\n\n\texpErr := new(expvar.String)\n\texpErr.Set(err.Error())\n\thostnameErrors.Set(\"configuration/environment\", expErr)\n\n\tlog.Debugf(\"Unable to get the hostname from the config file: %s\", err)\n\tlog.Debug(\"Trying to determine a reliable host name automatically...\")\n\n\t// if fargate we strip the hostname\n\tif fargate.IsFargateInstance() {\n\t\thostnameData := saveHostnameData(cacheHostnameKey, \"\", \"\")\n\t\treturn hostnameData, nil\n\t}\n\n\t// GCE metadata\n\tlog.Debug(\"GetHostname trying GCE metadata...\")\n\tif getGCEHostname, found := hostname.ProviderCatalog[\"gce\"]; found {\n\t\tgceName, err := getGCEHostname()\n\t\tif err == nil {\n\t\t\thostnameData := saveHostnameData(cacheHostnameKey, gceName, \"gce\")\n\t\t\treturn hostnameData, err\n\t\t}\n\t\texpErr := new(expvar.String)\n\t\texpErr.Set(err.Error())\n\t\thostnameErrors.Set(\"gce\", expErr)\n\t\tlog.Debug(\"Unable to get hostname from GCE: \", err)\n\t}\n\n\t// FQDN\n\tvar fqdn string\n\tcanUseOSHostname := isOSHostnameUsable()\n\tif canUseOSHostname {\n\t\tlog.Debug(\"GetHostname trying FQDN/`hostname -f`...\")\n\t\tfqdn, err = getSystemFQDN()\n\t\tif config.Datadog.GetBool(\"hostname_fqdn\") && err == nil {\n\t\t\thostName = fqdn\n\t\t\tprovider = \"fqdn\"\n\t\t} else {\n\t\t\tif err != nil {\n\t\t\t\texpErr := new(expvar.String)\n\t\t\t\texpErr.Set(err.Error())\n\t\t\t\thostnameErrors.Set(\"fqdn\", expErr)\n\t\t\t}\n\t\t\tlog.Debug(\"Unable to get FQDN from system: \", err)\n\t\t}\n\t}\n\n\tisContainerized, containerName := getContainerHostname()\n\tif isContainerized {\n\t\tif containerName != \"\" {\n\t\t\thostName = containerName\n\t\t\tprovider = \"container\"\n\t\t} else {\n\t\t\texpErr := new(expvar.String)\n\t\t\texpErr.Set(\"Unable to get hostname from container API\")\n\t\t\thostnameErrors.Set(\"container\", expErr)\n\t\t}\n\t}\n\n\tif canUseOSHostname && hostName == \"\" {\n\t\t// os\n\t\tlog.Debug(\"GetHostname trying os...\")\n\t\tsystemName, err := os.Hostname()\n\t\tif err == nil {\n\t\t\thostName = systemName\n\t\t\tprovider = \"os\"\n\t\t} else {\n\t\t\texpErr := new(expvar.String)\n\t\t\texpErr.Set(err.Error())\n\t\t\thostnameErrors.Set(\"os\", expErr)\n\t\t\tlog.Debug(\"Unable to get hostname from OS: \", err)\n\t\t}\n\t}\n\n\t/* at this point we've either the hostname from the os or an empty string */\n\n\t// We use the instance id if we're on an ECS cluster or we're on EC2\n\t// and the hostname is one of the default ones\n\tif getEC2Hostname, found := hostname.ProviderCatalog[\"ec2\"]; found {\n\t\tlog.Debug(\"GetHostname trying EC2 metadata...\")\n\n\t\tif ecs.IsECSInstance() || ec2.IsDefaultHostname(hostName) {\n\t\t\tec2Hostname, err := getValidEC2Hostname(getEC2Hostname)\n\n\t\t\tif err == nil {\n\t\t\t\thostName = ec2Hostname\n\t\t\t\tprovider = \"aws\"\n\t\t\t} else {\n\t\t\t\texpErr := new(expvar.String)\n\t\t\t\texpErr.Set(err.Error())\n\t\t\t\thostnameErrors.Set(\"aws\", expErr)\n\t\t\t\tlog.Debug(err)\n\t\t\t}\n\t\t} else {\n\t\t\terr := fmt.Errorf(\"not retrieving hostname from AWS: the host is not an ECS instance and other providers already retrieve non-default hostnames\")\n\t\t\tlog.Debug(err.Error())\n\t\t\texpErr := new(expvar.String)\n\t\t\texpErr.Set(err.Error())\n\t\t\thostnameErrors.Set(\"aws\", expErr)\n\n\t\t\t// Display a message when enabling `ec2_use_windows_prefix_detection` would make the hostname resolution change.\n\t\t\tif ec2.IsWindowsDefaultHostname(hostName) {\n\t\t\t\t// As we are in the else clause `ec2.IsDefaultHostname(hostName)` is false. If `ec2.IsWindowsDefaultHostname(hostName)`\n\t\t\t\t// is `true` that means `ec2_use_windows_prefix_detection` is set to false.\n\t\t\t\tec2Hostname, err := getValidEC2Hostname(getEC2Hostname)\n\n\t\t\t\t// Check if we get a valid hostname when enabling `ec2_use_windows_prefix_detection` and the hostnames are different.\n\t\t\t\tif err == nil && ec2Hostname != hostName {\n\t\t\t\t\t// REMOVEME: This should be removed if/when the default `ec2_use_windows_prefix_detection` is set to true\n\t\t\t\t\tlog.Infof(\"The agent resolved your hostname as '%s'. You may want to use the EC2 instance-id ('%s') for the in-app hostname.\"+\n\t\t\t\t\t\t\" For more information: https://docs.datadoghq.com/ec2-use-win-prefix-detection\", hostName, ec2Hostname)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\th, err := os.Hostname()\n\tif err == nil && !config.Datadog.GetBool(\"hostname_fqdn\") && fqdn != \"\" && hostName == h && h != fqdn {\n\t\tif runtime.GOOS != \"windows\" {\n\t\t\t// REMOVEME: This should be removed when the default `hostname_fqdn` is set to true\n\t\t\tlog.Warnf(\"DEPRECATION NOTICE: The agent resolved your hostname as '%s'. However in a future version, it will be resolved as '%s' by default. To enable the future behavior, please enable the `hostname_fqdn` flag in the configuration. For more information: https://dtdg.co/flag-hostname-fqdn\", h, fqdn)\n\t\t} else { // OS is Windows\n\t\t\tlog.Warnf(\"The agent resolved your hostname as '%s', and will be reported this way to maintain compatibility with version 5. To enable reporting as '%s', please enable the `hostname_fqdn` flag in the configuration. For more information: https://dtdg.co/flag-hostname-fqdn\", h, fqdn)\n\t\t}\n\t}\n\n\t// If at this point we don't have a name, bail out\n\tif hostName == \"\" {\n\t\terr = fmt.Errorf(\"unable to reliably determine the host name. You can define one in the agent config file or in your hosts file\")\n\t} else {\n\t\t// we got a hostname, residual errors are irrelevant now\n\t\terr = nil\n\t}\n\n\thostnameData := saveHostnameData(cacheHostnameKey, hostName, provider)\n\tif err != nil {\n\t\texpErr := new(expvar.String)\n\t\texpErr.Set(fmt.Sprintf(err.Error()))\n\t\thostnameErrors.Set(\"all\", expErr)\n\t}\n\treturn hostnameData, err\n}", "title": "" }, { "docid": "b7e8eb5fd48ad7941084139aefd3bb8c", "score": "0.62408286", "text": "func getHostName() (string){\n host, err := os.Hostname()\n if err != nil {\n fmt.Println(\"%s\", err)\n log.Error(\"get os.HostName error \", err)\n } else {\n //fmt.Println(\"%s\", host)\n log.Debugf(\"get os.HostName success host:\", host)\n }\n return host\n}", "title": "" }, { "docid": "10e97973f70d706d5cc377ac304ae34e", "score": "0.6239771", "text": "func (s *DatabaseServerV3) GetHostname() string {\n\treturn s.Spec.Hostname\n}", "title": "" }, { "docid": "6e833ae4d169ca98aea8e7235ad33fff", "score": "0.623276", "text": "func (s *AppServerV3) GetHostname() string {\n\treturn s.Spec.Hostname\n}", "title": "" }, { "docid": "0ba790ed4f54bc4bae90b425eb0ba333", "score": "0.6208936", "text": "func internalHostname() (hn string, err error) {\n\t// attempt to fetch FQDN\n\thn, err = helpers.RunCommand(\"/usr/bin/env\", \"\", \"hostname\", \"-f\")\n\tif err == nil && hn != \"\" {\n\t\treturn\n\t}\n\n\t// failing that try the short name\n\thn, err = helpers.RunCommand(\"/usr/bin/env\", \"\", \"hostname\")\n\tif err == nil && hn != \"\" {\n\t\treturn\n\t}\n\n\t// return whatever we did get including the error\n\treturn\n}", "title": "" }, { "docid": "c653304b51d1c39f01d4866a00b072c0", "score": "0.6208484", "text": "func GetHostname(req *http.Request) string {\n\tif req == nil {\n\t\treturn \"\"\n\t}\n\th, _, err := net.SplitHostPort(req.Host)\n\tif err != nil {\n\t\treturn req.Host\n\t}\n\treturn h\n}", "title": "" }, { "docid": "25f92b602eb4033875bd6229c95799d1", "score": "0.62019706", "text": "func (o *V0037Node) GetHostname() string {\n\tif o == nil || o.Hostname == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Hostname\n}", "title": "" }, { "docid": "f0334bf754c61c0f586d1a36b1e772ba", "score": "0.6169442", "text": "func (o *SmartstackBackend) GetHostname() string {\n\tif o == nil || o.Hostname == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Hostname\n}", "title": "" }, { "docid": "c65a55a50e55ea68623b042b84b6fdf0", "score": "0.6155541", "text": "func (s *SessionTrackerV1) GetHostname() string {\n\treturn s.Spec.Hostname\n}", "title": "" }, { "docid": "5c04d427b26630b3823a58a84900bdc5", "score": "0.61473167", "text": "func GetHostname() string {\n\thostname, err := os.Hostname()\n\tif err != nil {\n\t\tlog.Errorf(\"failed to get hostname, err: %v\", err)\n\t\treturn \"\"\n\t}\n\n\treturn hostname\n}", "title": "" }, { "docid": "955a050e50da93d457a2ba028ad3ff11", "score": "0.6141584", "text": "func GetHostname() string {\n\thostname, err := os.Hostname()\n\n\tif err != nil {\n\t\thostname = \"Unknown\"\n\t\tlog.Fatal(err)\n\t}\n\n\treturn hostname\n}", "title": "" }, { "docid": "ffde8e91bb8de83268ca764a8afb931e", "score": "0.6135613", "text": "func (o *ServiceCheck) GetHostName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn o.HostName\n}", "title": "" }, { "docid": "845e727fe80731bcf5b388ebf8d452e5", "score": "0.61140287", "text": "func GetHostname() (string, error) {\n\thostname, err := os.Hostname()\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn strings.ToLower(hostname), nil\n}", "title": "" }, { "docid": "4a4195115bf9a0c6e7dae670faff93ce", "score": "0.60845613", "text": "func getHostname(c *gin.Context) {\n\tname, err := os.Hostname()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tc.IndentedJSON(http.StatusOK, gin.H{\"hostname\": name})\n}", "title": "" }, { "docid": "b3e59d9b7f492c6cad2a58433e7cc4a3", "score": "0.60755754", "text": "func (o *ShowSystem) GetHostname() string {\n\tif o == nil || IsNil(o.Hostname) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Hostname\n}", "title": "" }, { "docid": "57834fefb54aef4f35194da5099df449", "score": "0.6040795", "text": "func GetHostname() (string, error) {\n\tif !config.IsCloudProviderEnabled(CloudProviderName) {\n\t\treturn \"\", fmt.Errorf(\"cloud provider is disabled by configuration\")\n\t}\n\n\thostname, err := getMetadataItemWithMaxLength(\"/hostname\", config.Datadog.GetInt(\"metadata_endpoints_max_hostname_size\"))\n\tif err != nil {\n\t\tif hostname, found := cache.Cache.Get(hostnameCacheKey); found {\n\t\t\tlog.Debugf(\"Unable to get ec2 hostname from aws metadata, returning cached hostname '%s': %s\", hostname, err)\n\t\t\treturn hostname.(string), nil\n\t\t}\n\t\treturn \"\", err\n\t}\n\n\tcache.Cache.Set(hostnameCacheKey, hostname, cache.NoExpiration)\n\n\treturn hostname, nil\n}", "title": "" }, { "docid": "2213033aa424a02d43a939cab4424be4", "score": "0.6031346", "text": "func GetHostname(hostnameOverride string) string {\n\thostname := hostnameOverride\n\tif hostname == \"\" {\n\t\tnodename, err := os.Hostname()\n\t\tif err != nil {\n\t\t\tglog.Fatalf(\"couldn't determine hostname: %v\", err)\n\t\t}\n\t\thostname = nodename\n\t}\n\treturn strings.ToLower(strings.TrimSpace(hostname))\n}", "title": "" }, { "docid": "b9043137ac19ab04726e74eae330381c", "score": "0.600075", "text": "func GetHostname(addr string) string {\n\treturn strings.Split(addr, \":\")[0]\n}", "title": "" }, { "docid": "d2f012a1f9f54a6073448969588caa12", "score": "0.60006166", "text": "func (c *Config) GetHostname() string {\n\thostname := c.GlobalConfig.Hostname\n\tif hostname != \"\" {\n\t\treturn hostname\n\t}\n\n\tvar err error\n\thostname, err = os.Hostname()\n\tif err != nil {\n\t\tlog.Error(err)\n\t}\n\treturn hostname\n}", "title": "" }, { "docid": "5b6502f5e94c364489abc7af841a0372", "score": "0.59123975", "text": "func getEndpointHostName(ep string, exec executor.Executor) (string, error) {\n\tres, err := exec.Exec(\"wget\", \"-O-\", \"-q\", fmt.Sprintf(\"http://%s/hostname\", ep))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "5b6502f5e94c364489abc7af841a0372", "score": "0.59123975", "text": "func getEndpointHostName(ep string, exec executor.Executor) (string, error) {\n\tres, err := exec.Exec(\"wget\", \"-O-\", \"-q\", fmt.Sprintf(\"http://%s/hostname\", ep))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "733cfd7fd56091dafc3f31ecb154e9b1", "score": "0.5904645", "text": "func (o HybridConnectionOutput) Hostname() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *HybridConnection) pulumi.StringOutput { return v.Hostname }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "04c4d74de3941bf3115f25836e199d98", "score": "0.59003294", "text": "func (l *Libvirt) DomainGetHostname(Dom Domain, Flags DomainGetHostnameFlags) (rHostname string, err error) {\n\tvar buf []byte\n\n\targs := DomainGetHostnameArgs {\n\t\tDom: Dom,\n\t\tFlags: Flags,\n\t}\n\n\tbuf, err = encode(&args)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar r response\n\tr, err = l.requestStream(277, constants.Program, buf, nil, nil)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Return value unmarshaling\n\ttpd := typedParamDecoder{}\n\tct := map[string]xdr.TypeDecoder{\"libvirt.TypedParam\": tpd}\n\trdr := bytes.NewReader(r.Payload)\n\tdec := xdr.NewDecoderCustomTypes(rdr, 0, ct)\n\t// Hostname: string\n\t_, err = dec.Decode(&rHostname)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "c3a5b3d11e3ab7d9329587e16a82170e", "score": "0.58985406", "text": "func GetHostname(ctx context.Context) (string, error) {\n\tmetadataJSON, err := instanceMetaFetcher.Fetch(ctx)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar metadata struct {\n\t\tVMID string\n\t}\n\tif err := json.Unmarshal([]byte(metadataJSON), &metadata); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to parse Azure instance metadata: %s\", err)\n\t}\n\n\tif err := validate.ValidHostname(metadata.VMID); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn metadata.VMID, nil\n}", "title": "" }, { "docid": "c52fc6da2d4ffc6e9d8ed6f731e195b9", "score": "0.58941585", "text": "func (o *NSQProducer) GetHostnameOk() (*string, bool) {\n\tif o == nil || o.Hostname == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Hostname, true\n}", "title": "" }, { "docid": "21fee5176def08b2787b8332d90dc4b4", "score": "0.5865625", "text": "func Hostname() (string, error)", "title": "" }, { "docid": "5c1cf010beff11d79ac709633ed7a475", "score": "0.5850872", "text": "func hostname(hostport string) (string, error) {\n\thost, _, err := net.SplitHostPort(hostport)\n\treturn host, err\n}", "title": "" }, { "docid": "225a14b8b03419e2b1777ca456592935", "score": "0.58133924", "text": "func GetHostname(hostnameOverride string) (string, error) {\n\thostName := hostnameOverride\n\tif len(hostName) == 0 {\n\t\tnodeName, err := os.Hostname()\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"couldn't determine hostname: %v\", err)\n\t\t}\n\t\thostName = nodeName\n\t}\n\n\t// Trim whitespaces first to avoid getting an empty hostname\n\t// For linux, the hostname is read from file /proc/sys/kernel/hostname directly\n\thostName = strings.TrimSpace(hostName)\n\tif len(hostName) == 0 {\n\t\treturn \"\", fmt.Errorf(\"empty hostname is invalid\")\n\t}\n\treturn strings.ToLower(hostName), nil\n}", "title": "" }, { "docid": "440f1bad3ec3868bf25d927d4d64c388", "score": "0.5809314", "text": "func GetHostname(hostnameOverride string) (string, error) {\n\thostName := hostnameOverride\n\tif len(hostName) == 0 {\n\t\tnodeName, err := os.Hostname()\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"couldn't determine hostname: %w\", err)\n\t\t}\n\t\thostName = nodeName\n\t}\n\n\t// Trim whitespaces first to avoid getting an empty hostname\n\t// For linux, the hostname is read from file /proc/sys/kernel/hostname directly\n\thostName = strings.TrimSpace(hostName)\n\tif len(hostName) == 0 {\n\t\treturn \"\", fmt.Errorf(\"empty hostname is invalid\")\n\t}\n\n\treturn strings.ToLower(hostName), nil\n}", "title": "" }, { "docid": "c3752724a1143fc52410a1b063c8c5ed", "score": "0.5803021", "text": "func (o *NodeUpdate) GetHostname() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Hostname\n}", "title": "" }, { "docid": "0f95b4334ad047d841d8d16639aeaa60", "score": "0.5768926", "text": "func (d *Driver) GetSSHHostname() (string, error) {\n\treturn d.GetIP()\n}", "title": "" }, { "docid": "0f95b4334ad047d841d8d16639aeaa60", "score": "0.5768926", "text": "func (d *Driver) GetSSHHostname() (string, error) {\n\treturn d.GetIP()\n}", "title": "" }, { "docid": "0f95b4334ad047d841d8d16639aeaa60", "score": "0.5768926", "text": "func (d *Driver) GetSSHHostname() (string, error) {\n\treturn d.GetIP()\n}", "title": "" }, { "docid": "48a11d707ffd3b17bf9c584f4d1d5b95", "score": "0.5757216", "text": "func (c *Conn) GetHostName(property string) (string, error) {\n\tp, err := c.object.GetProperty(dbusInterface + \".\" + property)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tv, b := p.Value().(string)\n\tif !b {\n\t\treturn \"\", fmt.Errorf(\"Empty value received: %s\", property)\n\t}\n\n\treturn v, nil\n}", "title": "" }, { "docid": "e397095388f63dca2e3bbb54d45c8603", "score": "0.57544273", "text": "func ConnVerifyHostname(c *tls.Conn, host string) error", "title": "" }, { "docid": "f6b89902cea1831bbc99daad43c86f59", "score": "0.57476974", "text": "func (o *SmartstackBackend) GetHostnameOk() (*string, bool) {\n\tif o == nil || o.Hostname == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Hostname, true\n}", "title": "" }, { "docid": "b2b824fb7979967a57698c062a4b7ed4", "score": "0.57469463", "text": "func GetHostName(hostAddr string) string {\n\treturn strings.Split(hostAddr, base.UrlPortNumberDelimiter)[0]\n}", "title": "" }, { "docid": "79c46b95250422458c67433e0fd3b162", "score": "0.5742529", "text": "func GetHost() string {\n\treturn Config().Hostname\n}", "title": "" }, { "docid": "841cc9417197cd6113e7a641e4dbcb14", "score": "0.57367855", "text": "func (o *ShowSystem) GetHostnameOk() (*string, bool) {\n\tif o == nil || IsNil(o.Hostname) {\n\t\treturn nil, false\n\t}\n\treturn o.Hostname, true\n}", "title": "" }, { "docid": "6de5978c50e8fec65fd016966c6aae17", "score": "0.5719986", "text": "func (p *PluginConfig) GetRemoteHostname() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\tif identity, err := bufpluginref.PluginIdentityForString(p.Plugin); err == nil {\n\t\treturn identity.Remote()\n\t}\n\tif reference, err := bufpluginref.PluginReferenceForString(p.Plugin, 0); err == nil {\n\t\treturn reference.Remote()\n\t}\n\tif p.Remote == \"\" {\n\t\treturn \"\"\n\t}\n\tif remote, _, _, _, err := bufremoteplugin.ParsePluginVersionPath(p.Remote); err == nil {\n\t\treturn remote\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "e56d4e288a8f45bd806197c789c6e524", "score": "0.57103926", "text": "func (p *ProxyForward) GetProxyHostname() string {\n\tif p.ProxyHostname != \"\" {\n\t\treturn p.ProxyHostname\n\t}\n\n\treturn \"127.0.0.1\"\n}", "title": "" }, { "docid": "ca615b910f9b6155dca8da9234ab09d9", "score": "0.57089424", "text": "func (m *SiteCollection) GetHostname()(*string) {\n return m.hostname\n}", "title": "" }, { "docid": "6705ee8897516c0df862debe0a5411ef", "score": "0.56951773", "text": "func (o LookupServerResultOutput) Hostname() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupServerResult) string { return v.Hostname }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0ffaa9eb4102b74097ac718d7c8c1913", "score": "0.568002", "text": "func (o *V0037Node) GetHostnameOk() (*string, bool) {\n\tif o == nil || o.Hostname == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Hostname, true\n}", "title": "" }, { "docid": "8eadce07678d08b39dcc72d225538d41", "score": "0.56533116", "text": "func (o *ApplianceDeviceClaimAllOf) GetHostname() string {\n\tif o == nil || o.Hostname == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Hostname\n}", "title": "" }, { "docid": "4e50e9edb97e0f2f900195d5e4482128", "score": "0.56512594", "text": "func (o *EventAttributes) GetHostname() string {\n\tif o == nil || o.Hostname == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Hostname\n}", "title": "" }, { "docid": "2cdfba25e33df9c0015d135b04c73dfb", "score": "0.561074", "text": "func (o *NodeUpdate) GetHostnameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Hostname, true\n}", "title": "" }, { "docid": "d1ced0561aea9540b46c2fe1decd2e21", "score": "0.5582689", "text": "func getHostName(staxName string, nodeName string) string {\n\treturn fmt.Sprintf(\"%s-%s\", staxName, nodeName)\n}", "title": "" }, { "docid": "2cec9f1677eb0fc14e0466358968b577", "score": "0.55731255", "text": "func GetHostName(r *http.Request) string {\n\thost := r.Header.Get(\"X-Forwarded-Host\")\n\tif host != \"\" {\n\t\treturn host\n\t}\n\treturn r.Host\n}", "title": "" }, { "docid": "8e6ff1f00ee8864a94ba1424994a763a", "score": "0.5549088", "text": "func (m *MockAgentServer) GetHostname(arg0 context.Context, arg1 *core.HostnameRequest) (*core.HostnameReply, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetHostname\", arg0, arg1)\n\tret0, _ := ret[0].(*core.HostnameReply)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "f6aeb0ae4cdecb619538bef498ecc8a3", "score": "0.55467653", "text": "func getRemoteHostname(ip string) string {\n\temptyValue := EmptyValue\n\n\tif jsonOut {\n\t\temptyValue = \"\"\n\t}\n\n\tif !lookupHostnames {\n\t\treturn emptyValue\n\t}\n\n\tif hostnameCache.Contains(ip) {\n\t\tv, _ := hostnameCache.Get(ip)\n\n\t\tif hostname, ok := v.(string); ok {\n\t\t\t//fmt.Println(\"HIT\")\n\t\t\treturn hostname\n\t\t}\n\t}\n\thostnames, err := net.LookupAddr(ip)\n\tif err != nil {\n\t\treturn emptyValue\n\t} else {\n\t\tif len(hostnames) > 0 {\n\t\t\thostnameCache.Add(ip, hostnames[0])\n\t\t\treturn hostnames[0]\n\t\t}\n\t}\n\treturn emptyValue\n\n}", "title": "" }, { "docid": "d7071816f80ca5e957dc6a44eb019c92", "score": "0.5542276", "text": "func (m *MockAgentClient) GetHostname(ctx context.Context, in *core.HostnameRequest, opts ...grpc.CallOption) (*core.HostnameReply, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, in}\n\tfor _, a := range opts {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"GetHostname\", varargs...)\n\tret0, _ := ret[0].(*core.HostnameReply)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "4f7e4b95b09943a38a8892888e3e427c", "score": "0.55292493", "text": "func (o ProviderOutput) ApiHostname() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.ApiHostname }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "0d984f9710d651e604f4fdd8de1e049f", "score": "0.5515926", "text": "func (c *Client) Hostname() (string, error) {\n\treturn c.get(\"/hostname\")\n}", "title": "" }, { "docid": "f487fc9837ec2a72bb51e32134dfe2d4", "score": "0.55112165", "text": "func getHostName(key string) string {\n\thostname := os.Getenv(key)\n\tif hostname == \"\" {\n\t\treturn \"localhost\"\n\t}\n\treturn hostname\n}", "title": "" }, { "docid": "d9a154c6814ea64520cddeae0a1f0351", "score": "0.54894376", "text": "func (o GetServiceHostnameConfigurationScmOutput) HostName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetServiceHostnameConfigurationScm) string { return v.HostName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "13b5beb3374bc8f0daa3ca66c4884a2b", "score": "0.54600614", "text": "func callboxHostName(dut *dut.DUT) (string, error) {\n\tdutHost := dut.HostName()\n\tif host, _, err := net.SplitHostPort(dutHost); err == nil {\n\t\tdutHost = host\n\t}\n\n\tdutHost = strings.TrimSuffix(dutHost, \".cros\")\n\tif dutHost == \"localhost\" {\n\t\treturn \"\", errors.Errorf(\"unable to parse hostname from: %q, localhost not supported\", dutHost)\n\t}\n\n\tif ip := net.ParseIP(dutHost); ip != nil {\n\t\treturn \"\", errors.Errorf(\"unable to parse hostname from: %q, ip:port format not supported\", dutHost)\n\t}\n\n\thostname := strings.Split(dutHost, \"-\")\n\tif len(hostname) < 2 {\n\t\treturn \"\", errors.Errorf(\"unable to parse hostname from: %q, unknown name format\", dutHost)\n\t}\n\n\t// CallboxManager expects callbox hostnames to end in .cros\n\thostname = hostname[0 : len(hostname)-1]\n\treturn fmt.Sprintf(\"%s.cros\", strings.Join(hostname, \"-\")), nil\n}", "title": "" }, { "docid": "cbd166aff218e24595523ab4ace15138", "score": "0.5456443", "text": "func (o *ServiceBrokerOpenstacksHostsGetParams) SetHostname(hostname string) {\n\to.Hostname = hostname\n}", "title": "" }, { "docid": "59f1ef182835166916becc87244de9a2", "score": "0.5453319", "text": "func (o *NSQProducer) SetHostname(v string) {\n\to.Hostname = &v\n}", "title": "" }, { "docid": "11c251ce859f48387670e9f1c8740bc1", "score": "0.5433654", "text": "func (o GetServiceHostnameConfigurationManagementOutput) HostName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetServiceHostnameConfigurationManagement) string { return v.HostName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "2a916d894ddf686b0e8d5aa7b2dc3c04", "score": "0.5406567", "text": "func (o *ServiceCheck) GetHostNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.HostName, true\n}", "title": "" }, { "docid": "e076281c3e3df26f360aad5d75f7d995", "score": "0.53899837", "text": "func (o LookupInstanceResultOutput) Hostname() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupInstanceResult) string { return v.Hostname }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b8db43dbaff402abc7f4999232f6e19a", "score": "0.53896135", "text": "func (o EciScalingConfigurationOutput) HostName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *EciScalingConfiguration) pulumi.StringPtrOutput { return v.HostName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "9fb897bf2fb527830947225aebdae5aa", "score": "0.5368003", "text": "func (o GetServiceHostnameConfigurationProxyOutput) HostName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetServiceHostnameConfigurationProxy) string { return v.HostName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "90ef4e72876affa7f3f6241e31cfd863", "score": "0.5362186", "text": "func (client *Client) DescribeDBInstanceIpHostnameWithCallback(request *DescribeDBInstanceIpHostnameRequest, callback func(response *DescribeDBInstanceIpHostnameResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeDBInstanceIpHostnameResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeDBInstanceIpHostname(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}", "title": "" }, { "docid": "0610fdd80855e1c8c55048c405ad480e", "score": "0.5357966", "text": "func (o *EventAttributes) GetHostnameOk() (*string, bool) {\n\tif o == nil || o.Hostname == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Hostname, true\n}", "title": "" }, { "docid": "e89c1d584e52aae713b2293b645f990a", "score": "0.534166", "text": "func (o ZoneSoaRecordOutput) HostName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ZoneSoaRecord) *string { return v.HostName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "e89c1d584e52aae713b2293b645f990a", "score": "0.534166", "text": "func (o ZoneSoaRecordOutput) HostName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ZoneSoaRecord) *string { return v.HostName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4c45ca4673468e359bf797eb0894fd06", "score": "0.5331739", "text": "func resolveHostname(hostname string) string {\n\tswitch hostname {\n\tcase registry.IndexHostname, registry.IndexName, registry.DefaultV2Registry.Host:\n\t\treturn registry.IndexServer\n\t}\n\treturn hostname\n}", "title": "" }, { "docid": "3d2a1db5cc38b2358549fe595755233a", "score": "0.53032446", "text": "func getFqdnHostname(osHost string) (string, error) {\n\tips, err := lookupIp(osHost)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfor _, ip := range ips {\n\t\thosts, err := lookupAddr(ip.String())\n\t\tif err != nil || len(hosts) == 0 {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif hosts[0] == \"localhost\" {\n\t\t\tcontinue\n\t\t}\n\t\ttrace.Hostname(\"found FQDN hosts: %s\", strings.Join(hosts, \", \"))\n\t\treturn strings.TrimSuffix(hosts[0], \".\"), nil\n\t}\n\treturn \"\", errors.New(\"can't lookup FQDN\")\n}", "title": "" }, { "docid": "b3da03aa15b5096600b0ea22d6419f82", "score": "0.52980435", "text": "func (o *ApplianceDeviceClaimAllOf) GetHostnameOk() (*string, bool) {\n\tif o == nil || o.Hostname == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Hostname, true\n}", "title": "" }, { "docid": "0642f696eca916e779f17e43e870d490", "score": "0.5270317", "text": "func Get() string {\n\tif hostname := os.Getenv(\"SCOPE_HOSTNAME\"); hostname != \"\" {\n\t\treturn hostname\n\t}\n\thostname, err := os.Hostname()\n\tif err != nil {\n\t\treturn \"(unknown)\"\n\t}\n\treturn hostname\n}", "title": "" }, { "docid": "cfa26ca036ada3ab2ae8aba7f8cd6b44", "score": "0.5269535", "text": "func (_this *URL) Hostname() string {\n\tvar ret string\n\tvalue := _this.Value_JS.Get(\"hostname\")\n\tret = (value).String()\n\treturn ret\n}", "title": "" }, { "docid": "2cdebb7b5b2e7629e354bdd5dfef9e4f", "score": "0.5268839", "text": "func (o ServiceHostnameConfigurationScmOutput) HostName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ServiceHostnameConfigurationScm) string { return v.HostName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "6400a9fbd3f21b3d2fac7493b17762be", "score": "0.52668816", "text": "func (c *Ctx) Hostname() string {\n\treturn BytesToString(c.Request.URI().Host())\n}", "title": "" }, { "docid": "b380e348415c3b30c1f7da35847528cf", "score": "0.52584517", "text": "func (o EcsLaunchTemplateOutput) HostName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *EcsLaunchTemplate) pulumi.StringPtrOutput { return v.HostName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "b1bf7a951d2f6ea0ea36dd21f39274eb", "score": "0.52548385", "text": "func (j *Jail) Hostname() string {\n\treturn j.hostname\n}", "title": "" }, { "docid": "4aad90c8e1caee2b21acc7aa0eeee97d", "score": "0.52545655", "text": "func Test_Ctx_Hostname(t *testing.T) {\n\tt.Parallel()\n\tapp := New()\n\tctx := app.AcquireCtx(&fasthttp.RequestCtx{})\n\tdefer app.ReleaseCtx(ctx)\n\tctx.Fasthttp.Request.SetRequestURI(\"http://google.com/test\")\n\tutils.AssertEqual(t, \"google.com\", ctx.Hostname())\n}", "title": "" }, { "docid": "ccb3db57cf339f433d4b8decf7a1529e", "score": "0.5254401", "text": "func (o CustomDomainScmOutput) HostName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CustomDomainScm) string { return v.HostName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "1da855d2dd9c71445a698913027881a7", "score": "0.52494705", "text": "func (mc *MockContiv) GetHostInterconnectIfName() string {\n\treturn mc.hostInterconnect\n}", "title": "" }, { "docid": "008df2ee340e49d9febae8db368956f2", "score": "0.52479583", "text": "func (o CustomDomainManagementOutput) HostName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CustomDomainManagement) string { return v.HostName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b4d3fe7ba635f9b7fab992fa04ffacd3", "score": "0.52473223", "text": "func GetApiHostname(ctx *pulumi.Context) string {\n\treturn config.Get(ctx, \"cloudflare:apiHostname\")\n}", "title": "" }, { "docid": "045f61843ca4746a5c9f9b51914e2a79", "score": "0.5226534", "text": "func (o ServiceHostnameConfigurationManagementOutput) HostName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ServiceHostnameConfigurationManagement) string { return v.HostName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "cd2a072af116db1a39a0d9a3c3b17d08", "score": "0.5226378", "text": "func (mr *MockAgentClientMockRecorder) GetHostname(ctx, in interface{}, opts ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{ctx, in}, opts...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"GetHostname\", reflect.TypeOf((*MockAgentClient)(nil).GetHostname), varargs...)\n}", "title": "" }, { "docid": "183659c1f92105f1ef660e3eadb21f9d", "score": "0.52249306", "text": "func HostnameProvider() (string, error) {\n\tlog.Debug(\"GetHostname trying EC2 metadata...\")\n\treturn GetInstanceID()\n}", "title": "" }, { "docid": "90ea7b3778caefb8e88307ae7b585902", "score": "0.5221034", "text": "func hostnameHandler(w http.ResponseWriter, r *http.Request) {\n\th, err := os.Hostname()\n\tif err != nil {\n\t\tfmt.Fprintf(w, \"unable to get hostname: %s\", err)\n\t}\n\tfmt.Fprintf(w, \"You are querying host %s\\n\", h)\n}", "title": "" }, { "docid": "84c802bb00c9182d2c7639ec1e6cc818", "score": "0.521847", "text": "func GetLocalEc2Hostname() (string, error) {\n\treturn getEc2Metadata(ec2HostnameURL)\n}", "title": "" } ]
4da7868b9910e2d0d3ccb533b0f2cee3
MarshalJSON marshals this object to a JSON structure
[ { "docid": "e5e78805d8347adeef4270793f4a45d2", "score": "0.0", "text": "func (o CreatePriceListConflictBody) MarshalJSON() ([]byte, error) {\n\t_parts := make([][]byte, 0, 2)\n\n\tvar dataCreatePriceListConflictBodyAO0 struct {\n\t\tInstance string `json:\"instance,omitempty\"`\n\n\t\tStatus int64 `json:\"status,omitempty\"`\n\n\t\tTitle string `json:\"title,omitempty\"`\n\n\t\tType string `json:\"type,omitempty\"`\n\t}\n\n\tdataCreatePriceListConflictBodyAO0.Instance = o.Instance\n\n\tdataCreatePriceListConflictBodyAO0.Status = o.Status\n\n\tdataCreatePriceListConflictBodyAO0.Title = o.Title\n\n\tdataCreatePriceListConflictBodyAO0.Type = o.Type\n\n\tjsonDataCreatePriceListConflictBodyAO0, errCreatePriceListConflictBodyAO0 := swag.WriteJSON(dataCreatePriceListConflictBodyAO0)\n\tif errCreatePriceListConflictBodyAO0 != nil {\n\t\treturn nil, errCreatePriceListConflictBodyAO0\n\t}\n\t_parts = append(_parts, jsonDataCreatePriceListConflictBodyAO0)\n\tvar dataCreatePriceListConflictBodyAO1 struct {\n\t\tErrors map[string]string `json:\"errors,omitempty\"`\n\t}\n\n\tdataCreatePriceListConflictBodyAO1.Errors = o.Errors\n\n\tjsonDataCreatePriceListConflictBodyAO1, errCreatePriceListConflictBodyAO1 := swag.WriteJSON(dataCreatePriceListConflictBodyAO1)\n\tif errCreatePriceListConflictBodyAO1 != nil {\n\t\treturn nil, errCreatePriceListConflictBodyAO1\n\t}\n\t_parts = append(_parts, jsonDataCreatePriceListConflictBodyAO1)\n\treturn swag.ConcatJSON(_parts...), nil\n}", "title": "" } ]
[ { "docid": "fe871e83b873a11479d8dc6581576604", "score": "0.6945284", "text": "func (p Paved) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(p.object)\n}", "title": "" }, { "docid": "0a2be6f68937edb10acfcbee26dd98d4", "score": "0.679275", "text": "func (v Like) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjson794297d0EncodeDsmnkoOrgHlc183(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "4b192dbd87026730cc24354dc736e368", "score": "0.6777225", "text": "func (r *Root) MarshalJSON() ([]byte, error) { return protojson.Marshal(r) }", "title": "" }, { "docid": "18477b0e0e539c1da2ec66d9e2709577", "score": "0.6733709", "text": "func (p P2SVPNGateway) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"etag\", p.Etag)\n\tpopulate(objectMap, \"id\", p.ID)\n\tpopulate(objectMap, \"location\", p.Location)\n\tpopulate(objectMap, \"name\", p.Name)\n\tpopulate(objectMap, \"properties\", p.Properties)\n\tpopulate(objectMap, \"tags\", p.Tags)\n\tpopulate(objectMap, \"type\", p.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "747b980d8da793d43e65aef61ce3ee41", "score": "0.66825366", "text": "func (v ObjectMeta) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjson16721522EncodeGitBetfavoritCfVadimTsurkovKuberwebKubDomainDeployments2(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "1ef2e201ab038240db8f553b321b9695", "score": "0.66742533", "text": "func (p Pool) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", p.ID)\n\tpopulate(objectMap, \"location\", p.Location)\n\tpopulate(objectMap, \"name\", p.Name)\n\tpopulate(objectMap, \"properties\", p.Properties)\n\tpopulate(objectMap, \"systemData\", p.SystemData)\n\tpopulate(objectMap, \"tags\", p.Tags)\n\tpopulate(objectMap, \"type\", p.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "8eb493b5786ef43a269770d47c6f2a37", "score": "0.6668472", "text": "func (p PremierAddOn) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", p.ID)\n\tpopulate(objectMap, \"kind\", p.Kind)\n\tpopulate(objectMap, \"location\", p.Location)\n\tpopulate(objectMap, \"name\", p.Name)\n\tpopulate(objectMap, \"properties\", p.Properties)\n\tpopulate(objectMap, \"tags\", p.Tags)\n\tpopulate(objectMap, \"type\", p.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "ab6e178bc1ebdf4a6f2ea1caed89321a", "score": "0.6659374", "text": "func (p PoolUpdate) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"location\", p.Location)\n\tpopulate(objectMap, \"properties\", p.Properties)\n\tpopulate(objectMap, \"tags\", p.Tags)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "2ce00bf7c8d677446630182aacb42df4", "score": "0.6625463", "text": "func (a ApplicationInsights) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", a.ID)\n\tpopulate(objectMap, \"key\", a.Key)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "fac73813e19177178e7cb98720599eb1", "score": "0.6623432", "text": "func (in Anything) MarshalJSON() ([]byte, error) {\n\tif in.Value == nil {\n\t\treturn []byte(\"null\"), nil\n\t}\n\treturn json.Marshal(in.Value)\n}", "title": "" }, { "docid": "d9215e0d5a74cd68a08e8dfadc307a3a", "score": "0.6620358", "text": "func (c CatAPTrue) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"friendly\", c.Friendly)\n\tpopulate(objectMap, \"id\", c.ID)\n\tpopulate(objectMap, \"name\", c.Name)\n\tpopulate(objectMap, \"status\", c.Status)\n\tif c.AdditionalProperties != nil {\n\t\tfor key, val := range c.AdditionalProperties {\n\t\t\tobjectMap[key] = val\n\t\t}\n\t}\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "bc06c4e1f74a12767ea13b905dc217b8", "score": "0.66178375", "text": "func (v VPNGateway) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"etag\", v.Etag)\n\tpopulate(objectMap, \"id\", v.ID)\n\tpopulate(objectMap, \"location\", v.Location)\n\tpopulate(objectMap, \"name\", v.Name)\n\tpopulate(objectMap, \"properties\", v.Properties)\n\tpopulate(objectMap, \"tags\", v.Tags)\n\tpopulate(objectMap, \"type\", v.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "619474adc7860a90b096ae80e79b5e70", "score": "0.6610169", "text": "func (self *secretAgent) MarshalJSON() ([]byte, error) {\n\tpublicInfo := struct {\n\t\tName string\n\t\tFakeName string\n\t\tNationality string\n\t}{self.FakeName, self.Name, randomPick()}\n\treturn json.Marshal(&publicInfo)\n}", "title": "" }, { "docid": "1d380ae26988cf59b7a1e4fe5dbeb01e", "score": "0.6597401", "text": "func (js JSONSerialization) MarshalJSON() ([]byte, error) {\n\tjs.Type = TypeJSON\n\tobjectMap := make(map[string]interface{})\n\tif js.JSONSerializationProperties != nil {\n\t\tobjectMap[\"properties\"] = js.JSONSerializationProperties\n\t}\n\tif js.Type != \"\" {\n\t\tobjectMap[\"type\"] = js.Type\n\t}\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "69fada5abd69e70279cb081bc86c965a", "score": "0.6581396", "text": "func (s SQLServer) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", s.ID)\n\tpopulate(objectMap, \"name\", s.Name)\n\tpopulate(objectMap, \"properties\", s.Properties)\n\tpopulate(objectMap, \"type\", s.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "34fb5f5e54ec794b1b1b23f443e0d13b", "score": "0.6575636", "text": "func (p PetAPObject) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", p.ID)\n\tpopulate(objectMap, \"name\", p.Name)\n\tpopulate(objectMap, \"status\", p.Status)\n\tif p.AdditionalProperties != nil {\n\t\tfor key, val := range p.AdditionalProperties {\n\t\t\tobjectMap[key] = val\n\t\t}\n\t}\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "710f47a2f4c0047127f8b6a1e6bbdac2", "score": "0.6549622", "text": "func (ssspa SQLServerStoredProcedureActivity) MarshalJSON() ([]byte, error) {\n\tssspa.Type = TypeSQLServerStoredProcedure\n\ttype Alias SQLServerStoredProcedureActivity\n\treturn json.Marshal(&struct {\n\t\tAlias\n\t}{\n\t\tAlias: (Alias)(ssspa),\n\t})\n}", "title": "" }, { "docid": "f8c8d7a2902951ea512bf4c3cbbc75f6", "score": "0.6542997", "text": "func (p JSON) MarshalJSON() ([]byte, error) {\n\tif p.IsUndefined() {\n\t\treturn nil, ErrMarshalUndefined\n\t}\n\n\tif p.IsNull() {\n\t\treturn json.Marshal(nil)\n\t}\n\n\treturn json.Marshal(p.v)\n}", "title": "" }, { "docid": "27e11b9e2f6ae066e58f012babc82ac4", "score": "0.6540909", "text": "func (s SecretCreateOrUpdateParameters) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"properties\", s.Properties)\n\tpopulate(objectMap, \"tags\", s.Tags)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "f8721a50ebec3936ed34b71621225c38", "score": "0.65392005", "text": "func (v DispatchSyncEventParams) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonC5a4559bEncodeGithubComKnqChromedpCdpServiceworker14(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "cfdfe86d086d640577f705aa3adda6f2", "score": "0.653789", "text": "func (v Post) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonD2b7633eEncodeTechParkDbHwInternalPkgModels8(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "ec47ab658f563fb0cf1d4e0936420bfc", "score": "0.65350753", "text": "func (v PostFull) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonD2b7633eEncodeTechParkDbHwInternalPkgModels7(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "8a1648e2161d4cdf55fb94ad947be502", "score": "0.6529192", "text": "func (v EzPost) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjson9d3a6ce9EncodeMainAppMod(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "291526a4877024764dc4793a96ddc7a5", "score": "0.65238124", "text": "func (p ProcessInfoCollection) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"nextLink\", p.NextLink)\n\tpopulate(objectMap, \"value\", p.Value)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "ac0fbbcf1ce4433287bd0e74213a9640", "score": "0.65236115", "text": "func jsonMarshal(ctx *fasthttp.RequestCtx, v interface{}) {\n\tctx.SetContentType(\"application/json; charset=utf-8\")\n\n\terr := json.NewEncoder(ctx).Encode(v)\n\tif err != nil {\n\t\t//Log Error\n\t}\n}", "title": "" }, { "docid": "48c01db1b04bdcf1175109cc12b3d4fd", "score": "0.65167445", "text": "func (j JSON) Marshal(value interface{}) ([]byte, error) {\n\treturn json.Marshal(value)\n}", "title": "" }, { "docid": "3f8a61350944199e83635729fd1eb2db", "score": "0.65167356", "text": "func (p PetAPTrue) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", p.ID)\n\tpopulate(objectMap, \"name\", p.Name)\n\tpopulate(objectMap, \"status\", p.Status)\n\tif p.AdditionalProperties != nil {\n\t\tfor key, val := range p.AdditionalProperties {\n\t\t\tobjectMap[key] = val\n\t\t}\n\t}\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "0768a310a65a3eda21e6ab161d5b2956", "score": "0.65162706", "text": "func (maku MultipleActivationKeyUpdate) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tif maku.Tags != nil {\n\t\tobjectMap[\"tags\"] = maku.Tags\n\t}\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "6845919cd79831047d85683a845ec740", "score": "0.65102255", "text": "func (o *SecretLockVersion) MarshalJSON() (buffer []byte, err error) {\n\tm := make(map[string]interface{})\n\tif len(o.additionalProperties) > 0 {\n\t\tfor k, v := range o.additionalProperties {\n\t\t\tm[k] = v\n\t\t}\n\t}\n\tif o.ID != nil {\n\t\tm[\"id\"] = o.ID\n\t}\n\tif o.Alias != nil {\n\t\tm[\"alias\"] = o.Alias\n\t}\n\tif o.Locks != nil {\n\t\tm[\"locks\"] = o.Locks\n\t}\n\tif o.PayloadAvailable != nil {\n\t\tm[\"payload_available\"] = o.PayloadAvailable\n\t}\n\tbuffer, err = json.Marshal(m)\n\treturn\n}", "title": "" }, { "docid": "d055e18d3bf2edfc53a9d50bf170b816", "score": "0.6496145", "text": "func (this *Properties) MarshalJSON() ([]byte, error) {\n\tstr, err := IstiomeshgatewayMarshaler.MarshalToString(this)\n\treturn []byte(str), err\n}", "title": "" }, { "docid": "a017fe1bd6ab17b8bd4712a50d1011ac", "score": "0.64918417", "text": "func (s SQLServerRegistrationUpdate) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"tags\", s.Tags)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "c1a5db39f1692dd1709e95ea7ac585d6", "score": "0.6477685", "text": "func (r AWSApiGatewayModel) MarshalJSON() ([]byte, error) {\n\ttype Properties AWSApiGatewayModel\n\treturn json.Marshal(&struct {\n\t\tType string\n\t\tProperties Properties\n\t\tDependsOn []string `json:\"DependsOn,omitempty\"`\n\t\tMetadata map[string]interface{} `json:\"Metadata,omitempty\"`\n\t\tDeletionPolicy DeletionPolicy `json:\"DeletionPolicy,omitempty\"`\n\t}{\n\t\tType: r.AWSCloudFormationType(),\n\t\tProperties: (Properties)(r),\n\t\tDependsOn: r._dependsOn,\n\t\tMetadata: r._metadata,\n\t\tDeletionPolicy: r._deletionPolicy,\n\t})\n}", "title": "" }, { "docid": "b9d8e1b76b336e9365eddbc30db72c9c", "score": "0.64690053", "text": "func (p ProcessThreadInfoCollection) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"nextLink\", p.NextLink)\n\tpopulate(objectMap, \"value\", p.Value)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "d08ea24b94def6a684d55db38ade0235", "score": "0.64675635", "text": "func (s SQLServerRegistration) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", s.ID)\n\tpopulate(objectMap, \"location\", s.Location)\n\tpopulate(objectMap, \"name\", s.Name)\n\tpopulate(objectMap, \"properties\", s.Properties)\n\tpopulate(objectMap, \"systemData\", s.SystemData)\n\tpopulate(objectMap, \"tags\", s.Tags)\n\tpopulate(objectMap, \"type\", s.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "97d32671455b7c0e60e803a634a9de1a", "score": "0.6466808", "text": "func (s ServerForCreate) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"identity\", s.Identity)\n\tpopulate(objectMap, \"location\", s.Location)\n\tpopulate(objectMap, \"properties\", s.Properties)\n\tpopulate(objectMap, \"sku\", s.SKU)\n\tpopulate(objectMap, \"tags\", s.Tags)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "885c4a568301a036c90a5b3d317bb4c3", "score": "0.6465789", "text": "func (r AWSKinesisAnalyticsApplicationOutput) MarshalJSON() ([]byte, error) {\n\ttype Properties AWSKinesisAnalyticsApplicationOutput\n\treturn json.Marshal(&struct {\n\t\tType string\n\t\tProperties Properties\n\t\tDependsOn []string `json:\"DependsOn,omitempty\"`\n\t\tMetadata map[string]interface{} `json:\"Metadata,omitempty\"`\n\t\tDeletionPolicy DeletionPolicy `json:\"DeletionPolicy,omitempty\"`\n\t}{\n\t\tType: r.AWSCloudFormationType(),\n\t\tProperties: (Properties)(r),\n\t\tDependsOn: r._dependsOn,\n\t\tMetadata: r._metadata,\n\t\tDeletionPolicy: r._deletionPolicy,\n\t})\n}", "title": "" }, { "docid": "00c80f61ecd69c7ba7008b8b874bc895", "score": "0.6464329", "text": "func (v PostFull) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonD2b7633eEncodeGithubComLisaBella97TechDbForumAppModels10(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "aca7293946d9518c161080e3005da304", "score": "0.64498895", "text": "func (a AdvSecurityObjectModel) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"entry\", a.Entry)\n\tpopulate(objectMap, \"type\", a.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "7d21aaf26b19335b492091218636e6f1", "score": "0.6449515", "text": "func (r AWSSSMAssociation) MarshalJSON() ([]byte, error) {\n\ttype Properties AWSSSMAssociation\n\treturn json.Marshal(&struct {\n\t\tType string\n\t\tProperties Properties\n\t\tDependsOn []string `json:\"DependsOn,omitempty\"`\n\t\tMetadata map[string]interface{} `json:\"Metadata,omitempty\"`\n\t\tDeletionPolicy DeletionPolicy `json:\"DeletionPolicy,omitempty\"`\n\t}{\n\t\tType: r.AWSCloudFormationType(),\n\t\tProperties: (Properties)(r),\n\t\tDependsOn: r._dependsOn,\n\t\tMetadata: r._metadata,\n\t\tDeletionPolicy: r._deletionPolicy,\n\t})\n}", "title": "" }, { "docid": "c51381e67a4014219a84e6f26f2c87f8", "score": "0.6432525", "text": "func (h HandlerMapping) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"arguments\", h.Arguments)\n\tpopulate(objectMap, \"extension\", h.Extension)\n\tpopulate(objectMap, \"scriptProcessor\", h.ScriptProcessor)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "4a5192de20925df3ba422c4afdc2e7ec", "score": "0.6431886", "text": "func (c ContainerGroupPropertiesInstanceView) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"events\", c.Events)\n\tpopulate(objectMap, \"state\", c.State)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "39b592d31512e70603af4c11a242fa7d", "score": "0.64288276", "text": "func (p ProcessInfo) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", p.ID)\n\tpopulate(objectMap, \"kind\", p.Kind)\n\tpopulate(objectMap, \"name\", p.Name)\n\tpopulate(objectMap, \"properties\", p.Properties)\n\tpopulate(objectMap, \"type\", p.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "d0ad273ba7ccc2e4bf4dc8e4cf75fd57", "score": "0.64276683", "text": "func (u UpdateTrustedIDProviderParameters) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"properties\", u.Properties)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "f317a767b1512dcb94ff8636a872a971", "score": "0.64244837", "text": "func (p PatchObject) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"properties\", p.Properties)\n\tpopulate(objectMap, \"tags\", p.Tags)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "ba72d333200edafb25149f59540c91e3", "score": "0.64223677", "text": "func MarshalJson(in interface{}) ([]byte, error) {\n\treturn Marshal(Json, in)\n}", "title": "" }, { "docid": "2f00dfb389f8c032b10a07401295dc37", "score": "0.64206076", "text": "func (w WebAppInstanceCollection) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"nextLink\", w.NextLink)\n\tpopulate(objectMap, \"value\", w.Value)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "cefd0cff694e00951d9be03244743b61", "score": "0.64194465", "text": "func (b BackendContract) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tb.Resource.marshalInternal(objectMap)\n\tpopulate(objectMap, \"properties\", b.Properties)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "1b97d7477de833eac53c3fe0804ddfb2", "score": "0.6415159", "text": "func (c *ConnectionJSON) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(c.Connection)\n}", "title": "" }, { "docid": "3baec7d189427a629b52204ef5d95f29", "score": "0.64149016", "text": "func (r AWSIoTThing) MarshalJSON() ([]byte, error) {\n\ttype Properties AWSIoTThing\n\treturn json.Marshal(&struct {\n\t\tType string\n\t\tProperties Properties\n\t\tDependsOn []string `json:\"DependsOn,omitempty\"`\n\t\tMetadata map[string]interface{} `json:\"Metadata,omitempty\"`\n\t\tDeletionPolicy DeletionPolicy `json:\"DeletionPolicy,omitempty\"`\n\t}{\n\t\tType: r.AWSCloudFormationType(),\n\t\tProperties: (Properties)(r),\n\t\tDependsOn: r._dependsOn,\n\t\tMetadata: r._metadata,\n\t\tDeletionPolicy: r._deletionPolicy,\n\t})\n}", "title": "" }, { "docid": "d354a160bfdc5d7548678f946c72bde4", "score": "0.6414014", "text": "func (s SavedSearch) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\ts.ProxyResource.marshalInternal(objectMap)\n\tpopulate(objectMap, \"etag\", s.Etag)\n\tpopulate(objectMap, \"properties\", s.Properties)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "3e1743dc377e3d62a823506be96c9f52", "score": "0.6410043", "text": "func (s SiteConfigurationSnapshotInfoCollection) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"nextLink\", s.NextLink)\n\tpopulate(objectMap, \"value\", s.Value)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "f0a59cb40058f7c4aac1394dabbc03aa", "score": "0.6409996", "text": "func (v TransStruct) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjson1bcb5839EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsIdlEndpointsBazBaz(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "a51de5d5614d0fa9124a283c78c54ee3", "score": "0.6408668", "text": "func (spu SQLPoolUsage) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "4d79fa72b7ce444c94c3caca5f2d82bc", "score": "0.6397866", "text": "func (sp SolutionPatch) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tif sp.Tags != nil {\n\t\tobjectMap[\"tags\"] = sp.Tags\n\t}\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "d76ef92ffdc0f01df3c963a912de5a59", "score": "0.6396617", "text": "func (c ContainerPropertiesInstanceView) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"currentState\", c.CurrentState)\n\tpopulate(objectMap, \"events\", c.Events)\n\tpopulate(objectMap, \"previousState\", c.PreviousState)\n\tpopulate(objectMap, \"restartCount\", c.RestartCount)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "3c8d6827448b33c9dcb532d7ab4dd222", "score": "0.6393661", "text": "func (s SQLServerProperties) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"cores\", s.Cores)\n\tpopulate(objectMap, \"edition\", s.Edition)\n\tpopulate(objectMap, \"propertyBag\", s.PropertyBag)\n\tpopulate(objectMap, \"registrationID\", s.RegistrationID)\n\tpopulate(objectMap, \"version\", s.Version)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "a54626d622e974e686e424bf91a571c3", "score": "0.639342", "text": "func (sps SQLPoolSchema) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "e6e495d20701fed5cdf0103710111fdf", "score": "0.63929886", "text": "func (b BackendReconnectContract) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tb.Resource.marshalInternal(objectMap)\n\tpopulate(objectMap, \"properties\", b.Properties)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "bb99464920ce551bffe1e4349b9af93a", "score": "0.63915443", "text": "func (rspp RecoverableSQLPoolProperties) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "37be3fa611233236f9047cbef8a2d99d", "score": "0.6386927", "text": "func (v Post) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonD2b7633eEncodeGithubComLisaBella97TechDbForumAppModels11(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "28c9d1ea84291d8e29152217b84b09c8", "score": "0.63850063", "text": "func (t Transform) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"id\", t.ID)\n\tpopulate(objectMap, \"name\", t.Name)\n\tpopulate(objectMap, \"properties\", t.Properties)\n\tpopulate(objectMap, \"systemData\", t.SystemData)\n\tpopulate(objectMap, \"type\", t.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "7c111c228bc819128322228096549653", "score": "0.6384528", "text": "func (f fabricObject) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(map[string]interface{}{\n\t\t\"faults\": f.faults,\n\t\t\"devices\": f.devices,\n\t\t\"pods\": f.pods,\n\t\t\"isisRoutes\": f.isisRoutes,\n\t\t\"timestamp\": f.timestamp,\n\t})\n}", "title": "" }, { "docid": "c6d73d8ed772be7575b2dcfc72b95cca", "score": "0.63845176", "text": "func (p PushSettings) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", p.ID)\n\tpopulate(objectMap, \"kind\", p.Kind)\n\tpopulate(objectMap, \"name\", p.Name)\n\tpopulate(objectMap, \"properties\", p.Properties)\n\tpopulate(objectMap, \"type\", p.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "11d8251065ebdf6b5ea343bb33c683a3", "score": "0.63832283", "text": "func (s Share) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tif s.ShareProperties != nil {\n\t\tobjectMap[\"properties\"] = s.ShareProperties\n\t}\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "e16b0e3e8fc6feafc00c8659695d0408", "score": "0.63805443", "text": "func (v stakes_info) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjson9e98f589EncodeGithubComValidatorCenterMinterGoSdkStakes(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "0d2b89b3231537e0886d69fd4062df19", "score": "0.637921", "text": "func (t Tags) Marshal() (ret []byte, err error) {\n\tret, err = json.Marshal(t)\n\treturn\n}", "title": "" }, { "docid": "1ce78a57904ff6b1f8ba881ad902a05f", "score": "0.63790035", "text": "func (a ApplicationStack) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"dependency\", a.Dependency)\n\tpopulate(objectMap, \"display\", a.Display)\n\tpopulate(objectMap, \"frameworks\", a.Frameworks)\n\tpopulate(objectMap, \"majorVersions\", a.MajorVersions)\n\tpopulate(objectMap, \"name\", a.Name)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "4d24ae33d242cc9e01b8e91d2d54ffda", "score": "0.6378863", "text": "func (v S) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjson89aae3efEncodeJson(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "5b81ae2c273f5a233404a336f45df674", "score": "0.63780004", "text": "func MarshalJSON(v interface{}) (out []byte, err error) {\n\treturn json.Marshal(v)\n}", "title": "" }, { "docid": "09cb85511ab3bc557df407a444f42fb6", "score": "0.6375285", "text": "func (s StorageInsight) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\ts.ProxyResource.marshalInternal(objectMap)\n\tpopulate(objectMap, \"eTag\", s.ETag)\n\tpopulate(objectMap, \"properties\", s.Properties)\n\tpopulate(objectMap, \"tags\", s.Tags)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "4f269265e78a23b33b594df3dd001741", "score": "0.63730574", "text": "func (s SQLServerRegistrationProperties) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"propertyBag\", s.PropertyBag)\n\tpopulate(objectMap, \"resourceGroup\", s.ResourceGroup)\n\tpopulate(objectMap, \"subscriptionId\", s.SubscriptionID)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "0b4ff0e8225dcedd9cf2f983e11a4246", "score": "0.63695145", "text": "func (o myOutput) MarshalJSON() ([]byte, error) {\n\n\ttype myOutput_ myOutput\n\tb, _ := json.Marshal(myOutput_(o))\n\n\tvar m map[string]json.RawMessage\n\tjson.Unmarshal(b, &m)\n\n\tfor k, v := range o.Tags {\n\t\tb, _ = json.Marshal(v)\n\t\tm[k] = json.RawMessage(b)\n\t}\n\n\treturn json.Marshal(m)\n}", "title": "" }, { "docid": "f49bfd9d98b4cb04a365c1b82fe36243", "score": "0.63667816", "text": "func (mp MultiPoint) MarshalJSON() ([]byte, error) {\n\treturn pointsMarshalJSON(mp, mpJSONPrefix, mpJSONSuffix), nil\n}", "title": "" }, { "docid": "ac8310da320ab9dcc66a312863e9ae07", "score": "0.6365161", "text": "func (p PremierAddOnProperties) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"marketplaceOffer\", p.MarketplaceOffer)\n\tpopulate(objectMap, \"marketplacePublisher\", p.MarketplacePublisher)\n\tpopulate(objectMap, \"product\", p.Product)\n\tpopulate(objectMap, \"sku\", p.SKU)\n\tpopulate(objectMap, \"vendor\", p.Vendor)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "9e8e5235ea84918e18f5ee6d85166b55", "score": "0.63621277", "text": "func (jf JSONFormat) MarshalJSON() ([]byte, error) {\n\tjf.Type = TypeJSONFormat\n\ttype Alias JSONFormat\n\treturn json.Marshal(&struct {\n\t\tAlias\n\t}{\n\t\tAlias: (Alias)(jf),\n\t})\n}", "title": "" }, { "docid": "eb8252289c0a9e5273c57f7575958779", "score": "0.6360431", "text": "func (r isisRouteObject) MarshalJSON() ([]byte, error) {\n\treturn []byte(r.json.Raw), nil\n}", "title": "" }, { "docid": "ec1b1ed70df7cc060e8003db2a438ae1", "score": "0.63566107", "text": "func (p ProviderRegistration) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", p.ID)\n\tpopulate(objectMap, \"name\", p.Name)\n\tpopulate(objectMap, \"properties\", p.Properties)\n\tpopulate(objectMap, \"type\", p.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "bd41e1b6ba93862fdf776b6b34c90a31", "score": "0.635527", "text": "func (o ListStreamComputeItems) MarshalJSON() ([]byte, error) {\n\ttoSerialize := map[string]interface{}{}\n\tif o.UnparsedObject != nil {\n\t\treturn json.Marshal(o.UnparsedObject)\n\t}\n\ttoSerialize[\"aggregation\"] = o.Aggregation\n\tif o.Facet != nil {\n\t\ttoSerialize[\"facet\"] = o.Facet\n\t}\n\n\tfor key, value := range o.AdditionalProperties {\n\t\ttoSerialize[key] = value\n\t}\n\treturn json.Marshal(toSerialize)\n}", "title": "" }, { "docid": "f54adaef3c81524b35ad8222b7006919", "score": "0.63550895", "text": "func Marshal(v interface{}) ([]byte, error) {\n\treturn JSON.Marshal(v)\n}", "title": "" }, { "docid": "45cfa5816311f92310bb6dab79f13322", "score": "0.63550603", "text": "func (pb PublishInfo) MarshalJSON() (b []byte, err error) {\n\treturn json.Marshal(pb.Pub)\n}", "title": "" }, { "docid": "9ff9df36da997ba5cb83d3273bdfbf1b", "score": "0.63511735", "text": "func (osVar OdbcSink) MarshalJSON() ([]byte, error) {\n\tosVar.Type = TypeOdbcSink\n\ttype Alias OdbcSink\n\treturn json.Marshal(&struct {\n\t\tAlias\n\t}{\n\t\tAlias: (Alias)(osVar),\n\t})\n}", "title": "" }, { "docid": "b1cfc709f57ba6ef28f3ad6559ee47ad", "score": "0.63506395", "text": "func (s SecretPatchParameters) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"properties\", s.Properties)\n\tpopulate(objectMap, \"tags\", s.Tags)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "8d611924691c5a065f27f913b9589341", "score": "0.63500106", "text": "func (r AWSAppSyncGraphQLApi) MarshalJSON() ([]byte, error) {\n\ttype Properties AWSAppSyncGraphQLApi\n\treturn json.Marshal(&struct {\n\t\tType string\n\t\tProperties Properties\n\t\tDependsOn []string `json:\"DependsOn,omitempty\"`\n\t\tMetadata map[string]interface{} `json:\"Metadata,omitempty\"`\n\t\tDeletionPolicy DeletionPolicy `json:\"DeletionPolicy,omitempty\"`\n\t}{\n\t\tType: r.AWSCloudFormationType(),\n\t\tProperties: (Properties)(r),\n\t\tDependsOn: r._dependsOn,\n\t\tMetadata: r._metadata,\n\t\tDeletionPolicy: r._deletionPolicy,\n\t})\n}", "title": "" }, { "docid": "17308e31197a9092ede1f712be0d6bc8", "score": "0.6349919", "text": "func (mak MultipleActivationKey) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tif mak.MultipleActivationKeyProperties != nil {\n\t\tobjectMap[\"properties\"] = mak.MultipleActivationKeyProperties\n\t}\n\tif mak.Tags != nil {\n\t\tobjectMap[\"tags\"] = mak.Tags\n\t}\n\tif mak.Location != nil {\n\t\tobjectMap[\"location\"] = mak.Location\n\t}\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "b3f1302093ddd9e443ef1e69463313b7", "score": "0.6348208", "text": "func (h HybridConnectionCollection) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"nextLink\", h.NextLink)\n\tpopulate(objectMap, \"value\", h.Value)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "964a251e7dce2f185e207ea8b5a65f36", "score": "0.6347419", "text": "func (r AWSApiGatewayStage) MarshalJSON() ([]byte, error) {\n\ttype Properties AWSApiGatewayStage\n\treturn json.Marshal(&struct {\n\t\tType string\n\t\tProperties Properties\n\t\tDependsOn []string `json:\"DependsOn,omitempty\"`\n\t\tMetadata map[string]interface{} `json:\"Metadata,omitempty\"`\n\t\tDeletionPolicy DeletionPolicy `json:\"DeletionPolicy,omitempty\"`\n\t}{\n\t\tType: r.AWSCloudFormationType(),\n\t\tProperties: (Properties)(r),\n\t\tDependsOn: r._dependsOn,\n\t\tMetadata: r._metadata,\n\t\tDeletionPolicy: r._deletionPolicy,\n\t})\n}", "title": "" }, { "docid": "f6750d5981948423ce78e3d5d06cdc6e", "score": "0.6345849", "text": "func (v Vote) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonD2b7633eEncodeTechParkDbHwInternalPkgModels(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "c572543d82b45c3445c1edfa86b826e8", "score": "0.6342555", "text": "func (r RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"properties\", r.Properties)\n\tpopulate(objectMap, \"tags\", r.Tags)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "b8b3bc14c5a4cedf12911b4bcc93ba5d", "score": "0.6342534", "text": "func (v EventScreenshotRequested) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonC5a4559bEncodeGithubComKnqChromedpCdpOverlay16(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "d9d930a44b28d4b04b0014281a895ea3", "score": "0.6340778", "text": "func (o CIAppPipelineEventPreviousPipeline) MarshalJSON() ([]byte, error) {\n\ttoSerialize := map[string]interface{}{}\n\tif o.UnparsedObject != nil {\n\t\treturn json.Marshal(o.UnparsedObject)\n\t}\n\ttoSerialize[\"id\"] = o.Id\n\tif o.Url != nil {\n\t\ttoSerialize[\"url\"] = o.Url\n\t}\n\n\tfor key, value := range o.AdditionalProperties {\n\t\ttoSerialize[key] = value\n\t}\n\treturn json.Marshal(toSerialize)\n}", "title": "" }, { "docid": "f8b0cb85867d22c7aaefbcbae83cee1b", "score": "0.63405746", "text": "func (spvasep SQLPoolVulnerabilityAssessmentScanExportProperties) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "e23d246c455e5efe92b6b2e4b1229650", "score": "0.63391364", "text": "func (v Intrinsic) MarshalJSON() ([]byte, error) { return json.Marshal(&v.Value) }", "title": "" }, { "docid": "aed0e172ab62c94c0d80b39be16da878", "score": "0.63368165", "text": "func (n NetworkConnectionUpdate) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"location\", n.Location)\n\tpopulate(objectMap, \"properties\", n.Properties)\n\tpopulate(objectMap, \"tags\", n.Tags)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "8437f0c180113bbcd59c9ab06a8d8640", "score": "0.6336577", "text": "func (m ManagedCCF) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", m.ID)\n\tpopulate(objectMap, \"location\", m.Location)\n\tpopulate(objectMap, \"name\", m.Name)\n\tpopulate(objectMap, \"properties\", m.Properties)\n\tpopulate(objectMap, \"systemData\", m.SystemData)\n\tpopulate(objectMap, \"tags\", m.Tags)\n\tpopulate(objectMap, \"type\", m.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "11e1b23564b8fc7e17d02f5ed303aa97", "score": "0.6336388", "text": "func (w WebAppCollection) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"nextLink\", w.NextLink)\n\tpopulate(objectMap, \"value\", w.Value)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "75809d74779b63f283f2cc8882f4eb74", "score": "0.63359046", "text": "func (p PoolListResult) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"nextLink\", p.NextLink)\n\tpopulate(objectMap, \"value\", p.Value)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "fc9354a012941437bb2ea07efc286f4d", "score": "0.6335596", "text": "func (g GatewayContract) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tg.Resource.marshalInternal(objectMap)\n\tpopulate(objectMap, \"properties\", g.Properties)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "fccd02d1072cb198f2e67e451c827e14", "score": "0.63336194", "text": "func (p Permissions) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\tpopulate(objectMap, \"certificates\", p.Certificates)\n\tpopulate(objectMap, \"keys\", p.Keys)\n\tpopulate(objectMap, \"secrets\", p.Secrets)\n\tpopulate(objectMap, \"storage\", p.Storage)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "0a542b9ddbea042ca8e3a77e6373e61e", "score": "0.63334286", "text": "func (p ProcessThreadInfo) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]any)\n\tpopulate(objectMap, \"id\", p.ID)\n\tpopulate(objectMap, \"kind\", p.Kind)\n\tpopulate(objectMap, \"name\", p.Name)\n\tpopulate(objectMap, \"properties\", p.Properties)\n\tpopulate(objectMap, \"type\", p.Type)\n\treturn json.Marshal(objectMap)\n}", "title": "" }, { "docid": "d2a66ac5a6b31917274bcf925cc3ba7f", "score": "0.6333161", "text": "func (v SearchInResponseBodyParams) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork22(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "410199a19856e65db6c3202900577915", "score": "0.6332875", "text": "func (i IdentityProviderCreateContract) MarshalJSON() ([]byte, error) {\n\tobjectMap := make(map[string]interface{})\n\ti.Resource.marshalInternal(objectMap)\n\tpopulate(objectMap, \"properties\", i.Properties)\n\treturn json.Marshal(objectMap)\n}", "title": "" } ]
d27a3d6ba9abffcb95009a6b1c942725
Checks whether this suits can be singed
[ { "docid": "b72143360fcbfcb7e8160214e931fd68", "score": "0.5716199", "text": "func (s *Sings) canSign(suits []string) (string, bool) {\n\tfor _, suit := range suits {\n\t\tcanSing, ok := s.sings[suit]\n\t\tif ok && !canSing {\n\t\t\treturn suit, true\n\t\t}\n\t}\n\treturn \"\", false\n}", "title": "" } ]
[ { "docid": "b77304c507bf4f4d539e1fc5339345e5", "score": "0.6189555", "text": "func (hand Hand) IsBusted() bool {\n\treturn hand.Sum() > BUST_LIMIT\n}", "title": "" }, { "docid": "6bd668488e12a7d41b2dbe16cda5b5c6", "score": "0.5778478", "text": "func (owner *Owner) CheckSuspension() {\n\tif owner.Eligible.LMActive == false {\n\t\tfor i := 0; i < len(owner.Eligible.Slips); i++ {\n\t\t\tif owner.Eligible.Slips[i].TimeLeft < 0.0 {\n\t\t\t\towner.ToggleElig()\n\t\t\t\towner.Eligible.Slips[i].SActive = false\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"Banned until \", owner.Eligible.Slips[i].End)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(\"Owner Active\")\n\t}\n}", "title": "" }, { "docid": "f3766a51c07bbf9fe36470ded82e184b", "score": "0.57771546", "text": "func allowSurge(ds *appsv1alpha1.DaemonSet) bool {\n\tmaxSurge, err := surgeCount(ds, 1)\n\treturn err == nil && maxSurge > 0\n}", "title": "" }, { "docid": "b06fb2b5d3f77bc82a911fa867ac68d3", "score": "0.56869745", "text": "func (g *Ghost) CanGhostsGoThrough() bool {\n\treturn true\n}", "title": "" }, { "docid": "e4b64f0d2ac6fc643a7c5f0bf178b0e8", "score": "0.5617745", "text": "func (srv *Server) hasOngoing() bool {\n\tfor i := range srv.ongoing {\n\t\tif srv.ongoing[i].cancel != nil {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "00695f92fcb142eb20869f2456b2fe4c", "score": "0.56152266", "text": "func (t *CPU) IsVulnerable() bool {\n\t_, ok := t.bugs[mds]\n\treturn ok\n}", "title": "" }, { "docid": "4972d027bb44de394769fcf2752f2b68", "score": "0.5587434", "text": "func (g *Client) CanAttest() bool {\n\treturn nil != g.keyring\n}", "title": "" }, { "docid": "992bcb5f323b22b3e8d0ea3c63164693", "score": "0.55469763", "text": "func IsAlive(k Killable) bool { return !IsDying(k) }", "title": "" }, { "docid": "f2294c5d2af0c527a0502d76b0b9479d", "score": "0.5545864", "text": "func (o *StorageHitachiHostAllOf) HasIsChapMutual() bool {\n\tif o != nil && o.IsChapMutual != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "442d0e110b21a5d611dd8957820fbb6e", "score": "0.55313677", "text": "func (g *Manager) IsHammer() <-chan struct{} {\n\treturn g.hammer\n}", "title": "" }, { "docid": "6d12083e63ce9710977b4daf349edc94", "score": "0.5507392", "text": "func (inv *Invasion)IsSimulationOver() bool {\n\t\t//check for whether all aliens finished\n\t\tif len(inv.aliens) == 0 {\n\t\t\tfmt.Println(\"All aliens are destroyed\")\n\t\t\tlogger.Println(\"All aliens are destroyed\")\n\t\t\treturn true;\n\t\t}\n\t\t//check whether aliens completed maximum allowed moves\n\t\tif inv.totalMoves > MaxMovesAllowed {\n\t\t\tfmt.Println(\"Aliens reached final state\");\n\t\t\tlogger.Println(\"Aliens reached final state\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n}", "title": "" }, { "docid": "1cb2c16df4d4df829a55c0a3449d3b21", "score": "0.5476631", "text": "func (c *constellation) canJoin(other *constellation) bool {\n\tfor otherPt := range other.points {\n\t\tif c.shouldContain(otherPt) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "067cc5e1c8bb0323d3688a636ff77340", "score": "0.54688853", "text": "func (h *DFPState) ShouldWash() bool {\n\tif h.IsWashed || !h.IsRunning || h.IsEmergencyStopped || (h.IsSecurity && !h.IsDisableSecurity) {\n\t\treturn false\n\t}\n\n\treturn true\n\n}", "title": "" }, { "docid": "1aca8e2e5a058a8b4061de9f67323e0d", "score": "0.5461614", "text": "func (round *base) CanProceed() bool {\n\tif !round.started {\n\t\treturn false\n\t}\n\tfor _, ok := range round.ok {\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "1aca8e2e5a058a8b4061de9f67323e0d", "score": "0.5461614", "text": "func (round *base) CanProceed() bool {\n\tif !round.started {\n\t\treturn false\n\t}\n\tfor _, ok := range round.ok {\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "36b4495af7c661ea06e62931710919e5", "score": "0.54574573", "text": "func CanPong(s *domain.Suit) bool {\n\treturn s.GetSuitType() == domain.SuitTypeSimple || s.GetSuitType() == domain.SuitTypeHonor\n}", "title": "" }, { "docid": "a29b3c830260b897e411bb020989b92f", "score": "0.5438633", "text": "func (w *worker) CanProceed(s Settings) error {\n\tif w.cluster != nil {\n\t\terr := w.validateContextForCluster()\n\t\tif err == nil && !s.SkipSizingRequirements {\n\t\t\terr = w.validateClusterSizing()\n\t\t}\n\t\treturn err\n\t}\n\treturn w.validateContextForHost()\n}", "title": "" }, { "docid": "e36972483aeee64a74f95d3daac4dbf4", "score": "0.54280007", "text": "func (s *MatchSession) canForfeit() error {\n\tif err := s.canCancel(); err == nil {\n\t\treturn util.ErrPublic(\"you can `!cancel` the current race wihout taking a loss!\")\n\t}\n\n\tif s.Status == MatchSessionStatusClosed {\n\t\treturn util.ErrPublic(\"you can't cancel a race that has already finished\")\n\t}\n\n\tif s.Status != MatchSessionStatusPreparing && s.Status != MatchSessionStatusInProgress {\n\t\treturn util.ErrPublic(\"you can't cancel a race that has not started or is not in its preparation phase\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bb178370a2e806892b0f9386cb2bead8", "score": "0.5427466", "text": "func (clk *clock) hasGlitchlessMux() bool {\n\treturn clk.cix == clkSys || clk.cix == clkRef\n}", "title": "" }, { "docid": "87ba703922c69646fbef1f9469602855", "score": "0.5413417", "text": "func CanChow(s *domain.Suit) bool {\n\treturn s.GetSuitType() == domain.SuitTypeSimple\n}", "title": "" }, { "docid": "532d35eadf0ce4bf179ac7d52fd1b7b4", "score": "0.53901845", "text": "func IsEligibleForHand(s *domain.Suit) bool {\n\treturn s.GetSuitType() != domain.SuitTypeBonus\n}", "title": "" }, { "docid": "d05a05e8322871f4daf3732139835dcc", "score": "0.5378572", "text": "func canAttendMeetings(intervals [][]int) bool {\n\t// 20200422\n\t// 执行耗时:16 ms,击败了31.37% 的Go用户\n\t// 内存消耗:6.2 MB,击败了100.00% 的Go用户\n\tsort.Slice(intervals, func(i, j int) bool {\n\t\tif intervals[i][0] < intervals[j][0] {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t})\n\tfmt.Printf(\"intervals=%v\\n\", intervals)\n\tfor i := 1; i < len(intervals); i++ {\n\t\tif intervals[i][0] < intervals[i-1][1] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n\n}", "title": "" }, { "docid": "a4bfb9c482c8039f28d53171dce6c7d5", "score": "0.5364862", "text": "func (m *Middle) isHealthy(c *Conn) bool {\n\tfor _, key := range c.Deps() {\n\t\tif !m.hasTarget(key) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "c3dabb9af85383679d6bf593440c8d22", "score": "0.53448915", "text": "func (o *Host) HasIsMuted() bool {\n\tif o != nil && o.IsMuted != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "d463f33b007d78eb43c201f5d73ba2ac", "score": "0.5336077", "text": "func (t *thread) isVulnerable() bool {\n\tfor _, bug := range vulnerabilities {\n\t\tif _, ok := t.bugs[bug]; ok {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "23b0a793df5ae2162479121ed9538340", "score": "0.53157586", "text": "func (ppo *PPO) Check () (bool) {\n\tif len (ppo.stash) == 0 && ppo.store == nil {\n\t\treturn false\n\t}\n\tfor _, stash := range ppo.stash {\n\t\tif stash.checkNewMssg () == true {\n\t\t\treturn true\n\t\t}\n\t\truntime.Gosched ()\n\t}\n\tif ppo.store != nil && ppo.store.checkNewMssg () == true {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d632be1c18f61f134bb8ac0066ce3fa2", "score": "0.5293567", "text": "func (c *cell) isBlocked() bool {\n\treturn c.distanceToShore == 0\n}", "title": "" }, { "docid": "d776e312e0ae60650160549d213da523", "score": "0.5288858", "text": "func IsUnderutilized(node *v1.Node, pods []*v1.Pod) bool {\n\tfor _, pod := range pods {\n\t\tif !scheduling.IsOwnedByDaemonSet(pod) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "fb7745f47d286f5344fcb70258d1630e", "score": "0.5287859", "text": "func (c CPUSet) IsVulnerable() bool {\n\tfor _, cpu := range c {\n\t\tif cpu.IsVulnerable() {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "665f9289cbf62afb3ef40ca6aefed77d", "score": "0.5275274", "text": "func (d *Philosophers) CheckAvailability(spoon int) bool {\n\t//fmt.Println(\"I am in checking\", spoon)\n\tmsg := <-d.SpoonChan[spoon] //msg: recieves whether it is free or not.\n\tif \"free\" == msg { //If spoon i free returns true otherwise false.\n\t\t//fmt.Println(\"free\")\n\t\treturn true\n\t} else {\n\t\t//fmt.Println(\"not free\")\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "ac095087b8a59ffe52d3c6c740d3967a", "score": "0.52733195", "text": "func (p Piece) ours() bool { return p.value() > 0 }", "title": "" }, { "docid": "3210059fa53afb4c868a65ba6e8abffe", "score": "0.5262204", "text": "func (sw *sessionWants) HasLiveWants() bool {\n\treturn len(sw.liveWants) > 0\n}", "title": "" }, { "docid": "5ad0354e7dc8548607bd4af407bae135", "score": "0.5252264", "text": "func (virtualMta *VirtualMta) IsInUsage() bool {\n\tvirtualMta.lock.Lock()\n\tdefer virtualMta.lock.Unlock()\n\treturn virtualMta.isInUsage\n}", "title": "" }, { "docid": "e71aca8b8c3d96f842ee4716a03f4bee", "score": "0.5252009", "text": "func (r RandomTpsLimitStrategy) IsAllowable() bool {\n\t// this is a simple demo.\n\tgxlog.CInfo(\"Random IsAllowable!\")\n\trandNum := rand.Int63n(2)\n\treturn randNum == 0\n}", "title": "" }, { "docid": "085be1b6d6d9423f56d564ac2a44c4c5", "score": "0.5250081", "text": "func (a *Animal) CanQuack() bool {\n\treturn false\n}", "title": "" }, { "docid": "f7c541f72f56c572442152fad6e3cd26", "score": "0.52483386", "text": "func (s *shard) hasHalted() bool {\n\tif s.master != nil {\n\t\tselect {\n\t\tcase <-s.master.servingCh:\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n\tif s.replica != nil {\n\t\tselect {\n\t\tcase <-s.replica.servingCh:\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "331481f350e2f5bb56d435e430e371b4", "score": "0.5237496", "text": "func IsDraining(ctx context.Context) bool {\n\tselect {\n\tcase <-C(ctx):\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "c0d4143d0d7779a9e592d324b837e2d5", "score": "0.5236772", "text": "func (board *Board) IsUnderAttack(precomputedData *PrecomputedData, turn Color, sq square) bool {\n\tvar enemyKnights Bitboard\n\tvar enemyBishopLikes Bitboard\n\tvar enemyRookLikes Bitboard\n\tvar enemyKing Bitboard\n\n\tif turn == WhiteColor {\n\t\tenemyKnights = board.bbBlackKnight\n\t\tenemyBishopLikes = board.bbBlackBishop | board.bbBlackQueen\n\t\tenemyRookLikes = board.bbBlackRook | board.bbBlackQueen\n\t\tenemyKing = board.bbBlackKing\n\t} else {\n\t\tenemyKnights = board.bbWhiteKnight\n\t\tenemyBishopLikes = board.bbWhiteBishop | board.bbWhiteQueen\n\t\tenemyRookLikes = board.bbWhiteRook | board.bbWhiteQueen\n\t\tenemyKing = board.bbWhiteKing\n\t}\n\n\tkingCollisions := precomputedData.KingMoves[sq] & enemyKing\n\tif kingCollisions != 0 {\n\t\treturn true\n\t}\n\n\t// Simulate putting a knight in the square where the allied king is, if the simulated\n\t// knight attacks an enemy knight then our king is in check by an enemy knight\n\tknightCollisions := precomputedData.KnightMoves[sq] & enemyKnights\n\tif knightCollisions != 0 {\n\t\treturn true\n\t}\n\n\t// Simulate rook and queens moving horizontally/vertically\n\tblockers := (^board.emptySquares) & precomputedData.RookMasks[sq]\n\tkey := (uint64(blockers) * precomputedData.RookMagics[sq]) >> (64 - precomputedData.RookIndexBits[sq])\n\trookCollisions := precomputedData.RookMoves[sq][key] & enemyRookLikes\n\tif rookCollisions != 0 {\n\t\treturn true\n\t}\n\n\t// Simulate bishop and queens moving diagonally\n\tblockers = (^board.emptySquares) & precomputedData.BishopMasks[sq]\n\tkey = (uint64(blockers) * precomputedData.BishopMagics[sq]) >> (64 - precomputedData.BishopIndexBits[sq])\n\tbishopCollisions := precomputedData.BishopMoves[sq][key] & enemyBishopLikes\n\tif bishopCollisions != 0 {\n\t\treturn true\n\t}\n\n\tif turn == WhiteColor {\n\t\tif sq < H7 && sq%8 != 0 {\n\t\t\tupLeftSquare := (sq + 7).Bitboard()\n\n\t\t\tif (board.bbBlackPawn & upLeftSquare) != 0 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\tif sq < H7 && sq%8 != 7 {\n\t\t\tupRightSquare := (sq + 9).Bitboard()\n\n\t\t\tif (board.bbBlackPawn & upRightSquare) != 0 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif sq > H2 && sq%8 != 0 {\n\t\t\tdownLeftSquare := (sq - 9).Bitboard()\n\n\t\t\tif (board.bbWhitePawn & downLeftSquare) != 0 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\tif sq > H2 && sq%8 != 7 {\n\t\t\tdownRightSquare := (sq - 7).Bitboard()\n\n\t\t\tif (board.bbWhitePawn & downRightSquare) != 0 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "29775362bd5d9ef667496170c8ff1bf8", "score": "0.52304536", "text": "func (u *SIMDUnit) CanAcceptWave() bool {\n\treturn u.toExec == nil\n}", "title": "" }, { "docid": "9e5c775897c0bde4c169046ad1ecaf19", "score": "0.52274257", "text": "func (t *PluginTarget) CanSend() bool {\n\treturn t.address.Account != \"\" && (t.address.Nick != \"\" || t.address.Channel != \"\")\n}", "title": "" }, { "docid": "9a623c2cd2b8122356fa449e72269e19", "score": "0.52176726", "text": "func (b BlockState) isWatery() bool {\r\n\twatery := water[b.Name]\r\n\tif !watery {\r\n\t\twaterlogged, exists := b.Properties[\"waterlogged\"]\r\n\t\tif !exists || waterlogged == \"false\" || b.isStairs() {\r\n\t\t\treturn false\r\n\t\t}\r\n\t}\r\n\treturn true\r\n}", "title": "" }, { "docid": "a28a83efc57c0a75f174dab23c449edf", "score": "0.5208831", "text": "func CheckShootIsTargeted(target TargetInterface) bool {\n\tif (len(target.Stack()) < 3) || (target.Stack()[len(target.Stack())-1].Kind == \"namespace\" && target.Stack()[len(target.Stack())-2].Kind != \"shoot\") {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "5347c49c1f78607f5224fa1a2426073f", "score": "0.5207383", "text": "func (self *Hand) IsWeakerThan(hand *Hand) bool {\n\t// ˅\n\treturn self.judgeGame(hand) == -1\n\t// ˄\n}", "title": "" }, { "docid": "6864910cd0cb7101d787025ccfff2d50", "score": "0.52072585", "text": "func (c *computer) outOfBounds() bool {\n\treturn c.addrOutOfBounds(c.insPtr)\n}", "title": "" }, { "docid": "7a4a9cd2c278a044067b114eb6796319", "score": "0.51930726", "text": "func (prod *ProducerBase) IsBlocked() bool {\n\treturn prod.GetState() == PluginStateWaiting\n}", "title": "" }, { "docid": "7de655e5f95ac6c2a6576631db5a0cd9", "score": "0.51883656", "text": "func (l *Latch) CanPause() bool {\n\treturn atomic.LoadInt32(&l.state) == LatchStarted\n}", "title": "" }, { "docid": "02ed65c163444fc3c40b41786cfa52a4", "score": "0.5188324", "text": "func (c *Consumer) IsHealthy() bool {\n\treturn true // check if channel stil alive?\n}", "title": "" }, { "docid": "a3de8cecad644e886b0a521531960515", "score": "0.5187802", "text": "func (h *FakeHealer) NeedsHeal() bool {\n\treturn true\n}", "title": "" }, { "docid": "199a5ce3df7af464f7c71dd9a9b5d8e6", "score": "0.5185428", "text": "func (o *IosCompliancePolicy) HasSecurityBlockJailbrokenDevices() bool {\n\tif o != nil && o.SecurityBlockJailbrokenDevices != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "e0ee3bb75c7a131b56a3231a2d70d6a5", "score": "0.51850885", "text": "func (pi *PInput) IsSane() bool {\n\n\tif pi.NonWitnessUtxo != nil && pi.WitnessUtxo != nil {\n\t\treturn false\n\t}\n\tif pi.WitnessUtxo == nil && pi.WitnessScript != nil {\n\t\treturn false\n\t}\n\tif pi.WitnessUtxo == nil && pi.FinalScriptWitness != nil {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "e0ee3bb75c7a131b56a3231a2d70d6a5", "score": "0.51850885", "text": "func (pi *PInput) IsSane() bool {\n\n\tif pi.NonWitnessUtxo != nil && pi.WitnessUtxo != nil {\n\t\treturn false\n\t}\n\tif pi.WitnessUtxo == nil && pi.WitnessScript != nil {\n\t\treturn false\n\t}\n\tif pi.WitnessUtxo == nil && pi.FinalScriptWitness != nil {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "4d984ea7b7098722c20f5c5972854a7a", "score": "0.5184399", "text": "func isScalingInProgress(cvcObj *cstor.CStorVolumeConfig) bool {\n\treturn len(cvcObj.Spec.Policy.ReplicaPoolInfo) != len(cvcObj.Status.PoolInfo)\n}", "title": "" }, { "docid": "9a453d6fbb35c7a0a3da209b6dc1ceab", "score": "0.5184211", "text": "func (m *Machine) Can(o Object, e Event) bool {\n\ttrs, err := m.AvailableTransitions(o, e)\n\treturn err == nil && len(trs) > 0\n}", "title": "" }, { "docid": "e503f79493327ffdb5c030c61a53652d", "score": "0.5179217", "text": "func (n *Node) IsSufficient() bool {\n\treturn n.Stats.Len() > 1\n}", "title": "" }, { "docid": "a886761a24093a52c190f91ced165fb3", "score": "0.5178552", "text": "func hasSpecs(instance *mobilesecurityservicev1alpha1.MobileSecurityServiceBind, reqLogger logr.Logger) bool {\n\t//Check if the cluster host was added in the CR\n\tif len(instance.Spec.ClusterHost) < 1 || instance.Spec.ClusterHost == \"{{clusterHost}}\" {\n\t\treqLogger.Info( \"Cluster Host IP was not found. Check the Bind CR configuration or ignore if the object was deleted\")\n\t\treturn false\n\t}\n\n\tif len(instance.Spec.AppId) < 1 {\n\t\treqLogger.Info(\"AppID was not found. Check the Bind CR configuration or ignore if the object was deleted\")\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "4bf5f07142085bac8ef7e44a0b7acd7f", "score": "0.51750606", "text": "func (_this *PeerConnection) CanTrickleIceCandidates() *bool {\n\tvar ret *bool\n\tvalue := _this.Value_JS.Get(\"canTrickleIceCandidates\")\n\tif value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {\n\t\t__tmp := (value).Bool()\n\t\tret = &__tmp\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "8e11431b631ec864359ad8252d9ca98b", "score": "0.5171427", "text": "func (vs VolatilitySet) IsLeakProof() bool {\n\treturn vs == 0 || vs == volatilityBit(tree.VolatilityLeakProof)\n}", "title": "" }, { "docid": "c5e16fcd8ec3bdf3fb40df382a7c0c49", "score": "0.5169169", "text": "func (ar *allocRunner) isShuttingDown() bool {\n\tar.destroyedLock.Lock()\n\tdefer ar.destroyedLock.Unlock()\n\treturn ar.shutdownLaunched\n}", "title": "" }, { "docid": "b095e77ee573785c7bee78eff38881c8", "score": "0.5162023", "text": "func (v Verbosity) CanNotify() (can bool) {\n\treturn v&VerbosityNotification != 0\n}", "title": "" }, { "docid": "cfa8c50c5af59ed7c4ec8c3f93d2cdbc", "score": "0.51398116", "text": "func (ji *JobInfo) HasSignaled() bool {\n\treturn ji.hasSignaled\n}", "title": "" }, { "docid": "ad647666e7475ccbec023fa925210b29", "score": "0.5136913", "text": "func (c *Client) canKill() bool {\n\treturn false\n}", "title": "" }, { "docid": "15af9e91bb95b5ce3e6eb2d8666bda28", "score": "0.5129722", "text": "func (v *MarketView) HasPower(ctx context.Context, st state.Tree, bstore blockstore.Blockstore, mAddr address.Address) bool {\n\tnumBytes, err := v.Miner(ctx, st, bstore, mAddr)\n\tif err != nil {\n\t\tif state.IsActorNotFoundError(err) {\n\t\t\treturn false\n\t\t}\n\n\t\tpanic(err) //hey guys, dropping errors is BAD\n\t}\n\n\treturn numBytes.GreaterThan(types.ZeroBytes)\n}", "title": "" }, { "docid": "c2b377b8493f2832e536041be6555f72", "score": "0.5129", "text": "func IsHealthyAllowPending(cluster Cluster, res *core.CachedResource) bool {\n\tif !cluster.GetOpts().IsPlacementRulesEnabled() && len(res.GetLearners()) > 0 {\n\t\treturn false\n\t}\n\treturn len(res.GetDownPeers()) == 0\n}", "title": "" }, { "docid": "7be7be0c8891841b6137185deefae8e5", "score": "0.51192147", "text": "func (b *Board) IsVictory() bool {\n\treturn b.goals == 0\n}", "title": "" }, { "docid": "547e0c43a7d31bdc8df339cd564240f5", "score": "0.5115009", "text": "func (t Target) CanSend() bool {\n\treturn t.Account != \"\" && (t.Nick != \"\" || t.Channel != \"\")\n}", "title": "" }, { "docid": "d8ae5cf64caf22a0a175acda8692945f", "score": "0.51125497", "text": "func (ss *SolarSystem) TheyPassThroughTheSun() bool {\n\ta := float64(ss.Sun.X - ss.Ferengi.X)\n\tb := float64(ss.Betazoid.X - ss.Ferengi.X)\n\tc := float64(ss.Sun.Y - ss.Ferengi.Y)\n\td := float64(ss.Betazoid.Y - ss.Ferengi.Y)\n\treturn math.Abs(math.Round((a)/(b))-math.Round((c)/(d))) < Tolerance\n}", "title": "" }, { "docid": "543b1b9e907134b772487773a606cc17", "score": "0.5112162", "text": "func (inst *QemuInstance) Signaled() bool {\n\treturn inst.qemu.Signaled()\n}", "title": "" }, { "docid": "89fc249e757576e0da5688149a0d2001", "score": "0.5110927", "text": "func (c Coordinator) inBlackout() bool {\n\treturn c.lastDispatched.Add(c.blackout).After(time.Now())\n}", "title": "" }, { "docid": "39b240c06671fe4900eec3dab56eb4cc", "score": "0.5107077", "text": "func (s *Smither) canRecurse() bool {\n\treturn s.complexity > s.rnd.Float64()\n}", "title": "" }, { "docid": "051a006fd85c2ed196d461e6db780eaa", "score": "0.5106352", "text": "func (b *Base) Permits(target *Player) bool {\n\tswitch target.Level {\n\tcase Admin:\n\t\treturn true\n\tcase Normal:\n\t\treturn b.O == target\n\tcase Guest:\n\t\treturn false\n\tdefault:\n\t\tlog.Printf(\"invalid type %T: %+v\", target.Level, target)\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "55a04a6f3557b9d6eda2867ff5648b4d", "score": "0.5104353", "text": "func (o *AdapterUnitAllOf) HasPower() bool {\n\tif o != nil && o.Power != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "12f8078798273484a9e6ca123bbe332e", "score": "0.5102068", "text": "func (s *subprocess) canKickSysmsgThread() (bool, uint32) {\n\t// numActiveContexts and numActiveThreads can be changed from stub\n\t// threads that handles the contextQueue without any locks. The idea\n\t// here is that any stub thread that gets CPU time can make some\n\t// progress. In stub threads, we can use only spinlock-like\n\t// synchronizations, but they don't work well because a thread that\n\t// holds a lock can be preempted by another thread that is waiting for\n\t// the same lock.\n\tnrActiveThreads := atomic.LoadUint32(&s.contextQueue.numActiveThreads)\n\tnrThreadsToWakeup := atomic.LoadUint32(&s.contextQueue.numThreadsToWakeup)\n\tnrActiveContexts := atomic.LoadUint32(&s.contextQueue.numActiveContexts)\n\n\tnrActiveThreads += nrThreadsToWakeup + 1\n\tif nrActiveThreads > nrActiveContexts {\n\t\t// This can happen when one or more stub threads are\n\t\t// waiting for cpu time. The host probably has more\n\t\t// running tasks than a number of cpu-s.\n\t\treturn false, nrActiveThreads\n\t}\n\treturn true, nrActiveThreads\n}", "title": "" }, { "docid": "f26fe30a06945783d8689f9f3e984f11", "score": "0.50922745", "text": "func (s *DB) HasSuicided(addr common.Address) bool {\n\tstateObject := s.getStateObject(addr)\n\tif stateObject != nil {\n\t\treturn stateObject.suicided\n\t}\n\treturn false\n}", "title": "" }, { "docid": "12f63ded77dfd934f18cb9368f398c70", "score": "0.50773674", "text": "func (ema *EmaSignals) CanSell() bool {\n\tlenSignals := len(ema.EmaSignals)\n\t// not buy or sell\n\tif lenSignals == 0 {\n\t\treturn false\n\t}\n\n\tif ema.EmaSignals[lenSignals-1].Action == BUY {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "002fa6fa3c43492dd3257adc8eb51370", "score": "0.5076336", "text": "func (o *StorageHitachiHostAllOf) HasPortLunSecurity() bool {\n\tif o != nil && o.PortLunSecurity != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "a521f3de213a002b98ae431544038ed4", "score": "0.5074202", "text": "func (ch *channel) canSend() bool {\n\treturn ch.loadSendQueueSize() < defaultSendQueueCapacity\n}", "title": "" }, { "docid": "736acf38e616607529b249f932a03dc2", "score": "0.5071539", "text": "func (o *StorageHitachiHostAllOf) HasWwn() bool {\n\tif o != nil && o.Wwn != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "dd46655db6cf4096ab8ce936e6efc43b", "score": "0.5068117", "text": "func (s *SpecialSupporter) CanHandle(trouble *Trouble) bool {\n\t// ˅\n\treturn trouble.id == s.targetID\n\t// ˄\n}", "title": "" }, { "docid": "554b69893f574f08b69f9265cca26b3d", "score": "0.5062137", "text": "func IsInsufficient(pos Position) bool {\n\tif pos.b[White][Pawn] != 0 || pos.b[Black][Pawn] != 0 ||\n\t\tpos.b[White][Rook] != 0 || pos.b[Black][Rook] != 0 ||\n\t\tpos.b[White][Queen] != 0 || pos.b[Black][Queen] != 0 {\n\t\treturn false\n\t}\n\tvar (\n\t\tnknights = PopCount(pos.b[White][Knight] | pos.b[Black][Knight])\n\t\tnbishops = PopCount(pos.b[White][Bishop] | pos.b[Black][Bishop])\n\t)\n\tif nknights+nbishops <= 1 {\n\t\t// KvK, KNvK, and KBvK are drawn.\n\t\treturn true\n\t}\n\tif nknights > 0 {\n\t\t// Knight and at least one other minor piece: in KNNvK, KBvKN, and KNvKN,\n\t\t// mate can't be forced, although it can be given by a series of legal moves.\n\t\treturn false\n\t}\n\tif bishops := (pos.b[White][Bishop] | pos.b[Black][Bishop]); bishops&DarkSquares == 0 || bishops&LightSquares == 0 {\n\t\t// Kings and any number of same color bishops only is drawn.\n\t\treturn true\n\t}\n\t// Opposite color bishops: KBvKB can mate, although not by force.\n\treturn false\n}", "title": "" }, { "docid": "bb710728cc0eb7c807ce539ed66bf0ea", "score": "0.5061711", "text": "func (t TalkToMe) Diagnostics() bool {\n\treturn t&(1<<2) > 0\n}", "title": "" }, { "docid": "d82f708f89c8fbcf1917c61d86dac30d", "score": "0.5057623", "text": "func (w World) HasScent(x, y int) bool {\n\treturn w.Grid[y][x].Scent\n}", "title": "" }, { "docid": "bca3fc0c0164bf3f2f6c6b8ea80f4b35", "score": "0.50574684", "text": "func (a *AccessKey) CanSign() bool {\n\treturn (a.ID) != \"\" && (a.SecretAccessKey) != \"\"\n}", "title": "" }, { "docid": "ab5fcded8807e7606195ae68ab7cfc75", "score": "0.5054028", "text": "func (s *State) CanAffordBuyback() bool {\n\tif s == nil || s.Hero == nil || s.Player == nil {\n\t\treturn false\n\t}\n\n\treturn s.BuybackCost < (s.ReliableGold + s.UnreliableGoldAfterDeath())\n}", "title": "" }, { "docid": "bf0ec374ef8ffce7ed88c191bcbc8086", "score": "0.50524247", "text": "func IsInteresting (g Gram) bool {\n\tfor _, v := range g.Signal {\n\t\tif v > AMP_THRESHOLD {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "41e2b6ed0cd6215b0072a2ccefdf6aed", "score": "0.5051398", "text": "func (wz *wizardBattleSimulator) bossAttacks() bool {\n\twz.b.attack(wz.w) //Boss time! (No need to record as only one possibility)\n\tif wz.w.health < 1 { //player defeated\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "57a10907adebe2cc4f2a53281478603c", "score": "0.50504094", "text": "func (id *SpiffeIDSigning) CanSign(cu CertURI) bool {\n\tswitch other := cu.(type) {\n\tcase *SpiffeIDSigning:\n\t\t// We can only sign other CA certificates for the same trust domain. Note\n\t\t// that we could open this up later for example to support external\n\t\t// federation of roots and cross-signing external roots that have different\n\t\t// URI structure but it's simpler to start off restrictive.\n\t\treturn id.URI().String() == other.URI().String()\n\tcase *SpiffeIDService:\n\t\t// The host component of the service must be an exact match for now under\n\t\t// ascii case folding (since hostnames are case-insensitive). Later we might\n\t\t// worry about Unicode domains if we start allowing customisation beyond the\n\t\t// built-in cluster ids.\n\t\treturn strings.ToLower(other.Host) == id.Host()\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "6c500bd10628f095eedd9ba1a847d9b5", "score": "0.5049641", "text": "func (c *Chain) CanShardBlocksSharders(sharders *node.Pool) bool {\n\treturn sharders.GetActiveCount()*100 >= sharders.Size()*c.MinActiveSharders\n}", "title": "" }, { "docid": "779f97649bce71fcfaf7bc662da7fba1", "score": "0.504496", "text": "func (t *Target) IsSSHID() bool {\n\treturn strings.Contains(t.Data, \".\")\n}", "title": "" }, { "docid": "b6f8fe362215e68bdaea9be7a70e4915", "score": "0.50422066", "text": "func (o *FabricMulticastPolicyAllOf) HasSnoopingState() bool {\n\tif o != nil && o.SnoopingState != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "dd1ed0e14adbe179cfe9ebdf148b5b8d", "score": "0.50398594", "text": "func (e *Engine) Won() bool {\n\tfor _, p := range e.points {\n\t\tif e.Surface[p.Y][p.X].Box == EMPTY {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "fa540ba1ec53bad2f9ca8fcab16bcc83", "score": "0.50377464", "text": "func (p *Pokemon) isAsleep() bool {\n\treturn strings.Contains(p.Condition, \" slp\")\n}", "title": "" }, { "docid": "ddc5579a8bf1deacc2e62f70e19b6636", "score": "0.50301975", "text": "func (pid PID) IsSUSY() bool {\n\t// fundamental SUSY particles have n =1 or =2\n\tswitch {\n\tcase pid.ExtraBits() > 0:\n\t\treturn false\n\tcase pid.Digit(N) != 1 && pid.Digit(N) != 2:\n\t\treturn false\n\tcase pid.Digit(Nr) != 0:\n\t\treturn false\n\tcase pid.FundamentalID() == 0:\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "630ac64913ac3758c8638d060191db82", "score": "0.50298554", "text": "func canLaunch(n *config.Node) bool {\n\tfor _, l := range n.Labels {\n\t\tif \n\t}\n\treturn false\n}", "title": "" }, { "docid": "7f4eaac952bf7d8154e15f104a889574", "score": "0.5020611", "text": "func (ws watcherSingle) canPromote() bool {\n\treturn ws.w.rev == ws.lastStoreRev\n}", "title": "" }, { "docid": "fdf4e36d0cc37a16a8b723b3f5fd2aab", "score": "0.5018931", "text": "func (s *strikeItem) hasPotential() bool {\n\treturn s.idx+1 <= len(s.successive)\n}", "title": "" }, { "docid": "84af7c116588d049e47ae7f64be6d3b6", "score": "0.50157887", "text": "func needsSuspendComponent(cluster v1alpha1.Cluster, comp v1alpha1.MemberType) bool {\n\tspec := cluster.ComponentSpec(comp)\n\tif spec == nil {\n\t\treturn false\n\t}\n\taction := spec.SuspendAction()\n\tif action == nil {\n\t\treturn false\n\t}\n\n\tif action.SuspendStatefulSet {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "35463a8bd0a135a6a0e5f08612aabde7", "score": "0.5015334", "text": "func (pid PID) HasCharm() bool {\n\tswitch {\n\tcase pid.ExtraBits() > 0:\n\t\treturn false\n\tcase pid.FundamentalID() > 0:\n\t\treturn false\n\t}\n\treturn pid.findQ(4)\n}", "title": "" }, { "docid": "32e5d99c66ebfdaf75acf39de1336aa6", "score": "0.5012413", "text": "func (s *SCIONLabASController) canConfigure(userEmail string, asID addr.AS) error {\n\tas, err := models.FindSCIONLabASByUserEmailAndASID(userEmail, asID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif (as.Status == models.Active) || (as.Status == models.Inactive) {\n\t\tif as.Type == models.Infrastructure {\n\t\t\treturn errors.New(\"cannot modify infrastructure ASes\")\n\t\t}\n\t\treturn nil\n\t}\n\treturn errors.New(\"the given AS has a pending update request\")\n}", "title": "" }, { "docid": "b8e45785e923cba14ced14fa82cc85ff", "score": "0.5012295", "text": "func (t *Throttler) Allow() bool {\n\tif delay := atomic.LoadInt64(&t.delay); delay > 0 {\n\t\tselect {\n\t\tcase <-t.ticks:\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "1db2ddb80c24fef71e25a6517c1bc247", "score": "0.50079685", "text": "func (pa PowerAction) IsValid() bool {\n\treturn pa == PowerActionStart ||\n\t\tpa == PowerActionStop ||\n\t\tpa == PowerActionTerminate ||\n\t\tpa == PowerActionRestart\n}", "title": "" } ]
aa2afac3f1528213aa677614f09c1e98
/ ================================================================================= Task.Save() Inputs: saveChildren bool true: recursively save all children false: save just this task and parent relationships Save the task to storage and (optionally) all of its children. It is important to note that the "storage unit" assumed is the task itself and all of this task's parent relationships. Save is where we enforce the memoryonly setting on a task, but it is ONLY ENFORCED AT THE TOP LEVEL Mappers are free to ignore the setting for children in the middle of the hierarhcy! Note that we leave the implementation of the recursion to the Mapper so it can take advantage of clever ways to load objects in bulk from whatever its storage mechanism is. ===============================================================================
[ { "docid": "8efb98f6889e84a4490b6bea6db2320b", "score": "0.8523005", "text": "func (t *Task) Save(saveChildren bool) error {\n\n // fmt.Printf(\"Task.Save() id:%s, name:%s, memoryonly:%t\\n\", t.GetId(), t.GetName(), t.memoryonly)\n\n // if memory only and not saving children then nothing to do\n if t.memoryonly && !saveChildren {\n return nil\n }\n\n // save my children if requested, and save myself if not memory only\n err := t.persist.Save(t, saveChildren, !t.memoryonly)\n if err != nil {\n return err\n // TBD - consider how to invalidate the in-memory copy of this object\n // if it can't be saved. Should it be removed? Should we try\n // again?\n }\n\n return nil\n}", "title": "" } ]
[ { "docid": "5387a86c063f28f06a48daab0675e554", "score": "0.7140138", "text": "func (tm *TaskDataMapperPostgreSQL) Save(t *Task, saveChildren bool, saveMyself bool) error {\n\n // log.Printf(\"Save(%t, %t): task = %s, id = %s, loaded = %t len(parentIds) = %d\", saveChildren, saveMyself, t.name, t.id, tm.loaded, len(tm.parentIds))\n\n // only save myself if requested\n if saveMyself {\n\n // upsert the task itself\n if tm.loaded {\n _, err := dbExec(env, `UPDATE tasks SET name = $1, state = $2, target_start_time = $3, actual_start_time = $4, actual_completion_time = $5, estimate_minutes = $6 \n WHERE ID = $7`, t.GetName(), t.GetState(), t.TargetStartTime, t.ActualStartTime, t.ActualCompletionTime, int(t.Estimate.Minutes()), t.GetId())\n if (err != nil) {\n err = errors.New(fmt.Sprintf(\"tdmp.Save(): Unable to update task %s: %s\", t.GetName(), err))\n return err\n }\n\n // update today, thisweek and dontforget tags - false means its an update\n // tm.syncSystemTags(t, false)\n err = tm.syncTags(t, false)\n if (err != nil) {\n return err;\n }\n\n // update all links - adding or removing to match the in-memory task\n err = tm.syncLinks(t, true)\n if (err != nil) {\n return err;\n }\n\n // update all users - adding or removing to match the in-memory task\n err = tm.syncUsers(t)\n if (err != nil) {\n return err;\n }\n\n\n } else {\n _, err := dbExec(env, `INSERT INTO tasks (id, name, state, target_start_time, actual_start_time, actual_completion_time, estimate_minutes) VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING id`, \n t.GetId(), t.GetName(), t.GetState(), t.TargetStartTime, t.ActualStartTime, t.ActualCompletionTime, int(t.Estimate.Minutes()))\n if (err != nil) { \n err = errors.New(fmt.Sprintf(\"tdmp.Save(): Unable to insert task %s: %s\", t.GetName(), err))\n return err\n }\n\n // update all tags - adding or removing to match the in-memory task\n err = tm.syncTags(t, true)\n if (err != nil) {\n return err;\n }\n\n // update all links - adding or removing to match the in-memory task\n err = tm.syncLinks(t, true)\n if (err != nil) {\n return err;\n }\n\n // update all users - adding or removing to match the in-memory task\n err = tm.syncUsers(t)\n if (err != nil) {\n return err;\n }\n\n tm.MarkInDB()\n }\n\n // now set the parent relationships - do we break datamapper pattern\n // by not also saving our children? note that we have our own\n // id if we get here - we just need the ids of our parents which is\n // super ugly - they may not have been saved - we must assume they have been\n // and that saving happens top-down.\n\n // first collect the parent ids we already have recorded as saved\n // we'll remove them as we go and anything no longer in the parent\n // list we'll remove at the end\n savedParentIds := tm.parentIds\n\n for p := t.FirstParent(); p != nil; p = t.NextParent() {\n\n // for this parent get it's id\n id := p.GetId()\n\n // for this parent make sure it is in the database\n // and if it is not we will skip it! we assume saves\n // are done top-down, so if it isn't \"loaded\" then\n // the parent must be a memory-only task and the\n // task we are saving should be set to be a root task\n var tmParent interface{}\n tmParent = p.DataMapper()\n tmParentPG := tmParent.(*TaskDataMapperPostgreSQL)\n skipParent := !tmParentPG.loaded\n\n // if we got an id then write the parent / child relationship\n if !skipParent {\n\n // first see if it is already written - if so nothing to do\n // except remove from the previously saved ids\n if tm.HasParentId(id) {\n savedParentIds = removeStringByValue(savedParentIds, id)\n } else {\n // if it wasn't so much work to check, i'd say we should assert that\n // saves are happening top-down and that the parent is already in the\n // DB before we call insert - because the insert will fail for data\n // integrity reasons if the parent is not already in the DB\n // assert tmParent.IsInDB()\n _, err := dbInsert(env, \"INSERT INTO task_parents (parent_id, child_id) VALUES ($1, $2)\", id, t.GetId())\n if err != nil { \n err = errors.New(fmt.Sprintf(\"tdmp.Save(): Unable to insert parent relationship between parent task %s and child task %s: %s\", p.GetName(), t.GetName(), err))\n return err\n }\n tm.AddParentId(id)\n }\n } // skip this parent if not loaded\n }\n\n // once we've looped through all the parents, anything left needs to\n // be removed - it means the parentage that was once saved is no longer there\n for _, idParent := range savedParentIds {\n _, err := dbExec(env, \"DELETE FROM task_parents WHERE parent_id = $1 AND child_id = $2\", idParent, t.GetId())\n if err != nil {\n err = errors.New(fmt.Sprintf(\"tdmp.Save(): Unable to remove obsolete parent relationship with parent id %d to child task %s: %s\", idParent, t.GetName(), err))\n return err\n }\n }\n } // if saveMyself\n\n // now recurse if requested\n if saveChildren {\n var err error = nil\n for c := t.FirstChild(); c != nil && err == nil; c = t.NextChild() {\n // log.Printf(\"about to save id=%s, name=%s\\n\", c.Id(), c.Name())\n // err = c.Save(true, true) - could use this to enforce memory-only objects within hierarchy\n err = c.persist.Save(c, true, true)\n }\n if err != nil {\n return err\n }\n } // if saveChildren\n\n return nil\n}", "title": "" }, { "docid": "790d424444b97791d7992dcd531b1339", "score": "0.58525014", "text": "func (b *Repo) Save(ctx context.Context) error {\n\t_, maps, err := b.recursiveAddPath(ctx, b.path, b.dag)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor p, c := range maps {\n\t\tif err := b.setLocalPath(p, c); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ccdbf888442828a1286cd7975e0add90", "score": "0.5822296", "text": "func (store *TaskStore) Save(t dawdle.Task) error {\n\tif t.ID == \"\" {\n\t\tt.ID = uuid.NewV4().String()\n\t}\n\n\tvar exists bool\n\n\tfor i := range store.tasks {\n\t\tif store.tasks[i].ID == t.ID {\n\t\t\tstore.tasks[i] = t\n\t\t\texists = true\n\t\t}\n\t}\n\n\tif !exists {\n\t\tstore.tasks = append(store.tasks, t)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0ab6bcf9a3a401fab72a2d392ffc93cb", "score": "0.5807363", "text": "func (task *Task) Save() error {\n\tdbSession := NewTaskDBSession()\n\tdefer dbSession.Close()\n\n\treturn task.SaveWithSession(dbSession)\n}", "title": "" }, { "docid": "6b10eb62cd574c488a2cee31694a1239", "score": "0.57691616", "text": "func (t *Task) Load(loadChildren bool) error {\n return t.persist.Load(t, loadChildren, t.memoryonly)\n}", "title": "" }, { "docid": "e04851ff5601c1a9f7d564bfb60d0166", "score": "0.5767333", "text": "func SaveTask(ctx *gin.Context, client *firestore.Client, task models.Task) bool {\n\tfmt.Println(task)\n\tvar err error\n\ttask.Children = nil\n\ttask.Owner = getUserRef(ctx, client)\n\tif task.Parent != nil {\n\t\ttask.Parent = getUserTasksRef(ctx, client).Doc(task.Parent.ID)\n\t}\n\tif task.ID == \"\" {\n\t\t_, _, err = getUserTasksRef(ctx, client).Add(ctx, task)\n\t} else {\n\t\t_, err = getUserTasksRef(ctx, client).Doc(task.ID).Set(ctx, task)\n\t}\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn err == nil\n}", "title": "" }, { "docid": "d92a6ed1a26048043d2290a88e90933b", "score": "0.542362", "text": "func saveCacheTask(task *types.Task) error {\n\n\tif !cacheMgr.isOK {\n\t\treturn nil\n\t}\n\n\ttaskGroupID := types.GetTaskGroupID(task.ID)\n\tif taskGroupID == \"\" {\n\t\treturn errors.New(\"task id error\")\n\t}\n\trunAs, appID := types.GetRunAsAndAppIDbyTaskGroupID(taskGroupID)\n\tapp := getCacheAppNode(runAs, appID)\n\tif app == nil {\n\t\tblog.V(3).Infof(\"app(%s.%s) not in cache\", runAs, appID)\n\t\treturn nil\n\t}\n\tif app.Taskgroups == nil {\n\t\tblog.V(3).Infof(\"app(%s.%s) taskgroups not in cache\", runAs, appID)\n\t\treturn nil\n\t}\n\n\tfor _, taskGroup := range app.Taskgroups {\n\t\tif taskGroup.ID == taskGroupID {\n\t\t\tblog.V(3).Infof(\"taskgroup(%s) in cache\", taskGroupID)\n\n\t\t\tcacheData := task.DeepCopy()\n\t\t\tisExist := false\n\t\t\tfor index, cacheTask := range taskGroup.Taskgroup {\n\t\t\t\tif task.ID == cacheTask.ID {\n\t\t\t\t\tblog.V(3).Infof(\"update task(%s) in cache\", task.ID)\n\t\t\t\t\ttaskGroup.Taskgroup[index] = cacheData\n\t\t\t\t\tisExist = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !isExist {\n\t\t\t\tblog.Warnf(\"insert task(%s) in cache\", task.ID)\n\t\t\t\ttaskGroup.Taskgroup = append(taskGroup.Taskgroup, cacheData)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d877ea3130ceb9a00f1778e02ff91d5b", "score": "0.5347207", "text": "func (b *Binder) Save(ctx context.Context) error {\n\tmemoryData, err := marshal(b.root, b.instance, b.tagName)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// compare\n\tvar todoSave []*mapData\n\tfor _, memoryItem := range memoryData {\n\t\tcurrentItem, ok := b.currentFiles[memoryItem.Key]\n\t\tif !ok || memoryItem.Value != currentItem.Value {\n\t\t\ttodoSave = append(todoSave, memoryItem)\n\t\t}\n\t}\n\n\tmemoryDataMap := make(map[string]*mapData)\n\tfor _, v := range memoryData {\n\t\tmemoryDataMap[v.Key] = v\n\t}\n\tfor k := range b.currentFiles {\n\t\tmemItem, ok := memoryDataMap[k]\n\t\tif !ok || memItem.Value == \"\" {\n\t\t\ttodoSave = append(todoSave, &mapData{\n\t\t\t\tKey: k,\n\t\t\t\tValue: \"\",\n\t\t\t})\n\t\t}\n\t}\n\tfor _, v := range todoSave {\n\t\tif v.Value == \"null\" || strings.HasSuffix(v.Key, \"/\") {\n\t\t\tcontinue\n\t\t}\n\t\tif err := b.saveJSONFile(ctx, v.Key, []byte(v.Value)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d6833cdb25b1242d67d613069d5c4dcf", "score": "0.53101337", "text": "func (t *Task) Remove(newParent *Task) error {\n\n // delete from storage before we remove from\n // memory since the data-mapper will need the\n // loaded object to find the persisted data to delete.\n // don't bother with reparenting my kids - too\n // hard to coordinate with the logic of only doing\n // so for orphans, and reparenting should get\n // fixed on the next save (will it?)\n if t.persist != nil {\n err := t.persist.Delete(t, nil)\n if err != nil {\n return err\n }\n }\n\n // remove from parent's child lists\n for _, p := range t.parents {\n err := p.RemoveChild(t)\n if err != nil {\n return err\n }\n }\n\n // remove from kids parent lists\n // replacing with new parent if specified\n // and child will be orphaned otherwise\n for _, k := range t.kids {\n err := k.RemoveParent(t)\n if err != nil {\n return err\n } \n if newParent != nil && !k.HasChildren() {\n k.AddParent(newParent)\n }\n }\n return nil\n}", "title": "" }, { "docid": "173df11a2d11ff2f63e74aa40d924308", "score": "0.5223143", "text": "func (w *worker) saveTask(t Task) error {\n\tvar reply interface{}\n\n\t// Call RpcHandler.FinishTask, which will save output to queue.\n\terr := w.client.Call(\"RpcHandler.FinishTask\", t, &reply)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4e30de315267d52991d8baf414d5b42f", "score": "0.5199479", "text": "func SaveTask(TaskHandle unsafe.Pointer, SaveAs string, Author string, Options uint32) int32 {\n\tcTaskHandle, _ := (C.TaskHandle)(TaskHandle), cgoAllocsUnknown\n\tcSaveAs, _ := unpackPCharString(SaveAs)\n\tcAuthor, _ := unpackPCharString(Author)\n\tcOptions, _ := (C.uInt32)(Options), cgoAllocsUnknown\n\t__ret := C.DAQmxSaveTask(cTaskHandle, cSaveAs, cAuthor, cOptions)\n\t__v := (int32)(__ret)\n\treturn __v\n}", "title": "" }, { "docid": "9639f97fe55eca0d54d7c0be835e937e", "score": "0.51650304", "text": "func (s *TaskServer) SaveTask(c echo.Context) error {\n\n\tdata := make(map[string]storage.TaskRead)\n\n\tform_date := c.FormValue(\"due_date\")\n\tdue_ptr := (*time.Time)(nil)\n\tif len(form_date) != 0 {\n\t\tdue_date, err := time.Parse(time.RFC3339Nano, form_date)\n\n\t\tif err != nil {\n\t\t\treturn Error(c, err)\n\t\t}\n\t\tdue_ptr = &due_date\n\t}\n\n\tasset_id := c.FormValue(\"asset_id\")\n\tasset_id_ptr := (*uuid.UUID)(nil)\n\tif len(asset_id) != 0 {\n\t\tasset_id, err := uuid.FromString(asset_id)\n\t\tif err != nil {\n\t\t\treturn Error(c, err)\n\t\t}\n\t\tasset_id_ptr = &asset_id\n\t}\n\n\tdomaincode := c.FormValue(\"domain\")\n\n\tdomaintask, err := s.CreateTaskDomainByCode(domaincode, c)\n\n\tif err != nil {\n\t\treturn Error(c, err)\n\t}\n\n\ttask, err := domain.CreateTask(\n\t\ts.TaskService,\n\t\tc.FormValue(\"title\"),\n\t\tc.FormValue(\"description\"),\n\t\tdue_ptr,\n\t\tc.FormValue(\"priority\"),\n\t\tdomaintask,\n\t\tc.FormValue(\"category\"),\n\t\tasset_id_ptr)\n\n\tif err != nil {\n\t\treturn Error(c, err)\n\t}\n\n\terr = <-s.TaskEventRepo.Save(task.UID, 0, task.UncommittedChanges)\n\tif err != nil {\n\t\treturn Error(c, err)\n\t}\n\n\t// Trigger Events\n\ts.publishUncommittedEvents(task)\n\n\ttaskRead := MapTaskToTaskRead(task)\n\ts.AppendTaskDomainDetails(taskRead)\n\n\tdata[\"data\"] = *taskRead\n\n\treturn c.JSON(http.StatusOK, data)\n}", "title": "" }, { "docid": "7f595a801f27e45495e5c745772cf5eb", "score": "0.51228344", "text": "func (s *Storage) SaveTask(t service.Task) error {\n\tif s.DB != nil {\n\t\ts.DB.Save(&t)\n\t\treturn nil\n\t} else {\n\t\treturn service.ErrStorageUnavailable\n\t}\n}", "title": "" }, { "docid": "a8793de0439cfdf26bfab40b1284aab6", "score": "0.51050824", "text": "func (t *Task) Children() map[*Task]struct{} {\n\tt.tg.pidns.owner.mu.RLock()\n\tdefer t.tg.pidns.owner.mu.RUnlock()\n\n\tchildren := make(map[*Task]struct{}, len(t.children))\n\tfor child, val := range t.children {\n\t\tchildren[child] = val\n\t}\n\n\treturn children\n}", "title": "" }, { "docid": "ca8d9f5a66df34014e834b12419970b3", "score": "0.5100719", "text": "func (d *localDB) PutTasks(tasks []*db.Task) error {\n\t// If there is an error during the transaction, we should leave the tasks\n\t// unchanged. Save the old Ids and DbModified times since we set them below.\n\ttype savedData struct {\n\t\tId string\n\t\tDbModified time.Time\n\t}\n\toldData := make([]savedData, 0, len(tasks))\n\t// Validate and save current data.\n\tfor _, t := range tasks {\n\t\tif err := d.validateTask(t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\toldData = append(oldData, savedData{\n\t\t\tId: t.Id,\n\t\t\tDbModified: t.DbModified,\n\t\t})\n\t}\n\trevertChanges := func() {\n\t\tfor i, data := range oldData {\n\t\t\ttasks[i].Id = data.Id\n\t\t\ttasks[i].DbModified = data.DbModified\n\t\t}\n\t}\n\tgobs := make(map[string][]byte, len(tasks))\n\terr := d.update(\"PutTasks\", func(tx *bolt.Tx) error {\n\t\tbucket := tasksBucket(tx)\n\t\t// Assign Ids and encode.\n\t\te := db.TaskEncoder{}\n\t\tnow := time.Now().UTC()\n\t\tfor _, t := range tasks {\n\t\t\tif t.Id == \"\" {\n\t\t\t\tif err := d.assignTaskId(tx, t, now); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif value := bucket.Get([]byte(t.Id)); value != nil {\n\t\t\t\t\tmodTs, serialized, err := unpackTask(value)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif !modTs.Equal(t.DbModified) {\n\t\t\t\t\t\tvar existing db.Task\n\t\t\t\t\t\tif err := gob.NewDecoder(bytes.NewReader(serialized)).Decode(&existing); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsklog.Warningf(\"Cached Task has been modified in the DB. Current:\\n%#v\\nCached:\\n%#v\", existing, t)\n\t\t\t\t\t\treturn db.ErrConcurrentUpdate\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tt.DbModified = now\n\t\t\te.Process(t)\n\t\t}\n\t\t// Insert/update.\n\t\tfor {\n\t\t\tt, serialized, err := e.Next()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif t == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tgobs[t.Id] = serialized\n\t\t\tvalue := packTask(t.DbModified, serialized)\n\t\t\tif err := bucket.Put([]byte(t.Id), value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\trevertChanges()\n\t\treturn err\n\t} else {\n\t\td.TrackModifiedTasksGOB(gobs)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f7083015f729ec60bc7f7af686555e2b", "score": "0.50949055", "text": "func (ts *TaskSet) SavePendingChanges() {\n\tids := make(IdsMap, len(ts.Tasks()))\n\n\tfor _, task := range ts.tasks {\n\t\tif task.WritePending {\n\t\t\ttask.SaveToDisk(ts.repoPath)\n\t\t}\n\n\t\tif task.ID > 0 {\n\t\t\tids[task.UUID] = task.ID\n\t\t}\n\t}\n\n\t// saving generally only happens when tasks are mutated. This is OK, and\n\t// important. Generally the ID assignment process is deterministic such\n\t// that a DB is not required. However, if tasks are listed and then tasks\n\t// are closed or created, it can have a ripple effect such that it is\n\t// possible for every ID to change. Therefore, tasks must retain their IDs\n\t// locally. This replaced a system where tasks recorded their IDs, which\n\t// can create merge conflicts in some (uncommon) cases.\n\tids.Save(ts.idsFilePath)\n}", "title": "" }, { "docid": "3148947f36c48ffddb44bd98561e21dd", "score": "0.502092", "text": "func (b BTreeCacheWrap) Write() error {\n\terr := b.batch.Write()\n\tb.Discard()\n\treturn err\n}", "title": "" }, { "docid": "e70f66fd065dfe296d60e6d2ed8a3016", "score": "0.49930224", "text": "func (f *FilesystemPersistence) Save(ctx context.Context, key, value []byte, ttl time.Time) error {\n\tif f.Immutable {\n\t\tlog.Println(\"Persistence layer is configured as immutable, yet tool is trying to write to it\")\n\t\treturn ErrInvalidConfig\n\t}\n\n\t// Serialize\n\tbo, err := proto.Marshal(&pb.PersistedObject{\n\t\tKey: key,\n\t\tValue: value,\n\t\tTtl: ttl.Unix(),\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create dir if not exists\n\t_, err = os.Stat(f.Dir)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = os.MkdirAll(f.Dir, 0700)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Create temp file\n\ttf, err := ioutil.TempFile(f.Dir, \"temp-\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Write it out\n\t_, err = tf.Write(bo)\n\tif err != nil {\n\t\ttf.Close() // ignore failure\n\t\tos.Remove(tf.Name()) // ignore failure\n\t\treturn err\n\t}\n\n\t// Close it\n\terr = tf.Close()\n\tif err != nil {\n\t\tos.Remove(tf.Name()) // ignore failure\n\t\treturn err\n\t}\n\n\t// Rename to correct filename - while not guaranteed by Golang to be atomic, apparently POSIX does on *nix systems\n\terr = os.Rename(tf.Name(), filepath.Join(f.Dir, fnamePrefix+hex.EncodeToString(key)))\n\tif err != nil {\n\t\tos.Remove(tf.Name()) // ignore failure\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2de23316be0a3811e7bbd19ec5e5e40f", "score": "0.49500445", "text": "func (rcb *RouteCreateBulk) Save(ctx context.Context) ([]*Route, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(rcb.builders))\n\tnodes := make([]*Route, len(rcb.builders))\n\tmutators := make([]Mutator, len(rcb.builders))\n\tfor i := range rcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := rcb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*RouteMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, rcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\tspec := &sqlgraph.BatchCreateSpec{Nodes: specs}\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, rcb.driver, spec); err != nil {\n\t\t\t\t\t\tif sqlgraph.IsConstraintError(err) {\n\t\t\t\t\t\t\terr = &ConstraintError{err.Error(), err}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation.id = &nodes[i].ID\n\t\t\t\tmutation.done = true\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, rcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "1fb26919d841f9c45f30bc643537a9f5", "score": "0.49398175", "text": "func (s *stateDB) saveTask(ctx context.Context, task *tasks.AuthenticatedTask) error {\n\tdata, err := json.Marshal(task)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Not every db driver may support getting rows affected, so ignore results.\n\t_, err = s.db().ExecContext(ctx, insertTaskSQL, task.UUID, data, time.Now())\n\n\treturn err\n}", "title": "" }, { "docid": "db1bcf1f614763970af1c850d4538941", "score": "0.49193442", "text": "func (arch *Archiver) SaveTree(ctx context.Context, snPath string, atree *Tree, previous *restic.Tree) (*restic.Tree, error) {\n\tdebug.Log(\"%v (%v nodes), parent %v\", snPath, len(atree.Nodes), previous)\n\n\ttree := restic.NewTree()\n\n\tfutureNodes := make(map[string]FutureNode)\n\n\t// iterate over the nodes of atree in lexicographic (=deterministic) order\n\tnames := make([]string, 0, len(atree.Nodes))\n\tfor name := range atree.Nodes {\n\t\tnames = append(names, name)\n\t}\n\tsort.Strings(names)\n\n\tfor _, name := range names {\n\t\tsubatree := atree.Nodes[name]\n\n\t\t// test if context has been cancelled\n\t\tif ctx.Err() != nil {\n\t\t\treturn nil, ctx.Err()\n\t\t}\n\n\t\t// this is a leaf node\n\t\tif subatree.Path != \"\" {\n\t\t\tfn, excluded, err := arch.Save(ctx, join(snPath, name), subatree.Path, previous.Find(name))\n\n\t\t\tif err != nil {\n\t\t\t\terr = arch.error(subatree.Path, fn.fi, err)\n\t\t\t\tif err == nil {\n\t\t\t\t\t// ignore error\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif !excluded {\n\t\t\t\tfutureNodes[name] = fn\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tsnItem := join(snPath, name) + \"/\"\n\t\tstart := time.Now()\n\n\t\toldNode := previous.Find(name)\n\t\toldSubtree := arch.loadSubtree(ctx, oldNode)\n\n\t\t// not a leaf node, archive subtree\n\t\tsubtree, err := arch.SaveTree(ctx, join(snPath, name), &subatree, oldSubtree)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tid, nodeStats, err := arch.saveTree(ctx, subtree)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif subatree.FileInfoPath == \"\" {\n\t\t\treturn nil, errors.Errorf(\"FileInfoPath for %v/%v is empty\", snPath, name)\n\t\t}\n\n\t\tdebug.Log(\"%v, saved subtree %v as %v\", snPath, subtree, id.Str())\n\n\t\tfi, err := arch.statDir(subatree.FileInfoPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tdebug.Log(\"%v, dir node data loaded from %v\", snPath, subatree.FileInfoPath)\n\n\t\tnode, err := arch.nodeFromFileInfo(subatree.FileInfoPath, fi)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tnode.Name = name\n\t\tnode.Subtree = &id\n\n\t\terr = tree.Insert(node)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tarch.CompleteItem(snItem, oldNode, node, nodeStats, time.Since(start))\n\t}\n\n\tdebug.Log(\"waiting on %d nodes\", len(futureNodes))\n\n\t// process all futures\n\tfor name, fn := range futureNodes {\n\t\tfn.wait(ctx)\n\n\t\t// return the error, or ignore it\n\t\tif fn.err != nil {\n\t\t\tfn.err = arch.error(fn.target, fn.fi, fn.err)\n\t\t\tif fn.err == nil {\n\t\t\t\t// ignore error\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\treturn nil, fn.err\n\t\t}\n\n\t\t// when the error is ignored, the node could not be saved, so ignore it\n\t\tif fn.node == nil {\n\t\t\tdebug.Log(\"%v excluded: %v\", fn.snPath, fn.target)\n\t\t\tcontinue\n\t\t}\n\n\t\tfn.node.Name = name\n\n\t\terr := tree.Insert(fn.node)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn tree, nil\n}", "title": "" }, { "docid": "408f5d01a5fb7a9d260f1db41919a6fb", "score": "0.4918214", "text": "func (d *distributedSet) Save(t time.Duration) error {\n\tlock.Lock()\n\tdefer lock.Unlock()\n\td.exp = time.Now().Add(t)\n\td.members = append(d.members, d.adds...)\n\td.adds = nil\n\tdistributedSets[d.key] = d\n\td.once.Do(func() {\n\t\tsafe.GoRoutine(d.ttl)\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "1e52864298256cb3f0042b024b44015e", "score": "0.48576188", "text": "func WriteTasks(path string, taskList *model.TaskList) {\r\n\ttList, err := json.Marshal(taskList)\r\n\tif err != nil {\r\n\t\tfmt.Printf(\"err %v\", err)\r\n\t}\r\n\terr = ioutil.WriteFile(path, tList, 0644)\r\n\tif err != nil {\r\n\t\tfmt.Printf(\"err %v\", err)\r\n\t}\r\n}", "title": "" }, { "docid": "88f37d3b8c44bb1dd6316b1e778aebae", "score": "0.4820019", "text": "func (n *node) saveToStorage(hardState raftpb.HardState, entries []raftpb.Entry, snapshot raftpb.Snapshot) {\n\tn.store.Append(entries)\n\tif !raft.IsEmptyHardState(hardState) {\n\t\tn.store.SetHardState(hardState)\n\t}\n\tif !raft.IsEmptySnap(snapshot) {\n\t\tn.store.ApplySnapshot(snapshot)\n\t}\n}", "title": "" }, { "docid": "4f1c45b16ca1cf8dbdf5703519ed5107", "score": "0.47851464", "text": "func (rcb *ResourceCreateBulk) Save(ctx context.Context) ([]*Resource, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(rcb.builders))\n\tnodes := make([]*Resource, len(rcb.builders))\n\tmutators := make([]Mutator, len(rcb.builders))\n\tfor i := range rcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := rcb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*ResourceMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, rcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\tspec := &sqlgraph.BatchCreateSpec{Nodes: specs}\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, rcb.driver, spec); err != nil {\n\t\t\t\t\t\tif sqlgraph.IsConstraintError(err) {\n\t\t\t\t\t\t\terr = &ConstraintError{err.Error(), err}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation.id = &nodes[i].ID\n\t\t\t\tmutation.done = true\n\t\t\t\tif specs[i].ID.Value != nil {\n\t\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, rcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "4d46a0c33815cbe2f2c7e86ce07a6564", "score": "0.4776894", "text": "func (db *FlatDB) Save() {\n\tdb.Export(db.Path)\n}", "title": "" }, { "docid": "332718b6e3c87271e116ba64ec7b06ac", "score": "0.47571585", "text": "func (c *MemoryPersistence) Save(correlationId string) error {\n\tc.Lock.RLock()\n\tdefer c.Lock.RUnlock()\n\n\tif c.Saver == nil {\n\t\treturn nil\n\t}\n\n\terr := c.Saver.Save(correlationId, c.Items)\n\tif err == nil {\n\t\tlength := len(c.Items)\n\t\tc.Logger.Trace(correlationId, \"Saved %d items\", length)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "e5cd2b81041d65453ec91163e2cfb7c1", "score": "0.4750133", "text": "func (m *PlannerProgressTaskBoardTaskFormat) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {\n err := m.Entity.Serialize(writer)\n if err != nil {\n return err\n }\n {\n err = writer.WriteStringValue(\"orderHint\", m.GetOrderHint())\n if err != nil {\n return err\n }\n }\n return nil\n}", "title": "" }, { "docid": "7f984d11fd52e3bec3c6bd6cfc5d8148", "score": "0.4748863", "text": "func (t Task) HasChildren() bool {\n return t.NumChildren() > 0\n}", "title": "" }, { "docid": "4305a772065d8f4f686e6a08c78e66aa", "score": "0.47376293", "text": "func (rcb *ResourceCreateBulk) Save(ctx context.Context) ([]*Resource, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(rcb.builders))\n\tnodes := make([]*Resource, len(rcb.builders))\n\tmutators := make([]Mutator, len(rcb.builders))\n\tfor i := range rcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := rcb.builders[i]\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*ResourceMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, rcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\tspec := &sqlgraph.BatchCreateSpec{Nodes: specs}\n\t\t\t\t\tspec.OnConflict = rcb.conflict\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, rcb.driver, spec); err != nil {\n\t\t\t\t\t\tif sqlgraph.IsConstraintError(err) {\n\t\t\t\t\t\t\terr = &ConstraintError{err.Error(), err}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation.id = &nodes[i].ID\n\t\t\t\tmutation.done = true\n\t\t\t\tif specs[i].ID.Value != nil {\n\t\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, rcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "0c3ee5a8b094af54c7e7d26ef84b1b2f", "score": "0.47241238", "text": "func (t *Tree) saveTree() error {\n\ttreeByte, err := t.Nodes.MarshalJSON()\n\tif err != nil {\n\t\tt.logger.Errorf(\"Tree save fail: %s\\n\", err.Error())\n\t\treturn err\n\t}\n\t// TODO: purge cache or not\n\treturn t.node.Save(treeByte)\n}", "title": "" }, { "docid": "f892da82254a1fa85ce547a9a9ef4ded", "score": "0.47213393", "text": "func (icb *InfoCreateBulk) Save(ctx context.Context) ([]*Info, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(icb.builders))\n\tnodes := make([]*Info, len(icb.builders))\n\tmutators := make([]Mutator, len(icb.builders))\n\tfor i := range icb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := icb.builders[i]\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*InfoMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, icb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\tspec := &sqlgraph.BatchCreateSpec{Nodes: specs}\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, icb.driver, spec); err != nil {\n\t\t\t\t\t\tif sqlgraph.IsConstraintError(err) {\n\t\t\t\t\t\t\terr = &ConstraintError{msg: err.Error(), wrap: err}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation.id = &nodes[i].ID\n\t\t\t\tif specs[i].ID.Value != nil && nodes[i].ID == 0 {\n\t\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, icb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "aa539118f87c927137545bf9549409b8", "score": "0.47179922", "text": "func PersistTaskQueue(distro string, tasks []task.Task, distroQueueInfo model.DistroQueueInfo) error {\n\tstartAt := time.Now()\n\ttaskQueue := make([]model.TaskQueueItem, 0, len(tasks))\n\tfor _, t := range tasks {\n\t\t// Does this task have any dependencies?\n\t\tdependencies := make([]string, 0, len(t.DependsOn))\n\t\tfor _, d := range t.DependsOn {\n\t\t\tdependencies = append(dependencies, d.TaskId)\n\t\t}\n\t\ttaskQueue = append(taskQueue, model.TaskQueueItem{\n\t\t\tId: t.Id,\n\t\t\tDisplayName: t.DisplayName,\n\t\t\tBuildVariant: t.BuildVariant,\n\t\t\tRevisionOrderNumber: t.RevisionOrderNumber,\n\t\t\tRequester: t.Requester,\n\t\t\tRevision: t.Revision,\n\t\t\tProject: t.Project,\n\t\t\tExpectedDuration: t.ExpectedDuration,\n\t\t\tPriority: t.Priority,\n\t\t\tGroup: t.TaskGroup,\n\t\t\tGroupMaxHosts: t.TaskGroupMaxHosts,\n\t\t\tGroupIndex: t.TaskGroupOrder,\n\t\t\tVersion: t.Version,\n\t\t\tActivatedBy: t.ActivatedBy,\n\t\t\tDependencies: dependencies,\n\t\t})\n\t}\n\n\tqueue := model.NewTaskQueue(distro, taskQueue, distroQueueInfo)\n\terr := queue.Save()\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\t// track scheduled time for prioritized tasks\n\tif err := task.SetTasksScheduledTime(tasks, startAt); err != nil {\n\t\treturn errors.Wrapf(err, \"error setting scheduled time for prioritized tasks for distro '%s'\", distro)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e4145e971181b8c5999bee5877a0a1cc", "score": "0.47155955", "text": "func (t *TaskStorage) StoreTask(task Task, projectID int) error {\n\tdata := TaskDB{\n\t\tProjectID: projectID,\n\t\tTitle: task.Title,\n\t\tDeadline: task.Deadline,\n\t\tAssigned: task.Assigned,\n\t\tStatus: task.Status,\n\t}\n\terr := t.db.Save(&data)\n\tif err != nil {\n\t\tlog.Printf(\"Cannot save task: %s\", err.Error())\n\t}\n\treturn err\n}", "title": "" }, { "docid": "21934320dcc3267a18eb9f93c15abdd0", "score": "0.47139803", "text": "func (tcb *TenantCreateBulk) Save(ctx context.Context) ([]*Tenant, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(tcb.builders))\n\tnodes := make([]*Tenant, len(tcb.builders))\n\tmutators := make([]Mutator, len(tcb.builders))\n\tfor i := range tcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := tcb.builders[i]\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*TenantMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, tcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, tcb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif nodes[i].ID == 0 {\n\t\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\t\tnodes[i].ID = int64(id)\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, tcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "da2ee2b98fb9cce5eef4864b7037f139", "score": "0.470359", "text": "func saveCacheTaskGroup(taskGroup *types.TaskGroup) error {\n\tif !cacheMgr.isOK {\n\t\treturn nil\n\t}\n\n\tapp := getCacheAppNode(taskGroup.RunAs, taskGroup.AppID)\n\tif app == nil {\n\t\tblog.V(3).Infof(\"app(%s.%s) not in cache\", taskGroup.RunAs, taskGroup.AppID)\n\t\treturn nil\n\t}\n\n\ttmpData := taskGroup.DeepCopy()\n\tif app.Taskgroups == nil {\n\t\tblog.V(3).Infof(\"insert taskgroup(%s) in cache\", tmpData.ID)\n\t\tapp.Taskgroups = append(app.Taskgroups, tmpData)\n\t\treturn nil\n\t}\n\n\tisExist := false\n\tfor index, currTaskGroup := range app.Taskgroups {\n\t\tif currTaskGroup.ID == taskGroup.ID {\n\t\t\tblog.V(3).Infof(\"update taskgroup(%s) in cache\", taskGroup.ID)\n\t\t\tapp.Taskgroups[index] = tmpData\n\t\t\tisExist = true\n\t\t}\n\t}\n\n\tif !isExist {\n\t\tblog.V(3).Infof(\"insert taskgroup(%s) in cache\", tmpData.ID)\n\t\tapp.Taskgroups = append(app.Taskgroups, tmpData)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "aecdcd3f8a5cf58f859867bdb72ee0d1", "score": "0.47010422", "text": "func (nu *NodeUpdate) Save(ctx context.Context) (int, error) {\n\tif len(nu.parent) > 1 {\n\t\treturn 0, errors.New(\"ent: multiple assignments on a unique edge \\\"parent\\\"\")\n\t}\n\treturn nu.sqlSave(ctx)\n}", "title": "" }, { "docid": "2379f152e4f48ec6c770b5d52cf7c8d8", "score": "0.4684724", "text": "func (t *Task) ToSafe() safe.Task {\n\treturn safe.Task{\n\t\tPlugin: t.Plugin,\n\t\tNode: t.Node,\n\t\tDetails: t.Details,\n\t}\n}", "title": "" }, { "docid": "f57150179b6d25c7117a5f0321de7004", "score": "0.46837488", "text": "func (scb *StepCreateBulk) Save(ctx context.Context) ([]*Step, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(scb.builders))\n\tnodes := make([]*Step, len(scb.builders))\n\tmutators := make([]Mutator, len(scb.builders))\n\tfor i := range scb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := scb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*StepMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, scb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, scb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, scb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "f2a81fb18ac58043d5baba822323557e", "score": "0.4674943", "text": "func (m *Model) Save(path string) error {\n\tdata, err := serializer.SerializeAny(m.Block)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn ioutil.WriteFile(path, data, 0644)\n}", "title": "" }, { "docid": "e8a0d29b7b82af5be739cd89138c61c7", "score": "0.46740288", "text": "func (t *Tree) WriteToDisk() error {\n\tx := t.Root\n\t// Locate the leftmost leaf node.\n\tfor {\n\t\tif x.leaf {\n\t\t\tbreak\n\t\t}\n\t\tx = x.child[0]\n\t}\n\tfp, err := t.CreateDBFIle()\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar offset int64 = 0\n\tfor {\n\t\tfor _, v := range x.vals {\n\t\t\t// The length of the byte slice preceeds it in the file.\n\t\t\tw := []byte{byte(len(v))}\n\t\t\tw = append(w, v...)\n\t\t\tn, err := fp.Write(w)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\toffset += int64(n)\n\t\t}\n\t\toffset = AdjustOffset(offset)\n\t\tfp.Seek(offset, 0)\n\t\tif x.next == nil {\n\t\t\tbreak\n\t\t} else {\n\t\t\tx = x.next\n\t\t}\n\t}\n\tif err = fp.Sync(); err != nil {\n\t\treturn err\n\t}\n\tif err = fp.Close(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5952a3f59b4a2fdc309bf8c8f0dc5329", "score": "0.4669642", "text": "func (m *Manager) Save(id string) error {\n\treturn m.p.Save(id)\n}", "title": "" }, { "docid": "5fbfa5bfe30b8e2f85a8f24cfeef17c1", "score": "0.46677876", "text": "func (pcb *PersonCreateBulk) Save(ctx context.Context) ([]*Person, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(pcb.builders))\n\tnodes := make([]*Person, len(pcb.builders))\n\tmutators := make([]Mutator, len(pcb.builders))\n\tfor i := range pcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := pcb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*PersonMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, pcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\tspec := &sqlgraph.BatchCreateSpec{Nodes: specs}\n\t\t\t\t\tspec.OnConflict = pcb.conflict\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, pcb.driver, spec); err != nil {\n\t\t\t\t\t\tif sqlgraph.IsConstraintError(err) {\n\t\t\t\t\t\t\terr = &ConstraintError{err.Error(), err}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation.id = &nodes[i].ID\n\t\t\t\tmutation.done = true\n\t\t\t\tif specs[i].ID.Value != nil {\n\t\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, pcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "7f828c194ebbd8cd0cebdccbf33cfa2e", "score": "0.46634674", "text": "func (tdl *ToDoList) Save() {\n\tfile, _ := os.Create(tdl.path)\n\n\tencoder := json.NewEncoder(file)\n\n\tif err := encoder.Encode(&tdl); err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to encode JSON for ToDoList\"))\n\t}\n\n\tfile.Close()\n}", "title": "" }, { "docid": "424dae1c09dbc1d510fe0eb9c20b4cc3", "score": "0.46542636", "text": "func (h *Handler) Write() error {\n\tbytes, err := json.Marshal(&h.tasks)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tif err := ioutil.WriteFile(h.JSONPath, bytes, 0644); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "174f007094ffd04fa26de658e6d92c1b", "score": "0.46386713", "text": "func (iter *GraphIterator) Save(w io.Writer) {\n\t//Create and fill a save struct.\n\ts := new(save)\n\ts.N = iter.n\n\ts.A = iter.a\n\ts.M = iter.m\n\ts.First = iter.first\n\ts.G = iter.sg.G\n\ts.Choices = iter.choices\n\ts.CurrentPath = iter.currentPath\n\n\t//Encode the save struct using gob.\n\tenc := gob.NewEncoder(w)\n\terr := enc.Encode(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "6b30d4acb42ab8614c736f8e3e59c54f", "score": "0.4628159", "text": "func (mcb *MainingreCreateBulk) Save(ctx context.Context) ([]*Mainingre, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(mcb.builders))\n\tnodes := make([]*Mainingre, len(mcb.builders))\n\tmutators := make([]Mutator, len(mcb.builders))\n\tfor i := range mcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := mcb.builders[i]\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*MainingreMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, mcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, mcb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, mcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "d236a12982d58abfe8512f5723447adf", "score": "0.4606818", "text": "func (m *SecurityConfigurationTask) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {\n err := m.DeviceAppManagementTask.Serialize(writer)\n if err != nil {\n return err\n }\n if m.GetApplicablePlatform() != nil {\n cast := (*m.GetApplicablePlatform()).String()\n err = writer.WriteStringValue(\"applicablePlatform\", &cast)\n if err != nil {\n return err\n }\n }\n if m.GetEndpointSecurityPolicy() != nil {\n cast := (*m.GetEndpointSecurityPolicy()).String()\n err = writer.WriteStringValue(\"endpointSecurityPolicy\", &cast)\n if err != nil {\n return err\n }\n }\n if m.GetEndpointSecurityPolicyProfile() != nil {\n cast := (*m.GetEndpointSecurityPolicyProfile()).String()\n err = writer.WriteStringValue(\"endpointSecurityPolicyProfile\", &cast)\n if err != nil {\n return err\n }\n }\n {\n err = writer.WriteStringValue(\"insights\", m.GetInsights())\n if err != nil {\n return err\n }\n }\n if m.GetIntendedSettings() != nil {\n cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetIntendedSettings()))\n for i, v := range m.GetIntendedSettings() {\n if v != nil {\n cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)\n }\n }\n err = writer.WriteCollectionOfObjectValues(\"intendedSettings\", cast)\n if err != nil {\n return err\n }\n }\n {\n err = writer.WriteInt32Value(\"managedDeviceCount\", m.GetManagedDeviceCount())\n if err != nil {\n return err\n }\n }\n if m.GetManagedDevices() != nil {\n cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetManagedDevices()))\n for i, v := range m.GetManagedDevices() {\n if v != nil {\n cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)\n }\n }\n err = writer.WriteCollectionOfObjectValues(\"managedDevices\", cast)\n if err != nil {\n return err\n }\n }\n return nil\n}", "title": "" }, { "docid": "383d584ba9477b1bc4fbe4695d4da3c6", "score": "0.460627", "text": "func (r *Root) Save(file File) {\n\tr.Lock()\n\tr.files[file.Name()] = file\n\tr.Unlock()\n}", "title": "" }, { "docid": "768e66cc6149759fb149192ccb404844", "score": "0.4601904", "text": "func (container *Container) Save() error {\n\t// Use slice so loading can capture null, rather than the zero value.\n\tcontainers := []*Container{container}\n\tdat, err := json.MarshalIndent(containers, \"\", \" \")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.MkdirAll(boweryDir, os.ModePerm|os.ModeDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfile, err := os.OpenFile(storedContainerPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\t_, err = io.Copy(file, strings.NewReader(string(dat)))\n\treturn err\n}", "title": "" }, { "docid": "484117092fb369670e89c9824478b2de", "score": "0.4595408", "text": "func (g *TaskGraph) Parallelize(breakFn BreakFunc) {\n\tfor i := 0; i < len(g.Nodes); i++ {\n\t\tnode := g.Nodes[i]\n\t\tresults := breakFn(node.Tasks)\n\t\tif len(results) == 0 || (len(results) == 1 && len(results[0]) == 1) {\n\t\t\tcontinue\n\t\t}\n\t\tnode.Tasks = nil\n\t\tout := node.Out\n\t\tnode.Out = nil\n\n\t\t// starting with the left anchor, create chains of nodes,\n\t\t// and avoid M x N in/out connections by creating spacers\n\t\tin := []int{i}\n\t\tfor _, inNodes := range results {\n\t\t\tif len(inNodes) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsingleIn, singleOut := len(in) == 1, len(inNodes) == 1\n\n\t\t\tswitch {\n\t\t\tcase singleIn && singleOut, singleIn, singleOut:\n\t\t\t\tin = g.bulkAdd(inNodes, in)\n\t\t\tdefault:\n\t\t\t\tin = g.bulkAdd([]*TaskNode{{}}, in)\n\t\t\t\tin = g.bulkAdd(inNodes, in)\n\t\t\t}\n\t\t}\n\n\t\t// make node the left anchor and nextNode the right anchor\n\t\tif len(out) > 0 {\n\t\t\tnext := len(g.Nodes)\n\t\t\tnextNode := &TaskNode{\n\t\t\t\tTasks: nil,\n\t\t\t\tOut: out,\n\t\t\t}\n\t\t\tg.Nodes = append(g.Nodes, nextNode)\n\t\t\tfor _, j := range out {\n\t\t\t\tg.Nodes[j].replaceIn(i, next)\n\t\t\t}\n\t\t\tfor _, j := range in {\n\t\t\t\tg.Nodes[j].Out = []int{next}\n\t\t\t\tnextNode.In = append(nextNode.In, j)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f0e7dc00eb9f22397d9065a4467d75ba", "score": "0.4589873", "text": "func (m *etcdMinion) SaveTaskResult(t *task.Task) error {\n\ttaskKey := filepath.Join(m.logDir, t.TaskID.String())\n\n\tdata, err := json.Marshal(t)\n\tif err != nil {\n\t\tlog.Printf(\"Failed to serialize task %s: %s\\n\", t.TaskID, err)\n\t\treturn err\n\t}\n\n\topts := &etcdclient.SetOptions{\n\t\tPrevExist: etcdclient.PrevIgnore,\n\t}\n\n\t_, err = m.kapi.Set(context.Background(), taskKey, string(data), opts)\n\tif err != nil {\n\t\tlog.Printf(\"Failed to save task %s: %s\\n\", t.TaskID, err)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "19b9bb3e813ddc13050550e1fcf481b4", "score": "0.45676467", "text": "func (m *Todo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {\n err := m.Entity.Serialize(writer)\n if err != nil {\n return err\n }\n if m.GetLists() != nil {\n cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLists()))\n for i, v := range m.GetLists() {\n if v != nil {\n cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)\n }\n }\n err = writer.WriteCollectionOfObjectValues(\"lists\", cast)\n if err != nil {\n return err\n }\n }\n return nil\n}", "title": "" }, { "docid": "192a23a10deca386cd5be0d0088d0726", "score": "0.4560488", "text": "func (arch *Archiver) saveTree(ctx context.Context, t *restic.Tree) (restic.ID, ItemStats, error) {\n\tvar s ItemStats\n\tbuf, err := json.Marshal(t)\n\tif err != nil {\n\t\treturn restic.ID{}, s, errors.Wrap(err, \"MarshalJSON\")\n\t}\n\n\t// append a newline so that the data is always consistent (json.Encoder\n\t// adds a newline after each object)\n\tbuf = append(buf, '\\n')\n\n\tb := &Buffer{Data: buf}\n\tres := arch.blobSaver.Save(ctx, restic.TreeBlob, b)\n\n\tres.Wait(ctx)\n\tif !res.Known() {\n\t\ts.TreeBlobs++\n\t\ts.TreeSize += uint64(len(buf))\n\t}\n\treturn res.ID(), s, nil\n}", "title": "" }, { "docid": "1d47efe1a66cc3d37ed6322967c7d370", "score": "0.45536694", "text": "func (ecb *EmptyCreateBulk) Save(ctx context.Context) ([]*Empty, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(ecb.builders))\n\tnodes := make([]*Empty, len(ecb.builders))\n\tmutators := make([]Mutator, len(ecb.builders))\n\tfor i := range ecb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := ecb.builders[i]\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*EmptyMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, ecb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\tspec := &sqlgraph.BatchCreateSpec{Nodes: specs}\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, ecb.driver, spec); err != nil {\n\t\t\t\t\t\tif sqlgraph.IsConstraintError(err) {\n\t\t\t\t\t\t\terr = &ConstraintError{err.Error(), err}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation.id = &nodes[i].ID\n\t\t\t\tmutation.done = true\n\t\t\t\tif specs[i].ID.Value != nil {\n\t\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, ecb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "46818450af01f457114973901e0d5013", "score": "0.4547917", "text": "func (c *FileCache) Save() error {\n\tc.CacheProperties.m.RLock()\n\tdefer c.CacheProperties.m.RUnlock()\n\terr := os.MkdirAll(filepath.Dir(c.File), 0600)\n\tif err != nil {\n\t\treturn utils.WithStack(err)\n\t}\n\tif c != nil {\n\t\terr := utils.EncodeFile(c.File, c)\n\t\tif err != nil {\n\t\t\treturn utils.WithStack(err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9099c50d73664059135917181ca5c5bf", "score": "0.45320377", "text": "func (ps *ProjectStack) Save(path string) error {\n\tcontract.Require(path != \"\", \"path\")\n\tcontract.Require(ps != nil, \"ps\")\n\n\tm, err := marshallerForPath(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tb, err := m.Marshal(ps)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {\n\t\treturn err\n\t}\n\n\treturn ioutil.WriteFile(path, b, 0644)\n}", "title": "" }, { "docid": "7fb1436a88a78f408230f606b5c6665f", "score": "0.45319626", "text": "func (store *InMemoryPlantStore) Save(plant *pb.Plant) error {\n\n\t// Lock locks store.\n\t// If the lock is already in use, the calling goroutine blocks until the mutex is available.\n\tstore.mutex.Lock()\n\t// Unlock unlocks store.\n\t// It is a run-time error if m is not locked on entry to Unlock.\n\tdefer store.mutex.Unlock()\n\n\tif store.data[plant.Id] != nil {\n\t\treturn ErrAlreadyExists\n\t}\n\n\tother := &pb.Plant{}\n\terr := copier.Copy(other, plant)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[ERROR] While, Copying plant data: %v\", err)\n\t}\n\tstore.data[other.Id] = other\n\treturn nil\n\n}", "title": "" }, { "docid": "e06bb1c2e3e81354f5631a368074b825", "score": "0.45307457", "text": "func (t *Task) ToJSON() ([]byte, error) {\n\treturn json.Marshal(t)\n}", "title": "" }, { "docid": "2f0bbf764878e8669eefeef705ac5514", "score": "0.45075926", "text": "func (s *State) Save() ([]byte, error) {\n\t// sync nonces to disk\n\ts.nonces.Save()\n\n\t// write the merkle tree updates to disk\n\trootHash := s.saveAccountsAndTally()\n\n\t// save the rootHash\n\ts.db.Set(StateKey, rootHash)\n\n\treturn rootHash, nil\n}", "title": "" }, { "docid": "97feda324195d6b1669e3130db8d2096", "score": "0.45029834", "text": "func (pcb *ProjectCreateBulk) Save(ctx context.Context) ([]*Project, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(pcb.builders))\n\tnodes := make([]*Project, len(pcb.builders))\n\tmutators := make([]Mutator, len(pcb.builders))\n\tfor i := range pcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := pcb.builders[i]\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tif err := builder.preSave(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation, ok := m.(*ProjectMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, pcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, pcb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, pcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "4695b9592661e633db9968c25f0f5752", "score": "0.44981003", "text": "func (mcb *ModelCreateBulk) Save(ctx context.Context) ([]*Model, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(mcb.builders))\n\tnodes := make([]*Model, len(mcb.builders))\n\tmutators := make([]Mutator, len(mcb.builders))\n\tfor i := range mcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := mcb.builders[i]\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*ModelMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, mcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\tspec := &sqlgraph.BatchCreateSpec{Nodes: specs}\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, mcb.driver, spec); err != nil {\n\t\t\t\t\t\tif sqlgraph.IsConstraintError(err) {\n\t\t\t\t\t\t\terr = &ConstraintError{msg: err.Error(), wrap: err}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation.id = &nodes[i].ID\n\t\t\t\tif specs[i].ID.Value != nil {\n\t\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, mcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "67aace7d03ea311de866f4c1f9ea5e95", "score": "0.44941905", "text": "func (o *employeeInfoBase) Save(ctx context.Context) {\n\tif o._restored {\n\t\to.update(ctx)\n\t} else {\n\t\to.insert(ctx)\n\t}\n}", "title": "" }, { "docid": "c41b18eaf2b1ae56d4e713a0d2157cde", "score": "0.44897982", "text": "func (m Mapper) MustSet(child Predicate, all bool, obj DNode) Mapper {\n\tif checkNil(obj) {\n\t\t//TODO: what should actually happen here?\n\t\t//panic for now.\n\t\tpanic(\"mapper MustSet nil value\")\n\t}\n\tobj.Recurse(0)\n\tvar err error\n\tif all {\n\t\tif val, ok := obj.(Saver); ok {\n\t\t\tm[string(child)], err = val.Save()\n\t\t\tif err != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t} else {\n\t\t\tm[string(child)] = obj\n\t\t}\n\t} else {\n\t\tm[string(child)] = Uid(obj.UID())\n\t}\n\treturn m\n}", "title": "" }, { "docid": "aae2d7b65f6e767b56cf5a03544927cb", "score": "0.44858193", "text": "func (hw *Homework) Save() error {\n\tfor _, item := range hw.Items {\n\t\tif err := item.Save(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cdf03c0fb4ad4dd15e96d5c47e09f92f", "score": "0.44751543", "text": "func (store *InvocationStore) Save(inv dawdle.Invocation) error {\n\tvar exists bool\n\n\tinv.Mark(timestamps.Created)\n\n\tfor i := range store.invocations {\n\t\tif inv.ID == store.invocations[i].ID {\n\t\t\tstore.invocations[i] = inv\n\t\t\texists = true\n\t\t}\n\t}\n\n\tif !exists {\n\t\tstore.mux.Lock()\n\t\tstore.invocations = append(store.invocations, inv)\n\t\tstore.byTaskID[inv.TaskID] = append(store.byTaskID[inv.TaskID], len(store.invocations)-1)\n\t\tstore.mux.Unlock()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4862a811d71352271f223d0bec1d0913", "score": "0.44730303", "text": "func (ss *SpriteSet) Save() error {\n\tif !ss.IsModified() {\n\t\treturn nil\n\t}\n\t// Seek to the beginning of the file\n\t_, err := ss.file.Seek(0, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// clear the contents of the file\n\terr = ss.file.Truncate(0)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// write out the new contents to the file\n\tenc := json.NewEncoder(ss.file)\n\tenc.SetIndent(\"\", \"\\t\")\n\tif err := enc.Encode(ss); err != nil {\n\t\treturn err\n\t}\n\tfor i, s := range ss.Sprites {\n\t\ts.modified = false\n\t\tss.Sprites[i] = s\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c4af8d6f46dc08fb05135038db6d4188", "score": "0.4460217", "text": "func (b *Builder) Execute(t *Task) {\n\tlog.Printf(\"builder.Execute %s\", t.ID)\n\tb.lock.Lock()\n\tsig := string(t.Signature)\n\tif b.artifacts[sig] != nil {\n\t\tlog.Printf(\"Task %s already done. Applying Artifact instead\", t.ID)\n\t}\n\top := b.operations[t.GetID()]\n\tb.lock.Unlock()\n\tt.Variables.Set(\"_TASK_ID\", t.ID)\n\ta := op(t.Variables)\n\tb.lock.Lock()\n\tb.artifacts[string(t.Signature)] = a\n\tt.MarkDone()\n\tb.lock.Unlock()\n}", "title": "" }, { "docid": "b8098687f80f56656650ad3582d43aab", "score": "0.44585717", "text": "func (m *ManifoldYaml) Save() error {\n\tyml, err := yaml.Marshal(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpath := m.Path\n\tif path == \"\" {\n\t\t// Set the yaml in the current directory if path is not known\n\t\twd, err := os.Getwd()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpath = filepath.Join(wd, YamlFilename)\n\t}\n\terr = ioutil.WriteFile(path, yml, requiredPermissions)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2201cc20e1651f570c70457d110cba0c", "score": "0.44553688", "text": "func (t *RWTransaction) spill() error {\n\t// Keep track of the current root nodes.\n\t// We will update this at the end once all nodes are created.\n\ttype root struct {\n\t\tnode *node\n\t\tpgid pgid\n\t}\n\tvar roots []root\n\n\t// Sort nodes by highest depth first.\n\tnodes := make(nodesByDepth, 0, len(t.nodes))\n\tfor _, n := range t.nodes {\n\t\tnodes = append(nodes, n)\n\t}\n\tsort.Sort(nodes)\n\n\t// Spill nodes by deepest first.\n\tfor i := 0; i < len(nodes); i++ {\n\t\tn := nodes[i]\n\n\t\t// Save existing root buckets for later.\n\t\tif n.parent == nil && n.pgid != 0 {\n\t\t\troots = append(roots, root{n, n.pgid})\n\t\t}\n\n\t\t// Split nodes into appropriate sized nodes.\n\t\t// The first node in this list will be a reference to n to preserve ancestry.\n\t\tnewNodes := n.split(t.db.pageSize)\n\t\tt.pending = newNodes\n\n\t\t// If this is a root node that split then create a parent node.\n\t\tif n.parent == nil && len(newNodes) > 1 {\n\t\t\tn.parent = &node{transaction: t, isLeaf: false}\n\t\t\tnodes = append(nodes, n.parent)\n\t\t}\n\n\t\t// Add node's page to the freelist.\n\t\tif n.pgid > 0 {\n\t\t\tt.db.freelist.free(t.id(), t.page(n.pgid))\n\t\t}\n\n\t\t// Write nodes to dirty pages.\n\t\tfor i, newNode := range newNodes {\n\t\t\t// Allocate contiguous space for the node.\n\t\t\tp, err := t.allocate((newNode.size() / t.db.pageSize) + 1)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Write the node to the page.\n\t\t\tnewNode.write(p)\n\t\t\tnewNode.pgid = p.id\n\t\t\tnewNode.parent = n.parent\n\n\t\t\t// The first node should use the existing entry, other nodes are inserts.\n\t\t\tvar oldKey []byte\n\t\t\tif i == 0 {\n\t\t\t\toldKey = n.key\n\t\t\t} else {\n\t\t\t\toldKey = newNode.inodes[0].key\n\t\t\t}\n\n\t\t\t// Update the parent entry.\n\t\t\tif newNode.parent != nil {\n\t\t\t\tnewNode.parent.put(oldKey, newNode.inodes[0].key, nil, newNode.pgid)\n\t\t\t}\n\t\t}\n\n\t\tt.pending = nil\n\t}\n\n\t// Update roots with new roots.\n\tfor _, root := range roots {\n\t\tt.buckets.updateRoot(root.pgid, root.node.root().pgid)\n\t}\n\n\t// Clear out nodes now that they are all spilled.\n\tt.nodes = make(map[pgid]*node)\n\n\treturn nil\n}", "title": "" }, { "docid": "e3d90a4cbb0769135b15483fc5ab3a97", "score": "0.44552258", "text": "func (fs *fileSystemStore) Save(lead Lead) error {\n\tfs.mux.Lock()\n\tdefer fs.mux.Unlock()\n\n\tlead.ID = uint(len(fs.leads) + 1)\n\tlead.CreatedAt = time.Now()\n\n\tfs.leads = append(fs.leads, lead)\n\tfs.fdEncoder.Encode(fs.leads)\n\treturn nil\n}", "title": "" }, { "docid": "cab74b53e4a14f301f248c4e112182d0", "score": "0.44545642", "text": "func (w *DiskStorage) Save(h pb.HardState, es []pb.Entry, snap pb.Snapshot) error {\n\tbatch := w.db.NewWriteBatch()\n\tdefer batch.Cancel()\n\n\tif err := w.addEntries(batch, es); err != nil {\n\t\treturn err\n\t}\n\tif err := w.setHardState(batch, h); err != nil {\n\t\treturn err\n\t}\n\tif err := w.setSnapshot(batch, snap); err != nil {\n\t\treturn err\n\t}\n\treturn batch.Flush()\n}", "title": "" }, { "docid": "cbea0704a2f2e9f592b7ec18215e9511", "score": "0.4454012", "text": "func (m *FileSync) Save() error {\n\treturn Db().Save(m).Error\n}", "title": "" }, { "docid": "397c1b3fb35c1c35abc913cf7c26a521", "score": "0.4449925", "text": "func (m Mapper) Set(child Predicate, all bool, obj DNode) Mapper {\n\tif checkNil(obj) {\n\t\t//TODO: what should actually happen here?\n\t\treturn m\n\t}\n\tvar err error\n\tobj.Recurse(0)\n\tif all {\n\t\tif val, ok := obj.(Saver); ok {\n\t\t\tm[string(child)], err = val.Save()\n\t\t\tif err != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t} else {\n\t\t\tm[string(child)] = obj\n\t\t}\n\t} else {\n\t\t//Default is only a uid edge. -> {\"uid\": \"uid\"}\n\t\tm[string(child)] = Uid(obj.UID())\n\t}\n\treturn m\n}", "title": "" }, { "docid": "8cda8a02d80ccc3dfb0a8f0949b42ef3", "score": "0.44475707", "text": "func (self *Group) SetAllChildren4O(key string, value interface{}, checkAlive bool, checkVisible bool, operation int, force bool) {\n self.Object.Call(\"setAllChildren\", key, value, checkAlive, checkVisible, operation, force)\n}", "title": "" }, { "docid": "2e3e92d9e9ea3086b587811cdf74e376", "score": "0.44467342", "text": "func (icb *IPCreateBulk) Save(ctx context.Context) ([]*IP, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(icb.builders))\n\tnodes := make([]*IP, len(icb.builders))\n\tmutators := make([]Mutator, len(icb.builders))\n\tfor i := range icb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := icb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*IPMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, icb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, icb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, icb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "f692c837578bbf18162055d354a01ace", "score": "0.44458455", "text": "func (bicb *BlockInstanceCreateBulk) Save(ctx context.Context) ([]*BlockInstance, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(bicb.builders))\n\tnodes := make([]*BlockInstance, len(bicb.builders))\n\tmutators := make([]Mutator, len(bicb.builders))\n\tfor i := range bicb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := bicb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*BlockInstanceMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, bicb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, bicb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, bicb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "a68db0c16a48f6619f9c24b2711aa3cb", "score": "0.4445113", "text": "func (m *PlannerUser) SetTasks(value []PlannerTaskable)() {\n err := m.GetBackingStore().Set(\"tasks\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "c881672c1786b85e0d591433448a5f6b", "score": "0.444108", "text": "func (nn *NN) Save(path string) error {\n\tlock.Lock()\n\tdefer lock.Unlock()\n\tf, err := os.Create(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tr, err := marshal(nn)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = io.Copy(f, r)\n\treturn err\n}", "title": "" }, { "docid": "99ad3b741e9e254e044933f40614d8bb", "score": "0.44405454", "text": "func (p *BasicPath) SavePath(valid bool, ds []interface{}) error {\n\tp.Valid = valid\n\tif !valid {\n\t\treturn nil\n\t}\n\n\tn := len(ds)\n\tif n < 1 {\n\t\treturn nil\n\t}\n\n\tne := n / 2\n\tp.Vertices = make([]BasicVertex, ne+1)\n\tif ne > 0 {\n\t\tp.Edges = make([]BasicEdge, ne)\n\t}\n\n\ti, j := 0, 0\n\tfor i < ne {\n\t\terr := p.Vertices[i].Scan(ds[j])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = p.Edges[i].Scan(ds[j+1])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\ti, j = i+1, j+2\n\t}\n\tp.Vertices[i].Scan(ds[j])\n\n\treturn nil\n}", "title": "" }, { "docid": "1c23128e33aed17d38b6b3ada5307c18", "score": "0.44397408", "text": "func (t *Task) DataMapper() TaskDataMapper {\n return t.persist\n}", "title": "" }, { "docid": "b84453a8606327c9705e2827ae8d6365", "score": "0.44341987", "text": "func (t *Tombstone) Write() error {\n\t// one write at a time\n\tt.fileLock.Lock()\n\tdefer t.fileLock.Unlock()\n\n\terr := os.MkdirAll(t.Graveyard, os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// does not exit\n\tfile, err := os.Create(t.Path())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create tombstone file: %v\", err)\n\t}\n\tdefer file.Close()\n\n\tpretty, err := yaml.Marshal(t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to marshal tombstone yaml: %v\", err)\n\t}\n\tfile.Write(pretty)\n\treturn nil\n}", "title": "" }, { "docid": "126dc9638f4f17092937c519c4ae4d00", "score": "0.44341695", "text": "func (tcb *TransactionCreateBulk) Save(ctx context.Context) ([]*Transaction, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(tcb.builders))\n\tnodes := make([]*Transaction, len(tcb.builders))\n\tmutators := make([]Mutator, len(tcb.builders))\n\tfor i := range tcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := tcb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*TransactionMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, tcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, tcb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, tcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "c5a85e5a322f96c0d019093fb309fdce", "score": "0.44293293", "text": "func (oicb *OrderInfoCreateBulk) Save(ctx context.Context) ([]*OrderInfo, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(oicb.builders))\n\tnodes := make([]*OrderInfo, len(oicb.builders))\n\tmutators := make([]Mutator, len(oicb.builders))\n\tfor i := range oicb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := oicb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*OrderInfoMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, oicb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, oicb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, oicb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "b02651b2b86256fc7b46bf3ce6ada599", "score": "0.44247133", "text": "func (nuo *NodeUpdateOne) Save(ctx context.Context) (*Node, error) {\n\tif len(nuo.parent) > 1 {\n\t\treturn nil, errors.New(\"ent: multiple assignments on a unique edge \\\"parent\\\"\")\n\t}\n\treturn nuo.sqlSave(ctx)\n}", "title": "" }, { "docid": "d47bc31f53edb7acc288127ac14ad03e", "score": "0.44234267", "text": "func (pcb *PageCreateBulk) Save(ctx context.Context) ([]*Page, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(pcb.builders))\n\tnodes := make([]*Page, len(pcb.builders))\n\tmutators := make([]Mutator, len(pcb.builders))\n\tfor i := range pcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := pcb.builders[i]\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tif err := builder.preSave(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation, ok := m.(*PageMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, pcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, pcb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, pcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "f928169ac62d87130d39190825366573", "score": "0.44154707", "text": "func (b *Base) Save(actor int64) bool {\n\trecords := M.SX{\n\t\t`id`: b.Id,\n\t\t`data`: b.MapToData(),\n\t}\n\tif b.UniqueId.Valid {\n\t\trecords[`unique_id`] = b.UniqueId.String\n\t}\n\tid := b.Connection.DoUpsert(actor, b.Table, records)\n\tif id == 0 {\n\t\treturn false\n\t}\n\tb.Id = id\n\treturn true\n}", "title": "" }, { "docid": "4062f59fe807fd72ad4d97609347b626", "score": "0.43934977", "text": "func (acb *AppointmentCreateBulk) Save(ctx context.Context) ([]*Appointment, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(acb.builders))\n\tnodes := make([]*Appointment, len(acb.builders))\n\tmutators := make([]Mutator, len(acb.builders))\n\tfor i := range acb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := acb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*AppointmentMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, acb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, acb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, acb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "62c52217e5211b3406f9c728c4880a89", "score": "0.43911228", "text": "func (s *Store) Save(todo Todo) error {\n\tin, err := dynamodbattribute.MarshalMap(todo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = s.db.PutItem(&dynamodb.PutItemInput{\n\t\tItem: in,\n\t\tTableName: aws.String(s.tableName),\n\t})\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ebf6c28ac2541fe6ffe827d27a301133", "score": "0.43881655", "text": "func (s *FileBackedStorage) Save() error {\n\treturn saveFile(s.filename, s.data)\n}", "title": "" }, { "docid": "6719704d1268db42cf3d3045811886e7", "score": "0.4387161", "text": "func (this *Block) Persist() bool {\n\tlog.Infof(\"Persisting block %s to disk\", this.IdStr())\n\n\t// Prepare folder\n\tthis.PrepareFolder()\n\n\t// Shards to disk\n\tfor _, shard := range this.DataShards {\n\t\tshard.Persist()\n\t}\n\tfor _, shard := range this.ParityShards {\n\t\tshard.Persist()\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "3971ca85e48809fed01512dadf3eada7", "score": "0.43785766", "text": "func BranchOut(ctx context.Context, task *queue.Task, t *tree.Tree, ps *PruningStrategy) (tasks []*queue.Task, e error) {\n\tprediction, err := tree.NewPredictionFromSet(ctx, task.Set, t.ClassFeature)\n\tif err != nil {\n\t\tif err != tree.ErrCannotPredictFromEmptySet {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tdefer func() {\n\t\terr = t.NodeStore.Store(ctx, task.Node)\n\t\tif e == nil {\n\t\t\te = err\n\t\t}\n\t}()\n\ttask.Node.Prediction = prediction\n\tsEntropy, err := task.Set.Entropy(ctx, t.ClassFeature)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(task.AvailableFeatures) == 0 || sEntropy <= ps.MinimumEntropy {\n\t\treturn nil, nil\n\t}\n\tvar selectedPartition *Partition\n\tvar featureIndex int\n\tfor i, f := range task.AvailableFeatures {\n\t\tpart, err := partition(ctx, task.Set, f, t.ClassFeature, ps)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif selectedPartition == nil || (part != nil && part.informationGain > selectedPartition.informationGain) {\n\t\t\tselectedPartition = part\n\t\t\tfeatureIndex = i\n\t\t}\n\t}\n\tif selectedPartition == nil {\n\t\treturn nil, nil\n\t}\n\ttask.Node.SubtreeFeature = selectedPartition.Feature\n\tstAvailableFeatures := make([]feature.Feature, 0, len(task.AvailableFeatures)-1)\n\tfor fi, sf := range task.AvailableFeatures {\n\t\tif fi != featureIndex {\n\t\t\tstAvailableFeatures = append(stAvailableFeatures, sf)\n\t\t}\n\t}\n\tstNodeIDs := make([]string, 0, len(selectedPartition.Tasks))\n\tfor _, st := range selectedPartition.Tasks {\n\t\tst.Node.ParentID = task.Node.ID\n\t\terr = t.NodeStore.Create(ctx, st.Node)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tstNodeIDs = append(stNodeIDs, st.Node.ID)\n\t\tst.AvailableFeatures = stAvailableFeatures\n\t}\n\ttask.Node.SubtreeIDs = stNodeIDs\n\treturn selectedPartition.Tasks, nil\n}", "title": "" }, { "docid": "b458dcb028c232abb14bcfa4fba506a0", "score": "0.4375661", "text": "func (cicb *ConfigItemCreateBulk) Save(ctx context.Context) ([]*ConfigItem, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(cicb.builders))\n\tnodes := make([]*ConfigItem, len(cicb.builders))\n\tmutators := make([]Mutator, len(cicb.builders))\n\tfor i := range cicb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := cicb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*ConfigItemMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, cicb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\tspec := &sqlgraph.BatchCreateSpec{Nodes: specs}\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, cicb.driver, spec); err != nil {\n\t\t\t\t\t\tif sqlgraph.IsConstraintError(err) {\n\t\t\t\t\t\t\terr = &ConstraintError{msg: err.Error(), wrap: err}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation.id = &nodes[i].ID\n\t\t\t\tif specs[i].ID.Value != nil {\n\t\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, cicb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "6a353f30160fddd708646761dad24405", "score": "0.43754074", "text": "func (s Serializer) Save(v any, path string) error {\n\tf, err := osCreate(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\treturn s.WriteTo(v, f)\n}", "title": "" }, { "docid": "6f6dd972e5807cd0f3f5f272a6ed1c16", "score": "0.4372313", "text": "func Save(cfg any, file string) error {\n\treturn toml.Save(cfg, file)\n}", "title": "" }, { "docid": "33b2405aa19630a5dc77c4da54f3f83b", "score": "0.4371977", "text": "func (arch *Archiver) SaveFile(p *Progress, node *Node) (Blobs, error) {\n\tfile, err := os.Open(node.path)\n\tdefer file.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// check file again\n\tfi, err := file.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif fi.ModTime() != node.ModTime {\n\t\te2 := arch.Error(node.path, fi, errors.New(\"file was updated, using new version\"))\n\n\t\tif e2 == nil {\n\t\t\t// create new node\n\t\t\tn, err := NodeFromFileInfo(node.path, fi)\n\t\t\tif err != nil {\n\t\t\t\tdebug.Log(\"Archiver.SaveFile\", \"NodeFromFileInfo returned error for %v: %v\", node.path, err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// copy node\n\t\t\t*node = *n\n\t\t}\n\t}\n\n\tvar blobs Blobs\n\n\t// store all chunks\n\tchnker := GetChunker(\"archiver.SaveFile\")\n\tchnker.Reset(file)\n\tchans := [](<-chan Blob){}\n\tdefer FreeChunker(\"archiver.SaveFile\", chnker)\n\n\tchunks := 0\n\n\tfor {\n\t\tchunk, err := chnker.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn nil, arrar.Annotate(err, \"SaveFile() chunker.Next()\")\n\t\t}\n\n\t\tchunks++\n\n\t\t// acquire token, start goroutine to save chunk\n\t\ttoken := <-arch.blobToken\n\t\tresCh := make(chan Blob, 1)\n\n\t\tgo func(ch chan<- Blob) {\n\t\t\tblob, err := arch.Save(backend.Data, chunk.Digest, chunk.Length, chunk.Reader(file))\n\t\t\t// TODO handle error\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tp.Report(Stat{Bytes: blob.Size})\n\t\t\tarch.blobToken <- token\n\t\t\tch <- blob\n\t\t}(resCh)\n\n\t\tchans = append(chans, resCh)\n\t}\n\n\tblobs = []Blob{}\n\tfor _, ch := range chans {\n\t\tblobs = append(blobs, <-ch)\n\t}\n\n\tif len(blobs) != chunks {\n\t\treturn nil, fmt.Errorf(\"chunker returned %v chunks, but only %v blobs saved\", chunks, len(blobs))\n\t}\n\n\tvar bytes uint64\n\n\tnode.Content = make([]backend.ID, len(blobs))\n\tdebug.Log(\"Archiver.Save\", \"checking size for file %s\", node.path)\n\tfor i, blob := range blobs {\n\t\tnode.Content[i] = blob.ID\n\t\tbytes += blob.Size\n\n\t\tdebug.Log(\"Archiver.Save\", \" adding blob %s\", blob)\n\t}\n\n\tif bytes != node.Size {\n\t\treturn nil, fmt.Errorf(\"errors saving node %q: saved %d bytes, wanted %d bytes\", node.path, bytes, node.Size)\n\t}\n\n\tdebug.Log(\"Archiver.SaveFile\", \"SaveFile(%q): %v\\n\", node.path, blobs)\n\n\treturn blobs, nil\n}", "title": "" }, { "docid": "023b733cf42cf5523330f14f30a1b4c1", "score": "0.43700996", "text": "func (c *cloneTask) Write(fid *srv.FFid, data []byte, offset uint64) (int, error) {\n\tc.Lock()\n\tdefer c.Unlock()\n\ttask := &tasks.Task{Title: string(data)}\n\ttask, err := tasks.NewTasksService(c.service).Insert(c.list.list.Id, task).Do()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tt, err := c.list.addTask(task)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tc.list.tasks[task.Id] = t\n\treturn len(data), nil\n}", "title": "" }, { "docid": "f8f9e3b520f7ded4e4e1caf3ba4b3b77", "score": "0.43693906", "text": "func (pcb *ParticipationCreateBulk) Save(ctx context.Context) ([]*Participation, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(pcb.builders))\n\tnodes := make([]*Participation, len(pcb.builders))\n\tmutators := make([]Mutator, len(pcb.builders))\n\tfor i := range pcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := pcb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*ParticipationMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, pcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, pcb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, pcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "8e737db6ef7be74b0f3f2d933138daa7", "score": "0.43669933", "text": "func (transaction *Transaction) Save(i interface{}) error {\n\treturn transaction.storm.saveEntity(i, transaction)\n}", "title": "" }, { "docid": "495b0f12a74e735105eaf22810864fdb", "score": "0.4360932", "text": "func (pvcb *PlaylistVideoCreateBulk) Save(ctx context.Context) ([]*Playlist_Video, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(pvcb.builders))\n\tnodes := make([]*Playlist_Video, len(pvcb.builders))\n\tmutators := make([]Mutator, len(pvcb.builders))\n\tfor i := range pvcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := pvcb.builders[i]\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tif err := builder.preSave(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation, ok := m.(*PlaylistVideoMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, pvcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, pvcb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {\n\t\t\t\t\t\tif cerr, ok := isSQLConstraintError(err); ok {\n\t\t\t\t\t\t\terr = cerr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, pvcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" } ]
e6d97d84705c7212d7e8d3436f9126c9
NewGovernableFilterer creates a new log filterer instance of Governable, bound to a specific deployed contract.
[ { "docid": "5393e3ddc8d980d983c60e2fcdf1780b", "score": "0.7569852", "text": "func NewGovernableFilterer(address common.Address, filterer bind.ContractFilterer) (*GovernableFilterer, error) {\n\tcontract, err := bindGovernable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &GovernableFilterer{contract: contract}, nil\n}", "title": "" } ]
[ { "docid": "4ccf0bafbbd850143dd368c532179e34", "score": "0.62063056", "text": "func NewGovernable(address common.Address, backend bind.ContractBackend) (*Governable, error) {\n\tcontract, err := bindGovernable(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Governable{GovernableCaller: GovernableCaller{contract: contract}, GovernableTransactor: GovernableTransactor{contract: contract}, GovernableFilterer: GovernableFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "2a22e6ae24c1c25c67e4a198f9da85c9", "score": "0.5653527", "text": "func NewGovernableCaller(address common.Address, caller bind.ContractCaller) (*GovernableCaller, error) {\n\tcontract, err := bindGovernable(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &GovernableCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "4ce0559efc46fe7172e90beaceaf7acc", "score": "0.5649051", "text": "func bindGovernable(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(GovernableABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}", "title": "" }, { "docid": "b79a4232111687a443d8fb94112e881e", "score": "0.56093603", "text": "func NewFilterer(f func(ptr interface{}) error) Filterer {\n return funcFilterer(f)\n}", "title": "" }, { "docid": "407ac8edbe28e2f0adc7e413ef8b61e6", "score": "0.55037594", "text": "func NewGovernmentContractFilterer(address common.Address, filterer bind.ContractFilterer) (*GovernmentContractFilterer, error) {\n\tcontract, err := bindGovernmentContract(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &GovernmentContractFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "74b93ead3bb61d6b2b8ce9d23c180134", "score": "0.54353046", "text": "func NewOwnableFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnableFilterer, error) {\n\tcontract, err := bindOwnable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "74b93ead3bb61d6b2b8ce9d23c180134", "score": "0.54353046", "text": "func NewOwnableFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnableFilterer, error) {\n\tcontract, err := bindOwnable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "74b93ead3bb61d6b2b8ce9d23c180134", "score": "0.54353046", "text": "func NewOwnableFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnableFilterer, error) {\n\tcontract, err := bindOwnable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "74b93ead3bb61d6b2b8ce9d23c180134", "score": "0.54353046", "text": "func NewOwnableFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnableFilterer, error) {\n\tcontract, err := bindOwnable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "74b93ead3bb61d6b2b8ce9d23c180134", "score": "0.54353046", "text": "func NewOwnableFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnableFilterer, error) {\n\tcontract, err := bindOwnable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "74b93ead3bb61d6b2b8ce9d23c180134", "score": "0.54353046", "text": "func NewOwnableFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnableFilterer, error) {\n\tcontract, err := bindOwnable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "3733ded229be3e4c01953c89a9a29ee3", "score": "0.5375993", "text": "func NewUpgradeableFilterer(address common.Address, filterer bind.ContractFilterer) (*UpgradeableFilterer, error) {\n\tcontract, err := bindUpgradeable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &UpgradeableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "177e321eef7bfc2cced712326cb25a59", "score": "0.5330763", "text": "func (o *StandardOptions) NewFilter(agent string) (*protocol.Filter, error) {\n\treturn filter.NewFilter(\n\t\tfilter.FactFilter(o.FactFilter...),\n\t\tfilter.AgentFilter(o.AgentFilter...),\n\t\tfilter.ClassFilter(o.ClassFilter...),\n\t\tfilter.IdentityFilter(o.IdentityFilter...),\n\t\tfilter.CombinedFilter(o.CombinedFilter...),\n\t\tfilter.CompoundFilter(o.CompoundFilter),\n\t\tfilter.AgentFilter(agent),\n\t)\n}", "title": "" }, { "docid": "2de03faaf07c1daa09d434927be6c007", "score": "0.5239787", "text": "func NewFilter(config *config.Config) (filter *Filter) {\n\tfilter = new(Filter)\n\tfilter.Config = config\n\treturn\n}", "title": "" }, { "docid": "d167c8cf837730326b67cbd9055bf047", "score": "0.5193704", "text": "func (_Bindings *BindingsFilterer) FilterNewComptroller(opts *bind.FilterOpts) (*BindingsNewComptrollerIterator, error) {\n\n\tlogs, sub, err := _Bindings.contract.FilterLogs(opts, \"NewComptroller\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BindingsNewComptrollerIterator{contract: _Bindings.contract, event: \"NewComptroller\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "9c008e7bb95f0b883f53fc14a83549cd", "score": "0.51577294", "text": "func NewWithdrawableFilterer(address common.Address, filterer bind.ContractFilterer) (*WithdrawableFilterer, error) {\n\tcontract, err := bindWithdrawable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &WithdrawableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "42b7964df44baa79cd078f96ebbacd29", "score": "0.51260984", "text": "func GetNewGlobalFilter() *GlobalFilter {\n\tgf := &GlobalFilter{\n\t\tAppFilter: nil,\n\t\tNSFilter: nil,\n\t\tTrafficSplit: []ClusterTraffic{},\n\t\tApplicableClusters: []string{},\n\t}\n\treturn gf\n}", "title": "" }, { "docid": "bcdff638fa557a8df67dc3943d860a54", "score": "0.5102077", "text": "func NewFilter(name string) (Config, error) {\n\tfn, ok := newFilterFuncs[name]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"No registered filter '%s'\", name)\n\t}\n\n\treturn fn(), nil\n}", "title": "" }, { "docid": "ecd09b0200ca10877e0d5260f433e0db", "score": "0.5080833", "text": "func (_CrToken *CrTokenFilterer) FilterNewImplementation(opts *bind.FilterOpts) (*CrTokenNewImplementationIterator, error) {\n\n\tlogs, sub, err := _CrToken.contract.FilterLogs(opts, \"NewImplementation\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CrTokenNewImplementationIterator{contract: _CrToken.contract, event: \"NewImplementation\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "a814a6bd8b641a231ecbd3a88855b86b", "score": "0.5038909", "text": "func NewFlytrapFilterer(address common.Address, filterer bind.ContractFilterer) (*FlytrapFilterer, error) {\n\tcontract, err := bindFlytrap(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &FlytrapFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "036652afad9908e21a01f5d553a2f4e3", "score": "0.5017056", "text": "func NewTransactableFilterer(address common.Address, filterer bind.ContractFilterer) (*TransactableFilterer, error) {\n\tcontract, err := bindTransactable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TransactableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "d2cef4f841ca901180e8919e40701a8e", "score": "0.50115865", "text": "func (_CrToken *CrTokenFilterer) FilterNewComptroller(opts *bind.FilterOpts) (*CrTokenNewComptrollerIterator, error) {\n\n\tlogs, sub, err := _CrToken.contract.FilterLogs(opts, \"NewComptroller\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CrTokenNewComptrollerIterator{contract: _CrToken.contract, event: \"NewComptroller\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "e71a78365ed110e3275a55bff807f51c", "score": "0.49878523", "text": "func NewFilter(level Level, writer Appender) *Filter {\n\tf := &Filter{\n\t\tLevel: level,\n\t\tAppender: writer,\n\n\t\trec: make(chan *LogRecord, LogBufferLength),\n\t\tclosing: false,\n\t}\n\n\tready := make(chan struct{})\n\tgo f.run(ready)\n\t<-ready\n\treturn f\n}", "title": "" }, { "docid": "cfce253eed8c552723a909926f9691ae", "score": "0.49771166", "text": "func New() filters.Spec {\n\treturn filter{headers: &snet.ForwardedHeaders{For: true, Host: true}}\n}", "title": "" }, { "docid": "ce6d572a265b2487b4f1793fc6ca7670", "score": "0.49706337", "text": "func NewFilter(controllerChannel chan Frame, messageCenter MessageCenter) Filter {\n\tfilter := Filter{}\n\n\tfilter.FilterChannel = make(chan Frame)\n\tfilter.FilterFunc = defaultFilterFunc\n\tfilter.controllerChannel = controllerChannel\n\tfilter.messageCenter = messageCenter\n\n\treturn filter\n}", "title": "" }, { "docid": "d9e42dfc4a51efc4c254f91db8c2f5f4", "score": "0.49492952", "text": "func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractFilterer, error) {\n\tcontract, err := bindContract(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "d9e42dfc4a51efc4c254f91db8c2f5f4", "score": "0.49492952", "text": "func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractFilterer, error) {\n\tcontract, err := bindContract(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "d9e42dfc4a51efc4c254f91db8c2f5f4", "score": "0.49492952", "text": "func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractFilterer, error) {\n\tcontract, err := bindContract(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "d9e42dfc4a51efc4c254f91db8c2f5f4", "score": "0.49492952", "text": "func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractFilterer, error) {\n\tcontract, err := bindContract(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "d9e42dfc4a51efc4c254f91db8c2f5f4", "score": "0.49492952", "text": "func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractFilterer, error) {\n\tcontract, err := bindContract(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "b159883b534caba0c71820e2188d29c6", "score": "0.4911219", "text": "func NewFilter() Filter {\n\treturn &filter{}\n}", "title": "" }, { "docid": "7e362bd9556489ec15edf0b8194ed315", "score": "0.48998415", "text": "func NewBaseFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*BaseFactoryFilterer, error) {\n\tcontract, err := bindBaseFactory(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BaseFactoryFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "61ec195213ecb3130f76802d99d12981", "score": "0.48991355", "text": "func NewFilter() filter.Filter {\n\treturn &recoveryFilter{\n\t\tpanics: metrics.Counter(\"HTTP.Panics\"),\n\t}\n}", "title": "" }, { "docid": "ca356b80161d1891bf025ca29f799124", "score": "0.48894736", "text": "func NewFilter(mod *elf.Module) *Filter {\n\treturn &Filter{\n\t\tmod: mod,\n\t\tconfig: mod.Map(defaultFilterConfig),\n\t\tfilter: mod.Map(defaultFilterName),\n\t\trules: make([]*FilterRule, 0),\n\t}\n}", "title": "" }, { "docid": "03019a5b75eb5afa00de651158a7b21e", "score": "0.488506", "text": "func NewFinalizableFilterer(address common.Address, filterer bind.ContractFilterer) (*FinalizableFilterer, error) {\n\tcontract, err := bindFinalizable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &FinalizableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "bad28ba43ef713fea9127ad52a589593", "score": "0.48764893", "text": "func NewBGPFilterLister(indexer cache.Indexer) BGPFilterLister {\n\treturn &bGPFilterLister{indexer: indexer}\n}", "title": "" }, { "docid": "7682887e9ceace169cc65f01aa5867aa", "score": "0.4855135", "text": "func NewSuperuserableFilterer(address common.Address, filterer bind.ContractFilterer) (*SuperuserableFilterer, error) {\n\tcontract, err := bindSuperuserable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SuperuserableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "d2d1ef81cce5662218468aaf8bf8a7ff", "score": "0.48516503", "text": "func NewBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*BridgeFilterer, error) {\n\tcontract, err := bindBridge(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BridgeFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "a647d55c47df6a1ff549ce55cdd3498f", "score": "0.48470387", "text": "func New(\n\tcfg Config,\n\tingesterConfig ingester.Config,\n\tlimits *validation.Overrides,\n\tregisterer prometheus.Registerer,\n\tlogger log.Logger,\n) (*Flusher, error) {\n\n\tf := &Flusher{\n\t\tcfg: cfg,\n\t\tingesterConfig: ingesterConfig,\n\t\tlimits: limits,\n\t\tregisterer: registerer,\n\t\tlogger: logger,\n\t}\n\tf.Service = services.NewBasicService(nil, f.running, nil)\n\treturn f, nil\n}", "title": "" }, { "docid": "79dc0144f42bae3c46e1da93c47348b8", "score": "0.48455364", "text": "func NewEthdkgFilterer(address common.Address, filterer bind.ContractFilterer) (*EthdkgFilterer, error) {\n\tcontract, err := bindEthdkg(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &EthdkgFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "cc6649756b27fa738cd14570cb91443b", "score": "0.4842686", "text": "func NewCraftingIFilterer(address common.Address, filterer bind.ContractFilterer) (*CraftingIFilterer, error) {\n\tcontract, err := bindCraftingI(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CraftingIFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "ab4ebbbd52cc2a9730bc0668cd0bf068", "score": "0.48424536", "text": "func (_AggregatorV2V3Interface *AggregatorV2V3InterfaceFilterer) FilterNewRound(opts *bind.FilterOpts, roundId []*big.Int, startedBy []common.Address) (*AggregatorV2V3InterfaceNewRoundIterator, error) {\n\n\tvar roundIdRule []interface{}\n\tfor _, roundIdItem := range roundId {\n\t\troundIdRule = append(roundIdRule, roundIdItem)\n\t}\n\tvar startedByRule []interface{}\n\tfor _, startedByItem := range startedBy {\n\t\tstartedByRule = append(startedByRule, startedByItem)\n\t}\n\n\tlogs, sub, err := _AggregatorV2V3Interface.contract.FilterLogs(opts, \"NewRound\", roundIdRule, startedByRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AggregatorV2V3InterfaceNewRoundIterator{contract: _AggregatorV2V3Interface.contract, event: \"NewRound\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "3e372970963e0c121de2e1aa56a44db9", "score": "0.48420388", "text": "func NewFilter() *Builder {\n\treturn &Builder{}\n}", "title": "" }, { "docid": "685d82b2c091bfb3c9c777fa4f1b8782", "score": "0.48409113", "text": "func NewOutboxFilterer(address common.Address, filterer bind.ContractFilterer) (*OutboxFilterer, error) {\n\tcontract, err := bindOutbox(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OutboxFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "a4707f395e37b7a5f1084e4228a44894", "score": "0.48254085", "text": "func NewOwnedFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnedFilterer, error) {\n\tcontract, err := bindOwned(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnedFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "a4707f395e37b7a5f1084e4228a44894", "score": "0.48254085", "text": "func NewOwnedFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnedFilterer, error) {\n\tcontract, err := bindOwned(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnedFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "a4707f395e37b7a5f1084e4228a44894", "score": "0.48254085", "text": "func NewOwnedFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnedFilterer, error) {\n\tcontract, err := bindOwned(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnedFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "096f292b384ca0779bd84b98e37f608d", "score": "0.4824989", "text": "func (_Contracts *ContractsFilterer) FilterNewVoter(opts *bind.FilterOpts, _voter []common.Address) (*ContractsNewVoterIterator, error) {\n\n\tvar _voterRule []interface{}\n\tfor _, _voterItem := range _voter {\n\t\t_voterRule = append(_voterRule, _voterItem)\n\t}\n\n\tlogs, sub, err := _Contracts.contract.FilterLogs(opts, \"NewVoter\", _voterRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractsNewVoterIterator{contract: _Contracts.contract, event: \"NewVoter\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "8e797d08519d4ca05d0add90f48aab4f", "score": "0.48248285", "text": "func newReconciler(mgr manager.Manager, opts options.AddOptions, licenseAPIReady *utils.ReadyFlag) reconcile.Reconciler {\n\tr := &ReconcileEgressGateway{\n\t\tclient: mgr.GetClient(),\n\t\tscheme: mgr.GetScheme(),\n\t\tprovider: opts.DetectedProvider,\n\t\tstatus: status.New(mgr.GetClient(), \"egressgateway\", opts.KubernetesVersion),\n\t\tclusterDomain: opts.ClusterDomain,\n\t\tlicenseAPIReady: licenseAPIReady,\n\t\tusePSP: opts.UsePSP,\n\t}\n\tr.status.Run(opts.ShutdownContext)\n\treturn r\n}", "title": "" }, { "docid": "0c071c9c209e77958458fc8e869c3a39", "score": "0.4820971", "text": "func NewPBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*PBridgeFilterer, error) {\n\tcontract, err := bindPBridge(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &PBridgeFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "653bb013441867dc1135894c8afdee5c", "score": "0.48057318", "text": "func NewFilter(ctx *pulumi.Context,\n\tname string, args *FilterArgs, opts ...pulumi.ResourceOption) (*Filter, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.FilterAction == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'FilterAction'\")\n\t}\n\tif args.FilterCriteria == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'FilterCriteria'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Filter\n\terr := ctx.RegisterResource(\"aws-native:inspectorv2:Filter\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "526b937ee43b69f9331c5ac1568480ae", "score": "0.47965342", "text": "func NewFlopperFilterer(address common.Address, filterer bind.ContractFilterer) (*FlopperFilterer, error) {\n\tcontract, err := bindFlopper(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &FlopperFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "7f03f95dd47d6c56f75398c9a1128c74", "score": "0.47892308", "text": "func NewOwnableDelegateProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*OwnableDelegateProxyFilterer, error) {\n\tcontract, err := bindOwnableDelegateProxy(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnableDelegateProxyFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "21371b1f8ed0f8ec4f374c9f73381fb4", "score": "0.4787041", "text": "func NewHubFilterer(address common.Address, filterer bind.ContractFilterer) (*HubFilterer, error) {\n\tcontract, err := bindHub(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &HubFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "737d8fc727d814672438fe816d5c7097", "score": "0.47861168", "text": "func NewCrowdsaleFilterer(address common.Address, filterer bind.ContractFilterer) (*CrowdsaleFilterer, error) {\n\tcontract, err := bindCrowdsale(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CrowdsaleFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "a6a75028f1448cee076440e37561ca10", "score": "0.4785272", "text": "func NewFooFilterer(address common.Address, filterer bind.ContractFilterer) (*FooFilterer, error) {\n\tcontract, err := bindFoo(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &FooFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "2f78b94b31c3991398aec7727b675a5f", "score": "0.47805867", "text": "func NewGrokFilter() (*GrokData) {\n\tgrok := cgrock.New()\n\treturn &GrokData{grok, \"\", nil}\n}", "title": "" }, { "docid": "3bee011a5b8a59b9bf53d9af22dfb28c", "score": "0.4775762", "text": "func newACLFilter(authorizer acl.Authorizer, logger *log.Logger, enforceVersion8 bool) *aclFilter {\n\tif logger == nil {\n\t\tlogger = log.New(os.Stderr, \"\", log.LstdFlags)\n\t}\n\treturn &aclFilter{\n\t\tauthorizer: authorizer,\n\t\tlogger: logger,\n\t\tenforceVersion8: enforceVersion8,\n\t}\n}", "title": "" }, { "docid": "dc0bd8e9b848e698bcb881538fa17afe", "score": "0.47614363", "text": "func NewBaseLibraryFilterer(address common.Address, filterer bind.ContractFilterer) (*BaseLibraryFilterer, error) {\n\tcontract, err := bindBaseLibrary(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BaseLibraryFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "6a3d54f30b5f83cd0c94e816847986e8", "score": "0.4738488", "text": "func NewAccessibleFilterer(address common.Address, filterer bind.ContractFilterer) (*AccessibleFilterer, error) {\n\tcontract, err := bindAccessible(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AccessibleFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "937e24aed2fa58f916dfae402590585d", "score": "0.47369033", "text": "func New(client client.ConfigProvider) *MetricFilter {\n\treturn &MetricFilter{client: client}\n}", "title": "" }, { "docid": "8c64df073dbeb3d74467db55178c6a85", "score": "0.4729559", "text": "func (c *Client) NewFilter(filter Filter) (*QuantityResponse, error) {\n\trequest := c.newRequest(EthNewFilter)\n\n\trequest.Params = []interface{}{\n\t\tfilter,\n\t}\n\tresponse := &QuantityResponse{}\n\n\treturn response, c.send(request, response)\n}", "title": "" }, { "docid": "90a8033e4d64b6b2a1e3c0cd0aad7991", "score": "0.4723784", "text": "func NewFilter(lti lti.Discrete, nse Noise) Filter {\n\treturn &filterImpl{lti, nse, nil}\n}", "title": "" }, { "docid": "65186cae459e57e28acac77561ec525c", "score": "0.47175235", "text": "func NewGossiper() *Gossiper {\n\tg := &Gossiper{}\n\tg.MaxGossipPacketSize = 1428\n\tg.GossipStage = \"GS\" // abbr for Gossip Stage\n\tg.JoinVerbHandler = \"JVH\"\n\tg.GossipDigestSynVerb = \"GSV\"\n\tg.GossipDigestAckVerb = \"GAV\"\n\tg.GossipDigestAck2Verb = \"GA2V\"\n\tg.intervalInMillis = 1000\n\tg.aVeryLongTime = 259200 * 1000\n\tg.preIdx = 0\n\tg.rrIdx = 0\n\tg.liveEndpoints = make(map[network.EndPoint]bool)\n\tg.unreachableEndpoints = make(map[network.EndPoint]bool)\n\tg.seeds = make(map[network.EndPoint]bool)\n\tg.endPointStateMap = make(map[network.EndPoint]*EndPointState)\n\tg.subscribers = make([]IEndPointStateChangeSubscriber, 0)\n\ts := rand.NewSource(time.Now().UnixNano() / int64(time.Millisecond))\n\tg.rnd = rand.New(s)\n\tGetFailureDetector().RegisterEventListener(g)\n\treturn g\n}", "title": "" }, { "docid": "e8da9b777b0d8bfebf0c948952736251", "score": "0.4714624", "text": "func New() filters.Spec {\n\treturn filter{}\n}", "title": "" }, { "docid": "dcf147d6dd4b08a16a7fbf90ef656884", "score": "0.47083548", "text": "func New(obj map[string]interface{}) (kio.Filter, error) {\n\tcfg := &airshipv1.ReplacementTransformer{}\n\terr := runtime.DefaultUnstructuredConverter.FromUnstructured(obj, cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp := &plugin{ReplacementTransformer: cfg}\n\tfor _, r := range p.Replacements {\n\t\tif r.Source == nil {\n\t\t\treturn nil, ErrBadConfiguration{Msg: \"`from` must be specified in one replacement\"}\n\t\t}\n\t\tif r.Target == nil && r.Targets == nil {\n\t\t\treturn nil, ErrBadConfiguration{Msg: \"`to` must be specified in one replacement\"}\n\t\t}\n\t\tif r.Target != nil && r.Targets != nil {\n\t\t\treturn nil, ErrBadConfiguration{Msg: \"only target OR targets is allowed in one replacement, not both\"}\n\t\t}\n\t\tif r.Source.ObjRef != nil && r.Source.Value != nil {\n\t\t\treturn nil, ErrBadConfiguration{Msg: \"only one of fieldref and value is allowed in one replacement\"}\n\t\t}\n\t\tif r.Source.ObjRef == nil && r.Source.Value == nil {\n\t\t\treturn nil, ErrBadConfiguration{Msg: \"no source value or source objectref value was given\"}\n\t\t}\n\t}\n\treturn p, nil\n}", "title": "" }, { "docid": "df20f0c6618b2efaa2bbc1af9e27f93e", "score": "0.47077486", "text": "func CreateGofer(id int, goferQueue chan chan JobRequest) Gofer {\n\n gofer := Gofer {\n GoferID: id,\n JobChan: make(chan JobRequest),\n GoferQueue: goferQueue,\n ExitChan: make(chan bool),\n }\n\n return gofer\n}", "title": "" }, { "docid": "d0a18bb8e3ed2c5d5b1f72b4f8142be6", "score": "0.46993983", "text": "func newFilter() *tasks.DateFiltering {\n return &tasks.DateFiltering{}\n}", "title": "" }, { "docid": "6c294b80ccecceb7bdd0c2ac4bab11a0", "score": "0.46798214", "text": "func NewHelloFilterer(address common.Address, filterer bind.ContractFilterer) (*HelloFilterer, error) {\n\tcontract, err := bindHello(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &HelloFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "ea6bf52e27a96542b727915507ab973c", "score": "0.46692574", "text": "func NewStorageFilterer(address common.Address, filterer bind.ContractFilterer) (*StorageFilterer, error) {\n\tcontract, err := bindStorage(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StorageFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "ea6bf52e27a96542b727915507ab973c", "score": "0.46692574", "text": "func NewStorageFilterer(address common.Address, filterer bind.ContractFilterer) (*StorageFilterer, error) {\n\tcontract, err := bindStorage(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StorageFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "ea6bf52e27a96542b727915507ab973c", "score": "0.46692574", "text": "func NewStorageFilterer(address common.Address, filterer bind.ContractFilterer) (*StorageFilterer, error) {\n\tcontract, err := bindStorage(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StorageFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "1c51b8c6ed10109142ebd5166e6f4362", "score": "0.46628043", "text": "func (_Mcapscontroller *McapscontrollerFilterer) FilterNewPoolInitializer(opts *bind.FilterOpts) (*McapscontrollerNewPoolInitializerIterator, error) {\n\n\tlogs, sub, err := _Mcapscontroller.contract.FilterLogs(opts, \"NewPoolInitializer\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &McapscontrollerNewPoolInitializerIterator{contract: _Mcapscontroller.contract, event: \"NewPoolInitializer\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "5a1862837c82073041a606bc862d8632", "score": "0.46542072", "text": "func NewContractsFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractsFilterer, error) {\n\tcontract, err := bindContracts(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractsFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "e61f0f3c6cf36a2555e14bc694ca32f0", "score": "0.46533895", "text": "func NewRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*RegistryFilterer, error) {\n\tcontract, err := bindRegistry(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RegistryFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "e61f0f3c6cf36a2555e14bc694ca32f0", "score": "0.46533895", "text": "func NewRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*RegistryFilterer, error) {\n\tcontract, err := bindRegistry(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RegistryFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "0661cb69342735e26ef1e84cc2537299", "score": "0.46369696", "text": "func NewAbstractFilter(fragmentSrc []interface{}, uniforms interface{}) *AbstractFilter {\n return &AbstractFilter{js.Global.Get(\"PIXI\").Get(\"AbstractFilter\").New(fragmentSrc, uniforms)}\n}", "title": "" }, { "docid": "e8e91516de27426bbcdb1d05352f0bcd", "score": "0.46239537", "text": "func NewBaseLibraryFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*BaseLibraryFactoryFilterer, error) {\n\tcontract, err := bindBaseLibraryFactory(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BaseLibraryFactoryFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "ddfefad8395cad3818affc07a1c86366", "score": "0.46197745", "text": "func NewFilter(filters ...Filter) Filter {\n\tvar filter Filter\n\tfor _, f := range filters {\n\t\tfilter = filter | f\n\t}\n\treturn filter\n}", "title": "" }, { "docid": "c1dd3209f0bdb88ceb276eb06c7cd299", "score": "0.4611095", "text": "func NewFilter(next log.Logger, minLevel *LevelValue) log.Logger {\n\treturn &filter{\n\t\tnext: next,\n\t\tminLevel: minLevel,\n\t}\n}", "title": "" }, { "docid": "b4366cf3e98724fe15eed5737fff0c97", "score": "0.4609174", "text": "func NewLoggerFilterer(address common.Address, filterer bind.ContractFilterer) (*LoggerFilterer, error) {\n\tcontract, err := bindLogger(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LoggerFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "1e27ed26e2ddc12fac41c79c0551cd2e", "score": "0.4601434", "text": "func (_Aggregator *AggregatorFilterer) FilterNewRound(opts *bind.FilterOpts, roundId []*big.Int, startedBy []common.Address) (*AggregatorNewRoundIterator, error) {\n\n\tvar roundIdRule []interface{}\n\tfor _, roundIdItem := range roundId {\n\t\troundIdRule = append(roundIdRule, roundIdItem)\n\t}\n\tvar startedByRule []interface{}\n\tfor _, startedByItem := range startedBy {\n\t\tstartedByRule = append(startedByRule, startedByItem)\n\t}\n\n\tlogs, sub, err := _Aggregator.contract.FilterLogs(opts, \"NewRound\", roundIdRule, startedByRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AggregatorNewRoundIterator{contract: _Aggregator.contract, event: \"NewRound\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "6ce6415b884208e8a626e58c13c9c01e", "score": "0.45990074", "text": "func NewBaseGroupFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*BaseGroupFactoryFilterer, error) {\n\tcontract, err := bindBaseGroupFactory(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BaseGroupFactoryFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "0871d0684a8431e31760acd3603cec6f", "score": "0.45974487", "text": "func (d *Data) NewFilter(fs storage.FilterSpec) (storage.Filter, error) {\n\tfilter := &Filter{Data: d, fs: fs}\n\n\t// Get associated labelblk. If none, we can't use roi filter so just do standard data send.\n\tlblk, err := d.GetSyncedLabelblk()\n\tif err != nil {\n\t\tdvid.Infof(\"Unable to get synced labelblk for labelvol %q. Unable to do any ROI-based filtering.\\n\", d.DataName())\n\t\treturn nil, nil\n\t}\n\n\troiIterator, _, found, err := roi.NewIteratorBySpec(fs, lblk)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !found || roiIterator == nil {\n\t\tdvid.Debugf(\"No ROI found so using generic data push for data %q.\\n\", d.DataName())\n\t\treturn nil, nil\n\t}\n\tfilter.it = roiIterator\n\n\treturn filter, nil\n}", "title": "" }, { "docid": "0a86039b99b92748eec0a7cfbc16ddd0", "score": "0.45947385", "text": "func NewFilter(t FilterOperator) *Filter {\n\treturn &Filter{\n\t\toperator: t,\n\t}\n}", "title": "" }, { "docid": "c91e1beff5f035c71c22ba994d6141d1", "score": "0.45939216", "text": "func newGoodWriter(address string, logstream chan *router.Message) *gelf.Writer {\n\tfor {\n\t\twriter, err := gelf.NewWriter(address)\n\t\tif err != nil {\n\t\t\tlogger.Printf(\"error dialing %s: %s\", address, err)\n\n\t\t\t// Try redial after 5 seconds\n\t\t\tdropSome(logstream, time.After(5*time.Second))\n\t\t}\n\n\t\tlogger.Printf(\"dialed %s\", address)\n\n\t\t// intended to forward logs to a service on localhost\n\t\twriter.CompressionLevel = flate.NoCompression\n\t\twriter.CompressionType = gelf.CompressGzip\n\n\t\treturn writer\n\t}\n}", "title": "" }, { "docid": "fbb382f8447ab406631529299bad3f2e", "score": "0.4586689", "text": "func NewFilter(prop, op string, val interface{}) *Filter {\n\treturn &Filter{\n\t\tProp: prop,\n\t\tOperator: op,\n\t\tValue: val,\n\t}\n}", "title": "" }, { "docid": "6aa6f304e25bcec88d124f624f78d1f1", "score": "0.45793137", "text": "func NewUserableFilterer(address common.Address, filterer bind.ContractFilterer) (*UserableFilterer, error) {\n\tcontract, err := bindUserable(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &UserableFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "03b1f57382347e7a646bfd6061818864", "score": "0.45656675", "text": "func New() *Filter {\n\treturn &Filter{\n\t\tinclude: []Matcher{},\n\t\texclude: []Matcher{},\n\t\tlimit: 0,\n\t}\n}", "title": "" }, { "docid": "37f65f0556503b679fc1bfe55d6a85a6", "score": "0.45619997", "text": "func NewKNSFilterer(address common.Address, filterer bind.ContractFilterer) (*KNSFilterer, error) {\n\tcontract, err := bindKNS(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &KNSFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "3daa7bf2bcb746b184a110341b5a727c", "score": "0.45617175", "text": "func NewPermInterfaceFilterer(address common.Address, filterer bind.ContractFilterer) (*PermInterfaceFilterer, error) {\n\tcontract, err := bindPermInterface(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &PermInterfaceFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "d7780c40eecb3253ca243dd9e0cc6fad", "score": "0.45609662", "text": "func NewChpRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*ChpRegistryFilterer, error) {\n\tcontract, err := bindChpRegistry(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ChpRegistryFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "bcd847d1688d1ead167c4245daea58a8", "score": "0.4558346", "text": "func NewBaseContentSpaceFilterer(address common.Address, filterer bind.ContractFilterer) (*BaseContentSpaceFilterer, error) {\n\tcontract, err := bindBaseContentSpace(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BaseContentSpaceFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "edee5f939227948714b26b97306929e3", "score": "0.45583194", "text": "func newBGPFilterList() *api.BGPFilterList {\n\treturn &api.BGPFilterList{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: api.KindBGPFilterList,\n\t\t\tAPIVersion: api.GroupVersionCurrent,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "f30e1955b076ad0784bc5393db255599", "score": "0.45562598", "text": "func NewBfsFilterer(address common.Address, filterer bind.ContractFilterer) (*BfsFilterer, error) {\n\tcontract, err := bindBfs(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BfsFilterer{contract: contract}, nil\n}", "title": "" }, { "docid": "d10b06757660a11e227f0ce1013a89d5", "score": "0.4546953", "text": "func (_Contracts *ContractsFilterer) FilterNewProposal(opts *bind.FilterOpts, _name [][32]byte, _proposalId []*big.Int) (*ContractsNewProposalIterator, error) {\n\n\tvar _nameRule []interface{}\n\tfor _, _nameItem := range _name {\n\t\t_nameRule = append(_nameRule, _nameItem)\n\t}\n\tvar _proposalIdRule []interface{}\n\tfor _, _proposalIdItem := range _proposalId {\n\t\t_proposalIdRule = append(_proposalIdRule, _proposalIdItem)\n\t}\n\n\tlogs, sub, err := _Contracts.contract.FilterLogs(opts, \"NewProposal\", _nameRule, _proposalIdRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractsNewProposalIterator{contract: _Contracts.contract, event: \"NewProposal\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "f015d2b482611595d43d1b8f0d3a036e", "score": "0.45351094", "text": "func (_Bindings *BindingsFilterer) WatchNewComptroller(opts *bind.WatchOpts, sink chan<- *BindingsNewComptroller) (event.Subscription, error) {\n\n\tlogs, sub, err := _Bindings.contract.WatchLogs(opts, \"NewComptroller\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(BindingsNewComptroller)\n\t\t\t\tif err := _Bindings.contract.UnpackLog(event, \"NewComptroller\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}", "title": "" }, { "docid": "7e716b25742c2cd36ff74aed7aed04ee", "score": "0.4533916", "text": "func NewForwarder(s *stack.Stack, rcvWnd, maxInFlight int, handler func(*ForwarderRequest)) *Forwarder {\n\tif rcvWnd == 0 {\n\t\trcvWnd = DefaultReceiveBufferSize\n\t}\n\treturn &Forwarder{\n\t\tstack: s,\n\t\tmaxInFlight: maxInFlight,\n\t\thandler: handler,\n\t\tinFlight: make(map[stack.TransportEndpointID]struct{}),\n\t\tlisten: newListenContext(s, protocolFromStack(s), nil /* listenEP */, seqnum.Size(rcvWnd), true, 0),\n\t}\n}", "title": "" }, { "docid": "9d8ce29ac9b15c74d320bd14b9ac3dea", "score": "0.45338747", "text": "func NewFilter() *Filterdata {\r\n\tfilter := new(Filterdata)\r\n\tvar err error\r\n\tfilter.regRData, err = lru.New(P2pCacheTxSize)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\treturn filter\r\n}", "title": "" }, { "docid": "bc728c4f5c124303497569d53902e77a", "score": "0.4533776", "text": "func NewGovernableTransactor(address common.Address, transactor bind.ContractTransactor) (*GovernableTransactor, error) {\n\tcontract, err := bindGovernable(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &GovernableTransactor{contract: contract}, nil\n}", "title": "" } ]
17fc2c73e11657a7b8a494df4550e494
GetMode retrieves the value with the specified key from the Mode map field of TerminalDevice.
[ { "docid": "836d99ae7a9f151352b445b6a15c0828", "score": "0.8207349", "text": "func (t *TerminalDevice) GetMode(ModeId uint16) *TerminalDevice_Mode {\n\n\tkey := ModeId\n\n\tif lm, ok := t.Mode[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "32226619af23a6b9e19819b3276380cc", "score": "0.8196858", "text": "func (t *TerminalDevice) GetMode(ModeId uint16) *TerminalDevice_Mode {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := ModeId\n\n\tif lm, ok := t.Mode[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "32226619af23a6b9e19819b3276380cc", "score": "0.8196858", "text": "func (t *TerminalDevice) GetMode(ModeId uint16) *TerminalDevice_Mode {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := ModeId\n\n\tif lm, ok := t.Mode[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "32226619af23a6b9e19819b3276380cc", "score": "0.8196858", "text": "func (t *TerminalDevice) GetMode(ModeId uint16) *TerminalDevice_Mode {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := ModeId\n\n\tif lm, ok := t.Mode[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fd2d066c09a8061b83e247d8bcd52264", "score": "0.73274034", "text": "func (d *Device) GetMode() uint8 {\n\treturn d.mode\n}", "title": "" }, { "docid": "7b91b22638e62aa23078eb2aa10d6c38", "score": "0.71112907", "text": "func (l *Lora) GetMode() (string, error) {\n\treturn l.tx(\"mode\", readline)\n}", "title": "" }, { "docid": "e9ab03ae1dab7316d3bc34a46d0c9410", "score": "0.7098235", "text": "func (c *ChannelModeSet) GetMode(mode ChannelMode) interface{} {\n\tc.mutex.RLock()\n\tdefer c.mutex.RUnlock()\n\treturn c.modes[mode]\n\n}", "title": "" }, { "docid": "4f33cc86ed32adb9057f20c319bebc86", "score": "0.69429255", "text": "func (psw *PSW) GetMode() uint16 {\n\treturn uint16(*psw >> 14)\n}", "title": "" }, { "docid": "a492f74ebf24904317c48049be103bed", "score": "0.6882975", "text": "func (m *Machine) GetMode() string {\n return m.Mode\n}", "title": "" }, { "docid": "9b746800a00564997a425849445cd24e", "score": "0.68664455", "text": "func GetMode() string {\n\treturn mode\n}", "title": "" }, { "docid": "92e2e01c8f8c22c10da9e5d459e8b1e9", "score": "0.6689133", "text": "func GetMode(mode string) (Mode, error) {\n\tvar ftpMode Mode\n\tif mode == ActiveModeStr {\n\t\tftpMode = ActiveMode\n\t} else if mode == PassiveModeStr {\n\t\tftpMode = PassiveMode\n\t} else if mode == DefaultModeStr {\n\t\tftpMode = IndMode\n\t} else {\n\t\treturn -1, errors.New(InvalidMode)\n\t}\n\treturn ftpMode, nil\n}", "title": "" }, { "docid": "4b6056cdd65f0e98c56a77f10f9ff7ee", "score": "0.6667359", "text": "func (s *EditState) GetMode() *byte {\n\tvar ret *byte\n\tret = (*byte)(unsafe.Pointer(&s.mode))\n\treturn ret\n}", "title": "" }, { "docid": "4d57b67a428fefbd06b55bba4048aab2", "score": "0.66155016", "text": "func (store Store) GetMode(id int64) (Mode, error) {\n\tvar mode Mode\n\terr := store.db.View(func(tx *bolt.Tx) error {\n\t\tif v := tx.Bucket(bucket.Modes).Get(itob(id)); v != nil {\n\t\t\tmode = Mode(btoi(v))\n\t\t} else {\n\t\t\tmode = ModeGetStarted\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn mode, fmt.Errorf(\"failed to get mode for id %d: %v\", id, err)\n\t}\n\treturn mode, nil\n}", "title": "" }, { "docid": "f4cb3d0e0b4e2fb7ab03b6d422752cb1", "score": "0.6551657", "text": "func (s *TextEdit) GetMode() *byte {\n\tvar ret *byte\n\tret = (*byte)(unsafe.Pointer(&s.mode))\n\treturn ret\n}", "title": "" }, { "docid": "b9d7327308915dc2bc5e17c9699d8642", "score": "0.6550174", "text": "func (_class VBDClass) GetMode(sessionID SessionRef, self VBDRef) (_retval VbdMode, _err error) {\n\tif IsMock {\n\t\treturn _class.GetModeMock(sessionID, self)\n\t}\t\n\t_method := \"VBD.get_mode\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_selfArg, _err := convertVBDRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"self\"), self)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_retval, _err = convertEnumVbdModeToGo(_method + \" -> \", _result.Value)\n\treturn\n}", "title": "" }, { "docid": "9edc1084c79d031785d1aa10bdbc4582", "score": "0.65351313", "text": "func (m *Measurement) GetMode() string {\n\treturn m.cfg.GetMode\n}", "title": "" }, { "docid": "c62dd9cbdc77a2d8ae7fe2767178a432", "score": "0.65016425", "text": "func (o *VirtualizationVirtualDiskConfig) GetMode() string {\n\tif o == nil || o.Mode == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Mode\n}", "title": "" }, { "docid": "b5582b2b27276ff9b60d698f82b80ecb", "score": "0.6487866", "text": "func (r *ScriptRegistry) GetMode(name string) (HarvestMode, error) {\n\td, exists := r.descriptors[name]\n\tif !exists {\n\t\treturn 0, ErrScriptNotFound\n\t}\n\treturn d.Mode, nil\n}", "title": "" }, { "docid": "855e3ba40fc7f63e4182e60fd1873cfe", "score": "0.64591885", "text": "func (o KeyToPathOutput) Mode() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v KeyToPath) *int { return v.Mode }).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "690c7dfa4d956273a83b9070b684d53c", "score": "0.64312977", "text": "func (o *Light2D) GetMode() Light2DMode {\n\t//log.Println(\"Calling Light2D.GetMode()\")\n\n\t// Build out the method's arguments\n\tptrArguments := make([]gdnative.Pointer, 0, 0)\n\n\t// Get the method bind\n\tmethodBind := gdnative.NewMethodBind(\"Light2D\", \"get_mode\")\n\n\t// Call the parent method.\n\t// enum.Light2D::Mode\n\tretPtr := gdnative.NewEmptyInt()\n\tgdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)\n\n\t// If we have a return type, convert it from a pointer into its actual object.\n\tret := gdnative.NewIntFromPointer(retPtr)\n\treturn Light2DMode(ret)\n}", "title": "" }, { "docid": "56bba40696fb1721f79ca49a4c0e8e19", "score": "0.62969255", "text": "func (o *WebApplicationConfigBrowserRestrictionSettings) GetMode() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Mode\n}", "title": "" }, { "docid": "24c3d959d193d0bc3e4111001dcc61f7", "score": "0.62601143", "text": "func (p *PID) GetMode() int32 {\n\tif p.modeAuto {\n\t\treturn Auto\n\t}\n\treturn Manual\n}", "title": "" }, { "docid": "6f0f66af8d8aa7d18050dd0ab4ed325d", "score": "0.6247969", "text": "func (t *TerminalDevice) GetOrCreateMode(ModeId uint16) *TerminalDevice_Mode {\n\n\tkey := ModeId\n\n\tif v, ok := t.Mode[key]; ok {\n\t\treturn v\n\t}\n\t// Panic if we receive an error, since we should have retrieved an existing\n\t// list member. This allows chaining of GetOrCreate methods.\n\tv, err := t.NewMode(ModeId)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateMode got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "6f0f66af8d8aa7d18050dd0ab4ed325d", "score": "0.6247969", "text": "func (t *TerminalDevice) GetOrCreateMode(ModeId uint16) *TerminalDevice_Mode {\n\n\tkey := ModeId\n\n\tif v, ok := t.Mode[key]; ok {\n\t\treturn v\n\t}\n\t// Panic if we receive an error, since we should have retrieved an existing\n\t// list member. This allows chaining of GetOrCreate methods.\n\tv, err := t.NewMode(ModeId)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateMode got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "6f0f66af8d8aa7d18050dd0ab4ed325d", "score": "0.6247969", "text": "func (t *TerminalDevice) GetOrCreateMode(ModeId uint16) *TerminalDevice_Mode {\n\n\tkey := ModeId\n\n\tif v, ok := t.Mode[key]; ok {\n\t\treturn v\n\t}\n\t// Panic if we receive an error, since we should have retrieved an existing\n\t// list member. This allows chaining of GetOrCreate methods.\n\tv, err := t.NewMode(ModeId)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateMode got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "6f0f66af8d8aa7d18050dd0ab4ed325d", "score": "0.6246902", "text": "func (t *TerminalDevice) GetOrCreateMode(ModeId uint16) *TerminalDevice_Mode {\n\n\tkey := ModeId\n\n\tif v, ok := t.Mode[key]; ok {\n\t\treturn v\n\t}\n\t// Panic if we receive an error, since we should have retrieved an existing\n\t// list member. This allows chaining of GetOrCreate methods.\n\tv, err := t.NewMode(ModeId)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateMode got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "f8cbf66af3d195eabf2b6aae906031c9", "score": "0.6216808", "text": "func (o KeyToPathPatchOutput) Mode() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v KeyToPathPatch) *int { return v.Mode }).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "189476abffc1f529ba910a21eb57ea08", "score": "0.62106365", "text": "func (o ConditionalAccessPolicyConditionsDevicesFilterPtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ConditionalAccessPolicyConditionsDevicesFilter) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "d9aac28fe2aa272a714254326aba9666", "score": "0.6080179", "text": "func (recv *LevelBar) GetMode() LevelBarMode {\n\tretC := C.gtk_level_bar_get_mode((*C.GtkLevelBar)(recv.native))\n\tretGo := (LevelBarMode)(retC)\n\n\treturn retGo\n}", "title": "" }, { "docid": "79b3f94eddcf2664bda1314cfdb2ca5c", "score": "0.60716796", "text": "func (o BwdifConfigPtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *BwdifConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "839cd5d9794af094c326a9672482a2a4", "score": "0.60526085", "text": "func (o YadifConfigPtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *YadifConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "129539333fddeea037c7ffa2beab2dbc", "score": "0.60446197", "text": "func (o *StorageHitachiPort) GetPortMode() string {\n\tif o == nil || o.PortMode == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.PortMode\n}", "title": "" }, { "docid": "8cab182d61ac48d73b03048b93b36238", "score": "0.6004121", "text": "func GetMode() string {\n\thome, err := os.UserHomeDir() //dir, _ := os.Getwd()\n\tCheckErr(err)\n\t//fmt.Println(\"home:\", home)\n\tif strings.Contains(home, \"intelbras\") {\n\t\treturn \"dev\"\n\t}\n\treturn \"prod\"\n}", "title": "" }, { "docid": "08215bb3d26eebb12eb81e1a2c45b51d", "score": "0.5987172", "text": "func (o YadifConfigOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v YadifConfig) *string { return v.Mode }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "ad7b0bd0693bac99c6e31dc242f26ffe", "score": "0.598501", "text": "func GetMode(instruction int, param int) int {\n // Move parameter digit to the ones digit, then mod 10 to isolate it\n mode := (instruction / int(math.Pow10(param+1))) % 10\n return mode\n}", "title": "" }, { "docid": "ebc3660b58b3daf4bcd6ff8efe2aec1e", "score": "0.5977812", "text": "func (o BwdifConfigOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v BwdifConfig) *string { return v.Mode }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "d1ceafa4748b5815b2c92f942d1de261", "score": "0.59735435", "text": "func (oc OpCode) Mode(index int) int {\n\treturn oc.Modes[index]\n}", "title": "" }, { "docid": "88eda74b841a00165408be2996e79f65", "score": "0.59536016", "text": "func (r *Resource) GetMode() string {\n\tswitch r.Mode {\n\tcase \"managed\":\n\t\treturn \"resource\"\n\tcase \"data\":\n\t\treturn \"data source\"\n\tdefault:\n\t\treturn \"invalid\"\n\t}\n}", "title": "" }, { "docid": "e3989211b135968db26c0efc7e368814", "score": "0.59375805", "text": "func (o ConditionalAccessPolicyConditionsDevicesFilterOutput) Mode() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ConditionalAccessPolicyConditionsDevicesFilter) string { return v.Mode }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "fac1f98ae29ec0e4b4e7006176013f9b", "score": "0.59053445", "text": "func (c *computer) readMode(val int, isImmediate bool) int {\n\tif isImmediate {\n\t\treturn val\n\t}\n\treturn c.memory[val]\n}", "title": "" }, { "docid": "b51aafdd22a957aebe3338c64ed2aeff", "score": "0.59013253", "text": "func (d *Deployment) GetMode() api.DeploymentMode {\n\treturn d.GetSpec().GetMode()\n}", "title": "" }, { "docid": "a05bcba304fd0041f3c9d24c4003211f", "score": "0.5852641", "text": "func (r *ReadPref) Mode() Mode {\n\treturn r.mode\n}", "title": "" }, { "docid": "24b11cdaba2017aca49de46cc44ae7fc", "score": "0.58522356", "text": "func GetMode() shared.PerformanceMode {\n\tif cpu.X86.HasAVX && cpu.X86.HasAVX2 {\n\t\treturn shared.Fast\n\t}\n\treturn shared.Normal\n}", "title": "" }, { "docid": "dcea6750cc50835bb7d9abb7e3c4906b", "score": "0.58151925", "text": "func (o APISpecPtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *APISpec) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "052e40a4db799e02711694cf4e5d74e9", "score": "0.5812186", "text": "func (a *FabricApiService) GetFabricPortModeByMoid(ctx context.Context, moid string) ApiGetFabricPortModeByMoidRequest {\n\treturn ApiGetFabricPortModeByMoidRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tmoid: moid,\n\t}\n}", "title": "" }, { "docid": "8ed979eb089218879e376bcaaaa2bcdc", "score": "0.5808654", "text": "func (c *computer) readMode(p param) int64 {\n\tswitch p.mode {\n\tcase PostionMode:\n\t\treturn c.memory[p.val]\n\tcase AbsoluteMode:\n\t\treturn p.val\n\tcase RelativeMode:\n\t\treturn c.memory[int(p.val)+c.relativeBase]\n\tdefault:\n\t\treturn c.memory[p.val]\n\t}\n\n}", "title": "" }, { "docid": "06bb8196301dd99853847cfcc50b272e", "score": "0.57988656", "text": "func (c *Ctx) GetMode() Modes {\n\treturn Modes(C.X_SSL_CTX_get_mode(c.ctx))\n}", "title": "" }, { "docid": "1b9a0f002cb2be12d546ad981095c8c0", "score": "0.5787415", "text": "func (recv *SizeGroup) GetMode() SizeGroupMode {\n\tretC := C.gtk_size_group_get_mode((*C.GtkSizeGroup)(recv.native))\n\tretGo := (SizeGroupMode)(retC)\n\n\treturn retGo\n}", "title": "" }, { "docid": "dc91f35a03057d4a772ba27eaee5b9a0", "score": "0.5763395", "text": "func (t *DurableTransaction) GetMode() TransactionMode {\n\treturn t.mode\n}", "title": "" }, { "docid": "06c565fe2aede0e3ecb72168d6d45434", "score": "0.5752188", "text": "func (conn MsgNetworkConn) GetMode() (res MsgNetworkConnMode) {\n\tres = C.msgnetwork_conn_get_mode(conn.inner)\n\truntime.KeepAlive(conn)\n\treturn\n}", "title": "" }, { "docid": "afff1bc633ffad26311f8de3ca826993", "score": "0.57354385", "text": "func (s *ServiceLevelObjectiveDefinition) GetViewMode() string {\n\tif s == nil || s.ViewMode == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ViewMode\n}", "title": "" }, { "docid": "c38516afea02e0382ccfb9e1613e5fbc", "score": "0.5716283", "text": "func (qrs qrSegment) getMode() modeType {\n\treturn qrs.Mode\n}", "title": "" }, { "docid": "a7542904321768f457ba2bd3cc561ecb", "score": "0.5714048", "text": "func (o FailoverGroupReadWriteEndpointFailoverPolicyPtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *FailoverGroupReadWriteEndpointFailoverPolicy) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "1a6b786a1a4f01649d0e53b6a5f0192d", "score": "0.57097846", "text": "func (o IndexerClusterSpecVolumesConfigMapItemsOutput) Mode() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v IndexerClusterSpecVolumesConfigMapItems) *int { return v.Mode }).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "ffa4e036fb32ad064ee2a58665747d35", "score": "0.5708248", "text": "func GetConsoleMode(handle uintptr) (uint32, error) {\n\tvar mode uint32\n\terr := syscall.GetConsoleMode(syscall.Handle(handle), &mode)\n\treturn mode, err\n}", "title": "" }, { "docid": "b1a4db08a69ad5918f5fe5ee4dfd9fcd", "score": "0.57012725", "text": "func (af *aggFunction) GetMode() AggFunctionMode {\n\treturn af.mode\n}", "title": "" }, { "docid": "1a03b84da60bdf02117a1a6a2ae05557", "score": "0.57006985", "text": "func (c *ChannelGroup) Mode() (Mode, error) {\n\tvar mode C.FMOD_MODE\n\tres := C.FMOD_ChannelGroup_GetMode(c.cptr, &mode)\n\treturn Mode(mode), errs[res]\n}", "title": "" }, { "docid": "a3dea74bae3662a2516bb8fc154826d1", "score": "0.5696384", "text": "func Mode() string {\n\treturn modeName\n}", "title": "" }, { "docid": "a3dea74bae3662a2516bb8fc154826d1", "score": "0.5696384", "text": "func Mode() string {\n\treturn modeName\n}", "title": "" }, { "docid": "a3dea74bae3662a2516bb8fc154826d1", "score": "0.5696384", "text": "func Mode() string {\n\treturn modeName\n}", "title": "" }, { "docid": "ea5a5f1a4b4bca398644c7133bd0b4c3", "score": "0.5690299", "text": "func (o BwdifConfigResponseOutput) Mode() pulumi.StringOutput {\n\treturn o.ApplyT(func(v BwdifConfigResponse) string { return v.Mode }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a3b56f113f2835e4ef01ed2eb9a2ca3a", "score": "0.5690124", "text": "func (o APISpecOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v APISpec) *string { return v.Mode }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "485fb4028d81ccd39db99bfe2b24fcf4", "score": "0.5685078", "text": "func (l *Line) GetOperationModeMap() (operationModeMap map[string]*OperationMode) {\n\toperationModeMap = map[string]*OperationMode{}\n\tfor _, operationModeRoutes := range l.OperationModeRoutesList {\n\t\toperationMode := operationModeRoutes.OperationMode\n\t\toperationModeMap[operationMode.Name] = operationModeRoutes.OperationMode\n\t}\n\treturn\n}", "title": "" }, { "docid": "a8e2c0943d10c7f56c8e3686437f5ee1", "score": "0.56814975", "text": "func (recv *TreeSelection) GetMode() SelectionMode {\n\tretC := C.gtk_tree_selection_get_mode((*C.GtkTreeSelection)(recv.native))\n\tretGo := (SelectionMode)(retC)\n\n\treturn retGo\n}", "title": "" }, { "docid": "0d13fac1c9dc05981badfb333ff323bd", "score": "0.56810683", "text": "func (f *torrentFile) GetMode() (mode int) {\n\tmode = f.mode\n\treturn\n}", "title": "" }, { "docid": "48599552680b55368ff78a2f4752c857", "score": "0.56723636", "text": "func (set ContinuousSet64) Mode() (modeKeys []float64, modeVal int, err error) {\n\tset.emptyDataSet()\n\tocurrenceMap := make(map[float64]int, 0)\n\tfor _, val := range set.Data {\n\t\tif _, ok := ocurrenceMap[val]; ok {\n\t\t\tocurrenceMap[val]++\n\t\t} else {\n\t\t\tocurrenceMap[val]++\n\t\t}\n\t}\n\n\tvar auxModeKeys []float64\n\tvar jumpBar int\n\tfor key, val := range ocurrenceMap {\n\t\tif val > jumpBar {\n\t\t\tjumpBar = val\n\t\t\tmodeKeys = append(auxModeKeys, key)\n\t\t} else if val == jumpBar {\n\t\t\tmodeKeys = append(modeKeys, key)\n\t\t}\n\n\t}\n\n\tmodeVal = ocurrenceMap[modeKeys[0]]\n\n\treturn modeKeys, modeVal, err\n}", "title": "" }, { "docid": "df552f84eaf002e9cee0eefc69bac320", "score": "0.5636398", "text": "func (o DeploymentPropertiesExtendedResponsePtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DeploymentPropertiesExtendedResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "c5c84ced4652626df2e26676105835df", "score": "0.5635517", "text": "func (gs *GameModeService) Get(id int, opts ...Option) (*GameMode, error) {\n\tif id < 0 {\n\t\treturn nil, ErrNegativeID\n\t}\n\n\tvar mode []*GameMode\n\n\topts = append(opts, SetFilter(\"id\", OpEquals, strconv.Itoa(id)))\n\terr := gs.client.post(gs.end, &mode, opts...)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"cannot get GameMode with ID %v\", id)\n\t}\n\n\treturn mode[0], nil\n}", "title": "" }, { "docid": "f8c3ba36fcffe67a638c0906890b27ee", "score": "0.56323504", "text": "func (o ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyPtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicy) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "65b3870bd03ba0258ab8dc149099ed2a", "score": "0.562824", "text": "func (m *DeviceConfiguration) GetDeviceManagementApplicabilityRuleDeviceMode()(DeviceManagementApplicabilityRuleDeviceModeable) {\n val, err := m.GetBackingStore().Get(\"deviceManagementApplicabilityRuleDeviceMode\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(DeviceManagementApplicabilityRuleDeviceModeable)\n }\n return nil\n}", "title": "" }, { "docid": "0c567f74bd9b6afe9ae7e9858710fa52", "score": "0.5628113", "text": "func (o YadifConfigResponseOutput) Mode() pulumi.StringOutput {\n\treturn o.ApplyT(func(v YadifConfigResponse) string { return v.Mode }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "f51f3b39d3e03b7f510de06f11de94fd", "score": "0.56278884", "text": "func (utdf UTDF) GetSystemMode() int {\n\tm := (int(utdf[48]) << 8) + int(utdf[49])\n\treturn m\n}", "title": "" }, { "docid": "44bdb278304136938a8758c804cd26ee", "score": "0.56095076", "text": "func (o ClientTlsSettingsPtrOutput) Mode() ClientTlsSettingsModePtrOutput {\n\treturn o.ApplyT(func(v *ClientTlsSettings) *ClientTlsSettingsMode {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Mode\n\t}).(ClientTlsSettingsModePtrOutput)\n}", "title": "" }, { "docid": "010b8d016e4970f3e115014e4957481c", "score": "0.5605784", "text": "func (o EkmConnectionOutput) KeyManagementMode() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *EkmConnection) pulumi.StringOutput { return v.KeyManagementMode }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "73622f0ae4f0f31a1d77e51fd901ea34", "score": "0.5602866", "text": "func (o *LWM2MDevice) GetSecurityMode() string {\n\tif o == nil || o.SecurityMode == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.SecurityMode\n}", "title": "" }, { "docid": "7272921a64bcc757de73d1c32f076502", "score": "0.56025124", "text": "func (o LicenseMasterSpecVolumesConfigMapItemsOutput) Mode() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v LicenseMasterSpecVolumesConfigMapItems) *int { return v.Mode }).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "bb48180ee648f98d0ce8a346537f9f55", "score": "0.5601504", "text": "func (o FailoverGroupReadonlyEndpointFailoverPolicyPtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *FailoverGroupReadonlyEndpointFailoverPolicy) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "5f65a6555207d79394587e75949e0f2a", "score": "0.55956906", "text": "func (o StandaloneSpecVolumesConfigMapItemsOutput) Mode() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v StandaloneSpecVolumesConfigMapItems) *int { return v.Mode }).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "12e22ff9fe6af5ac856a04ebc58749cc", "score": "0.557973", "text": "func (s *Status) Mode() Mode {\n\treturn Mode(s.read1(133))\n}", "title": "" }, { "docid": "e188b8931a876e446b347dd45b46bb1f", "score": "0.5577774", "text": "func (o SearchHeadClusterSpecVolumesConfigMapItemsOutput) Mode() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v SearchHeadClusterSpecVolumesConfigMapItems) *int { return v.Mode }).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "ad47c4a7ba8fea087f51899e83c47b48", "score": "0.55638385", "text": "func (c *ChannelModeSet) GetKey() string {\n\tval := c.GetMode(ChannelModeKey)\n\tif val == nil {\n\t\treturn \"\"\n\t}\n\treturn val.(string)\n\n}", "title": "" }, { "docid": "f57ce91c6e0bcbe88580e19f170582af", "score": "0.5549472", "text": "func (device *DCBrick) GetDriveMode() (mode DriveMode, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetDriveMode), buf.Bytes())\n\tif err != nil {\n\t\treturn mode, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 9 {\n\t\t\treturn mode, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 9)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn mode, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &mode)\n\n\t}\n\n\treturn mode, nil\n}", "title": "" }, { "docid": "a4382080aba077e46d8ac546450f77bb", "score": "0.55408144", "text": "func (o DeploymentPropertiesPtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DeploymentProperties) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "7d91f346eb6f98539d63652cd5e7fb1f", "score": "0.5540402", "text": "func (obj SwapChain) GetDisplayMode() (pMode DISPLAYMODE, err Error) {\n\tvar cpMode C.D3DDISPLAYMODE\n\terr = toErr(C.IDirect3DSwapChain9GetDisplayMode(obj.handle, &cpMode))\n\tpMode.fromC(&cpMode)\n\treturn\n}", "title": "" }, { "docid": "babb8677317b307811839a2c1878ab66", "score": "0.5537035", "text": "func ModeByName(name string) Mode {\n\treturn modes[name]\n}", "title": "" }, { "docid": "9505b88d59840a89010c8d35ea02e235", "score": "0.553045", "text": "func ModeString(s string) (Mode, error) {\n\tif val, ok := _ModeNameToValueMap[s]; ok {\n\t\treturn val, nil\n\t}\n\n\tif val, ok := _ModeNameToValueMap[strings.ToLower(s)]; ok {\n\t\treturn val, nil\n\t}\n\treturn 0, fmt.Errorf(\"%s does not belong to Mode values\", s)\n}", "title": "" }, { "docid": "d58b3a0c330f8a06730b892a58127cbf", "score": "0.5522743", "text": "func GetProcessMode(r *http.Request) (string, error) {\n\tmode := r.FormValue(\"mode\")\n\n\tswitch mode {\n\tcase \"serial\":\n\tcase \"parallel\":\n\t\treturn mode, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"Process mode not supported: %s\", mode)\n\t}\n\treturn \"\", nil\n}", "title": "" }, { "docid": "cd6b28ca7102dcdffdc26f8ac269e8d2", "score": "0.5506913", "text": "func (devs Devices) GetModes(modes []PinMode) error {\n\tfor i, dev := range devs {\n\t\tpinStart := i * PinCount\n\t\tif pinStart >= len(modes) {\n\t\t\tbreak\n\t\t}\n\t\tif err := dev.GetModes(modes[pinStart:]); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ad3452077c6c4fb807e3a51a8f0e79be", "score": "0.5500766", "text": "func (d *Decoder) Mode() int {\n\treturn d.mode\n}", "title": "" }, { "docid": "8ffd65cc17a75fc808651465ecfe2ac4", "score": "0.54715616", "text": "func (t *TerminalDevice) NewMode(ModeId uint16) (*TerminalDevice_Mode, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Mode == nil {\n\t\tt.Mode = make(map[uint16]*TerminalDevice_Mode)\n\t}\n\n\tkey := ModeId\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.Mode[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Mode\", key)\n\t}\n\n\tt.Mode[key] = &TerminalDevice_Mode{\n\t\tModeId: &ModeId,\n\t}\n\n\treturn t.Mode[key], nil\n}", "title": "" }, { "docid": "8ffd65cc17a75fc808651465ecfe2ac4", "score": "0.54715616", "text": "func (t *TerminalDevice) NewMode(ModeId uint16) (*TerminalDevice_Mode, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Mode == nil {\n\t\tt.Mode = make(map[uint16]*TerminalDevice_Mode)\n\t}\n\n\tkey := ModeId\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.Mode[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Mode\", key)\n\t}\n\n\tt.Mode[key] = &TerminalDevice_Mode{\n\t\tModeId: &ModeId,\n\t}\n\n\treturn t.Mode[key], nil\n}", "title": "" }, { "docid": "8ffd65cc17a75fc808651465ecfe2ac4", "score": "0.54715616", "text": "func (t *TerminalDevice) NewMode(ModeId uint16) (*TerminalDevice_Mode, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Mode == nil {\n\t\tt.Mode = make(map[uint16]*TerminalDevice_Mode)\n\t}\n\n\tkey := ModeId\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.Mode[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Mode\", key)\n\t}\n\n\tt.Mode[key] = &TerminalDevice_Mode{\n\t\tModeId: &ModeId,\n\t}\n\n\treturn t.Mode[key], nil\n}", "title": "" }, { "docid": "8ffd65cc17a75fc808651465ecfe2ac4", "score": "0.54715616", "text": "func (t *TerminalDevice) NewMode(ModeId uint16) (*TerminalDevice_Mode, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Mode == nil {\n\t\tt.Mode = make(map[uint16]*TerminalDevice_Mode)\n\t}\n\n\tkey := ModeId\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.Mode[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Mode\", key)\n\t}\n\n\tt.Mode[key] = &TerminalDevice_Mode{\n\t\tModeId: &ModeId,\n\t}\n\n\treturn t.Mode[key], nil\n}", "title": "" }, { "docid": "adec2efa1d1fee39cd64da94bc056329", "score": "0.54490936", "text": "func (o *SpatialMaterial) GetDepthDrawMode() SpatialMaterialDepthDrawMode {\n\t//log.Println(\"Calling SpatialMaterial.GetDepthDrawMode()\")\n\n\t// Build out the method's arguments\n\tptrArguments := make([]gdnative.Pointer, 0, 0)\n\n\t// Get the method bind\n\tmethodBind := gdnative.NewMethodBind(\"SpatialMaterial\", \"get_depth_draw_mode\")\n\n\t// Call the parent method.\n\t// enum.SpatialMaterial::DepthDrawMode\n\tretPtr := gdnative.NewEmptyInt()\n\tgdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)\n\n\t// If we have a return type, convert it from a pointer into its actual object.\n\tret := gdnative.NewIntFromPointer(retPtr)\n\treturn SpatialMaterialDepthDrawMode(ret)\n}", "title": "" }, { "docid": "e42f0a0b4457bc2f2411cff3026ee73b", "score": "0.5440013", "text": "func (m *NodeProfileMock) GetOpMode() (r MemberOpMode) {\n\tcounter := atomic.AddUint64(&m.GetOpModePreCounter, 1)\n\tdefer atomic.AddUint64(&m.GetOpModeCounter, 1)\n\n\tif len(m.GetOpModeMock.expectationSeries) > 0 {\n\t\tif counter > uint64(len(m.GetOpModeMock.expectationSeries)) {\n\t\t\tm.t.Fatalf(\"Unexpected call to NodeProfileMock.GetOpMode.\")\n\t\t\treturn\n\t\t}\n\n\t\tresult := m.GetOpModeMock.expectationSeries[counter-1].result\n\t\tif result == nil {\n\t\t\tm.t.Fatal(\"No results are set for the NodeProfileMock.GetOpMode\")\n\t\t\treturn\n\t\t}\n\n\t\tr = result.r\n\n\t\treturn\n\t}\n\n\tif m.GetOpModeMock.mainExpectation != nil {\n\n\t\tresult := m.GetOpModeMock.mainExpectation.result\n\t\tif result == nil {\n\t\t\tm.t.Fatal(\"No results are set for the NodeProfileMock.GetOpMode\")\n\t\t}\n\n\t\tr = result.r\n\n\t\treturn\n\t}\n\n\tif m.GetOpModeFunc == nil {\n\t\tm.t.Fatalf(\"Unexpected call to NodeProfileMock.GetOpMode.\")\n\t\treturn\n\t}\n\n\treturn m.GetOpModeFunc()\n}", "title": "" }, { "docid": "867c5fbd336783d5f41579246dbc89d9", "score": "0.5438703", "text": "func (o WorkloadMetadataConfigPtrOutput) Mode() WorkloadMetadataConfigModePtrOutput {\n\treturn o.ApplyT(func(v *WorkloadMetadataConfig) *WorkloadMetadataConfigMode {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Mode\n\t}).(WorkloadMetadataConfigModePtrOutput)\n}", "title": "" }, { "docid": "a310c9aaf9037ce6e33f1e9a9b87257f", "score": "0.54315984", "text": "func (v *VSwitchService) GetFailMode(bridge string) (FailMode, error) {\n\tout, err := v.exec(\"get-fail-mode\", bridge)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn FailMode(out), nil\n}", "title": "" }, { "docid": "4f00009cf55e0e5a3b3a471f23e6045c", "score": "0.5431315", "text": "func (o TargetEndpointSpecPtrOutput) Mode() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *TargetEndpointSpec) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Mode\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "49b774c53de928dc6a183d47634eb527", "score": "0.5430304", "text": "func (btn *ToggleButton) GetMode() bool {\n\treturn btn.Candy().Guify(\"gtk_toggle_button_get_mode\", btn).MustBool()\n}", "title": "" }, { "docid": "9148e25ead85ceea8a49f8635d5e9167", "score": "0.5426356", "text": "func (o GoogleCloudDatacatalogV1beta1ColumnSchemaResponseOutput) Mode() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GoogleCloudDatacatalogV1beta1ColumnSchemaResponse) string { return v.Mode }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c063cdef4ef96473941160f9a2035c58", "score": "0.5420848", "text": "func (o DBClusterOutput) Mode() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *DBCluster) pulumi.StringOutput { return v.Mode }).(pulumi.StringOutput)\n}", "title": "" } ]
24b513cc939012ae2da71a648f669e31
Sieve calculates all prime numbers up to given input using Sieve of Eratosthenes algorithm.
[ { "docid": "9ea3d899eb6ac447b36f04b7e5585ae8", "score": "0.7145783", "text": "func Sieve(number int) (primes []int) {\n\tsieve := make([]bool, number+1)\n\n\tfor i := 2; i <= number; i++ {\n\t\tif !sieve[i] {\n\t\t\tprimes = append(primes, i)\n\t\t\tfor j := i + i; j <= number; j += i {\n\t\t\t\tsieve[j] = true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn primes\n}", "title": "" } ]
[ { "docid": "e44545100be6ca68c642a76adcd150a9", "score": "0.7604039", "text": "func SolveSieve() {\n\tfmt.Println(\"Find prime numbers through nth number\")\n\tvar a uint\n\tfmt.Print(\"Enter Number: \")\n\t_, _ = fmt.Scan(&a)\n\tprimes := Sieve(a)\n\tfor _, prime := range primes {\n\t\tfmt.Printf(\"%d\\n\", prime)\n\t}\n\tfmt.Printf(\"\\n\")\n}", "title": "" }, { "docid": "23796a3ac3460f77a2f4bcd431cdfcaf", "score": "0.74704546", "text": "func Sieve(n int) int {\n\t// We use false for prime and\n\t// true for non-prime values in arr\n\tarr := make([]bool, n)\n\tfor i := range arr {\n\t\tarr[i] = true\n\t}\n\n\tlimit := int(math.Sqrt(float64(n)))\n\n\tfor i := 2; i <= limit; i++ {\n\t\tif arr[i] {\n\t\t\tfor j := i * i; j < n; j += i {\n\t\t\t\tarr[j] = false\n\t\t\t}\n\t\t}\n\t}\n\n\tcounter := 0\n\tfor _, p := range arr {\n\t\tif p {\n\t\t\tcounter += 1\n\t\t}\n\t}\n\n\t// Account for numbers 0 & 1 being in the array\n\treturn counter - 2\n}", "title": "" }, { "docid": "ca601796a2e341484ad5e70f115fa055", "score": "0.74644", "text": "func Sieve(limit int) []int {\n\n\tif limit < 2 {\n\t\treturn make([]int, 0)\n\t}\n\n\tif limit == 2 {\n\t\treturn []int{2}\n\t}\n\n\tsieve := make([]bool, limit+1)\n\tfor i := range sieve {\n\t\tsieve[i] = true\n\t}\n\tsieve[0] = false\n\tsieve[1] = false\n\n\t// start sieve operation\n\troot := int(math.Sqrt(float64(limit)))\n\tfor i := 2; i <= root; i++ {\n\t\tif sieve[i] {\n\t\t\tfor n := i * i; n < limit+1; n += i {\n\t\t\t\tsieve[n] = false\n\t\t\t}\n\t\t}\n\t}\n\n\tret := make([]int, 0)\n\n\tfor i, s := range sieve {\n\t\tif s {\n\t\t\tret = append(ret, i)\n\t\t}\n\t}\n\n\treturn ret\n\n}", "title": "" }, { "docid": "737bf12406f6d47c379e58974f321cf9", "score": "0.7453404", "text": "func SieveOfEratosthenes(n int) []bool {\n isPrime := make([]bool, n+1)\n for m:= 0; m <= n; m++ {\n isPrime[m] = true\n }//initialize n+1 elements to be true\n isPrime[0] = false\n isPrime[1] = false\n if n == 1 {\n return isPrime\n }\n for i := 2; i <= n; i++ {\n if isPrime[i] == true {\n for j := 2; j*i <= n; j ++ {\n isPrime[i*j] = false\n }\n }\n }\n return isPrime\n}", "title": "" }, { "docid": "f8fcd312c451297f1495bab65c8cdc7c", "score": "0.7429169", "text": "func Example_primes() {\n\t// Sieve of Eratosthenes\n\tconst n = 50\n\tsieve := bit.New().AddRange(2, n)\n\tsqrtN := int(math.Sqrt(n))\n\tfor p := 2; p <= sqrtN; p = sieve.Next(p) {\n\t\tfor k := p * p; k < n; k += p {\n\t\t\tsieve.Delete(k)\n\t\t}\n\t}\n\tfmt.Println(sieve)\n\t// Output: {2 3 5 7 11 13 17 19 23 29 31 37 41 43 47}\n}", "title": "" }, { "docid": "3ebf1c9f578223eb3f58703872ca44a5", "score": "0.74161", "text": "func sieveEratosthenes(n uint) []uint {\n\tvar primes []uint\n\tsieve := make(map[uint]bool)\n\n\tfor i := uint(2); i < n; i++ {\n\t\tsieve[i] = true\n\t}\n\n\tfor i := uint(2); i <= n; i++ {\n\t\tif cand := sieve[i]; cand {\n\t\t\tprimes = append(primes, i)\n\t\t\tfor k := 2 * i; k <= n; k += i {\n\t\t\t\tsieve[k] = false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn primes\n}", "title": "" }, { "docid": "2ca1d6aa3317ad6d0d6f1b013d0fa586", "score": "0.73911613", "text": "func primeSieve(p, i, n int, nums []int) int {\n\t// Enumerate the multiples of p by counting in increments of p from 2p to n,\n\t// and mark them in the list (these will be 2p, 3p, 4p, ...;\n\t// the p itself should not be marked).\n\n\t// If we have reached the maximum,\n\t// return the first number greater than p that is not marked\n\tif p+i >= n {\n\t\tfor _, v := range nums {\n\t\t\tif v > i && v != -1 {\n\t\t\t\treturn v\n\t\t\t}\n\t\t}\n\n\t\treturn p\n\t}\n\n\t// Mark in the list\n\tnums[p] = -1\n\n\t// Continue recursively\n\treturn primeSieve(p+i, i, n, nums)\n}", "title": "" }, { "docid": "ee1bc31623dc9b528bba93649fbb317e", "score": "0.7374105", "text": "func sieve(x int) []int {\n\tvar answer []int\n\t// Fill answer slice\n\tfor i := 2; i <= x; i++ {\n\t\tanswer = append(answer, i)\n\t}\n\t// Only need to run to the sqrt of x iterations\n\tlimit := int(math.Sqrt(float64(x)))\n\tfor i := 0; i < limit; i++ {\n\t\tcurrentNumber := answer[i]\n\t\tarrayLocation := i\n\t\t// Find next non-zero element in answer\n\t\tfor {\n\t\t\tif currentNumber == 0 {\n\t\t\t\tarrayLocation++\n\t\t\t\tcurrentNumber = answer[arrayLocation]\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// Turn every multiple of currentNumber into 0\n\t\t// since it's clearly not prime\n\t\tfor j := i + 1; j < len(answer); j++ {\n\t\t\t// Don't divide by zero and skip over self checks\n\t\t\tif answer[j] == 0 || answer[j] == currentNumber {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif answer[j]%currentNumber == 0 {\n\t\t\t\tanswer[j] = 0\n\t\t\t}\n\t\t}\n\t}\n\treturn answer\n}", "title": "" }, { "docid": "a5d89ae5216e61f90fb3f7cf457a5a13", "score": "0.73532236", "text": "func SieveOfEratosthenes(n int) []int {\n\tf := make([]bool, n)\n\tvar r []int\n\tfor i := 2; i <= int(math.Sqrt(float64(n))); i++ {\n\t\tif f[i] == false {\n\t\t\tfor j := i * i; j < n; j += i {\n\t\t\t\tf[j] = true\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 2; i < n; i++ {\n\t\tif f[i] == false {\n\t\t\tr = append(r, i)\n\t\t}\n\t}\n\treturn r\n}", "title": "" }, { "docid": "e35133b8a34013e3ad5de5d69f0f9434", "score": "0.7350504", "text": "func (p *Set) Sieve(max uint64) {\n\t// marking non-primes as true\n\tsieve := make([]bool, max)\n\tfor i := uint64(4); i < max; i++ {\n\t\tif i%2 == 0 || i%3 == 0 {\n\t\t\tsieve[i] = true\n\t\t}\n\t}\n\tfor p := uint64(5); p < max; p += 2 {\n\t\tif sieve[p] {\n\t\t\tcontinue\n\t\t}\n\t\tfor c := p * p; c < max; c += 2 * p {\n\t\t\tsieve[c] = true\n\t\t}\n\t}\n\tp.set = sieve\n}", "title": "" }, { "docid": "cf5e18ad7d124f223e2b9e5cfb0658af", "score": "0.73226947", "text": "func main() {\n\t//s := [n+1]int // this is the sieve. 0 means not visited, 1 means visited,\n\t// 2 means last visited - use 1 extra, to make things simpler...\n\tfor a := 2; a < n+1; a++ {\n\t\tfor b := a; b < n+1; b += a {\n\t\t\tif s[b] == 0 {\n\t\t\t\tif b < 20-a {\n\t\t\t\t\ts[b] = 1\n\t\t\t\t} else {\n\t\t\t\t\ts[b] = 2\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfor a := 1; a < n+1; a++ {\n\t\tif s[a] == 2 {\n\t\t\tfmt.Print(a,\" x \")\n\t\t\tprod *= a\n\t\t}\n\t}\n\tfmt.Println(prod)\n}", "title": "" }, { "docid": "66923690f9e4e8c850687c58a40b5b3b", "score": "0.71966255", "text": "func Sieve(limit int) []int {\n\tchecked := make([]bool, limit+1)\n\tprimes := []int{}\n\tfor i := 2; i <= limit; i++ {\n\t\tif !checked[i] {\n\t\t\tfor j := i + i; j <= limit; j += i {\n\t\t\t\tchecked[j] = true\n\t\t\t}\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n\treturn primes\n}", "title": "" }, { "docid": "1dbafb5fe065b5a09595c2e2da3ab14f", "score": "0.71941733", "text": "func PrimesSieve(threshold int) []int {\n\tinitarray := make([]int, 0)\n\tskip := map[int]bool{}\n\tfor h := 2; h <= threshold; h += 1 {\n\t\tfor i := h; i < threshold; i += h {\n\t\t\tif skip[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif h == i {\n\t\t\t\tinitarray = append(initarray, i)\n\t\t\t} else {\n\t\t\t\tskip[i] = true\n\t\t\t}\n\t\t}\n\t}\n\treturn initarray\n}", "title": "" }, { "docid": "74f51b7e3c1cb2ab13d0e6945bf62aa0", "score": "0.71863186", "text": "func Sieve() chan int {\n\t// The output values.\n\tout := make(chan int, 1024)\n\tout <- 2\n\tout <- 3\n\tout <- 5\n\tout <- 7\n\tout <- 11\n\n\t// The channel of all composites to be eliminated in increasing order.\n\tcomposites := make(chan int, 8046)\n\n\t// The feedback loop.\n\tprimes := make(chan int, 1024)\n\tprimes <- 11\n\n\t// Merge channels of multiples of `primes` into `composites`.\n\tgo func() {\n\t\th := make(PeekChHeap, 0, 8046)\n\t\tmin := 143\n\t\tfor {\n\t\t\tm := multiples(<-primes)\n\t\t\thead := <-m\n\t\t\tfor min < head {\n\t\t\t\tcomposites <- min\n\t\t\t\tminchan := heap.Pop(&h).(*PeekCh)\n\t\t\t\tmin = minchan.head\n\t\t\t\tminchan.head = <-minchan.ch\n\t\t\t\theap.Push(&h, minchan)\n\t\t\t}\n\t\t\tfor min == head {\n\t\t\t\tminchan := heap.Pop(&h).(*PeekCh)\n\t\t\t\tmin = minchan.head\n\t\t\t\tminchan.head = <-minchan.ch\n\t\t\t\theap.Push(&h, minchan)\n\t\t\t}\n\t\t\tcomposites <- head\n\t\t\theap.Push(&h, &PeekCh{<-m, m})\n\t\t}\n\t}()\n\n\t// Sieve out `composites` from `candidates`.\n\tgo func() {\n\t\t// In order to generate the nth prime we only need multiples of\n\t\t// primes ≤ sqrt(nth prime). Thus, the merging goroutine will\n\t\t// receive from this channel much slower than this goroutine\n\t\t// will send to it, making the buffer accumulates and blocks this\n\t\t// goroutine from sending to `primes`, causing a deadlock. The\n\t\t// solution is to use a proxy goroutine to do automatic buffering.\n\t\tprimes := sendproxy(primes)\n\n\t\tcandidates := coprime2357()\n\t\tp := <-candidates\n\n\t\tfor {\n\t\t\tc := <-composites\n\t\t\tfor p < c {\n\t\t\t\tprimes <- p\n\t\t\t\tout <- p\n\t\t\t\tp = <-candidates\n\t\t\t}\n\t\t\tif p == c {\n\t\t\t\tp = <-candidates\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn out\n}", "title": "" }, { "docid": "eb7949503a299fdfa6ba07655ea89b65", "score": "0.7176997", "text": "func sieve() {\n\n\t// make function is used to create a new channel\n\tch := make(chan int) // Create a new channel.\n\t\n\t// Start generate() as a subprocess.\n\t// 'go' statement starts generate(ch) function in a\n\t// independent thread\n\t\n\t// this is what is called a goroutine\n\t\n\tgo generate(ch)\n\t\n\t \n\t//for j := 1; j<20; j++ {\n\t\t// initialize prime with what comes from ch\n\t\tprime := <-ch\n\t\tfmt.Print(prime, \"\\n\")\n\t\t\n\t\t// next value of channel goes into another variable\n\t\tprime1 := <-ch\n\t\tfmt.Print(prime1, \"\\n\")\n\t\t\n\t//}\n}", "title": "" }, { "docid": "cd6767c7d82ab13c24b983a9ad85a949", "score": "0.71538293", "text": "func sieveOfEratosthenes(max int) []bool {\n\n\tprimes := make([]bool, max+1)\n\t// NOTE: all slice elements are initialized to false\n\n\tprimes[0] = true\n\tprimes[1] = true\n\tfor i := 2; i*i <= max; i++ {\n\t\tstep := i\n\t\tif primes[i] {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i + step; j <= max; j += step {\n\t\t\tprimes[j] = true\n\t\t}\n\t}\n\treturn primes\n}", "title": "" }, { "docid": "e93e12f6883fc5838972779f27f89c66", "score": "0.7146232", "text": "func Sieve(n, lowerLimit int) []int {\n\tvar prime = make([]bool, n+1)\n\tvar primes []int\n\t// fill it with true values\n\tfor i := range prime {\n\t\tprime[i] = true\n\t}\n\tfor i := 2; float64(i) <= math.Sqrt(float64(n)); i++ {\n\t\tif big.NewInt(int64(i)).ProbablyPrime(10) {\n\t\t\tfor j := i * i; j <= n; j += i {\n\t\t\t\tprime[j] = false\n\t\t\t}\n\t\t}\n\t}\n\tfor i, v := range prime {\n\t\tif v && i > lowerLimit {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n\treturn primes\n}", "title": "" }, { "docid": "08d6d61b8895eec6ca4790906dc03f2a", "score": "0.7126692", "text": "func getPrimes(limit int) *[]int {\n\tif limit < 2 {\n\t\treturn &[]int{}\n\t}\n\tif limit == 2 {\n\t\treturn &[]int{2}\n\t}\n\tif limit == 3 {\n\t\treturn &[]int{2, 3}\n\t}\n\tsieve := make([]bool, limit+1)\n\n\ttestingLimit := math.Ceil(math.Sqrt(float64(limit)))\n\n\tfor i := float64(0); i < testingLimit; i++ {\n\t\tfor j := float64(0); j < testingLimit; j++ {\n\n\t\t\tn := 4*int(math.Pow(i, 2)) + int(math.Pow(j, 2))\n\t\t\tif n <= limit && (n%12 == 1 || n%12 == 5) {\n\t\t\t\tsieve[n] = !sieve[n]\n\t\t\t}\n\n\t\t\tn = int(3*math.Pow(i, 2)) + int(math.Pow(j, 2))\n\t\t\tif n <= limit && n%12 == 7 {\n\t\t\t\tsieve[n] = !sieve[n]\n\t\t\t}\n\n\t\t\tn = int(3*math.Pow(i, 2)) - int(math.Pow(j, 2))\n\t\t\tif n <= limit && i > j && n%12 == 11 {\n\t\t\t\tsieve[n] = !sieve[n]\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 5; i < int(testingLimit); i++ {\n\t\tif sieve[i] == true {\n\t\t\tk := int(math.Pow(float64(i), 2))\n\t\t\tfor j := k; j <= limit; j += k {\n\t\t\t\tsieve[j] = false\n\t\t\t}\n\t\t}\n\t}\n\n\tprimes := []int{2, 3}\n\tfor i, isprime := range sieve {\n\t\tif isprime && i >= 5 {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n\treturn &primes\n}", "title": "" }, { "docid": "f8e70371924c3289a4b9e5ce20f358fa", "score": "0.7126147", "text": "func Sieve(limit int) []int {\n\tc := make([]bool, limit)\n\n\t// We only have to test numbers up to half the limit because all of them\n\t// will be multipied by at least 2\n\tfor p := 2; p < limit/2; p++ {\n\t\tif c[p] == composite {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor m := 2; m*p < limit; m++ {\n\t\t\tif c[p*m] == prime {\n\t\t\t\tc[p*m] = composite\n\t\t\t}\n\t\t}\n\t}\n\n\tprimes := []int{}\n\tfor i := 2; i < limit; i++ {\n\t\tif c[i] == prime {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n\n\treturn primes\n}", "title": "" }, { "docid": "1246cc9281a503f360705f0d9944d0f6", "score": "0.7102987", "text": "func Sieve(in <-chan int, out chan<- int, prime int) {\n\tfor {\n\t\ti := <-in\n\t\tif i%prime != 0 {\n\t\t\tout <- i\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ba33128427850a52e1e6e8ff7cb63e73", "score": "0.7078016", "text": "func eratosthenes(num int) []int {\n\t// initialise an array of with num elements\n\tsieve := make([]bool, num+2)\n\t// intialise slice to contain prime numbers\n\tprimes := make([]int, 0)\n\n\t// index = 2\n\t// while i <= num\n\t// for i := 2; i <= int(math.Sqrt(float64(num)))+1; i++ {\n\tfor i := 2; i <= num; i++ {\n\n\t\tif sieve[i] == false {\n\n\t\t\t// i should be a prime number, so add to list of primes\n\t\t\tprimes = append(primes, i)\n\n\t\t\tfor j := 2; i*j <= num; j++ {\n\t\t\t\tsieve[i*j] = true\n\t\t\t}\n\t\t}\n\t}\n\n\t// return the list of primes\n\treturn primes\n}", "title": "" }, { "docid": "a8fd56b2eebc4a452555c37d9407d5da", "score": "0.70351976", "text": "func SieveOfEratosthenes(n int) []int {\n\tprimeArray := make([]int, n+1)\n\tbound := int(math.Sqrt(float64(n)))\n\n\t// now, range over primeArray, and cross off multiples of first prime we see and iterate this process.\n\tfor p := 2; p <= bound; p++ {\n\t\tif primeArray[p] == 0 {\n\t\t\tprimeArray = CrossOffMultiples(primeArray, p)\n\t\t}\n\t}\n\n\treturn primeArray\n}", "title": "" }, { "docid": "fc6bfca0b6853cee1b4650e04bbc8bbd", "score": "0.69937843", "text": "func Sieve(limit int) []int {\n\tif limit < 2 {\n\t\treturn make([]int, 0)\n\t}\n\tcandidates := make(map[int]struct{})\n\tvar s struct{}\n\tfor i := 2; i <= limit; i++ {\n\t\tcandidates[i] = s\n\t}\n\n\tfor i := 2; i <= limit; i++ {\n\t\tfor j := i * 2; j <= limit; j += i {\n\t\t\tdelete(candidates, j)\n\t\t}\n\t}\n\n\tprimes := make([]int, len(candidates))\n\ti := 0\n\tfor k := range candidates {\n\t\tprimes[i] = k\n\t\ti++\n\t}\n\tsort.Ints(primes)\n\treturn primes\n}", "title": "" }, { "docid": "adf251710537a480fb4c8cae5236a25f", "score": "0.6972705", "text": "func SieveOfEratosthenes(n int) []bool {\n\tsieve := make([]bool, n+1)\n\tfor i := range sieve {\n\t\tsieve[i] = true\n\t}\n\tsieve[0] = false\n\tsieve[1] = false\n\n\tfor i, v := range sieve {\n\t\tif v {\n\t\t\tfor j := i + i; j < n+1; j += i {\n\t\t\t\tsieve[j] = false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn sieve\n}", "title": "" }, { "docid": "e2b6a6f1d0469ef2d4689b6209b58cf6", "score": "0.688463", "text": "func main(){\n\tstarttime := time.Now();\n\t\n\t//borrowing from 7\n\t//Sieve of Eratosthenes\n\t\n\tn := 2000000\n\ta := makeRange(1, n)\n\ta[0] = false\n\tfor i:=2; i<=int(math.Sqrt(float64(n))); i++{\n\t\tj:=(i*i)\n\t\tk:= 0\n\t\tfor j<=n{\n\t\t\ta[j-1] = false;\n\t\t\tk = k + 1\n\t\t\tj = i*i + k*i\n\t\t}\n\t}\n\t\n\t//sum\n\tsum :=0\n\tfor h := range a {\n\t\tif (a[h]){\n\t\t\t//shift up 1\n\t\t\tsum = sum + (h+1)\n\t\t}\n\t}\n\tfmt.Println(sum)\n\t\n\t\n\tfmt.Println(time.Since(starttime));\t\n}", "title": "" }, { "docid": "e72131f4e8ca51d5f2a4de3f74713dd2", "score": "0.68763286", "text": "func Problem146() {\n\t// Does not check consecutivity yet\n\tvar sum int\n\tvar square int\n\tsieve := pe.SieveOfEratosthenes(1000000*1000000 + 27)\n\n\tfor i := 1; i < 1000000; i++ {\n\t\tsquare = i * i\n\t\tswitch {\n\t\tcase !sieve[square+1]:\n\t\tcase !sieve[square+3]:\n\t\tcase !sieve[square+7]:\n\t\tcase !sieve[square+9]:\n\t\tcase !sieve[square+13]:\n\t\tcase !sieve[square+27]:\n\t\tdefault:\n\t\t\tsum += i\n\t\t}\n\t}\n\tfmt.Println(sum)\n}", "title": "" }, { "docid": "ee1c9fb946e800089c15107621279a55", "score": "0.68445766", "text": "func (ps *Sieve) Init(n uint64) *Sieve {\n\t// Prime number sieve, Eratosthenes (276-194 b.t. )\n\t// This implementation considers only multiples of primes\n\t// greater than 3, so the smallest value has to be mapped to 5.\n\t// Note: There is no multiplication operation in this function\n\t// and *no call to a sqrt* function.\n\n\tps.Lim = n\n\n\tif n <= smallCompositeLimit {\n\t\tps.isComposite = smallComposites\n\t\treturn ps\n\t}\n\n\tps.isComposite = make([]uint32, n/(3*bitsPerInt)+1)\n\tvar (\n\t\td1, d2, p1, p2, s, s2 uint64 = 8, 8, 3, 7, 7, 3\n\t\tl, c, max, inc uint64 = 0, 1, n / 3, 0\n\t\ttoggle bool\n\t)\n\n\tfor s < max { // -- scan the sieve\n\t\t// -- if a primes is found ...\n\t\tif (ps.isComposite[l>>log2Int] & (1 << (l & mask))) == 0 {\n\t\t\tinc = p1 + p2 // -- ... cancel its multiples\n\n\t\t\t// -- ... set c as composite\n\t\t\tfor c = s; c < max; c += inc {\n\t\t\t\tps.isComposite[c>>log2Int] |= 1 << (c & mask)\n\t\t\t}\n\n\t\t\tfor c = s + s2; c < max; c += inc {\n\t\t\t\tps.isComposite[c>>log2Int] |= 1 << (c & mask)\n\t\t\t}\n\t\t}\n\n\t\tl++\n\t\ttoggle = !toggle\n\t\tif toggle {\n\t\t\ts += d2\n\t\t\td1 += 16\n\t\t\tp1 += 2\n\t\t\tp2 += 2\n\t\t\ts2 = p2\n\t\t} else {\n\t\t\ts += d1\n\t\t\td2 += 8\n\t\t\tp1 += 2\n\t\t\tp2 += 6\n\t\t\ts2 = p1\n\t\t}\n\t}\n\treturn ps\n}", "title": "" }, { "docid": "d0adc5a2235eb10ef1bfa55048bb81c5", "score": "0.67101", "text": "func InitSieve(size uint) (*Sieve, error) {\n\t// There is no prime numbers when size is under 2\n\tif size < 2 {\n\t\treturn nil, &SieveError{\n\t\t\ttime.Now(),\n\t\t\t\"The size of numbers must be at least 2\",\n\t\t}\n\t}\n\n\tsize++\n\ts := &Sieve{}\n\ts.size = size\n\ts.num = make([]int, int(size))\n\ts.isPrime = make([]bool, int(size))\n\n\tfor k := range s.num {\n\t\ts.num[k] = k\n\t}\n\n\tfor k := range s.isPrime {\n\t\tif k <= 1 {\n\t\t\ts.isPrime[k] = false\n\t\t} else {\n\t\t\ts.isPrime[k] = true\n\t\t}\n\t}\n\treturn s, nil\n}", "title": "" }, { "docid": "27ff646921605d4f476ae1078303b7b5", "score": "0.66697884", "text": "func init() {\n\tsieveOfPrimes = SieveOfEratosthenes(maxprime)\n}", "title": "" }, { "docid": "1349178544f3c034fc9a3633800737c8", "score": "0.6655147", "text": "func TestSievePrimality(t *testing.T) {\n testXSievePrimality(Sieve, t)\n}", "title": "" }, { "docid": "155f28f1aa405d04a3deb14a819e53e1", "score": "0.66095185", "text": "func main() {\n\tconst max = 2000000\n\n\tprimes := euler.GetPrimesUpto(max)\n\tsum := 0\n\tfor _, p := range primes {\n\t\tsum += p\n\t}\n\tfmt.Println(sum)\n}", "title": "" }, { "docid": "ba257a1a69e406ac5eb364771b8ca73d", "score": "0.6519021", "text": "func Sieve(get chan int, ack chan bool) {\n prime := <- get\n fmt.Println(\"Found prime number\", prime)\n n := <- get\n var passDown = make(chan int)\n var ackUnder = make(chan bool)\n if n != sentinel {\n go Sieve(passDown, ackUnder)\n } else {\n ack <- true\n }\n for ; n != sentinel; n = <- get {\n if (n % prime) != 0 {\n passDown <- n\n }\n }\n passDown <- sentinel\n <- ackUnder\n ack <- true\n}", "title": "" }, { "docid": "05f3e11bd446e822b04a090a52fc9607", "score": "0.64141095", "text": "func countPrimes(n int) (int) {\n if (n <= 0) {\n return 0\n }\n\n sqrtN := math.Sqrt(float64(n))\n allNums := make([]bool, n+1)\n x := 0\n\n for i := 2; i <= int(sqrtN); i++ {\n if allNums[i] == false {\n for j := i*i; j <= n; j +=i {\n allNums[j] = true\n }\n }\n }\n\n for k := 2; k <= n; k++ {\n if !allNums[k] {\n x++\n }\n }\n\n return x\n}", "title": "" }, { "docid": "0f17586d6bdfe8dccfb9b7b134194bb8", "score": "0.6369263", "text": "func Primes() []int {\n\tprimes := []int{2}\nSearch:\n\tfor i := 3; i < (1 << Bits); i++ {\n\t\tfor _, prime := range primes {\n\t\t\tif (i % prime) == 0 {\n\t\t\t\tcontinue Search\n\t\t\t}\n\t\t}\n\t\tprimes = append(primes, i)\n\t}\n\treturn primes\n}", "title": "" }, { "docid": "f25e10d5b519c94ce34ea67e43504b98", "score": "0.63590235", "text": "func Eratosthenes(n int) (primes []int) {\n\tvar primesChannel = make(chan int)\n\tvar firstChan = make(chan int)\n\n\tgo accumulate(primesChannel, &primes)\n\tgo process(firstChan, primesChannel)\n\n\tfor i := 2; len(primes) < n; i++ {\n\t\tfirstChan <- i\n\t}\n\treturn primes\n}", "title": "" }, { "docid": "f199fbca1bdc659baabfc47f066d193f", "score": "0.63375473", "text": "func main() {\n\n\tvar i int = 3\n\n\t// the only obvious optimization was to not check even numbers (above 2),\n\t// so we start at 3 and initialize count to 1, since 2 is prime.\n\tfor count := 1; count < 10001; i += 2 {\n\t\tif utils.IsPrime(i) {\n\t\t\tcount += 1\n\t\t}\n\t}\n\n\t// should print: 104743\n\tfmt.Println(\"10001st Prime:\", i-2)\n}", "title": "" }, { "docid": "d187393431ae224ba96f93e4931fd6d5", "score": "0.63358295", "text": "func TestCSievePrimality(t *testing.T) {\n testXSievePrimality(CSieve, t)\n}", "title": "" }, { "docid": "2d87260d65a3d57772fd0cea22f9e49c", "score": "0.6289581", "text": "func primeGenerate(under int) []bool {\r\n a := make([]bool, under)\r\n for i := 2; i < under; i++ {\r\n a[i] = true\r\n }\r\n for p := 2; p*p <= under; p++ {\r\n if a[p] {\r\n j := p*p\r\n for j < under {\r\n a[j] = false\r\n j = j+p\r\n }\r\n }\r\n }\r\n return a\r\n}", "title": "" }, { "docid": "109855fcb2a8428eef4ee8b5795eed94", "score": "0.62861925", "text": "func generatePrimes() {\n\n\tvar prime = int64(2)\n\n\tfor i := 0; i < MAX; i++ {\n\t\tfor !isPrime(prime) {\n\t\t\tprime++\n\t\t}\n\n\t\tprimes = append(primes, prime)\n\t\tprime++\n\t}\n}", "title": "" }, { "docid": "71bad15efed03f250fac96e4f2828f27", "score": "0.6279589", "text": "func TestSieveOfEratosthenes(t *testing.T) {\n\tpexp := []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29} // the expected list of primes\n\tprec := SieveOfEratosthenes(30) // the recieved list of primes\n\n\tif len(pexp) != len(prec) {\n\t\tt.Errorf(\"Length of recieved list does not match that which is expected:\\n\")\n\t\tt.Errorf(\"\\texpected: %v\\n\", pexp)\n\t\tt.Errorf(\"\\trecieved: %v\\n\", prec)\n\t}\n\n\tfor i := range pexp {\n\t\tif pexp[i] != prec[i] {\n\t\t\tt.Errorf(\"Should have recieved %d, instead got %d\\n\", pexp[i], prec[i])\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d55d68cbbf3358ac12e93c13d4e62b25", "score": "0.6279366", "text": "func initPrimes(n int) {\n\tprimes = make([]bool, n+1)\n\tfor i := 2; i <= n; i++ {\n\t\tprimes[i] = true\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif primes[i] {\n\t\t\tfor j := i * 2; j <= n; j += i {\n\t\t\t\tprimes[j] = false\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "14b203950d2435894c8b9fb2e342049f", "score": "0.62730134", "text": "func main() {\n\taMax, bMax, nMax := 0, 0, 0\n\tprimes := ESieve(87400)\n\tbPos := ESieve(1000)\n\n\tfor a := -999; a < 1001; a += 2 {\n\t\tfor i := 1; i < len(bPos); i++ {\n\t\t\tfor j := 0; j < 2; j++ {\n\t\t\t\tn := 0\n\t\t\t\tsign := -1\n\t\t\t\tif j == 0 {\n\t\t\t\t\tsign = 1\n\t\t\t\t}\n\t\t\t\taodd := 0\n\t\t\t\tif i%2 == 0 {\n\t\t\t\t\taodd = -1\n\t\t\t\t}\n\t\t\t\tfor contains(primes, int(math.Abs(float64(n*n+(a+aodd)*n+sign*bPos[i])))) {\n\t\t\t\t\tn++\n\t\t\t\t}\n\t\t\t\tif n > nMax {\n\t\t\t\t\taMax = a\n\t\t\t\t\tbMax = bPos[i]\n\t\t\t\t\tnMax = n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"a: %d, b: %d, p: %d\", aMax, bMax, aMax*bMax)\n}", "title": "" }, { "docid": "845086ac9299527075c44e5e7021a9a8", "score": "0.62470144", "text": "func countPrimes(n int) (ret int) {\n\tif n < 3 {\n\t\treturn 0\n\t}\n\tprimes := make([]int, n+1)\n\tvis := make([]bool, n+1)\n\n\tfor i := 2; i < n; i++ {\n\t\tif !vis[i] {\n\t\t\tprimes[ret] = i\n\t\t\tret++\n\t\t}\n\t\tfor j := 0; j < ret && i*primes[j] < n; j++ {\n\t\t\tvis[i*primes[j]] = true\n\t\t\tif i%primes[j] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "f51c97cbe45d408c413c8cd1aa5996fa", "score": "0.6241523", "text": "func New(n uint64) *Sieve {\n\treturn new(Sieve).Init(n)\n}", "title": "" }, { "docid": "de48917759f466096329458e11ba1991", "score": "0.62274677", "text": "func primesCovering(maxPrime int) [] int {\n\tknownPrimes := make([]int, 0, 10000)\n\tif maxPrime > 2 {\n\t\tcandidate := 3\n\t\tknownPrimes = append(knownPrimes, candidate)\n\n\tFactorFound:\n\t\tfor knownPrimes[len(knownPrimes)-1] < maxPrime {\n\t\t\tcandidate += 2\n\t\t\tsqrtLimit := int(math.Sqrt(float64(candidate)) + 1)\n\t\t\tfor _, p := range knownPrimes {\n\t\t\t\tif p > sqrtLimit {\n\t\t\t\t\tbreak // any non-prime will have factor <= sqrt(candidate), therefore this one is prime\n\t\t\t\t}\n\t\t\t\tif candidate%p == 0 {\n\t\t\t\t\tcontinue FactorFound // next candidate\n\t\t\t\t}\n\t\t\t}\n\t\t\tknownPrimes = append(knownPrimes, candidate)\n\t\t}\n\t}\n\n\treturn append([] int{2}, knownPrimes...)\n}", "title": "" }, { "docid": "f040281e4f0730ddd5d2ffc22c320a89", "score": "0.6219245", "text": "func getPrimesUnder(number int) []int {\n var results []int\n counter := 0\n for i := 1; i <= number; i++ {\n for j := 1; j < i; j++ {\n if i % j == 0 {\n counter ++\n }\n }\n if ( counter < 2 ) {\n results = append(results, i)\n }\n counter = 0\n }\n return results\n}", "title": "" }, { "docid": "0770a3e0446a1314bf37f7ce2fb08b58", "score": "0.6178878", "text": "func TrivialPrimeFinder(n int) []bool {\n isPrime := make([]bool, n+1)\n isPrime[0] = false\n isPrime[1] = false\n if n == 1 {\n return isPrime\n }\n for i := 2; i < n + 1; i++ {\n isPrime[i] = true\n for j := 2; j < i; j++ {\n if isPrime[j] == true {\n if i % j == 0 {\n isPrime[i] = false\n break\n }\n }\n }\n }\n return isPrime\n}", "title": "" }, { "docid": "ee209650dc08f6695a93fea091b96978", "score": "0.61720645", "text": "func (ps *Sieve) Iterate(min, max uint64, visitor prime.Visitor) bool {\n\t// isComposite[0] ... isComposite[n] includes\n\t// 5 <= primes numbers <= 96*(n+1)+1\n\n\tswitch {\n\tcase max > ps.Lim:\n\t\treturn false\n\tcase max < 2:\n\t\treturn true\n\tcase min <= 2:\n\t\tmin = 2\n\t\tif visitor(2) {\n\t\t\treturn true\n\t\t}\n\t}\n\tswitch {\n\tcase max < 3:\n\t\treturn true\n\tcase min <= 3:\n\t\tif visitor(3) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tabsPos := uint64((min+(min+1)%2)/3 - 1)\n\tindex := absPos / bitsPerInt\n\tbitPos := absPos % bitsPerInt\n\ttoggle := bitPos&1 == 1\n\tprime := uint64(5 + 3*(bitsPerInt*index+bitPos) - bitPos&1)\n\n\tfor prime <= max {\n\t\tbitField := ps.isComposite[index] >> bitPos\n\t\tindex++\n\t\tfor ; bitPos < bitsPerInt; bitPos++ {\n\t\t\tif bitField&1 == 0 && visitor(prime) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\ttoggle = !toggle\n\t\t\tif toggle {\n\t\t\t\tprime += 2\n\t\t\t} else {\n\t\t\t\tprime += 4\n\t\t\t}\n\t\t\tif prime > max {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tbitField >>= 1\n\t\t}\n\t\tbitPos = 0\n\t}\n\treturn true\n}", "title": "" }, { "docid": "a504d7b5782512e09c1c1dc1c3372027", "score": "0.61632144", "text": "func ListOfPrimes(n int) []int {\n primes := make([]int, n)\n isPrime := SieveOfEratosthenes(n)\n i := 0\n for j:= 1; j <= n; j++ {\n if isPrime[j] == true {\n primes[i] = j\n i++\n }\n }\n return primes[:i]\n}", "title": "" }, { "docid": "cfd7b50b1420deb45e307fe8683d8099", "score": "0.61468035", "text": "func findPrimes(start int, end int, target int) {\n\n\tnonprimes := make(map[int]bool, end-start+1)\n\n\t// mark non primes from existing primes\n\tvar p int // mark down the number at the end of prime array\n\tfor _, p = range primes {\n\t\tvar i int\n\t\tif p*p >= start {\n\t\t\ti = p * p\n\t\t} else if start%p == 0 {\n\t\t\ti = start\n\t\t} else {\n\t\t\ti = (start/p + 1) * p\n\t\t}\n\t\tfor ; i <= end; i = i + p {\n\t\t\tnonprimes[i] = true\n\t\t}\n\t}\n\n\t// start adding new primes\n\tsqrt_end := int(math.Sqrt(float64(end)))\n\tvar i int\n\tif p < start {\n\t\ti = start\n\t} else { // p >=start, to address prime number 2\n\t\ti = p + 1\n\t}\n\tfor ; i <= sqrt_end; i++ { // use i*i <=end is also OK, if sqrt result not required\n\t\tif !nonprimes[i] {\n\t\t\tprimes = append(primes, i)\n\t\t\tif len(primes) == target {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// mark non primes\n\t\t\tfor j := i * i; j <= end; j = j + i {\n\t\t\t\tnonprimes[j] = true\n\t\t\t}\n\t\t}\n\t}\n\t// from sqrt(end) to end, the unmarked are primes\n\t// start might be larger than sqrt_end in previous step\n\tif sqrt_end+1 < start {\n\t\ti = start\n\t} else {\n\t\ti = sqrt_end + 1\n\t}\n\tfor ; i <= end; i++ {\n\t\tif !nonprimes[i] {\n\t\t\tprimes = append(primes, i)\n\t\t\tif len(primes) == target {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "17875f1bbf6d69c3735e85eb759fd516", "score": "0.6129207", "text": "func TestSmall(t *testing.T) {\n\t// reproduce 10 primes hardcoded right here.\n\tten := []uint64{2, 3, 5, 7, 11, 13, 17, 19, 23, 29}\n\tn := ten[9]\n\ts := New(n)\n\tif s.Limit() < n {\n\t\tt.Fatal(\"Limit of\", n, \"expected. Got\", s.Limit())\n\t}\n\t// check that the 10 are right\n\tvar i int\n\ts.Iterate(0, n, func(prime uint64) (termiate bool) {\n\t\tif prime != ten[i] {\n\t\t\tt.Fatal(\"Incorrect prime. Expected\", ten[i], \"got\", prime)\n\t\t}\n\t\ti++\n\t\treturn\n\t})\n\n\t// resieve, getting all precomputed primes\n\tn = 3 * bitsPerInt * uint64(len(smallComposites))\n\ts.Init(n)\n\n\t// s.isComposites shouldn't have grown\n\tif len(s.isComposite) != len(smallComposites) {\n\t\tt.Error(\"Sieve didn't recognize small n\")\n\t}\n\n\t// use handy PrimeGenerator function to save primes for next test\n\tsmallPrimes := prime.Primes(s)\n\n\t// test InitPi on boundary case of small np\n\ts.InitPi(uint64(len(smallPrimes)))\n\tif s.Lim != n {\n\t\tt.Error(\"SievePi didn't seem to work on small np\")\n\t}\n\n\t// asking for one more prime than was precomputed should trigger sieve.\n\ts.InitPi(1 + uint64(len(smallPrimes)))\n\tif len(s.isComposite) <= len(smallComposites) {\n\t\tt.Fatal(\"sieve didn't seem to work\", len(s.isComposite), len(smallComposites))\n\t}\n\n\t// check that primes from sieve match precomputed primes from\n\t// previous test. test IterateFunc early termination feature\n\t// in the process.\n\tvar j uint64\n\tok := s.Iterate(0, s.Lim, func(prime uint64) bool {\n\t\tif int(j) == len(smallPrimes) {\n\t\t\treturn true\n\t\t}\n\t\tif prime != smallPrimes[j] {\n\t\t\tt.Fatalf(\"sieve failed. expected %d for prime[%d]. got %d.\\n\",\n\t\t\t\tsmallPrimes[j], j, prime)\n\t\t}\n\t\tj++\n\t\treturn false\n\t})\n\tif !ok {\n\t\tt.Error(\"Iterate returned false on early termination.\")\n\t}\n}", "title": "" }, { "docid": "332fd3bfdb82472532ab76d65c9f5f40", "score": "0.6123715", "text": "func germainPrime(bits int, c chan *big.Int, quit chan int) (p *big.Int, err error) {\n\trandom := rand.Reader\n\n\tif bits < 2 {\n\t\terr = fmt.Errorf(\"crypto/rand: prime size must be at least 2-bit\")\n\t\treturn\n\t}\n\n\tb := uint(bits % 8)\n\tif b == 0 {\n\t\tb = 8\n\t}\n\n\tbytes := make([]byte, (bits+7)/8)\n\tp = new(big.Int)\n\tp1 := new(big.Int)\n\n\tbigMod := new(big.Int)\n\n\tfor {\n\t\tselect {\n\t\tcase <-quit:\n\t\t\treturn\n\t\tdefault:\n\t\t\t// this is to make it non-blocking\n\t\t}\n\n\t\t_, err = io.ReadFull(random, bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Clear bits in the first byte to make sure the candidate has a size <= bits.\n\t\tbytes[0] &= uint8(int(1<<b) - 1)\n\t\t// Don't let the value be too small, i.e, set the most significant two bits.\n\t\t// Setting the top two bits, rather than just the top bit,\n\t\t// means that when two of these values are multiplied together,\n\t\t// the result isn't ever one bit short.\n\t\tif b >= 2 {\n\t\t\tbytes[0] |= 3 << (b - 2)\n\t\t} else {\n\t\t\t// Here b==1, because b cannot be zero.\n\t\t\tbytes[0] |= 1\n\t\t\tif len(bytes) > 1 {\n\t\t\t\tbytes[1] |= 0x80\n\t\t\t}\n\t\t}\n\t\t// Make the value odd since an even number this large certainly isn't prime.\n\t\tbytes[len(bytes)-1] |= 1\n\n\t\tp.SetBytes(bytes)\n\n\t\t// Calculate the value mod the product of smallPrimes. If it's\n\t\t// a multiple of any of these primes we add two until it isn't.\n\t\t// The probability of overflowing is minimal and can be ignored\n\t\t// because we still perform Miller-Rabin tests on the result.\n\t\tbigMod.Mod(p, smallPrimesProduct)\n\t\tmod := bigMod.Uint64()\n\n\tNextDelta:\n\t\tfor delta := uint64(0); delta < 1<<20; delta += 2 {\n\t\t\tm := mod + delta\n\t\t\tfor _, prime := range smallPrimes {\n\t\t\t\tif m%uint64(prime) == 0 && (bits > 6 || m != uint64(prime)) {\n\t\t\t\t\tcontinue NextDelta\n\t\t\t\t}\n\n\t\t\t\t// 2*mod + 2*delta + 1\tshould not be divisible by smallPrimes as well\n\t\t\t\tm1 := (2*m + 1) % smallPrimesProduct.Uint64()\n\n\t\t\t\tif m1%uint64(prime) == 0 && (bits > 6 || m1 != uint64(prime)) {\n\t\t\t\t\tcontinue NextDelta\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif delta > 0 {\n\t\t\t\tbigMod.SetUint64(delta)\n\t\t\t\tp.Add(p, bigMod)\n\t\t\t}\n\n\t\t\tp1.Add(p, p)\n\t\t\tp1.Add(p1, big.NewInt(1))\n\t\t\tbreak\n\t\t}\n\n\t\t// There is a tiny possibility that, by adding delta, we caused\n\t\t// the number to be one bit too long. Thus we check BitLen\n\t\t// here.\n\t\tif p.ProbablyPrime(20) && p.BitLen() == bits {\n\t\t\tif p1.ProbablyPrime(20) {\n\t\t\t\t// waiting for a message about channel being closed is repeated here,\n\t\t\t\t// because it might happen that channel is closed after waiting at the\n\t\t\t\t// beginning of for loop above (but we want to have it there also,\n\t\t\t\t// otherwise it this goroutine might be searching for a germain\n\t\t\t\t// prime for some time after one was found by another goroutine\n\t\t\t\tselect {\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn\n\t\t\t\tdefault:\n\t\t\t\t\t// this is to make it non-blocking\n\t\t\t\t}\n\n\t\t\t\tc <- p\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "63e3bdfbbb708a64f06037b9a3577f42", "score": "0.6071891", "text": "func findPrimes(x int) []int {\n primes := []int{2}\n for i := 2; i < x; i++ {\n if isPrime(i) {\n primes = append(primes, i)\n }\n }\n return primes\n}", "title": "" }, { "docid": "831ba3607188c221dc69591234094d5e", "score": "0.6063809", "text": "func process(input chan int, primes chan int) {\n\tvar output chan int\n\tvar p = <-input\n\n\tprimes <- p\n\n\tfor {\n\t\tx := <-input\n\n\t\tif x%p != 0 {\n\t\t\tif output == nil {\n\t\t\t\toutput = make(chan int)\n\t\t\t\tgo process(output, primes)\n\t\t\t}\n\t\t\toutput <- x\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d3ae05a7d5f9eb6f7a57d66fb154f791", "score": "0.60277605", "text": "func seedThePrime(max int) (int, int) {\n\n // we find all primes up to limit\n\tprimes := sieveOfEratosthenes(max)\n\n // and we calculate all prime-consecutive sums that are smaller than limit\n sums := findAllSums(max, primes)\n l := len(sums)\n\n // we must now go through a list of sums and check if it is a prime and how\n // many primes are needed to get to that sum\n\tprime := 0\n num := 0\n for i := 0; i < l; i++ {\n if !primes[sums[i].sum] && sums[i].primes > num {\n prime = sums[i].sum\n num = sums[i].primes\n }\n\t}\n\treturn prime, num\n}", "title": "" }, { "docid": "1ac5195610cf258fd05be36669cdccae", "score": "0.6013616", "text": "func Prime(rand io.Reader, bits int) (p *big.Int, err error) {\n\tif bits < 2 {\n\t\terr = errors.New(\"crypto/rand: prime size must be at least 2-bit\")\n\t\treturn\n\t}\n\n\tb := uint(bits % 8)\n\tif b == 0 {\n\t\tb = 8\n\t}\n\n\tbytes := make([]byte, (bits+7)/8)\n\tp = new(big.Int)\n\n\tbigMod := new(big.Int)\n\n\tfor {\n\t\t_, err = io.ReadFull(rand, bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Clear bits in the first byte to make sure the candidate has a size <= bits.\n\t\tbytes[0] &= uint8(int(1<<b) - 1)\n\t\t// Don't let the value be too small, i.e, set the most significant two bits.\n\t\t// Setting the top two bits, rather than just the top bit,\n\t\t// means that when two of these values are multiplied together,\n\t\t// the result isn't ever one bit short.\n\t\tif b >= 2 {\n\t\t\tbytes[0] |= 3 << (b - 2)\n\t\t} else {\n\t\t\t// Here b==1, because b cannot be zero.\n\t\t\tbytes[0] |= 1\n\t\t\tif len(bytes) > 1 {\n\t\t\t\tbytes[1] |= 0x80\n\t\t\t}\n\t\t}\n\t\t// Make the value odd since an even number this large certainly isn't prime.\n\t\tbytes[len(bytes)-1] |= 1\n\n\t\tp.SetBytes(bytes)\n\n\t\t// Calculate the value mod the product of smallPrimes. If it's\n\t\t// a multiple of any of these primes we add two until it isn't.\n\t\t// The probability of overflowing is minimal and can be ignored\n\t\t// because we still perform Miller-Rabin tests on the result.\n\t\tbigMod.Mod(p, smallPrimesProduct)\n\t\tmod := bigMod.Uint64()\n\n\tNextDelta:\n\t\tfor delta := uint64(0); delta < 1<<20; delta += 2 {\n\t\t\tm := mod + delta\n\t\t\tfor _, prime := range smallPrimes {\n\t\t\t\tif m%uint64(prime) == 0 && (bits > 6 || m != uint64(prime)) {\n\t\t\t\t\tcontinue NextDelta\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif delta > 0 {\n\t\t\t\tbigMod.SetUint64(delta)\n\t\t\t\tp.Add(p, bigMod)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\t// There is a tiny possibility that, by adding delta, we caused\n\t\t// the number to be one bit too long. Thus we check BitLen\n\t\t// here.\n\t\tif p.ProbablyPrime(20) && p.BitLen() == bits {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bbaca4fb6c0b4be510d3eb6484bf2e5b", "score": "0.5955552", "text": "func newPrimeTester(limit int) *primeTester {\n\tt := primeTester{make([]bool,limit+1)}\n\t\n\t// Initialize everything as prime\n\tfor i,_ := range t.primes {\n\t\tt.primes[i] = true\n\t}\n\tt.primes[0], t.primes[1] = false, false\n\n\tfor i:=2;i<=limit;i++ {\n\t\tif t.primes[i] {\n\t\t\tfor j := i + i; j <= limit; j = j + i {\n\t\t\t\tt.primes[j] = false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &t\n}", "title": "" }, { "docid": "0ebcec651bc70ae32a1d2ecb22a63509", "score": "0.5940025", "text": "func primes (number uint64, primes_ch chan<- []uint64) {\n\n ch := make(chan uint64) // Create a new channel.\n go generate(ch) // Start generate() as a subprocess.\n\n primes := []uint64 {}\n\n for {\n prime := <-ch\n\n if prime > uint64(math.Sqrt(float64(number))) {\n primes_ch <- primes\n }\n\n primes = append(primes, prime)\n\n ch1 := make(chan uint64)\n go filter(ch, ch1, prime)\n ch = ch1\n }\n}", "title": "" }, { "docid": "04d7c43a1b0b7ae7ea1a6117abedcb48", "score": "0.59390175", "text": "func main() {\n\tcnt := 0\n\tfor i := 109900; i <= 126900; i += 17 {\n\t\tif isPrime(i) {\n\t\t\tfmt.Println(i)\n\t\t} else {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Printf(\"DONE: %d\\n\", cnt)\n}", "title": "" }, { "docid": "bb884d46e1873aa1cdc8f395187f3b50", "score": "0.5927939", "text": "func EratosthenesPlain(n int) []int {\n\t// phi is the count of prime numbers <=n approximated by x/ln(x).\n\tphi := int(math.Ceil((float64(n) / math.Log(float64(n)) * 1.2)))\n\tps := make([]int, phi)\n\tps[0], ps[1] = 2, 3\n\tsqrt := int(math.Sqrt(float64(n)))\n\tk := 2\n\tfor m := 3; m <= n; m += 2 {\n\t\tyes := true\n\t\tfor i := 0; i < k; i++ {\n\t\t\tif ps[i] > sqrt {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif m%ps[i] == 0 {\n\t\t\t\tyes = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif yes {\n\t\t\tps[k] = m\n\t\t\tk++\n\t\t}\n\t}\n\treturn ps[:k]\n}", "title": "" }, { "docid": "4ba27db9c0b35c15672060da134365cd", "score": "0.5915469", "text": "func primes(n int) chan int {\n\tc := make(chan int)\n\tgo func() {\n\t\tnumPrimes := 0\n\t\tfor i:=0;numPrimes<n;i++ {\n\t \tif prime(i){\n\t\t\tc <- i\t\n\t\t\tnumPrimes += 1\n\t\t\t}\n\t\t}\n\t\tclose(c)\n\t}()\n\t\n\treturn c\n\t\t\n}", "title": "" }, { "docid": "a64bce0ab64b465a90a3ffa181f5cd37", "score": "0.5884955", "text": "func main() {\n\tvar n = 1571\n\n\tvar inputErr error\n\tn, inputErr = askForConsoleInpunt()\n\tif inputErr != nil {\n\t\tfmt.Println(\"Error reading input:\", inputErr)\n\t\treturn\n\t}\n\n\tprimes := getPrimeNumbers(n)\n\n\tfmt.Println(\"Primes list:\")\n\tfmt.Println(primes)\n}", "title": "" }, { "docid": "4ff07db7d9382688a8566ac9acf6cb54", "score": "0.58649206", "text": "func NewSeive(n int64) Seive {\n\tprimes := make([]bool, n)\n\n\tfor i := int64(2); i < n; i++ {\n\t\tprimes[i] = true\n\t}\n\n\tfor p := int64(2); p <= utilities.Sqrt(n); p++ {\n\t\tif primes[p] {\n\t\t\tfor i := p * 2; i < n; i += p {\n\t\t\t\tprimes[i] = false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn Seive{\n\t\tPrimes: primes,\n\t}\n}", "title": "" }, { "docid": "d17a7e2de6da4e93bee0164ef8ce1970", "score": "0.5813105", "text": "func euler_7(max int) {\n\t\n\tnum := 1\n\tfor i := 1; i<=max; i++ {\n\t\tfor len(eulerlib.GetDivisors(num, true)) != 2 {\n\t\t\tnum++\n\t\t}\n\t\tfmt.Println(num, \"is the\", i, \"prime number\")\n\t\tnum++\n\t}\n}", "title": "" }, { "docid": "0cc123908fa8689a60eefbd7642a11f3", "score": "0.57876986", "text": "func main() {\n\t// Populate the maximum range of prime numbers. Must be greater than 2\n\tfmt.Println(\"Enter a maximum range to generate prime numbers: \")\n\tvar num_range int\n\tfmt.Scan(&num_range)\n\n\tfmt.Println(\"\\nThe prime numbers are: \")\n\tprimeNums := genPrime(num_range)\n\tfmt.Println(primeNums)\n\n\tfmt.Println(\"\\nSo, the multiples of five of the prime numbers are: \")\n\tmultiPrimes := multiPly(primeNums)\n\tfmt.Println(multiPrimes)\n\n\tfmt.Println(\"\\nAnd the sum of the prime numbers: \")\n\tfmt.Println(sumArr(primeNums))\n\n\tfmt.Println(\"\\nWhile the sum of the multiple of five of the prime numbers are: \")\n\tfmt.Println(sumArr(multiPrimes))\n}", "title": "" }, { "docid": "62abc5d60ddfd3e9cfc05f28dc3f675c", "score": "0.5756947", "text": "func randPrime(rand io.Reader, bits int) (p *big.Int) {\n\tb := uint(bits % 8)\n\tif b == 0 {\n\t\tb = 8\n\t}\n\n\tbytes := make([]byte, (bits+7)/8)\n\tp = new(big.Int)\n\n\tbigMod := new(big.Int)\n\n\tfor {\n\t\tif _, err := io.ReadFull(rand, bytes); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\t// Clear bits in the first byte to make sure the candidate has a size <= bits.\n\t\tbytes[0] &= uint8(int(1<<b) - 1)\n\t\t// Don't let the value be too small, i.e, set the most significant two bits.\n\t\t// Setting the top two bits, rather than just the top bit,\n\t\t// means that when two of these values are multiplied together,\n\t\t// the result isn't ever one bit short.\n\t\tif b >= 2 {\n\t\t\tbytes[0] |= 3 << (b - 2)\n\t\t} else {\n\t\t\t// Here b==1, because b cannot be zero.\n\t\t\tbytes[0] |= 1\n\t\t\tif len(bytes) > 1 {\n\t\t\t\tbytes[1] |= 0x80\n\t\t\t}\n\t\t}\n\t\t// Make the value odd since an even number this large certainly isn't prime.\n\t\tbytes[len(bytes)-1] |= 1\n\n\t\tp.SetBytes(bytes)\n\n\t\t// Calculate the value mod the product of smallPrimes. If it's\n\t\t// a multiple of any of these primes we add two until it isn't.\n\t\t// The probability of overflowing is minimal and can be ignored\n\t\t// because we still perform Miller-Rabin tests on the result.\n\t\tbigMod.Mod(p, smallPrimesProduct)\n\t\tmod := bigMod.Uint64()\n\n\tNextDelta:\n\t\tfor delta := uint64(0); delta < 1<<20; delta += 2 {\n\t\t\tm := mod + delta\n\t\t\tfor _, prime := range smallPrimes {\n\t\t\t\tif m%uint64(prime) == 0 && (bits > 6 || m != uint64(prime)) {\n\t\t\t\t\tcontinue NextDelta\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif delta > 0 {\n\t\t\t\tbigMod.SetUint64(delta)\n\t\t\t\tp.Add(p, bigMod)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\t// There is a tiny possibility that, by adding delta, we caused\n\t\t// the number to be one bit too long. Thus we check BitLen\n\t\t// here.\n\t\tif p.ProbablyPrime(20) && p.BitLen() == bits {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "aa2a261b74c02a398d0951ac77dc4ebe", "score": "0.5747808", "text": "func Primes(ctx context.Context) <-chan int {\n\tout := make(chan int)\n\tgo func() {\n\t\tdefer close(out)\n\t\tc := Range(ctx, 2, 1)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase i := <-c:\n\t\t\t\tc = FilterMultiple(i)(ctx, c)\n\t\t\t\tselect {\n\t\t\t\tcase out <- i:\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\treturn out\n}", "title": "" }, { "docid": "39981d20c9ac244352faf06a6b78e1b4", "score": "0.5683253", "text": "func (s *Sieve) Screen(ch chan *Sieve, err chan error) {\n\t// There is no prime numbers when size is under 2\n\tif s.size < 2 {\n\t\terr <- &SieveError{\n\t\t\ttime.Now(),\n\t\t\t\"The size of numbers must be at least 2\",\n\t\t}\n\t}\n\t// Need to initialize before using this method\n\tif s.isPrime[0] && s.isPrime[1] {\n\t\terr <- &SieveError{\n\t\t\ttime.Now(),\n\t\t\t\"Need to initialize the structure before using this method\",\n\t\t}\n\t}\n\tclose(err)\n\n\tfor i := 2; i < s.threshold(); i++ {\n\t\tif s.isPrime[i] {\n\t\t\ts.Prime = append(s.Prime, i)\n\n\t\t\tfor j := i * i; j < int(s.size); j += i {\n\t\t\t\ts.isPrime[j] = false\n\t\t\t\tch <- s\n\t\t\t}\n\t\t}\n\t}\n\tclose(ch)\n\n\tfor i := s.threshold(); i < int(s.size); i++ {\n\t\tif s.isPrime[i] {\n\t\t\ts.Prime = append(s.Prime, i)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "576131f357e591b62b70e89ee9b09739", "score": "0.56722677", "text": "func findAllSums(max int, primes []bool) []consecutiveSum {\n\n sums := make([]consecutiveSum, 0)\n\n for low := 2; low <= max; low++ {\n cnt, s := 0, 0\n if !primes[low] {\n for high := low; high <= max; high++ {\n if !primes[high] {\n s = s + high\n cnt++\n // we append the current sum...\n if s < max && cnt > 1 {\n sums = append(sums, consecutiveSum{s, cnt})\n }\n // if current sum exceeds limit...\n if s > max { break }\n }\n }\n }\n }\n return sums\n}", "title": "" }, { "docid": "7ce54e753ff203e86170a3679a25e0ed", "score": "0.566686", "text": "func FindPrime(input int) int {\n\tnumcheck := 0\n\tif (input % 2) == 0 {\n\t\tnumcheck = input - 1\n\t} else {\n\t\tnumcheck = input - 2\n\t}\n\tfor i := numcheck; i > 1; i = i - 2 {\n\t\tif checkIsPrime(i) {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "cb203d4c9a2da549787026726482ac70", "score": "0.56376797", "text": "func isPrime(i int64) bool{\n\tvar j int64 = 2\n\tlim := float64(i)\n\tfor float64(j)<=math.Sqrt(lim){\n\t\tif isMultiple(i,j){\n\t\t\treturn false\n\t\t}\n\t\tj++\n\t}\n\treturn true\n}", "title": "" }, { "docid": "bdda99bf02aea4e5ed067fcf0d8c9cb2", "score": "0.5628324", "text": "func Factorbase(value int) []*big.Int {\n var primes []*big.Int\n f := make([]bool, value)\n for i := 2; i <= int(math.Sqrt(float64(value))); i++ {\n if f[i] == false {\n for j := i * i; j < value; j += i {\n f[j] = true\n }\n }\n }\n for i := 2; i < value; i++ {\n if f[i] == false {\n primes = append(primes, big.NewInt(int64(i)))\n }\n }\n\n return primes\n}", "title": "" }, { "docid": "fdde0df9f9f0da53963f5395fe6f7797", "score": "0.5621096", "text": "func euler_10(n int) {\n\tsum := 0\n\tfor i := 2; i < n; i++ {\n\t\tif eulerlib.IsPrime(i) {\n\t\t\t//fmt.Println(i, \"is prime\")\n\t\t\tsum += i\n\t\t}\n\t}\n\t\n\tfmt.Println(\"Sum of all primes below\", n, \"is\", sum)\n}", "title": "" }, { "docid": "d080383dfe363ec184862ae5e63a7706", "score": "0.5582103", "text": "func TestIsPrime(t *testing.T) {\n\tvar x int\n\tvar i uint64\n\tvar result bool\n\tvar invalid uint64 = 0\n\n\tfile, _ := os.Open(\"files/primelist\")\n\tscanner := bufio.NewScanner(file)\n\tcache := make(map[uint64][]uint64)\n\tfor scanner.Scan() {\n\t\tx, _ = strconv.Atoi(scanner.Text())\n\t\ti = uint64(x)\n\n\t\t// Non-prime numbers should return more than two factors\n\t\tfor ; invalid < i; invalid++ {\n\t\t\t_, result = IsPrime(invalid, cache)\n\t\t\tassert.Equal(t, false, result, invalid, \" should not return true\")\n\t\t}\n\n\t\t// Primes should be the same as in the provided file\n\t\t_, result = IsPrime(i, cache)\n\t\tassert.Equal(t, true, result)\n\t\tinvalid++\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\tfmt.Println(err)\n\t}\n}", "title": "" }, { "docid": "eb3f71d4a3071d1ff1e7d5d46eebfbc2", "score": "0.5574546", "text": "func filterPrime(in <-chan int, out chan<- int, prime int) {\n\tfor {\n\t\ti := <-in\n\t\tif i%prime != 0 {\n\t\t\tout <- i\n\t\t}\n\t}\n}", "title": "" }, { "docid": "42c211796a11481377da7fb00e7a6c9a", "score": "0.5568472", "text": "func filter(in <-chan uint, out chan<- uint, prime uint) {\n\tfor {\n\t\ti := <-in // Receive value from 'in'.\n\t\tif i%prime != 0 {\n\t\t\tout <- i // Send 'i' to 'out'.\n\t\t}\n\t}\n}", "title": "" }, { "docid": "448be4a6c58f56896abaebf4e2a07fb7", "score": "0.5564336", "text": "func basic(l, u int) Primes {\n\n\tvar isPrime bool\n\tvar p Primes\n\n\t// Adjust lower bound: 2 is the smallest prime number\n\tif l < 3 {\n\t\tp = append(p, 2)\n\t\tl = 3\n\t}\n\n\t// Adjust lower bound: even numbers cannot be prime,\n\t// so no need to iterate over them\n\tif l%2 == 0 {\n\t\tl++\n\t}\n\n\tfor i := l; i <= u; i += 2 {\n\t\tisPrime = checkPrime(i)\n\t\tif isPrime {\n\t\t\tp = append(p, i)\n\t\t\tisPrime = false\n\t\t}\n\t}\n\n\treturn p\n}", "title": "" }, { "docid": "210402b13d6eda0e289b715140c19515", "score": "0.55538046", "text": "func Solve0007() {\n\tvar answer int\n\tvar primes []int = []int{}\n\tvar isPrime bool = true\n\tvar num int = 2\n\n\tfor len(primes) < 10002 {\n\t\tisPrime = true\n\n\t\tfor _, prime := range primes {\n\t\t\tif num%prime == 0 {\n\t\t\t\tisPrime = false\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t}\n\n\t\tif isPrime {\n\t\t\tprimes = append(primes, num)\n\t\t}\n\n\t\tnum++\n\t}\n\n\tanswer = primes[10000]\n\tfmt.Println(answer)\n}", "title": "" }, { "docid": "25ed68e462dd90a569c0ab041ed26b49", "score": "0.5553245", "text": "func Generate(size int) []int {\n\tprimes := make([]bool, size)\n\n\tfor i := range primes {\n\t\tprimes[i] = true\n\t}\n\n\tsqrt := int(math.Sqrt(float64(size)))\n\n\tfor i := 2; i <= sqrt; i++ {\n\t\tfor j := 2; j*i < size; j++ {\n\t\t\tif primes[i*j] {\n\t\t\t\tprimes[i*j] = false\n\t\t\t}\n\t\t}\n\t}\n\n\tvar arrayOfPrimes []int\n\n\tfor i := 2; i < size; i++ {\n\t\tif primes[i] {\n\t\t\tarrayOfPrimes = append(arrayOfPrimes, i)\n\t\t}\n\t}\n\n\treturn arrayOfPrimes\n}", "title": "" }, { "docid": "f3d4b468ffd7dea46dd4fcec9e68efb4", "score": "0.5553133", "text": "func GeneratePrimes(num int) []int {\n\tinChan := make(chan int)\n\tprimes := make([]int, 0, num)\n\tgo generate(inChan)\n\tfor len(primes) < num {\n\t\tprime := <-inChan\n\t\tprimes = append(primes, prime)\n\t\toutChan := make(chan int)\n\t\tgo filter(inChan, outChan, prime)\n\t\tinChan = outChan\n\t}\n\treturn primes\n}", "title": "" }, { "docid": "04df53f4882da713ba9066900296977e", "score": "0.555144", "text": "func prime(n int) bool {\n\tfor i := 2; i < n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "1de09dd7f5138dbb8b88f1422cae3d4e", "score": "0.55429524", "text": "func primeCount(n int64) int32 {\n\n\tif len(primes) == 0 {\n\t\tgeneratePrimes()\n\t}\n\n\tresult := int32(0)\n\tmarker := int64(1)\n\n\tfor i := 0; i < len(primes) && marker*primes[i] <= n; i++ {\n\t\tresult++\n\t\tmarker = marker * primes[i]\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "3938f6837667d8f10f2e72813f746d3b", "score": "0.5532899", "text": "func PrimeFactors(n int) []int {\n\t//limit := int(math.Sqrt(float64(n)))\n\ttn := n\n\tfactors := []int{1}\n\tfor tn > 1 {\n\t\tif sieveOfPrimes[tn] == 0 {\n\t\t\t// tn is the smallest remaining prime factor\n\t\t\tfactors = append(factors, tn)\n\t\t\ttn = 1 // will exit loop\n\t\t} else {\n\t\t\t// sieve[tn] is the smallest remaining prime factor\n\t\t\tfactors = append(factors, sieveOfPrimes[tn])\n\t\t\ttn = tn / sieveOfPrimes[tn]\n\t\t}\n\t}\n\treturn factors\n\n}", "title": "" }, { "docid": "112891210f80ebaa811ad77a0ef81941", "score": "0.55304325", "text": "func simpleSeive(n int) []int {\n\tresult := make([]bool, n+1)\n\tfor i := 2; i <= n; i++ {\n\t\tif !result[i] {\n\t\t\tfor j := 2 * i; j <= n; j = j + i {\n\t\t\t\tresult[j] = true\n\t\t\t}\n\t\t}\n\t}\n\toutput := make([]int, 0)\n\tfor i := 2; i <= n; i++ {\n\t\tif !result[i] {\n\t\t\toutput = append(output, i)\n\t\t}\n\t}\n\treturn output\n}", "title": "" }, { "docid": "3833d18b5cb7df8fbeab3230ef67ec4b", "score": "0.552494", "text": "func goFactor(work chan task, tab []uint8, report chan []int) {\n\n for {\n thisJob := <-work\n start := thisJob.start\n end := thisJob.end\n primes := thisJob.primes\n if start == 0 {\n return\n }\n\n found := make([]int, 2, 2+end-start) //store primes found\n found[0] = start //indentifies the results\n found[1] = end\n for i := start; i < end; i++ {\n //max is smallest int > sqrt(i)\n max := int(1 + math.Sqrt(float64(i)))\n for _, f := range primes { //try all primes passed to us\n if f >= max { //it's prime!\n tab[i] = 1\n found = append(found, i)\n break\n }\n if i%f == 0 { //it's not prime \n tab[i] = 1 + tab[i/f]\n break\n }\n }\n }\n report <- found[:] //we're done\n }\n}", "title": "" }, { "docid": "c2c81f65a6392a92b4644b30e7df7eca", "score": "0.5517458", "text": "func ListPrimes(size int) []bool {\n\tlist := make([]bool, size)\n\tlist[1] = true\n\tp := 2\n\tfor {\n\t\tpSq := p * p\n\t\tif pSq >= size {\n\t\t\tbreak\n\t\t}\n\n\t\tfor i := pSq; i < size; i += p {\n\t\t\tlist[i] = true // I multiple de p\n\t\t}\n\n\t\t// siguiente primo\n\t\tfor {\n\t\t\tp++\n\t\t\tif !list[p] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn list\n}", "title": "" }, { "docid": "f7a26978a36cbd7a5da5986e6061dec0", "score": "0.55064136", "text": "func fillPrimeNumber(n int) (slice []int) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tfmt.Println(\"Don't panic, everything is under control )\", r)\n\t\t}\n\t}()\n\n\tboolArr := make([]bool, maxPrimeIndex) //max prime index for first 500 numbers\n\tboolArr[0] = true // non prime\n\tboolArr[1] = true // non prime\n\n\t// fill bool array non prime numbers, prime = false for default\n\tfor i := 2; i < maxPrimeIndex; i++ {\n\t\tif !boolArr[i] {\n\t\t\tif i * i < maxPrimeIndex {\n\t\t\t\tfor j := i * i; j < maxPrimeIndex; j += i {\n\t\t\t\t\tboolArr[j] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// convert bool indexes to prime numbers\n\tprimeArr := make([]int, 0, n)\n\tfor i := 0; i < maxPrimeIndex; i++ {\n\t\tif !boolArr[i] {\n\t\t\tprimeArr = append(primeArr, i)\n\t\t\tn--\n\t\t\tif n == 0 {\n\t\t\t\tbreak // no need more than n\n\t\t\t}\n\t\t}\n\t}\n\treturn primeArr\n}", "title": "" }, { "docid": "99067d0112a53267f95e6e00287f7a1a", "score": "0.5504498", "text": "func isPrime(v int64) bool {\n\tsq := int64(math.Sqrt(float64(v))) + 1\n\tvar i int64\n\tfor i = 2; i < sq; i++ {\n\t\tif v%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "29846d87d83973f55af48e601dcd5af4", "score": "0.54794353", "text": "func (op *obcSieve) Initiated() {}", "title": "" }, { "docid": "7afbeaf52be31d9b051cf89abaa5b1e4", "score": "0.5467977", "text": "func filter(in <-chan int, out chan<- int, prime int) {\n\tfor {\n\t\ti := <-in // Receive value from 'in'.\n\t\tif i%prime != 0 {\n\t\t\tout <- i // Send 'i' to 'out'.\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9464e3439bb11312e9db93028f3afed5", "score": "0.54612017", "text": "func checkPrime(input int) bool {\n\t//we create the factorCount variable\n\tfactorCount := 0\n\t//We loop through all the numbers from 1 to the input\n\tfor i := 1; i <= input; i++ {\n\t\t//If the input is perfectly divisible by i, i is a factor of the input. This could easily be changed to add the value of i, which is a factor of the input to a slice which stores all the factors of the input.\n\t\tif input%i == 0 {\n\t\t\tfactorCount++\n\t\t}\n\t}\n\t//if there are only two factors of the input, the input is prime so the checkprime function should return the bool true. This could also be done using the len() of a slice if you decided to add the factors of the input to a slice.\n\tif factorCount == 2 {\n\t\treturn true\n\t} else {\n\t\t//Otherwise return false\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "bc98ad8aa85082d671bf96cf23db02b7", "score": "0.54606366", "text": "func ExampleanyThingDaisyChain_sieve() {\n\tch := make(chan anyThing) // Create a new channel.\n\tgo Generate(ch) // Launch Generate goroutine.\n\tfor i := 0; i < 10; i++ {\n\t\tprime := <-ch\n\t\tfmt.Println(prime)\n\t\tch = anyThingDaisyChain(ch, Filter(prime))\n\t}\n\t// Output:\n\t// 2\n\t// 3\n\t// 5\n\t// 7\n\t// 11\n\t// 13\n\t// 17\n\t// 19\n\t// 23\n\t// 29\n}", "title": "" }, { "docid": "fa68684dee789e7e7200377cc9cec070", "score": "0.54545397", "text": "func TestCountPrimes(t *testing.T) {\n\tvar v int\n\t\n\tv = countPrimes(5)\n\tif v != 3 {\n\t\tt.Error(\"Expected 3, got \", v)\n\t}\n\n\tv = countPrimes(10000)\n\tif v != 1229 {\n\t\tt.Error(\"Expected 1229, got \", v)\n\t}\n\n\tv = countPrimes(-6)\n\tif v != 0 {\n\t\tt.Error(\"Expected 0, got \", v)\n\t}\n}", "title": "" }, { "docid": "c60c5e1ebce0e3bc5d4da784ab6036bd", "score": "0.5451261", "text": "func primeFactors(n int) []int {\n\tif primes[n] {\n\t\treturn []int{n}\n\t}\n\tif result, ok := primeFactorsCache[n]; ok {\n\t\treturn result\n\t}\n\tvar result []int\n\tfor x := 2; x <= n/2; x++ {\n\t\tif primes[x] && n%x == 0 {\n\t\t\tresult = append(result, x)\n\t\t\tresult = append(result, primeFactors(n/x)...)\n\t\t\tbreak\n\t\t}\n\t}\n\tprimeFactorsCache[n] = result\n\treturn result\n}", "title": "" }, { "docid": "95dd4b3a6d825adc2403f13dc1570387", "score": "0.5448284", "text": "func isPrime(n int) bool {\n for i := int(2); i <= int(math.Sqrt(float64(n))); i++ {\n if n % i == 0 {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "60c519ebe8212352d7f3c1c25a3b982f", "score": "0.54443014", "text": "func primeCandidatesChan(from uint64, to uint64) <-chan uint64 {\n\tnumbers := make(chan uint64, 100)\n\n\tif from <= 2 {\n\t\tnumbers <- 2\n\t}\n\n\tif from % 2 == 0 {\n\t\tfrom++\n\t}\n\tif to % 2 == 0 {\n\t\tto--\n\t}\n\n\tgo func() {\n\t\tfor n := from; n <= to; n += 2 {\n\t\t\tnumbers <- n\n\t\t}\n\t\tclose(numbers)\n\t}()\n\treturn numbers\n}", "title": "" }, { "docid": "9eadec78769ea124afea9227d1daa7ac", "score": "0.5444086", "text": "func (s *sieve) Set(n uint64, x uint64) {\n\tbyte := uint64(n / 64)\n\tswitch x {\n\tcase 1:\n\t\ts.data[byte] |= 1 << (n % 64)\n\tdefault:\n\t\ts.data[byte] &= ^(1 << (n % 64))\n\t}\n\n}", "title": "" }, { "docid": "3534b25beb849ff501e8208600827cd4", "score": "0.5440794", "text": "func Phi(n int) int {\n\tif n == 0 {\n\t\tpanic(\"invalid input\")\n\t}\n\tif n == 1 {\n\t\treturn 1\n\t}\n\t// store numbers in range [2,n]\n\tnumbers := make([]int, n-1)\n\tfor i := range numbers {\n\t\tnumbers[i] = i + 2\n\t}\n\n\t// sieve method\n\tfor i, v := range numbers {\n\t\tif v == i+2 {\n\t\t\t// v is a prime\n\t\t\tfor j := i; j <= n-2; j += v {\n\t\t\t\tnumbers[j] /= v\n\t\t\t\tnumbers[j] *= v - 1\n\t\t\t}\n\t\t}\n\t}\n\n\treturn numbers[n-2]\n}", "title": "" }, { "docid": "19c880304e8824f99db15f91d94a5762", "score": "0.5426017", "text": "func genPrime(num_range int) []int {\n\tresult := []int{}\n\tfor i := 0; i <= num_range; i++ {\n\t\tif isPrime(i) {\n\t\t\tresult = append(result, i)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "9c18614b7f2891ca07c362909072c54a", "score": "0.5413419", "text": "func isPrime(x int64) bool {\n\tfor i := int64(2); i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" } ]
131cb20f5999961666963191b2190070
This function is used to create initial tree
[ { "docid": "31635021f6874758c443b845fdea08d4", "score": "0.6163106", "text": "func (node *Node) MakeTree(left, right int) {\n\n // Out of range\n if right < left {\n return\n }\n\n // Leaf node\n if left == right {\n node.val = array[left]; // Init value\n return\n }\n\n var lc, rc Node;\n mid := midIndx(left, right)\n lc.MakeTree(left, mid) // Init left child\n rc.MakeTree(mid + 1, right) // Init right child\n\n // link with parent\n node.lc = &lc\n node.rc = &rc\n\n // set parent value from left and right child\n if node.lc.val > node.rc.val {\n node.val = node.lc.val\n } else {\n node.val = node.rc.val\n }\n}", "title": "" } ]
[ { "docid": "c5db38c9d1708fba8cc517d3d5f3d7e4", "score": "0.7169754", "text": "func start_new_tree(key []byte, ptr *record) *node {\n\troot := &node{is_leaf: true}\n\troot.keys[0] = key\n\troot.ptrs[0] = ptr\n\troot.ptrs[ORDER-1] = nil\n\troot.parent = nil\n\troot.num_keys++\n\treturn root\n}", "title": "" }, { "docid": "9736ebe954822ffea6c82614a9079a28", "score": "0.70592296", "text": "func InitTree() Node {\n\ta := Node{value: \"A\"}\n\tb := Node{value: \"B\"}\n\tc := Node{value: \"C\"}\n\td := Node{value: \"D\"}\n\te := Node{value: \"E\"}\n\tf := Node{value: \"F\"}\n\tg := Node{value: \"G\"}\n\n\ta.left = &b\n\ta.right = &c\n\n\tb.left = &d\n\tb.right = &e\n\n\tc.left = &f\n\tc.right = &g\n\n\treturn a\n}", "title": "" }, { "docid": "0a3d4f1a975414f2d28e66ba61b3505d", "score": "0.6998146", "text": "func InitTree(data int32) *Node { //to implement interface return TreeImp\n\troot := Node{\n\t\tData: data,\n\t}\n\treturn &root\n}", "title": "" }, { "docid": "b186c4ab5c0c059f789efe648a6f5936", "score": "0.6674027", "text": "func CreateTree(depth int) *Node {\n if depth <= 0 {\n return &Node{}\n }\n return &Node{\n Left: CreateTree(depth - 1),\n Right: CreateTree(depth - 1),\n }\n}", "title": "" }, { "docid": "9ebb5187ea15e54f7d0448901771b601", "score": "0.66134006", "text": "func buildTree() *tree.Node {\n\n\troot := tree.Node{\n\t\tName: \"A\",\n\t\tChildren: []tree.Node{\n\t\t\ttree.Node{\n\t\t\t\tName: \"B\",\n\t\t\t\tChildren: []tree.Node{\n\t\t\t\t\ttree.Node{\n\t\t\t\t\t\tName: \"E\",\n\t\t\t\t\t},\n\t\t\t\t\ttree.Node{\n\t\t\t\t\t\tName: \"F\",\n\t\t\t\t\t},\n\t\t\t\t\ttree.Node{\n\t\t\t\t\t\tName: \"G\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\ttree.Node{\n\t\t\t\tName: \"C\",\n\t\t\t\tChildren: []tree.Node{\n\t\t\t\t\ttree.Node{\n\t\t\t\t\t\tName: \"H\",\n\t\t\t\t\t},\n\t\t\t\t\ttree.Node{\n\t\t\t\t\t\tName: \"I\",\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\ttree.Node{\n\t\t\t\tName: \"D\",\n\t\t\t\tChildren: []tree.Node{\n\t\t\t\t\ttree.Node{\n\t\t\t\t\t\tName: \"J\",\n\t\t\t\t\t},\n\t\t\t\t\ttree.Node{\n\t\t\t\t\t\tName: \"K\",\n\t\t\t\t\t},\n\t\t\t\t\ttree.Node{\n\t\t\t\t\t\tName: \"L\",\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t},\n\t}\n\n\treturn &root\n}", "title": "" }, { "docid": "b029d6b296ae825d66725436d2fd6858", "score": "0.65933585", "text": "func (node *Node) BuildTree(keys []string){\n var parent_key string\n\n totalKeys := len(keys)\n\n for i, key := range keys {\n prefixes := buildPrefixes(key)\n for i, prefix := range prefixes {\n if i == 0 {\n parent_key = \"ROOT\"\n } else {\n parent_key = prefixes[i-1]\n }\n\n node.addChild(prefix, parent_key)\n }\n ProgressBar(float64(i + 1), float64(totalKeys))\n }\n}", "title": "" }, { "docid": "1663387490bdbbf952b268124d12daa9", "score": "0.65689576", "text": "func InitializeTree(speciesNames []string) Datatypes.Tree {\n\tnumLeaves := len(speciesNames)\n\tvar t Datatypes.Tree // a Tree is []*Node\n\n\tt = make([]*Datatypes.Node, 2*numLeaves-1)\n\t// all of these pointers have default value of nil; we need to point them at nodes\n\n\t// we should create 2n-1 nodes.\n\tfor i := range t {\n\t\tvar vx Datatypes.Node\n\t\t// let's label the first numLeaves nodes with the appropriate species name.\n\t\t// by default, vx.age = 0.0, and its children are nil.\n\t\tif i < numLeaves {\n\t\t\t//at a leaf ... let's assign its label.\n\t\t\tvx.Label = speciesNames[i]\n\t\t} else {\n\t\t\t// let's just give it an unspecific name\n\t\t\tvx.Label = \"Ancestor species \" + strconv.Itoa(i)\n\t\t}\n\t\t// indexing the node\n\t\tvx.Num = i\n\t\t// one thing to do: point t[i] at vx\n\t\tt[i] = &vx\n\t}\n\n\treturn t\n}", "title": "" }, { "docid": "df1af86e1528b05c418d80454b6406b6", "score": "0.6531913", "text": "func main(){\n\troot :=treeNode{\"A1\",nil,nil}\n\n\troot.left = &treeNode{value:\"B2\"}\n\troot.right = &treeNode{value:\"C3\"}\n\troot.left.left = &treeNode{value:\"D4\"}\n\troot.left.right = &treeNode{value:\"E5\"}\n\troot.left.right.left = new(treeNode)\n\troot.left.right.left.value = \"F6\"\n\t \n\troot.right.left = &treeNode{value:\"G7\"}\n\troot.right.left.right = &treeNode{value:\"H8\"}\n\troot.right.right = &treeNode{value:\"I9\"}\n\n\troot.PreOrder()\n\troot.Inorder()\n\troot.Postorder()\n\n}", "title": "" }, { "docid": "688ecbfaba79bd50a25c9b951fb7e83a", "score": "0.646631", "text": "func createTree(curLevel int, lineBuf []PrintLine) ([]PrintLine, int) {\n\t//fmt.Printf(\"--> Enter createTree: curLevel %d, lineBufLen %d, line[0]: %s\\n\",\n\t// \tcurLevel, len(lineBuf), lineBuf[0].line)\n\tres := []PrintLine{}\n\tprocessed := 0\n\tlb := lineBuf\n\nLoop:\n\tfor len(lb) > 0 {\n\t\t// fmt.Printf(\" lb[0]: lnLevel %d, line '%s'\\n\", lb[0].lnLevel, lb[0].line)\n\t\tif lb[0].lnLevel < curLevel {\n\t\t\tbreak Loop\n\t\t} else if lb[0].lnLevel == curLevel {\n\t\t\tres = append(res, lb[0])\n\t\t\tprocessed++\n\t\t\tlb = lb[1:]\n\t\t} else {\n\t\t\tsubtree, p := createTree(lb[0].lnLevel, lb)\n\t\t\tres[len(res)-1].subtree = subtree\n\t\t\tprocessed += p\n\t\t\tlb = lb[p:]\n\t\t}\n\t}\n\t//fmt.Printf(\"<-- Return createTree: curLevel %d, lineBufLen %d, line[0]: %s\\n\",\n\t//\tcurLevel, len(lineBuf), lineBuf[0].line)\n\treturn res, processed\n}", "title": "" }, { "docid": "8e88bca00c74d1d69d06406a06e99fda", "score": "0.6458677", "text": "func buildTree() *TreeNode {\n\tnode1 := &TreeNode{Val:1}\n\tnode2 := &TreeNode{Val:2}\n\tnode3 := &TreeNode{Val:3}\n\tnode4 := &TreeNode{Val:4}\n\tnode5 := &TreeNode{Val:5}\n\tnode6 := &TreeNode{Val:6}\n\tnode7 := &TreeNode{Val:7}\n\n\tnode1.Left = node2\n\tnode1.Right = node3\n\tnode2.Left = node4\n\tnode2.Right = node5\n\tnode3.Left = node6\n\tnode3.Right = node7\n\treturn node1\n}", "title": "" }, { "docid": "8a77d0d59d4bfce42781a10f7889a1ce", "score": "0.64085495", "text": "func (cts *commitTreeStorage) newTree(t trillian.Tree) *tree {\n\tret := &tree{\n\t\tstore: cts.hbase,\n\t\tmeta: &t,\n\t}\n\n\t// we don't need to initialize these\n\t// k := unseqKey(t.TreeId)\n\t// k.(*kv).v = list.New()\n\t// ret.store.BufferedPut(\"subtrees\", k.(*kv).k, \"raw\", \"bytes\",\n\n\tk := hashToSeqKey(t.TreeId)\n\tk.(*kv).v = make(map[string][]int64, 1)\n\n\tvar treeIDMapBytes []byte\n\ttreeIDMapBytes, _ = json.Marshal(k.(*kv).v)\n\n\tret.store.BufferedPut(\"subtrees\", k.(*kv).k, \"raw\", \"bytes\", treeIDMapBytes)\n\tret.store.Flush()\n\n\treturn ret\n}", "title": "" }, { "docid": "4adcbe8780fcddb63d21262ef974a429", "score": "0.639928", "text": "func buildTree(preorder []int, inorder []int) *TreeNode {\n\tif len(preorder) == 0 {\n\t\treturn nil\n\t}\n\trootVal := preorder[0]\n\tlength := len(preorder)\n\troot := &TreeNode{\n\t\tVal: rootVal,\n\t\tLeft: nil,\n\t\tRight: nil,\n\t}\n\tif len(preorder) == 1 {\n\t\treturn root\n\t}\n\n\tidx := 0\n\tfor idx < length && inorder[idx] != rootVal {\n\t\tidx++\n\t}\n\tlfLength := idx\n\t//rgtLength := length - lfLength - 1\n\troot.Left = buildTree(preorder[1:1+lfLength], inorder[0:lfLength])\n\troot.Right = buildTree(preorder[lfLength+1:], inorder[idx+1:])\n\treturn root\n}", "title": "" }, { "docid": "c6ecc68e09dcb4552fd97f0caab2698e", "score": "0.6389576", "text": "func (t *RootedTree) Init() {\n\tfor i := 0; i < t.Size; i++ {\n\t\tt.Parent[i] = make([]int, t.maxLogSize)\n\t}\n\tt.dfs(t.Root, -1, 0)\n\tfor k := 0; k < t.maxLogSize-1; k++ {\n\t\tfor v := 0; v < t.Size; v++ {\n\t\t\tif t.Parent[v][k] == -1 {\n\t\t\t\tt.Parent[v][k+1] = -1\n\t\t\t} else {\n\t\t\t\tt.Parent[v][k+1] = t.Parent[t.Parent[v][k]][k]\n\t\t\t}\n\t\t}\n\t}\n\tt.initialized = true\n}", "title": "" }, { "docid": "b8591939ae26bec6700eed7449e1aef3", "score": "0.6373807", "text": "func newTreeNode(item ...interface{}) treeNode {\n\tif len(item) == 0 {\n\t\treturn Empty{}\n\t}\n\tfirst := item[0]\n\treturn (&Tree{first, s(first), Empty{}, Empty{}}).buildTreeFrom(\n\t\titem[1:])\n}", "title": "" }, { "docid": "b619927af314edac6d047bbce4690851", "score": "0.63610494", "text": "func Init() *Tree {\n\treturn &Tree{}\n}", "title": "" }, { "docid": "4ea31a4ce95ebe8712399af193ad81f6", "score": "0.6344699", "text": "func ConstructTree(tokens []string) *Node {\n\tvar head *Node\n\tvar last *Node\n\tfor _, token := range tokens {\n\t\tthis := Node{Value: token, Next: nil}\n\t\tif head == nil {\n\t\t\thead = &this\n\t\t} else {\n\t\t\tlast.Next = &this\n\t\t}\n\t\tlast = &this\n\t}\n\treturn head\n}", "title": "" }, { "docid": "e1c98dbe5d3b0a8cec57e2923a706b9e", "score": "0.6294163", "text": "func buildTree(preorder []int, inorder []int) *TreeNode {\n\tindexMap := make(map[int]int)\n\tfor i, val := range inorder {\n\t\tindexMap[val] = i\n\t}\n\treturn construct(preorder, 0, len(preorder)-1, inorder, 0, len(inorder)-1, indexMap)\n}", "title": "" }, { "docid": "e62759aa2cae7f9a642716b3aa232589", "score": "0.62789744", "text": "func NewTree(depth uint) *Tree {\n\t// tree has max elements 2^depth\n\ttoReturn := &Tree{depth: depth, maxElements: pow(2, int(depth))}\n\n\t// initialize data structs\n\ttoReturn.commitmentsIndices = make(map[Hash]uint)\n\ttoReturn.commitments = make(map[uint]Hash)\n\ttoReturn.EmptyRootsByHeight = make([]Hash, depth+1)\n\n\t// create empty roots\n\tvar node Hash // initialized to 0x000000..., empty leaf value\n\ttoReturn.EmptyRootsByHeight[0] = node\n\n\t// starting from the leaf to the root, each depth level emptyRoot value\n\t// equals a shaCompress of it's descendant\n\tfor h := uint(1); h <= depth; h++ {\n\t\tnode = shaCompress(node, node)\n\t\ttoReturn.EmptyRootsByHeight[h] = node\n\t}\n\n\treturn toReturn\n}", "title": "" }, { "docid": "918afb49676d60736d9fe08d990bc285", "score": "0.62695813", "text": "func (d *ltDom) initialize() {\n\ttype workItem struct {\n\t\tname vName\n\t\tparentName vName\n\t}\n\n\t// Initialize objs for mapping from object index back to Object.\n\ti := 0\n\td.p.ForEachObject(func(x Object) bool {\n\t\td.objs[i] = x\n\t\ti++\n\t\treturn true\n\t})\n\n\t// Add roots to the work stack, essentially pretending to visit\n\t// the pseudo-root, numbering it 0.\n\td.semis[pseudoRoot] = 0\n\td.parents[pseudoRoot] = -1\n\td.vertices[0] = pseudoRoot\n\tvar work []workItem\n\tfor i := 1; i < 1+d.nRoots; i++ {\n\t\twork = append(work, workItem{name: vName(i), parentName: 0})\n\t}\n\n\tn := vNumber(1) // 0 was the pseudo-root.\n\n\t// Build the spanning tree, assigning vertex numbers to each object\n\t// and initializing semi and parent.\n\tfor len(work) != 0 {\n\t\titem := work[len(work)-1]\n\t\twork = work[:len(work)-1]\n\n\t\tif d.semis[item.name] != -1 {\n\t\t\tcontinue\n\t\t}\n\n\t\td.semis[item.name] = n\n\t\td.parents[item.name] = item.parentName\n\t\td.vertices[n] = item.name\n\t\tn++\n\n\t\tvisitChild := func(_ int64, child Object, _ int64) bool {\n\t\t\tchildIdx, _ := d.p.findObjectIndex(d.p.Addr(child))\n\t\t\twork = append(work, workItem{name: vName(childIdx + d.nRoots + 1), parentName: item.name})\n\t\t\treturn true\n\t\t}\n\n\t\troot, object := d.findVertexByName(item.name)\n\t\tif root != nil {\n\t\t\td.p.ForEachRootPtr(root, visitChild)\n\t\t} else {\n\t\t\td.p.ForEachPtr(object, visitChild)\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "7122230dfc8616ce9533a331af0c8da1", "score": "0.62240654", "text": "func Create(degree int, dbPath string) *Tree {\n\tx := &Node{0, degree, true, []int{}, [][]byte{}, []*Node{}, nil}\n\treturn &Tree{x, dbPath, map[int]int{}}\n}", "title": "" }, { "docid": "986e4e553e68450a3407b9d6cce2e643", "score": "0.6212425", "text": "func New(item ...interface{}) immut.Seq { return newTreeNode(item...) }", "title": "" }, { "docid": "0bb99f17e9d4950917a07cb08185242b", "score": "0.61723715", "text": "func buildTree(preorder []int, inorder []int) *TreeNode {\n\tif len(preorder) == 0 || len(inorder) == 0 {\n\t\treturn nil\n\t}\n\n\trootVal := preorder[0]\n\trootIndex := 0\n\tfor rootVal != inorder[rootIndex] {\n\t\trootIndex++\n\t}\n\n\tleft := buildTree(preorder[1:rootIndex+1], inorder[0:rootIndex])\n\tright := buildTree(preorder[rootIndex+1:len(preorder)], inorder[rootIndex+1:len(inorder)])\n\treturn &TreeNode{\n\t\tVal: rootVal,\n\t\tLeft: left,\n\t\tRight: right,\n\t}\n}", "title": "" }, { "docid": "b6febc1466e300b8626ddb09b39edcdc", "score": "0.6168504", "text": "func New() *Tree {\n\treturn newTree(0, 0, 0777)\n}", "title": "" }, { "docid": "282ea14d3f19a5b3ea40be6d081f7d2c", "score": "0.6164282", "text": "func MakeTree(darr []Data) *Node {\n\tvar root *Node\n\tif darr == nil {\n\t\treturn root\n\t}\n\tfor idx := 0; idx < len(darr); idx++ {\n\t\troot = addtotree(root, darr[idx])\n\t}\n\treturn root\n}", "title": "" }, { "docid": "1bc7612a3769a94f81da4b9cfe79eaee", "score": "0.61636883", "text": "func (db *DB) InitStateTree(depth uint64, genesisAccounts []UserState) error {\n\t// calculate total number of leaves\n\ttotalLeaves := math.Exp2(float64(depth))\n\tif int(totalLeaves) != len(genesisAccounts) {\n\t\treturn errors.New(\"Depth and number of leaves do not match\")\n\t}\n\tdb.Logger.Debug(\"Attempting to init balance tree\", \"totalAccounts\", totalLeaves)\n\n\tvar err error\n\n\t// insert coodinator leaf\n\terr = db.InsertCoordinatorAccounts(&genesisAccounts[0], depth)\n\tif err != nil {\n\t\tdb.Logger.Error(\"Unable to insert coodinator account\", \"err\", err)\n\t\treturn err\n\t}\n\n\tvar insertRecords []interface{}\n\tprevNodePath := genesisAccounts[0].Path\n\n\tfor i := 1; i < len(genesisAccounts); i++ {\n\t\tpathToAdjacentNode, err := GetAdjacentNodePath(prevNodePath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgenesisAccounts[i].UpdatePath(pathToAdjacentNode)\n\t\tinsertRecords = append(insertRecords, genesisAccounts[i])\n\t\tprevNodePath = genesisAccounts[i].Path\n\t}\n\n\tdb.Logger.Info(\"Creating user accounts, might take a minute or two, sit back.....\", \"count\", len(insertRecords))\n\terr = gormbulk.BulkInsert(db.Instance, insertRecords, CHUNK_SIZE)\n\tif err != nil {\n\t\tdb.Logger.Error(\"Unable to insert accounts to DB\", \"err\", err)\n\t\treturn errors.New(\"Unable to insert accounts\")\n\t}\n\n\t// merkelise\n\t// 1. Pick all leaves at level depth\n\t// 2. Iterate 2 of them and create parents and store\n\t// 3. Persist all parents to database\n\t// 4. Start with next round\n\tfor i := depth; i > 0; i-- {\n\t\t// get all leaves at depth N\n\t\taccs, err := db.GetStatesAtDepth(i)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar nextLevelAccounts []interface{}\n\n\t\t// iterate over 2 at a time and create next level\n\t\tfor i := 0; i < len(accs); i += 2 {\n\t\t\tleft, err := HexToByteArray(accs[i].Hash)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tright, err := HexToByteArray(accs[i+1].Hash)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tparentHash, err := GetParent(left, right)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tparentPath := GetParentPath(accs[i].Path)\n\t\t\tnewAccNode := *newStateNode(parentPath, parentHash.String())\n\t\t\tnextLevelAccounts = append(nextLevelAccounts, newAccNode)\n\t\t}\n\t\terr = gormbulk.BulkInsert(db.Instance, nextLevelAccounts, CHUNK_SIZE)\n\t\tif err != nil {\n\t\t\tdb.Logger.Error(\"Unable to insert states to DB\", \"err\", err)\n\t\t\treturn errors.New(\"Unable to insert states\")\n\t\t}\n\t}\n\n\t// mark the root node type correctly\n\treturn nil\n}", "title": "" }, { "docid": "b9db87d6b2047a917dea66685ea4aab7", "score": "0.6159043", "text": "func newNode(val interface{}) *treeNode { return new(treeNode).init(val) }", "title": "" }, { "docid": "58234000ca112797a8be0c85fe13d6d0", "score": "0.6133738", "text": "func testTree1() *BTNode {\n\tone := &BTNode{Data: \"1\"}\n\ttwo := &BTNode{Data: \"2\"}\n\tthree := &BTNode{Data: \"3\"}\n\tfour := &BTNode{Data: \"4\"}\n\tfive := &BTNode{Data: \"5\"}\n\tsix := &BTNode{Data: \"6\"}\n\tseven := &BTNode{Data: \"7\"}\n\n\tfour.Left = two\n\tfour.Right = six\n\ttwo.Left = one\n\ttwo.Right = three\n\tsix.Left = five\n\tsix.Right = seven\n\n\treturn four\n}", "title": "" }, { "docid": "cb58414bbd0d88f2274eebf061cf5bb2", "score": "0.6130303", "text": "func newTreeNode() *treeNode {\n\treturn &treeNode{Children: map[string]*treeNode{}}\n}", "title": "" }, { "docid": "c8bd600d74a602e93352dedb9c30afbe", "score": "0.61301804", "text": "func CreateTree(vals []string) *TreeNode {\n\tj := 1\n\tnodes := make(map[int]*TreeNode)\n\troot := &TreeNode{}\n\tfor i, val := range vals {\n\t\tif j == 1 {\n\t\t\troot.Val, _ = strconv.Atoi(val)\n\t\t\tnodes[i] = root\n\t\t\tif i+j < len(vals) {\n\t\t\t\troot.Left = CreateNode(vals[i+j])\n\t\t\t\tnodes[i+j] = root.Left\n\t\t\t}\n\t\t\tif i+j+1 < len(vals) {\n\t\t\t\troot.Right = CreateNode(vals[i+j+1])\n\t\t\t\tnodes[i+j+1] = root.Right\n\t\t\t}\n\t\t\tj++\n\t\t\tcontinue\n\t\t}\n\t\tif i+j > len(vals)-1 {\n\t\t\treturn root\n\t\t}\n\n\t\tnode := nodes[i]\n\t\tnode.Left = CreateNode(vals[i+j])\n\t\tnodes[i+j] = node.Left\n\t\tif i+j == len(vals)-1 {\n\t\t\tbreak\n\t\t}\n\n\t\tnode.Right = CreateNode(vals[i+j+1])\n\t\tnodes[i+j+1] = node.Right\n\t\tif i+j+1 == len(vals)-1 {\n\t\t\tbreak\n\t\t}\n\t\tj++\n\t}\n\treturn root\n}", "title": "" }, { "docid": "3d16218a6b276756132930d7fbb0cb44", "score": "0.612101", "text": "func New(root string, tta bool, tsa bool, lu PathLookup, bs Blobstore) *Tree {\n\treturn &Tree{\n\t\tlookup: lu,\n\t\tblobstore: bs,\n\t\troot: root,\n\t\ttreeTimeAccounting: tta,\n\t\ttreeSizeAccounting: tsa,\n\t}\n}", "title": "" }, { "docid": "69cca1b9fa23df9f39bdd9070176620b", "score": "0.6114288", "text": "func (n *treeNode) init(val interface{}) *treeNode {\n\tn.left = nil\n\tn.right = nil\n\tn.bal = equal\n\tn.size = 1\n\tn.value = val\n\treturn n\n}", "title": "" }, { "docid": "7119423a578202d684c2be31ffd39a70", "score": "0.60985214", "text": "func New(root *Node) *Tree {\n\ttr := &Tree{}\n\troot.Black = true\n\ttr.Root = root\n\treturn tr\n}", "title": "" }, { "docid": "cb2ed07f13b1bdcda8546e48b7802d2e", "score": "0.60969657", "text": "func newAlohaTree(t *testing.T, db dbm.DB) (*MutableTree, types.CommitID) {\n\ttree, _ := NewMutableTree(db, cacheSize)\n\tfor k, v := range treeData {\n\t\ttree.Set([]byte(k), []byte(v))\n\t}\n\tfor i := 0; i < nMoreData; i++ {\n\t\tkey := rand2.Bytes(12)\n\t\tvalue := rand2.Bytes(50)\n\t\ttree.Set(key, value)\n\t}\n\thash, ver, err := tree.SaveVersion()\n\trequire.Nil(t, err)\n\treturn tree, types.CommitID{Version: ver, Hash: hash}\n}", "title": "" }, { "docid": "828995d350c7cca43be41d0d9f19285b", "score": "0.6083719", "text": "func buildTree(browser *ole.IDispatch, branch *Tree) {\n\tvar count int32\n\n\tlogger.Println(\"Entering branch:\", branch.Name)\n\n\t// loop through leafs\n\toleutil.MustCallMethod(browser, \"ShowLeafs\").ToIDispatch()\n\tcount = oleutil.MustGetProperty(browser, \"Count\").Value().(int32)\n\n\tlogger.Println(\"\\tLeafs count:\", count)\n\n\tfor i := 1; i <= int(count); i++ {\n\n\t\titem := oleutil.MustCallMethod(browser, \"Item\", i).Value()\n\t\ttag := oleutil.MustCallMethod(browser, \"GetItemID\", item).Value()\n\n\t\tl := Leaf{Name: item.(string), Tag: tag.(string)}\n\n\t\tlogger.Println(\"\\t\", i, l)\n\n\t\tbranch.Leaves = append(branch.Leaves, l)\n\t}\n\n\t// loop through branches\n\toleutil.MustCallMethod(browser, \"ShowBranches\").ToIDispatch()\n\tcount = oleutil.MustGetProperty(browser, \"Count\").Value().(int32)\n\n\tlogger.Println(\"\\tBranches count:\", count)\n\n\tfor i := 1; i <= int(count); i++ {\n\n\t\tnextName := oleutil.MustCallMethod(browser, \"Item\", i).Value()\n\n\t\tlogger.Println(\"\\t\", i, \"next branch:\", nextName)\n\n\t\t// move down\n\t\toleutil.MustCallMethod(browser, \"MoveDown\", nextName)\n\n\t\t// recursively populate tree\n\t\tnextBranch := Tree{nextName.(string), branch, []*Tree{}, []Leaf{}}\n\t\tbranch.Branches = append(branch.Branches, &nextBranch)\n\t\tbuildTree(browser, &nextBranch)\n\n\t\t// move up and set branches again\n\t\toleutil.MustCallMethod(browser, \"MoveUp\")\n\t\toleutil.MustCallMethod(browser, \"ShowBranches\").ToIDispatch()\n\t}\n\n\tlogger.Println(\"Exiting branch:\", branch.Name)\n\n}", "title": "" }, { "docid": "0814262a1952df79579c678424ce9e14", "score": "0.6066799", "text": "func Tree(inp <-chan Chunk) *Node {\n\tlevels := []*Node{new(Node)}\n\n\tfor chunk := range inp {\n\t\tlevels[0].Leaves = append(levels[0].Leaves, chunk.Bytes)\n\t\tfor _, n := range levels {\n\t\t\tn.Size += uint64(chunk.Len)\n\t\t}\n\t\tfor i := uint(0); i < chunk.Level; i++ {\n\t\t\tif i == uint(len(levels))-1 {\n\t\t\t\tlevels = append(levels, &Node{\n\t\t\t\t\tSize: levels[i].Size,\n\t\t\t\t})\n\t\t\t}\n\t\t\tlevels[i+1].Nodes = append(levels[i+1].Nodes, levels[i])\n\t\t\tlevels[i] = &Node{\n\t\t\t\tOffset: levels[i+1].Offset + levels[i+1].Size,\n\t\t\t}\n\t\t}\n\t}\n\tif len(levels[0].Leaves) > 0 {\n\t\tfor i := 0; i < len(levels)-1; i++ {\n\t\t\tlevels[i+1].Nodes = append(levels[i+1].Nodes, levels[i])\n\t\t}\n\t}\n\n\troot := levels[len(levels)-1]\n\tfor len(root.Nodes) == 1 {\n\t\troot = root.Nodes[0]\n\t}\n\n\treturn root\n}", "title": "" }, { "docid": "28ecf2f8f81de259ff255513078f6c36", "score": "0.6035135", "text": "func sampleTree() TreeMap {\n\ta := TreeMap{label: \"a (40)\", size: 40}\n\tb := TreeMap{label: \"b (30)\", size: 30}\n\tc := TreeMap{label: \"c (10)\", children: []TreeMap{a, b}}\n\tc.setSize(10)\n\n\td := TreeMap{label: \"d (10)\", size: 10}\n\te := TreeMap{label: \"e (20)\", size: 20}\n\tf := TreeMap{label: \"f (15)\", size: 15}\n\tg := TreeMap{label: \"g (15)\", size: 15}\n\th := TreeMap{label: \"h (15)\", size: 15}\n\ti := TreeMap{label: \"i (30)\", size: 30}\n\tj := TreeMap{label: \"j (0)\", children: []TreeMap{d, e, f, g, h, i}}\n\tj.setSize(0)\n\n\tk := TreeMap{label: \"k (10)\", size: 10}\n\tl := TreeMap{label: \"l (20)\", size: 20}\n\tm := TreeMap{label: \"m (12)\", size: 15}\n\tn := TreeMap{label: \"n (16)\", size: 15}\n\to := TreeMap{label: \"o (15)\", size: 15}\n\tp := TreeMap{label: \"p (15)\", children: []TreeMap{k, l, m, n, o}}\n\tp.setSize(15)\n\n\troot := TreeMap{label: \"root (0)\", children: []TreeMap{c, j, p}}\n\troot.setSize(0)\n\n\treturn root\n}", "title": "" }, { "docid": "6841549c39b247753c73951214a6ac62", "score": "0.6027898", "text": "func NewTree(db *sql.DB) *Tree {\n\tt := &Tree{\n\t\tDB: db,\n\t}\n\treturn t\n}", "title": "" }, { "docid": "804a601db371ebd662e1945a78626f88", "score": "0.60183907", "text": "func NewTree(p string) *Node {\n\treturn &Node{\n\t\tTitle: \"@root\",\n\t\tRawURL: p,\n\t\tSort: 0,\n\t\tType: 0,\n\t}\n}", "title": "" }, { "docid": "f7f3f5675d6a453ec534cfcdf9cc887d", "score": "0.60120136", "text": "func makeTree(p []int) map[int]*Node {\n\tm := make(map[int]*Node)\n\tfor i := len(p) - 1; 0 < i; i-- {\n\t\tif m[i] == nil {\n\t\t\tm[i] = &Node{i, p[i], false}\n\t\t\tfor x := p[i]; (0 < x) && m[x] == nil; x = p[x] {\n\t\t\t\tm[x] = &Node{x, p[x], true}\n\t\t\t}\n\t\t}\n\t}\n\tm[0] = &Node{0, 0, true}\n\treturn m\n}", "title": "" }, { "docid": "dbe48fe2946204e395ee1e320f997f6b", "score": "0.6007067", "text": "func (imf *ImmutableForest) newTree(prefix []byte) *RWTree {\n\tp := string(prefix)\n\ttree := NewRWTree(NewPrefixDB(imf.treeDB, p), imf.cacheSize)\n\timf.treeCache.Add(p, tree)\n\treturn tree\n}", "title": "" }, { "docid": "cc375fc42048af473b9255d4f6d8472d", "score": "0.59886724", "text": "func node(label int, value string) *Tree {\n node := new(Tree)\n node.Label = label\n node.Value = value\n return node\n}", "title": "" }, { "docid": "a34da3e49872a6f2fd5b365c7d9e86c0", "score": "0.595466", "text": "func buildTree(tab []int, start, end int) *BinaryNode {\n\tif start > end {\n\t\treturn nil\n\t}\n\tmid := (start + end) / 2\n\troot := &BinaryNode{\n\t\tvalue: tab[mid],\n\t\tindex: mid,\n\t\tleft: nil,\n\t\tright: nil,\n\t}\n\troot.left = buildTree(tab, start, mid-1)\n\troot.right = buildTree(tab, mid+1, end)\n\treturn root\n}", "title": "" }, { "docid": "3e6c0d76993c90912c2a75722017c1b0", "score": "0.59367067", "text": "func main() {\n\ttree := CreateNode(1)\n\tn2 := CreateNode(2)\n\tn3 := CreateNode(3)\n\tn4 := CreateNode(4)\n\tn5 := CreateNode(5)\n\tn6 := CreateNode(6)\n\tn7 := CreateNode(7)\n\tn8 := CreateNode(8)\n\ttree.Left = n2\n\ttree.Right = n3\n\tn2.Left = n4\n\tn2.Right = n5\n\tn3.Right = n6\n\tn5.Left = n7\n\tn7.Right = n8\n\tfmt.Println(\"preOrder\")\n\tPreOrder(tree)\n\tfmt.Println(\"\\n ============ \")\n\n\tfmt.Println(\"PreOrderNotRecursion\")\n\tPreOrderNotRecursion(tree)\n\tfmt.Println(\"\\n ============ \")\n\n\tfmt.Println(\"midOrder\")\n\tMidOrder(tree)\n\tfmt.Println(\"\\n ============ \")\n\n\tfmt.Println(\"inOrderNotRecursion\")\n\tInOrderNotRecursion(tree)\n\tfmt.Println(\"\\n ============ \")\n\n\tfmt.Println(\"postOrder\")\n\tPostOrder(tree)\n\tfmt.Println(\"\\n ============ \")\n\n\tfmt.Println(\"postOrderNotRecursion\")\n\tPostOrderNotRecursion(tree)\n\tfmt.Println(\"\\n ============ \")\n\n\tfmt.Println(\"BreadthFirstSearch\")\n\tBreadthFirstSearch(tree)\n\tfmt.Println(\"\\n ============ \")\n}", "title": "" }, { "docid": "86c60156b7a2f03025539b1ef8b77eee", "score": "0.5934768", "text": "func NewTree(preallocate int) *Tree {\n\ttree := new(Tree)\n\ttree.root = tree.newnode()\n\tif preallocate == 0 {\n\t\treturn tree\n\t}\n\n\t// Simplification, static preallocate max 6 bits\n\tif preallocate > 6 || preallocate < 0 {\n\t\tpreallocate = 6\n\t}\n\n\tvar key, mask uint32\n\n\tfor inc := startbit; preallocate > 0; inc, preallocate = inc>>1, preallocate-1 {\n\t\tkey = 0\n\t\tmask >>= 1\n\t\tmask |= startbit\n\n\t\tfor {\n\t\t\ttree.insert32(key, mask, nil, false)\n\t\t\tkey += inc\n\t\t\tif key == 0 { // magic bits collide\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn tree\n}", "title": "" }, { "docid": "c86cfb337a4f590e6d5e1eaaf88f7bb6", "score": "0.5922403", "text": "func NewTree(lessfn LessFunc) *Tree {\n\tt := new(Tree)\n\tt.max_doc = 0\n\tt.min_doc = 1<<31 - 1\n\tt.less = lessfn\n\treturn t\n}", "title": "" }, { "docid": "1a8548b84cda9a6f89b44b658a74f1c1", "score": "0.5921462", "text": "func New() *Tree {\n\treturn &Tree{\n\t\troot: &node{\n\t\t\tnType: root,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "2a55f2c17897d6bddac3c42a3d4582c5", "score": "0.59152347", "text": "func buildTree(nodes []*Node) (Node, error) {\n\tif len(nodes) == 1 {\n\t\t// This is the root, we directly return the root\n\t\treturn *nodes[0], nil\n\t}\n\tvar parents []*Node\n\tfor i := 0; i < len(nodes); i += 2 {\n\t\thash := sha256.New()\n\t\t// If odds number of nodes, construct the last parent with both left and right as nodes[-1].Hash\n\t\tleftNode, rightNode := nodes[i], nodes[i]\n\t\tif i+1 < len(nodes) {\n\t\t\trightNode = nodes[i+1]\n\t\t}\n\t\tconcatHash := append(leftNode.Hash, rightNode.Hash...)\n\t\tif _, err := hash.Write(concatHash); err != nil {\n\t\t\treturn Node{}, errors.New(\"cannot hash content: \" + string(concatHash))\n\t\t}\n\t\tparent := Node{\n\t\t\tHash: hash.Sum(nil),\n\t\t\tLeft: leftNode,\n\t\t\tRight: rightNode,\n\t\t}\n\t\tleftNode.Parent, rightNode.Parent = &parent, &parent\n\t\tparents = append(parents, &parent)\n\t}\n\treturn buildTree(parents)\n}", "title": "" }, { "docid": "919adbf2703d94d0b54a64cd11ed36f7", "score": "0.59115756", "text": "func newSideChainRootedTree(root *BlockNode) *sidechainRootedTree {\n\troot.workSum = blockchain.CalcWork(root.Header.Bits)\n\treturn &sidechainRootedTree{\n\t\troot: root,\n\t\tchildren: make(map[chainhash.Hash]*BlockNode),\n\t\ttips: make(map[chainhash.Hash]*BlockNode),\n\t}\n}", "title": "" }, { "docid": "0bff02bc3aef4544f03f9e13fa8fc272", "score": "0.59099305", "text": "func TestCreateTreeDifferentApproaches(t *testing.T) {\n\tnodes := []*Node{\n\t\t&Node{Content: []byte(\"first\")},\n\t\t&Node{Content: []byte(\"second\")},\n\t\t&Node{Content: []byte(\"third\")},\n\t\t&Node{Content: []byte(\"fourth\")},\n\t\t&Node{Content: []byte(\"fifth\")},\n\t}\n\tmerkleTree := MerkleTree{Leafs: nodes}\n\tmerkleTreeRecursive := MerkleTree{Leafs: nodes}\n\tmerkleTree.CreateTree()\n\tmerkleTreeRecursive.CreateTreeRecursive()\n\n\tassert.NotNil(t, merkleTree.Root)\n\tassert.NotNil(t, merkleTreeRecursive.Root)\n\tassert.Equal(t, merkleTree.Root.getHashString(), merkleTreeRecursive.Root.getHashString())\n\n}", "title": "" }, { "docid": "3160b28416056ecfee1658f4bfeeb43c", "score": "0.58876765", "text": "func TestTreeBuilder(t *testing.T) {\n\ttree := NewTree()\n\ttree.PushObject(\"a\")\n\ttree.PushObject(\"b\")\n\t_ = tree.Root()\n\n\t// Correctness is assumed, as it's tested by the merkletree package. This\n\t// function is really for code coverage.\n}", "title": "" }, { "docid": "f33b0930672defe81797e398b92ef61b", "score": "0.58730704", "text": "func NewTree() *Tree {\n\treturn &Tree{\n\t\tnode: &Node{\n\t\t\tlabel: pathRoot,\n\t\t\tactions: make(map[string]http.Handler),\n\t\t\tmiddlewares: nil,\n\t\t\tchildren: make(map[string]*Node),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "4cd880799cf84a5190e4b6acfd3387dc", "score": "0.5867961", "text": "func InitializeTree(geneT Tree, speciesN int) {\n\tfor _, i := range geneT {\n\t\ti.cost = make(map[*Node]float64, speciesN)\n\t\ti.speciation = make(map[*Node]float64, speciesN)\n\t\ti.duplication = make(map[*Node]float64, speciesN)\n\t\ti.transfer = make(map[*Node]float64, speciesN)\n\t\ti.in = make(map[*Node]float64, speciesN)\n\t\ti.inAlt = make(map[*Node]float64, speciesN)\n\t\ti.out = make(map[*Node]float64, speciesN)\n\t}\n}", "title": "" }, { "docid": "0d17b9ca197e431703b216b14c921b99", "score": "0.5863331", "text": "func NewTree() (t *Tree) {\n\tt = new(Tree)\n\tt.nodes = make(map[int]Node)\n\treturn\n}", "title": "" }, { "docid": "eaba8435bc3ee8e631e2cf7719646658", "score": "0.585498", "text": "func Generate(c Config) Node {\n\t// This algorithm was thought up by a young genius I know, I can claim only\n\t// the implementation :)\n\tif c.AvgDepth == 0 {\n\t\tpanic(\"avg depth of zero is not possible\")\n\t}\n\n\t// Will be used the generation of file depths\n\tpos := distuv.Poisson{\n\t\tLambda: float64(c.AvgDepth - 1),\n\t\tSrc: c.Src,\n\t}\n\n\t// We start from zero, so it's one less\n\tpadding := numDigits(c.NumFiles - 1)\n\trootNode := Node{Children: make(map[string]Node)}\n\n\t// Pool is the pool of files still left to be placed. They are grouped by\n\t// the level they are going to use.\n\tpool := make(map[string]uint64, c.NumFiles)\n\n\tfor i := uint64(0); i < c.NumFiles; i++ {\n\t\t// Filenames are simply numbers with zero names to be all of the same length\n\t\tfname := fmt.Sprintf(\"f%0*d\", padding, i)\n\t\tdepth := uint64(pos.Rand())\n\n\t\tpool[fname] = depth\n\t\trootNode.Children[fname] = Node{}\n\t}\n\n\t// Now we must process the tree\n\tgenTreeStruct(pool, c, rootNode, 0)\n\n\treturn rootNode\n}", "title": "" }, { "docid": "56f3cffd7db9841ab6b97a4a94a958f7", "score": "0.5837677", "text": "func NewTree() *Node {\r\n\treturn &Node{}\r\n}", "title": "" }, { "docid": "d517cb7e24cb9f32f8a989e090896d6b", "score": "0.58349085", "text": "func NewTree() *Tree {\n\treturn &Tree{\n\t\tNodes: map[string]node.Node{},\n\t\tPipelines: map[string]pipeline.Pipeline{},\n\t}\n}", "title": "" }, { "docid": "3bdac6da6ac3d5e2f35188167ecad864", "score": "0.58295333", "text": "func buildTree(preorder []int, inorder []int) *TreeNode {\n\tif len(preorder) == 0 || len(inorder) == 0 {\n\t\treturn nil\n\t}\n\n\tpivotVal := preorder[0]\n\troot := &TreeNode{Val: pivotVal}\n\tpivotIdx := 0\n\tfor pivotIdx < len(inorder) {\n\t\tif inorder[pivotIdx] == pivotVal {\n\t\t\tbreak\n\t\t}\n\t\tpivotIdx++\n\t}\n\troot.Left = buildTree(preorder[1:pivotIdx+1], inorder[:pivotIdx])\n\troot.Right = buildTree(preorder[pivotIdx+1:], inorder[pivotIdx+1:])\n\n\treturn root\n}", "title": "" }, { "docid": "56ee7a87d07497d71c9901a062d8b42f", "score": "0.5821113", "text": "func constructTree(root *types.FlameGraphNode, details *pb.MetricDetailsResponse) {\n\tcnt := types.RootElementId + 2\n\ttotal := uint64(details.TotalSpace)\n\toccupiedByMetrics := uint64(0)\n\tseen := make(map[string]*types.FlameGraphNode)\n\tvar seenSoFar string\n\tvar seenSoFarPrev string\n\n\tfor metric, data := range details.Metrics {\n\t\toccupiedByMetrics += uint64(data.Size_)\n\t\tseenSoFar = \"\"\n\t\tparts := strings.Split(metric, \".\")\n\t\tl := len(parts) - 1\n\t\tfor i, part := range parts {\n\t\t\tif part == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tseenSoFarPrev = seenSoFar\n\t\t\tseenSoFar = seenSoFar + \".\" + part\n\t\t\tif n, ok := seen[seenSoFar]; ok {\n\t\t\t\tn.Count++\n\t\t\t\tn.Value += int64(data.Size_)\n\t\t\t\tif n.ModTime < data.ModTime {\n\t\t\t\t\tn.ModTime = data.ModTime\n\t\t\t\t}\n\t\t\t\tif n.ATime < data.ATime {\n\t\t\t\t\tn.ATime = data.ATime\n\t\t\t\t}\n\t\t\t\tif n.RdTime < data.RdTime {\n\t\t\t\t\tn.RdTime = data.RdTime\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar parent *types.FlameGraphNode\n\t\t\t\tif seenSoFarPrev != \"\" {\n\t\t\t\t\tparent = seen[seenSoFarPrev]\n\t\t\t\t} else {\n\t\t\t\t\tparent = root\n\t\t\t\t}\n\n\t\t\t\tv := int64(0)\n\t\t\t\tif i == l {\n\t\t\t\t\tv = int64(data.Size_)\n\t\t\t\t}\n\n\t\t\t\tm := &types.FlameGraphNode{\n\t\t\t\t\tId: cnt,\n\t\t\t\t\tCluster: parent.Cluster,\n\t\t\t\t\tName: part,\n\t\t\t\t\tValue: v,\n\t\t\t\t\tModTime: data.ModTime,\n\t\t\t\t\tRdTime: data.RdTime,\n\t\t\t\t\tATime: data.ATime,\n\t\t\t\t\tTotal: int64(total),\n\t\t\t\t\tParent: parent,\n\t\t\t\t}\n\t\t\t\tseen[seenSoFar] = m\n\t\t\t\tparent.Children = append(parent.Children, m)\n\t\t\t\tparent.ChildrenIds = append(parent.ChildrenIds, cnt)\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\n\tif occupiedByMetrics+details.FreeSpace < total {\n\t\toccupiedByRest := total - occupiedByMetrics - details.FreeSpace\n\t\tm := &types.FlameGraphNode{\n\t\t\tId: cnt,\n\t\t\tCluster: root.Cluster,\n\t\t\tName: \"[not-whisper]\",\n\t\t\tValue: int64(occupiedByRest),\n\t\t\tModTime: root.ModTime,\n\t\t\tTotal: int64(total),\n\t\t\tParent: root,\n\t\t}\n\n\t\troot.ChildrenIds = append(root.ChildrenIds, cnt)\n\t\troot.Children = append(root.Children, m)\n\t} else {\n\t\tlogger.Error(\"occupiedByMetrics > totalSpace-freeSpace\",\n\t\t\tzap.String(\"cluster\", root.Cluster),\n\t\t\tzap.Uint64(\"occupied_by_metrics\", occupiedByMetrics),\n\t\t\tzap.Uint64(\"free_space\", details.FreeSpace),\n\t\t\tzap.Uint64(\"total_space\", details.TotalSpace),\n\t\t)\n\t}\n}", "title": "" }, { "docid": "0eaa6c837570e76d63b442a8ed9b2cb3", "score": "0.5819568", "text": "func newIndexTree(startPath string) (indexTree, error) {\n\ttitle := toTitle(filepath.Base(startPath))\n\turl := startPath\n\n\tisFile, err := isFile(startPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif isFile {\n\t\treturn page{title: title, url: url}, nil\n\t}\n\n\tcontentsNames, _ := readDirContentsNames(startPath)\n\tcontents := []node{}\n\tfor _, name := range contentsNames {\n\t\tpath := filepath.Join(startPath, name)\n\t\tnode, err := newIndexTree(path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcontents = append(contents, node)\n\t}\n\n\treturn section{title: title, url: url, contents: contents}, nil\n}", "title": "" }, { "docid": "39307fc1168ee4d9ad654b43ffd3d1ef", "score": "0.58014184", "text": "func New(k int) *Tree {\n var t *Tree\n for _, v := range rand.Perm(10) {\n t = insert(t, (1+v)*k)\n }\n return t\n}", "title": "" }, { "docid": "e877fb25a8543e4353c2dd58abdfcd15", "score": "0.5798699", "text": "func NewTree(root rune) *Tree {\n\tvar tree = &Tree{root: root}\n\ttree.left = nil\n\ttree.right = nil\n\treturn tree\n}", "title": "" }, { "docid": "d7894ed638e90521044893b350b06bd8", "score": "0.5793356", "text": "func NewTree(compare func(interface{}, interface{}) int) Tree {\n\treturn Tree{\n\t\tnode: nil,\n\t\tcompare: compare,\n\t}\n}", "title": "" }, { "docid": "6fd3ac6ee99f51830070d182436b3749", "score": "0.5792125", "text": "func NewTree(capacity int) *Tree {\n\tvar n *C.node\n\tn = C.r3_tree_create(C.int(capacity))\n\tt := &Tree{\n\t\tnode: n,\n\t\tdatas: make([]interface{}, 0, 10),\n\t}\n\treturn t\n}", "title": "" }, { "docid": "a1002e9a0d697cb517841d897cea4968", "score": "0.57886", "text": "func New(compare func(a, b interface{}) int) *tree {\n\tt := new(tree)\n\n\tt.compare = compare\n\n\tt.Clear()\n\n\treturn t\n}", "title": "" }, { "docid": "6aaea0ddb6c7f278de72a15dde45f60c", "score": "0.57880527", "text": "func merkletree (data map[string]Data)Node{\n\n\t//var root Node\n\tleafNodes := make(map[int]Node) //Store all the leaf nodes\n\ti:=0\n\n\tfor key := range data {\n\t\tvar node Node\n\t\tnode.value = key + LocalkeyValue[key].val\n\t\tnode.hash = hashfunc(node.value)\n\t\tleafNodes[i] = node\n\t\ti+=1\n\t}\n\n\tfor len(leafNodes) !=1{\n\t\ttemp := make(map[int]Node)\n\t\tj:=0\n\t\tfor i=0; i<len(leafNodes); i+=2 {\n\t\t\tnode1 := leafNodes[i]\n\t\t\tvar node2 Node\n\t\t\tif i+1 < len(leafNodes) {\n\t\t\t\tnode2 = leafNodes[i+1]\n\t\t\t} else{\n\t\t\t\ttemp[j] = leafNodes[i]\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tvar parent Node // initialize parent node and adding values to the\n\t\t\tparent.value = node1.value + node2.value\n\t\t\tparent.hash = hashfunc(parent.value)\n\t\t\tparent.left = &node1\n\t\t\tparent.right = &node2\n\t\t\ttemp[j] = parent\n\t\t\tj+=1\n\t\t}\n\t\tleafNodes = temp\n\t}\n\n\tvar root Node\n\troot = leafNodes[0]\n\n\treturn root\n}", "title": "" }, { "docid": "41b43c159cf510a394875809f94dba9b", "score": "0.578463", "text": "func New(mode int) *Tree {\n\tif mode != TD234 && mode != BU23 {\n\t\tmode = BU23\n\t}\n\treturn &Tree{\n\t\tsize: 0,\n\t\troot: nil,\n\t\tmode: mode,\n\t}\n}", "title": "" }, { "docid": "bb87158ccc4bd7415573ba6e26295a76", "score": "0.57783294", "text": "func(tree *MerkleTree) BuildTree() {\r\n\ttree.Count = 0\r\n\t}", "title": "" }, { "docid": "748fb1051e867ea37161b96f7419b8d9", "score": "0.57766736", "text": "func newNode(key string, parent *Node) *Node {\n\tvar parentPath []string\n\tif parent == nil || parent.Key == TreeRoot {\n\t\tparentPath = []string{}\n\t} else {\n\t\tparentPath = parent.Path\n\t}\n\n\tnode := &Node{\n\t\tKey: key,\n\t\tvalue: nil,\n\t\tparent: parent,\n\t\tChildren: cmap.New(),\n\t\tPath: append(parentPath, key),\n\n\t\tpristine: true,\n\t}\n\n\tif parent != nil {\n\t\tparent.Children.Set(node.Key, node)\n\t\tparent.SetValue(nil)\n\t}\n\n\treturn node\n}", "title": "" }, { "docid": "d755b8083b7cda67b6534c75de40358b", "score": "0.57677245", "text": "func NewTree() Tree {\n\treturn &baseTree{}\n}", "title": "" }, { "docid": "3d08b1a25e6ce62e1be3a7401cef896d", "score": "0.5757201", "text": "func NewTree(connect4 *connect4.Connect4) *Tree {\n\troot := NewNode(nil, 0, connect4)\n\treturn &Tree{Root: root}\n}", "title": "" }, { "docid": "c7d5c0f807d5a73d7bf257839decd3a0", "score": "0.57564545", "text": "func (mpt *MerklePatriciaTrie) Initial() {\n\tmpt.root = \"\"\n\tmpt.db = make(map[string]Node)\n}", "title": "" }, { "docid": "2eaee56e44c3751719e2ccd03151bae9", "score": "0.5753415", "text": "func NewTree(ctx context.Context, cln *client.Client, mw *progress.MultiWriter, mod *parser.Module, long bool) (treeprint.Tree, error) {\n\tresolver, err := NewResolver(cln, mw)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tres, err := NewLocalResolved(mod)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer res.Close()\n\n\tvar (\n\t\ttree = treeprint.New()\n\t\tnodeByModule = make(map[*parser.Module]treeprint.Tree)\n\t\tmu sync.Mutex\n\t)\n\n\ttree.SetValue(mod.Pos.Filename)\n\tnodeByModule[mod] = tree\n\n\terr = ResolveGraph(ctx, resolver, res, mod, nil, func(decl *parser.ImportDecl, dgst digest.Digest, mod, importMod *parser.Module) error {\n\t\tvar prefix string\n\t\tif dgst != \"\" {\n\t\t\tencoded := dgst.Encoded()\n\t\t\tif !long && len(encoded) > 7 {\n\t\t\t\tencoded = encoded[:7]\n\t\t\t}\n\t\t\tprefix = fmt.Sprintf(\"%s:%s\", dgst.Algorithm(), encoded)\n\t\t}\n\n\t\tvar value string\n\t\tswitch {\n\t\tcase decl.ImportFunc != nil:\n\t\t\tvalue = filepath.Join(prefix, ModuleFilename)\n\t\tcase decl.ImportPath != nil:\n\t\t\tif prefix == \"\" {\n\t\t\t\tvalue = decl.ImportPath.Path.Unquoted()\n\t\t\t} else {\n\t\t\t\tvalue = filepath.Join(prefix, decl.ImportPath.Path.Unquoted())\n\t\t\t}\n\t\t}\n\n\t\tmu.Lock()\n\t\tnode := nodeByModule[mod]\n\t\timportNode := node.AddMetaBranch(decl.Ident.Name, value)\n\t\tnodeByModule[importMod] = importNode\n\t\tmu.Unlock()\n\n\t\treturn nil\n\t})\n\treturn tree, err\n}", "title": "" }, { "docid": "ddb48035c16661f372c8ff8d1edf96b2", "score": "0.5750493", "text": "func buildTreeWithManager(treeDef treeBuilderTest, tm *TreeManager) error {\n\ttest := treeDef\n\tndIds := make([][md5.Size]byte, 0, 100)\n\tee := crypto.BlockElement{\n\t\tBlock: &crypto.Block{\n\t\t\tMinerId: strconv.Itoa(1),\n\t\t\tType: crypto.GenesisBlock,\n\t\t\tPrevBlock: genBlockSeed,\n\t\t\tRecords: []*crypto.BlockOp{},\n\t\t\tNonce: 12324,\n\t\t},\n\t}\n\t// add genesis block\n\ttm.AddBlock(ee)\n\tbuf := [md5.Size]byte{}\n\tcopy(buf[:], ee.Block.Hash())\n\tndIds = append(ndIds, buf)\n\n\tfor i := 0; i < len(test.addOrder); i += 10 {\n\t\t// grab root and start adding n nodes\n\t\trootId := ndIds[test.addOrder[i]]\n\t\tfor j := 0; j < test.addOrder[i+1]; j++ {\n\t\t\trecords := make([]*crypto.BlockOp, test.addOrder[i+4])\n\t\t\tfor u := 0; u < test.addOrder[i+4]; u++ {\n\t\t\t\trecord := crypto.BlockOp{\n\t\t\t\t\tType: crypto.BlockOpType(test.addOrder[i+8]),\n\t\t\t\t\tFilename: filenames[test.addOrder[i+7]],\n\t\t\t\t\tData: datum[test.addOrder[i+6]],\n\t\t\t\t\tCreator: strconv.Itoa(test.addOrder[i+5]),\n\t\t\t\t\tRecordNumber: uint16(test.addOrder[i+9]) + uint16(u),\n\t\t\t\t}\n\t\t\t\trecords[u] = &record\n\t\t\t\tcounter += 1\n\t\t\t}\n\t\t\tee := crypto.BlockElement{\n\t\t\t\tBlock: &crypto.Block{\n\t\t\t\t\tMinerId: strconv.Itoa(test.addOrder[i+2]),\n\t\t\t\t\tType: crypto.BlockType(test.addOrder[i+3]),\n\t\t\t\t\tPrevBlock: rootId,\n\t\t\t\t\tRecords: records,\n\t\t\t\t\tNonce: 12324,\n\t\t\t\t},\n\t\t\t}\n\t\t\tee.Block.FindNonce(numberOfZeros, numberOfZeros)\n\t\t\tvar err error\n\t\t\terr = tm.AddBlock(ee)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbuf := [md5.Size]byte{}\n\t\t\tcopy(buf[:], ee.Block.Hash())\n\t\t\tndIds = append(ndIds, buf)\n\t\t\trootId = buf\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6258fc28eb102c23d4c6633bbabd2afc", "score": "0.57493454", "text": "func constructTree(startSymb string, completedArr []subSet, symb2nt map[string]common.NonTerminal) ([]string, error) {\r\n\tres := make([]string, 0)\r\n\tfor i, it := range completedArr[len(completedArr)-1] {\r\n\t\tif it.nonTerm == startSymb && it.at == 0 {\r\n\t\t\tfmt.Println(it)\r\n\t\t\tres = append(res, constructHelper(i, len(completedArr)-1, completedArr, symb2nt)...)\r\n\t\t\treturn res, nil\r\n\t\t}\r\n\t}\r\n\treturn nil, errors.New(\"Fail to find startSymbol in the last completed set.\")\r\n}", "title": "" }, { "docid": "5c656eb785455fc925cab7f2a58a58c4", "score": "0.5743615", "text": "func newJSONTree(tree *Node) *jsonTree {\n\tjt := new(jsonTree)\n\tjt.Component = tree.component\n\tfor _, child := range tree.children {\n\t\tjt.Children = append(jt.Children, newJSONTree(child))\n\t}\n\treturn jt\n}", "title": "" }, { "docid": "232c567b833d48640404b204693af739", "score": "0.57423085", "text": "func NewTree(repo *Repository, id SHA1) *Tree {\n\treturn &Tree{\n\t\tID: id,\n\t\trepo: repo,\n\t}\n}", "title": "" }, { "docid": "344deefe4f82810b98025ad7e3579cfb", "score": "0.5739597", "text": "func buildTree(nodes []*Node) *Node {\n\tif len(nodes) == 1 {\n\t\treturn nodes[0]\n\t}\n\tif len(nodes)%2 != 0 {\n\t\tl := len(nodes)\n\t\tnodes[l-2] = join(nodes[l-2], nodes[l-1])\n\t\tnodes = nodes[:l-1]\n\t}\n\n\tnewnodes := make([]*Node, 0, len(nodes)/2+1)\n\tfor i := 0; i < len(nodes); i += 2 {\n\t\tnewnodes = append(newnodes, join(nodes[i], nodes[i+1]))\n\t}\n\treturn buildTree(newnodes)\n}", "title": "" }, { "docid": "c4bd97c6581ee883c5d73fc5bb399d0b", "score": "0.5724184", "text": "func testTree3() *BTNode {\n\tone := &BTNode{Data: \"1\"}\n\ttwo := &BTNode{Data: \"2\"}\n\tthree := &BTNode{Data: \"3\"}\n\tfour := &BTNode{Data: \"4\"}\n\tfive := &BTNode{Data: \"5\"}\n\tsix := &BTNode{Data: \"6\"}\n\tseven := &BTNode{Data: \"7\"}\n\n\ttwo.Right = three\n\tthree.Left = one\n\tthree.Right = four\n\tfour.Left = seven\n\tfour.Right = five\n\tfive.Left = six\n\n\treturn two\n}", "title": "" }, { "docid": "121b1ee20da0e38f8538500840ae68f4", "score": "0.5722237", "text": "func Tree(w *mfm.Window) {}", "title": "" }, { "docid": "a1ebd16969cc187e56d8f9e44d30c373", "score": "0.57185227", "text": "func main() {\n\t// [4,2,5,1,3]\n\troot := &TreeNode{Val: 1}\n\tnode1 := &TreeNode{Val: 2}\n\tnode2 := &TreeNode{Val: 3}\n\tnode3 := &TreeNode{Val: 4}\n\tnode4 := &TreeNode{Val: 5}\n\n\troot.Left = node1\n\troot.Right = node2\n\troot.Right.Left = node3\n\troot.Right.Right = node4\n\n\tobj := Constructor()\n\ts := obj.serialize(root)\n\tfmt.Println(\"serialize: \", s)\n\td := obj.deserialize(s)\n\tfmt.Println(\"deserialize: \", d)\n}", "title": "" }, { "docid": "b9d756683f7e7b2e110dd9014875f222", "score": "0.5708841", "text": "func NewTree(dest string) *Tree {\n\treturn &Tree{\n\t\tLink: \"/\",\n\t\tType: TreeIndex,\n\t\tI18n: \"tree\",\n\t\tSort: 0,\n\t\tDest: dest,\n\t\tURL: \"\",\n\t}\n}", "title": "" }, { "docid": "456e1c078da819560573f5271e4ea34d", "score": "0.5695482", "text": "func buildTree(treenode *TreeNode, list []contenttype.ContentTyper) {\n\t//Add current level contents\n\tparentLocation := treenode.Content.GetLocation()\n\tfor _, item := range list {\n\t\tlocation := item.GetLocation()\n\t\tif location.Depth == parentLocation.Depth+1 && location.ParentID == parentLocation.ID {\n\t\t\ttreenode.Children = append(treenode.Children, TreeNode{Content: item, Location: location})\n\t\t}\n\t}\n\n\t//Add sub level. If it's leaf node it will not run the loop.\n\tfor i, _ := range treenode.Children {\n\t\tbuildTree(&treenode.Children[i], list)\n\t}\n}", "title": "" }, { "docid": "7f450aa7dda3c5692c4ab24c3047afe7", "score": "0.5689863", "text": "func (dt *DecisionTree) creatNode(parent *Node, data *container.Tensor, label []string) *Node {\n\tvar r *Node\n\ttmp := label[0]\n\tleafFlag := true\n\tfor _, v := range label {\n\t\tif !strings.EqualFold(tmp, v) {\n\t\t\tleafFlag = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif leafFlag {\n\t\tr = NewNode(fmt.Sprintf(\"%d\", -1))\n\t\t// glog.Infof(\"leaf: %s\", label[0])\n\t\tr.Attributes.Put(ClassificationLableKey, label[0])\n\t\tr.Attributes.Put(AttributeLabelKey, \"-1\")\n\t\tif parent == nil {\n\t\t\tdt.Root = r\n\t\t} else {\n\t\t\tr.parent = parent\n\t\t}\n\t\treturn r\n\t}\n\t// glog.Infof(\"%v \\n %v\", data.SliceString(), label)\n\tindex, eg, freq := chooseBestAttribute(data, label)\n\t// glog.Infof(\"best attribute: %s\", data.Get(index).Label)\n\t// glog.Infof(\"%v\", freq)\n\tr = NewNode(fmt.Sprintf(\"%d\", index))\n\tr.Attributes.Put(EntropyGainKey, eg)\n\n\tif parent == nil {\n\t\tdt.Root = r\n\t} else {\n\t\tr.parent = parent\n\t}\n\n\tr.Attributes.Put(AttributeLabelKey, data.Get(index).Label)\n\t//creat edges\n\tdt.creatEdge(r, index, data, label, freq)\n\t// }\n\n\treturn r\n\n}", "title": "" }, { "docid": "bf2b7d7cf8e54de3cda278327837bdaf", "score": "0.568496", "text": "func (self *Tree)insertNode(n *Node){\n\tif self.Root==nil{\n\t\tself.Root = n\n\t\tself.Nleaves += 1\n\t\treturn\n\t}\n\tp := self.Root\n\tif p.L==nil{\n\t\tself.Root = new(Node)\n\t\tself.Root.L = p\n\t\tp.parent = self.Root\n\t\tself.Root.R = n\n\t\tn.parent = self.Root\n\t\tself.Root.Children = 2\n\t\tself.Nleaves += 1\n\t\tupdateHashes(self.Root)\n\t\treturn\n\t}\n\tif p.isFull(){\n\t\tself.Root = new(Node)\n\t\tself.Root.L = p\n\t\tp.parent = self.Root\n\t\tself.Root.R = n\n\t\tn.parent = self.Root\n\t\tself.Root.Children = self.Root.L.Children+2\n\t\tself.Nleaves += 1\n\t\tupdateHashes(self.Root)\n\t\treturn\n\t}\n\tfor ;!p.isFull();{\n\t\tp = p.R\n\t}\n\tx1 := p\n\tx2 := n\n\tp = new(Node)\n\tp.parent = x1.parent\n\tp.parent.R = p\n\tp.L = x1\n\tx1.parent = p\n\tp.R = x2\n\tx2.parent = p\n\tp.Children = x1.Children+x2.Children+2\n\tself.Nleaves += 1\n\tupdateHashes(p)\n}", "title": "" }, { "docid": "36c1b69a55fcf66e8a9f63af347446fe", "score": "0.5679943", "text": "func Make(filtered bool) (tree *Tree) {\n\ttree = new(Tree);\n\ttree.keep_duplicates = !filtered;\n\treturn;\n}", "title": "" }, { "docid": "631046e6cf89e15580b43029916b9b80", "score": "0.56737703", "text": "func (this *node) init(tree *BTree) {\n\tthis.size = int(tree.header.KeySize) + /*size of offset*/ 4\n\tthis.offset = -1\n\tthis.count = 0\n\tthis.raw = make([]byte, tree.header.bufferSize(), tree.header.bufferSize()+uint32(this.size))\n\tthis.datas = this.raw[8:]\n\tcopy(this.raw[0:4], []byte{0xff, 0xff, 0xff, 0xff})\n}", "title": "" }, { "docid": "c361d203081f66f687347f519cacf593", "score": "0.5671392", "text": "func testTree2() *BTNode {\n\tone := &BTNode{Data: \"1\"}\n\ttwo := &BTNode{Data: \"2\"}\n\tthree := &BTNode{Data: \"3\"}\n\tfour := &BTNode{Data: \"4\"}\n\n\tthree.Left = two\n\tthree.Right = four\n\ttwo.Left = one\n\n\treturn three\n}", "title": "" }, { "docid": "c8367779e82786bd19374a53385ee5f0", "score": "0.56664026", "text": "func makeFsTree(is is.I) (treebuilder, *counts) {\n\tdisallowed := PrettyRunes([]rune{'/', '\\\\', '?', '%', '*', ':', '|', '\"', '\\'', '>', '<', '\\000'})\n\t_ = disallowed\n\t// words := get20kwords()\n\tr := rand.New(rand.NewSource(0xc4))\n\n\t// We create pseudo random directory structure with the following limits.\n\tmax_path_depth := uint32(10) // Maximum number of nested folders\n\tmax_name_chars := uint32(20) // Maximum characters in a filename\n\tmax_path_chars := uint32(max_name_chars * 10) // Maximum characters in a file path\n\tmax_data := uint32(512) // Maximum amount of random data to put in files.\n\tmax_items_per_folder := uint32(40) // Maximum number of children per folder.\n\n\t// make n, m files and folders\n\t// walk into some folders and repeat until max depth\n\tvar tree treebuilder\n\tfile_data := make([]byte, max_data)\n\titem_count := uint32(0)\n\tvar t_files, t_folders, t_max_depth, t_max_path uint32\n\tcount := &counts{&item_count, &t_files, &t_folders, &t_max_depth, &t_max_path}\n\ttree = func(fs vfs.Filesystem, max_depth, max_total_items, depth uint32, path string, item_count uint32) uint32 {\n\t\tif item_count >= max_total_items {\n\t\t\treturn item_count\n\t\t}\n\t\tif depth >= max_depth || (r.Uint32()%(max_path_depth/2)) == 0 {\n\t\t\tif depth >= max_depth {\n\t\t\t\tt_max_depth++\n\t\t\t}\n\t\t\treturn item_count\n\t\t}\n\t\tfolder_items := r.Uint32() % max_items_per_folder\n\t\tfor i := uint32(0); i < folder_items; i++ {\n\t\t\titem_count++\n\t\t\tif item_count >= max_total_items {\n\t\t\t\treturn item_count\n\t\t\t}\n\t\t\tnamelen := ((r.Uint32() % max_name_chars) / 2)\n\t\t\t// First 50% chars are ascii range to make sorting tests clear\n\t\t\tprefixlen := namelen / 2\n\t\t\t// if prefixlen%4 != 0 {\n\t\t\t// prefixlen += 4 - prefixlen%4\n\t\t\t// }\n\t\t\tif prefixlen == 0 {\n\t\t\t\tprefixlen = 1\n\t\t\t}\n\n\t\t\talpha := PrettyRunes(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv\")\n\t\t\tname := string(NewPrettyRunes(int(prefixlen), func(r PrettyRune) bool {\n\t\t\t\treturn !r.In(alpha)\n\t\t\t}))\n\n\t\t\tname += string(NewPrettyRunes(int(namelen), func(r PrettyRune) bool {\n\t\t\t\t// return r.In(disallowed)\n\t\t\t\treturn !r.In(alpha)\n\t\t\t}))\n\n\t\t\t// for uint32(len(name)) < namelen {\n\t\t\t// rn := rune(r.Uint32() % utf8.MaxRune)\n\t\t\t// //Loop until anonymous function returns true, because where is 'indexOf'?\n\t\t\t// //FIX: I know this looks like ass, but I'll have to fix it later.\n\t\t\t// for func() bool {\n\t\t\t// for _, x := range disallowed {\n\t\t\t// if rn == x || (!unicode.IsPrint(rn) || !unicode.IsGraphic(rn)) {\n\t\t\t// return false\n\t\t\t// }\n\t\t\t// }\n\t\t\t// return true\n\t\t\t// }() {\n\t\t\t// rn = rune(r.Uint32() % utf8.MaxRune)\n\t\t\t// }\n\t\t\t// name += string(rn)\n\t\t\t// // if len(name) > 0 {\n\t\t\t// // name += \"_\"\n\t\t\t// // }\n\t\t\t// // name += words[int(r.Uint32()%uint32(len(words)))]\n\t\t\t// }\n\n\t\t\tthis_path := filepath.Join(path, name)\n\t\t\tif uint32(len(path)) >= max_path_chars {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpath_len := uint32(len(strings.Split(this_path, \"/\")))\n\t\t\tif path_len > t_max_path {\n\t\t\t\tt_max_path = path_len\n\t\t\t}\n\t\t\tif r.Uint32()%4 == 0 { // 1 in 4 items is a folder\n\t\t\t\tt_folders++\n\t\t\t\terr := vfs.MkdirAll(fs, this_path, 0700)\n\t\t\t\tis.NoErr(err)\n\t\t\t\titem_count = tree(fs, max_depth, max_total_items, depth+1, this_path, item_count)\n\t\t\t\tif item_count >= max_total_items {\n\t\t\t\t\treturn item_count\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt_files++\n\t\t\tn, err := r.Read(file_data)\n\t\t\tis.NoErr(err)\n\t\t\tis.Equal(n, uint32(len(file_data)))\n\t\t\terr = vfs.WriteFile(fs, this_path, file_data[:r.Uint32()%max_data], 0600)\n\t\t\tis.NoErr(err)\n\t\t\tif item_count >= max_total_items {\n\t\t\t\treturn item_count\n\t\t\t}\n\t\t}\n\t\treturn item_count\n\t}\n\treturn tree, count\n}", "title": "" }, { "docid": "99d1d76a4cec7999c085a825cbf2005e", "score": "0.56655806", "text": "func NewTree(less LessFunc) *Tree {\n\treturn &Tree{less: less}\n}", "title": "" }, { "docid": "1e01585df7f0fffacf53d687925e5f3d", "score": "0.5664573", "text": "func New(minChildren, maxChildren int) *Tree {\n\treturn &Tree{\n\t\tMinChildren: minChildren,\n\t\tMaxChildren: maxChildren,\n\t\troot: &node{\n\t\t\tleaf: true,\n\t\t\tlevel: 1,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "ebde090bfd7bfa27b42eb71dd9f8a34b", "score": "0.56630856", "text": "func minimalTree(data []int) *BinaryTreeNode {\n\tif len(data) == 0 {\n\t\treturn nil\n\t}\n\tcenterIndex := len(data) / 2\n\tnode := BinaryTreeNode{\n\t\tdata: data[centerIndex],\n\t\tleft: minimalTree(data[:centerIndex]),\n\t\tright: minimalTree(data[centerIndex+1:]),\n\t}\n\treturn &node\n}", "title": "" }, { "docid": "d6e72497566fdafce94ba3070f5244f2", "score": "0.5659138", "text": "func (g *Generator) generateDependencyTree() (Node, []Node, []Node) {\n\troot := NewBranch()\n\tallNodes := []Node{root}\n\tprevNodes := []Node{root}\n\tfor depth := 1; depth <= g.MaxDepth; depth++ {\n\t\tcurNodes := g.createBreadth(depth)\n\t\tg.assignParents(prevNodes, curNodes)\n\t\tprevNodes = curNodes\n\t\tallNodes = append(allNodes, curNodes...)\n\t}\n\treturn root, allNodes, prevNodes\n}", "title": "" }, { "docid": "0ec308d8ab234e3763e543c126e7513d", "score": "0.56552035", "text": "func (t *Tree) Setup(owner *userpb.UserId, propagateToRoot bool) error {\n\t// create data paths for internal layout\n\tdataPaths := []string{\n\t\tfilepath.Join(t.root, \"nodes\"),\n\t\t// notes contain symlinks from nodes/<u-u-i-d>/uploads/<uploadid> to ../../uploads/<uploadid>\n\t\t// better to keep uploads on a fast / volatile storage before a workflow finally moves them to the nodes dir\n\t\tfilepath.Join(t.root, \"uploads\"),\n\t\tfilepath.Join(t.root, \"trash\"),\n\t}\n\tfor _, v := range dataPaths {\n\t\terr := os.MkdirAll(v, 0700)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// the root node has an empty name\n\t// the root node has no parent\n\tn := node.New(\"root\", \"\", \"\", 0, \"\", nil, t.lookup)\n\terr := t.createNode(n, owner)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// set propagation flag\n\tv := []byte(\"0\")\n\tif propagateToRoot {\n\t\tv = []byte(\"1\")\n\t}\n\tif err = xattr.Set(n.InternalPath(), xattrs.PropagationAttr, v); err != nil {\n\t\treturn err\n\t}\n\n\t// create spaces folder and iterate over existing nodes to populate it\n\tspacesPath := filepath.Join(t.root, \"spaces\")\n\tfi, err := os.Stat(spacesPath)\n\tif os.IsNotExist(err) {\n\t\t// create personal spaces dir\n\t\tif err := os.MkdirAll(filepath.Join(spacesPath, spaceTypePersonal), 0700); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// create share spaces dir\n\t\tif err := os.MkdirAll(filepath.Join(spacesPath, spaceTypeShare), 0700); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tf, err := os.Open(filepath.Join(t.root, \"nodes\"))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tnodes, err := f.Readdir(0)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor i := range nodes {\n\t\t\tnodePath := filepath.Join(t.root, \"nodes\", nodes[i].Name())\n\n\t\t\t// is it a user root? -> create personal space\n\t\t\tif isRootNode(nodePath) {\n\t\t\t\t// we can reuse the node id as the space id\n\t\t\t\tt.linkSpace(spaceTypePersonal, nodes[i].Name(), nodes[i].Name())\n\t\t\t}\n\n\t\t\t// is it a shared node? -> create share space\n\t\t\tif isSharedNode(nodePath) {\n\t\t\t\t// we can reuse the node id as the space id\n\t\t\t\tt.linkSpace(spaceTypeShare, nodes[i].Name(), nodes[i].Name())\n\t\t\t}\n\t\t}\n\t} else if !fi.IsDir() {\n\t\t// check if it is a directory\n\t\treturn fmt.Errorf(\"%s is not a directory\", spacesPath)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f5137a6c6cc20319d56eba6061c5ee83", "score": "0.56547433", "text": "func (wt *Worktree) buildWorktreeGraph() {\n\tif wt.root.ObjType != object.Commit {\n\t\tlog.Fatal(got.ErrWrongRootType)\n\t}\n\n\twt.root.ParentCommitHash = got.ReadHead()\n\n\tfor _, obj := range wt.index {\n\t\tif obj.ParentPath == \".\" {\n\t\t\tobj.Parent = wt.root\n\t\t\twt.root.Children = append(wt.root.Children, obj)\n\t\t}\n\n\t\tfor _, oObj := range wt.index {\n\t\t\tif oObj.ParentPath == obj.Path {\n\t\t\t\tobj.Children = append(obj.Children, oObj)\n\t\t\t}\n\n\t\t\tif obj.ParentPath == oObj.Path {\n\t\t\t\tobj.Parent = oObj\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ccf11e3165663d78c87e780c8ced0014", "score": "0.56322783", "text": "func (v *VectorModel) CreateBinaryTree() {\n\t//fmt.Fprintf(os.Stdout, \"Create Binary Tree %v\", time.Now())\n\tfmt.Fprintf(os.Stdout, \"Create Binary Tree\\n\")\n\tvar min1i, min2i, pos1, pos2 int\n\tvar point []int = make([]int, MAX_CODE_LENGTH)\n\tvar code []byte = make([]byte, MAX_CODE_LENGTH)\n\tvar count []int64 = make([]int64, v.VocabSize*2+1)\n\tvar binaryt []int = make([]int, v.VocabSize*2+1)\n\tvar parentNode []int = make([]int, v.VocabSize*2+1)\n\n\tfor a := 0; a < v.VocabSize; a++ {\n\t\tcount[a] = int64(v.Vocab[a].Count)\n\t}\n\tfor b := v.VocabSize; b < v.VocabSize*2; b++ {\n\t\tcount[b] = 1e15\n\t}\n\n\tpos1 = v.VocabSize - 1\n\tpos2 = v.VocabSize\n\t// Following algorithm constructs the Huffman tree encoding adding one node at a time\n\tfor c := 0; c < v.VocabSize-1; c++ {\n\t\t// First, find the 2 smallest nodes: min1, min2\n\t\tif pos1 >= 0 {\n\t\t\tif count[pos1] < count[pos2] {\n\t\t\t\tmin1i = pos1\n\t\t\t\tpos1--\n\t\t\t} else {\n\t\t\t\tmin1i = pos2\n\t\t\t\tpos2++\n\t\t\t}\n\t\t} else {\n\t\t\tmin1i = pos2\n\t\t\tpos2++\n\t\t}\n\t\tif pos1 >= 0 {\n\t\t\tif count[pos1] < count[pos2] {\n\t\t\t\tmin2i = pos1\n\t\t\t\tpos1--\n\t\t\t} else {\n\t\t\t\tmin2i = pos2\n\t\t\t\tpos2++\n\t\t\t}\n\t\t} else {\n\t\t\tmin2i = pos2\n\t\t\tpos2++\n\t\t}\n\t\tcount[v.VocabSize+c] = count[min1i] + count[min2i]\n\t\tparentNode[min1i] = v.VocabSize + c\n\t\tparentNode[min2i] = v.VocabSize + c\n\t\tbinaryt[min2i] = 1\n\t}\n\t// Now assign binary code to each vocab word\n\tfor d := 0; d < v.VocabSize; d++ {\n\t\te := d\n\t\ti := 0\n\t\tfor {\n\t\t\tcode[i] = byte(binaryt[e])\n\t\t\tpoint[i] = e\n\t\t\ti++\n\t\t\te = parentNode[e]\n\t\t\tif e == (v.VocabSize*2)-2 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tv.Vocab[d].Codelen = byte(i)\n\t\tv.Vocab[d].Point[0] = v.VocabSize - 2\n\t\tfor j := 0; j < i; j++ {\n\t\t\tv.Vocab[d].Code[i-j-1] = code[j]\n\t\t\tv.Vocab[d].Point[i-j] = point[j] - v.VocabSize\n\t\t}\n\t}\n}", "title": "" }, { "docid": "639be17f884c2fae5d688193897b39ca", "score": "0.5630603", "text": "func New(s string) *Tree {\n\tt := &Tree{root: &node{val: \"\"}}\n\n\tt.insert(s)\n\n\treturn t\n}", "title": "" }, { "docid": "a674d95db70b8ccf5a085fe14564c3d1", "score": "0.56242687", "text": "func makeTopLevel(nodes []*MerkleTreeNode) []*MerkleTreeNode{\n\tvar topLevel []*MerkleTreeNode\n\tfor i := 0; i < len(nodes)/2; i++ {\n\t\ttopLevel = append(topLevel,joinNode(nodes[2*i],nodes[2*i+1]))\n\t}\n\tif len(nodes) % 2 ==1{\n\t\tindex := len(nodes)-1\n\t\ttopLevel = append(topLevel,joinNode(nodes[index],nodes[index]))\n\t}\n\treturn topLevel\n}", "title": "" }, { "docid": "a19f680d5842e5e9c388e6b113cc297c", "score": "0.562054", "text": "func main() {\n\troot := &TreeNode{Val: 4, Left: &TreeNode{Val: 2, Left: &TreeNode{Val: 1}, Right: &TreeNode{Val: 3}}, Right: &TreeNode{Val: 5}}\n\tfmt.Printf(\"%v\\n\", root.Traversal())\n\n\troot.Insert(0)\n\tfmt.Printf(\"%v\\n\", root.Traversal())\n\n\troot.Insert(6)\n\tfmt.Printf(\"%v\\n\", root.Traversal())\n\n\troot.Delete(5)\n\tfmt.Printf(\"%v\\n\", root.Traversal())\n\n\troot.Delete(2)\n\tfmt.Printf(\"%v\\n\", root.Traversal())\n}", "title": "" }, { "docid": "7a8b2adad00d5f0141330703ad71336a", "score": "0.56191117", "text": "func New() *Tree {\n\treturn &Tree{mu: new(sync.RWMutex)}\n}", "title": "" }, { "docid": "0049eb6878812cc17a694136dbb58272", "score": "0.5615997", "text": "func newContentTree(rootPath string) (contentTree, error) {\n\ttree := make(contentTree)\n\terr := tree.installBuiltins()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"newContentTree('%s'): %w\", rootPath, err)\n\t}\n\n\troot, err := os.Open(rootPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"newContentTree('%s'): os.Open(...): %w\", rootPath, err)\n\t}\n\tdefer root.Close()\n\n\titems, err := root.Readdir(-1)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"newContentTree('%s'): file.Readdir(...): %w\", rootPath, err)\n\t}\n\n\tfor _, item := range items {\n\t\tif item.IsDir() {\n\t\t\tdomain, err := newDomainTree(filepath.Join(rootPath, item.Name()))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"newContentTree('%s'): %w\", rootPath, err)\n\t\t\t}\n\t\t\ttree[item.Name()] = domain\n\t\t}\n\t}\n\n\treturn tree, nil\n}", "title": "" } ]
d22d3c169bd226223e625a17f9bf4235
NewBondedInterfaceDescriptor creates a new instance of BondedInterfaceDescriptor.
[ { "docid": "1f1edd14f5103257693a0cb92fe79fd7", "score": "0.8290087", "text": "func NewBondedInterfaceDescriptor(ifHandler vppcalls.InterfaceVppAPI, ifIndex ifaceidx.IfaceMetadataIndex,\n\tlog logging.PluginLogger) (*kvs.KVDescriptor, *BondedInterfaceDescriptor) {\n\tdescriptorCtx := &BondedInterfaceDescriptor{\n\t\tifHandler: ifHandler,\n\t\tlog: log.NewLogger(\"bonded-interface-descriptor\"),\n\t\tifIndex: ifIndex,\n\t}\n\ttypedDescriptor := &adapter.BondedInterfaceDescriptor{\n\t\tName: BondedInterfaceDescriptorName,\n\t\tKeySelector: descriptorCtx.IsBondEnslaveKey,\n\t\tValueTypeName: string(proto.MessageName(&interfaces.BondLink_BondedInterface{})),\n\t\tCreate: descriptorCtx.Create,\n\t\tDelete: descriptorCtx.Delete,\n\t\tDependencies: descriptorCtx.Dependencies,\n\t}\n\treturn adapter.NewBondedInterfaceDescriptor(typedDescriptor), descriptorCtx\n}", "title": "" } ]
[ { "docid": "9aa4c5cab674ba90fcb3533eed03e2e8", "score": "0.68256015", "text": "func (d *BondedInterfaceDescriptor) Create(key string, bondedIf *interfaces.BondLink_BondedInterface) (metadata interface{}, err error) {\n\tbondIf, _, _ := interfaces.ParseBondedInterfaceKey(key)\n\n\tbondIfMeta, found := d.ifIndex.LookupByName(bondIf)\n\tif !found {\n\t\terr = errors.Errorf(\"failed to find bond interface %s\", bondIf)\n\t\td.log.Error(err)\n\t\treturn nil, err\n\t}\n\n\tslaveMeta, found := d.ifIndex.LookupByName(bondedIf.Name)\n\tif !found {\n\t\terr = errors.Errorf(\"failed to find bond %s slave interface %s\", bondIf, bondedIf.Name)\n\t\td.log.Error(err)\n\t\treturn nil, err\n\t}\n\n\terr = d.ifHandler.AttachInterfaceToBond(slaveMeta.SwIfIndex, bondIfMeta.SwIfIndex, bondedIf.IsPassive, bondedIf.IsLongTimeout)\n\tif err != nil {\n\t\td.log.Error(err)\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "740ab3f367c0a2bb5da06b4a947fe6b4", "score": "0.6319895", "text": "func (t *Bfd) NewInterface(Id string) (*Bfd_Interface, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*Bfd_Interface)\n\t}\n\n\tkey := Id\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &Bfd_Interface{\n\t\tId: &Id,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "467013cbf5e9cded31a397290daba411", "score": "0.5615139", "text": "func NewInterface(ifc net.Interface) *Interface {\n\treturn &Interface{\n\t\tInterface: ifc,\n\t\taddrs: nil,\n\t}\n}", "title": "" }, { "docid": "7b51fba3a441fb28e8e2be747a66e0d9", "score": "0.53945154", "text": "func (*Afts_NextHop_InterfaceRef) Descriptor() ([]byte, []int) {\n\treturn file_v1_proto_gribi_aft_gribi_aft_proto_rawDescGZIP(), []int{1, 8, 0}\n}", "title": "" }, { "docid": "8a5a1b3a18022d82277bab93a2eab648", "score": "0.53659517", "text": "func (t *NetworkInstance) NewInterface(Id string) (*NetworkInstance_Interface, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*NetworkInstance_Interface)\n\t}\n\n\tkey := Id\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &NetworkInstance_Interface{\n\t\tId: &Id,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "436b1efc18dd942741670f2e72ffa909", "score": "0.53039455", "text": "func NewInterface(methods []*types.Func, embeddeds []*types.Named,) *types.Interface", "title": "" }, { "docid": "4e3d026361cb12e9316fde122cc460d3", "score": "0.5174809", "text": "func NewInterfaceWatcher(kvscheduler kvs.KVScheduler, ifHandler linuxcalls.NetlinkAPI, notifyInterface func(*ifmodel.InterfaceNotification), log logging.PluginLogger) *InterfaceWatcher {\n\tdescriptor := &InterfaceWatcher{\n\t\tlog: log.NewLogger(\"if-watcher\"),\n\t\tkvscheduler: kvscheduler,\n\t\tifHandler: ifHandler,\n\t\tnotify: notifyInterface,\n\t\tifaces: make(map[string]hostInterface),\n\t\tlinkNotifCh: make(chan netlink.LinkUpdate),\n\t\taddrNotifCh: make(chan netlink.AddrUpdate),\n\t\tdelayedLinkNotifCh: make(chan linkNotif, 100),\n\t\tdoneCh: make(chan struct{}),\n\t}\n\tdescriptor.intfsInSyncCond = sync.NewCond(&descriptor.ifacesMu)\n\tdescriptor.ctx, descriptor.cancel = context.WithCancel(context.Background())\n\n\treturn descriptor\n}", "title": "" }, { "docid": "42b8c490b452c2703ccc2d91463963aa", "score": "0.5127287", "text": "func (t *Device) NewInterface(Name string) (*Interface, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*Interface)\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &Interface{\n\t\tName: &Name,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "a66d4db5dcb1b98c43b0150e82cdb997", "score": "0.5119391", "text": "func (*LogicalInterface) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_baremetalsolution_v2_network_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "b26892a84df4131f18592602a0f1306e", "score": "0.51170325", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ldp_Discovery_Interfaces) NewInterface(Name string) (*SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ldp_Discovery_Interfaces_Interface, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ldp_Discovery_Interfaces_Interface)\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ldp_Discovery_Interfaces_Interface{\n\t\tName: &Name,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "1ffa8f769b9d7270430c4a75763bbd01", "score": "0.5075322", "text": "func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors) NewNeighbor(Id string) (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Neighbor == nil {\n\t\tt.Neighbor = make(map[string]*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor)\n\t}\n\n\tkey := Id\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.Neighbor[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Neighbor\", key)\n\t}\n\n\tt.Neighbor[key] = &OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor{\n\t\tId: &Id,\n\t}\n\n\treturn t.Neighbor[key], nil\n}", "title": "" }, { "docid": "e546a33161844a351cacc05b2f6be7f2", "score": "0.5073328", "text": "func (*ReqCreateAdaptiveIPServer) Descriptor() ([]byte, []int) {\n\treturn file_harp_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "57c6da813bcfd9b640746b605d6fe0d2", "score": "0.5065641", "text": "func (*Interface) Descriptor() ([]byte, []int) {\n\treturn file_proto_daemon_v1_daemon_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "f40261254d20d8f8d57fff2b1703209e", "score": "0.50582206", "text": "func (x *fastReflection_MsgValidatorBond) New() protoreflect.Message {\n\treturn new(fastReflection_MsgValidatorBond)\n}", "title": "" }, { "docid": "cce897fc8afa72f8aa0211166e51b20c", "score": "0.50499415", "text": "func (*ServerNetworkTemplate_LogicalInterface) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_baremetalsolution_v2_instance_proto_rawDescGZIP(), []int{16, 0}\n}", "title": "" }, { "docid": "7d8a54dc913f1a69ef2e3fcfb42ade95", "score": "0.50176245", "text": "func (*NotifyInterfaceDownRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_daemon_v1_daemon_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "323bacb28fddd44742b9ee131e7cc8ba", "score": "0.5003755", "text": "func (d *BondedInterfaceDescriptor) Delete(key string, bondedIf *interfaces.BondLink_BondedInterface, metadata interface{}) error {\n\tbondIf, _, _ := interfaces.ParseBondedInterfaceKey(key)\n\n\tslaveIfMeta, found := d.ifIndex.LookupByName(bondedIf.Name)\n\tif !found {\n\t\terr := errors.Errorf(\"failed to find bond %s slave interface %s\", bondIf, bondedIf.Name)\n\t\td.log.Error(err)\n\t\treturn err\n\t}\n\n\terr := d.ifHandler.DetachInterfaceFromBond(slaveIfMeta.SwIfIndex)\n\tif err != nil {\n\t\td.log.Error(err)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "4ea5b6d1a510ce8e2e64501948a9b117", "score": "0.49852034", "text": "func NewProxyArpInterfaceDescriptor(scheduler kvs.KVScheduler,\n\tproxyArpHandler vppcalls.ProxyArpVppAPI, log logging.PluginLogger) *kvs.KVDescriptor {\n\n\tctx := &ProxyArpInterfaceDescriptor{\n\t\tscheduler: scheduler,\n\t\tproxyArpHandler: proxyArpHandler,\n\t\tlog: log.NewLogger(\"proxy-arp-interface-descriptor\"),\n\t}\n\n\ttypedDescr := &adapter.ProxyARPInterfaceDescriptor{\n\t\tName: ProxyArpInterfaceDescriptorName,\n\t\tKeySelector: func(key string) bool {\n\t\t\t_, isProxyARPInterfaceKey := l3.ParseProxyARPInterfaceKey(key)\n\t\t\treturn isProxyARPInterfaceKey\n\t\t},\n\t\tValueTypeName: string(proto.MessageName(&l3.ProxyARP_Interface{})),\n\t\tCreate: ctx.Create,\n\t\tDelete: ctx.Delete,\n\t\tDependencies: ctx.Dependencies,\n\t}\n\treturn adapter.NewProxyARPInterfaceDescriptor(typedDescr)\n}", "title": "" }, { "docid": "6cb3b1cfb16864e4073598fb752bea8d", "score": "0.49848145", "text": "func (*IamBinding) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_securitycenter_v1_iam_binding_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "fe167461a16cccae40a6347d5f1089ca", "score": "0.4971209", "text": "func (x *fastReflection_MsgValidatorBondResponse) New() protoreflect.Message {\n\treturn new(fastReflection_MsgValidatorBondResponse)\n}", "title": "" }, { "docid": "d65479b365ebdcb419bb12f605f3f837", "score": "0.49511495", "text": "func NewDeviceDescriptor(d *gousb.Device) (ndd *DeviceDescriptor, err error) {\n\n\tndd = new(DeviceDescriptor)\n\tdata := make([]byte, BufferSizeDeviceDescriptor)\n\n\t_, err = d.Control(\n\t\tRequestDirectionIn + RequestTypeStandard + RequestRecipientDevice,\n\t\tRequestGetDescriptor,\n\t\tTypeDeviceDescriptor,\n\t\tInterfaceNumber,\n\t\tdata)\n\n\tif err == nil {\n\n\t\t*ndd = DeviceDescriptor {\n\t\t\tdata[0],\n\t\t\tdata[1],\n\t\t\tuint16(data[2]) + (uint16(data[3])<<8),\n\t\t\tdata[4],\n\t\t\tdata[5],\n\t\t\tdata[6],\n\t\t\tdata[7],\n\t\t\tuint16(data[8]) + (uint16(data[9])<<8),\n\t\t\tuint16(data[10]) + (uint16(data[11])<<8),\n\t\t\tuint16(data[12]) + (uint16(data[13])<<8),\n\t\t\tdata[14],\n\t\t\tdata[15],\n\t\t\tdata[16],\n\t\t\tdata[17]}\n\t} else {\n\t\terr = fmt.Errorf(\"%s: %v\", getFunctionInfo(), err)\n\t}\n\n\treturn ndd, err\n}", "title": "" }, { "docid": "d93945b6dc9e346b08509de02626d9c2", "score": "0.49100727", "text": "func NewConfigDescriptor(d *gousb.Device) (ncd *ConfigDescriptor, err error) {\n\n\tncd = new(ConfigDescriptor)\n\tdata := make([]byte, BufferSizeConfigDescriptor)\n\n\t_, err = d.Control(\n\t\tRequestDirectionIn + RequestTypeStandard + RequestRecipientDevice,\n\t\tRequestGetDescriptor,\n\t\tTypeConfigDescriptor,\n\t\tInterfaceNumber,\n\t\tdata)\n\n\tif err == nil {\n\n\t\t*ncd = ConfigDescriptor {\n\t\t\tdata[0],\n\t\t\tdata[1],\n\t\t\tuint16(data[2]) + (uint16(data[3]) << 8),\n\t\t\tdata[4],\n\t\t\tdata[5],\n\t\t\tdata[6],\n\t\t\tdata[7],\n\t\t\tdata[8]}\n\t} else {\n\t\terr = fmt.Errorf(\"%s: %v\", getFunctionInfo(), err)\n\t}\n\n\treturn ncd, err\n}", "title": "" }, { "docid": "6a59b8646e0cfbff9b1b7b532e07f19b", "score": "0.49009675", "text": "func New(t Transporter, options ...Option) *Bon {\n\tb := &Bon{\n\t\ttransporter: t,\n\t\thandlers: make(map[Route]func(net.Conn)),\n\t\toptions: &opts{\n\t\t\tlogOutput: os.Stdout,\n\t\t},\n\t}\n\tfor _, optionFunc := range options {\n\t\toptionFunc(b)\n\t}\n\tb.log = log.New(b.options.logOutput, \"bon\", log.LstdFlags)\n\treturn b\n}", "title": "" }, { "docid": "4cbb926d3df2b62eae95b5b0659b1e7a", "score": "0.48871213", "text": "func NewInterfaceHandler(ch govppapi.Channel) InterfaceVppAPI {\n\th := &InterfaceHandler{\n\t\tch: ch,\n\t}\n\treturn h\n}", "title": "" }, { "docid": "793f8315979648c70125c25d220663d6", "score": "0.48839346", "text": "func (t *OpenconfigInterfaces_Interfaces) NewInterface(Name string) (*OpenconfigInterfaces_Interfaces_Interface, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*OpenconfigInterfaces_Interfaces_Interface)\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &OpenconfigInterfaces_Interfaces_Interface{\n\t\tName: &Name,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "aab8e0c3256a5abd29f209895dd7de1a", "score": "0.48803642", "text": "func (*LogicalInterface_LogicalNetworkInterface) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_baremetalsolution_v2_network_proto_rawDescGZIP(), []int{3, 0}\n}", "title": "" }, { "docid": "ac4f66ffb9793de1c7376517f73cbd59", "score": "0.4867272", "text": "func (*NetworkInterface) Descriptor() ([]byte, []int) {\n\treturn file_flow_flow_proto_rawDescGZIP(), []int{34}\n}", "title": "" }, { "docid": "4f2b6add60da73d02e0630a8983926ba", "score": "0.4857238", "text": "func (*ResCreateAdaptiveIPServer) Descriptor() ([]byte, []int) {\n\treturn file_harp_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "f453e07a895cf4bb8089bce5677f96b0", "score": "0.48562217", "text": "func (*GetInterfacesRequest) Descriptor() ([]byte, []int) {\n\treturn file_ddi_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "113a4aac164b218c3d0198b6d296131a", "score": "0.48509523", "text": "func New() (iface *Intface) {\n\tiface = &Intface{}\n\tvar err error\n\tiface.pipe, err = zmq.NewSocket(zmq.PAIR)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = iface.pipe.Bind(\"inproc://iface\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tgo iface.agent()\n\ttime.Sleep(100 * time.Millisecond)\n\treturn\n}", "title": "" }, { "docid": "e0ee6f0d99242f2967dd88ca8cdf775b", "score": "0.4850405", "text": "func (*NotifyInterfaceDownResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_daemon_v1_daemon_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "92b754c822dc65b04574feca2dd49a32", "score": "0.48365232", "text": "func (*Nic) Descriptor() ([]byte, []int) {\n\treturn file_deploy_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "9dfa00a555a5370f0cdb231ab1df4cbd", "score": "0.48358902", "text": "func (*GetInterfacesResponse) Descriptor() ([]byte, []int) {\n\treturn file_ddi_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "7dc560a6f3016870c15069482c985299", "score": "0.48287272", "text": "func (*NetworkInterface) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_compute_v1_instance_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "7297425138463c6e12241a14268e1a4b", "score": "0.48250833", "text": "func (*ProxyInitConfiguration) Descriptor() ([]byte, []int) {\n\treturn file_api_v1alpha1_istiocontrolplane_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "dba34e231c648a0a6eef33f15d7282d8", "score": "0.48157853", "text": "func (plugin *BDConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error {\n\tplugin.log.Infof(\"Assigning new interface %v to bridge domain\", ifName)\n\t// Find bridge domain where the interface should be assigned\n\tbdIdx, bd, bdIf, found := plugin.bdIndexes.LookupBdForInterface(ifName)\n\tif !found {\n\t\tplugin.log.Debugf(\"Interface %s does not belong to any bridge domain\", ifName)\n\t\treturn nil\n\t}\n\tvar bdIfs []*l2.BridgeDomains_BridgeDomain_Interfaces // Single-value\n\tconfiguredIf, err := plugin.bdHandler.SetInterfacesToBridgeDomain(bd.Name, bdIdx, append(bdIfs, bdIf), plugin.ifIndexes)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error while assigning interface %s to bridge domain %s\", ifName, bd.Name)\n\t}\n\n\t// Refresh metadata\n\tconfiguredIfs, found := plugin.bdIndexes.LookupConfiguredIfsForBd(bd.Name)\n\tif !found {\n\t\treturn fmt.Errorf(\"unable to get list of configured interfaces from %s\", configuredIfs)\n\t}\n\tplugin.bdIndexes.UpdateMetadata(bd.Name, l2idx.NewBDMetadata(bd, append(configuredIfs, configuredIf...)))\n\n\t// Push to bridge domain state.\n\tif err := plugin.PropagateBdDetailsToStatus(bdIdx, bd.Name); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a571cdb00823c17cb72f48803934952c", "score": "0.48046044", "text": "func (*PDBConfiguration) Descriptor() ([]byte, []int) {\n\treturn file_api_v1alpha1_istiocontrolplane_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "01be45730a3aaae6689f9757338f7fe7", "score": "0.47878578", "text": "func (t *SrlNokiaSystem_System_Lldp_Interface) NewNeighbor(Id string) (*SrlNokiaSystem_System_Lldp_Interface_Neighbor, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Neighbor == nil {\n\t\tt.Neighbor = make(map[string]*SrlNokiaSystem_System_Lldp_Interface_Neighbor)\n\t}\n\n\tkey := Id\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.Neighbor[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Neighbor\", key)\n\t}\n\n\tt.Neighbor[key] = &SrlNokiaSystem_System_Lldp_Interface_Neighbor{\n\t\tId: &Id,\n\t}\n\n\treturn t.Neighbor[key], nil\n}", "title": "" }, { "docid": "2d1499577602a044e4126eb81be47e61", "score": "0.47781906", "text": "func (*Bidding) Descriptor() ([]byte, []int) {\n\treturn file_beeswax_bid_adcandidate_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "04e4e22303d2a1e2852de0ac40e78df0", "score": "0.47766688", "text": "func (t *Bfd) GetOrCreateInterface(Id string) *Bfd_Interface {\n\n\tkey := Id\n\n\tif v, ok := t.Interface[key]; ok {\n\t\treturn v\n\t}\n\t// Panic if we receive an error, since we should have retrieved an existing\n\t// list member. This allows chaining of GetOrCreate methods.\n\tv, err := t.NewInterface(Id)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateInterface got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "d8a107fe6ba90bc6aab0c41a3d8d0ba8", "score": "0.4771382", "text": "func (x *fastReflection_MsgCancelUnbondingDelegation) New() protoreflect.Message {\n\treturn new(fastReflection_MsgCancelUnbondingDelegation)\n}", "title": "" }, { "docid": "2af9432f783de4e3893f1d7bc05640b5", "score": "0.4771055", "text": "func (t *OpenconfigLldp_Lldp_Interfaces) NewInterface(Name string) (*OpenconfigLldp_Lldp_Interfaces_Interface, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*OpenconfigLldp_Lldp_Interfaces_Interface)\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &OpenconfigLldp_Lldp_Interfaces_Interface{\n\t\tName: &Name,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "6f05ddcffc5c80456bb595d53e6e44f8", "score": "0.4769008", "text": "func (*ReqCreateAdaptiveIPSetting) Descriptor() ([]byte, []int) {\n\treturn file_harp_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "3f70f79b19e520e07cbb25bc49817748", "score": "0.47454727", "text": "func NewInterface(parent *ast.InterfaceType, spec *ast.TypeSpec, annotationMap *AnnotationMap) *Interface {\n\n\treturn &Interface{\n\t\tBaseType: BaseType{\n\t\t\tname: spec.Name.Name,\n\t\t\tannotations: annotationMap,\n\t\t},\n\t\tparent: parent,\n\t\tspec: spec,\n\t\tmethods: parent.Methods.List,\n\t}\n}", "title": "" }, { "docid": "2515a6e150cb1d67a243ca21d1fff9e1", "score": "0.47335115", "text": "func (*InterfacesRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_daemon_v1_daemon_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "8dbcf358d38c28614e36fda01582c04f", "score": "0.47272512", "text": "func NewDiamondDescriptor(opts ...DiamondDescriptorOption) *DiamondDescriptor {\n\td := defaultDiamondDescriptor()\n\tfor _, apply := range opts {\n\t\tapply(d)\n\t}\n\treturn d\n}", "title": "" }, { "docid": "7f3683cfa8da11520e575c4f04c94fe0", "score": "0.47240657", "text": "func (*ReqGetAdaptiveIPServer) Descriptor() ([]byte, []int) {\n\treturn file_harp_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "a7f68d065fb5734e2416f4defc2bbc12", "score": "0.47152433", "text": "func (t *Interface_Subinterface_Ipv4) NewNeighbor(Ip string) (*Interface_Subinterface_Ipv4_Neighbor, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Neighbor == nil {\n\t\tt.Neighbor = make(map[string]*Interface_Subinterface_Ipv4_Neighbor)\n\t}\n\n\tkey := Ip\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.Neighbor[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Neighbor\", key)\n\t}\n\n\tt.Neighbor[key] = &Interface_Subinterface_Ipv4_Neighbor{\n\t\tIp: &Ip,\n\t}\n\n\treturn t.Neighbor[key], nil\n}", "title": "" }, { "docid": "53be3e32ffc333c992012bd3925e71a6", "score": "0.47094712", "text": "func NewDescriptor(proto string, name string, addr string, port int, zone string, scheme string) *ProtocolDescriptor {\n\treturn &ProtocolDescriptor{\n\t\tname,\n\t\taddr,\n\t\tport,\n\t\tzone,\n\t\tscheme,\n\t\tmake(map[string]interface{}),\n\t\tproto,\n\t\tuuid.New(),\n\t}\n}", "title": "" }, { "docid": "c6e4b85354d5f19026a983b295d3524a", "score": "0.4700952", "text": "func NewInterface() *Interface {\n\treturn &Interface{}\n}", "title": "" }, { "docid": "65e1e6bc6cce59500dc597c152ce3a77", "score": "0.4691949", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Isis_Instance) NewInterface(InterfaceName string) (*SrlNokiaNetworkInstance_NetworkInstance_Protocols_Isis_Instance_Interface, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*SrlNokiaNetworkInstance_NetworkInstance_Protocols_Isis_Instance_Interface)\n\t}\n\n\tkey := InterfaceName\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &SrlNokiaNetworkInstance_NetworkInstance_Protocols_Isis_Instance_Interface{\n\t\tInterfaceName: &InterfaceName,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "6285ffc6331825e2d7024cd05d1615b0", "score": "0.46854106", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area) NewInterface(InterfaceName string) (*SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface)\n\t}\n\n\tkey := InterfaceName\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface{\n\t\tInterfaceName: &InterfaceName,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "73dd83cd657ed6da0c1794e25d230cfc", "score": "0.4672889", "text": "func (*InterfacesResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_daemon_v1_daemon_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "df0f209c7af9fda8996e0b9fd8727bf8", "score": "0.4663671", "text": "func (*PrivateServiceConnectConfig) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_aiplatform_v1beta1_service_networking_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "48ce154bbe64b0e1292a2d28f9ea24df", "score": "0.4660062", "text": "func (x *fastReflection_MsgValidatorBond) Interface() protoreflect.ProtoMessage {\n\treturn (*MsgValidatorBond)(x)\n}", "title": "" }, { "docid": "fbb59d7a3aa9d3a59cb92705b8fe470c", "score": "0.46593243", "text": "func (*HelloReply) Descriptor() ([]byte, []int) {\n\treturn file_gateway_gateway_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "e61fc6c198028220fa130f6a3dcb50a4", "score": "0.46567997", "text": "func NewInterface(methods []*Func, embeddeds []*Named) *Interface {\n\ttnames := make([]Type, len(embeddeds))\n\tfor i, t := range embeddeds {\n\t\ttnames[i] = t\n\t}\n\treturn NewInterfaceType(methods, tnames)\n}", "title": "" }, { "docid": "92efa03ad563c20d0f905bd251b6018a", "score": "0.4651779", "text": "func (t *SrlNokiaBfd_Bfd_MicroBfdSessions_LagInterface) NewMemberInterface(Name string) (*SrlNokiaBfd_Bfd_MicroBfdSessions_LagInterface_MemberInterface, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.MemberInterface == nil {\n\t\tt.MemberInterface = make(map[string]*SrlNokiaBfd_Bfd_MicroBfdSessions_LagInterface_MemberInterface)\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.MemberInterface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list MemberInterface\", key)\n\t}\n\n\tt.MemberInterface[key] = &SrlNokiaBfd_Bfd_MicroBfdSessions_LagInterface_MemberInterface{\n\t\tName: &Name,\n\t}\n\n\treturn t.MemberInterface[key], nil\n}", "title": "" }, { "docid": "fbb675ec08f4963f41782f8a67d5f64d", "score": "0.46461308", "text": "func New(inst ivi.Instrument, reset bool) (Ag33220, error) {\n\tchannelNames := []string{\n\t\t\"Output\",\n\t}\n\toutputCount := len(channelNames)\n\tchannels := make([]Channel, outputCount)\n\tfor i, ch := range channelNames {\n\t\tbaseChannel := fgen.NewChannel(i, ch, inst)\n\t\tchannels[i] = Channel{baseChannel}\n\t}\n\tinherentBase := ivi.InherentBase{\n\t\tClassSpecMajorVersion: 4,\n\t\tClassSpecMinorVersion: 3,\n\t\tClassSpecRevision: \"5.2\",\n\t\tGroupCapabilities: []string{\n\t\t\t\"IviFgenBase\",\n\t\t\t\"IviFgenStdfunc\",\n\t\t\t\"IviFgenTrigger\",\n\t\t\t\"IviFgenInternalTrigger\",\n\t\t\t\"IviFgenBurst\",\n\t\t},\n\t\tSupportedInstrumentModels: []string{\n\t\t\t\"33220A\",\n\t\t\t\"33210A\",\n\t\t},\n\t}\n\tinherent := ivi.NewInherent(inst, inherentBase)\n\tdriver := Ag33220{\n\t\tinst: inst,\n\t\tChannels: channels,\n\t\tInherent: inherent,\n\t}\n\tif reset {\n\t\terr := driver.Reset()\n\t\treturn driver, err\n\t}\n\treturn driver, nil\n}", "title": "" }, { "docid": "ea3943d3c87a528f48bb4323998a6fd8", "score": "0.46409342", "text": "func (*CreateAddressReply) Descriptor() ([]byte, []int) {\n\treturn file_draw_interface_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "91e34cf79bbc37df223e3365bbab6b35", "score": "0.46372044", "text": "func (*PrivateServiceConnectConfig) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_aiplatform_v1_service_networking_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "84f05fcf5d4c39ff737fe1b6754f0b45", "score": "0.46332294", "text": "func (*IstiodConfiguration) Descriptor() ([]byte, []int) {\n\treturn file_api_v1alpha1_istiocontrolplane_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "a222474b7a0c87f49296e69d9f3da717", "score": "0.4633043", "text": "func (*Dataplane_Networking_Inbound) Descriptor() ([]byte, []int) {\n\treturn file_mesh_v1alpha1_dataplane_proto_rawDescGZIP(), []int{0, 0, 0}\n}", "title": "" }, { "docid": "5d9dd365c44eef1e60aa79ed1bddcb06", "score": "0.4632685", "text": "func (*FederatedGatewaySpec) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_solo_apis_api_gloo_fed_fed_gateway_v1_gateway_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "f5db17eec68b7751c00d546c882e828d", "score": "0.46226263", "text": "func NewPrototypeDescriptorMock(t minimock.Tester) *PrototypeDescriptorMock {\n\tm := &PrototypeDescriptorMock{t: t}\n\tif controller, ok := t.(minimock.MockController); ok {\n\t\tcontroller.RegisterMocker(m)\n\t}\n\n\tm.CodeMock = mPrototypeDescriptorMockCode{mock: m}\n\n\tm.HeadRefMock = mPrototypeDescriptorMockHeadRef{mock: m}\n\n\tm.StateIDMock = mPrototypeDescriptorMockStateID{mock: m}\n\n\treturn m\n}", "title": "" }, { "docid": "a95e507de031dabf17ae861211a8085f", "score": "0.4621322", "text": "func (*Banner) Descriptor() ([]byte, []int) {\n\treturn file_config_shared_global_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "e9775a359cc7dec8bfc975f7604033ce", "score": "0.461854", "text": "func (*CNIConfiguration) Descriptor() ([]byte, []int) {\n\treturn file_api_v1alpha1_istiocontrolplane_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "982bfc56597c638bc9db9893ad91db3c", "score": "0.46183994", "text": "func (*CreateInstructionRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_datalabeling_v1beta1_data_labeling_service_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "c9cc239eede90239c92ddf79d5eabd85", "score": "0.46179566", "text": "func (d *ACLToInterfaceDescriptor) GetDescriptor() *kvs.KVDescriptor {\n\treturn &kvs.KVDescriptor{\n\t\tName: ACLToInterfaceDescriptorName,\n\t\tKeySelector: d.IsACLInterfaceKey,\n\t\tCreate: d.Create,\n\t\tDelete: d.Delete,\n\t\tDependencies: d.Dependencies,\n\t}\n}", "title": "" }, { "docid": "59f784b3fe7629461e32249aefc4bcce", "score": "0.46123624", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance) NewInterface(Name string) (*SrlNokiaNetworkInstance_NetworkInstance_Interface, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Interface == nil {\n\t\tt.Interface = make(map[string]*SrlNokiaNetworkInstance_NetworkInstance_Interface)\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.Interface[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Interface\", key)\n\t}\n\n\tt.Interface[key] = &SrlNokiaNetworkInstance_NetworkInstance_Interface{\n\t\tName: &Name,\n\t}\n\n\treturn t.Interface[key], nil\n}", "title": "" }, { "docid": "69a0ef84f061163c8c2298752a31607b", "score": "0.4594796", "text": "func (*AddSniMatchMetadata) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_apploadbalancer_v1_load_balancer_service_proto_rawDescGZIP(), []int{28}\n}", "title": "" }, { "docid": "3f244626cb2f2be5556205a7b42e29eb", "score": "0.45890847", "text": "func (*CreateImplementRequest) Descriptor() ([]byte, []int) {\n\treturn file_entpb_entpb_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "91031c7dd0a175fd9a23e5652dea67e7", "score": "0.45848307", "text": "func New(opts *Options) (stack.LinkEndpoint, error) {\n\tcaps := stack.LinkEndpointCapabilities(0)\n\tif opts.RXChecksumOffload {\n\t\tcaps |= stack.CapabilityRXChecksumOffload\n\t}\n\n\tif opts.TXChecksumOffload {\n\t\tcaps |= stack.CapabilityTXChecksumOffload\n\t}\n\n\thdrSize := 0\n\tif opts.EthernetHeader {\n\t\thdrSize = header.EthernetMinimumSize\n\t\tcaps |= stack.CapabilityResolutionRequired\n\t}\n\n\tif opts.SaveRestore {\n\t\tcaps |= stack.CapabilitySaveRestore\n\t}\n\n\tif opts.DisconnectOk {\n\t\tcaps |= stack.CapabilityDisconnectOk\n\t}\n\n\tif !opts.IsMaster && (len(opts.FDs) < int(2 + opts.NumQueuePairs * 2)) {\n\t\treturn nil, fmt.Errorf(\"Not enough file descriptors\")\n\t}\n\n\tconfig := memifConfig {\n\t\tnumS2MRings: opts.NumQueuePairs,\n\t\tnumM2SRings: opts.NumQueuePairs,\n\t\tlog2RingSize: opts.Log2RingSize,\n\t\tpacketBufferSize: opts.PacketBufferSize,\n\t}\n\n\te := &endpoint {\n\t\tmemfdFd:\t -1,\n\t\tid: opts.ID,\n\t\tisMaster: opts.IsMaster,\n\t\tconfig: config,\n\t\tmtu: opts.MTU,\n\t\tcaps: caps,\n\t\t// TODO: closedfunc...\n\t\tclosed: opts.ClosedFunc,\n\t\taddr: opts.Address,\n\t\t// TODO: maybe we dont need eth header?\n\t\thdrSize: hdrSize,\n\t\trxMode: opts.RxMode,\n\t}\n\n\tif opts.GSOMaxSize != 0 {\n\t\tif opts.SoftwareGSOEnabled {\n\t\t\te.caps |= stack.CapabilitySoftwareGSO\n\t\t} else {\n\t\t\te.caps |= stack.CapabilityHardwareGSO\n\t\t}\n\t\te.gsoMaxSize = opts.GSOMaxSize\n\t}\n\n\tif e.isMaster {\n\t\t// FIXME: use go-routine\n\t\tlistener, err := e.newListener(opts.FDs[0], -1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// will block until connected\n\t\terr = listener.poll()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Assert we received a connection request\n\t} else {\n\t\te.memfdFd = opts.FDs[0]\n\t\t// assign endpoint and interrupt fd to queues\n\t\tfor i := uint16(0); i < opts.NumQueuePairs; i++ {\n\t\t\ttxq := queue {\n\t\t\t\tringType: ringTypeS2M,\n\t\t\t\tlog2RingSize: 0,\n\t\t\t\tregion: 0,\n\t\t\t\te: e,\n\t\t\t\tringOffset: 0,\n\t\t\t\tlastHead: 0,\n\t\t\t\tlastTail: 0,\n\t\t\t\tinterruptFd: opts.FDs[1 + i],\n\t\t\t}\n\t\t\te.txQueues = append(e.txQueues, txq)\n\n\t\t\trxq := queue {\n\t\t\t\tringType: ringTypeM2S,\n\t\t\t\tlog2RingSize: 0,\n\t\t\t\tregion: 0,\n\t\t\t\te: e,\n\t\t\t\tringOffset: 0,\n\t\t\t\tlastHead: 0,\n\t\t\t\tlastTail: 0,\n\t\t\t\tinterruptFd: opts.FDs[1 + i + opts.NumQueuePairs],\n\t\t\t}\n\t\t\te.rxQueues = append(e.rxQueues, rxq)\n\t\t}\n\n\t\tcontrol, err := e.newControlChannel(opts.FDs[(opts.NumQueuePairs * 2) + 1], -1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// FIXME: use go-routine so that memif doesn't block\n\t\tfor !e.connected {\n\t\t\terr = control.poll()\n\t\t\tif err != nil {\n\t\t\t\t// TODO: disconnect\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\t// FIXME: remove once connection establishment is handled in go-routines\n\tif !e.connected {\n\t\treturn nil, fmt.Errorf(\"Failed to connect\")\n\t}\n\n\treturn e, nil\n}", "title": "" }, { "docid": "ae5070f8ec7e5d84b47f0fca2e3a9c35", "score": "0.45814413", "text": "func (*ReqDeleteAdaptiveIPServer) Descriptor() ([]byte, []int) {\n\treturn file_harp_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "65aa05dcdd30fa82e5343f365ef40c3f", "score": "0.45765042", "text": "func (t *Interface_Subinterface_Ipv6) NewNeighbor(Ip string) (*Interface_Subinterface_Ipv6_Neighbor, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Neighbor == nil {\n\t\tt.Neighbor = make(map[string]*Interface_Subinterface_Ipv6_Neighbor)\n\t}\n\n\tkey := Ip\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.Neighbor[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Neighbor\", key)\n\t}\n\n\tt.Neighbor[key] = &Interface_Subinterface_Ipv6_Neighbor{\n\t\tIp: &Ip,\n\t}\n\n\treturn t.Neighbor[key], nil\n}", "title": "" }, { "docid": "0455475b034aac94e7f2f11f623b50ca", "score": "0.45701554", "text": "func (*FederatedGatewaySpec_Template) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_solo_apis_api_gloo_fed_fed_gateway_v1_gateway_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "b480ef06b2c9ab8bcf876df16b58a857", "score": "0.4569933", "text": "func (*NewName) Descriptor() ([]byte, []int) {\n\treturn file_dns_service_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "f8ba96f9b5fb55916806e413a2ba2be8", "score": "0.45697838", "text": "func NewFakeInterface() *FakeInterface {\n\treturn &FakeInterface{\n\t\teventsCh: make(chan watch.Event),\n\t\tclosed: uint32(1),\n\t\tstopCh: make(chan struct{}),\n\t}\n}", "title": "" }, { "docid": "72ec6a8c7381b5e1104e4f0d92e2a95f", "score": "0.45685884", "text": "func (t *Bfd_Interface) GetOrCreateInterfaceRef() *Bfd_Interface_InterfaceRef {\n\tif t.InterfaceRef != nil {\n\t\treturn t.InterfaceRef\n\t}\n\tt.InterfaceRef = &Bfd_Interface_InterfaceRef{}\n\treturn t.InterfaceRef\n}", "title": "" }, { "docid": "5bd685b1f1e46fc8f9694bd028667c47", "score": "0.45675036", "text": "func (*CreateMethodDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_audit_proto_v1alpha2_method_descriptor_service_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "aee5b5e8098c55c1a8375bd348e596aa", "score": "0.45661432", "text": "func (*ResGetAdaptiveIPServer) Descriptor() ([]byte, []int) {\n\treturn file_harp_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "bca4dd1f97142e479f8b697fd233a577", "score": "0.45657113", "text": "func (t *OpenconfigLldp_Lldp_Interfaces_Interface) GetOrCreateNeighbors() *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors {\n\tif t.Neighbors != nil {\n\t\treturn t.Neighbors\n\t}\n\tt.Neighbors = &OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors{}\n\treturn t.Neighbors\n}", "title": "" }, { "docid": "fd0778637affcaf69a47350da037abb2", "score": "0.45628387", "text": "func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors) NewNeighbor(Id string) (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Neighbor == nil {\n\t\tt.Neighbor = make(map[string]*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor)\n\t}\n\n\tkey := Id\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.Neighbor[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Neighbor\", key)\n\t}\n\n\tt.Neighbor[key] = &OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor{\n\t\tId: &Id,\n\t}\n\n\treturn t.Neighbor[key], nil\n}", "title": "" }, { "docid": "e932a5586c8c118172d163e127570019", "score": "0.45569965", "text": "func (*Bidding_CustomStrategy) Descriptor() ([]byte, []int) {\n\treturn file_beeswax_bid_adcandidate_proto_rawDescGZIP(), []int{0, 2}\n}", "title": "" }, { "docid": "b2d939f72d81170bff1da0f09b467b46", "score": "0.45565847", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface) NewNeighbor(RouterId string) (*SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface_Neighbor, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Neighbor == nil {\n\t\tt.Neighbor = make(map[string]*SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface_Neighbor)\n\t}\n\n\tkey := RouterId\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.Neighbor[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Neighbor\", key)\n\t}\n\n\tt.Neighbor[key] = &SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface_Neighbor{\n\t\tRouterId: &RouterId,\n\t}\n\n\treturn t.Neighbor[key], nil\n}", "title": "" }, { "docid": "026ffe284516b0c7d6d871af68891083", "score": "0.45522794", "text": "func newNetInterfaceMutation(c config, op Op, opts ...netinterfaceOption) *NetInterfaceMutation {\n\tm := &NetInterfaceMutation{\n\t\tconfig: c,\n\t\top: op,\n\t\ttyp: TypeNetInterface,\n\t\tclearedFields: make(map[string]struct{}),\n\t}\n\tfor _, opt := range opts {\n\t\topt(m)\n\t}\n\treturn m\n}", "title": "" }, { "docid": "9917c99bc0847fdc60d922cac902d884", "score": "0.4552205", "text": "func (*ResGetAdaptiveIPAvailableIPList) Descriptor() ([]byte, []int) {\n\treturn file_harp_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "a0b567287873d6f7f7b4b260d7c53d95", "score": "0.45511746", "text": "func BindToInterface(fd int, ifname string) error {\n\treturn interfaces.BindToInterface(fd, ifname)\n}", "title": "" }, { "docid": "f594e9188ecc13442aa29bfe629a01e9", "score": "0.45506495", "text": "func (*ProxyConfiguration) Descriptor() ([]byte, []int) {\n\treturn file_api_v1alpha1_istiocontrolplane_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "24d595d4ba6c9ae38a5b0aa20b8a849c", "score": "0.45498624", "text": "func (*Ancient) Descriptor() ([]byte, []int) {\n\treturn file_api_ancient_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "d894473296462f7030c94e37923ebcf4", "score": "0.45446837", "text": "func (d *ProxyArpInterfaceDescriptor) Create(key string, value *l3.ProxyARP_Interface) (metadata interface{}, err error) {\n\tif err := d.proxyArpHandler.EnableProxyArpInterface(value.Name); err != nil {\n\t\treturn nil, errors.Errorf(\"failed to enable proxy ARP for interface %s: %v\", value.Name, err)\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "6e85a9663b85a8c025d46123be594b72", "score": "0.45440283", "text": "func NewDHCPProxyDescriptor(scheduler kvs.KVScheduler,\n\tdhcpProxyHandler vppcalls.DHCPProxyAPI, log logging.PluginLogger) *kvs.KVDescriptor {\n\n\tctx := &DHCPProxyDescriptor{\n\t\tscheduler: scheduler,\n\t\tdhcpProxyHandler: dhcpProxyHandler,\n\t\tlog: log.NewLogger(\"dhcp-proxy-descriptor\"),\n\t}\n\n\ttypedDescr := &adapter.DHCPProxyDescriptor{\n\t\tName: DHCPProxyDescriptorName,\n\t\tKeySelector: l3.ModelDHCPProxy.IsKeyValid,\n\t\tKeyLabel: l3.ModelDHCPProxy.StripKeyPrefix,\n\t\tNBKeyPrefix: l3.ModelDHCPProxy.KeyPrefix(),\n\t\tValueTypeName: l3.ModelDHCPProxy.ProtoName(),\n\t\tCreate: ctx.Create,\n\t\tDelete: ctx.Delete,\n\t\tRetrieve: ctx.Retrieve,\n\t\tDependencies: ctx.Dependencies,\n\t\tValidate: ctx.Validate,\n\t}\n\treturn adapter.NewDHCPProxyDescriptor(typedDescr)\n}", "title": "" }, { "docid": "31552b5ee4db57412770e6083d2a1604", "score": "0.45427382", "text": "func (*Afts_NextHop_IpInIp) Descriptor() ([]byte, []int) {\n\treturn file_v1_proto_gribi_aft_gribi_aft_proto_rawDescGZIP(), []int{1, 8, 1}\n}", "title": "" }, { "docid": "6815b51b9b6cb5c811def77b23ff0ffe", "score": "0.45389727", "text": "func (*CreateInstanceRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_datafusion_v1beta1_v1beta1_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "cca6449cb80d36ab6476a282467e0b56", "score": "0.45375502", "text": "func (*Bound) Descriptor() ([]byte, []int) {\n\treturn file_inner_innerpb_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "c2ad12caa64480c8f1764ab0c56c037d", "score": "0.45277828", "text": "func (b Bridge) AddInterface(ifname string) (err error) {\n\tn, err := netif.GetByName(ifname)\n\tif err != nil {\n\t\treturn\n\t}\n\tn.Name = b\n\ts := netif.SocketFd()\n\tdefer netif.SocketClose(s)\n\terr = ioctl.Ioctl(s, unix.SIOCBRADDIF, n)\n\treturn\n}", "title": "" }, { "docid": "e6e433b7e5d580960738d19613959003", "score": "0.45260233", "text": "func (*ReqGetAdaptiveIPServerList) Descriptor() ([]byte, []int) {\n\treturn file_harp_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "5d46cae66d99e9938015ac7b9ed8efc6", "score": "0.45222446", "text": "func (*ResCreateAdaptiveIPSetting) Descriptor() ([]byte, []int) {\n\treturn file_harp_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "295bff49a1484fcf6a9a661be13d85fd", "score": "0.45218042", "text": "func (*ImGift) Descriptor() ([]byte, []int) {\n\treturn file_connect_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "53aa63d53684c2074c919bd2cc746ab1", "score": "0.45199317", "text": "func NewObjectDescriptorMock(t minimock.Tester) *ObjectDescriptorMock {\n\tm := &ObjectDescriptorMock{t: t}\n\tif controller, ok := t.(minimock.MockController); ok {\n\t\tcontroller.RegisterMocker(m)\n\t}\n\n\tm.ChildPointerMock = mObjectDescriptorMockChildPointer{mock: m}\n\n\tm.CodeMock = mObjectDescriptorMockCode{mock: m}\n\n\tm.HeadRefMock = mObjectDescriptorMockHeadRef{mock: m}\n\n\tm.IsPrototypeMock = mObjectDescriptorMockIsPrototype{mock: m}\n\n\tm.MemoryMock = mObjectDescriptorMockMemory{mock: m}\n\n\tm.ParentMock = mObjectDescriptorMockParent{mock: m}\n\n\tm.PrototypeMock = mObjectDescriptorMockPrototype{mock: m}\n\n\tm.StateIDMock = mObjectDescriptorMockStateID{mock: m}\n\n\treturn m\n}", "title": "" } ]
22c1cd33973aebc5b2139b53fa83569d
IsSupportedResourceType returns true if obj is a supported Kubernetes resource type
[ { "docid": "a552ad74c2c6f1d9bd0934704fdd1d23", "score": "0.8696389", "text": "func IsSupportedResourceType(obj Resource) bool {\n\tswitch obj.(type) {\n\tcase *CronJobV1Beta1,\n\t\t*DaemonSetListV1, *DaemonSetV1, *DaemonSetV1Beta1, *DaemonSetV1Beta2,\n\t\t*DeploymentExtensionsV1Beta1, *DeploymentV1, *DeploymentV1Beta1, *DeploymentV1Beta2, *DeploymentListV1,\n\t\t*NamespaceListV1, *NamespaceV1,\n\t\t*NetworkPolicyListV1, *NetworkPolicyV1,\n\t\t*PodListV1, *PodV1, *PodTemplateV1,\n\t\t*ReplicationControllerListV1, *ReplicationControllerV1,\n\t\t*StatefulSetListV1, *StatefulSetV1, *StatefulSetV1Beta1:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" } ]
[ { "docid": "dc2b9fc537d4021a4b90d1fef6122ab7", "score": "0.7110518", "text": "func IsSupportedGroupVersionKind(obj Resource) bool {\n\tif ( IsSupportedResourceType(obj) || ResourceTypes[obj.GetObjectKind().GroupVersionKind().Kind] ) {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "b72914827edd8c2fff3facd979db5f23", "score": "0.6629554", "text": "func isSupportedRes(res *v1.ResourceName) bool {\n\tif *res == v1.ResourceCPU || *res == v1.ResourceMemory {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "9b679e3052f472872e7fc9cc1ce3fe5b", "score": "0.64290446", "text": "func fncIsResource(ctx core.Context, args []*core.ZVal) (*core.ZVal, error) {\n\tvar z *core.ZVal\n\t_, err := core.Expand(ctx, args, &z)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn core.ZBool(z.GetType() == core.ZtResource).ZVal(), nil\n}", "title": "" }, { "docid": "b79714de06dac1acf8a44e04ca2e1f27", "score": "0.6327975", "text": "func isSupported(kind string) bool {\n\t_, ok := supportedKinds[kind]\n\treturn ok\n}", "title": "" }, { "docid": "0fbcb015e8c598ef923aeff8615cf207", "score": "0.6290603", "text": "func CfnObjectType_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_customerprofiles.CfnObjectType\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "2fac64ca95a8416a606d582b65326708", "score": "0.617774", "text": "func IsSupported(value interface{}) bool {\n\t_, ok := GetType(value)\n\treturn ok\n}", "title": "" }, { "docid": "053d6c0612e23cc1bfc4d30b83018504", "score": "0.61389816", "text": "func (o *StackpathRpcResourceInfo) HasResourceType() bool {\n\tif o != nil && o.ResourceType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "20c866f7452e2c8f327ffbb9e14e126b", "score": "0.60741895", "text": "func (self *ApiQuery) hasObjType(supported ...int) bool {\n for _, s := range supported {\n if self.object.Type == s {\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "6eff9c426269c5067d59da86093c8cd4", "score": "0.6034062", "text": "func IsCRD(obj *unstructured.Unstructured) bool {\n\treturn obj.GetKind() == string(kinds.CustomResourceDefinition) &&\n\t\tstrings.HasPrefix(obj.GetAPIVersion(), \"apiextensions.k8s.io/\")\n}", "title": "" }, { "docid": "01574cfb721a4a2055635a13c8fae3b8", "score": "0.60094434", "text": "func isKnownNonPodObject(object runtime.Object) bool {\n\tswitch object.(type) {\n\tcase *apiregistrationv1.APIService,\n\t\t*apiregistrationv1beta1.APIService,\n\t\t*certificatesv1beta1.CertificateSigningRequest,\n\t\t*rbacv1.ClusterRole,\n\t\t*rbacv1.ClusterRoleBinding,\n\t\t*rbacv1.Role,\n\t\t*rbacv1.RoleBinding,\n\t\t*rbacv1alpha1.ClusterRole,\n\t\t*rbacv1alpha1.ClusterRoleBinding,\n\t\t*rbacv1alpha1.Role,\n\t\t*rbacv1alpha1.RoleBinding,\n\t\t*rbacv1beta1.ClusterRole,\n\t\t*rbacv1beta1.ClusterRoleBinding,\n\t\t*rbacv1beta1.Role,\n\t\t*rbacv1beta1.RoleBinding,\n\t\t*corev1.ConfigMap,\n\t\t*corev1.Endpoints,\n\t\t*extensions.Ingress,\n\t\t*corev1.LimitRange,\n\t\t*corev1.Namespace,\n\t\t*extensions.NetworkPolicy,\n\t\t*networkingv1.NetworkPolicy,\n\t\t*corev1.PersistentVolume,\n\t\t*corev1.PersistentVolumeClaim,\n\t\t*policyv1beta1.PodDisruptionBudget,\n\t\t*policyv1.PodDisruptionBudget,\n\t\t*policyv1beta1.PodSecurityPolicy,\n\t\t*extensions.PodSecurityPolicy,\n\t\t*corev1.ResourceQuota,\n\t\t*corev1.Secret,\n\t\t*corev1.ServiceAccount,\n\t\t*corev1.Service,\n\t\t*storagev1.StorageClass,\n\t\t*storagev1beta1.StorageClass,\n\t\t*v1beta1.CustomResourceDefinition,\n\t\t*admissionv1beta1.ValidatingWebhookConfiguration,\n\t\t*admissionv1beta1.MutatingWebhookConfiguration:\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "8a17c13ff3c3864af4b328246d96a828", "score": "0.60003304", "text": "func (d *resourceFilterer) FilterObj(obj runtime.Object) (isAllowed bool, isList bool, err error) {\n\tswitch o := obj.(type) {\n\tcase *metav1.Status:\n\t\t// Status object is returned when the Kubernetes API returns an error and\n\t\t// should be forwarded to the user.\n\t\treturn true, false, nil\n\tcase *corev1.Pod:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.PodList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *corev1.Secret:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.SecretList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *corev1.ConfigMap:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.ConfigMapList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *corev1.Namespace:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.NamespaceList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *corev1.Service:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.ServiceList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *corev1.Endpoints:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.EndpointsList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *corev1.ServiceAccount:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.ServiceAccountList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *corev1.Node:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.NodeList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *corev1.PersistentVolume:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.PersistentVolumeList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *corev1.PersistentVolumeClaim:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *corev1.PersistentVolumeClaimList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\n\tcase *appsv1.Deployment:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *appsv1.DeploymentList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\n\tcase *appsv1.ReplicaSet:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *appsv1.ReplicaSetList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *appsv1.StatefulSet:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *appsv1.StatefulSetList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\n\tcase *appsv1.DaemonSet:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *appsv1.DaemonSetList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *authv1.ClusterRole:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *authv1.ClusterRoleList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *authv1.Role:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *authv1.RoleList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\n\tcase *authv1.ClusterRoleBinding:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *authv1.ClusterRoleBindingList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\n\tcase *authv1.RoleBinding:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *authv1.RoleBindingList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\n\tcase *batchv1.CronJob:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *batchv1.CronJobList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\n\tcase *batchv1.Job:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *batchv1.JobList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\n\tcase *certificatesv1.CertificateSigningRequest:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *certificatesv1.CertificateSigningRequestList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *networkingv1.Ingress:\n\t\tresult, err := filterResource(d.kind, d.verb, o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\tcase *networkingv1.IngressList:\n\t\to.Items = pointerArrayToArray(\n\t\t\tfilterResourceList(\n\t\t\t\td.kind, d.verb,\n\t\t\t\tarrayToPointerArray(o.Items), d.allowedResources, d.deniedResources, d.log),\n\t\t)\n\t\treturn len(o.Items) > 0, true, nil\n\tcase *unstructured.Unstructured:\n\t\tif o.IsList() {\n\t\t\thasElemts := filterUnstructuredList(d.verb, o, d.allowedResources, d.deniedResources, d.log)\n\t\t\treturn hasElemts, true, nil\n\t\t}\n\n\t\tr := getKubeResource(utils.KubeCustomResource, d.verb, o)\n\t\tresult, err := matchKubernetesResource(\n\t\t\tr,\n\t\t\td.allowedResources, d.deniedResources,\n\t\t)\n\t\tif err != nil {\n\t\t\td.log.WithError(err).Warn(\"Unable to compile regex expressions within kubernetes_resources.\")\n\t\t}\n\t\t// if err is not nil or result is false, we should not include it.\n\t\treturn result, false, nil\n\n\tcase *metav1.Table:\n\t\t_, err := d.filterMetaV1Table(o, d.allowedResources, d.deniedResources)\n\t\tif err != nil {\n\t\t\treturn false, false, trace.Wrap(err)\n\t\t}\n\t\treturn len(o.Rows) > 0, true, nil\n\n\tdefault:\n\t\t// It's important default types are never blindly forwarded or protocol\n\t\t// extensions could result in information disclosures.\n\t\treturn false, false, trace.BadParameter(\"unexpected type received; got %T\", obj)\n\t}\n}", "title": "" }, { "docid": "a77e83f5d29bafb6de0897fe6ede275d", "score": "0.59794056", "text": "func (k ResourceKind) Scalable() bool {\n\tscalable := []ResourceKind{\n\t\tResourceKindDeployment,\n\t\tResourceKindReplicaSet,\n\t\tResourceKindReplicationController,\n\t\tResourceKindStatefulSet,\n\t}\n\n\tfor _, kind := range scalable {\n\t\tif k == kind {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "653e6d19b68172327f5c68e9250f49e9", "score": "0.59267795", "text": "func CfnDeviceFleet_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sagemaker.CfnDeviceFleet\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "f8ba9846552ab5961a21794fe3108683", "score": "0.59130627", "text": "func (o *StackpathRpcResourceInfoAllOf) HasResourceType() bool {\n\tif o != nil && o.ResourceType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0d7c115e659a925c196459b04340470e", "score": "0.58971125", "text": "func isOfKind(obj runtime.Object, kind string) bool {\n\treturn strings.EqualFold(obj.GetObjectKind().GroupVersionKind().Kind, kind)\n}", "title": "" }, { "docid": "3f3fd79291c54726f96c4da2c163c551", "score": "0.58966094", "text": "func (o *StackpathRpcResourceInfoAllOf) GetResourceTypeOk() (*string, bool) {\n\tif o == nil || o.ResourceType == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ResourceType, true\n}", "title": "" }, { "docid": "34f4fc23688acdadc88c047ead6dd516", "score": "0.58819336", "text": "func IsTypeInResources(typeName string, resources []Resource) bool {\n\tfor _, i := range resources {\n\t\tif i.Type == typeName {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "42d8b8de8900c923f675e7ad8886643a", "score": "0.58722806", "text": "func isSupportedVerb(apiResource *metav1.APIResource, verb string) bool {\n\tif verb == \"\" || verb == \"*\" {\n\t\treturn true\n\t}\n\tfor _, v := range apiResource.Verbs {\n\t\tif strings.EqualFold(v, verb) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "69c00407e1950d7c4734800ff299f6f6", "score": "0.5842376", "text": "func (h *baseSecondaryLayer2NetworkControllerEventHandler) IsResourceScheduled(obj interface{}) bool {\n\treturn h.baseHandler.isResourceScheduled(h.objType, obj)\n}", "title": "" }, { "docid": "b102642ca7ccdd3237d4efd254c1b4c2", "score": "0.58320886", "text": "func (*teleResources) SupportedResources() []string {\n\treturn supportedResources\n}", "title": "" }, { "docid": "71335689f6eaf44a5c2f53693e3e6267", "score": "0.583085", "text": "func (h *defaultNetworkControllerEventHandler) IsResourceScheduled(obj interface{}) bool {\n\treturn h.baseHandler.isResourceScheduled(h.objType, obj)\n}", "title": "" }, { "docid": "cdecaa2a8a70730e6f13063bedd8532e", "score": "0.58218646", "text": "func IsKafkaResource(instance *v1beta1.KogitoInfra) bool {\n\treturn instance.Spec.Resource.APIVersion == KafkaAPIVersion && instance.Spec.Resource.Kind == KafkaKind\n}", "title": "" }, { "docid": "366a616b44d7461f0aa91435eb7854d8", "score": "0.5819474", "text": "func IsValidResource(resource ResourceName) bool {\n\tswitch resource {\n\tcase ResourceStorage:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "0da24a7bc37b73bd02e44d7ffd1c6d94", "score": "0.5767426", "text": "func CfnDevice_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sagemaker.CfnDevice\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "d8993a1c7f62a991624f5b952d9b4a12", "score": "0.5751316", "text": "func isNonPerfResource(resKind string) bool {\n\n\tswitch resKind {\n\tcase Services, Configmaps, Routes:\n\t\t// Configmaps and Routes get processed according to low performing algorithm\n\t\t// But, Service must be processed everytime\n\t\treturn true\n\tcase Ingresses, Endpoints:\n\t\t// Ingresses get processed according to new high performance algorithm\n\t\t// Endpoints are out of equation, during initial state never gets processed\n\t\treturn false\n\t}\n\n\t// Unknown resources are to be considered as non-performing\n\treturn true\n}", "title": "" }, { "docid": "9dc882cfdbb7e6708cce6010b1a6e2a5", "score": "0.5749685", "text": "func (o *ResourcepoolLease) HasResourceType() bool {\n\tif o != nil && o.ResourceType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3e4024d59dcf5b6fb7fa0eca8ce8c633", "score": "0.57448596", "text": "func (o *ResourceQuota) GetResourceTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ResourceType, true\n}", "title": "" }, { "docid": "733441812df437074c8498d9c6bb40d1", "score": "0.57297164", "text": "func (k *kubeDetails) getClusterSupportedResources() (*serializer.CodecFactory, rbacSupportedResources, error) {\n\tk.rwMu.RLock()\n\tdefer k.rwMu.RUnlock()\n\t// If the cluster is offline, return an error because we don't have the schema\n\t// for the cluster.\n\tif k.isClusterOffline {\n\t\treturn nil, nil, trace.ConnectionProblem(nil, \"kubernetes cluster %q is offline\", k.kubeCluster.GetName())\n\t}\n\treturn &(k.kubeCodecs), k.rbacSupportedTypes, nil\n}", "title": "" }, { "docid": "cf8097d51dc596c91c02ed836a11a3ae", "score": "0.5701052", "text": "func (e enumPlugin) TypeIsSupported(f humanize.File, t humanize.TypeName) bool {\n\treturn t.Type.GetDefinition() == \"string\"\n}", "title": "" }, { "docid": "000f964b4c9a824dd49639c85429b4da", "score": "0.56893355", "text": "func ScalableTarget_IsResource(construct awscdk.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_applicationautoscaling.ScalableTarget\",\n\t\t\"isResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "68a04755df1ec871bdb459d8b1c26797", "score": "0.5673368", "text": "func CfnInstanceFleetConfig_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_emr.CfnInstanceFleetConfig\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "154ef2d5012211e60bc035cc9e110fce", "score": "0.56493235", "text": "func (o *StackpathRpcResourceInfo) GetResourceTypeOk() (*string, bool) {\n\tif o == nil || o.ResourceType == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ResourceType, true\n}", "title": "" }, { "docid": "cf558d918bbc39763ecde320fb25b42d", "score": "0.56451905", "text": "func (o *ResourceProvider) GetResourceTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ResourceType, true\n}", "title": "" }, { "docid": "982179eb86bf9790cd2a7b4f4b762d5f", "score": "0.5638436", "text": "func (metric Metric) IsSupported(statsd *StatsDServer) (supported bool) {\n\tswitch metric.Stats.Type {\n\tcase \"ms\":\n\t\tsupported = true\n\t}\n\treturn\n}", "title": "" }, { "docid": "cd4a8839b091b28caeb98af50b5249ce", "score": "0.5632894", "text": "func (resourceSet ResourceSet) objectResourceExists() bool {\n\tfor resource := range resourceSet {\n\t\tif resource.isObjectPattern() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c23a8ed16f72904fb452c245cbfa300f", "score": "0.5630251", "text": "func BackupVault_IsResource(construct awscdk.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_backup.BackupVault\",\n\t\t\"isResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "16af7938b33c446661e531dc95cfe530", "score": "0.56218743", "text": "func (obj LabelableObject) GetResourceType() resource.Type {\n\tswitch obj {\n\tcase RuntimeLabelableObject:\n\t\treturn resource.RuntimeLabel\n\tcase RuntimeContextLabelableObject:\n\t\treturn resource.RuntimeContextLabel\n\tcase ApplicationLabelableObject:\n\t\treturn resource.ApplicationLabel\n\tcase TenantLabelableObject:\n\t\treturn resource.TenantLabel\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "20932e42f1e30ef07356f45219e69426", "score": "0.5614663", "text": "func (o *ExcessResourceAllOf) GetResourceTypeOk() (*string, bool) {\n\tif o == nil || o.ResourceType == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ResourceType, true\n}", "title": "" }, { "docid": "b39ede38eb496fc0654279c06ee993de", "score": "0.5595983", "text": "func (o *ResourcepoolLeaseAllOf) GetResourceTypeOk() (*string, bool) {\n\tif o == nil || o.ResourceType == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ResourceType, true\n}", "title": "" }, { "docid": "72ca2913fad4830c534b519afeaa7dc6", "score": "0.5594004", "text": "func (gdt *String) IsResourceFile() bool {\n\n\t/* go_godot_string_is_resource_file(API_STRUCT) ->godot_bool */\n\n\tapi := CoreApi\n\trcv := (*C.godot_string)(unsafe.Pointer(gdt))\n\n\tret := C.go_godot_string_is_resource_file(\n\t\tapi,\n\t\trcv,\n\t)\n\n\treturn *(*bool)(unsafe.Pointer(&ret))\n}", "title": "" }, { "docid": "a518c349d32be676a38d1fd7b14d8b87", "score": "0.55788904", "text": "func CfnBackupVault_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_backup.CfnBackupVault\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "57fbd1298c959dc0172f37ca18c25d0d", "score": "0.5575699", "text": "func IsSupportedKubernetesFormat(n string) bool {\n\tfor _, s := range validSuffixes {\n\t\tif strings.HasSuffix(n, s) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d62d9c3b831c977b737da1e14efb9e72", "score": "0.557156", "text": "func (o *ExcessResourceAllOf) HasResourceType() bool {\n\tif o != nil && o.ResourceType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1ad03f4b1cf8d5f67b49afb785fe1daa", "score": "0.55667084", "text": "func (o *ResourcepoolLeaseAllOf) HasResourceType() bool {\n\tif o != nil && o.ResourceType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "89c1c1c9a17a3a44ac3be1ec524106a9", "score": "0.5563276", "text": "func isOperatorCreatedResource(obj metav1.Object) bool {\n\treturn obj.GetLabels()[helmreconciler.OwningResourceName] != \"\" &&\n\t\tobj.GetLabels()[helmreconciler.OwningResourceNamespace] != \"\" &&\n\t\tobj.GetLabels()[helmreconciler.IstioComponentLabelStr] != \"\"\n}", "title": "" }, { "docid": "309e9ae16cb3fd7d0e7d2c6540d013c2", "score": "0.5559877", "text": "func CfnScalableTarget_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_applicationautoscaling.CfnScalableTarget\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "ccf85ee46463959669caa9362f979cd0", "score": "0.5558894", "text": "func (o *Authentication) HasResourceType() bool {\n\tif o != nil && o.ResourceType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "df2f5e685e61c9219d356792788916f2", "score": "0.5556195", "text": "func matchKubernetesResource(resource types.KubernetesResource, allowed, denied []types.KubernetesResource) (bool, error) {\n\t// utils.KubeResourceMatchesRegex checks if the resource.Kind is strictly equal\n\t// to each entry and validates if the Name and Namespace fields matches the\n\t// regex allowed by each entry.\n\tresult, err := utils.KubeResourceMatchesRegex(resource, denied)\n\tif err != nil {\n\t\treturn false, trace.Wrap(err)\n\t} else if result {\n\t\treturn false, nil\n\t}\n\n\tresult, err = utils.KubeResourceMatchesRegex(resource, allowed)\n\tif err != nil {\n\t\treturn false, trace.Wrap(err)\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "2fe9e2616350547f3540ca0aef73b1c2", "score": "0.55494326", "text": "func (obj Resource) IsDefinedBy() interface{} { return GetIsDefinedBy(obj) }", "title": "" }, { "docid": "50715278e90ef9ed546ae52c080a6a5b", "score": "0.5539011", "text": "func (h *irsaHelper) IsSupported(ctx context.Context) (bool, error) {\n\texists, err := h.oidc.CheckProviderExists(ctx)\n\tif err != nil {\n\t\treturn false, errors.Wrapf(err, \"error checking OIDC provider\")\n\t}\n\treturn exists, nil\n}", "title": "" }, { "docid": "25ffd1c6e57cebd926fc1a8505adceb8", "score": "0.5537217", "text": "func IsSubresource(resourceName string) bool {\n\treturn strings.Contains(resourceName, \"/\")\n}", "title": "" }, { "docid": "77aba6d6db0f37256a7c6e2a20cb96d8", "score": "0.5531897", "text": "func filterResource(kind, verb string, resource kubeObjectInterface, allowed, denied []types.KubernetesResource) (bool, error) {\n\tresult, err := matchKubernetesResource(\n\t\tgetKubeResource(kind, verb, resource),\n\t\tallowed, denied,\n\t)\n\treturn result, trace.Wrap(err)\n}", "title": "" }, { "docid": "507e96f5283d7f41c54e601fa56a165c", "score": "0.5531451", "text": "func (g *Generator) isSupported(t types.Type) bool {\n\tif isErrorType(t) || isWrapperType(t) {\n\t\treturn true\n\t}\n\tswitch t := t.(type) {\n\tcase *types.Basic:\n\t\tswitch t.Kind() {\n\t\tcase types.Bool, types.UntypedBool,\n\t\t\ttypes.Int,\n\t\t\ttypes.Int8, types.Uint8, // types.Byte\n\t\t\ttypes.Int16,\n\t\t\ttypes.Int32, types.UntypedRune, // types.Rune\n\t\t\ttypes.Int64, types.UntypedInt,\n\t\t\ttypes.Float32,\n\t\t\ttypes.Float64, types.UntypedFloat,\n\t\t\ttypes.String, types.UntypedString:\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\tcase *types.Slice:\n\t\tswitch e := t.Elem().(type) {\n\t\tcase *types.Basic:\n\t\t\treturn e.Kind() == types.Uint8\n\t\t}\n\tcase *types.Pointer:\n\t\tswitch t := t.Elem().(type) {\n\t\tcase *types.Named:\n\t\t\treturn g.validPkg(t.Obj().Pkg())\n\t\t}\n\tcase *types.Named:\n\t\tswitch t.Underlying().(type) {\n\t\tcase *types.Interface, *types.Pointer:\n\t\t\treturn g.validPkg(t.Obj().Pkg())\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "8403bb2127bf0b5f340200cafffd04a5", "score": "0.5528647", "text": "func (o *ResourcepoolLease) GetResourceTypeOk() (*string, bool) {\n\tif o == nil || o.ResourceType == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ResourceType, true\n}", "title": "" }, { "docid": "aa9a1877a9b84ce74efb2244b48985c4", "score": "0.5525815", "text": "func IsSupportedWrkchainType(wrkchainType string) bool {\n\t_, ok := wrkchainModules[WrkchainType(wrkchainType)]\n\treturn ok\n}", "title": "" }, { "docid": "abfe8c5c02c94961746300c29f930f89", "score": "0.55183077", "text": "func IsResource(e ld.Entity) bool { return ld.Is(e, Class_Resource.ID) }", "title": "" }, { "docid": "abfe8c5c02c94961746300c29f930f89", "score": "0.55183077", "text": "func IsResource(e ld.Entity) bool { return ld.Is(e, Class_Resource.ID) }", "title": "" }, { "docid": "ce8ecf401948b66a4a1248e2f0985ba3", "score": "0.5507953", "text": "func CfnVirtualGateway_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"aws-cdk-lib.aws_appmesh.CfnVirtualGateway\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "da5321640f7bbceac4aace3c70b1a195", "score": "0.5507496", "text": "func ApplyResource(ctx context.Context, client coreclientv1.Client, recorder record.EventRecorder, resource client.Object) (bool, error) {\n\tswitch t := resource.(type) {\n\tcase *appsv1.Deployment:\n\t\treturn applyDeployment(ctx, client, recorder, t)\n\tcase *appsv1.DaemonSet:\n\t\treturn applyDaemonSet(ctx, client, recorder, t)\n\tcase *corev1.ConfigMap:\n\t\treturn applyConfigMap(ctx, client, recorder, t)\n\tcase *policyv1.PodDisruptionBudget:\n\t\treturn applyPodDisruptionBudget(ctx, client, recorder, t)\n\tcase *rbacv1.Role:\n\t\treturn applyRole(ctx, client, recorder, t)\n\tcase *rbacv1.ClusterRole:\n\t\treturn applyClusterRole(ctx, client, recorder, t)\n\tcase *rbacv1.RoleBinding:\n\t\treturn applyRoleBinding(ctx, client, recorder, t)\n\tcase *rbacv1.ClusterRoleBinding:\n\t\treturn applyClusterRoleBinding(ctx, client, recorder, t)\n\tdefault:\n\t\treturn false, fmt.Errorf(\"unhandled type %T\", resource)\n\t}\n}", "title": "" }, { "docid": "8a1a515dafcebe2f3116c2df39d3ef4f", "score": "0.55041975", "text": "func IsSupported(currency string) bool {\n\tp, ok := currencies[currency]\n\treturn ok && p != nil\n}", "title": "" }, { "docid": "48f9ea3be4d450003ddeb54d235d39cd", "score": "0.5501003", "text": "func TopicBase_IsResource(construct awscdk.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.TopicBase\",\n\t\t\"isResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "5fc1becd75fb0d6fb93fbe52cbbe4868", "score": "0.54962766", "text": "func Topic_IsResource(construct awscdk.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.Topic\",\n\t\t\"isResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "d390bcb2d30a9fdb649d85e6e1c27760", "score": "0.54908925", "text": "func CfnWorkteam_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sagemaker.CfnWorkteam\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "f09ffc8c546e91b988c985068061dac1", "score": "0.5484906", "text": "func (o *AccessReviewResponse) HasResourceType() bool {\n\tif o != nil && o.ResourceType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "6214d4e7f19b90a651ee8fb6c2a441fb", "score": "0.54812133", "text": "func (client Client) IsRequestTypeSupported(reqType, subType int64) bool {\n\tterror.Log(errors.New(\"No implemented\"))\n\treturn true\n}", "title": "" }, { "docid": "08fc9cadf7849012282019ae770c674c", "score": "0.5476453", "text": "func IsTypeSupported(dataType string) bool {\n\t_, supported := supportedDataTypes[dataType]\n\treturn supported\n}", "title": "" }, { "docid": "78f975dde32a0fa478fd4220297f89ba", "score": "0.54755163", "text": "func containsResourceType(resourceTypes []resourceType, r resourceType) bool {\n\tfor _, rt := range resourceTypes {\n\t\tif rt == r {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7a8b08df6cd5937f30ec318e312f802c", "score": "0.5475242", "text": "func IsKnativeEventingResource(instance *v1beta1.KogitoInfra) bool {\n\treturn instance.Spec.Resource.APIVersion == KnativeEventingAPIVersion && instance.Spec.Resource.Kind == KnativeEventingBrokerKind\n}", "title": "" }, { "docid": "dddef5153232b05f5180df564623557f", "score": "0.5458007", "text": "func IsTypeNameSupported(t string) bool {\n\tfor imageType, name := range ImageTypes {\n\t\tif name == t {\n\t\t\treturn IsImageTypeSupportedByVips(imageType).Load\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5962ede323b5dc1b8e99ba9e4d550eff", "score": "0.54469913", "text": "func (c client) supportedVersion(obj k8sclient.Object) k8sclient.Object {\n\tif c.Minor < 16 {\n\t\tswitch obj.(type) {\n\n\t\t// Deployment\n\t\tcase *appsv1.Deployment:\n\t\t\treturn &appsv1beta1.Deployment{}\n\n\t\t// DaemonSet\n\t\tcase *appsv1.DaemonSet:\n\t\t\treturn &extv1beta1.DaemonSet{}\n\n\t\t// ReplicaSet\n\t\tcase *appsv1.ReplicaSet:\n\t\t\treturn &extv1beta1.ReplicaSet{}\n\n\t\t// StatefulSet\n\t\tcase *appsv1.StatefulSet:\n\t\t\treturn &appsv1beta1.StatefulSet{}\n\t\t}\n\t}\n\n\tif c.Minor > 24 {\n\t\tswitch obj.(type) {\n\t\tcase *batchv1beta1.CronJob:\n\t\t\treturn &batchv1.CronJob{}\n\t\t}\n\t}\n\n\treturn obj\n}", "title": "" }, { "docid": "ce25cf885fe41c8c5f1ec76c72915ad1", "score": "0.54445374", "text": "func (Topic) IsResourceIdentifiable() {}", "title": "" }, { "docid": "f9b119056b063ea618fc4be597710b8c", "score": "0.543747", "text": "func CfnMonitoringSchedule_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sagemaker.CfnMonitoringSchedule\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "9cd20e241e368ca3166322b3c2627a33", "score": "0.5434381", "text": "func (o *ConfluentAccountResourceAttributes) GetResourceTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ResourceType, true\n}", "title": "" }, { "docid": "d4c074b12b789c4b9525cf2cf5e40f63", "score": "0.54331505", "text": "func Rule_IsResource(construct awscdk.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_events.Rule\",\n\t\t\"isResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "0fcd12fae7c8c40441db04ecaa0f5c2c", "score": "0.54247516", "text": "func (e *extension) IsSubresource() bool {\n\treturn len(e.SubResourcePath) > 0\n}", "title": "" }, { "docid": "4d47f75f24a9ae820d39596e15cbb5b1", "score": "0.541821", "text": "func (r *Resource) Kind() ResourceKind {\n\tswitch {\n\tcase r.File != nil:\n\t\treturn KindFile\n\tcase r.Process != nil:\n\t\treturn KindProcess\n\tcase r.Group != nil:\n\t\treturn KindGroup\n\tcase r.Command != nil:\n\t\treturn KindCommand\n\tcase r.Audit != nil:\n\t\treturn KindAudit\n\tcase r.Docker != nil:\n\t\treturn KindDocker\n\tcase r.KubeApiserver != nil:\n\t\treturn KindKubernetes\n\tcase r.Custom != nil:\n\t\treturn KindCustom\n\tdefault:\n\t\treturn KindInvalid\n\t}\n}", "title": "" }, { "docid": "f9031b6aa65784903a80117d1f0a57d8", "score": "0.5412196", "text": "func (r Registration) SupportedResources() map[string]*schema.Resource {\n\treturn map[string]*schema.Resource{\n\t\t\"azurerm_container_group\": resourceContainerGroup(),\n\t\t\"azurerm_container_registry_webhook\": resourceContainerRegistryWebhook(),\n\t\t\"azurerm_container_registry\": resourceContainerRegistry(),\n\t\t\"azurerm_kubernetes_cluster\": resourceKubernetesCluster(),\n\t\t\"azurerm_kubernetes_cluster_node_pool\": resourceKubernetesClusterNodePool(),\n\t}\n}", "title": "" }, { "docid": "dd07ae2abac1527a721f73fa8197b4d6", "score": "0.53989387", "text": "func (o *Authentication) GetResourceTypeOk() (*string, bool) {\n\tif o == nil || o.ResourceType == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ResourceType, true\n}", "title": "" }, { "docid": "d59d51854cd90734afb737ea5123f0a7", "score": "0.5389345", "text": "func (i ResourceType) IsAResourceType() bool {\n\tfor _, v := range _ResourceTypeValues {\n\t\tif i == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d59d51854cd90734afb737ea5123f0a7", "score": "0.5389345", "text": "func (i ResourceType) IsAResourceType() bool {\n\tfor _, v := range _ResourceTypeValues {\n\t\tif i == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d59d51854cd90734afb737ea5123f0a7", "score": "0.5389345", "text": "func (i ResourceType) IsAResourceType() bool {\n\tfor _, v := range _ResourceTypeValues {\n\t\tif i == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d59d51854cd90734afb737ea5123f0a7", "score": "0.5389345", "text": "func (i ResourceType) IsAResourceType() bool {\n\tfor _, v := range _ResourceTypeValues {\n\t\tif i == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7e18b7351bf3bebf7a439b5be429e9b1", "score": "0.53877604", "text": "func Subscription_IsResource(construct awscdk.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.Subscription\",\n\t\t\"isResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "c48203bdabc44563cf6f81d0f0f4cd3a", "score": "0.53864115", "text": "func resourceExists(resController *ClusterWatcher, resInfo resourceID) (bool, error) {\n\tgvr, ok := resController.getWatchGVR(resInfo.gvr)\n\tif ok {\n\t\tvar intfNoNS = resController.plugin.dynamicClient.Resource(gvr)\n\t\tvar intf dynamic.ResourceInterface\n\t\tif resInfo.namespace != \"\" {\n\t\t\tintf = intfNoNS.Namespace(resInfo.namespace)\n\t\t} else {\n\t\t\tintf = intfNoNS\n\t\t}\n\n\t\t// fetch the current resource\n\t\t_, err := intf.Get(resInfo.name, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\treturn true, nil\n\t}\n\treturn false, fmt.Errorf(\"resourceExists Unable to find GVR for kind %s\", resInfo.kind)\n}", "title": "" }, { "docid": "0d76d9fdda8d3b8b0b728e74e949d951", "score": "0.5383294", "text": "func IsSupported(mime string) bool {\n\t_, ok := matchMIME[mime]\n\treturn ok\n}", "title": "" }, { "docid": "17890ff6e8220a4449f05ef27fed65d7", "score": "0.5382236", "text": "func (c *CRD) HasAPIResource(groupVersion metav1.GroupVersion, name string) (bool, error) {\n\tresources, err := c.ListAPIResources(groupVersion)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tfor _, res := range resources {\n\t\tif res.Name == name {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\n\treturn false, nil\n}", "title": "" }, { "docid": "0af4934b20a099b7f6ec211ce18ad26c", "score": "0.5379339", "text": "func CfnBackupPlan_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_backup.CfnBackupPlan\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "d038fa89ca1fd4853dd3befef6339e30", "score": "0.53754216", "text": "func (p *KubernetesProvider) GetSupportedService() map[string]terraform_utils.ServiceGenerator {\n\tresources := make(map[string]terraform_utils.ServiceGenerator)\n\n\tconfig, _, err := pluginutils.InitClientAndConfig()\n\tif err != nil {\n\t\treturn resources\n\t}\n\n\tdc, err := discovery.NewDiscoveryClientForConfig(config)\n\tif err != nil {\n\t\treturn resources\n\t}\n\n\tlists, err := dc.ServerPreferredResources()\n\tif err != nil {\n\t\treturn resources\n\t}\n\n\tfor _, list := range lists {\n\t\tif len(list.APIResources) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tgv, err := schema.ParseGroupVersion(list.GroupVersion)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, resource := range list.APIResources {\n\t\t\tif len(resource.Verbs) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// filter to resources that support list\n\t\t\tif len(resource.Verbs) > 0 && !sets.NewString(resource.Verbs...).Has(\"list\") {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// filter to resource that are supported by terraform kubernetes provider\n\t\t\tif _, ok := tfk8s.Provider().(*tfschema.Provider).ResourcesMap[extractTfResourceName(resource.Kind)]; !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tresources[resource.Name] = &Kind{\n\t\t\t\tGroup: gv.Group,\n\t\t\t\tVersion: gv.Version,\n\t\t\t\tName: resource.Kind,\n\t\t\t\tNamespaced: resource.Namespaced,\n\t\t\t}\n\t\t}\n\t}\n\treturn resources\n}", "title": "" }, { "docid": "86f432c9dd3ee0d9ac3539ee649296b7", "score": "0.53698814", "text": "func CfnGraphQLApi_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"aws-cdk-lib.aws_appsync.CfnGraphQLApi\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "9d4b390fa8932b0a50a5f32ca348fb4e", "score": "0.5366972", "text": "func (m *TemplateMetadata) PlatformSupported() bool {\n\n\t// Default is all platforms supported\n\tif len(m.Platforms) == 0 {\n\t\treturn true\n\t}\n\n\t// Check that the platform is in the list\n\tplatformsSupported := slicer.String(m.Platforms)\n\treturn platformsSupported.Contains(runtime.GOOS)\n}", "title": "" }, { "docid": "6ea91a7b7a07a9caf4574f17f55d3512", "score": "0.5366703", "text": "func IsSupportedDeviceType(deviceType string) bool {\n\tfor _, dt := range SupportedDeviceTypes {\n\t\tif dt == deviceType {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "03ad895db70206b4263889f56b53f69a", "score": "0.5351438", "text": "func IsTypeSupported(t ImageType) bool {\n\t_, ok := ImageTypes[t]\n\treturn ok && IsImageTypeSupportedByVips(t).Load\n}", "title": "" }, { "docid": "b5078dd2c11fff41348cbcbe2efbce15", "score": "0.5350923", "text": "func GetObjectResource(obj *unstructured.Unstructured) string {\n\tswitch res := strings.ToLower(obj.GroupVersionKind().Kind); res {\n\tcase \"virtualmachineinstance\":\n\t\treturn VMIResource\n\tcase \"virtualmachine\":\n\t\treturn VMResource\n\tcase \"virtualmachineinstancereplicaset\":\n\t\treturn VMIReplicaSetResource\n\tdefault:\n\t\treturn res\n\t}\n}", "title": "" }, { "docid": "84153d23aaa06a6d255d5c46ea559bb3", "score": "0.53451", "text": "func (r *KubernetesSource) IsAllowed(resourceType, namespace string, eventType EventType) bool {\n\tif r == nil || len(r.Resources) == 0 {\n\t\treturn false\n\t}\n\n\tisEventAllowed := func(resourceEvents KubernetesResourceEventTypes) bool {\n\t\tif len(resourceEvents) > 0 { // if resource overrides the global events, use them\n\t\t\treturn resourceEvents.Contains(eventType)\n\t\t}\n\t\treturn r.Event.Types.Contains(eventType) // check global events\n\t}\n\n\tfor _, resource := range r.Resources {\n\t\tvar namespaceAllowed bool\n\t\tif resource.Namespaces.IsConfigured() {\n\t\t\tnamespaceAllowed = resource.Namespaces.IsAllowed(namespace)\n\t\t} else {\n\t\t\tnamespaceAllowed = r.Namespaces.IsAllowed(namespace)\n\t\t}\n\n\t\tif resource.Type == resourceType &&\n\t\t\tisEventAllowed(resource.Event.Types) &&\n\t\t\tnamespaceAllowed {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b6683f0ae5b806dc50de1287e67b9b46", "score": "0.5343025", "text": "func (a *resourceTracker) isResourcePossible(memory uint64, isAsync bool) bool {\n\tif isAsync {\n\t\treturn memory <= a.ramAsyncTotal\n\t} else {\n\t\treturn memory <= a.ramSyncTotal+a.ramAsyncTotal\n\t}\n}", "title": "" }, { "docid": "58cb9b222dc0c7f82e9934e252cf6011", "score": "0.5330322", "text": "func (p Platform) IsSupported() bool {\n\tfor _, v := range AllSupportedExs {\n\t\tif v.String() == strings.ToLower(p.String()) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "71c88a666a116c0ecb89d85578371e63", "score": "0.5329679", "text": "func CfnMaintenanceWindowTask_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_ssm.CfnMaintenanceWindowTask\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "447613612553f92eea6ce5b07128e5f8", "score": "0.5329193", "text": "func CfnGraphQLSchema_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"aws-cdk-lib.aws_appsync.CfnGraphQLSchema\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "8918f8ec46a692373dfda30f3ba4fc1c", "score": "0.5312584", "text": "func IsSupported(format magicnum.Format) bool {\n\tswitch format {\n\tcase magicnum.Zip, magicnum.LZ4, magicnum.Tar, magicnum.GZip, magicnum.BZip2:\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "87f311107e919f9d5b74fb2c0dd7a723", "score": "0.53052515", "text": "func CfnScalingPolicy_IsCfnResource(construct constructs.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_applicationautoscaling.CfnScalingPolicy\",\n\t\t\"isCfnResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" } ]
51168d9371f3fdd5d2ba05634122ec24
RunAllRetryTasks transition all retry tasks to pending state within the given queue, and reports the number of tasks transitioned.
[ { "docid": "47e29df155e566c4a448f8b134e45a02", "score": "0.7388518", "text": "func (i *Inspector) RunAllRetryTasks(qname string) (int, error) {\n\tif err := validateQueueName(qname); err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := i.rdb.RunAllRetryTasks(qname)\n\treturn int(n), err\n}", "title": "" } ]
[ { "docid": "bb845997b56aa238115459b559d29e4c", "score": "0.6628005", "text": "func (i *Inspector) KillAllRetryTasks(qname string) (int, error) {\n\tif err := validateQueueName(qname); err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := i.rdb.KillAllRetryTasks(qname)\n\treturn int(n), err\n}", "title": "" }, { "docid": "58fe907aea9f5e4818d8db4934c1b05f", "score": "0.6290796", "text": "func (i *Inspector) DeleteAllRetryTasks(qname string) (int, error) {\n\tif err := validateQueueName(qname); err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := i.rdb.DeleteAllRetryTasks(qname)\n\treturn int(n), err\n}", "title": "" }, { "docid": "e858d79d3ec26b9e6b2998980b871b6f", "score": "0.6133253", "text": "func (i *Inspector) RunAllScheduledTasks(qname string) (int, error) {\n\tif err := validateQueueName(qname); err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := i.rdb.RunAllScheduledTasks(qname)\n\treturn int(n), err\n}", "title": "" }, { "docid": "20d9c0b8e5ff55d375b2bcd18d09bcc4", "score": "0.5970078", "text": "func (i *Inspector) RunAllDeadTasks(qname string) (int, error) {\n\tif err := validateQueueName(qname); err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := i.rdb.RunAllDeadTasks(qname)\n\treturn int(n), err\n}", "title": "" }, { "docid": "7dd7c85800833ecd01d5176f4398e304", "score": "0.53774554", "text": "func (i *Inspector) KillAllScheduledTasks(qname string) (int, error) {\n\tif err := validateQueueName(qname); err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := i.rdb.KillAllScheduledTasks(qname)\n\treturn int(n), err\n}", "title": "" }, { "docid": "2bd7051ccb4132719ab26fadae8c3e51", "score": "0.5352335", "text": "func (bw *BasicWorker) QueuePendingTasks() error {\n\tstate := taurus.PENDING\n\tqueue := Pending\n\terrChan := make(chan error)\n\tticker := time.NewTicker(StoreScanTick)\n\tgo func() {\n\t\tvar qpErr error\n\tqueuer:\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-bw.done:\n\t\t\t\tticker.Stop()\n\t\t\t\tqpErr = nil\n\t\t\t\tlog.Printf(\"Finishing %s Task queuer\", state)\n\t\t\t\tbreak queuer\n\t\t\tcase <-ticker.C:\n\t\t\t\tjobs, err := bw.store.GetJobs(state)\n\t\t\t\tif err != nil {\n\t\t\t\t\tqpErr = fmt.Errorf(\"Error reading new Jobs: %s\", err)\n\t\t\t\t\tbreak queuer\n\t\t\t\t}\n\t\t\t\tfor _, job := range jobs {\n\t\t\t\t\tctx, cancel := context.WithTimeout(context.Background(), MasterTimeout)\n\t\t\t\t\tlaunchedTasks, err := taurus.MesosTasks(ctx, bw.master, job.Id, nil)\n\t\t\t\t\tlog.Printf(\"Job %s has %d launched tasks\", job.Id, len(launchedTasks))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"Failed to retrieve Tasks for Job %s: %s\", job.Id, err)\n\t\t\t\t\t\tcancel()\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfor _, jobTask := range job.Tasks {\n\t\t\t\t\t\tfor i := uint32(0); i < jobTask.Replicas-uint32(len(launchedTasks)); i++ {\n\t\t\t\t\t\t\ttaskInfo := taurus.CreateMesosTaskInfo(job.Id, jobTask)\n\t\t\t\t\t\t\ttask := &taurus.Task{\n\t\t\t\t\t\t\t\tInfo: taskInfo,\n\t\t\t\t\t\t\t\tJobId: job.Id,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttaskId := taskInfo.TaskId.GetValue()\n\t\t\t\t\t\t\tlog.Printf(\"Queueing task: %s\", taskId)\n\t\t\t\t\t\t\tif err := bw.queue.Publish(queue, task); err != nil {\n\t\t\t\t\t\t\t\tlog.Printf(\"Failed to queue %s: %s\", taskId, err)\n\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\terrChan <- qpErr\n\t\tlog.Printf(\"%s tasks queuer ticker stopped\", state)\n\t}()\n\n\treturn <-errChan\n}", "title": "" }, { "docid": "69b5d4d194a8fae2ec18c7609a99c967", "score": "0.53435767", "text": "func (t *WorkerTask) awaitRunning() error {\n\tfor i := 0; i < t.config.Workers; i++ {\n\t\tif err := t.awaitWorkerRunning(i); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1b3a0839fb9b55e12cd941943bcad658", "score": "0.53349537", "text": "func (state *Dispatcher) processWaitingQueue() {\n\tfor {\n\t\tselect {\n\t\tcase <-state.waitingQueueReady:\n\t\t\tstate.logger.Info(\"WaitingQueue processor has caught what waiting queue is ready to be processed...\")\n\n\t\t\tstate.mxQueues.Lock()\n\n\t\t\t// if there are no waiting tasks because of shutting down, just continue\n\t\t\tif len(state.waiting) == 0 {\n\t\t\t\tstate.mxQueues.Unlock()\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tt := state.waiting[0]\n\n\t\t\tlogger := state.logger.WithField(\"task_id\", t.ID)\n\t\t\tlogger.Debugf(\"Task %s is getting from the waiting queue...\", t.ID)\n\n\t\t\tinProgress, ok := state.inProgress[t.Repo]\n\n\t\t\t// Define if we can move task to the \"in progress\" queue\n\t\t\t// (we can do it only if current repo is not in the \"in progress\" queue yet)\n\t\t\taddToInProgress := false\n\t\t\tif !ok || (inProgress.Repo != t.Repo) {\n\t\t\t\tstate.inProgress[t.Repo] = t\n\t\t\t\taddToInProgress = true\n\t\t\t\tlogger.Debugf(\"Task %s is moving to the 'in progress' queue and is going to be processed...\", t.ID)\n\t\t\t}\n\n\t\t\tstate.waiting = state.waiting[1:]\n\n\t\t\tstate.mxQueues.Unlock()\n\n\t\t\t// Send current task to the workers or move it back to the \"waiting\" queue\n\t\t\tif addToInProgress {\n\t\t\t\tstate.pool <- t\n\t\t\t} else {\n\t\t\t\tgo func() {\n\t\t\t\t\t// Task processing takes some time, so to not to repeat the process too many times,\n\t\t\t\t\t// just wait a little before re-add task to the waiting queue\n\t\t\t\t\tstate.mxQueues.Lock()\n\t\t\t\t\tstate.reassigning[t.ID] = t\n\t\t\t\t\tstate.mxQueues.Unlock()\n\n\t\t\t\t\ttime.Sleep(state.medianProcessorExecTime)\n\n\t\t\t\t\tstate.AddTask(&t)\n\n\t\t\t\t\tstate.mxQueues.Lock()\n\t\t\t\t\tdelete(state.reassigning, t.ID)\n\t\t\t\t\tstate.mxQueues.Unlock()\n\t\t\t\t}()\n\t\t\t\tlogger.Debugf(\"Task %s moved back to the 'waiting' queue.\", t.ID)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "10c6592cdbc64d8f8a23d533205b7aae", "score": "0.5278383", "text": "func (s *scheduler) runPending() {\n\tfor i := 0; i < len(s.tasks); i++ {\n\t\tif s.tasks[i].shouldRun() {\n\t\t\ts.workChannel <- s.tasks[i]\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1dffa0cdc0844d40e03de38f9af42d23", "score": "0.5163624", "text": "func (tr *placerTracker) RetryAllBackoff(numOfRunners int, err error) bool {\n\t// This means Placer is operating on an empty list. No runners\n\t// available. Record it. ALWAYS do this before failing fast.\n\tif numOfRunners == 0 {\n\t\tstats.Record(tr.requestCtx, emptyPoolCountMeasure.M(0))\n\t}\n\n\t// If there are no runners and last call to provision runners failed due\n\t// to a user error (or misconfiguration) then fail fast.\n\tif numOfRunners == 0 && err != nil {\n\t\t// IsFuncError currently synonymous with tag: 'blame == user'\n\t\t// See: runner_fninvoke.handleFnInvokeCall2\n\t\tif models.IsFuncError(err) {\n\t\t\t// We also sanity check for a 502 before returning.\n\t\t\tw, ok := err.(models.APIError)\n\t\t\tif ok {\n\t\t\t\tif 502 == w.Code() {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tt := common.NewTimer(tr.cfg.RetryAllDelay)\n\tdefer t.Stop()\n\n\tselect {\n\tcase <-tr.requestCtx.Done(): // client side timeout/cancel\n\t\treturn false\n\tcase <-tr.placerCtx.Done(): // placer wait timeout\n\t\treturn false\n\tcase <-t.C:\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "28ad7fff3ec6a1eaacd2c4f3face1967", "score": "0.5128295", "text": "func (bw *BasicWorker) ReconcilePendingJobs() error {\n\toldState := taurus.PENDING\n\tnewState := taurus.RUNNING\n\terrChan := make(chan error)\n\tticker := time.NewTicker(ReconcileScanTick)\n\tgo func() {\n\t\tvar reconErr error\n\treconciler:\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-bw.done:\n\t\t\t\tlog.Printf(\"Finished %s Reconciler\", oldState)\n\t\t\t\tticker.Stop()\n\t\t\t\treconErr = nil\n\t\t\t\tbreak reconciler\n\t\t\tcase <-ticker.C:\n\t\t\t\tjobs, err := bw.store.GetJobs(oldState)\n\t\t\t\tif err != nil {\n\t\t\t\t\treconErr = fmt.Errorf(\"Error reading %s Jobs: %s\", oldState, err)\n\t\t\t\t\tbreak reconciler\n\t\t\t\t}\n\t\t\t\tfor _, job := range jobs {\n\t\t\t\t\tctx, cancel := context.WithTimeout(context.Background(), MasterTimeout)\n\t\t\t\t\tlaunchedTasks, err := taurus.MesosTasks(ctx, bw.master, job.Id, nil)\n\t\t\t\t\tlog.Printf(\"Job %s has %d launched tasks\", job.Id, len(launchedTasks))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"Failed to retrieve Tasks for Job %s: %s\", job.Id, err)\n\t\t\t\t\t\tcancel()\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tjobTaskCount := uint32(0)\n\t\t\t\t\tfor _, jobTask := range job.Tasks {\n\t\t\t\t\t\tjobTaskCount += jobTask.Replicas\n\t\t\t\t\t}\n\t\t\t\t\tif uint32(len(launchedTasks)) == jobTaskCount {\n\t\t\t\t\t\tjob.State = newState\n\t\t\t\t\t\tif err := bw.store.UpdateJob(job); err != nil {\n\t\t\t\t\t\t\treconErr = fmt.Errorf(\"Failed to update job %s: %s\", job.Id, err)\n\t\t\t\t\t\t\tbreak reconciler\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlog.Printf(\"Job %s marked as %s\", job.Id, newState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\terrChan <- reconErr\n\t\tlog.Printf(\"%s Task Reconciler tick stopped\", oldState)\n\t}()\n\n\treturn <-errChan\n}", "title": "" }, { "docid": "c09e35ea4fa3962c2156de71a91c7f2d", "score": "0.5115811", "text": "func (i *Inspector) ListRetryTasks(qname string, opts ...ListOption) ([]*RetryTask, error) {\n\tif err := validateQueueName(qname); err != nil {\n\t\treturn nil, err\n\t}\n\topt := composeListOptions(opts...)\n\tpgn := rdb.Pagination{Size: opt.pageSize, Page: opt.pageNum - 1}\n\tzs, err := i.rdb.ListRetry(qname, pgn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar tasks []*RetryTask\n\tfor _, z := range zs {\n\t\tprocessAt := time.Unix(z.Score, 0)\n\t\tt := NewTask(z.Message.Type, z.Message.Payload)\n\t\ttasks = append(tasks, &RetryTask{\n\t\t\tTask: t,\n\t\t\tID: z.Message.ID.String(),\n\t\t\tQueue: z.Message.Queue,\n\t\t\tNextProcessAt: processAt,\n\t\t\tMaxRetry: z.Message.Retry,\n\t\t\tRetried: z.Message.Retried,\n\t\t\t// TODO: LastFailedAt: z.Message.LastFailedAt\n\t\t\tErrorMsg: z.Message.ErrorMsg,\n\t\t\tscore: z.Score,\n\t\t})\n\t}\n\treturn tasks, nil\n}", "title": "" }, { "docid": "f90d66973d03906130578ceecb36bb07", "score": "0.50617456", "text": "func (m *MultiTask) Attempts() int {\n\tvar attempts int\n\tfor _, t := range m.tasks {\n\t\tattempts += t.Attempts()\n\t}\n\treturn attempts\n}", "title": "" }, { "docid": "f19d92e7895ffd2e80bf112775d1a7c4", "score": "0.5010219", "text": "func (t *TransactionsInternal) ForceCleanupQueue() []TransactionCleanupAttempt {\n\twaitCh := make(chan []gocbcore.TransactionsCleanupAttempt, 1)\n\tt.parent.txns.Internal().ForceCleanupQueue(func(attempts []gocbcore.TransactionsCleanupAttempt) {\n\t\twaitCh <- attempts\n\t})\n\tcoreAttempts := <-waitCh\n\n\tvar attempts []TransactionCleanupAttempt\n\tfor _, attempt := range coreAttempts {\n\t\tattempts = append(attempts, cleanupAttemptFromCore(attempt))\n\t}\n\n\treturn attempts\n}", "title": "" }, { "docid": "56dc53a4a0c46d9f154b6e257819052e", "score": "0.50022244", "text": "func (qm *ServerMgr) updateQueue(logTimes bool) (err error) {\n\n\tlogger.Debug(3, \"(updateQueue) wait for lock\")\n\tqm.queueLock.Lock()\n\tdefer qm.queueLock.Unlock()\n\n\tlogger.Debug(3, \"(updateQueue) starting\")\n\tvar tasks []*Task\n\ttasks, err = qm.TaskMap.GetTasks()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif true {\n\t\tif len(tasks) > 0 {\n\t\t\ttask := tasks[0]\n\t\t\tjobID := task.JobId\n\t\t\tjob, _ := GetJob(jobID)\n\n\t\t\tjobState, _ := job.GetState(true)\n\t\t\tfmt.Printf(\"*** job *** %s %s\\n\", jobID, jobState)\n\t\t\tfor wi_id, _ := range job.WorkflowInstancesMap {\n\t\t\t\twi := job.WorkflowInstancesMap[wi_id]\n\t\t\t\twiState, _ := wi.GetState(true)\n\t\t\t\tfmt.Printf(\"WorkflowInstance: %s (%s) remain: %d\\n\", wi_id, wiState, wi.RemainSteps)\n\n\t\t\t\tvar wi_tasks []*Task\n\t\t\t\twi_tasks, err = wi.GetTasks(true)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif len(wi_tasks) > 0 {\n\t\t\t\t\tfor j, _ := range wi_tasks {\n\t\t\t\t\t\ttask := wi_tasks[j]\n\t\t\t\t\t\tfmt.Printf(\" Task %d: %s (wf: %s, state %s)\\n\", j, task.ID, task.WorkflowInstanceID, task.State)\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Printf(\" no tasks\\n\")\n\t\t\t\t}\n\t\t\t\t//if len(wi_tasks) > 20 {\n\t\t\t\t//\tpanic(\"too many tasks!\")\n\t\t\t\t//}\n\n\t\t\t\tfor _, sw := range wi.Subworkflows {\n\t\t\t\t\tfmt.Printf(\" Subworkflow: %s\\n\", sw)\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\t\t\tfmt.Printf(\"*** job *** no tasks\\n\")\n\t\t}\n\t}\n\t//logger.Debug(0, \"(updateQueue) len(tasks): %d\", len(tasks))\n\n\tthreads := 20\n\tsize := len(tasks)\n\n\tloopStart := time.Now()\n\tlogger.Debug(0, \"(updateQueue) starting loop through TaskMap; threads: %d, TaskMap.Len: %d\", threads, size)\n\n\ttaskChan := make(chan *Task, size)\n\tqueueChan := make(chan int, size)\n\tfor w := 1; w <= threads; w++ {\n\t\tgo qm.updateQueueWorker(w, logTimes, taskChan, queueChan)\n\t}\n\n\t//total := 0\n\tfor _, task := range tasks {\n\n\t\ttaskIDStr, _ := task.String()\n\t\tlogger.Debug(3, \"(updateQueue) sending task to QueueWorkers: %s\", taskIDStr)\n\n\t\t//total += 1\n\t\ttaskChan <- task\n\t}\n\tclose(taskChan)\n\n\t// count tasks that have been queued (it also is a mean)\n\tnotReady := 0\n\tqueued := 0\n\tskipped := 0 // did not get lock\n\tfor i := 1; i <= size; i++ {\n\t\tq := <-queueChan\n\t\tswitch q {\n\t\tcase 0:\n\t\t\tnotReady++\n\t\tcase 1:\n\t\t\tqueued++\n\t\tcase 2:\n\t\t\tskipped++\n\t\t}\n\t}\n\tclose(queueChan)\n\tlogger.Debug(0, \"(updateQueue) completed loop through TaskMap; # processed: %d, queued: %d, skipped: %d, took %s\", size, queued, skipped, time.Since(loopStart))\n\n\tlogger.Debug(3, \"(updateQueue) range qm.workQueue.Clean()\")\n\n\t// Remove broken workunits\n\tfor _, workunit := range qm.workQueue.Clean() {\n\t\tid := workunit.ID\n\t\tjobID := workunit.JobId\n\t\ttaskID := workunit.TaskName\n\n\t\tjerror := &JobError{\n\t\t\tWorkFailed: id,\n\t\t\tTaskFailed: taskID,\n\t\t\tServerNotes: \"workunit is nil\",\n\t\t\tStatus: JOB_STAT_SUSPEND,\n\t\t}\n\t\tif err = qm.SuspendJob(jobID, nil, jerror); err != nil {\n\t\t\tlogger.Error(\"(updateQueue:SuspendJob) jobID=%s; err=%s\", jobID, err.Error())\n\t\t}\n\t\tlogger.Error(\"(updateQueue) workunit %s is nil, suspending job %s\", id, jobID)\n\t}\n\n\tlogger.Debug(3, \"(updateQueue) ending\")\n\treturn\n}", "title": "" }, { "docid": "7b75a541917382a0901c3056f5a61615", "score": "0.5001482", "text": "func (s *TestBase) ClearReplicationQueue() {\n\tlog.Infof(\"Clearing replication tasks (RangeID: %v, ReadLevel: %v)\",\n\t\ts.ShardInfo.RangeID, s.GetReplicationReadLevel())\n\ttasks, err := s.GetReplicationTasks(100, true)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error during cleanup: %v\", err)\n\t}\n\n\tcounter := 0\n\tfor _, t := range tasks {\n\t\tlog.Infof(\"Deleting replication task with ID: %v\", t.TaskID)\n\t\ts.CompleteReplicationTask(t.TaskID)\n\t\tcounter++\n\t}\n\n\tlog.Infof(\"Deleted '%v' replication tasks.\", counter)\n\tatomic.StoreInt64(&s.replicationReadLevel, 0)\n}", "title": "" }, { "docid": "270e49171fe28f97a9039da5d08fc1d7", "score": "0.4995113", "text": "func (m *TaskGroupRunner) rollback() {\n\tcount := len(m.rollbacks)\n\tif count == 0 {\n\t\tglog.Infof(\"nothing to rollback\")\n\t\treturn\n\t}\n\n\t// execute the rollback tasks in **reverse order**\n\tfor i := count - 1; i >= 0; i-- {\n\t\t_, err := m.rollbacks[i].Execute()\n\t\tif err != nil {\n\t\t\t// warn this rollback error & continue with the next rollbacks\n\t\t\tglog.Warningf(\"failed to rollback: task '%#v': error '%s'\", m.rollbacks[i], err.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "405a7390afc5432fe205c44c8b20bcd7", "score": "0.49629948", "text": "func queueTasks(ctx context.Context, log zerolog.Logger, wg *sync.WaitGroup,\n\tctrl *scurry.Controller, task measurement.Task, cfg ScurryCLI) {\n\tdefer wg.Done()\n\n\tmCh := ctrl.TaskQueue()\n\tfor _, target := range cfg.Target {\n\t\tlog.Debug().\n\t\t\tStr(\"target\", target).\n\t\t\tMsgf(\"Queueing task\")\n\t\ttask.Target = target\n\t\tmCh <- task\n\t}\n\n\tlog.Debug().Msgf(\"Finished queueing tasks\")\n}", "title": "" }, { "docid": "95fee961998ee6061bef475de37632df", "score": "0.49179494", "text": "func PrintAllTasks() {\n\tvar j int\n\tfor i := range task_root.Tasks {\n\t\tt := task_root.Tasks[i]\n\t\tif t.Done == false {\n\t\t\tj += 1\n\t\t\tPrintTask(&t, j, 0)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "858b025053f3650d1b1e166547b4514f", "score": "0.4914123", "text": "func (m *TaskGroupRunner) rollback() {\n\tcount := len(m.rollbacks)\n\tif count == 0 {\n\t\tklog.Warningf(\"nothing to rollback: no rollback tasks were found\")\n\t\treturn\n\t}\n\n\tklog.Warningf(\"will rollback previously executed runtask(s)\")\n\n\t// execute the rollback tasks in **reverse order**\n\tfor i := count - 1; i >= 0; i-- {\n\t\terr := m.rollbacks[i].ExecuteIt()\n\t\tif err != nil {\n\t\t\t// warn this rollback error & continue with the next rollbacks\n\t\t\tklog.Warningf(\"failed to rollback run task {%s}: %s\", m.rollbacks[i].Runtask.Name, errors.Cause(err))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "df13bf5e02b147f21558b8b0ba6c011d", "score": "0.49023315", "text": "func (s *TestBase) ClearTransferQueue() {\n\tlog.Infof(\"Clearing transfer tasks (RangeID: %v, ReadLevel: %v)\",\n\t\ts.ShardInfo.RangeID, s.GetTransferReadLevel())\n\ttasks, err := s.GetTransferTasks(100, true)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error during cleanup: %v\", err)\n\t}\n\n\tcounter := 0\n\tfor _, t := range tasks {\n\t\tlog.Infof(\"Deleting transfer task with ID: %v\", t.TaskID)\n\t\ts.CompleteTransferTask(t.TaskID)\n\t\tcounter++\n\t}\n\n\tlog.Infof(\"Deleted '%v' transfer tasks.\", counter)\n\tatomic.StoreInt64(&s.readLevel, 0)\n}", "title": "" }, { "docid": "f8f6748a74504679e90eff7cda98b025", "score": "0.4897159", "text": "func (t *simpleQueue) backgroundtask() {\n\tvar retryqueue list.List // list of queued messages; the list is not multithreading safe, and must only be accessed from backgroundtask()\n\n\tgoglog.Logger.Debug(\"backgroundtask started for \", t.GetType())\n\tdur := time.Duration(t.RetryInterval) * time.Second\n\tticker := time.NewTicker(dur)\n\tdefer ticker.Stop()\n\tfor {\n\t\tselect {\n\t\tcase event := <-t.queue:\n\t\t\tif (retryqueue.Len() < t.MaxQueueSize) || t.MaxQueueSize == -1 {\n\t\t\t\tretryqueue.PushBack(event)\n\t\t\t}\n\t\tcase <-t.ctx.Done():\n\t\t\tgoglog.Logger.Debugf(\"queue %s closing\", t.GetType())\n\t\t\treturn\n\t\tcase <-ticker.C:\n\t\t\t// We have reached a RetryInterval. If there are any events in the queue, lets send one back.\n\t\t\t// If we are still in pause mode we will send one, if we are in normal mode we will send all back.\n\t\t\tif e := retryqueue.Front(); e != nil {\n\t\t\t\tgoglog.Logger.Debugf(\"%s simplequeue trying to deliver, has %v events in queue\", t.GetType(), retryqueue.Len())\n\t\t\t\tif atomic.LoadUint32(&t.isInPause) == StatusPaused {\n\t\t\t\t\tmsg := e.Value\n\t\t\t\t\tretryqueue.Remove(e)\n\t\t\t\t\tswitch v := msg.(type) {\n\t\t\t\t\tcase logevent.LogEvent:\n\t\t\t\t\t\tgo func() {\n\t\t\t\t\t\t\tctx, cancel := context.WithTimeout(context.Background(), dur)\n\t\t\t\t\t\t\terr := t.output.OutputEvent(ctx, v)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tgoglog.Logger.Errorf(\"queue: %ssendone %s\", t.GetType(), err.Error())\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcancel()\n\t\t\t\t\t\t}()\n\t\t\t\t\tcase []byte:\n\t\t\t\t\t\tgo func() {\n\t\t\t\t\t\t\tselect {\n\t\t\t\t\t\t\tcase <-t.ctx.Done():\n\t\t\t\t\t\t\t\tgoglog.Logger.Debugf(\"queue %s closing\", t.GetType())\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\tcase t.codecCh <- v:\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}()\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tgoglog.Logger.Errorf(\"Invalid type %T\", v)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// we are not in pause mode and will queue all the events in the queue for sending.\n\t\t\t\t\t// First we need to empty the queue and get all events to send.\n\t\t\t\t\tmyList := []any{}\n\t\t\t\t\tfor {\n\t\t\t\t\t\te := retryqueue.Front()\n\t\t\t\t\t\tif e == nil {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tevent := e.Value\n\t\t\t\t\t\tmyList = append(myList, event)\n\t\t\t\t\t\tretryqueue.Remove(e)\n\t\t\t\t\t}\n\t\t\t\t\t// Now we have to send them all out\n\t\t\t\t\tgo func() {\n\t\t\t\t\t\tfor x := range myList {\n\t\t\t\t\t\t\tctx, cancel := context.WithTimeout(context.Background(), dur)\n\t\t\t\t\t\t\tdefer cancel()\n\t\t\t\t\t\t\tswitch v := (myList[x]).(type) {\n\t\t\t\t\t\t\tcase []byte:\n\t\t\t\t\t\t\t\tselect {\n\t\t\t\t\t\t\t\tcase <-t.ctx.Done():\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\tcase t.codecCh <- v:\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase logevent.LogEvent:\n\t\t\t\t\t\t\t\terr := t.Output(ctx, v)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tgoglog.Logger.Errorf(\"queue: %s sendall %s\", t.GetType(), err.Error())\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tgoglog.Logger.Errorf(\"Invalid type %T\", v)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6f875882efb2a3e833a838a8cfad0f8d", "score": "0.4883071", "text": "func (i *Inspector) DeleteAllScheduledTasks(qname string) (int, error) {\n\tif err := validateQueueName(qname); err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := i.rdb.DeleteAllScheduledTasks(qname)\n\treturn int(n), err\n}", "title": "" }, { "docid": "c51bf7302d8bb3cbb3666a56d830191e", "score": "0.48218143", "text": "func (s *Scheduler) RunPending() {\n\trunnableJobs, n := s.getRunnableJobs()\n\n\tif n != 0 {\n\t\tfor i := 0; i < n; i++ {\n\t\t\trunnableJobs[i].run()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d7524522dcd44085b45d80af58577548", "score": "0.48030972", "text": "func (jm *jobMgr) ConfirmAllTransfersScheduled() {\n\tatomic.StoreInt32(&jm.atomicAllTransfersScheduled, 1)\n}", "title": "" }, { "docid": "271d765d7d759e49dda8c22ab22f2b8e", "score": "0.47553778", "text": "func (w *Worker) TaskQueue(tasks ...Task) (taskIds []string, err error) {\n\toutTasks := make([]map[string]interface{}, 0, len(tasks))\n\n\tfor _, task := range tasks {\n\t\tthisTask := map[string]interface{}{\n\t\t\t\"code_name\": task.CodeName,\n\t\t\t\"payload\": task.Payload,\n\t\t\t\"priority\": task.Priority,\n\t\t\t\"cluster\": task.Cluster,\n\t\t\t\"label\": task.Label,\n\t\t}\n\t\tif task.Timeout != nil {\n\t\t\tthisTask[\"timeout\"] = (*task.Timeout).Seconds()\n\t\t}\n\t\tif task.Delay != nil {\n\t\t\tthisTask[\"delay\"] = int64((*task.Delay).Seconds())\n\t\t}\n\n\t\toutTasks = append(outTasks, thisTask)\n\t}\n\n\tin := map[string][]map[string]interface{}{\"tasks\": outTasks}\n\tout := struct {\n\t\tTasks []struct {\n\t\t\tId string `json:\"id\"`\n\t\t} `json:\"tasks\"`\n\t\tMsg string `json:\"msg\"`\n\t}{}\n\n\terr = w.tasks().Req(\"POST\", &in, &out)\n\tif err != nil {\n\t\treturn\n\t}\n\n\ttaskIds = make([]string, 0, len(out.Tasks))\n\tfor _, task := range out.Tasks {\n\t\ttaskIds = append(taskIds, task.Id)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "5259fa5c71915ed747c70b28c746f574", "score": "0.47265634", "text": "func (s *TaskScheduler) regenerateTaskQueue() error {\n\tdefer timer.New(\"TaskScheduler.regenerateTaskQueue\").Stop()\n\n\t// Find the unfinished Jobs.\n\tunfinishedJobs, err := s.jCache.UnfinishedJobs()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Find TaskSpecs for all unfinished Jobs.\n\tpreFilterCandidates, err := s.findTaskCandidatesForJobs(unfinishedJobs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Filter task candidates.\n\tcandidates, err := s.filterTaskCandidates(preFilterCandidates)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Process the remaining task candidates.\n\tqueue, err := s.processTaskCandidates(candidates)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Save the queue.\n\ts.queueMtx.Lock()\n\tdefer s.queueMtx.Unlock()\n\ts.lastScheduled = time.Now()\n\ts.queue = queue\n\treturn nil\n}", "title": "" }, { "docid": "9ac95f7c8d6a4d4a3ac3bb5c424b0e0d", "score": "0.4720867", "text": "func Retry(task Task, max int) error {\n\tvar err error\n\tfor i := 0; i < max; i++ {\n\t\terr = task.Run()\n\t\tif err == nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "f5cc13106b3060b3c3e64ad7086973b1", "score": "0.47168243", "text": "func queueAllTests(remainingParallelTests chan *testCase, tests []*testCase) {\n\tfor i := range tests {\n\t\tcurr := tests[i]\n\t\tremainingParallelTests <- curr\n\t}\n\n\tclose(remainingParallelTests)\n}", "title": "" }, { "docid": "30929f4e95d0676c597028837868a1ca", "score": "0.470064", "text": "func (m *MarathonScheduler) CountAllTasks(running *demand.Tasks) error {\n\tvar (\n\t\terr error\n\t\tappsMessage AppsMessage\n\t)\n\n\trunning.Lock()\n\tdefer running.Unlock()\n\n\turl := m.baseMarathonURL + \"apps/\"\n\n\tbody, err := utils.GetJSON(url)\n\tif err != nil {\n\t\tlog.Errorf(\"Error getting Marathon Apps %v\", err)\n\t\treturn err\n\t}\n\n\terr = json.Unmarshal(body, &appsMessage)\n\tif err != nil {\n\t\tlog.Errorf(\"Error %v unmarshalling from %s\", err, string(body[:]))\n\t\treturn err\n\t}\n\n\tappCounts := make(map[string]int)\n\n\t// Remove leading slash from App IDs and set the instance counts.\n\tfor _, app := range appsMessage.Apps {\n\t\tappCounts[strings.Replace(app.ID, \"/\", \"\", 1)] = app.Instances\n\t}\n\n\t// Set running counts. Defaults to 0 if the App does not exist.\n\ttasks := running.Tasks\n\tfor _, t := range tasks {\n\t\tt.Running = appCounts[t.Name]\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "a0a1ff313206165b343cac83d60fc12c", "score": "0.46910605", "text": "func (c *RetryClient) Retry(ctx context.Context) {\n\tc.pushTask(ctx, func(ctx context.Context, cli *BaseClient) {\n\t\toldRetryQueue := append([]retryFn{}, c.retryQueue...)\n\t\tc.retryQueue = nil\n\n\t\tfor _, retry := range oldRetryQueue {\n\t\t\tc.muStats.Lock()\n\t\t\tc.stats.TotalRetries++\n\t\t\tc.muStats.Unlock()\n\n\t\t\terr := retry(ctx, cli)\n\t\t\tif retryErr, ok := err.(ErrorWithRetry); ok {\n\t\t\t\tc.retryQueue = append(c.retryQueue, retryErr.Retry)\n\t\t\t\tc.retryQueue = append(c.retryQueue, oldRetryQueue...)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "f2fc95cf2a75dbf9804abc9d6fe8d96d", "score": "0.46756002", "text": "func (c *Coordinator) checkTaskProgress() {\n\tdefer c.mutex.Unlock()\n\tfor {\n\t\tc.mutex.Lock()\n\t\tif c.stage == COMPLETE {\n\t\t\tbreak\n\t\t}\n\t\tfor _, task := range c.mapTasks {\n\t\t\tif task.Status == IN_PROGRESS && task.TimeAssigned.Add(c.timeout).After(time.Now()) {\n\t\t\t\ttask.Status = NOT_STARTED\n\t\t\t}\n\t\t}\n\t\tfor _, task := range c.reduceTasks {\n\t\t\tif task.Status == IN_PROGRESS && task.TimeAssigned.Add(c.timeout).After(time.Now()) {\n\t\t\t\ttask.Status = NOT_STARTED\n\t\t\t}\n\t\t}\n\t\tc.mutex.Unlock()\n\t}\n\tc.wg.Done()\n}", "title": "" }, { "docid": "b31822d5bac6199645328e8f063d9ac4", "score": "0.4674024", "text": "func (jm *jobMgr) ResetAllTransfersScheduled() {\n\tatomic.StoreInt32(&jm.atomicAllTransfersScheduled, 0)\n}", "title": "" }, { "docid": "63aade8aa608487212c75fc79e45ce80", "score": "0.46452698", "text": "func (i *Inspector) DeleteAllDeadTasks(qname string) (int, error) {\n\tif err := validateQueueName(qname); err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := i.rdb.DeleteAllDeadTasks(qname)\n\treturn int(n), err\n}", "title": "" }, { "docid": "7175a4bb293565905750d2509383a14b", "score": "0.4634462", "text": "func (r *mutationResolver) ScheduleUndispatchedBaseTasks(ctx context.Context, patchID string) ([]*restModel.APITask, error) {\n\topts := data.TaskFilterOptions{\n\t\tStatuses: evergreen.TaskFailureStatuses,\n\t\tIncludeExecutionTasks: true,\n\t\tIncludeBaseTasks: false,\n\t}\n\ttasks, _, err := r.sc.FindTasksByVersion(patchID, opts)\n\tif err != nil {\n\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"Could not fetch tasks for patch: %s \", err.Error()))\n\t}\n\n\tscheduledTasks := []*restModel.APITask{}\n\ttasksToSchedule := make(map[string]bool)\n\n\tfor _, t := range tasks {\n\t\t// If a task is a generated task don't schedule it until we get all of the generated tasks we want to generate\n\t\tif t.GeneratedBy == \"\" {\n\t\t\t// We can ignore an error while fetching tasks because this could just mean the task didn't exist on the base commit.\n\t\t\tbaseTask, _ := t.FindTaskOnBaseCommit()\n\t\t\tif baseTask != nil && baseTask.Status == evergreen.TaskUndispatched {\n\t\t\t\ttasksToSchedule[baseTask.Id] = true\n\t\t\t}\n\t\t\t// If a task is generated lets find its base task if it exists otherwise we need to generate it\n\t\t} else if t.GeneratedBy != \"\" {\n\t\t\tbaseTask, _ := t.FindTaskOnBaseCommit()\n\t\t\t// If the task is undispatched or doesn't exist on the base commit then we want to schedule\n\t\t\tif baseTask == nil {\n\t\t\t\tgeneratorTask, err := task.FindByIdExecution(t.GeneratedBy, nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"Experienced an error trying to find the generator task: %s\", err.Error()))\n\t\t\t\t}\n\t\t\t\tif generatorTask != nil {\n\t\t\t\t\tbaseGeneratorTask, _ := generatorTask.FindTaskOnBaseCommit()\n\t\t\t\t\t// If baseGeneratorTask is nil then it didn't exist on the base task and we can't do anything\n\t\t\t\t\tif baseGeneratorTask != nil && baseGeneratorTask.Status == evergreen.TaskUndispatched {\n\t\t\t\t\t\terr = baseGeneratorTask.SetGeneratedTasksToActivate(t.BuildVariant, t.DisplayName)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"Could not activate generated task: %s\", err.Error()))\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttasksToSchedule[baseGeneratorTask.Id] = true\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if baseTask.Status == evergreen.TaskUndispatched {\n\t\t\t\ttasksToSchedule[baseTask.Id] = true\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfor taskId := range tasksToSchedule {\n\t\ttask, err := SetScheduled(ctx, r.sc, taskId, true)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tscheduledTasks = append(scheduledTasks, task)\n\t}\n\t// sort scheduledTasks by display name to guarantee the order of the tasks\n\tsort.Slice(scheduledTasks, func(i, j int) bool {\n\t\treturn *scheduledTasks[i].DisplayName < *scheduledTasks[j].DisplayName\n\t})\n\n\treturn scheduledTasks, nil\n}", "title": "" }, { "docid": "dfd490ab2fc4b20fa63afa3674be173c", "score": "0.46228087", "text": "func (f *FakeWorkQueue) NumRequeues(item interface{}) int { return 0 }", "title": "" }, { "docid": "dfd490ab2fc4b20fa63afa3674be173c", "score": "0.46228087", "text": "func (f *FakeWorkQueue) NumRequeues(item interface{}) int { return 0 }", "title": "" }, { "docid": "9da3be2af7abf5139061d946d82432ea", "score": "0.4615337", "text": "func (r *mutationResolver) ScheduleUndispatchedBaseTasks(ctx context.Context, patchID string) ([]*restModel.APITask, error) {\n\topts := task.GetTasksByVersionOptions{\n\t\tStatuses: evergreen.TaskFailureStatuses,\n\t\tIncludeExecutionTasks: true,\n\t}\n\ttasks, _, err := task.GetTasksByVersion(ctx, patchID, opts)\n\tif err != nil {\n\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"Could not fetch tasks for patch: %s \", err.Error()))\n\t}\n\n\tscheduledTasks := []*restModel.APITask{}\n\ttasksToSchedule := make(map[string]bool)\n\n\tfor _, t := range tasks {\n\t\t// If a task is a generated task don't schedule it until we get all of the generated tasks we want to generate\n\t\tif t.GeneratedBy == \"\" {\n\t\t\t// We can ignore an error while fetching tasks because this could just mean the task didn't exist on the base commit.\n\t\t\tbaseTask, _ := t.FindTaskOnBaseCommit()\n\t\t\tif baseTask != nil && baseTask.Status == evergreen.TaskUndispatched {\n\t\t\t\ttasksToSchedule[baseTask.Id] = true\n\t\t\t}\n\t\t\t// If a task is generated lets find its base task if it exists otherwise we need to generate it\n\t\t} else if t.GeneratedBy != \"\" {\n\t\t\tbaseTask, _ := t.FindTaskOnBaseCommit()\n\t\t\t// If the task is undispatched or doesn't exist on the base commit then we want to schedule\n\t\t\tif baseTask == nil {\n\t\t\t\tgeneratorTask, err := task.FindByIdExecution(t.GeneratedBy, nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"Experienced an error trying to find the generator task: %s\", err.Error()))\n\t\t\t\t}\n\t\t\t\tif generatorTask != nil {\n\t\t\t\t\tbaseGeneratorTask, _ := generatorTask.FindTaskOnBaseCommit()\n\t\t\t\t\t// If baseGeneratorTask is nil then it didn't exist on the base task and we can't do anything\n\t\t\t\t\tif baseGeneratorTask != nil && baseGeneratorTask.Status == evergreen.TaskUndispatched {\n\t\t\t\t\t\terr = baseGeneratorTask.SetGeneratedTasksToActivate(t.BuildVariant, t.DisplayName)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn nil, InternalServerError.Send(ctx, fmt.Sprintf(\"Could not activate generated task: %s\", err.Error()))\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttasksToSchedule[baseGeneratorTask.Id] = true\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if baseTask.Status == evergreen.TaskUndispatched {\n\t\t\t\ttasksToSchedule[baseTask.Id] = true\n\t\t\t}\n\n\t\t}\n\t}\n\n\ttaskIDs := []string{}\n\tfor taskId := range tasksToSchedule {\n\t\ttaskIDs = append(taskIDs, taskId)\n\t}\n\tscheduled, err := setManyTasksScheduled(ctx, r.sc.GetURL(), true, taskIDs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tscheduledTasks = append(scheduledTasks, scheduled...)\n\t// sort scheduledTasks by display name to guarantee the order of the tasks\n\tsort.Slice(scheduledTasks, func(i, j int) bool {\n\t\treturn utility.FromStringPtr(scheduledTasks[i].DisplayName) < utility.FromStringPtr(scheduledTasks[j].DisplayName)\n\t})\n\n\treturn scheduledTasks, nil\n}", "title": "" }, { "docid": "1ec7b6668a4510c4ccf8fc13c02e8776", "score": "0.46126106", "text": "func (s *Scheduler) inferPlans() {\n\tfor {\n\t\ttask := <- s.pendingTasks\n\t\tlog.Printf(\"Planning to run task [%d]\", task.ID)\n\n\t\tplan := s.inferPlanForTask(task)\n\n\t\tif plan != nil {\n\t\t\ts.pendingPlans <- plan // a channel is used here because only fifo's policy is supported\n\t\t} else {\n\t\t\tgo func() {\n\t\t\t\ttime.Sleep(TaskRetryTimeInterval)\n\t\t\t\ts.pendingTasks <- task\n\t\t\t\tlog.Printf(\"Retring the task [%d]\", task.ID)\n\t\t\t}()\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "368ecb0607735b6e1da09693850aeaeb", "score": "0.45934975", "text": "func (ar *allocRunner) RestartAll(event *structs.TaskEvent) error {\n\t// Restart the taskCoordinator to allow dead tasks to run again.\n\tar.taskCoordinator.Restart()\n\treturn ar.restartTasks(context.TODO(), event, false, true)\n}", "title": "" }, { "docid": "a54228a085fdfd072c869c8d1062d1b1", "score": "0.45926112", "text": "func (s *UIState) processQueue() {\n\tfor {\n\t\tselect {\n\t\tcase f := <-s.queueChan:\n\t\t\tf()\n\t\tdefault:\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0bf76faa3da43ef48afe22d4e4c308c2", "score": "0.45596954", "text": "func (r *RDB) forwardAll(qname string) (err error) {\n\tdelayedKeys := []string{base.ScheduledKey(qname), base.RetryKey(qname)}\n\tpendingKey := base.PendingKey(qname)\n\ttaskKeyPrefix := base.TaskKeyPrefix(qname)\n\tgroupKeyPrefix := base.GroupKeyPrefix(qname)\n\tfor _, delayedKey := range delayedKeys {\n\t\tn := 1\n\t\tfor n != 0 {\n\t\t\tn, err = r.forward(delayedKey, pendingKey, taskKeyPrefix, groupKeyPrefix)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "459cc5c7b58be1bd0bbb173cef893301", "score": "0.4555824", "text": "func (mgr *DiskRepairMgr) StatQueueTaskCnt() (inited, prepared, completed int) {\n\ttodo, doing := mgr.prepareQueue.StatsTasks()\n\tinited = todo + doing\n\n\ttodo, doing = mgr.workQueue.StatsTasks()\n\tprepared = todo + doing\n\n\ttodo, doing = mgr.finishQueue.StatsTasks()\n\tcompleted = todo + doing\n\treturn\n}", "title": "" }, { "docid": "ed1a13c431dd83995f1c0e9253f9ad51", "score": "0.45541376", "text": "func (c *Controller) processAllItemsInQueue() {\n\tnumRules := c.queue.Len()\n\tbatchSyncRuleKeys := make([]string, numRules)\n\tfor i := 0; i < numRules; i++ {\n\t\truleKey, _ := c.queue.Get()\n\t\tbatchSyncRuleKeys[i] = ruleKey.(string)\n\t\t// set key to done to prevent missing watched updates between here and fullSync finish.\n\t\tc.queue.Done(ruleKey)\n\t}\n\t// Reconcile all rule keys at once.\n\tif err := c.syncRules(batchSyncRuleKeys); err != nil {\n\t\tklog.Errorf(\"Error occurred when reconciling all rules for init events: %v\", err)\n\t\tfor _, k := range batchSyncRuleKeys {\n\t\t\tc.queue.AddRateLimited(k)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "208894c61cce2167b959f105018d1d7b", "score": "0.4543216", "text": "func (bq *baseQueue) processLoop(stopper *stop.Stopper) {\n\tctx := bq.AnnotateCtx(context.Background())\n\tstopper.RunWorker(ctx, func(ctx context.Context) {\n\t\tdefer func() {\n\t\t\tbq.mu.Lock()\n\t\t\tbq.mu.stopped = true\n\t\t\tbq.mu.Unlock()\n\t\t}()\n\n\t\t// nextTime is initially nil; we don't start any timers until the queue\n\t\t// becomes non-empty.\n\t\tvar nextTime <-chan time.Time\n\n\t\timmediately := make(chan time.Time)\n\t\tclose(immediately)\n\n\t\tfor {\n\t\t\tselect {\n\t\t\t// Exit on stopper.\n\t\t\tcase <-stopper.ShouldStop():\n\t\t\t\treturn\n\n\t\t\t// Incoming signal sets the next time to process if there were previously\n\t\t\t// no replicas in the queue.\n\t\t\tcase <-bq.incoming:\n\t\t\t\tif nextTime == nil {\n\t\t\t\t\t// When a replica is added, wake up immediately. This is mainly\n\t\t\t\t\t// to facilitate testing without unnecessary sleeps.\n\t\t\t\t\tnextTime = immediately\n\n\t\t\t\t\t// In case we're in a test, still block on the impl.\n\t\t\t\t\tbq.impl.timer(0)\n\t\t\t\t}\n\t\t\t// Process replicas as the timer expires.\n\t\t\tcase <-nextTime:\n\t\t\t\trepl := bq.pop()\n\t\t\t\tvar duration time.Duration\n\t\t\t\tif repl != nil {\n\t\t\t\t\tannotatedCtx := repl.AnnotateCtx(ctx)\n\t\t\t\t\tif stopper.RunTask(\n\t\t\t\t\t\tannotatedCtx, fmt.Sprintf(\"storage.%s: processing replica\", bq.name),\n\t\t\t\t\t\tfunc(annotatedCtx context.Context) {\n\t\t\t\t\t\t\tstart := timeutil.Now()\n\t\t\t\t\t\t\tif err := bq.processReplica(annotatedCtx, repl); err != nil {\n\t\t\t\t\t\t\t\t// Maybe add failing replica to purgatory if the queue supports it.\n\t\t\t\t\t\t\t\tbq.maybeAddToPurgatory(annotatedCtx, repl, err, stopper)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tduration = timeutil.Since(start)\n\n\t\t\t\t\t\t\t//helper.Printf(5, \"done %s\", duration)\n\t\t\t\t\t\t}) != nil {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif bq.Length() == 0 {\n\t\t\t\t\tnextTime = nil\n\t\t\t\t} else {\n\t\t\t\t\tnextTime = time.After(bq.impl.timer(duration))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "16c052875f8a076ed9627d2ce15022ff", "score": "0.4535034", "text": "func (b *Build) AllUnblockedTasksFinished(tasks []task.Task) (bool, string, error) {\n\tif !b.Activated {\n\t\treturn false, b.Status, nil\n\t}\n\tallFinished := true\n\tstatus := evergreen.BuildSucceeded\n\tfor _, t := range tasks {\n\t\tif t.BuildId != b.Id {\n\t\t\tcontinue\n\t\t}\n\t\tif evergreen.IsFailedTaskStatus(t.Status) {\n\t\t\tstatus = evergreen.BuildFailed\n\t\t}\n\t\tif !evergreen.IsFinishedTaskStatus(t.Status) {\n\t\t\tif !t.Activated {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !t.Blocked() {\n\t\t\t\tallFinished = false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn allFinished, status, nil\n}", "title": "" }, { "docid": "d34ca143402581bd9359f911e3a96f70", "score": "0.45254457", "text": "func (ftp *FixedTaskPool) GetQueueCount() int {\n\n\treturn len(ftp.taskQueue)\n}", "title": "" }, { "docid": "c782a860d549f77ee07d8a83adf1999f", "score": "0.45244217", "text": "func (r *RDB) Retry(ctx context.Context, msg *base.TaskMessage, processAt time.Time, errMsg string, isFailure bool) error {\n\tvar op errors.Op = \"rdb.Retry\"\n\tnow := r.clock.Now()\n\tmodified := *msg\n\tif isFailure {\n\t\tmodified.Retried++\n\t}\n\tmodified.ErrorMsg = errMsg\n\tmodified.LastFailedAt = now.Unix()\n\tencoded, err := base.EncodeMessage(&modified)\n\tif err != nil {\n\t\treturn errors.E(op, errors.Internal, fmt.Sprintf(\"cannot encode message: %v\", err))\n\t}\n\texpireAt := now.Add(statsTTL)\n\tkeys := []string{\n\t\tbase.TaskKey(msg.Queue, msg.ID),\n\t\tbase.ActiveKey(msg.Queue),\n\t\tbase.LeaseKey(msg.Queue),\n\t\tbase.RetryKey(msg.Queue),\n\t\tbase.ProcessedKey(msg.Queue, now),\n\t\tbase.FailedKey(msg.Queue, now),\n\t\tbase.ProcessedTotalKey(msg.Queue),\n\t\tbase.FailedTotalKey(msg.Queue),\n\t}\n\targv := []interface{}{\n\t\tmsg.ID,\n\t\tencoded,\n\t\tprocessAt.Unix(),\n\t\texpireAt.Unix(),\n\t\tisFailure,\n\t\tint64(math.MaxInt64),\n\t}\n\treturn r.runScript(ctx, op, retryCmd, keys, argv...)\n}", "title": "" }, { "docid": "1c30f5b2449638a7f39881ba00237c00", "score": "0.45240378", "text": "func TestRunningAll(t *testing.T) {\n\tvar td taskData\n\ttotal := 10000000\n\tworkers := runtime.NumCPU()\n\n\tpool := New(total, workers, func(wg *sync.WaitGroup, pos, total, workerID int) interface{} {\n\t\t//\ttime.Sleep(time.Duration(rand.Int63n(20)*10+1) * time.Millisecond)\n\n\t\ttd.mx.Lock()\n\t\tdefer td.mx.Unlock()\n\n\t\ttd.tasksDone = append(td.tasksDone, pos)\n\t\treturn nil\n\t})\n\n\tpool.Run().Wait()\n\n\tif len(td.tasksDone) != total {\n\t\tt.Errorf(\"Not all jobs were executed! Executed tasks: %d\", len(td.tasksDone))\n\t}\n\n\tsort.Sort(sort.IntSlice(td.tasksDone))\n\n\t// Check if all tasks were executed\n\tfor i := 0; i < total-1; i++ {\n\t\tif td.tasksDone[i] != td.tasksDone[i+1]-1 {\n\t\t\tt.Errorf(\"Missing %d\", td.tasksDone[i+1])\n\t\t}\n\t}\n}", "title": "" }, { "docid": "87af9c91eaf4a7786382d20d2a75dbb0", "score": "0.45193672", "text": "func (ar *allocRunner) restartTasks(ctx context.Context, event *structs.TaskEvent, failure bool, force bool) error {\n\twaitCh := make(chan struct{})\n\tvar err *multierror.Error\n\tvar errMutex sync.Mutex\n\n\t// run alloc task restart hooks\n\tar.taskRestartHooks()\n\n\tgo func() {\n\t\tvar wg sync.WaitGroup\n\t\tdefer close(waitCh)\n\t\tfor tn, tr := range ar.tasks {\n\t\t\twg.Add(1)\n\t\t\tgo func(taskName string, taskRunner *taskrunner.TaskRunner) {\n\t\t\t\tdefer wg.Done()\n\n\t\t\t\tvar e error\n\t\t\t\tif force {\n\t\t\t\t\te = taskRunner.ForceRestart(ctx, event.Copy(), failure)\n\t\t\t\t} else {\n\t\t\t\t\te = taskRunner.Restart(ctx, event.Copy(), failure)\n\t\t\t\t}\n\n\t\t\t\t// Ignore ErrTaskNotRunning errors since tasks that are not\n\t\t\t\t// running are expected to not be restarted.\n\t\t\t\tif e != nil && e != taskrunner.ErrTaskNotRunning {\n\t\t\t\t\terrMutex.Lock()\n\t\t\t\t\tdefer errMutex.Unlock()\n\t\t\t\t\terr = multierror.Append(err, fmt.Errorf(\"failed to restart task %s: %v\", taskName, e))\n\t\t\t\t}\n\t\t\t}(tn, tr)\n\t\t}\n\t\twg.Wait()\n\t}()\n\n\tselect {\n\tcase <-waitCh:\n\tcase <-ctx.Done():\n\t}\n\n\treturn err.ErrorOrNil()\n}", "title": "" }, { "docid": "cc16cc1b2021b66268b6951bccccef44", "score": "0.45116556", "text": "func (m *migrator) RollbackAll(ctx context.Context) error {\n\tmigrations := m.Migrations(Active)\n\treturn m.RollbackN(ctx, len(migrations))\n}", "title": "" }, { "docid": "7552919891d7d1a988ac5cc161e90020", "score": "0.45092064", "text": "func (w *Worker) Run(ctx context.Context, f Work) (err error) {\n\tif len(w.Qs) == 0 {\n\t\treturn fmt.Errorf(\"No queues specified to work on\")\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn fmt.Errorf(\"worker quit: %w\", ctx.Err())\n\t\tdefault:\n\t\t}\n\n\t\ttask, err := w.eqc.Claim(ctx, From(w.Qs...), ClaimFor(w.lease))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"worker claim (%q): %w\", w.Qs, err)\n\t\t}\n\n\t\terrQ := w.ErrQMap(task.Queue)\n\n\t\tvar args []ModifyArg\n\t\trenewed, workErr := w.eqc.DoWithRenew(ctx, task, w.lease, func(ctx context.Context) error {\n\t\t\tvar err error\n\t\t\tif args, err = f(ctx, task); err != nil {\n\t\t\t\tif e := new(RetryTaskError); errors.As(err, &e) {\n\t\t\t\t\tchangeArgs := []ChangeArg{ErrTo(taskErrMsg(e)), AttemptToNext()}\n\t\t\t\t\tif w.MaxAttempts == 0 || task.Attempt+1 < w.MaxAttempts {\n\t\t\t\t\t\tlog.Printf(\"Worker received retryable error, incrementing attempt: %v\", e)\n\t\t\t\t\t\tchangeArgs = append(changeArgs, ArrivalTimeBy(w.baseRetryDelay))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.Printf(\"Worker max attempts reached, moving to %q instead of retrying: %v\", errQ, e)\n\t\t\t\t\t\tchangeArgs = append(changeArgs, QueueTo(errQ))\n\t\t\t\t\t}\n\t\t\t\t\targs = []ModifyArg{task.AsChange(changeArgs...)}\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif e := new(MoveTaskError); errors.As(err, &e) {\n\t\t\t\t\tlog.Printf(\"Worker moving to %q: %v\", errQ, err)\n\t\t\t\t\targs = []ModifyArg{task.AsChange(QueueTo(errQ), ErrTo(taskErrMsg(e)))}\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"work (%q): %w\", w.Qs, err)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif workErr != nil {\n\t\t\tif _, ok := AsDependency(workErr); ok {\n\t\t\t\tlog.Printf(\"Worker continuing after dependency (%q)\", w.Qs)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif IsTimeout(workErr) {\n\t\t\t\tlog.Printf(\"Worker continuing after timeout (%q)\", w.Qs)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif IsCanceled(workErr) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"worker error: %w\", workErr)\n\t\t}\n\n\t\tmodification := NewModification(uuid.Nil, args...)\n\t\tfor _, task := range modification.Changes {\n\t\t\tif task.ID == renewed.ID && task.Version != renewed.Version {\n\t\t\t\tif task.Version > renewed.Version {\n\t\t\t\t\treturn fmt.Errorf(\"task updated inside worker body, expected version <= %v, got %v\", renewed.Version, task.Version)\n\t\t\t\t}\n\t\t\t\ttask.Version = renewed.Version\n\t\t\t}\n\t\t}\n\t\tfor _, id := range modification.Depends {\n\t\t\tif id.ID == renewed.ID && task.Version != renewed.Version {\n\t\t\t\tif task.Version > renewed.Version {\n\t\t\t\t\treturn fmt.Errorf(\"task updated inside worker body, expected version <= %v, got %v\", renewed.Version, task.Version)\n\t\t\t\t}\n\t\t\t\tid.Version = renewed.Version\n\t\t\t}\n\t\t}\n\t\tfor _, id := range modification.Deletes {\n\t\t\tif id.ID == renewed.ID && task.Version != renewed.Version {\n\t\t\t\tif task.Version > renewed.Version {\n\t\t\t\t\treturn fmt.Errorf(\"task updated inside worker body, expected version <= %v, got %v\", renewed.Version, task.Version)\n\t\t\t\t}\n\t\t\t\tid.Version = renewed.Version\n\t\t\t}\n\t\t}\n\n\t\tif _, _, err := w.eqc.Modify(ctx, WithModification(modification)); err != nil {\n\t\t\tif depErr, ok := AsDependency(err); ok {\n\t\t\t\tif w.OnDepErr != nil {\n\t\t\t\t\tif err := w.OnDepErr(depErr); err != nil {\n\t\t\t\t\t\tlog.Printf(\"Dependency error upgraded to fatal: %v\", err)\n\t\t\t\t\t\treturn fmt.Errorf(\"worker depdency error upgraded to fatal: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlog.Printf(\"Worker ack failed (%q), throwing away: %v\", w.Qs, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif IsTimeout(err) {\n\t\t\t\tlog.Printf(\"Worker continuing (%q) after ack timeout: %v\", w.Qs, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif IsCanceled(err) {\n\t\t\t\tlog.Printf(\"Worker exiting cleanly (%q) instead of acking: %v\", w.Qs, err)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"worker ack (%q): %w\", w.Qs, err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "78754b4be04925b28418d06e92adc4b4", "score": "0.45067132", "text": "func (d *defaultQueue) DequeueAll() ([]Task, bool) {\n\td.Lock()\n\tdefer d.Unlock()\n\td.toDoTasks, d.paddingTasks = d.paddingTasks, d.toDoTasks\n\td.paddingTasks = d.paddingTasks[:0]\n\treturn d.toDoTasks, len(d.toDoTasks) > 0\n}", "title": "" }, { "docid": "4a57acfc3a0d6e9fa58b2de3f7eb5f1b", "score": "0.45010778", "text": "func (q *APTQueue) run() {\n\tif !q.Context.Config.IsE2ETest() {\n\t\tq.Context.Logger.Info(\"apt_queue invoked but is doing nothing because this service is probably no longer necessary, except in end-to-end tests.\")\n\t\tq.Context.Logger.Info(\"We are evaluating whether or not to remove this service entirely from our production environment.\")\n\t\treturn\n\t}\n\tparams := url.Values{}\n\tparams.Set(\"queued_at__is_null\", \"true\")\n\tparams.Set(\"status\", constants.StatusPending)\n\tparams.Set(\"retry\", \"true\")\n\tparams.Add(\"action__in\", constants.ActionDelete)\n\tparams.Add(\"action__in\", constants.ActionGlacierRestore)\n\tparams.Add(\"action__in\", constants.ActionRestoreFile)\n\tparams.Add(\"action__in\", constants.ActionRestoreObject)\n\tparams.Set(\"node__is_null\", \"true\")\n\tparams.Set(\"page\", \"1\")\n\tparams.Set(\"per_page\", \"100\")\n\tfor {\n\t\tresp := q.Context.RegistryClient.WorkItemList(params)\n\t\tif resp.Error != nil {\n\t\t\tq.Context.Logger.Errorf(\"Error getting WorkItem list from Registry: %s\", resp.Error)\n\t\t}\n\t\tq.Context.Logger.Infof(\"Found %d items\", len(resp.WorkItems()))\n\t\tfor _, item := range resp.WorkItems() {\n\t\t\tif q.addToNSQ(item) {\n\t\t\t\tq.markAsQueued(item)\n\t\t\t}\n\t\t}\n\t\tq.Context.Logger.Info(\"HasNextPage =\", resp.HasNextPage())\n\t\tif !resp.HasNextPage() {\n\t\t\tbreak\n\t\t}\n\t\tparams = resp.ParamsForNextPage()\n\t}\n}", "title": "" }, { "docid": "01bc4203c1a008f1f79d1c87c814c62f", "score": "0.44983748", "text": "func (m *MissionStateReporter) syncQueue() {\n\tworkFunc := func() bool {\n\t\tif !helper.TestClusterReady() {\n\t\t\tklog.V(3).Infof(\"Cluster is unhealthy, skipping mission status checking.\")\n\t\t\treturn false\n\t\t}\n\n\t\tkey, quit := m.queue.Get()\n\t\tif quit {\n\t\t\treturn true\n\t\t}\n\t\tdefer m.queue.Done(key)\n\n\t\terr := m.processQueueItem(key.(string))\n\t\tif err == nil {\n\t\t\t// no error, forget this entry and return\n\t\t\tm.queue.Forget(key)\n\t\t\treturn false\n\t\t}\n\n\t\t// rather than wait for a full resync, re-add the mission to the queue to be processed\n\t\tm.queue.AddRateLimited(key)\n\t\tutilruntime.HandleError(err)\n\t\treturn false\n\t}\n\n\tfor {\n\t\tquit := workFunc()\n\t\tif quit {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6e16648f24a7638fe360ef4e799efb1b", "score": "0.44933227", "text": "func (m *Master) schedule() {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tif m.done {\n\t\treturn\n\t}\n\n\tallTasksFinished := true\n\tfor index, t := range m.taskStats {\n\t\tswitch t.Status {\n\t\tcase TaksStatusReady:\n\t\t\tallTasksFinished = false\n\t\t\tm.taskCh <- m.getTask(index)\n\t\t\tm.taskStats[index].Status = TaskStatusQueue\n\t\tcase TaskStatusQueue:\n\t\t\tallTasksFinished = false\n\t\tcase TaskStatusRunning:\n\t\t\tallTasksFinished = false\n\t\t\tif time.Now().Sub(t.StartTime) > MaxTaskRunTime {\n\t\t\t\tm.taskStats[index].Status = TaskStatusQueue\n\t\t\t\tm.taskCh <- m.getTask(index)\n\t\t\t}\n\t\tcase TaskStatusFinish:\n\t\tcase TaskStatusError:\n\t\t\tallTasksFinished = false\n\t\t\tm.taskStats[index].Status = TaskStatusQueue\n\t\t\tm.taskCh <- m.getTask(index)\n\t\tdefault:\n\t\t\tpanic(\"Error in task status\")\n\t\t}\n\t}\n\tif allTasksFinished {\n\t\tif m.taskType == MapType {\n\t\t\tm.initReduceTask()\n\t\t} else {\n\t\t\tm.done = true\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d96970523b4063c2bdaf10bb6ef46d74", "score": "0.44930476", "text": "func (s *TaskScheduler) scheduleTasks() error {\n\tdefer timer.New(\"TaskScheduler.scheduleTasks\").Stop()\n\t// Find free bots, match them with tasks.\n\tbots, err := getFreeSwarmingBots(s.swarming)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.queueMtx.Lock()\n\tdefer s.queueMtx.Unlock()\n\tschedule := getCandidatesToSchedule(bots, s.queue)\n\n\t// First, group by commit hash since we have to isolate the code at\n\t// a particular revision for each task.\n\tbyRepoState := map[db.RepoState][]*taskCandidate{}\n\tfor _, c := range schedule {\n\t\tbyRepoState[c.RepoState] = append(byRepoState[c.RepoState], c)\n\t}\n\n\t// Isolate the tasks by commit.\n\tfor rs, candidates := range byRepoState {\n\t\tif err := s.isolateTasks(rs, candidates); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Trigger tasks.\n\tbyCandidateId := make(map[string]*db.Task, len(schedule))\n\ttasksToInsert := make(map[string]*db.Task, len(schedule)*2)\n\tfor _, candidate := range schedule {\n\t\tt := candidate.MakeTask()\n\t\tif err := s.db.AssignId(t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treq := candidate.MakeTaskRequest(t.Id)\n\t\tresp, err := s.swarming.TriggerTask(req)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcreated, err := swarming.ParseTimestamp(resp.Request.CreatedTs)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to parse timestamp of created task: %s\", err)\n\t\t}\n\t\tt.Created = created\n\t\tt.SwarmingTaskId = resp.TaskId\n\t\tbyCandidateId[candidate.MakeId()] = t\n\t\ttasksToInsert[t.Id] = t\n\t\t// If we're stealing commits from another task, find it and adjust\n\t\t// its blamelist.\n\t\t// TODO(borenet): We're retrieving a cached task which may have been\n\t\t// changed since the cache was last updated. We need to handle that.\n\t\tif candidate.StealingFromId != \"\" {\n\t\t\tvar stealingFrom *db.Task\n\t\t\tif _, err := parseId(candidate.StealingFromId); err == nil {\n\t\t\t\tstealingFrom = byCandidateId[candidate.StealingFromId]\n\t\t\t\tif stealingFrom == nil {\n\t\t\t\t\treturn fmt.Errorf(\"Attempting to backfill a just-triggered candidate but can't find it: %q\", candidate.StealingFromId)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar ok bool\n\t\t\t\tstealingFrom, ok = tasksToInsert[candidate.StealingFromId]\n\t\t\t\tif !ok {\n\t\t\t\t\tstealingFrom, err = s.tCache.GetTask(candidate.StealingFromId)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\toldCommits := util.NewStringSet(stealingFrom.Commits)\n\t\t\tstealing := util.NewStringSet(t.Commits)\n\t\t\tstealingFrom.Commits = oldCommits.Complement(stealing).Keys()\n\t\t\ttasksToInsert[stealingFrom.Id] = stealingFrom\n\t\t}\n\t}\n\ttasks := make([]*db.Task, 0, len(tasksToInsert))\n\tfor _, t := range tasksToInsert {\n\t\ttasks = append(tasks, t)\n\t}\n\n\t// Insert the tasks into the database.\n\tif err := s.db.PutTasks(tasks); err != nil {\n\t\treturn err\n\t}\n\n\t// Remove the tasks from the queue.\n\tnewQueue := make([]*taskCandidate, 0, len(s.queue)-len(schedule))\n\tfor i, j := 0, 0; i < len(s.queue); {\n\t\tif j >= len(schedule) {\n\t\t\tnewQueue = append(newQueue, s.queue[i:]...)\n\t\t\tbreak\n\t\t}\n\t\tif s.queue[i] == schedule[j] {\n\t\t\tj++\n\t\t} else {\n\t\t\tnewQueue = append(newQueue, s.queue[i])\n\t\t}\n\t\ti++\n\t}\n\ts.queue = newQueue\n\n\t// Note; if regenerateQueue and scheduleTasks are ever decoupled so that\n\t// the queue is reused by multiple runs of scheduleTasks, we'll need to\n\t// address the fact that some candidates may still have their\n\t// StoleFromId pointing to candidates which have been triggered and\n\t// removed from the queue. In that case, we should just need to write a\n\t// loop which updates those candidates to use the IDs of the newly-\n\t// inserted Tasks in the database rather than the candidate ID.\n\n\tglog.Infof(\"Triggered %d tasks on %d bots.\", len(schedule), len(bots))\n\treturn nil\n}", "title": "" }, { "docid": "b6c038264d36227ee32d98e1bbc4010b", "score": "0.44909856", "text": "func (d *dispatcher) DispatchTaskLoop() {\n\tlogutil.BgLogger().Info(\"dispatch task loop start\")\n\tticker := time.NewTicker(checkTaskRunningInterval)\n\tdefer ticker.Stop()\n\tfor {\n\t\tselect {\n\t\tcase <-d.ctx.Done():\n\t\t\tlogutil.BgLogger().Info(\"dispatch task loop exits\", zap.Error(d.ctx.Err()), zap.Int64(\"interval\", int64(checkTaskRunningInterval)/1000000))\n\t\t\treturn\n\t\tcase <-ticker.C:\n\t\t\tcnt := d.getRunningGTaskCnt()\n\t\t\tif d.checkConcurrencyOverflow(cnt) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// TODO: Consider getting these tasks, in addition to the task being worked on..\n\t\t\tgTasks, err := d.taskMgr.GetGlobalTasksInStates(proto.TaskStatePending, proto.TaskStateRunning, proto.TaskStateReverting, proto.TaskStateCancelling)\n\t\t\tif err != nil {\n\t\t\t\tlogutil.BgLogger().Warn(\"get unfinished(pending, running, reverting or cancelling) tasks failed\", zap.Error(err))\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// There are currently no global tasks to work on.\n\t\t\tif len(gTasks) == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfor _, gTask := range gTasks {\n\t\t\t\t// This global task is running, so no need to reprocess it.\n\t\t\t\tif d.isRunningGTask(gTask.ID) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// the task is not in runningGTasks set when:\n\t\t\t\t// owner changed or task is cancelled when status is pending.\n\t\t\t\tif gTask.State == proto.TaskStateRunning || gTask.State == proto.TaskStateReverting || gTask.State == proto.TaskStateCancelling {\n\t\t\t\t\td.setRunningGTask(gTask)\n\t\t\t\t\tcnt++\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif d.checkConcurrencyOverflow(cnt) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\terr = d.processNormalFlow(gTask)\n\t\t\t\tlogutil.BgLogger().Info(\"dispatch task loop\", zap.Int64(\"task ID\", gTask.ID),\n\t\t\t\t\tzap.String(\"state\", gTask.State), zap.Uint64(\"concurrency\", gTask.Concurrency), zap.Error(err))\n\t\t\t\tif err != nil || gTask.IsFinished() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\td.setRunningGTask(gTask)\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f8f68407d2c8ab488ac8de36900acdea", "score": "0.4488086", "text": "func TestTaskRunRetry(t *testing.T) {\n\tctx := context.Background()\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\tc, namespace := setup(ctx, t)\n\tknativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf)\n\tdefer tearDown(ctx, t, c, namespace)\n\n\t// Create a PipelineRun with a single TaskRun that can only fail,\n\t// configured to retry 5 times.\n\tpipelineRunName := \"retry-pipeline\"\n\tnumRetries := 5\n\tif _, err := c.PipelineRunClient.Create(ctx, &v1beta1.PipelineRun{\n\t\tObjectMeta: metav1.ObjectMeta{Name: pipelineRunName},\n\t\tSpec: v1beta1.PipelineRunSpec{\n\t\t\tPipelineSpec: &v1beta1.PipelineSpec{\n\t\t\t\tTasks: []v1beta1.PipelineTask{{\n\t\t\t\t\tName: \"retry-me\",\n\t\t\t\t\tTaskSpec: &v1beta1.EmbeddedTask{TaskSpec: v1beta1.TaskSpec{\n\t\t\t\t\t\tSteps: []v1beta1.Step{{\n\t\t\t\t\t\t\tContainer: corev1.Container{Image: \"busybox\"},\n\t\t\t\t\t\t\tScript: \"exit 1\",\n\t\t\t\t\t\t}},\n\t\t\t\t\t}},\n\t\t\t\t\tRetries: numRetries,\n\t\t\t\t}},\n\t\t\t},\n\t\t},\n\t}, metav1.CreateOptions{}); err != nil {\n\t\tt.Fatalf(\"Failed to create PipelineRun %q: %v\", pipelineRunName, err)\n\t}\n\n\t// Wait for the PipelineRun to fail, when retries are exhausted.\n\tif err := WaitForPipelineRunState(ctx, c, pipelineRunName, 5*time.Minute, PipelineRunFailed(pipelineRunName), \"PipelineRunFailed\"); err != nil {\n\t\tt.Fatalf(\"Waiting for PipelineRun to fail: %v\", err)\n\t}\n\n\t// Get the status of the PipelineRun.\n\tpr, err := c.PipelineRunClient.Get(ctx, pipelineRunName, metav1.GetOptions{})\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to get PipelineRun %q: %v\", pipelineRunName, err)\n\t}\n\n\t// PipelineRunStatus should have 1 TaskRun status, and it should be failed.\n\tif len(pr.Status.TaskRuns) != 1 {\n\t\tt.Errorf(\"Got %d TaskRun statuses, wanted %d\", len(pr.Status.TaskRuns), numRetries)\n\t}\n\tfor taskRunName, trs := range pr.Status.TaskRuns {\n\t\tif !isFailed(t, taskRunName, trs.Status.Conditions) {\n\t\t\tt.Errorf(\"TaskRun status %q is not failed\", taskRunName)\n\t\t}\n\t}\n\n\t// There should only be one TaskRun created.\n\ttrs, err := c.TaskRunClient.List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to list TaskRuns: %v\", err)\n\t} else if len(trs.Items) != 1 {\n\t\tt.Fatalf(\"Found %d TaskRuns, want 1\", len(trs.Items))\n\t}\n\n\t// The TaskRun status should have N retriesStatuses, all failures.\n\ttr := trs.Items[0]\n\tpodNames := map[string]struct{}{}\n\tfor idx, r := range tr.Status.RetriesStatus {\n\t\tif !isFailed(t, tr.Name, r.Conditions) {\n\t\t\tt.Errorf(\"TaskRun %q retry status %d is not failed\", tr.Name, idx)\n\t\t}\n\t\tpodNames[r.PodName] = struct{}{}\n\t}\n\tpodNames[tr.Status.PodName] = struct{}{}\n\tif len(tr.Status.RetriesStatus) != numRetries {\n\t\tt.Errorf(\"TaskRun %q had %d retriesStatuses, want %d\", tr.Name, len(tr.Status.RetriesStatus), numRetries)\n\t}\n\n\t// There should be N Pods created, all failed, all owned by the TaskRun.\n\tpods, err := c.KubeClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{})\n\t// We expect N+1 Pods total, one for each failed and retried attempt, and one for the final attempt.\n\twantPods := numRetries + 1\n\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to list Pods: %v\", err)\n\t} else if len(pods.Items) != wantPods {\n\t\tt.Errorf(\"BUG: Found %d Pods, want %d\", len(pods.Items), wantPods)\n\t}\n\tfor _, p := range pods.Items {\n\t\tif _, found := podNames[p.Name]; !found {\n\t\t\tt.Errorf(\"BUG: TaskRunStatus.RetriesStatus did not report pod name %q\", p.Name)\n\t\t}\n\t\tif p.Status.Phase != corev1.PodFailed {\n\t\t\tt.Errorf(\"BUG: Pod %q is not failed: %v\", p.Name, p.Status.Phase)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "57202a35c51667fb0ccb4313977994af", "score": "0.44656304", "text": "func (m *TaskGroupRunner) runAllTasks(values map[string]interface{}, postTaskRunFn PostTaskRunFn) error {\n\tfor _, tSpec := range m.taskSpecs {\n\t\t// build a task executor\n\t\t// this is all about utilizing the meta task information\n\t\tte, err := newTaskExecutor(tSpec.identity, tSpec.metaTaskYml, tSpec.taskYml, values)\n\t\tif err != nil {\n\t\t\t// log with verbose details\n\t\t\tglog.Errorf(\"failed to execute task: identity '%s': meta yaml '%s': template values '%#v'\", tSpec.identity, tSpec.metaTaskYml, values)\n\t\t\treturn err\n\t\t}\n\n\t\t// actual task execution is done here\n\t\tresult, err := te.Execute()\n\t\tif err != nil {\n\t\t\t// log with verbose details\n\t\t\t// TODO\n\t\t\t// log with pretty print !!! Currently task yaml is logged in a readable\n\t\t\t// manner\n\t\t\tglog.Errorf(\"failed to execute task: identity '%s': meta task '%#v': task yaml '%s': template values '%#v'\", tSpec.identity, te.getMetaTaskExecutor(), tSpec.taskYml, values)\n\t\t\treturn err\n\t\t}\n\n\t\t// below are some of the housekeeping activities post the task execution\n\t\t//\n\t\t// if execution was successful then add it to rollback plans; these plans\n\t\t// will be used incase of a failure while executing the next or future\n\t\t// task(s)\n\t\t//\n\t\t// get the object that was created by this task\n\t\ttaskResults := util.GetMapOfStrings(result, tSpec.identity)\n\t\tif taskResults == nil {\n\t\t\t// log with verbose details\n\t\t\tglog.Errorf(\"failed to execute task: nil task results: identity '%s': meta task '%#v': task yaml '%s': template values: '%#v': result '%#v'\", tSpec.identity, te.getMetaTaskExecutor(), tSpec.taskYml, values, result)\n\t\t\t// return error minus verbosity\n\t\t\treturn fmt.Errorf(\"failed to execute task: nil task results: identity '%s'\", tSpec.identity)\n\t\t}\n\n\t\t// extract the name of this object\n\t\tobjName := taskResults[string(v1alpha1.ObjectNameTRTP)]\n\t\tif len(objName) == 0 {\n\t\t\t// log with verbose details\n\t\t\tglog.Errorf(\"failed to execute task: missing object name: identity '%s': meta task '%#v': task yaml '%s': template values '%#v': result: '%#v'\", tSpec.identity, te.getMetaTaskExecutor(), tSpec.taskYml, values, result)\n\t\t\t// return error minus verbosity\n\t\t\treturn fmt.Errorf(\"failed to execute task: missing object name: identity '%s'\", tSpec.identity)\n\t\t}\n\n\t\t// this is planning & not the actual rollback\n\t\tm.planForRollback(tSpec, te, objName)\n\n\t\t// executing this closure provides a way to capture the result of this task\n\t\t// into the values. This is useful to provide data to the next task before\n\t\t// this next task's execution\n\t\tpostTaskRunFn(result)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0e088d12eb445fd0b1d7b3199ede4250", "score": "0.445283", "text": "func (m *TaskGroupRunner) runAllTasks(values map[string]interface{}) (err error) {\n\tfor _, runtask := range m.allTasks {\n\t\terr = m.runATask(runtask, values)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "1a712f4a2de772c1133c52e75716acf2", "score": "0.44501895", "text": "func (consumer *Consumer) RequeueWorking() error {\n\tfor consumer.HasUnacked() {\n\t\tp, err := consumer.GetUnacked()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp.Requeue()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fd1c5762559bfade84e6a6c6aae4013b", "score": "0.44493118", "text": "func (queue *Queue) RequeueFailed() error {\n\tl := queue.GetFailedLength()\n\t// TODO implement this in lua\n\tfor l > 0 {\n\t\tanswer := queue.redisClient.RPopLPush(queue.failedName(), queue.inputName())\n\t\tif answer.Err() != nil {\n\t\t\treturn answer.Err()\n\t\t}\n\t\tqueue.redisClient.Incr(queue.inputCounterName())\n\t\tl--\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "13700ab1550e0611fab79ce093945de3", "score": "0.4440442", "text": "func (bw *BasicWorker) ScheduleTasks(driver scheduler.SchedulerDriver, offers []*mesos.Offer) {\nReadOffers:\n\tfor _, offer := range offers {\n\t\tremainingCpus := taurus.ScalarResourceVal(\"cpus\", offer.Resources)\n\t\tremainingMems := taurus.ScalarResourceVal(\"mem\", offer.Resources)\n\n\t\tlog.Println(\"Taurus Received Offer <\", offer.Id.GetValue(), \"> with cpus=\", remainingCpus, \" mem=\", remainingMems)\n\n\t\t// Map to avoid launching duplicate tasks in the same batch slice\n\t\tlaunchTaskMap := make(map[string]bool)\n\t\tlaunchTasks := make([]*mesos.TaskInfo, 0, 0)\n\t\tvar taskCpu, taskMem float64\n\t\tvar retryCount int\n\tReadTasks:\n\t\tfor {\n\t\t\ttask, err := bw.pending.ReadTask(QueueTimeout)\n\t\t\tif err != nil {\n\t\t\t\tretryCount += 1\n\t\t\t\tswitch {\n\t\t\t\tcase bw.pending.TimedOut(err):\n\t\t\t\t\tlog.Printf(\"No %s tasks available\", taurus.PENDING)\n\t\t\t\tcase bw.pending.Closed(err):\n\t\t\t\t\tbreak ReadTasks\n\t\t\t\tdefault:\n\t\t\t\t\tlog.Printf(\"Failed to read from %s queue: %s\", taurus.PENDING, err)\n\t\t\t\t}\n\t\t\t\tif retryCount == QueueRetry {\n\t\t\t\t\tbreak ReadTasks\n\t\t\t\t}\n\t\t\t\tcontinue ReadTasks\n\t\t\t}\n\t\t\tif task != nil {\n\t\t\t\ttaskId := task.Info.TaskId.GetValue()\n\t\t\t\t// Don't add the same task bwice into launchTasks slice\n\t\t\t\tif launchTaskMap[taskId] {\n\t\t\t\t\tlog.Printf(\"Skipping already queued Task %s\", taskId)\n\t\t\t\t\tcontinue ReadTasks\n\t\t\t\t}\n\t\t\t\ttaskCpu = taurus.ScalarResourceVal(\"cpus\", task.Info.Resources)\n\t\t\t\ttaskMem = taurus.ScalarResourceVal(\"mem\", task.Info.Resources)\n\t\t\t\tif remainingCpus >= taskCpu && remainingMems >= taskMem {\n\t\t\t\t\ttask.Info.SlaveId = offer.SlaveId\n\t\t\t\t\tlaunchTasks = append(launchTasks, task.Info)\n\t\t\t\t\tlaunchTaskMap[taskId] = true\n\t\t\t\t\tremainingCpus -= taskCpu\n\t\t\t\t\tremainingMems -= taskMem\n\t\t\t\t} else {\n\t\t\t\t\tbreak ReadTasks\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif len(launchTasks) > 0 {\n\t\t\tlog.Printf(\"Launching %d tasks for offer %s\", len(launchTasks), offer.Id.GetValue())\n\t\t\tlaunchStatus, err := driver.LaunchTasks(\n\t\t\t\t[]*mesos.OfferID{offer.Id},\n\t\t\t\tlaunchTasks,\n\t\t\t\t&mesos.Filters{RefuseSeconds: proto.Float64(1)})\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Mesos status: %#v Failed to launch Tasks %s: %s\", launchStatus, launchTasks, err)\n\t\t\t\tcontinue ReadOffers\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Println(\"Declining offer \", offer.Id.GetValue())\n\t\t\tdeclineStatus, err := driver.DeclineOffer(\n\t\t\t\toffer.Id,\n\t\t\t\t&mesos.Filters{RefuseSeconds: proto.Float64(1)})\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error declining offer for mesos status %#v: %s\", declineStatus, err)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "23af26c0ecee315795fde8f064a7396d", "score": "0.44384173", "text": "func (s *Scheduler) RunAllwithDelay(d int) {\n\tfor i := 0; i < s.size; i++ {\n\t\ts.jobs[i].run()\n\t\ttime.Sleep(time.Duration(d))\n\t}\n}", "title": "" }, { "docid": "f88c3df292533b09c6274971c82b7baf", "score": "0.44345942", "text": "func cleanUpTasks(ctx context.Context, que *queue.Queue){\n\tlog.Printf(\"called cleanup tasks on queue\")\n\tqr, _ := queue.NewQueueReader(que)\n\t//get the head of the queue\n\thead := qr.Next()\n\tfor {\n\t\tif head == nil {\n\t\t\t//all items in queue have been processed once , wait and then start again\n\t\t\t//dont need to run as it will consume cpu unnecessarily\n\t\t\ttime.Sleep(model.Polltime)\n\t\t\thead = qr.Next()\n\t\t\tcontinue\n\t\t}\n\t\ttask, ok := head.Value.(*model.Task)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\t//check if task needs to be removed or added to end of queue\n\t\tpushBack, remove := checkTaskStatus(ctx, task)\n\t\tif pushBack{\n\t\t\tque.RemoveElement(head)\n\t\t\tque.Enqueue(head)\n\t\t}\n\t\tif remove {\n\t\t\tque.RemoveElement(head)\n\t\t}\n\t\thead = qr.Next()\n\t}\n}", "title": "" }, { "docid": "73438b70c9f7917bc6415eea0027e89a", "score": "0.44328627", "text": "func recoverActiveTasks() {\n\tsched_ids, err := db.GetScheduledTaskIdsWithStatus(db.Active)\n\tif err == nil {\n\t\tfor _, id := range sched_ids {\n\t\t\tRunScheduledTask(id)\n\t\t}\n\t}\n\toneTime_ids, err := db.GetOneTimeTaskIdsWithStatus(db.Active)\n\tif err == nil {\n\t\tfor _, id := range oneTime_ids {\n\t\t\tRunOneTimeTask(id)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "27ff581bb62de31894c67c95a39a08f1", "score": "0.4431275", "text": "func (f *replicationTaskFetcherWorker) fetchTasks() {\n\ttimer := time.NewTimer(backoff.Jitter(\n\t\tf.config.ReplicationTaskFetcherAggregationInterval(),\n\t\tf.config.ReplicationTaskFetcherTimerJitterCoefficient(),\n\t))\n\tdefer timer.Stop()\n\n\tfor {\n\t\tselect {\n\t\tcase request := <-f.requestChan:\n\t\t\tf.bufferRequests(request)\n\n\t\tcase <-timer.C:\n\t\t\t// When timer fires, we collect all the requests we have so far and attempt to send them to remote.\n\t\t\terr := f.getMessages()\n\t\t\tif err != nil {\n\t\t\t\ttimer.Reset(backoff.Jitter(\n\t\t\t\t\tf.config.ReplicationTaskFetcherErrorRetryWait(),\n\t\t\t\t\tf.config.ReplicationTaskFetcherTimerJitterCoefficient(),\n\t\t\t\t))\n\t\t\t} else {\n\t\t\t\ttimer.Reset(backoff.Jitter(\n\t\t\t\t\tf.config.ReplicationTaskFetcherAggregationInterval(),\n\t\t\t\t\tf.config.ReplicationTaskFetcherTimerJitterCoefficient(),\n\t\t\t\t))\n\t\t\t}\n\n\t\tcase <-f.shutdownChan:\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "26645aba8919fd559ab3c8c8fbb94ddc", "score": "0.4426527", "text": "func Requeue() (*reconcile.Result, error) { return &ctrl.Result{Requeue: true}, nil }", "title": "" }, { "docid": "d3e71ca1088aadb8d0b9bb070fc8fc2d", "score": "0.44260457", "text": "func (s *Scheduler) RunAll() {\n\tfor i := 0; i < s.size; i++ {\n\t\ts.jobs[i].run()\n\t}\n}", "title": "" }, { "docid": "b36dc176f5d7f25a0bfd22039a90f947", "score": "0.44218138", "text": "func (q *Queue) CancelAll() {\n for _, state := range JOBSTATES {\n var jids []string\n for {\n jids, _ = q.Jobs(state, 0, 100)\n for _, jid := range jids {\n j, err := q.cli.GetRecurringJob(jid)\n if j != nil && err == nil {\n j.Cancel()\n }\n }\n\n if len(jids) < 100 {\n break\n }\n }\n }\n}", "title": "" }, { "docid": "e511450837aa389fa330f6202334e88b", "score": "0.4413068", "text": "func (r *Recorder) ReportRunningTaskRuns(ctx context.Context, lister listers.TaskRunLister) {\n\tlogger := logging.FromContext(ctx)\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\t// When the context is cancelled, stop reporting.\n\t\t\treturn\n\n\t\tcase <-time.After(r.ReportingPeriod):\n\t\t\t// Every 30s surface a metric for the number of running tasks.\n\t\t\tif err := r.RunningTaskRuns(lister); err != nil {\n\t\t\t\tlogger.Warnf(\"Failed to log the metrics : %v\", err)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e4d7d3d16ad66e54f64903168f019455", "score": "0.44059762", "text": "func (runCtx *RunContext) Requeue(lastAttempt bool) bool {\n\tif runCtx.monitor != nil {\n\t\trunCtx.monitor.Remove(runCtx.RunInfo.Run.AttemptID)\n\t}\n\trunCtx.attemptsLeft--\n\tif runCtx.attemptsLeft <= 0 {\n\t\trunCtx.queueManager.AddEvent(&QueueEvent{\n\t\t\tDelta: time.Now().Sub(runCtx.RunInfo.CreationTime),\n\t\t\tPriority: runCtx.RunInfo.Priority,\n\t\t\tType: QueueEventTypeAbandoned,\n\t\t})\n\t\trunCtx.Log.Error(\"run errored out too many times. giving up\", nil)\n\t\trunCtx.Close()\n\t\treturn false\n\t}\n\tif lastAttempt {\n\t\t// If this is the result of a runner successfully sending a JE verdict, it\n\t\t// _might_ be a transient problem. In any case, only attempt to run it at\n\t\t// most once more.\n\t\trunCtx.attemptsLeft = 1\n\t}\n\trunCtx.RunInfo.Run.UpdateAttemptID()\n\t// Since it was already ready to be executed, place it in the high-priority\n\t// queue.\n\tif !runCtx.queue.enqueue(runCtx, QueuePriorityHigh) {\n\t\t// That queue is full. We've exhausted all our options, bail out.\n\t\trunCtx.queueManager.AddEvent(&QueueEvent{\n\t\t\tDelta: time.Now().Sub(runCtx.RunInfo.CreationTime),\n\t\t\tPriority: runCtx.RunInfo.Priority,\n\t\t\tType: QueueEventTypeAbandoned,\n\t\t})\n\t\trunCtx.Log.Error(\"The high-priority queue is full. giving up\", nil)\n\t\trunCtx.Close()\n\t\treturn false\n\t}\n\trunCtx.queueManager.AddEvent(&QueueEvent{\n\t\tDelta: time.Now().Sub(runCtx.RunInfo.CreationTime),\n\t\tPriority: runCtx.RunInfo.Priority,\n\t\tType: QueueEventTypeRetried,\n\t})\n\treturn true\n}", "title": "" }, { "docid": "b4a6c4b0006fbab88efcb49e766d3267", "score": "0.4398986", "text": "func scheduleReconcileAllStoragePools(ctx context.Context, freq time.Duration,\n\tnTimes int, scWatchCntrl *StorageClassWatch, spController *SpController) {\n\tlog := logger.GetLogger(ctx)\n\tlog.Debugf(\"Scheduled ReconcileAllStoragePools starting\")\n\tgo func() {\n\t\ttick := time.NewTicker(freq)\n\t\tdefer tick.Stop()\n\t\tfor iteration := 0; iteration < nTimes; iteration++ {\n\t\t\titerID := \"iteration-\" + strconv.Itoa(iteration)\n\t\t\tselect {\n\t\t\tcase <-tick.C:\n\t\t\t\tlog.Debugf(\"[%s] Starting reconcile for all StoragePool instances\", iterID)\n\t\t\t\terr := ReconcileAllStoragePools(ctx, scWatchCntrl, spController)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Errorf(\"[%s] Error reconciling StoragePool instances in HostMount listener. Err: %+v\", iterID, err)\n\t\t\t\t} else {\n\t\t\t\t\tlog.Debugf(\"[%s] Successfully reconciled all StoragePool instances\", iterID)\n\t\t\t\t}\n\t\t\tcase <-ctx.Done():\n\t\t\t\tlog.Debugf(\"[%s] Done reconcile all loop for StoragePools\", iterID)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tlog.Infof(\"Scheduled ReconcileAllStoragePools completed\")\n\t}()\n\tlog.Infof(\"Scheduled ReconcileAllStoragePools started\")\n}", "title": "" }, { "docid": "b621680102bc1286b57f8560193a42bd", "score": "0.43987626", "text": "func (t *TestBackoffTimer) ScheduleRetry(err error) (int, time.Duration) {\n\t// Do nothing, we'll trigger whenever we want\n\treturn 0, 0\n}", "title": "" }, { "docid": "a09f1bd666482d888815bc797205ddde", "score": "0.4397506", "text": "func TestAllTasksFinishWithErrors(t *testing.T) {\n\n\tworkTime := time.Second\n\ttasks := []Task{func() error {\n\t\ttime.Sleep(workTime)\n\t\treturn fmt.Errorf(\"error from task 1\")\n\t}, func() error {\n\t\ttime.Sleep(workTime)\n\t\treturn fmt.Errorf(\"error from task 2\")\n\t}, func() error {\n\t\ttime.Sleep(workTime)\n\t\treturn fmt.Errorf(\"error from task 3\")\n\t}, func() error {\n\t\ttime.Sleep(workTime)\n\t\treturn fmt.Errorf(\"error from task 4\")\n\t}, func() error {\n\t\ttime.Sleep(workTime)\n\t\treturn fmt.Errorf(\"error from task 5\")\n\t}}\n\tthreadCount := 3\n\terrorLimit := 4\n\tstartTime := time.Now()\n\terr := Run(tasks, threadCount, errorLimit)\n\tendTime := time.Now()\n\n\tassert.Nil(t, err)\n\tassert.Equal(t, int(workTime.Seconds())*2, endTime.Second()-startTime.Second())\n}", "title": "" }, { "docid": "638529e2f79b7f189819048c1bb5644a", "score": "0.4397374", "text": "func processRetryJobResults(results []v1alpha1.JobRunResult, count int) v1alpha1.JobState {\n\tattempts := len(results)\n\t// For any individual job, there should always be at least a single JobRunResult. Retries are consecutive\n\t// attempts of the initial job that ended in a failure state. Therefore, the maximum number of JobRunResults\n\t// should amount to 1 + job.MaxRetries. This *must* be enforced by the ReleaseController because the\n\t// ReleasePayloadController does not care. It simply keeps track of all the results of a job that are\n\t// attributable back to a particular ReleasePayload.\n\tmaxResults := count + 1\n\n\tvar pendingJobs, successfulJobs, failedJobs, _ = interrogateJobResults(results)\n\n\tswitch {\n\tcase len(successfulJobs) > 0:\n\t\treturn v1alpha1.JobStateSuccess\n\tcase len(pendingJobs) > 0:\n\t\treturn v1alpha1.JobStatePending\n\tcase len(failedJobs) > 0:\n\t\tswitch {\n\t\tcase attempts < maxResults:\n\t\t\treturn v1alpha1.JobStatePending\n\t\tdefault:\n\t\t\treturn v1alpha1.JobStateFailure\n\t\t}\n\tdefault:\n\t\treturn v1alpha1.JobStateUnknown\n\t}\n}", "title": "" }, { "docid": "e5379bea379110497b8cdf03165a28fe", "score": "0.43934157", "text": "func (mr *Master) schedule(phase jobPhase) {\n\tvar ntasks int\n\tvar nios int // number of inputs (for reduce) or outputs (for map)\n\tswitch phase {\n\tcase mapPhase:\n\t\tntasks = len(mr.files)\n\t\tnios = mr.nReduce\n\tcase reducePhase:\n\t\tntasks = mr.nReduce\n\t\tnios = len(mr.files)\n\t}\n\n\tfmt.Printf(\"Schedule: %v %v tasks (%d I/Os)\\n\", ntasks, phase, nios)\n\n\t// All ntasks tasks have to be scheduled on workers, and only once all of\n\t// them have been completed successfully should the function return.\n\t// Remember that workers may fail, and that any given worker may finish\n\t// multiple tasks.\n\t//\n\t// TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO\n\t//\n\tallDone := make(chan int, ntasks)\n\tallTask := make(chan int, ntasks)\n\n\tfor task := 0; task < ntasks; task++ {\n\t\tallTask <- task\n\t}\n\n\t// Fork a new goroutine\n\tgo func() {\n\t\tfor true {\n\t\t\ti := <-allTask\n\t\t\tif i < 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\ttask := i\n\n\t\t\tgo func() {\n\t\t\t\tw := <-mr.registerChannel\n\n\t\t\t\ttaskargs := DoTaskArgs{mr.jobName, mr.files[task], phase, task, nios}\n\t\t\t\tok := call(w, \"Worker.DoTask\", &taskargs, new(struct{}))\n\t\t\t\tif !ok {\n\t\t\t\t\tfmt.Printf(\"Master: RPC %s[%d] dotask error: %q\\n\", w, task, ok)\n\t\t\t\t\tallDone <- task\n\t\t\t\t} else {\n\t\t\t\t\tallDone <- -1\n\t\t\t\t\tmr.registerChannel <- w\n\t\t\t\t}\n\n\t\t\t}()\n\t\t}\n\t}()\n\n\tfor task := 0; task < ntasks; task++ {\n\t\ti := <-allDone\n\t\tif i >= 0 {\n\t\t\tlog.Println(\"Retry: \", i)\n\t\t\tallTask <- i\n\t\t\ttask--\n\t\t} else {\n\t\t\tlog.Println(\"Done: \", i)\n\t\t}\n\t}\n\n\tallTask <- -1\n\n\tfmt.Printf(\"Schedule: %v phase done\\n\", phase)\n}", "title": "" }, { "docid": "54348ffafdffb4789e4057e6c5535411", "score": "0.43928283", "text": "func TestAllTasksFinishWithoutErrors(t *testing.T) {\n\n\ttasks := []Task{func() error {\n\t\treturn nil\n\t}, func() error {\n\t\treturn nil\n\t}, func() error {\n\t\treturn nil\n\t}, func() error {\n\t\treturn nil\n\t}, func() error {\n\t\treturn nil\n\t}}\n\tthreadCount := 5\n\terrorLimit := 5\n\terr := Run(tasks, threadCount, errorLimit)\n\n\tassert.Nil(t, err)\n}", "title": "" }, { "docid": "e37e07c359c180798669f1a6bc83f988", "score": "0.4391301", "text": "func (s *sender) loop() {\n\tfor p := range s.queue {\n\t\ts.backoff()\n\t\ts.sendPayload(p)\n\t}\n}", "title": "" }, { "docid": "fdfe9f32d030ec125b6bc660298a384a", "score": "0.43736038", "text": "func GetTasksFromQueue(messChannal chan<- model.SnmpSendParams,\n\t param model.CommonInitParam,\n\t sendParams model.SnmpSendParams,\n wg *sync.WaitGroup, taskCount int) {\n\n\n\tqueueInit, errOpen := amqp_serv.RabbitQueueInit(param.AmqpUrl, param.QueueName)\n\tif errOpen != nil {\n\t\tmodel.FailOnError(errOpen, \"RabbitQueueOpen - FATAL ERROR\")\n\t}\n\tdefer queueInit.Connect.Close()\n\tdefer queueInit.Channel.Close()\n\n\t// fmt.Println(queueInit)\n\n\tswitch param.AmqpFuncType {\n\tcase \"get\" :\n\n\t\tmsg, err, ok := amqp_serv.GetOneMessage(queueInit)\n\t\tif err == nil && ok {\n\t\t\tsnmpItem := amqp_serv.MessageDataConvert(msg, sendParams)\n\t\t\tmessChannal <- snmpItem\n\t\t\tprintTaskCount(taskCount, 1)\n\n\t\t} else {\n\t\t\tErrorGetTask(err)\n\t\t}\n\n\t\t//case \"consumer\" :\n\t\t//\tBasisConsumeAction(queueInit, sendParams, param)\n\t\t//\n\t\t//default:\n\t\t//\tBasisGetAction(queueInit, sendParams, param)\n\n\t}\n\n\tdefer wg.Done()\n\n}", "title": "" }, { "docid": "f73fa046c3069d4221cf6419c918f287", "score": "0.43717366", "text": "func (a *ActiveCommandChain) Retry(stage string, interval time.Duration, count int, f func(retryCount int) error) {\n\ta.Add(func() (err error) {\n\t\tvar i int\n\t\tfor err = f(i + 1); i < count && err != nil; i, err = i+1, f(i+1) {\n\t\t\tif stage != \"\" {\n\t\t\t\ta.log.Println(stage, \"...\")\n\t\t\t}\n\t\t\ttime.Sleep(interval)\n\t\t}\n\t\treturn err\n\t})\n}", "title": "" }, { "docid": "11a4367fee4c1eb151cfb746a0889e7c", "score": "0.43589872", "text": "func (t *Task) CountSimilarFailingTasks() (int, error) {\n\treturn Count(ByDifferentFailedBuildVariants(t.Revision, t.BuildVariant, t.DisplayName,\n\t\tt.Project, t.Requester))\n}", "title": "" }, { "docid": "fe3b9d46107343c7b6250081eac17029", "score": "0.43553904", "text": "func (s *peersSource) runPersistenceQueueWorkerLoop(\n\topts bootstrap.RunOptions,\n\tpersistenceQueue chan persistenceFlush,\n\tpersistFlush persist.FlushPreparer,\n\tbootstrapResult result.DataBootstrapResult,\n\tlock *sync.Mutex,\n) {\n\t// Track async cleanup tasks.\n\tasyncTasks := &sync.WaitGroup{}\n\n\t// Wait for cleanups to all occur before returning from worker.\n\tdefer asyncTasks.Wait()\n\n\t// If performing a bootstrap with persistence enabled then flush one\n\t// at a time as shard results are gathered.\n\tfor flush := range persistenceQueue {\n\t\terr := s.flush(opts, persistFlush, flush.nsMetadata, flush.shard,\n\t\t\tflush.shardResult, flush.timeRange, asyncTasks)\n\t\tif err == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Remove results and make unfulfilled if an error occurred.\n\t\ts.log.Error(\"peers bootstrapper bootstrap with persistence flush encountered error\",\n\t\t\tzap.Error(err))\n\n\t\t// Make unfulfilled.\n\t\tlock.Lock()\n\t\tunfulfilled := bootstrapResult.Unfulfilled().Copy()\n\t\tunfulfilled.AddRanges(result.NewShardTimeRanges().Set(\n\t\t\tflush.shard,\n\t\t\txtime.NewRanges(flush.timeRange),\n\t\t))\n\t\tbootstrapResult.SetUnfulfilled(unfulfilled)\n\t\tlock.Unlock()\n\t}\n}", "title": "" }, { "docid": "505b50b6e46e8bb3595621dc38edc894", "score": "0.43495733", "text": "func RetrieveAllRetryMessages(ctx context.Context, db Inquirer) ([]*bmodels.Message, error) {\n\treturn bmodels.Messages(\n\t\tbmodels.MessageWhere.Status.EQ(MessageDeliveryStatusFailed),\n\t\tbmodels.MessageWhere.RetryCount.LT(maxRetry),\n\t\tbmodels.MessageWhere.NextDeliveryTime.LT(time.Now()),\n\t\tqm.Load(bmodels.MessageRels.Merchant),\n\t).All(ctx, db)\n}", "title": "" }, { "docid": "750b57971b0a6f34f88cdaba87b3c2c8", "score": "0.43492332", "text": "func (ab *apmBacklog) flushQueueBacklog() {\n\tbuf := buffers.Get().(*bytes.Buffer)\n\n\tfor _, queue := range ab.queues {\n\t\terr := json.NewEncoder(buf).Encode(queue)\n\t\tif err != nil {\n\t\t\tlogger.Printf(\"Backlog queue failed = %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\treq, err := http.NewRequest(\n\t\t\thttp.MethodPut,\n\t\t\tfmt.Sprintf(\"%s/api/v5/projects/%d/queues-stats\",\n\t\t\t\tab.opt.APMHost, ab.opt.ProjectId),\n\t\t\tbuf,\n\t\t)\n\t\tif err != nil {\n\t\t\tlogger.Printf(\"Backlog queue failed = %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tsetRequestHeaders(req, ab.opt.ProjectKey)\n\n\t\tresp, err := ab.opt.HTTPClient.Do(req)\n\t\tif err != nil {\n\t\t\tlogger.Printf(\"Backlog queue failed = %s\", err)\n\t\t\tcontinue\n\t\t}\n\t\tdefer resp.Body.Close()\n\n\t\tif resp.StatusCode > 400 {\n\t\t\tlogger.Printf(\"Backlog queue failed = %q\", resp.Status)\n\t\t}\n\n\t\tbuf.Reset()\n\t}\n\n\tab.queues = nil\n}", "title": "" }, { "docid": "103ff5f7d1a21d399122508448ddccba", "score": "0.43479535", "text": "func initTaskStatus(ts *mo.TaskStorage) {\r\n\tfor _, task := range ts.Tasks {\r\n\t\tif task.Status == mo.StatusPending {\r\n\t\t\ttask.Status = mo.StatusError\r\n\t\t\ttask.Err = errors.New(\"app restarted\")\r\n\t\t} else if task.Status == mo.StatusRunning {\r\n\t\t\ttask.Status = mo.StatusPause\r\n\t\t\tfor _, subtask := range task.SubTasks {\r\n\t\t\t\tif subtask.Status == mo.StatusRunning {\r\n\t\t\t\t\tsubtask.Status = mo.StatusPending\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tts.Save()\r\n\t}\r\n}", "title": "" }, { "docid": "5894d4f32f41f61eae3e84317c0d0d52", "score": "0.43443316", "text": "func RetriesTask(taskName string, cmd *exec.Cmd, logPath string, opt *Params) (err error) {\n\tvar t int\n\tsuccess := false\n\tvar cmdRun exec.Cmd\n\tfor t = 0; t < opt.Retries+1; t++ {\n\t\tcmdRun = *cmd\n\t\terr := bexec.System(&cmdRun, logPath, opt.Quiet)\n\t\tif err == nil {\n\t\t\tsuccess = true\n\t\t\tbreak\n\t\t} else {\n\t\t\tif opt.Retries != 0 {\n\t\t\t\tlog.Warnf(\"Failed on attempt %d... error: %v ... retrying after %d seconds.\", t+1, err, opt.RetSleepTime)\n\t\t\t} else {\n\t\t\t\tlog.Warnf(\"Failed on attempt %d... error: %v\", t+1, err)\n\t\t\t}\n\t\t\ttime.Sleep(time.Duration(opt.RetSleepTime) * time.Second)\n\t\t}\n\t}\n\tif !success {\n\t\treturn errors.New(\"Faild to access: \" + taskName)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2c5bce9775e3ff5b8fc4818fcb1cafd8", "score": "0.43438295", "text": "func watcher(conf queueConfig) {\n\tdefer conf.pipeWg.Done()\n\twatching := []Task{}\n\twait := 2 * time.Second\n\tmaxWait := 2 * time.Minute\n\tif conf.pipe.mainnet {\n\t\tmaxWait = 5 * time.Minute\n\t}\n\treceivedAllTasks := false\n\n\tfor range time.Tick(wait) {\n\t\tincomplete := []Task{}\n\t\tsummary, err := getStorageSummary(conf)\n\t\tqueued := summary.QueuedStorageJobs\n\t\texecuting := summary.ExecutingStorageJobs\n\t\tfinal := summary.LatestFinalStorageJobs\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, task := range watching {\n\t\t\tif task.Stage < DealsComplete {\n\t\t\t\tnewStage := DealsStarting\n\t\t\t\ttask.Stage = newStage\n\t\t\t\tconf.updates <- task\n\t\t\t\tif conf.pipe.dryRun {\n\t\t\t\t\tnewStage = Complete\n\t\t\t\t\tdryRunStep()\n\t\t\t\t} else {\n\t\t\t\t\tdeals := make([]*userPb.StorageJob, 0)\n\t\t\t\t\tfor _, job := range queued {\n\t\t\t\t\t\tif job.Cid == task.CID {\n\t\t\t\t\t\t\tdeals = append(deals, job)\n\t\t\t\t\t\t\tnewStage = DealsQueued\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor _, job := range executing {\n\t\t\t\t\t\tif job.Cid == task.CID {\n\t\t\t\t\t\t\tdeals = append(deals, job)\n\t\t\t\t\t\t\tnewStage = DealsExecuting\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcompleted := 0\n\t\t\t\t\tfor _, job := range final {\n\t\t\t\t\t\tif job.Cid == task.CID {\n\t\t\t\t\t\t\tdeals = append(deals, job)\n\t\t\t\t\t\t\tnewStage = DealsComplete\n\t\t\t\t\t\t\tcompleted++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttask.Deals = deals\n\t\t\t\t\tif completed == len(deals) {\n\t\t\t\t\t\tconf.staging.Done(task.Bytes)\n\t\t\t\t\t\tnewStage = Complete\n\t\t\t\t\t} else {\n\t\t\t\t\t\tincomplete = append(incomplete, task)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttask.Stage = newStage\n\t\t\t\tconf.updates <- task\n\t\t\t}\n\t\t\tif conf.pipe.dryRun {\n\t\t\t\tconf.staging.Done(task.Bytes)\n\t\t\t\ttask.Stage = DryRunComplete\n\t\t\t\tconf.updates <- task\n\t\t\t}\n\t\t}\n\t\twatching = append(incomplete, updateWatching(conf.watch)...)\n\t\tif !receivedAllTasks {\n\t\t\treceivedAllTasks = checkReceivedAll(conf.complete)\n\t\t}\n\t\t// Allows any empty jobs or dry-runs to clean up fast.\n\t\tif wait < maxWait {\n\t\t\twait = wait * 2\n\t\t}\n\t\tif receivedAllTasks && len(watching) == 0 {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "de0ccea7664f32a60cf06ae6d9d4c69e", "score": "0.43348286", "text": "func schedule(jobName string, mapFiles []string, nReduce int, phase jobPhase, registerChan chan string) {\n\tvar ntasks int\n\tvar n_other int // number of inputs (for reduce) or outputs (for map)\n\tswitch phase {\n\tcase mapPhase:\n\t\tntasks = len(mapFiles)\n\t\tn_other = nReduce\n\tcase reducePhase:\n\t\tntasks = nReduce\n\t\tn_other = len(mapFiles)\n\t}\n\n\tfmt.Printf(\"Schedule: %v %v tasks (%d I/Os)\\n\", ntasks, phase, n_other)\n\n\t// All ntasks tasks have to be scheduled on workers. Once all tasks\n\t// have completed successfully, schedule() should return.\n\t//\n\t// Your code here (Part III, Part IV).\n\t//\n\t\n\tworkers := make([]string, 0, 10)\n\tworkStatus := make([]int, ntasks)\n\tfinishedTasks := 0\n\t\n\tsuccess := make(chan Result)\n fail := make(chan Result)\n\t\n\tdefer close(success)\n\tdefer close(fail)\n\t\n\thandleLoop:\n\tfor {\n\t\tselect {\n\t\t\tcase registerStr := <- registerChan:\n\t\t\t\tfmt.Printf(\"Register worker %s\\n\", registerStr)\n\t\t\t\twork := findUnfinishedWork(&workStatus)\n\t\t\t\tif work == -1 {\n\t\t\t\t\tworkers = append(workers, registerStr)\n\t\t\t\t} else {\n\t\t\t\t\tworkStatus[work] = 1\n\t\t\t\t\tgo dispatchTask(jobName, mapFiles, work, registerStr, n_other, phase, success, fail)\t\n\t\t\t\t}\t\t\t\t\t\n\t\t\tcase taskReturn := <- success:\n\t\t\t\tworkStatus[taskReturn.work] = 2\n\t\t\t\t\n\t\t\t\tfinishedTasks++\n\t\t\t\t\n\t\t\t\tif finishedTasks == ntasks {\n\t\t\t\t\tfmt.Println(\"All tasks finished!\")\t\n\t\t\t\t\tbreak handleLoop\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\twork := findUnfinishedWork(&workStatus)\n\t\t\t\t\tif work == -1 {\n\t\t\t\t\t\tworkers = append(workers, taskReturn.worker)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tworkStatus[work] = 1\n\t\t\t\t\t\tgo dispatchTask(jobName, mapFiles, work, taskReturn.worker, n_other, phase, success, fail)\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase taskReturn := <- fail:\n\t\t\t\tworkStatus[taskReturn.work] = 0\n\n\t\t\t\tif len(workers) == 0 {\n\t\t\t\t\tfmt.Println(\"No available workers!\")\n\t\t\t\t} else\t{\n\t\t\t\t\tworkStatus[taskReturn.work] = 1\n\t\t\t\t\tworker := workers[len(workers) - 1]\n\t\t\t\t\tworkers = workers[:len(workers) - 1]\n\t\t\t\t\tgo dispatchTask(jobName, mapFiles, taskReturn.work, worker, n_other, phase, success, fail)\n\t\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9d6a2834f2f5fba541ca056d9919eed7", "score": "0.4322408", "text": "func (cl *client) schedule(ctx context.Context, path string, queue chan<- *fetchGroup, bundleOutcomes <-chan BundleOutcome) {\n\tdefer close(queue)\n\n\tvar chunkRangeBegin uint64\n\tvar byteRangeBegin uint64\n\t// NB: for a zero-length file this being zero by default is trivially fine.\n\t// Scheduling is finished when completed is strictly = to chunk count, not chunk *index*.\n\t// That is, completing chunk 0 sets this to 1, 1 to 2 and so on.\n\tvar completedChunks uint64\n\n\tminimumBacklogDepth := uint64(0)\n\tbundleRequestInterval := 0\n\tschedulerNotify := make(chan bool, 64)\n\n\t// set cached object attributes rather than depending on zero objects to\n\t// permit client reuse\n\tcl.chunkCount = nil\n\tcl.chunkSize = nil\n\n\tfor {\n\t\tvar bundles []*ccmsg.TicketBundle\n\t\tvar err error\n\t\t// if not nil, has a Retry request\n\t\tvar retry *BundleOutcome\n\n\t\tfinishedOutcomes := false\n\t\tfor !finishedOutcomes {\n\t\t\tselect {\n\t\t\tcase bundleOutcome := <-bundleOutcomes:\n\t\t\t\tswitch bundleOutcome.Outcome {\n\t\t\t\tcase Completed:\n\t\t\t\t\tcompletedChunks = bundleOutcome.ChunkOffset + bundleOutcome.Chunks\n\t\t\t\t\tcl.l.Debugf(\"completed %d chunks at chunk %d\", bundleOutcome.Chunks, bundleOutcome.ChunkOffset)\n\t\t\t\t\t// Here is where a readahead check 'is it time to read ahead' would sit and replace the time.After heuristic\n\t\t\t\tcase Deferred:\n\t\t\t\t\t// Deferral isn't handled further down the pipeline yet.\n\t\t\t\t\tif bundleOutcome.Bundle == nil {\n\t\t\t\t\t\terr = errors.New(\"nil Bundle in Deferred bundleOutcome\")\n\t\t\t\t\t\tqueue <- &fetchGroup{err: err}\n\t\t\t\t\t\tcl.l.Error(\"encountered an error, shutting down scheduler\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\t// there is no point passing this bundle back down for\n\t\t\t\t\t// decryption etc if it has bundles from a cache we have\n\t\t\t\t\t// failed out\n\t\t\t\t\tif cl.hasFailedCaches(bundleOutcome.Bundle) {\n\t\t\t\t\t\tcl.l.Debugf(\"retrying %d deferred chunks at chunk %d\", bundleOutcome.Chunks, bundleOutcome.ChunkOffset)\n\t\t\t\t\t\tretry = &bundleOutcome\n\t\t\t\t\t\t// break out of this loop to insert a fetch group for this retry in-order\n\t\t\t\t\t\tfinishedOutcomes = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tqueue <- bundleOutcome.Bundle\n\t\t\t\t\t}\n\t\t\t\tcase Retry:\n\t\t\t\t\tcl.l.Debugf(\"retrying %d failed chunks at chunk %d\", bundleOutcome.Chunks, bundleOutcome.ChunkOffset)\n\t\t\t\t\tretry = &bundleOutcome\n\t\t\t\t\t// break out of this loop to insert a fetch group for this retry in-order\n\t\t\t\t\tfinishedOutcomes = true\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tcl.l.Debug(\"No bundle outcomes to process\")\n\t\t\t\tfinishedOutcomes = true\n\t\t\t}\n\t\t}\n\n\t\t// First iteration or have not requested the last chunk\n\t\tif cl.chunkCount == nil || chunkRangeBegin < *cl.chunkCount || retry != nil {\n\t\t\t// Have bundles to request\n\t\t\tif retry != nil {\n\t\t\t\tbundles, err = cl.requestBundles(ctx, path, retry.ChunkOffset, retry.Chunks)\n\t\t\t} else {\n\t\t\t\tbundles, err = cl.requestBundles(ctx, path, chunkRangeBegin, 0)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tqueue <- &fetchGroup{\n\t\t\t\t\terr: err,\n\t\t\t\t}\n\t\t\t\tcl.l.Error(\"encountered an error, shutting down scheduler\")\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tif completedChunks >= *cl.chunkCount {\n\t\t\t\tcl.l.Info(\"got all bundles, terminating scheduler\")\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tbundles = []*ccmsg.TicketBundle{}\n\t\t}\n\n\t\tfor _, bundle := range bundles {\n\t\t\tif func() bool {\n\t\t\t\tctx, span := trace.StartSpan(ctx, \"cachecash.com/Client/HandleBundle\")\n\t\t\t\t// It would be nice for folk reading traces to make this span\n\t\t\t\t// live until the end of decryptPuzzle, but there are many\n\t\t\t\t// termination paths to track down - so pending a full reorg of\n\t\t\t\t// this code to reduce cyclomatic complexity that would add too\n\t\t\t\t// much cognitive overhead.\n\t\t\t\tdefer span.End()\n\t\t\t\tif cl.chunkCount == nil {\n\t\t\t\t\t// Cache the chunk count to permit completion detection when retrying non-terminal blocks\n\t\t\t\t\t_count := bundle.Metadata.ChunkCount()\n\t\t\t\t\tcl.chunkCount = &_count\n\t\t\t\t\t_size := bundle.Metadata.GetChunkSize()\n\t\t\t\t\tcl.chunkSize = &_size\n\t\t\t\t} else {\n\t\t\t\t\tif bundle.Metadata.ChunkCount() != *cl.chunkCount {\n\t\t\t\t\t\terr = errors.New(\"object chunk count changed mid retrieval\")\n\t\t\t\t\t\tqueue <- &fetchGroup{err: err}\n\t\t\t\t\t\tcl.l.Error(\"encountered an error, shutting down scheduler\")\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t\tif bundle.Metadata.GetChunkSize() != *cl.chunkSize {\n\t\t\t\t\t\terr = errors.New(\"object chunk size changed mid retrieval\")\n\t\t\t\t\t\tqueue <- &fetchGroup{err: err}\n\t\t\t\t\t\tcl.l.Error(\"encountered an error, shutting down scheduler\")\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tchunks := len(bundle.TicketRequest)\n\t\t\t\tcl.l.WithFields(logrus.Fields{\n\t\t\t\t\t\"len(chunks)\": chunks,\n\t\t\t\t}).Info(\"pushing bundle to downloader\")\n\t\t\t\tif retry != nil && retry.Chunks != uint64(chunks) {\n\t\t\t\t\t// Currently we depend on the publisher giving us the entire\n\t\t\t\t\t// bundles we asked for during retry: the scheduler could\n\t\t\t\t\t// conceptually loop until we have them all\n\t\t\t\t\terr = errors.Errorf(\"Only got %d of %d chunks during retry\", chunks, retry.Chunks)\n\t\t\t\t\tqueue <- &fetchGroup{err: err}\n\t\t\t\t\tcl.l.Error(\"encountered an error, shutting down scheduler\")\n\t\t\t\t\treturn true\n\t\t\t\t}\n\n\t\t\t\t// For each chunk in TicketBundle, dispatch a request to the appropriate cache.\n\t\t\t\tchunkResults := make([]*chunkRequest, chunks)\n\n\t\t\t\tfetchGroup := &fetchGroup{\n\t\t\t\t\tbundle: bundle,\n\t\t\t\t\tnotify: []chan DownloadResult{},\n\t\t\t\t\tschedulerNotify: schedulerNotify,\n\t\t\t\t}\n\n\t\t\t\tfor i := 0; i < chunks; i++ {\n\t\t\t\t\tb := &chunkRequest{\n\t\t\t\t\t\tbundle: bundle,\n\t\t\t\t\t\tidx: i,\n\t\t\t\t\t\tparent: trace.FromContext(ctx),\n\t\t\t\t\t}\n\t\t\t\t\tchunkResults[i] = b\n\n\t\t\t\t\tci := bundle.CacheInfo[i]\n\t\t\t\t\tpubKey := ci.Pubkey.GetPublicKey()\n\t\t\t\t\tcc, err := cl.GetCacheConnection(ctx, ci.Addr.ConnectionString(), pubKey)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tcl.l.WithError(err).Error(\"failed to connect to cache\")\n\t\t\t\t\t\t// In future we should resubmit the bundle - but this is better than panicing.\n\t\t\t\t\t\tfetchGroup.err = err\n\t\t\t\t\t\tfetchGroup.bundle = nil\n\t\t\t\t\t\tqueue <- fetchGroup\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\n\t\t\t\t\tclientNotify := make(chan DownloadResult, 128)\n\t\t\t\t\tfetchGroup.notify = append(fetchGroup.notify, clientNotify)\n\n\t\t\t\t\tcc.SubmitRequest(ctx, clientNotify, b)\n\t\t\t\t}\n\n\t\t\t\tqueue <- fetchGroup\n\t\t\t\tif retry == nil {\n\t\t\t\t\tchunkRangeBegin += uint64(chunks)\n\t\t\t\t\tbyteRangeBegin += uint64(chunks) * bundle.Metadata.ChunkSize\n\t\t\t\t}\n\t\t\t\tminimumBacklogDepth = uint64(bundle.Metadata.MinimumBacklogDepth)\n\t\t\t\tbundleRequestInterval = int(bundle.Metadata.BundleRequestInterval)\n\t\t\t\treturn false\n\t\t\t}() {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tcl.waitUntilNextRequest(schedulerNotify, minimumBacklogDepth, bundleRequestInterval)\n\t}\n}", "title": "" }, { "docid": "27842b74da2bc224ddc72071a711fca6", "score": "0.43154618", "text": "func WaitJobsQueueDone(wg *sync.WaitGroup, queue ...WaitJob) {\n\tfor _, job := range queue {\n\t\tWaitSingleJobDone(wg, job)\n\t}\n}", "title": "" }, { "docid": "310559696090af5cce3514c5330f7fdd", "score": "0.43140158", "text": "func (w *TaskWorker) IncrementPending() { w.pending++ }", "title": "" }, { "docid": "b9cff8a6f7e2ab4db8752ab7201b2a82", "score": "0.43107674", "text": "func (s *Server) reapFailedEvaluations(stopCh chan struct{}) {\n\tfor {\n\t\tselect {\n\t\tcase <-stopCh:\n\t\t\treturn\n\t\tdefault:\n\t\t\t// Scan for a failed evaluation\n\t\t\teval, token, err := s.evalBroker.Dequeue([]string{failedQueue}, time.Second)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif eval == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Update the status to failed\n\t\t\tupdateEval := eval.Copy()\n\t\t\tupdateEval.Status = structs.EvalStatusFailed\n\t\t\tupdateEval.StatusDescription = fmt.Sprintf(\"evaluation reached delivery limit (%d)\", s.config.EvalDeliveryLimit)\n\t\t\ts.logger.Printf(\"[WARN] nomad: eval %#v reached delivery limit, marking as failed\", updateEval)\n\n\t\t\t// Create a follow-up evaluation that will be used to retry the\n\t\t\t// scheduling for the job after the cluster is hopefully more stable\n\t\t\t// due to the fairly large backoff.\n\t\t\tfollowupEvalWait := s.config.EvalFailedFollowupBaselineDelay +\n\t\t\t\ttime.Duration(rand.Int63n(int64(s.config.EvalFailedFollowupDelayRange)))\n\t\t\tfollowupEval := eval.CreateFailedFollowUpEval(followupEvalWait)\n\n\t\t\t// Update via Raft\n\t\t\treq := structs.EvalUpdateRequest{\n\t\t\t\tEvals: []*structs.Evaluation{updateEval, followupEval},\n\t\t\t}\n\t\t\tif _, _, err := s.raftApply(structs.EvalUpdateRequestType, &req); err != nil {\n\t\t\t\ts.logger.Printf(\"[ERR] nomad: failed to update failed eval %#v and create a follow-up: %v\", updateEval, err)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Ack completion\n\t\t\ts.evalBroker.Ack(eval.ID, token)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fce862a99a2f366399d77134b9922e36", "score": "0.43062723", "text": "func (s Service) RecalculateTasks(ctx context.Context) {\n\tw := httptest.NewRecorder()\n\tr, err := http.NewRequest(http.MethodPost, \"/\", nil)\n\tif err != nil {\n\t\tlogger.Log.WarnfCtx(ctx, recalculateTasksLog, err)\n\t}\n\n\tctx = transactionID.NewContext()\n\ts.taskCounterService.RecalculateAllCounters(w, r.WithContext(ctx))\n\n\tresp := w.Result()\n\t_, err = io.Copy(ioutil.Discard, resp.Body)\n\tif err != nil {\n\t\tlogger.Log.WarnfCtx(ctx, recalculateTasksLog, err)\n\t}\n\n\terr = resp.Body.Close()\n\tif err != nil {\n\t\tlogger.Log.WarnfCtx(ctx, recalculateTasksLog, err)\n\t}\n}", "title": "" }, { "docid": "33828e55b81b3d5d5b7ec1cdf5d63366", "score": "0.4295174", "text": "func (o AzureQueueSinkOutput) SinkRetryCount() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v AzureQueueSink) interface{} { return v.SinkRetryCount }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "a78c5b198c5e3541559c65cd5095c5a4", "score": "0.4289326", "text": "func calcScheduledTasksDuration(queue []model.TaskQueueItem) time.Duration {\n\tvar scheduledTasksDuration time.Duration\n\n\tfor _, taskQueueItem := range queue {\n\t\tscheduledTasksDuration += taskQueueItem.ExpectedDuration\n\t}\n\treturn scheduledTasksDuration\n}", "title": "" }, { "docid": "9c96b675a81ea93b99ad0f08048a04d3", "score": "0.42872038", "text": "func (qm *ServerMgr) updateQueueTask(task *Task, logTimes bool) (isQueued bool, times map[string]time.Duration, skip bool, err error) {\n\tskip = false\n\tvar taskID Task_Unique_Identifier\n\ttaskID, err = task.GetIDTimeout(\"updateQueueTask\", time.Second*1)\n\tif err != nil {\n\t\terr = nil\n\t\tskip = true\n\t\treturn\n\t}\n\n\tvar taskIDStr string\n\ttaskIDStr, _ = taskID.String()\n\n\tvar taskState string\n\ttaskState, err = task.GetStateTimeout(time.Second * 1)\n\tif err != nil {\n\t\terr = nil\n\t\tskip = true\n\t\treturn\n\t}\n\n\tswitch taskState {\n\tcase TASK_STAT_READY:\n\t\tlogger.Debug(3, \"(updateQueueTask) task %s already has state %s, continue with enqueuing\", taskIDStr, taskState)\n\tcase TASK_STAT_INIT, TASK_STAT_PENDING:\n\t\tlogger.Debug(3, \"(updateQueueTask) task %s has state %s, first check if ready\", taskIDStr, taskState)\n\n\t\tvar taskReady bool\n\t\tvar reason string\n\t\tstartIsReady := time.Now()\n\n\t\tif logTimes {\n\t\t\ttimes = make(map[string]time.Duration)\n\t\t}\n\t\ttaskReady, reason, skip, err = qm.isTaskReady(taskID, task)\n\t\tif logTimes {\n\t\t\ttimes[\"isTaskReady\"] = time.Since(startIsReady)\n\t\t}\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"(updateQueueTask) qm.isTaskReady returned: %s\", err.Error())\n\t\t\treturn\n\t\t}\n\t\tif skip {\n\t\t\treturn\n\t\t}\n\t\tif !taskReady {\n\t\t\t_ = task.SetTaskNotReadyReason(reason, true)\n\n\t\t\tlogger.Debug(3, \"(updateQueueTask) task not ready (%s): qm.isTaskReady returned reason: %s\", taskIDStr, reason)\n\t\t\treturn\n\t\t}\n\t\tlogger.Debug(3, \"(updateQueueTask) task ready (%s)\", taskIDStr)\n\n\t\t// get new state\n\t\ttaskState, err = task.GetState()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\tdefault:\n\t\tlogger.Debug(3, \"(updateQueueTask) skipping task %s , it has state %s\", taskIDStr, taskState)\n\t\treturn\n\t}\n\n\tlogger.Debug(3, \"(updateQueueTask) task: %s (state: %s, added by %s)\", taskIDStr, taskState, task.Comment)\n\n\t// task_ready\n\tif taskState != TASK_STAT_READY {\n\t\terr = fmt.Errorf(\"(updateQueueTask) task is not ready !???!?\")\n\t\treturn\n\t}\n\tlogger.Debug(3, \"(updateQueueTask) task %s is ready now, continue to enqueuing\", taskIDStr)\n\n\tvar jobID string\n\tjobID, err = task.GetJobID()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar job *Job\n\tjob, err = GetJob(jobID)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tstartEnQueue := time.Now()\n\tvar teqTimes map[string]time.Duration\n\tteqTimes, err = qm.taskEnQueue(taskID, task, job, logTimes)\n\tif logTimes {\n\t\tfor k, v := range teqTimes {\n\t\t\ttimes[k] = v\n\t\t}\n\t\ttimes[\"taskEnQueue\"] = time.Since(startEnQueue)\n\t}\n\tif err != nil {\n\t\txerr := err\n\t\terr = nil\n\n\t\tlogger.Error(\"(updateQueueTask) (taskIDStr: %s) suspending task, taskEnQueue returned: %s\", taskIDStr, xerr.Error())\n\t\terr = task.SetState(TASK_STAT_SUSPEND, true, \"updateQueueTask\")\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tjobID, err = task.GetJobID()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tvar task_str string\n\t\ttask_str, err = task.String()\n\t\tif err != nil {\n\t\t\treturn\n\n\t\t}\n\n\t\tjerror := &JobError{\n\t\t\tTaskFailed: task_str,\n\t\t\tServerNotes: fmt.Sprintf(\"failed enqueuing task %s, qm.taskEnQueue returned: %s\", taskIDStr, xerr.Error()),\n\t\t\tStatus: JOB_STAT_SUSPEND,\n\t\t}\n\t\terr = qm.SuspendJob(jobID, nil, jerror)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"(updateQueueTask) qm.SuspendJob returned: %s\", err.Error())\n\t\t\treturn\n\t\t}\n\t\terr = xerr\n\t\treturn\n\t}\n\n\tisQueued = true\n\n\tlogger.Debug(3, \"(updateQueueTask) task enqueued: %s\", taskIDStr)\n\n\treturn\n}", "title": "" }, { "docid": "8891de1ddd55108f96add6432af0630b", "score": "0.42870682", "text": "func RunTestsWithRetry(ctx context.Context, allTests []string, runTestsOnce runTestsOnceFunc, retryn int) ([]*resultsjson.Result, error) {\n\tvar allResults []*resultsjson.Result\n\tunstarted := make(map[string]struct{})\n\n\tlogging.Infof(ctx, \"Allowing up to %v retries\", retryn)\n\tretries := make(map[string]int)\n\tfor _, t := range allTests {\n\t\tunstarted[t] = struct{}{}\n\t\tretries[t] = retryn\n\t}\n\n\tfor {\n\t\t// Compute tests to run.\n\t\ttests := make([]string, 0, len(unstarted))\n\t\tfor _, t := range allTests {\n\t\t\tif _, ok := unstarted[t]; ok {\n\t\t\t\ttests = append(tests, t)\n\t\t\t}\n\t\t}\n\n\t\t// Run tests once.\n\t\tresults, err := runTestsOnce(ctx, tests)\n\t\tif err != nil {\n\t\t\tallResults = append(allResults, results...)\n\t\t\treturn allResults, err\n\t\t}\n\n\t\t// Abort to avoid infinite retries if no test ran in the last attempt.\n\t\t// Note: this needs to happen above the results modifications as if there\n\t\t// is 1 failing test & we strip that fail then we return rather than retry.\n\t\tif len(results) == 0 {\n\t\t\treturn allResults, ErrNoTestRanInLastAttempt\n\t\t}\n\n\t\t// Update the results and unstarted list based on retries/failures.\n\t\tfor _, r := range results {\n\t\t\tif len(r.Errors) > 0 && retries[r.Test.Name] > 0 {\n\t\t\t\tlogging.Infof(ctx, \"Retrying %v due to failure\", r.Test.Name)\n\t\t\t\tretries[r.Test.Name]--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tallResults = append(allResults, r)\n\t\t\tdelete(unstarted, r.Test.Name)\n\t\t}\n\n\t\t// Return success if we ran all tests and there are no more retries.\n\t\tif len(unstarted) == 0 {\n\t\t\treturn allResults, nil\n\t\t}\n\n\t\tlogging.Infof(ctx, \"Trying to run %v remaining test(s)\", len(unstarted))\n\t}\n}", "title": "" }, { "docid": "c08816e8e96d01b9b6ba5c2699bc6ca6", "score": "0.42855448", "text": "func (r *Runner) run() error {\n\tfor id, task := range r.tasks {\n\t\t// if detect interrupt signal\n\t\tif r.gotInterrupt() {\n\t\t\treturn ErrInterrupt\n\t\t}\n\t\t// execute task\n\t\ttask(id)\n\t}\n\treturn nil\n}", "title": "" } ]
27907b3313178cd53399fb2c05ef6fdc
getProtocols return map with supported protocols
[ { "docid": "7b82602383f0a79d1c3b78018caf7193", "score": "0.7955458", "text": "func getProtocols(protocols []*sslscan.Protocol) map[string]bool {\n\tvar supported = make(map[string]bool)\n\n\tfor _, protocol := range protocols {\n\t\tsupported[protocol.Name+\" \"+protocol.Version] = true\n\t}\n\n\treturn supported\n}", "title": "" } ]
[ { "docid": "492d7985c6bf4d700e17e800d44eb37a", "score": "0.691828", "text": "func RegisteredProtocols() []string {\n\tregistryLock.RLock()\n\tdefer registryLock.RUnlock()\n\tp := make([]string, 0, len(registry))\n\tfor k := range registry {\n\t\tp = append(p, k)\n\t}\n\treturn p\n}", "title": "" }, { "docid": "72e2df9bfaa00637dad7ce9181cd3daf", "score": "0.6570632", "text": "func printProtocolsInfo(details *sslscan.EndpointDetails) {\n\tprintCategoryHeader(\"Protocols\")\n\n\tsupportedProtocols := getProtocols(details.Protocols)\n\n\tfor _, protocol := range protocolList {\n\t\tfmtc.Printf(\" %-24s {s}|{!} \", protocol)\n\n\t\tswitch {\n\t\tcase protocol == \"TLS 1.2\":\n\t\t\tif supportedProtocols[protocol] {\n\t\t\t\tfmtc.Println(\"{g}Yes{!}\")\n\t\t\t} else {\n\t\t\t\tfmtc.Println(\"{y}No{!}\")\n\t\t\t}\n\t\tcase protocol == \"SSL 3.0\" && supportedProtocols[protocol]:\n\t\t\tfmtc.Printf(\"{r}%s{!}\\n\", getBool(supportedProtocols[protocol]))\n\t\tcase protocol == \"SSL 2.0\" && supportedProtocols[protocol]:\n\t\t\tfmtc.Printf(\"{r}%s{!}\\n\", getBool(supportedProtocols[protocol]))\n\t\tdefault:\n\t\t\tfmtc.Printf(\"%s\\n\", getBool(supportedProtocols[protocol]))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cabbd85367023342267e0c1999bc0811", "score": "0.6515967", "text": "func SupportedProtocols(protos []protocol.ID) NetOpt {\n\treturn libipfs.SupportedProtocols(protos)\n}", "title": "" }, { "docid": "19f18471100830069e8f2cad469ced56", "score": "0.64159375", "text": "func (s *Service) Protocols() []p2p.Protocol {\n\tprotos := make([]p2p.Protocol, len(ProtocolVersions))\n\tfor i, vsn := range ProtocolVersions {\n\t\tprotos[i] = s.pm.makeProtocol(vsn)\n\t\tprotos[i].Attributes = []enr.Entry{s.currentEnr()}\n\t}\n\treturn protos\n}", "title": "" }, { "docid": "8872c185ec51f4c80667695f024c9f68", "score": "0.6273397", "text": "func All() map[string]Protocol {\n\tm.Lock()\n\tdefer m.Unlock()\n\tprotocols := map[string]Protocol{}\n\tfor name, p := range registry {\n\t\tprotocols[name] = p\n\t}\n\treturn protocols\n}", "title": "" }, { "docid": "f3fda8b572a625f103ac0f47498b2a8e", "score": "0.6227762", "text": "func PossibleProtocolValues() []Protocol {\n\treturn []Protocol{Encrypted, Plaintext}\n}", "title": "" }, { "docid": "c657ca2caf965dc1c91af7bc44b5449c", "score": "0.61870694", "text": "func (o RouteInfoResponseOutput) Protocols() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v RouteInfoResponse) []string { return v.Protocols }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "7126514a9a980fbf257ebe64058b9ec2", "score": "0.6038261", "text": "func (s *Ethereum) Protocols() []p2p.Protocol {\n\treturn s.protocolManager.SubProtocols\n}", "title": "" }, { "docid": "9ef817c5a0bf4f483addba485f927378", "score": "0.6031035", "text": "func Protocol_Values() []string {\n\treturn []string{\n\t\tProtocolMqtt,\n\t\tProtocolHttp,\n\t}\n}", "title": "" }, { "docid": "23420b181de9d7501e53c3a7f6660dbf", "score": "0.6010187", "text": "func (s *DeviceService) GetNetworkProtocols() (res tds.GetNetworkProtocolsResponse, err error) {\n\terr = s.Client.Call(tds.GetNetworkProtocols{}, &res)\n\treturn\n}", "title": "" }, { "docid": "7b0ec01d15dd9315da9e07af34db374a", "score": "0.5973009", "text": "func (svc Service) ApplicationProtocols() (map[string]AppProtocol, error) {\n\tval, ok := svc.v[ServiceApplicationProtocolKey]\n\tif !ok {\n\t\treturn map[string]AppProtocol{}, nil\n\t}\n\n\tvar portToProtos map[string]AppProtocol\n\terr := json.Unmarshal([]byte(val), &portToProtos)\n\n\t// Verify protocol is an accepted value\n\tfor _, proto := range portToProtos {\n\t\tswitch proto {\n\t\tcase ProtocolHTTP, ProtocolHTTPS:\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"invalid port application protocol: %v\", proto)\n\t\t}\n\t}\n\n\treturn portToProtos, err\n}", "title": "" }, { "docid": "6f193d429fae74250640ea3eca75259f", "score": "0.59532493", "text": "func (r AlgodReceiver) Supports() map[string]bool {\n\tm := map[string]bool{}\n\tfor _, np := range r.EnabledProtocolNetworks.Get() {\n\t\tm[np] = true\n\t}\n\treturn m\n}", "title": "" }, { "docid": "333ca8283c23cb252b869c2be529f93d", "score": "0.59384334", "text": "func (o GetCustomRoutingEndpointGroupDestinationsResultOutput) Protocols() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetCustomRoutingEndpointGroupDestinationsResult) []string { return v.Protocols }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "8b2cae52b3009190cda2195f03128f6a", "score": "0.5889557", "text": "func (s *Entropy) Protocols() []p2p.Protocol {\n\tprotos := ent.MakeProtocols((*entropyHandler)(s.handler), s.networkID, s.ethDialCandidates)\n\tif s.config.SnapshotCache > 0 {\n\t\tprotos = append(protos, snap.MakeProtocols((*snapHandler)(s.handler), s.snapDialCandidates)...)\n\t}\n\treturn protos\n}", "title": "" }, { "docid": "9d850b95818b311611c5045924d6cf02", "score": "0.5830565", "text": "func ListProtocols(client *gophercloud.ServiceClient) pagination.Pager {\n\turl := protocolsURL(client)\n\treturn pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page {\n\t\treturn ProtocolPage{pagination.SinglePageBase(r)}\n\t})\n}", "title": "" }, { "docid": "46c83d80df598555bac5c8c6c8b236b0", "score": "0.5815154", "text": "func PossibleProtocolValues() []Protocol {\n\treturn []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolWs, ProtocolWss}\n}", "title": "" }, { "docid": "5c0f1d27ab4fac103b38ac6aea4ff05d", "score": "0.58128935", "text": "func Subprotocols(r *http.Request) []string {\n\th := strings.TrimSpace(r.Header.Get(\"Sec-Websocket-Protocol\"))\n\tif h == \"\" {\n\t\treturn nil\n\t}\n\tprotocols := strings.Split(h, \",\")\n\tfor i := range protocols {\n\t\tprotocols[i] = strings.TrimSpace(protocols[i])\n\t}\n\treturn protocols\n}", "title": "" }, { "docid": "1cc38dfd96843cb42237074e8e167af8", "score": "0.5808263", "text": "func (o PacketMirroringFilterResponseOutput) IpProtocols() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v PacketMirroringFilterResponse) []string { return v.IpProtocols }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "28e52d05b9e126f59e2091a317fd90f9", "score": "0.5784581", "text": "func (o PacketMirroringFilterOutput) IpProtocols() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v PacketMirroringFilter) []string { return v.IpProtocols }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "58754231d2dcc82106aebf57ae703644", "score": "0.5760632", "text": "func (o PacketMirroringFilterPtrOutput) IpProtocols() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *PacketMirroringFilter) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.IpProtocols\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "b3a84af3396fc972248695b873b81654", "score": "0.57563263", "text": "func (c Config) GetProtocolDef(name string) *ProtocolConf {\n\tfor _, prot := range c.Server.Protocols {\n\t\tif prot.Name == name {\n\t\t\treturn prot\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1916196f76fb205195db7c8a94069272", "score": "0.5735408", "text": "func (o GetHostsHostOutput) Protocols() GetHostsHostProtocolArrayOutput {\n\treturn o.ApplyT(func(v GetHostsHost) []GetHostsHostProtocol { return v.Protocols }).(GetHostsHostProtocolArrayOutput)\n}", "title": "" }, { "docid": "b8b49d496c77b1e3c7565e1bdc70b91f", "score": "0.5735326", "text": "func PossibleProtocolTypeValues() []ProtocolType {\n return []ProtocolType{HTTPS,SSH,TCP,WebSocket}\n }", "title": "" }, { "docid": "e859514eaf32aee21e05395e4142d208", "score": "0.57291305", "text": "func (o *NvmeInterfaceInfoType) TransportProtocols() NvmeInterfaceInfoTypeTransportProtocols {\n\tvar r NvmeInterfaceInfoTypeTransportProtocols\n\tif o.TransportProtocolsPtr == nil {\n\t\treturn r\n\t}\n\tr = *o.TransportProtocolsPtr\n\treturn r\n}", "title": "" }, { "docid": "ceae97c14752c612dde92a50359b89be", "score": "0.57231694", "text": "func (m *NetworkConnection) GetProtocol()(*SecurityNetworkProtocol) {\n return m.protocol\n}", "title": "" }, { "docid": "18b7f7b77190b06bc0b386ea2acb97ff", "score": "0.5721458", "text": "func PossibleEnabledProtocolsValues() []EnabledProtocols {\n\treturn []EnabledProtocols{EnabledProtocolsNFS, EnabledProtocolsSMB}\n}", "title": "" }, { "docid": "e730664bb7723003badc256c9cc861e3", "score": "0.5718761", "text": "func MapProtocolHandlers(log Logger, h Honeypot) map[string]HandlerFunc {\n\tprotocolHandlers := map[string]HandlerFunc{}\n\tprotocolHandlers[\"smtp\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleSMTP(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"rdp\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleRDP(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"smb\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleSMB(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"ftp\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleFTP(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"sip\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleSIP(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"rfb\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleRFB(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"telnet\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleTelnet(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"mqtt\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleMQTT(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"bittorrent\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleBittorrent(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"memcache\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleMemcache(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"jabber\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleJabber(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"adb\"] = func(ctx context.Context, conn net.Conn) error {\n\t\treturn HandleADB(ctx, conn, log, h)\n\t}\n\tprotocolHandlers[\"default\"] = func(ctx context.Context, conn net.Conn) error {\n\t\tsnip, bufConn, err := Peek(conn, 4)\n\t\tif err != nil {\n\t\t\tif err := conn.Close(); err != nil {\n\t\t\t\tlog.Error(\"failed to close connection\", zap.Error(err))\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\t// poor mans check for HTTP request\n\t\thttpMap := map[string]bool{\"GET \": true, \"POST\": true, \"HEAD\": true, \"OPTI\": true, \"CONN\": true}\n\t\tif _, ok := httpMap[strings.ToUpper(string(snip))]; ok {\n\t\t\treturn HandleHTTP(ctx, bufConn, log, h)\n\t\t}\n\t\t// fallback TCP handler\n\t\treturn HandleTCP(ctx, bufConn, log, h)\n\t}\n\treturn protocolHandlers\n}", "title": "" }, { "docid": "f8f3e048d0c1f457d8cefa28de6aa233", "score": "0.5655914", "text": "func ListenerProtocol_Values() []string {\n\treturn []string{\n\t\tListenerProtocolHttp,\n\t\tListenerProtocolHttps,\n\t}\n}", "title": "" }, { "docid": "1a706b7e770c85dd969170b3f98d7ea8", "score": "0.56444424", "text": "func (h *NatVppHandler) getProtocol(protocol uint8) (proto nat.Protocol) {\n\tswitch protocol {\n\tcase TCP:\n\t\treturn nat.Protocol_TCP\n\tcase UDP:\n\t\treturn nat.Protocol_UDP\n\tcase ICMP:\n\t\treturn nat.Protocol_ICMP\n\tdefault:\n\t\th.log.Warnf(\"Unknown protocol %v\", protocol)\n\t\treturn 0\n\t}\n}", "title": "" }, { "docid": "8d61ea55f0940f81fccab9af887b3fc6", "score": "0.56327826", "text": "func OptionProtocols(protocols ...DownloadProtocol) Option {\n\tpp := make(map[string]DownloadProtocol, len(protocols))\n\tfor _, p := range protocols {\n\t\tpp[p.Protocol()] = p\n\t}\n\n\treturn func(r *Registry) {\n\t\tr.protocols = pp\n\t}\n}", "title": "" }, { "docid": "6fdf17c1e80ad1fec0d2fe17fc0ffac3", "score": "0.56248456", "text": "func PossibleProbeProtocolValues() []ProbeProtocol {\n\treturn []ProbeProtocol{\n\t\tProbeProtocolHTTP,\n\t\tProbeProtocolHTTPS,\n\t\tProbeProtocolTCP,\n\t}\n}", "title": "" }, { "docid": "9ad616ed999c097b16ca827e5dd9ef2c", "score": "0.55763274", "text": "func ExtractProtocolNames(anns map[string]string) []string {\n\tval := valueFromAnnotation(protocolsKey, anns)\n\treturn strings.Split(val, \",\")\n}", "title": "" }, { "docid": "1c6f7b5ff712bda6935a268228f95534", "score": "0.55748373", "text": "func PossibleProbeProtocolValues() []ProbeProtocol {\n\treturn []ProbeProtocol{\n\t\tProbeProtocolNotSet,\n\t\tProbeProtocolHTTP,\n\t\tProbeProtocolHTTPS,\n\t}\n}", "title": "" }, { "docid": "8afb22df75dc146fd088aa1ea84de61e", "score": "0.55590624", "text": "func (session *Session) SupportProtocol(protocol string) bool {\n\tfor _, supportedProtocol := range session.SupportedProtocols {\n\t\tif protocol == supportedProtocol {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7d678984c43e37ebdc0437461d93661e", "score": "0.55549484", "text": "func (r Registry) PreferProtocol(protocols ...string) Drivers {\n\tvar final Drivers\n\tvar leftOver Drivers\n\ttracking := make(map[int]Drivers)\n\tprotocols = deduplicate(protocols)\n\tfor _, registry := range r.Drivers {\n\t\tvar movedToTracking bool\n\t\tfor index, pName := range protocols {\n\t\t\tif strings.EqualFold(registry.Protocol, pName) {\n\t\t\t\ttracking[index] = append(tracking[index], registry)\n\t\t\t\tmovedToTracking = true\n\t\t\t}\n\t\t}\n\t\tif !movedToTracking {\n\t\t\tleftOver = append(leftOver, registry)\n\t\t}\n\t}\n\tfor x := 0; x <= len(tracking); x++ {\n\t\tfinal = append(final, tracking[x]...)\n\t}\n\tfinal = append(final, leftOver...)\n\treturn final\n}", "title": "" }, { "docid": "aa8992fef4bf2627bdfb3e73722773ee", "score": "0.5547922", "text": "func getProtocol(value *thrift_any.Any) *protocol.ProtocolStruct {\n\treturn &protocol.ProtocolStruct{\n\t\tStandard: value.GetProtocol(),\n\t\tCustom: value.CustomProtocol,\n\t}\n}", "title": "" }, { "docid": "d4dd489142d46d42b0859d75bd247854", "score": "0.55246663", "text": "func RegisteredProtocol(protocol string) (Protocol, []string) {\n\tregistryLock.RLock()\n\te := registry[protocol]\n\tregistryLock.RUnlock()\n\treturn e.obj, e.p\n}", "title": "" }, { "docid": "890f51389181a4cce3e3f771c717f71f", "score": "0.5519411", "text": "func (pf protocolFactory) GetProtocol(name string) protocol.ConnectionProtocol {\n\n\tswitch name {\n\tcase \"supplicant\":\n\t\treturn supplicant.Protocol{}\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "9f8997421db9d5d5eea6d7a9eecea289", "score": "0.5499878", "text": "func (r *ChannelRegistrar) ChannelsForProtocol(protocol proto.Protocol) sets.String {\n\tif protocol.GreaterEqual(proto.Minecraft_1_13) {\n\t\treturn r.ModernChannelIds()\n\t}\n\treturn r.LegacyChannelIds()\n}", "title": "" }, { "docid": "52cd4a035674f5ef8dedec2b0deda5a0", "score": "0.5496844", "text": "func getTLSProtocol(protocol string) uint16 {\n\tswitch protocol {\n\tcase \"TLSv1\":\n\t\treturn tls.VersionTLS10\n\tcase \"TLSv1.1\":\n\t\treturn tls.VersionTLS11\n\tcase \"TLSv1.2\":\n\t\treturn tls.VersionTLS12\n\tcase \"TLSv1.3\":\n\t\treturn tls.VersionTLS13\n\tdefault:\n\t\tlogrus.Debugf(\"%s is an unsupported TLS protocol version. use default: %s\", protocol, defaultTLSVer)\n\t\treturn tls.VersionTLS12 // the default TLS protocol is TLSv1.2\n\t}\n}", "title": "" }, { "docid": "2e0c5279e63d165cd27faa539d47ffc0", "score": "0.543293", "text": "func getProtocolFactory(protoc *protocol.ProtocolStruct) (thrift.ProtocolFactory, error) {\n\tswitch protoc.GetStandard() {\n\tcase protocol.StandardProtocol_Custom:\n\tcase protocol.StandardProtocol_Binary:\n\t\treturn thrift.NewBinaryProtocolFactoryDefault(), nil\n\tcase protocol.StandardProtocol_Compact:\n\t\treturn thrift.NewCompactProtocolFactory(), nil\n\tcase protocol.StandardProtocol_Json:\n\t\treturn thrift.NewSimpleJSONProtocolFactory(), nil\n\tcase protocol.StandardProtocol_SimpleJson:\n\t\treturn thrift.NewJSONProtocolFactory(), nil\n\t}\n\t// default value in case the protocol is unknown, as seen in the java implementation of conformance tests.\n\treturn thrift.NewCompactProtocolFactory(), nil\n}", "title": "" }, { "docid": "ded9bf3189670f872aaa632216d6c787", "score": "0.54235774", "text": "func getSupportedCipherAlgo() map[CipherAlgoType]CipherAlgoValues {\n\tret := map[CipherAlgoType]CipherAlgoValues{}\n\tlen := C.size_t(0)\n\talgos := C.get_supported_cipher_algos(&len)\n\tslice := (*[1 << 30]C.struct_supported_cipher_algo)(unsafe.Pointer(algos))[:len]\n\tfor _, a := range slice {\n\t\tk := CipherAlgoType(a.algo)\n\t\tv := CipherAlgoValues{\n\t\t\tIvLen: uint16(a.iv_len),\n\t\t\tBlockSize: uint16(a.block_size),\n\t\t\tKeyLen: uint16(a.key_len),\n\t\t\tKeyword: C.GoString(a.keyword),\n\t\t}\n\t\tret[k] = v\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "5c312487a9e33c654c219930b4c3bcdb", "score": "0.5407064", "text": "func PossibleMonitorProtocolValues() []MonitorProtocol {\n\treturn []MonitorProtocol{HTTP, HTTPS, TCP}\n}", "title": "" }, { "docid": "ffc9779325dab5e93d1f71d9eb37c357", "score": "0.53760654", "text": "func PossibleBackendProtocolValues() []BackendProtocol {\n\treturn []BackendProtocol{BackendProtocolHTTP, BackendProtocolSoap}\n}", "title": "" }, { "docid": "5299b31dbd3dadae7883d2e72f7fb391", "score": "0.5371625", "text": "func (c *ChainServerConfigProvider) GetUseHttpsProtocol() (bool, bool) {\n\tfor _, provider := range c.chain {\n\t\tval, ok := provider.GetUseHttpsProtocol()\n\t\tif ok {\n\t\t\treturn val, true\n\t\t}\n\t}\n\tpanic(\"There is no https protocol info found!\")\n\treturn false, false\n}", "title": "" }, { "docid": "f02f4dddec47fde4829bec01772c908c", "score": "0.5341046", "text": "func (o InsightFiltersPtrOutput) NetworkProtocols() InsightFiltersNetworkProtocolArrayOutput {\n\treturn o.ApplyT(func(v *InsightFilters) []InsightFiltersNetworkProtocol {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.NetworkProtocols\n\t}).(InsightFiltersNetworkProtocolArrayOutput)\n}", "title": "" }, { "docid": "f736717fe942594764aa465320ac359d", "score": "0.53022176", "text": "func GetProtocol(route routev1.Route, ingress iextensionsv1.Ingress) string {\n\tif !reflect.DeepEqual(ingress, iextensionsv1.Ingress{}) && ingress.Spec.TLS != nil {\n\t\treturn \"https\"\n\t} else if !reflect.DeepEqual(route, routev1.Route{}) && route.Spec.TLS != nil {\n\t\treturn \"https\"\n\t}\n\treturn \"http\"\n}", "title": "" }, { "docid": "a85b8dccd232e5e14c60093a63d08cbc", "score": "0.5301976", "text": "func PossibleAFDEndpointProtocolsValues() []AFDEndpointProtocols {\n\treturn []AFDEndpointProtocols{\n\t\tAFDEndpointProtocolsHTTP,\n\t\tAFDEndpointProtocolsHTTPS,\n\t}\n}", "title": "" }, { "docid": "52976bc04d44540efce7977c6e8547a4", "score": "0.53003365", "text": "func PossibleHTTPProtocolValues() []HTTPProtocol {\n\treturn []HTTPProtocol{HTTPProtocolHTTPS, HTTPProtocolHttpshttp}\n}", "title": "" }, { "docid": "dadaaf6b18a9e55aaca2d12b72c1724e", "score": "0.52835613", "text": "func getSupportedApis() map[string]struct{} {\n\tcmd := exec.Command(\"kubectl\", \"api-versions\")\n\n\tcmdOutput := &bytes.Buffer{}\n\tcmd.Stdout = cmdOutput\n\tcmdError := &bytes.Buffer{}\n\tcmd.Stderr = cmdError\n\terr := cmd.Run()\n\tif err != nil {\n\t\t//return err\n\t}\n\tsupportedApiList := strings.Split(cmdOutput.String(), \"\\n\")\n\tsupportedApisMap := make(map[string]struct{}, len(supportedApiList))\n\tfor _, s := range supportedApiList {\n\t\ts = strings.Trim(s, \" \")\n\t\tif len(s) > 0 {\n\t\t\tsupportedApisMap[s] = struct{}{}\n\t\t}\n\t}\n\treturn supportedApisMap\n}", "title": "" }, { "docid": "c82da14308b41bb0de470181a67ceb0b", "score": "0.5274777", "text": "func (m *Cluster) GetExtensionProtocolOptions() map[string]*_struct.Struct {\n\tif m != nil {\n\t\treturn m.ExtensionProtocolOptions\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7408dd7851f5b52524e8897ee253afac", "score": "0.5268709", "text": "func (r Registry) Using(proto string) Drivers {\n\tvar supportedRegistries Drivers\n\tfor _, reg := range r.Drivers {\n\t\tif reg.Protocol == proto {\n\t\t\tsupportedRegistries = append(supportedRegistries, reg)\n\t\t}\n\t}\n\treturn supportedRegistries\n}", "title": "" }, { "docid": "4247a6b29a3341345694dc57d2f8fbfe", "score": "0.5265294", "text": "func (o InsightFiltersOutput) NetworkProtocols() InsightFiltersNetworkProtocolArrayOutput {\n\treturn o.ApplyT(func(v InsightFilters) []InsightFiltersNetworkProtocol { return v.NetworkProtocols }).(InsightFiltersNetworkProtocolArrayOutput)\n}", "title": "" }, { "docid": "2797309a8603e55197263c19bcf3ee6f", "score": "0.5260087", "text": "func PossibleSSLProtocolValues() []SSLProtocol {\n\treturn []SSLProtocol{\n\t\tSSLProtocolTLSv1,\n\t\tSSLProtocolTLSv11,\n\t\tSSLProtocolTLSv12,\n\t}\n}", "title": "" }, { "docid": "fb3773c92f3f80001102bfbe3c8c48bc", "score": "0.5248147", "text": "func (p *Profile) GetInterfaces() (map[string]*dproto.Interface, error) {\n\tp.Log(\"Starting CiscoIOS.GetInterfaces()\")\n\tinterfaces := make(map[string]*dproto.Interface)\n\n\tpatterns := make(map[string]string)\n\t/*patterns[\"ports\"] = `(?m:^(\\s+)?(?P<ifname>.+?)\\s+is(?:\\s+administratively)?\\s+`+\n\t\t\t\t\t\t`(?P<admin>up|down),\\s+line\\s+protocol\\s+is\\s+`+\n\t\t\t\t\t\t`(?P<oper>up|down)(\\s+)?(?:\\((?:connected|notconnect|disabled|monitoring|err-disabled)\\)\\s*)?\\n\\s+`+\n\t\t\t\t\t\t`(.*)address is (?P<mac>([0-9A-Fa-f]){4}\\.([0-9A-Fa-f]){4}\\.([0-9A-Fa-f]){4})(.*)\\n`+\n\t\t\t\t\t\t`(?:\\s+Description:\\s(?P<desc>[^\\n]+)\\n)?(?:\\s+Internet address ((is\\s(?P<ip>\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\/\\d{1,2}))|([^\\d]+))(\\s+)?\\n)?[^\\n]+\\n[^\\n]+\\n\\s+`+\n\t\t\t\t\t\t`Encapsulation\\s+(?P<encaps>[^\\n]+))`*/\n\tpatterns[\"ifname\"] = `^(?P<type>[a-z]{2})[a-z\\-]*\\s*(?P<number>\\d+(/\\d+(/\\d+)?)?(\\.\\d+(/\\d+)*(\\.\\d+)?)?(:\\d+(\\.\\d+)*)?(/[a-z]+\\d+(\\.\\d+)?)?(A|B)?)$`\n\tpatterns[\"name\"] = `(?m:^(\\s+)?(?P<ifname>.+?)\\s+is(?:\\s+administratively)?\\s+(?P<admin>up|down),\\s+line\\s+protocol\\s+is\\s+(?P<oper>up|down)(\\s+)?)`\n\tpatterns[\"desc\"] = `(?m:^\\s+Description:\\s+(?P<desc>[^\\n]+)\\n)`\n\tpatterns[\"lldp\"] = `(?mis:^(?P<iface>(?:Fa|Gi|Te)[^:]+?):)`\n\tregexps, err := p.CompileRegexps(patterns)\n\tif err != nil {\n\t\treturn interfaces, err\n\t}\n\n\t// First get portchannels\n\tpos, err := p.GetPortchannels()\n\tif err != nil {\n\t\tp.Log(\"Error getting portchannels: %s\", err.Error())\n\t\treturn interfaces, nil\n\t}\n\t//return interfaces, fmt.Errorf(\"test\")\n\n\t// Then get interfaces\n\tresult, err := p.Cli.Cmd(\"show interface\")\n\tif err != nil {\n\t\treturn interfaces, errors.Wrap(err, \"Cannot get interfaces data\")\n\t}\n\tp.Debug(result)\n\n\tparts, err := text.SplitByParts(result, `(?msi:^[^\\s]+\\s+is (administratively )?(up|down), line)`)\n\tif err != nil {\n\t\treturn interfaces, errors.Wrap(err, \"Cannot split output by parts\")\n\t}\n\n\tfor _, part := range parts {\n\t\tout := p.ParseSingle(regexps[\"name\"], part)\n\t\tifname := strings.Trim(out[\"ifname\"], \" \")\n\t\tif ifname == \"\" {\n\t\t\tp.Log(\"Error: empty interface name!\")\n\t\t\tcontinue\n\t\t}\n\n\t\tshortname, err := p.ConvertIfname(ifname, regexps[\"ifname\"])\n\t\tif err != nil {\n\t\t\tp.Log(err.Error())\n\t\t}\n\n\t\tout = p.ParseSingle(regexps[\"desc\"], part)\n\t\tdesc := strings.Trim(out[\"desc\"], \" \")\n\n\t\tiftype := p.GetInterfaceType(shortname)\n\t\tnewInt := dproto.Interface{\n\t\t\tName:ifname,\n\t\t\tShortname:shortname,\n\t\t\tType:iftype,\n\t\t\tLldpID:ifname,\n\t\t\tDescription:desc,\n\t\t}\n\t\tif iftype == dproto.InterfaceType_AGGREGATED {\n\t\t\tif po, ok := pos[shortname]; ok {\n\t\t\t\tnewInt.PoMembers = po\n\t\t\t} else {\n\t\t\t\tp.Log(\"WARNING! Cannot find port-channel details for '%s'!\", shortname)\n\t\t\t}\n\t\t}\n\t\t/*if iftype == dproto.InterfaceType_TUNNEL {\n\t\t\tcontinue\n\t\t}\n\t\tp.Debug(\"%s\", part)*/\n\n\t\tinterfaces[ifname] = &newInt\n\t}\n\n\t/*\n\tports := p.ParseMultiple(regexps[\"ports\"], result)\n\tfor _, port := range ports {\n\t\tifname := port[\"ifname\"]\n\t\tif ifname == \"\" {\n\t\t\tp.Log(\"Error: empty interface name!\")\n\t\t\tcontinue\n\t\t}\n\t\tifname, err = p.ConvertIfname(port[\"ifname\"], regexps[\"ifname\"])\n\t\tif err != nil {\n\t\t\tp.Log(err.Error())\n\t\t}\n\n\t\tiftype := p.GetInterfaceType(ifname)\n\t\tnewInt := dproto.Interface{\n\t\t\tName: strings.Trim(port[\"ifname\"], \" \"),\n\t\t\tShortname: ifname,\n\t\t\tDescription: strings.Trim(port[\"desc\"], \" \"),\n\t\t\tType:iftype,\n\t\t\tLldpID:strings.Trim(port[\"ifname\"], \" \"),\n\t\t}\n\t\tif iftype == dproto.InterfaceType_AGGREGATED {\n\t\t\tif po, ok := pos[ifname]; ok {\n\t\t\t\tnewInt.PoMembers = po\n\t\t\t} else {\n\t\t\t\tp.Log(\"WARNING! Cannot find port-channel details for '%s'!\", ifname)\n\t\t\t}\n\t\t}\n\n\t\tinterfaces[ifname] = &newInt\n\t}\n\t*/\n\n\treturn interfaces, nil\n}", "title": "" }, { "docid": "725e76575434d80344b638b16ca29369", "score": "0.5227772", "text": "func (a *app) EndpointsForProtocol(protocol model.Protocol) []environment.DeployedAppEndpoint {\n\tout := make([]environment.DeployedAppEndpoint, 0)\n\tfor _, e := range a.endpoints {\n\t\tif e.Protocol() == protocol {\n\t\t\tout = append(out, e)\n\t\t}\n\t}\n\treturn out\n}", "title": "" }, { "docid": "dba5675d01926daa0dbce51bb5b13d95", "score": "0.5211746", "text": "func Protocol() (uint8, uint8, error) {\n\treturn pkgHandle.Protocol()\n}", "title": "" }, { "docid": "991161a7072332af3cb7da93e271219c", "score": "0.5192323", "text": "func (o StreamingPolicyCommonEncryptionCencPtrOutput) EnabledProtocols() StreamingPolicyCommonEncryptionCencEnabledProtocolsPtrOutput {\n\treturn o.ApplyT(func(v *StreamingPolicyCommonEncryptionCenc) *StreamingPolicyCommonEncryptionCencEnabledProtocols {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.EnabledProtocols\n\t}).(StreamingPolicyCommonEncryptionCencEnabledProtocolsPtrOutput)\n}", "title": "" }, { "docid": "0e0f9cd740a7f34bcb91118c1788b856", "score": "0.5181523", "text": "func (o StreamingPolicyCommonEncryptionCbcsPtrOutput) EnabledProtocols() StreamingPolicyCommonEncryptionCbcsEnabledProtocolsPtrOutput {\n\treturn o.ApplyT(func(v *StreamingPolicyCommonEncryptionCbcs) *StreamingPolicyCommonEncryptionCbcsEnabledProtocols {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.EnabledProtocols\n\t}).(StreamingPolicyCommonEncryptionCbcsEnabledProtocolsPtrOutput)\n}", "title": "" }, { "docid": "4d46fc507079fb9d7581055a8f1055a8", "score": "0.5181506", "text": "func (c *MuxConn) PeekProtocol() string {\n\tvar n int\n\tn, c.lastError = c.Conn.Read(c.dataBuf.buffer)\n\tif n == 0 || (c.lastError != nil && c.lastError != io.EOF) {\n\t\treturn \"\"\n\t}\n\tc.dataBuf.unRead = true\n\tfor _, m := range defaultHTTP1Methods {\n\t\tif strings.HasPrefix(string(c.dataBuf.buffer), m) {\n\t\t\treturn \"http\"\n\t\t}\n\t}\n\tfor _, m := range defaultHTTP2Methods {\n\t\tif strings.HasPrefix(string(c.dataBuf.buffer), m) {\n\t\t\treturn \"http2\"\n\t\t}\n\t}\n\treturn \"tls\"\n}", "title": "" }, { "docid": "076968dded9146f29fbe62e05029ebe8", "score": "0.5167072", "text": "func getProtocol () (thrift.TProtocol, error) {\n\n\tvar err error\n\tif protocol == nil {\n\t\tprotocol, err = initProtocol()\n\t}\n\treturn protocol, err\n\n}", "title": "" }, { "docid": "5b6d23d312bbd981c6d1275e1affb869", "score": "0.51546526", "text": "func getConnectos() []ConnectorConf {\n\tconf := GetConfig()\n\treturn conf.Connectors\n\n}", "title": "" }, { "docid": "88f882879d11469a2b03c002c9b2a5b8", "score": "0.5141444", "text": "func ProtocolGetter(info types.RequestInfo) string {\n\treturn string(info.Protocol())\n}", "title": "" }, { "docid": "acb5a1ff42512e3ffb10625763d17b53", "score": "0.51409537", "text": "func RegisterDefaultProtocols(protocolYAMLs ...[]byte) {\n\tfor idx, protocolYAML := range protocolYAMLs {\n\t\tvar p cptype.ComponentProtocol\n\t\tif err := yaml.Unmarshal(protocolYAML, &p); err != nil {\n\t\t\tpanic(fmt.Errorf(\"failed to parse protocol yaml, index: %d, err: %v\", idx, err))\n\t\t}\n\t\tif p.Scenario == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tdefaultProtocols[p.Scenario] = p\n\t\tlogrus.Infof(\"default protocol registered for scenario: %s\", p.Scenario)\n\t}\n}", "title": "" }, { "docid": "cd987edf55e7fe4cb5f7a72ecf0f449f", "score": "0.51406556", "text": "func (c Compilers) availableLanguages() map[string]CompositionDetails {\n\tfmt.Printf(\"Received languages request...\")\n\tlangs := make(map[string]CompositionDetails)\n\n\t// make a list of currently supported languages\n\tfor k, v := range c {\n\t\tif v.Disabled != \"true\" {\n\t\t\tlangs[k] = v.CompositionDetails\n\t\t}\n\t}\n\n\tlog.Printf(\"currently supporting %d of %d known languages\\n\", len(langs), len(c))\n\treturn langs\n}", "title": "" }, { "docid": "5ad52f3f96d85d5064700bd7dbe40974", "score": "0.5138719", "text": "func (c Client) GetSupportedCommands() map[string]string {\n\tcommands := make(map[string]string)\n\turl := strings.Replace(\"http://{ip}/sony/system\", \"{ip}\", c.IP, 1)\n\tresp, body, _ := gorequest.New().Post(url).\n\t\tType(\"json\").\n\t\tSend(`{\"method\":\"getRemoteControllerInfo\",\"params\":[\"\"],\"id\":1,\"version\":\"1.0\"}`).\n\t\tEnd()\n\tif resp.StatusCode == 200 {\n\t\tvar jb RemoteControllerInfo\n\t\tjson.Unmarshal([]byte(body), &jb)\n\t\tlog.Println(\"JB\", jb)\n\t\tjresult := jb.Result[1]\n\t\tlog.Println(\"JResult\", jresult)\n\t\tfor _, c := range jresult {\n\t\t\tcommands[c.Name] = c.Value\n\t\t\tlog.Println(c.Name, c.Value)\n\t\t}\n\t}\n\treturn commands\n}", "title": "" }, { "docid": "1992496a81d00eeac852501aa234f701", "score": "0.5124888", "text": "func (common Common) GetBackends() []ProtocolBackend {\n\tvar backends []ProtocolBackend\n\thasDCBackends := false\n\thasClusterBackends := false\n\thasDirectBackends := false\n\n\tfor _, dc := range common.BackendsByDC {\n\t\thasDCBackends = true\n\t\tfor _, cluster := range dc.Clusters {\n\t\t\tbackends = append(backends, cluster.ProtocolBackends...)\n\t\t\tbackends = append(backends, getProtocolBackendsFromAddressList(cluster.Backends)...)\n\t\t}\n\t}\n\n\tfor _, cluster := range common.BackendsByCluster {\n\t\thasClusterBackends = true\n\t\tbackends = append(backends, cluster.ProtocolBackends...)\n\t\tbackends = append(backends, getProtocolBackendsFromAddressList(cluster.Backends)...)\n\t}\n\n\tif len(common.Backends) > 0 || len(common.ProtocolBackends) > 0 {\n\t\thasDirectBackends = true\n\t}\n\n\t// TODO: GV - check w/BackendsByDC\n\tif (hasDCBackends && hasClusterBackends) || (hasDirectBackends && len(backends) > 0) {\n\t\tlog.Fatal(\"duplicate backend definition in config -- exiting\")\n\t}\n\n\tbackends = append(backends, common.ProtocolBackends...)\n\tbackends = append(backends, getProtocolBackendsFromAddressList(common.Backends)...)\n\treturn backends\n}", "title": "" }, { "docid": "5d56b06eaaace4ce782658adb21b1c0f", "score": "0.5124209", "text": "func (o StreamingPolicyCommonEncryptionCencOutput) EnabledProtocols() StreamingPolicyCommonEncryptionCencEnabledProtocolsPtrOutput {\n\treturn o.ApplyT(func(v StreamingPolicyCommonEncryptionCenc) *StreamingPolicyCommonEncryptionCencEnabledProtocols {\n\t\treturn v.EnabledProtocols\n\t}).(StreamingPolicyCommonEncryptionCencEnabledProtocolsPtrOutput)\n}", "title": "" }, { "docid": "872be5236246909ae0b7ee0eff157c33", "score": "0.51078063", "text": "func PossibleConnectivityCheckProtocolValues() []ConnectivityCheckProtocol {\n\treturn []ConnectivityCheckProtocol{ConnectivityCheckProtocolHTTP, ConnectivityCheckProtocolHTTPS, ConnectivityCheckProtocolTCP}\n}", "title": "" }, { "docid": "6ca3e837f2fd44a25c50bf3af503500d", "score": "0.5107612", "text": "func (o StreamingPolicyCommonEncryptionCbcsOutput) EnabledProtocols() StreamingPolicyCommonEncryptionCbcsEnabledProtocolsPtrOutput {\n\treturn o.ApplyT(func(v StreamingPolicyCommonEncryptionCbcs) *StreamingPolicyCommonEncryptionCbcsEnabledProtocols {\n\t\treturn v.EnabledProtocols\n\t}).(StreamingPolicyCommonEncryptionCbcsEnabledProtocolsPtrOutput)\n}", "title": "" }, { "docid": "20c53fb7c1904e79f47e7f6ee6ac898e", "score": "0.5100653", "text": "func GetProtocol() protocol.Protocol {\n\tprotocolOnce.Do(func() {\n\t\tdubboProtocol = NewDubboProtocol()\n\t})\n\treturn dubboProtocol\n}", "title": "" }, { "docid": "b07642237df9bddeb962e9cce6191343", "score": "0.50941277", "text": "func (NetworkProtocol) Values() []NetworkProtocol {\n\treturn []NetworkProtocol{\n\t\t\"TCP\",\n\t\t\"UDP\",\n\t}\n}", "title": "" }, { "docid": "d3596442cb930ab4f9eb04e28ba1136d", "score": "0.50826055", "text": "func (s *Server) protocol(proto string) bool {\n\tfor _, p := range s.Protocols {\n\t\tif p == proto {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "2bc6f5f790b4adf0e88a796dcde68d80", "score": "0.5080621", "text": "func toRuntimeProtocol(protocol v1.Protocol) runtimeapi.Protocol {\n\tswitch protocol {\n\tcase v1.ProtocolTCP:\n\t\treturn runtimeapi.Protocol_TCP\n\tcase v1.ProtocolUDP:\n\t\treturn runtimeapi.Protocol_UDP\n\tcase v1.ProtocolSCTP:\n\t\treturn runtimeapi.Protocol_SCTP\n\t}\n\n\tklog.InfoS(\"Unknown protocol, defaulting to TCP\", \"protocol\", protocol)\n\treturn runtimeapi.Protocol_TCP\n}", "title": "" }, { "docid": "f782fa8b0fbe19463779c906850645fb", "score": "0.5080432", "text": "func PossibleTransportProtocolValues() []TransportProtocol {\n\treturn []TransportProtocol{\n\t\tTransportProtocolAll,\n\t\tTransportProtocolTCP,\n\t\tTransportProtocolUDP,\n\t}\n}", "title": "" }, { "docid": "339778eda787d5fe728106759b16ed3c", "score": "0.50798005", "text": "func WrapProtocol(p rpc.Protocol, r InboundRegistry) rpc.Protocol {\n\tif r.Registry == nil {\n\t\treturn p\n\t}\n\n\tmethods := make(map[string]rpc.ServeHandlerDescription)\n\tfor methodName, desc := range p.Methods {\n\t\tmethods[methodName] = wrapDescription(\n\t\t\tp.Name+\".\"+methodName, desc, r)\n\t}\n\treturn rpc.Protocol{\n\t\tName: p.Name,\n\t\tMethods: methods,\n\t\tWrapError: p.WrapError,\n\t}\n}", "title": "" }, { "docid": "e5d2822765a1521ecfcf732907d5cca4", "score": "0.50786644", "text": "func getProtocol(service *v1.Service) (string, error) {\n\tprotocol, ok := service.Annotations[annDOProtocol]\n\tif !ok {\n\t\treturn \"tcp\", nil\n\t}\n\n\tif protocol != \"tcp\" && protocol != \"http\" && protocol != \"https\" {\n\t\treturn \"\", fmt.Errorf(\"invalid protocol: %q specified in annotation: %q\", protocol, annDOProtocol)\n\t}\n\n\treturn protocol, nil\n}", "title": "" }, { "docid": "64d74e4170a776a8e05bd017847d79d6", "score": "0.50704503", "text": "func getTargetProtocol(request *serialization.RoundTripRequest) *protocol.ProtocolStruct {\n\tif request.IsSetTargetProtocol() {\n\t\treturn request.GetTargetProtocol()\n\t}\n\t// default value in case the protocol is not specified, as seen in the java implementation of conformance tests.\n\tif !request.IsSetValue() {\n\t\treturn &protocol.ProtocolStruct{\n\t\t\tStandard: protocol.StandardProtocol_Compact,\n\t\t\tCustom: nil,\n\t\t}\n\t}\n\tvalue := request.GetValue()\n\treturn getProtocol(value)\n}", "title": "" }, { "docid": "8a43e13c1fbd8f09979b1e7de3449251", "score": "0.5069137", "text": "func init() {\n\tGlobalRegisterDefaultProtocols()\n}", "title": "" }, { "docid": "f119e753946a96f99905f60aa01aa2c4", "score": "0.50655526", "text": "func (o FirewallPolicyRuleMatcherLayer4ConfigOutput) IpProtocol() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v FirewallPolicyRuleMatcherLayer4Config) *string { return v.IpProtocol }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "dfc0346e181a40e9dd497cb0464bc796", "score": "0.5056664", "text": "func (p *Protocol) SupportedFeatureSets() []string {\n\tvar features []string\n\tif p.Supports(sting.FeatureSet) {\n\t\tfeatures = append(features, sting.FeatureSetName)\n\t}\n\treturn features\n}", "title": "" }, { "docid": "652500cbfdd79b6ad30482004c173834", "score": "0.5055415", "text": "func (p *tMPProtocolFactory) GetProtocol(t thrift.TTransport) thrift.TProtocol {\n\tprotocol := thrift.NewTBinaryProtocolTransport(t)\n\treturn thrift.NewTMultiplexedProtocol(protocol, sentryProtocol)\n}", "title": "" }, { "docid": "dbff6dec127dc470b746d2cef2cbb7ba", "score": "0.5040888", "text": "func (*NetworkInstance_PolicyForwarding_Policy_Rule_Ipv4_Protocol_Union_E_OpenconfigPacketMatchTypes_IP_PROTOCOL) Is_NetworkInstance_PolicyForwarding_Policy_Rule_Ipv4_Protocol_Union() {\n}", "title": "" }, { "docid": "dbff6dec127dc470b746d2cef2cbb7ba", "score": "0.5040888", "text": "func (*NetworkInstance_PolicyForwarding_Policy_Rule_Ipv4_Protocol_Union_E_OpenconfigPacketMatchTypes_IP_PROTOCOL) Is_NetworkInstance_PolicyForwarding_Policy_Rule_Ipv4_Protocol_Union() {\n}", "title": "" }, { "docid": "47b914a19126516057e75faf32092d08", "score": "0.5037778", "text": "func getSupportedAuthAlgo() map[AuthAlgoType]AuthAlgoValues {\n\tret := map[AuthAlgoType]AuthAlgoValues{}\n\tlen := C.size_t(0)\n\talgos := C.get_supported_auth_algos(&len)\n\tslice := (*[1 << 30]C.struct_supported_auth_algo)(unsafe.Pointer(algos))[:len]\n\tfor _, a := range slice {\n\t\tk := AuthAlgoType(a.algo)\n\t\tv := AuthAlgoValues{\n\t\t\tDigestLen: uint16(a.digest_len),\n\t\t\tKeyLen: uint16(a.key_len),\n\t\t\tKeyNotReq: (a.key_not_req == 1),\n\t\t\tKeyword: C.GoString(a.keyword),\n\t\t}\n\t\tret[k] = v\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "64242ce72d0423ffed16b5b9f1e138a5", "score": "0.5020051", "text": "func GetProtocol() protocol.Protocol {\n\tonce.Do(func() {\n\t\tregProtocol = newRegistryProtocol()\n\t})\n\treturn regProtocol\n}", "title": "" }, { "docid": "9b28e4d48c9da620302fd1281160d900", "score": "0.50123084", "text": "func (h handler) GetProtocolConfig(v interface{}) error {\n\trobot.RLock()\n\terr := json.Unmarshal(protocolConfig, v)\n\trobot.RUnlock()\n\treturn err\n}", "title": "" }, { "docid": "ebe59547d5cae6f0d3a7c63b3649844d", "score": "0.50025547", "text": "func (m *WindowsFirewallRule) GetProtocol()(*int32) {\n val, err := m.GetBackingStore().Get(\"protocol\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*int32)\n }\n return nil\n}", "title": "" }, { "docid": "d03564ac93d312200fa777366307c9b0", "score": "0.4996823", "text": "func getSecureProtocol(protocol string) string {\n\tswitch protocol {\n\tcase \"ws\":\n\t\treturn \"wss\"\n\tcase \"http\":\n\t\treturn \"https\"\n\tdefault:\n\t\treturn protocol\n\t}\n}", "title": "" }, { "docid": "3e304ccd3802216cb4f5bf4f16189c0a", "score": "0.49828455", "text": "func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol {\n\treturn []SecurityRuleProtocol{\n\t\tSecurityRuleProtocolAsterisk,\n\t\tSecurityRuleProtocolTCP,\n\t\tSecurityRuleProtocolUDP,\n\t}\n}", "title": "" }, { "docid": "3b1206cd6fa9c9b6591c5bde128b7f30", "score": "0.4982691", "text": "func (o *StorageNetAppNfsClient) GetProtocolOk() (*string, bool) {\n\tif o == nil || o.Protocol == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Protocol, true\n}", "title": "" }, { "docid": "ec44c6669e09c8342f51e8b0feed8d30", "score": "0.4975862", "text": "func (o *OpenapiTaskGenerationRequestAllOf) GetProtocolOk() (*string, bool) {\n\tif o == nil || o.Protocol == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Protocol, true\n}", "title": "" }, { "docid": "c6c71bcc6b288c59d879843b74b333b9", "score": "0.49600267", "text": "func PossibleDestinationProtocolValues() []DestinationProtocol {\n\treturn []DestinationProtocol{\n\t\tDestinationProtocolHTTP,\n\t\tDestinationProtocolHTTPS,\n\t\tDestinationProtocolMatchRequest,\n\t}\n}", "title": "" }, { "docid": "fd6a702b11f30fc415d8c344df2c34f2", "score": "0.4957257", "text": "func getPreferredAvailableAPIs(client kubernetes.Interface, kind string) (Capabilities, error) {\n\tdiscoveryclient := client.Discovery()\n\tlists, err := discoveryclient.ServerPreferredResources()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcaps := Capabilities{}\n\tfor _, list := range lists {\n\t\tif len(list.APIResources) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, resource := range list.APIResources {\n\t\t\tif len(resource.Verbs) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif resource.Kind == kind {\n\t\t\t\tcaps[list.GroupVersion] = true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn caps, nil\n}", "title": "" }, { "docid": "110749cc1550992e64f31cff5b6feec9", "score": "0.4953111", "text": "func (ctx *Ctx) Protocol() string {\n\tif ctx.C.IsTLS() {\n\t\treturn \"https\"\n\t}\n\treturn \"http\"\n}", "title": "" }, { "docid": "16221bd38bc8a18e309f7323109b64b0", "score": "0.4951809", "text": "func GetProtocol(ip net.IP) Protocol {\n\tif len(ip) == net.IPv4len || ip.To4() != nil {\n\t\treturn ProtocolIPv4\n\t}\n\treturn ProtocolIPv6\n}", "title": "" }, { "docid": "87fac9972196540e24bd3abc32fa45ae", "score": "0.4948585", "text": "func GetProtocolFactory() ProtocolFactory {\n\treturn protocolFactory\n}", "title": "" }, { "docid": "54496f57bab95ebcf0788fb30a351b96", "score": "0.49483848", "text": "func (o *OpenapiTaskGenerationRequestAllOf) GetProtocol() string {\n\tif o == nil || o.Protocol == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Protocol\n}", "title": "" }, { "docid": "77ed43d5d62c3dcc57013038c890524b", "score": "0.49437279", "text": "func (c *RedfishClient) GetProtocol() string {\n\treturn constvalue.MockProtocol\n}", "title": "" }, { "docid": "8b6c6c86ef73989c1e3536677b5c8357", "score": "0.4941273", "text": "func (detection *Detection) Protocol() string {\n\treturn detection.Info.Protocol()\n}", "title": "" } ]
8530dbc90f835f6e3ce99a1d1500dbe0
GetRepeatOptions returns the RepeatOptions field value if set, zero value otherwise.
[ { "docid": "7a326f20be9aa8294700fcc69f2e0c1c", "score": "0.7250694", "text": "func (o *TasklistsIdTasksJsonTodoItem) GetRepeatOptions() TasklistsIdTasksJsonTodoItemRepeatOptions {\n\tif o == nil || o.RepeatOptions == nil {\n\t\tvar ret TasklistsIdTasksJsonTodoItemRepeatOptions\n\t\treturn ret\n\t}\n\treturn *o.RepeatOptions\n}", "title": "" } ]
[ { "docid": "bcfb2d123c384e562325f8883b1d05a1", "score": "0.6703335", "text": "func (o *TasklistsIdTasksJsonTodoItem) SetRepeatOptions(v TasklistsIdTasksJsonTodoItemRepeatOptions) {\n\to.RepeatOptions = &v\n}", "title": "" }, { "docid": "bc9efffdc1e91813cedfd0ad39b0bab6", "score": "0.6271207", "text": "func (o *TasklistsIdTasksJsonTodoItem) HasRepeatOptions() bool {\n\tif o != nil && o.RepeatOptions != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "6138205e52f8a66f30caa561e6bbfe71", "score": "0.61587095", "text": "func (o *TasklistsIdTasksJsonTodoItem) GetRepeatOptionsOk() (*TasklistsIdTasksJsonTodoItemRepeatOptions, bool) {\n\tif o == nil || o.RepeatOptions == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RepeatOptions, true\n}", "title": "" }, { "docid": "bb82fae2f46d94616bf84b754052f5ae", "score": "0.5248282", "text": "func Repeat(repeat int) option {\n\treturn func(t *GTest) { t.repeat = repeat }\n}", "title": "" }, { "docid": "95474217cb4d71a8e18b02e1d98a8d4e", "score": "0.5235001", "text": "func Repeat(repeat string) Option {\n\treturn func(heatmap *Heatmap) error {\n\t\theatmap.Builder.Repeat = &repeat\n\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "f68f631b088360f1413c340fc32462d6", "score": "0.48680955", "text": "func (o *SilentPolicy) GetRepeatInterval() string {\n\tif o == nil || o.RepeatInterval == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.RepeatInterval\n}", "title": "" }, { "docid": "6265cf1906726e03e76675a7c8e1a6f3", "score": "0.4865268", "text": "func (o GetEcsInvocationsInvocationOutput) RepeatMode() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetEcsInvocationsInvocation) string { return v.RepeatMode }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "5e2865389c241f1650b44bb836780217", "score": "0.48379442", "text": "func (r *LogfileRouteLogger) GetRepeatLength(ttl uint8) int {\n\treturn len(r.routeMap[ttl])\n}", "title": "" }, { "docid": "07464567dca59118e2dba9093984b952", "score": "0.47951323", "text": "func GetRepeatLogs() bool {\n\treturn repeatLogs\n}", "title": "" }, { "docid": "429fefcbf896966910168e99a358dace", "score": "0.47922993", "text": "func FromRepeat(ctx context.Context) int {\n\tif ctx != nil {\n\t\trepeated := ctx.Value(_repeat{})\n\t\tif repeated != nil {\n\t\t\treturn repeated.(int)\n\t\t}\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "fb45b8d5fdca9d36975ddb14d06b5224", "score": "0.47091883", "text": "func RecycleOptionTTLJitter(jitter time.Duration) RecycleOption {\n\treturn func(r *Recycler) *Recycler {\n\t\tr.ttlJitter = jitter\n\t\treturn r\n\t}\n}", "title": "" }, { "docid": "f0be75f0439bd5d44d14972ff38c1642", "score": "0.4567996", "text": "func (_m *MockPlcDiscoveryItem) GetOptions() map[string][]string {\n\tret := _m.Called()\n\n\tvar r0 map[string][]string\n\tif rf, ok := ret.Get(0).(func() map[string][]string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(map[string][]string)\n\t\t}\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "3cec22570b26d49d95c4cec254b75db4", "score": "0.45096815", "text": "func (o *PeoplePersonOfPeople) GetUseShorthandDurations() bool {\n\tif o == nil || o.UseShorthandDurations == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.UseShorthandDurations\n}", "title": "" }, { "docid": "a10bc427244bb48d195f058e2471de16", "score": "0.45019588", "text": "func (data *Data) Options() []int {\n\tret := []int{}\n\n\tif data.v > 0 {\n\t\treturn []int{data.v}\n\t}\n\n\tfor i := 1; i < 10; i++ {\n\t\tfound := false\n\t\tfor _, v := range data.no {\n\t\t\tif v == i {\n\t\t\t\tfound = true\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tret = append(ret, i)\n\t\t}\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "20d02baa6c9a74e700b12bd52ce1a250", "score": "0.44941622", "text": "func (o *SilentPolicy) HasRepeatInterval() bool {\n\tif o != nil && o.RepeatInterval != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8ed1aeedbee67916cadc250846d9451f", "score": "0.44769508", "text": "func (o *SilentPolicy) GetRepeatIntervalOk() (*string, bool) {\n\tif o == nil || o.RepeatInterval == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RepeatInterval, true\n}", "title": "" }, { "docid": "780eac374528f82413da8d8809712696", "score": "0.44600162", "text": "func (i *InputMessagePoll) GetOptions() (value []string) {\n\tif i == nil {\n\t\treturn\n\t}\n\treturn i.Options\n}", "title": "" }, { "docid": "b1b31cedde72cda7bac347460adedf16", "score": "0.44250518", "text": "func Retries(i int) Option {\n\treturn func(o *Options) {\n\t\to.CallOptions.Retries = i\n\t}\n}", "title": "" }, { "docid": "94da8d0e97b0453ed64409fb9a0ac9e5", "score": "0.44218576", "text": "func (_e *MockPlcDiscoveryItem_Expecter) GetOptions() *MockPlcDiscoveryItem_GetOptions_Call {\n\treturn &MockPlcDiscoveryItem_GetOptions_Call{Call: _e.mock.On(\"GetOptions\")}\n}", "title": "" }, { "docid": "11708707e0170c328fab77f3691888d4", "score": "0.4404868", "text": "func (hr HelmRelease) GetReuseValues() bool {\n\tswitch hr.Spec.ResetValues {\n\tcase nil:\n\t\treturn false\n\tdefault:\n\t\treturn !*hr.Spec.ResetValues\n\t}\n}", "title": "" }, { "docid": "fc8ee0ad2dcc77f8407c8eb67fda50a5", "score": "0.43749845", "text": "func (m NoSettlPartySubIDsRepeatingGroup) Get(i int) NoSettlPartySubIDs {\n\treturn NoSettlPartySubIDs{m.RepeatingGroup.Get(i)}\n}", "title": "" }, { "docid": "234aa964581f61d3ba18f55863af4bdb", "score": "0.43332925", "text": "func (o *WeeklyScheduleSettings) GetReplicaOptions() WeeklyReplicaScheduleSettings {\n\tif o == nil || o.ReplicaOptions == nil {\n\t\tvar ret WeeklyReplicaScheduleSettings\n\t\treturn ret\n\t}\n\treturn *o.ReplicaOptions\n}", "title": "" }, { "docid": "615395f3ec3a9a3a6d1c4adb20ca92ee", "score": "0.4331286", "text": "func Retries(value int) Option {\n\treturn func(o *Options) {\n\t\to.maxRetries = value\n\t}\n}", "title": "" }, { "docid": "1021fa3df7ef0ed1ab2be96d293a5295", "score": "0.43083158", "text": "func (o *RUMSearchEventsRequest) GetOptions() RUMQueryOptions {\n\tif o == nil || o.Options == nil {\n\t\tvar ret RUMQueryOptions\n\t\treturn ret\n\t}\n\treturn *o.Options\n}", "title": "" }, { "docid": "55f080e96c3ffa9edc2aa8b3e226e9c0", "score": "0.43060082", "text": "func (c *Client) Repeat(repeat bool) error {\n\tif repeat {\n\t\treturn c.okCmd(\"repeat 1\")\n\t}\n\treturn c.okCmd(\"repeat 0\")\n}", "title": "" }, { "docid": "1a6f0bf2b101da165afc49a80ff184e1", "score": "0.42846352", "text": "func (dev *InputDevice) GetRepeatRate() *[2]uint {\n\trepeat_delay := new([2]uint)\n\tioctl(dev.File.Fd(), uintptr(EVIOCGREP), unsafe.Pointer(repeat_delay))\n\n\treturn repeat_delay\n}", "title": "" }, { "docid": "61d32bc68c057c0549d71afdee49d098", "score": "0.4281134", "text": "func (o *PostAvaSourceOptions) GetTryAutoGenerateItemNumbersAndSchema() bool {\n\tif o == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\n\treturn o.TryAutoGenerateItemNumbersAndSchema\n}", "title": "" }, { "docid": "21a8ce0314ba69353ced03f5d927b2ea", "score": "0.42786548", "text": "func (r *ReplicationsConfig) GetReset() bool {\n\tif r == nil || r.Reset == nil {\n\t\treturn false\n\t}\n\treturn *r.Reset\n}", "title": "" }, { "docid": "9f377432faa14ff437b9f3b16620099f", "score": "0.4272238", "text": "func (o *SyntheticsAPIStep) GetRetry() SyntheticsTestOptionsRetry {\n\tif o == nil || o.Retry == nil {\n\t\tvar ret SyntheticsTestOptionsRetry\n\t\treturn ret\n\t}\n\treturn *o.Retry\n}", "title": "" }, { "docid": "ec4cbc3725a846cd1b7bba6b0fa3c417", "score": "0.4270123", "text": "func (o GetAutoSnapshotPoliciesPolicyOutput) RepeatWeekdays() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetAutoSnapshotPoliciesPolicy) []string { return v.RepeatWeekdays }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "ec4cbc3725a846cd1b7bba6b0fa3c417", "score": "0.4270123", "text": "func (o GetAutoSnapshotPoliciesPolicyOutput) RepeatWeekdays() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetAutoSnapshotPoliciesPolicy) []string { return v.RepeatWeekdays }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "f4d35f0f81dc5346f39a461dee1f894e", "score": "0.42216846", "text": "func SelectRepeater(fieldName string, p interface{}, attrs map[string]string, contentType, tmplString string) []byte {\n\tscope := editor.TagNameFromStructField(fieldName, p)\n\thtml := bytes.Buffer{}\n\t_, err := html.WriteString(`<span class=\"__ponzu-repeat ` + scope + `\">`)\n\tif err != nil {\n\t\tlog.Println(\"Error writing HTML string to SelectRepeater buffer\")\n\t\treturn nil\n\t}\n\n\tif _, ok := attrs[\"class\"]; ok {\n\t\tattrs[\"class\"] += \" browser-default\"\n\t} else {\n\t\tattrs[\"class\"] = \"browser-default\"\n\t}\n\n\t// find the field values in p to determine if an option is pre-selected\n\tfieldVals := editor.ValueFromStructField(fieldName, p)\n\tvals := strings.Split(fieldVals, \"__ponzu\")\n\n\toptions, err := encodeDataToOptions(contentType, tmplString)\n\tif err != nil {\n\t\tlog.Println(\"Error encoding data to options for\", contentType, err)\n\t\treturn nil\n\t}\n\n\tfor _, val := range vals {\n\t\tsel := editor.NewElement(\"select\", attrs[\"label\"], fieldName, p, attrs)\n\t\tvar opts []*editor.Element\n\n\t\t// provide a call to action for the select element\n\t\tcta := &editor.Element{\n\t\t\tTagName: \"option\",\n\t\t\tAttrs: map[string]string{\"disabled\": \"true\", \"selected\": \"true\"},\n\t\t\tData: \"Select an option...\",\n\t\t\tViewBuf: &bytes.Buffer{},\n\t\t}\n\n\t\t// provide a selection reset (will store empty string in db)\n\t\treset := &editor.Element{\n\t\t\tTagName: \"option\",\n\t\t\tAttrs: map[string]string{\"value\": \"\"},\n\t\t\tData: \"None\",\n\t\t\tViewBuf: &bytes.Buffer{},\n\t\t}\n\n\t\topts = append(opts, cta, reset)\n\n\t\tfor k, v := range options {\n\t\t\toptAttrs := map[string]string{\"value\": k}\n\t\t\tif k == val {\n\t\t\t\toptAttrs[\"selected\"] = \"true\"\n\t\t\t}\n\t\t\topt := &editor.Element{\n\t\t\t\tTagName: \"option\",\n\t\t\t\tAttrs: optAttrs,\n\t\t\t\tData: v,\n\t\t\t\tViewBuf: &bytes.Buffer{},\n\t\t\t}\n\n\t\t\topts = append(opts, opt)\n\t\t}\n\n\t\t_, err := html.Write(editor.DOMElementWithChildrenSelect(sel, opts))\n\t\tif err != nil {\n\t\t\tlog.Println(\"Error writing DOMElementWithChildrenSelect to SelectRepeater buffer\")\n\t\t\treturn nil\n\t\t}\n\t}\n\n\t_, err = html.WriteString(\"</span>\")\n\tif err != nil {\n\t\tlog.Println(\"Error writing HTML string to SelectRepeater buffer\")\n\t\treturn nil\n\t}\n\n\treturn append(html.Bytes(), editor.RepeatController(fieldName, p, \"select\", \".input-field\")...)\n}", "title": "" }, { "docid": "de62938a09cd69f8836af4a9221f16dc", "score": "0.42096692", "text": "func (c *Client) Repeat(repeat bool) error {\n\tif repeat {\n\t\treturn c.Command(\"repeat 1\").OK()\n\t}\n\treturn c.Command(\"repeat 0\").OK()\n}", "title": "" }, { "docid": "d84683274ebaab902a75f0f254225a32", "score": "0.42096114", "text": "func (H264RepeatPps) Values() []H264RepeatPps {\n\treturn []H264RepeatPps{\n\t\t\"DISABLED\",\n\t\t\"ENABLED\",\n\t}\n}", "title": "" }, { "docid": "c4a07994b630abbedaae5880439a3a04", "score": "0.42090037", "text": "func GetTestRedisOptions(t *testing.T) RedisOptions {\n\thostport := os.Getenv(\"TEST_REDIS_HOSTPORT\")\n\tif hostport == \"\" {\n\t\thostport = \"localhost:6379\"\n\t}\n\t// default is empty\n\tpassword := os.Getenv(\"TEST_REDIS_PASSWORD\")\n\tdbNum := os.Getenv(\"TEST_REDIS_DB\")\n\tif dbNum == \"\" {\n\t\tdbNum = \"0\"\n\t}\n\tdbInt, err := strconv.ParseInt(dbNum, 10, 64)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn RedisOptions{DBKeys: int(dbInt), HostPort: hostport, Password: password}\n}", "title": "" }, { "docid": "c526a23a4aa1f9c03472229f5ab39d5b", "score": "0.420289", "text": "func (o *PaginationSerializerWithGalleryViewFieldOptionsExampleRowResponse) HasFieldOptions() bool {\n\tif o != nil && !IsNil(o.FieldOptions) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5fe2bcbc3d5b0ce4eb81653d9e4c9b88", "score": "0.41970932", "text": "func (w WatchOptions) GetNoReplay() bool {\n\treturn w.noReplay\n}", "title": "" }, { "docid": "c7d78d30a950b084566c4306fefcc6e1", "score": "0.41858032", "text": "func RecycleOptionTTL(ttl time.Duration) RecycleOption {\n\treturn func(r *Recycler) *Recycler {\n\t\tr.ttl = ttl\n\t\treturn r\n\t}\n}", "title": "" }, { "docid": "18b1b54d79361e39f5b42d6ffca7fc8a", "score": "0.41821492", "text": "func testRetryOptions() retry.Options {\n\treturn retry.Options{\n\t\tInitialBackoff: 1 * time.Millisecond,\n\t\tMaxBackoff: 2 * time.Millisecond,\n\t\tMultiplier: 2,\n\t\tMaxRetries: 1,\n\t}\n}", "title": "" }, { "docid": "72e1f5fbf556d0aa1389ee66018c2dfe", "score": "0.41805512", "text": "func (m NoQuoteSetsRepeatingGroup) Get(i int) NoQuoteSets {\n\treturn NoQuoteSets{m.RepeatingGroup.Get(i)}\n}", "title": "" }, { "docid": "35698add05fceca0616159d0c2bdae91", "score": "0.418045", "text": "func (v SSHInfo) GetReviewRefOptions(id, patch string) (string, []string, error) {\n\tvar (\n\t\tref string\n\t\toptions []string\n\t)\n\tif v.ReviewRefPattern == \"\" {\n\t\treturn \"\", nil, errors.New(\"empty review_ref in ssh_info\")\n\t}\n\tif patch == \"\" || patch == \"0\" {\n\t\tpatch = \"head\"\n\t}\n\tref = ReplaceMacros(v.ReviewRefPattern,\n\t\tmap[string]string{\"id\": id, \"patch\": patch})\n\tif v.ProtoType == ProtoTypeAGit && v.ProtoVersion > 2 {\n\t\toptions = append(options, \"review=\"+id)\n\t}\n\treturn ref, options, nil\n}", "title": "" }, { "docid": "32cc1950c8fb60c2af1812d23a444966", "score": "0.41705304", "text": "func (o *PaginationSerializerWithGalleryViewFieldOptionsExampleRowResponse) GetFieldOptions() map[string]GalleryViewFieldOptions {\n\tif o == nil || IsNil(o.FieldOptions) {\n\t\tvar ret map[string]GalleryViewFieldOptions\n\t\treturn ret\n\t}\n\treturn *o.FieldOptions\n}", "title": "" }, { "docid": "dc5e76508262c84f226d27ad75b55e1c", "score": "0.41685867", "text": "func (o *ModelsStorageOptionsTemplate) GetRepl() int32 {\n\tif o == nil || o.Repl == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\treturn *o.Repl\n}", "title": "" }, { "docid": "3ba10eb7b791c50e100e8625d5724200", "score": "0.41682798", "text": "func (o *Options) GetRenotifyInterval() int {\n\tif o == nil || o.RenotifyInterval == nil {\n\t\treturn 0\n\t}\n\treturn *o.RenotifyInterval\n}", "title": "" }, { "docid": "ca5bd44636601e751ef7f1220e71da9f", "score": "0.4161638", "text": "func Retries(retries uint) PolicyOption {\n\treturn policyOptionFunc(func(opts *policyOptions) {\n\t\topts.retries = retries\n\t})\n}", "title": "" }, { "docid": "6500203a7e839f35ee05ba37a6c30945", "score": "0.41593024", "text": "func (o *WeeklyScheduleSettings) HasReplicaOptions() bool {\n\tif o != nil && o.ReplicaOptions != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "63fd1874c756b4c9e7a4698e84b7066a", "score": "0.41434848", "text": "func (d *Device) RepeatState() (uint, uint) {\n\tvar rep [2]int32\n\tioctl(d.fd.Fd(), _EVIOCGREP, unsafe.Pointer(&rep[0]))\n\treturn uint(rep[0]), uint(rep[1])\n}", "title": "" }, { "docid": "02b1c0350d4ebe6096ebbe793849d4dd", "score": "0.41138467", "text": "func RetryOption(count int) Option {\n\treturn optionFunc(func(h *handler) {\n\t\th.retry = count\n\t})\n}", "title": "" }, { "docid": "6b985eb002cb76f4050a5edf5eb397e6", "score": "0.41132212", "text": "func RepetitionOptional(se *sch.SchemaElement) {\n\tt := sch.FieldRepetitionType_OPTIONAL\n\tse.RepetitionType = &t\n}", "title": "" }, { "docid": "f419276c1819b3b980b903514b1a3a3c", "score": "0.4112277", "text": "func (ng *nodegroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) {\n\treturn nil, cloudprovider.ErrNotImplemented\n}", "title": "" }, { "docid": "37db94997d675a98d2116825810f5671", "score": "0.41054013", "text": "func (s *BoltDb) GetOptions(appName, label string) map[string]string {\n\n\tprops := make(map[string]string)\n\n\tprefix := getLabelKey(appName, label)\n\n\ts.View(func(tx *bolt.Tx) error {\n\t\t// Assume bucket exists and has keys\n\t\tb := tx.Bucket(s.PropsBucketName)\n\n\t\tc := b.Cursor()\n\n\t\tfor k, v := c.Seek(prefix); bytes.HasPrefix(k, prefix); k, v = c.Next() {\n\n\t\t\t_, _, variable, err := parsePropertyKey(k)\n\n\t\t\tif err != nil {\n\t\t\t\tlog.Print(err)\n\t\t\t} else {\n\t\t\t\tprops[variable] = parseValue(v)\n\t\t\t}\n\n\t\t}\n\n\t\treturn nil\n\t})\n\n\treturn props\n}", "title": "" }, { "docid": "91c925fa7f5a6b1194632704152fb25f", "score": "0.41047323", "text": "func (backend *Backend) GetOptions(ctx context.Context, recordType string) (*databroker.Options, error) {\n\traw, err := backend.client.HGet(ctx, optionsKey, recordType).Result()\n\tif errors.Is(err, redis.Nil) {\n\t\t// treat no options as an empty set of options\n\t\treturn new(databroker.Options), nil\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar options databroker.Options\n\terr = proto.Unmarshal([]byte(raw), &options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &options, nil\n}", "title": "" }, { "docid": "9d0701aa5847a638889cbd9134c21091", "score": "0.40960816", "text": "func (a *ExtendedProtocolConfigurationOptions) GetLen() (len uint16) {\n\treturn a.Len\n}", "title": "" }, { "docid": "7f8a4482122c652c844934077be39baa", "score": "0.40959555", "text": "func (o *SilentPolicy) SetRepeatInterval(v string) {\n\to.RepeatInterval = &v\n}", "title": "" }, { "docid": "35122445d3043b11e7e1fa68aa7e59ee", "score": "0.40723264", "text": "func (o *ViewBoardColumnSettings) GetRecurring() bool {\n\tif o == nil || o.Recurring == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.Recurring\n}", "title": "" }, { "docid": "ee3860c85a4fc9a50954c4a888108898", "score": "0.40654993", "text": "func (r *Route) GetOptions(pattern string, h ...interface{}) {\n\tmiddlewares := r.getMiddlewares(h)\n\tr.R.Get(r.getPattern(pattern), Wrap(middlewares...))\n\tr.R.Options(r.getPattern(pattern), Wrap(middlewares...))\n}", "title": "" }, { "docid": "6b58e3cab405b27751d91f58e7d0ebcd", "score": "0.4057241", "text": "func Repeat(times int, t Tween) Tween {\n\treturn &repeat{\n\t\tduration: time.Duration(times) * t.Duration(),\n\t\tinfinite: times == 0,\n\t\tt: t}\n}", "title": "" }, { "docid": "e49bbfb1d5842cab7e52f69b524457cf", "score": "0.404409", "text": "func (m *pipeline) Options() []string {\n\treturn m.optionsField\n}", "title": "" }, { "docid": "e0995e49c6f0f677f565018cddbc8b9e", "score": "0.40404856", "text": "func (o *Options) RetryDuration() time.Duration {\n\treturn time.Second * time.Duration(o.RetryDelay)\n}", "title": "" }, { "docid": "a866712147cb678b238d2df04c5d89dc", "score": "0.4031238", "text": "func getRecurseOpt(opts []*opt.Opt) (result bool) {\n\tif o := opt.Get(opts, \"recurse\"); o != nil {\n\t\tif val, ok := o.Val.(bool); ok {\n\t\t\tresult = val\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e09f520c12b5e31d174fdd187a135524", "score": "0.40207785", "text": "func (o *RecipeOptions) GetBSON() (interface{}, error) {\n\n\tif o == nil {\n\t\treturn nil, nil\n\t}\n\n\ts := &mongoAttributesRecipeOptions{}\n\n\ts.AppCrendentialFormat = o.AppCrendentialFormat\n\n\treturn s, nil\n}", "title": "" }, { "docid": "e7e48862ea3149037b192060b6674a01", "score": "0.40190032", "text": "func (mock *DatasetAPIMock) GetOptionsCalls() []struct {\n\tCtx context.Context\n\tUserAuthToken string\n\tServiceAuthToken string\n\tCollectionID string\n\tID string\n\tEdition string\n\tVersion string\n\tDimension string\n\tQ *dataset.QueryParams\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tUserAuthToken string\n\t\tServiceAuthToken string\n\t\tCollectionID string\n\t\tID string\n\t\tEdition string\n\t\tVersion string\n\t\tDimension string\n\t\tQ *dataset.QueryParams\n\t}\n\tmock.lockGetOptions.RLock()\n\tcalls = mock.calls.GetOptions\n\tmock.lockGetOptions.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "a1331b00d32e2f5c5894d054f44259b4", "score": "0.40087602", "text": "func (o *Options) Reset() {\n\to.init()\n\tfor _, opt := range o.longOpts {\n\t\topt.Seen = false\n\t\topt.Raw = \"\"\n\t}\n\tfor _, opt := range o.shortOpts {\n\t\topt.Seen = false\n\t\topt.Raw = \"\"\n\t}\n\n}", "title": "" }, { "docid": "a7ebaa5fcfd547f9b812d6e4d3bafb1c", "score": "0.40082735", "text": "func (v Value) RepetitionLevel() int { return int(v.repetitionLevel) }", "title": "" }, { "docid": "7c477a7576a0a20ab63b911cc75a5cd0", "score": "0.40079433", "text": "func (_options *PostFindOptions) SetR(r int64) *PostFindOptions {\n\t_options.R = core.Int64Ptr(r)\n\treturn _options\n}", "title": "" }, { "docid": "9fad5ae49dbca0df1635e400d5fda732", "score": "0.40036643", "text": "func HasDuplicateOptions(file *ast.File, name string) bool {\n\tvar n int\n\tfor _, st := range file.Body {\n\t\tif val, ok := st.(*ast.OptionStatement); ok {\n\t\t\tassign := val.Assignment\n\t\t\tif va, ok := assign.(*ast.VariableAssignment); ok {\n\t\t\t\tif va.ID.Name == name {\n\t\t\t\t\tif ok {\n\t\t\t\t\t\tn++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn n > 1\n}", "title": "" }, { "docid": "2bdf2525b7a221796076b7bd48815f0b", "score": "0.3999714", "text": "func (ev *BanditEnv) RandomOpt() int {\n\top := rand.Intn(ev.N)\n\tev.Option.Set(op)\n\treturn op\n}", "title": "" }, { "docid": "2b3fa04da0f566aefe4fb6c049caeba1", "score": "0.39916727", "text": "func SetRepeatMode(state string, opts *Options) error {\n\tv, err := query.Values(opts)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tv.Add(\"state\", state)\n\n\tt := getAccessToken()\n\n\tr := buildRequest(\"PUT\", apiURLBase+\"me/player/repeat\", v, nil)\n\tr.Header.Add(\"Authorization\", \"Bearer \"+t)\n\n\terr = makeRequest(r, nil)\n\n\treturn err\n}", "title": "" }, { "docid": "12c7ee56d537f30a45c9c5c15499d65e", "score": "0.39881718", "text": "func (ng *cherryNodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) {\n\treturn nil, cloudprovider.ErrNotImplemented\n}", "title": "" }, { "docid": "d06bb5c0e926a4845ba4ea3eb424ed91", "score": "0.39862633", "text": "func (v *Volume) GetOptions() map[string]string {\n\treturn v.Options\n}", "title": "" }, { "docid": "429d87ea5b8bca86c0aff746e0f6a71c", "score": "0.3984818", "text": "func (m NoSettlPartyIDsRepeatingGroup) Get(i int) NoSettlPartyIDs {\n\treturn NoSettlPartyIDs{m.RepeatingGroup.Get(i)}\n}", "title": "" }, { "docid": "9cb3582d60c4920421942cfca3d585b5", "score": "0.3980416", "text": "func (p *Poll) GetMultipleChoice() (value bool) {\n\tif p == nil {\n\t\treturn\n\t}\n\treturn p.Flags.Has(2)\n}", "title": "" }, { "docid": "534138a560d1bfa5d38ecf009c07adc4", "score": "0.3977601", "text": "func (o *SyntheticsGlobalVariable) GetParseTestOptions() SyntheticsGlobalVariableParseTestOptions {\n\tif o == nil || o.ParseTestOptions == nil {\n\t\tvar ret SyntheticsGlobalVariableParseTestOptions\n\t\treturn ret\n\t}\n\treturn *o.ParseTestOptions\n}", "title": "" }, { "docid": "783159665f3ab815ccc33e4800ae5c2b", "score": "0.39747968", "text": "func (m *mockConfig) GetTaskRetries() int {\n\targs := m.Called()\n\treturn args.Get(0).(int)\n}", "title": "" }, { "docid": "310285017cfc5664acba6340c5b22ad8", "score": "0.39734003", "text": "func (n *NodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) {\n\treturn nil, cloudprovider.ErrNotImplemented\n}", "title": "" }, { "docid": "310285017cfc5664acba6340c5b22ad8", "score": "0.39734003", "text": "func (n *NodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) {\n\treturn nil, cloudprovider.ErrNotImplemented\n}", "title": "" }, { "docid": "c1e4a6780cf3ab3eba086537b9d89746", "score": "0.39713562", "text": "func (m *SearchRequest) GetResultTemplateOptions()(ResultTemplateOptionable) {\n return m.resultTemplateOptions\n}", "title": "" }, { "docid": "2c8b6b437f0da10cc44b5800447dc156", "score": "0.3969937", "text": "func (s Style) GetFillOptions() Style {\n\treturn Style{\n\t\tFillColor: s.FillColor,\n\t}\n}", "title": "" }, { "docid": "c483a1253434c783dc2e3fd975cd5028", "score": "0.3961777", "text": "func (_options *GetDocumentOptions) SetRevs(revs bool) *GetDocumentOptions {\n\t_options.Revs = core.BoolPtr(revs)\n\treturn _options\n}", "title": "" }, { "docid": "6428216a9a73c50122aeac9389f6751f", "score": "0.3959078", "text": "func (o AlertMutingRuleScheduleOutput) Repeat() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AlertMutingRuleSchedule) *string { return v.Repeat }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "12f2c559c586178ab16b17e73df16614", "score": "0.39580345", "text": "func (ip *InstancePoolNodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) {\n\treturn nil, cloudprovider.ErrNotImplemented\n}", "title": "" }, { "docid": "f8793504ec4a43065fd17472af8c5082", "score": "0.39543927", "text": "func (o *OauthSettings) GetReset() bool {\n\tif o == nil || o.Reset == nil {\n\t\treturn false\n\t}\n\treturn *o.Reset\n}", "title": "" }, { "docid": "795678e77e84e5e9516e8d59a21dd04b", "score": "0.3954285", "text": "func (o *InstitutionsGetRequest) GetOptions() InstitutionsGetRequestOptions {\n\tif o == nil || o.Options == nil {\n\t\tvar ret InstitutionsGetRequestOptions\n\t\treturn ret\n\t}\n\treturn *o.Options\n}", "title": "" }, { "docid": "c5a455bf6fb0adfe3da226555fc49e08", "score": "0.3947963", "text": "func (s *Options) GetDuration(key string, defaultVal ...time.Duration) (ir time.Duration) {\n\tstr := s.GetString(key, \"BAD\")\n\tif str == \"BAD\" {\n\t\tfor _, vv := range defaultVal {\n\t\t\tir = vv\n\t\t}\n\t} else {\n\t\tvar err error\n\t\tif ir, err = time.ParseDuration(str); err != nil {\n\t\t\tfor _, vv := range defaultVal {\n\t\t\t\tir = vv\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "2678fb45ad3762bbbf3981bbc6fc0a37", "score": "0.39456978", "text": "func R(r int) Option {\n\treturn optionFunc(func(opts *options) {\n\t\topts.r = r\n\t})\n}", "title": "" }, { "docid": "9714a47119564c9b34b131a39885c909", "score": "0.3943345", "text": "func (s *RelayAgent_Dhcpv6_Interface) GetOrCreateOptions() *RelayAgent_Dhcpv6_Interface_Options {\n\tif s.Options != nil {\n\t\treturn s.Options\n\t}\n\ts.Options = &RelayAgent_Dhcpv6_Interface_Options{}\n\treturn s.Options\n}", "title": "" }, { "docid": "3c10f3721c25568c7157133e4a5e3815", "score": "0.39433083", "text": "func (_options *PostBulkGetOptions) SetRevs(revs bool) *PostBulkGetOptions {\n\t_options.Revs = core.BoolPtr(revs)\n\treturn _options\n}", "title": "" }, { "docid": "bd7ede5f29c6aa0bcfbc5621f2e9b8da", "score": "0.39430955", "text": "func StreamOptionRetryResetInterval(retryResetInterval time.Duration) StreamOption {\n\treturn retryResetIntervalOption{retryResetInterval: retryResetInterval}\n}", "title": "" }, { "docid": "b49478997fe3f57cac391e4245de2cd0", "score": "0.3939393", "text": "func (q *QuotaConfig) GetReset() bool {\n\tif q == nil || q.Reset == nil {\n\t\treturn false\n\t}\n\treturn *q.Reset\n}", "title": "" }, { "docid": "da5f9178039ac6bbc451c2f0aa126678", "score": "0.393624", "text": "func (s *SyntheticsTest) GetOptions() SyntheticsOptions {\n\tif s == nil || s.Options == nil {\n\t\treturn SyntheticsOptions{}\n\t}\n\treturn *s.Options\n}", "title": "" }, { "docid": "b7eb406f256b55808db0035acea2fd76", "score": "0.3934409", "text": "func (m NoPartySubIDsRepeatingGroup) Get(i int) NoPartySubIDs {\n\treturn NoPartySubIDs{m.RepeatingGroup.Get(i)}\n}", "title": "" }, { "docid": "b7eb406f256b55808db0035acea2fd76", "score": "0.3934409", "text": "func (m NoPartySubIDsRepeatingGroup) Get(i int) NoPartySubIDs {\n\treturn NoPartySubIDs{m.RepeatingGroup.Get(i)}\n}", "title": "" }, { "docid": "b7eb406f256b55808db0035acea2fd76", "score": "0.3934409", "text": "func (m NoPartySubIDsRepeatingGroup) Get(i int) NoPartySubIDs {\n\treturn NoPartySubIDs{m.RepeatingGroup.Get(i)}\n}", "title": "" }, { "docid": "a671aa9911772a7f3fc3ef5288e5153a", "score": "0.39343533", "text": "func (m *MockPeer) GetOpts() []grpc.DialOption {\n\tret := m.ctrl.Call(m, \"GetOpts\")\n\tret0, _ := ret[0].([]grpc.DialOption)\n\treturn ret0\n}", "title": "" }, { "docid": "384cc3cac384118f91f807169669d7cb", "score": "0.39304075", "text": "func (_options *GetReplicationDocumentOptions) SetRevs(revs bool) *GetReplicationDocumentOptions {\n\t_options.Revs = core.BoolPtr(revs)\n\treturn _options\n}", "title": "" }, { "docid": "23a704e4b89036f0310bb7a39d612b9d", "score": "0.39261132", "text": "func GetOptions() *Options {\n\n\tvar lockfike string\n\tflag.StringVar(&lockfike, \"lockfike\", \"/etc/certificates.lock\", \"Lock file location\")\n\n\tvar daysexpiration int\n\tflag.IntVar(&daysexpiration, \"daysexpiration\", 15, \"Number of days before warning\")\n\n\tvar dirs string\n\tflag.StringVar(&dirs, \"dirs\", \"/etc/nginx/sites-enabled,/etc/apache2/sites-enabled,/etc/nginx/vhosts.d,/etc/apache2/vhosts.d,/etc/apache2/sites.d,/etc/nginx/sites.d\", \"Directories be checked to find certs\")\n\n\tvar letsencrypt bool\n\tflag.BoolVar(&letsencrypt, \"letsencrypt\", true, \"Check only if the certificate was issued by letsencrypt\")\n\n\tvar verbosity int\n\tflag.IntVar(&verbosity, \"verbosity\", 3, \"0 = only errors, 1 = important things, 2 = all, 3 = none\")\n\n\tvar cooldown string\n\tflag.StringVar(&cooldown, \"cooldown\", \"/tmp/gorilla.lock\", \"Cooldown file lock location\")\n\n\tflag.Parse()\n\n\topts := NewOptions(lockfike, daysexpiration, dirs, letsencrypt, verbosity, cooldown)\n\n\treturn opts\n}", "title": "" }, { "docid": "be2c8c86d4c7053a72ac3fbc5234ebbd", "score": "0.39258343", "text": "func (o *RUMSearchEventsRequest) HasOptions() bool {\n\treturn o != nil && o.Options != nil\n}", "title": "" }, { "docid": "55039ba23d712ba21afb44f5bf960adf", "score": "0.3922501", "text": "func (asg *asg) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) {\n\treturn nil, cloudprovider.ErrNotImplemented\n}", "title": "" }, { "docid": "ef1eae7ff736f36c8ff1724c1b4112aa", "score": "0.391945", "text": "func (o *AssetReportCreateRequest) GetOptions() AssetReportCreateRequestOptions {\n\tif o == nil || o.Options == nil {\n\t\tvar ret AssetReportCreateRequestOptions\n\t\treturn ret\n\t}\n\treturn *o.Options\n}", "title": "" }, { "docid": "ff7e200a8146e72ecd4d63ebe608bd4e", "score": "0.39137417", "text": "func (o *Options) HasRenotifyInterval() bool {\n\tif o != nil && o.RenotifyInterval != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" } ]
e1e6cd1cd43fe7c2c2dc50bc5ec73e63
relocateFile moves |fileID| from the |oldParentID| folder to the old_files_dir folder. It returns an error if the operation fails.
[ { "docid": "4562ff42f0f1132583b957ee14091205", "score": "0.77457845", "text": "func (p *pusher) relocateFile(fileID, oldParentID string) error {\r\n\ttallyOp()\r\n\tif *verbose {\r\n\t\tfmt.Printf(\"relocateFile(%s, %s)\\n\", fileID, oldParentID)\r\n\t}\r\n\tparentRef := &drive.ParentReference{Id: *oldFilesDir}\r\n\r\n\t// Wrap in a simple retry loop since Drive can be unreliable.\r\n\tif err := try.Do(func(attempt int) (bool, error) {\r\n\t\t_, err := p.drv.Parents.Insert(fileID, parentRef).Do()\r\n\t\tif err != nil {\r\n\t\t\tlog.Print(err)\r\n\t\t\ttime.Sleep(time.Second)\r\n\t\t}\r\n\t\treturn attempt < try.MaxRetries, err\r\n\t}); err != nil {\r\n\t\treturn fmt.Errorf(\"An Insert() error occurred: %v\", err)\r\n\t}\r\n\r\n\t// Wrap in a simple retry loop since Drive can be unreliable.\r\n\tif err := try.Do(func(attempt int) (bool, error) {\r\n\t\terr := p.drv.Parents.Delete(fileID, oldParentID).Do()\r\n\t\tif err != nil {\r\n\t\t\tlog.Print(err)\r\n\t\t\ttime.Sleep(time.Second)\r\n\t\t}\r\n\t\treturn attempt < try.MaxRetries, err\r\n\t}); err != nil {\r\n\t\treturn fmt.Errorf(\"A Delete() error occurred: %v\", err)\r\n\t}\r\n\r\n\treturn nil\r\n}", "title": "" } ]
[ { "docid": "5d9bd9be0d1cbb4064a558097819e15d", "score": "0.6036805", "text": "func (mdb *MetadataDb) MoveFile(\n\tctx context.Context,\n\toph *OpHandle,\n\tinode int64,\n\tnewParentDir Dir,\n\tnewName string) error {\n\tif mdb.options.Verbose {\n\t\tmdb.log(\"MoveFile -> %s/%s\", newParentDir.FullPath, newName)\n\t}\n\tsqlStmt := fmt.Sprintf(`\n \t\t UPDATE namespace\n SET parent = '%s', name = '%s'\n\t\t\tWHERE inode = '%d';`,\n\t\tnewParentDir.FullPath, newName, inode)\n\n\tif _, err := oph.txn.Exec(sqlStmt); err != nil {\n\t\tmdb.log(err.Error())\n\t\tmdb.log(\"MoveFile error executing transaction\")\n\t\treturn oph.RecordError(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5199db6bba2d21464f4265839c8a68be", "score": "0.56897664", "text": "func (fs *FileSystem) RenameFile(oldSiaPath, newSiaPath modules.SiaPath) (err error) {\n\t// Open SiaDir for file at old location.\n\toldDirSiaPath, err := oldSiaPath.Dir()\n\tif err != nil {\n\t\treturn err\n\t}\n\toldDir, err := fs.managedOpenSiaDir(oldDirSiaPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\terr = errors.Compose(err, oldDir.Close())\n\t}()\n\t// Open the file.\n\tsf, err := oldDir.managedOpenFile(oldSiaPath.Name())\n\tif errors.Contains(err, ErrNotExist) {\n\t\treturn ErrNotExist\n\t}\n\tif err != nil {\n\t\treturn errors.AddContext(err, \"failed to open file for renaming\")\n\t}\n\tdefer func() {\n\t\terr = errors.Compose(err, sf.Close())\n\t}()\n\n\t// Create and Open SiaDir for file at new location.\n\tnewDirSiaPath, err := newSiaPath.Dir()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := fs.NewSiaDir(newDirSiaPath, sf.managedMode()); err != nil {\n\t\treturn errors.AddContext(err, fmt.Sprintf(\"failed to create SiaDir %v for SiaFile %v\", newDirSiaPath.String(), oldSiaPath.String()))\n\t}\n\tnewDir, err := fs.managedOpenSiaDir(newDirSiaPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\terr = errors.Compose(err, newDir.Close())\n\t}()\n\t// Rename the file.\n\treturn sf.managedRename(newSiaPath.Name(), oldDir, newDir)\n}", "title": "" }, { "docid": "1e0055f2aa110d8625e080d1e3ce79d6", "score": "0.5608873", "text": "func (storage *GCDStorage) MoveFile(threadIndex int, from string, to string) (err error) {\n\n from = storage.convertFilePath(from)\n to = storage.convertFilePath(to)\n\n fileID, ok := storage.findPathID(from)\n if !ok {\n return fmt.Errorf(\"Attempting to rename file %s with unknown id\", to)\n }\n\n fromParentID := storage.getPathID(\"chunks\")\n toParentID := storage.getPathID(\"fossils\")\n\n if strings.HasPrefix(from, \"fossils\") {\n fromParentID, toParentID = toParentID, fromParentID\n }\n\n for {\n _, err = storage.service.Files.Update(fileID, nil).AddParents(toParentID).RemoveParents(fromParentID).Do()\n if retry, err := storage.shouldRetry(err); err == nil && !retry {\n break\n } else if retry {\n continue\n } else {\n return err\n }\n }\n\n storage.savePathID(to, storage.getPathID(from))\n storage.deletePathID(from)\n return nil\n}", "title": "" }, { "docid": "afd8b3801b25132d4a60d874aa2c2f1f", "score": "0.5518022", "text": "func (fs *FileSystem) RenameDir(oldSiaPath, newSiaPath modules.SiaPath) error {\n\t// Open SiaDir for parent dir at old location.\n\toldDirSiaPath, err := oldSiaPath.Dir()\n\tif err != nil {\n\t\treturn err\n\t}\n\toldDir, err := fs.managedOpenSiaDir(oldDirSiaPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\toldDir.Close()\n\t}()\n\t// Open the dir to rename.\n\tsd, err := oldDir.managedOpenDir(oldSiaPath.Name())\n\tif errors.Contains(err, ErrNotExist) {\n\t\treturn ErrNotExist\n\t}\n\tif err != nil {\n\t\treturn errors.AddContext(err, \"failed to open file for renaming\")\n\t}\n\tdefer func() {\n\t\tsd.Close()\n\t}()\n\n\t// Create and Open parent SiaDir for dir at new location.\n\tnewDirSiaPath, err := newSiaPath.Dir()\n\tif err != nil {\n\t\treturn err\n\t}\n\tmd, err := sd.Metadata()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := fs.NewSiaDir(newDirSiaPath, md.Mode); err != nil {\n\t\treturn errors.AddContext(err, fmt.Sprintf(\"failed to create SiaDir %v for SiaFile %v\", newDirSiaPath.String(), oldSiaPath.String()))\n\t}\n\tnewDir, err := fs.managedOpenSiaDir(newDirSiaPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tnewDir.Close()\n\t}()\n\t// Rename the dir.\n\terr = sd.managedRename(newSiaPath.Name(), oldDir, newDir)\n\treturn err\n}", "title": "" }, { "docid": "98ec976c35254bcd40889d4810d18004", "score": "0.53604186", "text": "func (lfs *LocalFSHandler) MoveFile(source string, dest string) error {\n\t// Path validation handled in FromPath()\n\tvar srcAnpath LocalAnPath\n\terr := srcAnpath.Set(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstat, err := os.Stat(srcAnpath.ProviderPath())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !stat.Mode().IsRegular() {\n\t\treturn errors.New(\"source path is a not file\")\n\t}\n\n\t// Path validation handled in FromPath()\n\tvar destAnpath LocalAnPath\n\terr = destAnpath.Set(dest)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstat, err = os.Stat(destAnpath.ProviderPath())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !stat.IsDir() {\n\t\treturn errors.New(\"destination path is not a directory\")\n\t}\n\n\tnewPath := filepath.Join(destAnpath.ProviderPath(), filepath.Base(srcAnpath.ProviderPath()))\n\tfmt.Println(newPath)\n\t_, err = os.Stat(newPath)\n\tif err == nil {\n\t\treturn errors.New(\"source exists in destination path\")\n\t}\n\n\treturn os.Rename(srcAnpath.ProviderPath(), newPath)\n}", "title": "" }, { "docid": "ec4e4bffddf91c1faba78eba59dafdf4", "score": "0.5191618", "text": "func (f *Fs) move(ctx context.Context, isDir bool, id, oldLeaf, newLeaf, oldDirectoryID, newDirectoryID string) (item *api.Item, err error) {\n\tnewLeaf = f.opt.Enc.FromStandardName(newLeaf)\n\toldLeaf = f.opt.Enc.FromStandardName(oldLeaf)\n\tdoRenameLeaf := oldLeaf != newLeaf\n\tdoMove := oldDirectoryID != newDirectoryID\n\n\t// Now rename the leaf to a temporary name if we are moving to\n\t// another directory to make sure we don't overwrite something\n\t// in the destination directory by accident\n\tif doRenameLeaf && doMove {\n\t\ttmpLeaf := newLeaf + \".\" + random.String(8)\n\t\titem, err = f.renameLeaf(ctx, isDir, id, tmpLeaf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Move the object to a new directory (with the existing name)\n\t// if required\n\tif doMove {\n\t\tvar info api.MoveFilesResponse\n\t\tmethod := \"doMoveFiles\"\n\t\tif isDir {\n\t\t\tmethod = \"doMoveFolders\"\n\t\t}\n\t\t_, err = f.rpc(ctx, method, params{\n\t\t\t\"fi_ids\": id,\n\t\t\t\"dir_id\": newDirectoryID,\n\t\t}, &info, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to move file to new directory: %w\", err)\n\t\t}\n\t\titem = &info.Item\n\t\terr = f.waitForBackgroundTask(ctx, info.Status.TaskID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Rename the leaf to its final name if required\n\tif doRenameLeaf {\n\t\titem, err = f.renameLeaf(ctx, isDir, id, newLeaf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn item, nil\n}", "title": "" }, { "docid": "abe944d60bbb15c11b880a130198933a", "score": "0.51186013", "text": "func (this *ImageManagerInstance) relocateImage(task *tasks.MaestroTask) {\n\timgp, ok := this.imageops.Load(task.Id)\n\tif ok {\n\t\timg := imgp.(*imageop)\n\t\t// we need to determine the file name for the downloaded image. It should be a single compressed file.\n\t\texists, err := pathExists(img.finalDir)\n\t\tif exists {\n\t\t\tdebugging.DEBUG_OUT(\"IMAGE>>> Image manager will replace image at %s for Job %s\\n\", img.finalDir, img.imageDef.GetJobName())\n\t\t\tlog.MaestroWarnf(\"Image manager will replace image at %s for Job %s\\n\", img.finalDir, img.imageDef.GetJobName())\n\t\t\terr = os.RemoveAll(img.finalDir)\n\t\t\tif err != nil {\n\t\t\t\tdebugging.DEBUG_OUT(\"IMAGE>>> Image Manager: Error removing existing directory: %s - Failing Task (id:%s)\\n\", img.finalDir, task.Id)\n\t\t\t\tlog.MaestroErrorf(\"Image Manager: Error removing existing directory: %s - Failing Task (id:%s)\\n\", img.finalDir, task.Id)\n\t\t\t\ttasks.FailTask(task.Id, &maestroSpecs.APIError{HttpStatusCode: 500, ErrorString: \"Failed to remove existing path\", Detail: \"Path:\" + img.finalDir})\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tdebugging.DEBUG_OUT2(\"IMAGE>>> relocateImage #2\\n\")\n\t\terr = os.MkdirAll(img.finalDir, 0755) //os.ModePerm)\n\t\tif err != nil {\n\t\t\tdebugging.DEBUG_OUT(\"IMAGE>>> Image Manager: Failed to create directory for image: %s - Failing Task (id:%s)\\n\", img.finalDir, task.Id)\n\t\t\tlog.MaestroErrorf(\"Image Manager: Failed to create directory for image: %s - Failing Task (id:%s)\\n\", img.finalDir, task.Id)\n\t\t\ttasks.FailTask(task.Id, &maestroSpecs.APIError{HttpStatusCode: 500, ErrorString: \"Failed to create image directory\", Detail: \"Path:\" + img.finalDir})\n\t\t\treturn\n\t\t}\n\t\tdebugging.DEBUG_OUT2(\"IMAGE>>> relocateImage #3\\n\")\n\t\t// directory created.\n\n\t\t// FIXME FIXME FIXME - hack until APIs in cloud finalized\n\t\tif true { //img.imageDef.GetImageType() == maestroSpecs.IMAGE_TYPE_ZIP || img.imageDef.GetImageType() == maestroSpecs.IMAGE_TYPE_DEVICEJS_ZIP\n\t\t\ttasks.MarkTaskStepAsExecuting(task.Id)\n\t\t\t// spawn a routine to unpack the archive\n\t\t\tdebugging.DEBUG_OUT2(\"IMAGE>>> relocateImage #4 unzip\\n\")\n\t\t\tgo unzipArchive(img.downloadFilepath, img.finalDir, func(err error) {\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.MaestroErrorf(\"Image Manager: Failed to unpack arhive to: %s - Failing Task (id:%s)\\n\", img.finalDir, task.Id)\n\t\t\t\t\ttasks.FailTask(task.Id, &maestroSpecs.APIError{HttpStatusCode: 500, ErrorString: \"Failed to unpack archive\", Detail: err.Error()})\n\t\t\t\t} else {\n\t\t\t\t\tlog.MaestroInfof(\"Image Manager: Archive unpacked at %s\\n\", img.finalDir)\n\t\t\t\t\ttasks.IterateTask(task.Id, nil)\n\t\t\t\t\tthis.registerImage(img)\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tdebugging.DEBUG_OUT2(\"IMAGE>>> relocateImage FAILED test ~310\\n\")\n\t\t\t// don't forget to cleanup\n\t\t\ttasks.FailTask(task.Id, &maestroSpecs.APIError{HttpStatusCode: 500, ErrorString: \"Unsupported Image type\", Detail: \"task id:\" + task.Id})\n\t\t}\n\t} else {\n\t\tdebugging.DEBUG_OUT(\"IMAGE>>> doDownload() --> Could not find image op: %s\\n\", task.Id)\n\t\ttasks.FailTask(task.Id, &maestroSpecs.APIError{HttpStatusCode: 500, ErrorString: \"Image not in table.\", Detail: \"task id:\" + task.Id})\n\t}\n\n}", "title": "" }, { "docid": "2a9770646af18f01ad2d8d9aeea85c55", "score": "0.507368", "text": "func (c *Common) moveFile(from string, to string) error {\n\t// copy the file\n\terr := files.CopyFile(from, to)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// delete the old file\n\terr = os.RemoveAll(from)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9ad4e75c0a9a8dffdda46785a7d06503", "score": "0.50313216", "text": "func path_rename(oldFd int32, oldPath unsafe.Pointer, oldPathLen size, newFd int32, newPath unsafe.Pointer, newPathLen size) Errno", "title": "" }, { "docid": "467be86a65a909e3a49a3e251a663d82", "score": "0.50008017", "text": "func (t *transitioner) swapFile(path string, oldEntry, newEntry *Entry) error {\n\t// Ensure that the path of the target exists (relative to the root) with the\n\t// specificed casing.\n\tif err := t.ensureRouteWithProperCase(path, false); err != nil {\n\t\treturn errors.Wrap(err, \"unable to verify path to target\")\n\t}\n\n\t// Compute the full path to this file.\n\tfullPath := filepath.Join(t.root, path)\n\n\t// Ensure that the existing entry hasn't been modified from what we're\n\t// expecting.\n\tmode, uid, gid, err := t.ensureExpectedFile(path, oldEntry)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to validate existing file\")\n\t}\n\n\t// Compute the new file mode based on the new entry's executability.\n\tif newEntry.Executable {\n\t\tmode = markExecutableForReaders(mode)\n\t} else {\n\t\tmode = stripExecutableBits(mode)\n\t}\n\n\t// If both files have the same contents (differing only in permissions),\n\t// then we won't have staged the file, so we just change the permissions on\n\t// the existing file.\n\tif bytes.Equal(oldEntry.Digest, newEntry.Digest) {\n\t\t// Attempt to change file permissions.\n\t\tif err := os.Chmod(fullPath, mode); err != nil {\n\t\t\treturn errors.Wrap(err, \"unable to change file permissions\")\n\t\t}\n\n\t\t// Success.\n\t\treturn nil\n\t}\n\n\t// Compute the path to the staged file.\n\tstagedPath, err := t.provider.Provide(path, newEntry.Digest)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to locate staged file\")\n\t}\n\n\t// Set the mode for the staged file.\n\tif err := os.Chmod(stagedPath, mode); err != nil {\n\t\treturn errors.Wrap(err, \"unable to set staged file mode\")\n\t}\n\n\t// Set the ownership for the staged file.\n\tif err := filesystem.SetOwnership(stagedPath, uid, gid); err != nil {\n\t\treturn errors.Wrap(err, \"unable to set staged file ownership\")\n\t}\n\n\t// Rename the staged file.\n\tif err := filesystem.RenameFileAtomic(stagedPath, fullPath); err != nil {\n\t\treturn errors.Wrap(err, \"unable to relocate staged file\")\n\t}\n\n\t// Success.\n\treturn nil\n}", "title": "" }, { "docid": "13d04073080555f8b0e3931109be8ecc", "score": "0.4987151", "text": "func Rename(ctx context.Context, oldParent fs.InodeOperations, oldName string, newParent fs.InodeOperations, newName string) error {\n\top, ok := oldParent.(*Dir)\n\tif !ok {\n\t\treturn ErrCrossDevice\n\t}\n\tnp, ok := newParent.(*Dir)\n\tif !ok {\n\t\treturn ErrCrossDevice\n\t}\n\n\tnp.mu.Lock()\n\tdefer np.mu.Unlock()\n\n\t// Check whether the ramfs entry to be replaced is a non-empty directory.\n\tif replaced, ok := np.children[newName]; ok {\n\t\tif fs.IsDir(replaced.StableAttr) {\n\t\t\t// FIXME: simplify by pinning children of ramfs-backed directories\n\t\t\t// in the Dirent tree: this allows us to generalize ramfs operations without\n\t\t\t// relying on an implementation of Readdir (which may do anything, like require\n\t\t\t// that the file be open ... which would be reasonable).\n\t\t\tdirCtx := &fs.DirCtx{}\n\t\t\t_, err := replaced.HandleOps().DeprecatedReaddir(ctx, dirCtx, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tattrs := dirCtx.DentAttrs()\n\n\t\t\t// ramfs-backed directories should not contain \".\" and \"..\", but we do this\n\t\t\t// just in case.\n\t\t\tdelete(attrs, \".\")\n\t\t\tdelete(attrs, \"..\")\n\n\t\t\t// If the directory to be replaced is not empty, reject the rename.\n\t\t\tif len(attrs) != 0 {\n\t\t\t\treturn ErrNotEmpty\n\t\t\t}\n\t\t}\n\t}\n\n\t// Be careful, we may have already grabbed this mutex above.\n\tif op != np {\n\t\top.mu.Lock()\n\t\tdefer op.mu.Unlock()\n\t}\n\n\t// Do the swap.\n\tn := op.children[oldName]\n\top.removeChildLocked(ctx, oldName)\n\tnp.addChildLocked(newName, n)\n\n\t// Update ctime.\n\tn.NotifyStatusChange(ctx)\n\n\treturn nil\n}", "title": "" }, { "docid": "e7bb5e72367da546e840f5adf1bfedd3", "score": "0.4943899", "text": "func (m *Master) RPCRenameFile(args gfs.RenameFileArg, reply *gfs.RenameFileReply) error {\n\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCRenameFile source <%s> target <%s> start\", args.Source, args.Target), gfs.MASTER, m.address)\n\tdefer gfs.DebugMsgToFile(fmt.Sprintf(\"RPCRenameFile source <%s> target <%s> end\", args.Source, args.Target), gfs.MASTER, m.address)\n\tsourceParents := getParents(args.Source)\n\tok, sourceFileMetadatas, err := m.acquireParentsRLocks(sourceParents)\n\tif !ok {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCRenameFile source <%s> target <%s> error <%s>\", args.Source, args.Target, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\tdefer m.unlockParentsRLocks(sourceFileMetadatas)\n\ttargetParents := getParents(args.Target)\n\tok, targetFileMetadatas, err := m.acquireParentsRLocks(targetParents)\n\tif !ok {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCRenameFile source <%s> target <%s> error <%s>\", args.Source, args.Target, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\tdefer m.unlockParentsRLocks(targetFileMetadatas)\n\tsourceFileMetadataFound, sourceExist := m.fileNamespace.Get(args.Source)\n\tif !sourceExist {\n\t\terr = fmt.Errorf(\"source path %s has not existed\", args.Source)\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCRenameFile source <%s> target <%s> error <%s>\", args.Source, args.Target, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\tsourceFileMetadata := sourceFileMetadataFound.(*FileMetadata)\n\tsourceFileMetadata.RLock()\n\tdefer sourceFileMetadata.RUnlock()\n\tif sourceFileMetadata.isDir {\n\t\terr = fmt.Errorf(\"source path %s is not a file\", args.Source)\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCRenameFile source <%s> target <%s> error <%s>\", args.Source, args.Target, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\tsetOk := m.fileNamespace.SetIfAbsent(args.Target, sourceFileMetadata)\n\tif !setOk {\n\t\terr = fmt.Errorf(\"target path %s has already existed\", args.Target)\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCRenameFile source <%s> target <%s> error <%s>\", args.Source, args.Target, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\tm.fileNamespace.Remove(args.Source)\n\treturn nil\n}", "title": "" }, { "docid": "2465ff23e2138f6a97f2c389b45d0315", "score": "0.48953584", "text": "func (s *Storage) MoveFile(fromPath string, toPath string) error {\n\tcanonicalFromPath, err := s.ValidDir(path.Dir(fromPath), false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcanonicalToPath, err := s.ValidDir(path.Dir(toPath), true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfromFileName := path.Base(fromPath)\n\ttoFileName := path.Base(toPath)\n\terr = os.Rename(canonicalFromPath+\"/\"+fromFileName, canonicalToPath+\"/\"+toFileName)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn os.Rename(canonicalFromPath+\"/.\"+fromFileName+\".meta.json\", canonicalToPath+\"/.\"+toFileName+\".meta.json\")\n}", "title": "" }, { "docid": "79c2dfabd270f31c12336cd8ba78cc43", "score": "0.48776582", "text": "func tryMoveFile(sourcePath, destPath string) error {\n\tinputFile, err := os.Open(sourcePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\toutputFile, err := os.Create(destPath)\n\tif err != nil {\n\t\tinputFile.Close()\n\t\treturn err\n\t}\n\tdefer outputFile.Close()\n\t_, err = io.Copy(outputFile, inputFile)\n\tinputFile.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// The copy was successful, so now delete the original file\n\terr = os.Remove(sourcePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fb17d7a83ff3257d3b5abc95f1a2a6c9", "score": "0.48492488", "text": "func (gd *Gdrive) Rename(ctx context.Context, id string, newName string, oldParentID string, newParentID string) (n *Node, err error) {\n\tif (oldParentID == \"\") != (newParentID == \"\") {\n\t\treturn nil, fmt.Errorf(\"Either both oldParentId and newParentId must be blank or they both must be non-blank\")\n\t}\n\tif newName == \"\" && oldParentID == \"\" {\n\t\treturn nil, fmt.Errorf(\"Either set newName, or the parent ids\")\n\t}\n\tfile := &drive.File{}\n\tif newName != \"\" {\n\t\tfile.Name = newName\n\t}\n\tupdateCall := gd.svc.Files.Update(id, file).\n\t\tContext(ctx)\n\tif oldParentID != \"\" {\n\t\tupdateCall.RemoveParents(oldParentID)\n\t\tupdateCall.AddParents(newParentID)\n\t}\n\tupdateCall.Fields(fileFields)\n\tfile, err = updateCall.Do()\n\tif err != nil {\n\t\tlog.Printf(\"Rename Do failed: %v\", err)\n\t\treturn nil, err\n\t}\n\tn, err = newNode(file.Id, file)\n\tif err != nil {\n\t\tlog.Printf(\"Rename newNode failed: %v\", err)\n\t\treturn nil, err\n\t}\n\treturn n, nil\n}", "title": "" }, { "docid": "1f0936ef6dbef72c2122d2c1cff7fd35", "score": "0.48342976", "text": "func (r *resourceMethod) MoveResource(oldNs, newNs, resType string, resourceIDs ...string) error {\n\tif err := r.CopyResource(oldNs, newNs, resType, resourceIDs...); err != nil {\n\t\treturn err\n\t}\n\tif err := r.RemoveResource(oldNs, resType, resourceIDs...); err != nil {\n\t\tr.logger.Errorf(\"DeleteResource resource fail, ns %s, resource type: %s, resourceID: %v, error: %s\",\n\t\t\tnewNs, resType, resourceIDs, err.Error())\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "492b65674071cbfc756c4375deef6d67", "score": "0.48034707", "text": "func (file *File) MoveToTest() error {\n\tif file.isInTemp {\n\t\terr := os.Rename(file.currLocation, file.fileName)\n\t\tif err != nil {\n\t\t\terr = moveFile(file.currLocation, file.fileName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfile.currLocation = file.fileName\n\t\tfile.isInTemp = false\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "91e35802aed792fee0cfdc0a9ff417b7", "score": "0.4796992", "text": "func (fn *FileNode) RenameFile(newpath string) (err error) {\n\torgpath := fn.FPath\n\tnewpath, err = fn.Info.Rename(newpath)\n\tif len(newpath) == 0 || err != nil {\n\t\treturn err\n\t}\n\tif fn.IsDir() {\n\t\tif fn.FRoot.IsDirOpen(orgpath) {\n\t\t\tfn.FRoot.SetDirOpen(gi.FileName(newpath))\n\t\t}\n\t}\n\trepo, _ := fn.Repo()\n\tif repo != nil && fn.Info.Vcs >= vci.Stored {\n\t\terr = repo.Move(string(orgpath), newpath)\n\t} else {\n\t\terr = os.Rename(string(orgpath), newpath)\n\t}\n\tif err == nil {\n\t\terr = fn.Info.InitFile(newpath)\n\t}\n\tif err == nil {\n\t\tfn.FPath = gi.FileName(fn.Info.Path)\n\t\tfn.SetName(fn.Info.Name)\n\t}\n\tfn.UpdateSig()\n\tfn.FRoot.UpdateDir() // need full update\n\treturn err\n}", "title": "" }, { "docid": "e9b9aca732162cd2336e181c195493b2", "score": "0.47640595", "text": "func (t *Tree) MoveResource(oldNs, newNs, resType string, resourceIDs ...string) error {\n\treturn t.resource.MoveResource(oldNs, newNs, resType, resourceIDs...)\n}", "title": "" }, { "docid": "aa7be7b2c43163fe748bf60d3335f3f5", "score": "0.47363263", "text": "func MoveFile(src string, dst string) error {\n\treturn nil\n}", "title": "" }, { "docid": "c943d8136c6750938b8e2a9755a32da4", "score": "0.47317854", "text": "func MoveFile(src, dst string) error {\n\tfi, err := os.Stat(src)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to open src file\")\n\t} else if !fi.Mode().IsRegular() {\n\t\treturn fmt.Errorf(\"source not regular file (mode %s)\", fi.Mode())\n\t}\n\n\t// Try to do a rename first. This only works if we're not moving across filesystems.\n\tif err := os.Rename(src, dst); err == nil {\n\t\treturn nil\n\t} else if lerr, ok := err.(*os.LinkError); !ok || lerr.Err != unix.EXDEV {\n\t\treturn errors.Wrap(err, \"failed to rename src to dst file\")\n\t}\n\n\t// Otherwise, copy before deleting src.\n\tif err := CopyFile(src, dst); err != nil {\n\t\treturn errors.Wrap(err, \"failed to copy src to dst file\")\n\t}\n\treturn os.Remove(src)\n}", "title": "" }, { "docid": "ea17d4f129fc0eabdbd936902e149bbd", "score": "0.4684318", "text": "func moveFile(source, destination string) error {\n\tsourceFile, err := os.Open(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sourceFile.Close()\n\n\tdestFile, err := os.Create(destination)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer destFile.Close()\n\n\tio.Copy(destFile, sourceFile)\n\treturn nil\n}", "title": "" }, { "docid": "ef370596955bcc98032dffe5a51511b2", "score": "0.46510702", "text": "func (service *Service) SafeMoveDirectory(originalPath, newPath string) error {\n\t// 1. Backup the source directory to a different folder\n\tbackupDir := fmt.Sprintf(\"%s-%s\", filepath.Dir(originalPath), \"backup\")\n\terr := MoveDirectory(originalPath, backupDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to backup source directory: %w\", err)\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t// If an error occurred, rollback the backup directory\n\t\t\trestoreErr := restoreBackup(originalPath, backupDir)\n\t\t\tif restoreErr != nil {\n\t\t\t\tlog.Warn().Err(restoreErr).Msg(\"failed to restore backup during creating versioning folder\")\n\t\t\t}\n\t\t}\n\t}()\n\n\t// 2. Copy the backup directory to the destination directory\n\terr = CopyDir(backupDir, newPath, false)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to copy backup directory to destination directory: %w\", err)\n\t}\n\n\t// 3. Delete the backup directory\n\terr = os.RemoveAll(backupDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to delete backup directory: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "14229d9ebe49677ce16d61185fafd22f", "score": "0.4627478", "text": "func MoveFile(src string, dest string) error {\n\n\tbytesRead, err := os.ReadFile(src)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err = os.WriteFile(dest, bytesRead, 0644); err != nil {\n\t\treturn err\n\t}\n\n\treturn os.Remove(src)\n}", "title": "" }, { "docid": "b3a7ed5d984bc0e8d34668d0e8dde27f", "score": "0.46245897", "text": "func MoveFile(src, dst string) (err error) {\n\t// copy\n\tif err = CopyFile(src, dst); err != nil {\n\t\treturn errors.Wrap(err, \"failed to copy file\")\n\t}\n\n\t// delete src file\n\tif err = os.Remove(src); err != nil {\n\t\terrors.Wrap(err, \"failed to remove file\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "aa6d24d42b567bbdbc444fa3bcf61ad1", "score": "0.4624005", "text": "func (cfg *lhcbConfig) RelocateFile(fname string) string {\n\tfname = strings.Replace(fname, \"/opt/lcg/external\", filepath.Join(cfg.siteroot, \"lcg\", \"external\"), 1)\n\tfname = strings.Replace(fname, \"/opt/lcg\", filepath.Join(cfg.siteroot, \"lcg\", \"releases\"), 1)\n\tfname = strings.Replace(fname, \"/opt/LHCbSoft\", cfg.siteroot, 1)\n\treturn fname\n}", "title": "" }, { "docid": "39e3394fe2de4ae31beeb2c51983a79e", "score": "0.4600803", "text": "func (fh *FileHandle) Move(newPath string) error {\n\tif err := os.Rename(fh.Path, newPath); err != nil {\n\t\treturn err\n\t}\n\n\t// update file name / path\n\tfh.Name = filepath.Base(newPath)\n\tfh.Path = newPath\n\treturn nil\n}", "title": "" }, { "docid": "41766d2d6cc6c0fce062a6c1e413f8f6", "score": "0.45710233", "text": "func moveFile(source, destination string) bool {\r\n\terr := os.Rename(source, destination)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t\treturn false\r\n\t}\r\n\treturn true\r\n}", "title": "" }, { "docid": "2b189fe754c342dd6b3ded8258d7129d", "score": "0.45610887", "text": "func renameFile(oldpath, newpath string) error {\n\tb, err := ioutil.ReadFile(oldpath)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = ioutil.WriteFile(newpath, b, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn os.Remove(oldpath)\n}", "title": "" }, { "docid": "ac55cc93182d4824061e98c2018caa67", "score": "0.45491448", "text": "func ReplaceFile(source, destination string) error {\n\tsrc, err := syscall.UTF16PtrFromString(source)\n\tif err != nil {\n\t\treturn &os.LinkError{\"replace\", source, destination, err}\n\t}\n\tdest, err := syscall.UTF16PtrFromString(destination)\n\tif err != nil {\n\t\treturn &os.LinkError{\"replace\", source, destination, err}\n\t}\n\n\t// see http://msdn.microsoft.com/en-us/library/windows/desktop/aa365240(v=vs.85).aspx\n\tif err := moveFileEx(src, dest, movefile_replace_existing|movefile_write_through); err != nil {\n\t\treturn &os.LinkError{\"replace\", source, destination, err}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "92b30852bcf1094f760649b3f4b99d1c", "score": "0.45323467", "text": "func (file File) Rename(newName string) (renamedFile File, err error) {\n\tif file == \"\" {\n\t\treturn \"\", ErrEmptyPath\n\t}\n\tfileSystem, path := file.ParseRawURI()\n\tif strings.ContainsAny(newName, fileSystem.Separator()) {\n\t\treturn \"\", fmt.Errorf(\"newName %#v for File.Rename contains path separator %s\", newName, fileSystem.Separator())\n\t}\n\tswitch fs := fileSystem.(type) {\n\tcase RenameFileSystem:\n\t\tnewPath, err := fs.Rename(path, newName)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn fs.RootDir().Join(newPath), nil\n\tcase MoveFileSystem:\n\t\tdir, _ := fs.SplitDirAndName(path)\n\t\tnewPath := fs.JoinCleanPath(dir, newName)\n\t\terr = fs.Move(path, newPath)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn fs.RootDir().Join(newPath), nil\n\tdefault:\n\t\trenamedFile = file.Dir().Join(newName)\n\t\tif file.IsDir() {\n\t\t\terr = renamedFile.MakeDir()\n\t\t} else {\n\t\t\terr = CopyFile(context.Background(), file, renamedFile)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn renamedFile, file.Remove()\n\t}\n}", "title": "" }, { "docid": "3fd8a5f0cac45c6305992d41712f72a4", "score": "0.45261142", "text": "func moveOldConfig() error {\n\tif os.Getenv(\"XDG_CONFIG_HOME\") == \"\" && runtime.GOOS != \"linux\" {\n\t\treturn nil\n\t}\n\n\tuserHomeDir := getUserHomeDir()\n\n\tp := path.Join(userHomeDir, configDirHidden, configFile)\n\t_, err := os.Stat(p)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to read config file located at: %s\", p)\n\t}\n\n\tnewFile, err := GetConfigFilePath(configFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to read config file located at: %s\", err)\n\t}\n\n\tif err := os.Rename(p, newFile); err != nil {\n\t\treturn fmt.Errorf(\"unable to move %s to %s\", p, newFile)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d9ce60fd41a40be95bd8c668f2165a40", "score": "0.44688663", "text": "func renameFile(oldpath, newpath string) error {\n\treturn os.Rename(oldpath, newpath)\n}", "title": "" }, { "docid": "82422873ec1dc010e374979f4f9d854d", "score": "0.44252387", "text": "func (d *driver) Move(ctx context.Context, sourcePath string, destPath string) error {\n\td.mutex.Lock()\n\tdefer d.mutex.Unlock()\n\n\tnormalizedSrc, normalizedDst := normalize(sourcePath), normalize(destPath)\n\n\terr := d.root.move(normalizedSrc, normalizedDst)\n\tswitch err {\n\tcase errNotExists:\n\t\treturn storagedriver.PathNotFoundError{Path: destPath}\n\tdefault:\n\t\treturn err\n\t}\n}", "title": "" }, { "docid": "4c2f19feb3396f8739f025ebfbabf1f7", "score": "0.44219038", "text": "func (f *File) MoveToLocation(location vfs.Location) (vfs.File, error) {\n\tnewFile, err := f.CopyToLocation(location)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdelErr := f.Delete()\n\treturn newFile, delErr\n}", "title": "" }, { "docid": "8f35eb2dce6f795afc1175c3da42c55a", "score": "0.439501", "text": "func (file *File) MoveToTemp(tempDir string) error {\n\tnewPath := filepath.Join(tempDir, file.fileName)\n\tif !file.isInTemp {\n\t\terr := os.Rename(file.currLocation, newPath)\n\t\tif err != nil {\n\t\t\terr = moveFile(file.currLocation, newPath)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfile.currLocation = newPath\n\t\tfile.isInTemp = true\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9a20532d94b5666ec9917798a086ce6f", "score": "0.43938974", "text": "func reliableRename(srcFilePath, dstFilePath string) (err error) {\n\tif err = reliableMkdirAll(path.Dir(dstFilePath), 0777); err != nil {\n\t\treturn err\n\t}\n\ti := 0\n\tfor {\n\t\t// After a successful parent directory create attempt a renameAll.\n\t\tif err = Rename(srcFilePath, dstFilePath); err != nil {\n\t\t\t// Retry only for the first retryable error.\n\t\t\tif osIsNotExist(err) && i == 0 {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tbreak\n\t}\n\treturn err\n}", "title": "" }, { "docid": "64abdb73dfebacaa0a11f116403bb6bb", "score": "0.43743196", "text": "func MoveToDir(filename, dir, newDir string) error {\n\tpath, _ := os.Getwd()\n\t// define old location and new location to moving file\n\toldLocation := filepath.Join(dir, filename)\n\tnewLocation := filepath.Join(path, newDir+\"/\"+filename)\n\n\t// execute\n\terr := os.Rename(oldLocation, newLocation)\n\tif err != nil {\n\t\t// log.Println(err)\n\t\treturn err\n\t}\n\n\tlog.Println(filename, \"Moved!\")\n\treturn nil\n}", "title": "" }, { "docid": "fdad45d09f71558329808c5d1f150ca5", "score": "0.4363236", "text": "func (file File) MoveTo(destination File) error {\n\treturn Move(context.Background(), file, destination)\n}", "title": "" }, { "docid": "fb903a84662787d5893dd92bf737caf6", "score": "0.4304448", "text": "func (n *Node) ReplaceParent(oldParentID string, newParentID string) (*http.Response, error) {\n\tbody := &replaceParent{\n\t\tFromParent: oldParentID,\n\t\tChildID: *n.Id,\n\t}\n\turl := fmt.Sprintf(\"nodes/%s/children\", newParentID)\n\treq, err := n.service.client.NewMetadataRequest(\"POST\", url, &body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := n.service.client.Do(req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\tn.Parents = []string{newParentID}\n\n\terr = resp.Body.Close()\n\treturn resp, err\n}", "title": "" }, { "docid": "f36d044c4fc264cac5970f8c5652a0eb", "score": "0.429504", "text": "func (s *storefs) Move(oldkey string, r *Record) error {\n\treturn s.fs.Move(oldkey, r.Key())\n}", "title": "" }, { "docid": "5452f7a0dd0b4c9046cdbc3caac2a6f2", "score": "0.42886564", "text": "func (s *Storage) relocateJournal(currentSize, wantedSize, journalSize, journalOffset int64) error {\n\theader := make([]byte, tocSize, tocSize)\n\tif _, err := s.ChunkFile.ReadAt(header, currentSize-tocSize); nil != err {\n\t\treturn fmt.Errorf(\"Failed to read journal header: %v\", err)\n\t}\n\n\tif valid := s.checkJournal(header, true); !valid {\n\t\treturn fmt.Errorf(\"Failed to validate journal header\")\n\t}\n\n\th := (*journalHeader)(unsafe.Pointer(&header[0]))\n\toldJournalOffset := s.ChunkSize * int64(h.maxChunks)\n\toldJournalSize := min(journalSize, currentSize-oldJournalOffset) - tocSize\n\tjournal := make([]byte, journalSize, journalSize)\n\n\tif _, err := s.ChunkFile.ReadAt(journal[:oldJournalSize], oldJournalOffset); nil != err {\n\t\treturn fmt.Errorf(\"Failed to read journal: %v\", err)\n\t}\n\n\ts.initJournal(header)\n\n\tsizeWithoutJournal := currentSize - oldJournalSize - tocSize\n\tif err := s.ChunkFile.Truncate(sizeWithoutJournal); nil != err {\n\t\treturn fmt.Errorf(\"Could not truncate chunk cache journal: %v\", err)\n\t}\n\n\tif err := s.ChunkFile.Truncate(wantedSize); nil != err {\n\t\treturn fmt.Errorf(\"Could not resize chunk cache file: %v\", err)\n\t}\n\n\tif _, err := s.ChunkFile.WriteAt(journal, journalOffset); nil != err {\n\t\treturn fmt.Errorf(\"Failed to write journal: %v\", err)\n\t}\n\tif _, err := s.ChunkFile.WriteAt(header, wantedSize-tocSize); nil != err {\n\t\treturn fmt.Errorf(\"Failed to write journal header: %v\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "371ba156900fab8c4c3a74f1b67d6cf6", "score": "0.42883292", "text": "func (d *Dirent) Move(dst *Dirent) error {\n\tif d.name == \"\" {\n\t\treturn errors.New(\"cannot move unnamed directory\")\n\t}\n\n\tif _, found := dst.children[d.name]; found {\n\t\treturn errors.New(\"entry already exists at destination\")\n\t}\n\n\td.Unlink()\n\tdst.children[d.name] = d\n\td.parent = dst\n\treturn nil\n}", "title": "" }, { "docid": "3c102a4818fb3202e5167e8c2f68a0d8", "score": "0.4273503", "text": "func rename(ctx context.Context, oldParent *fs.Inode, oldName string, newParent *fs.Inode, newName string, replacement bool) error {\n\top, ok := oldParent.InodeOperations.(*Dir)\n\tif !ok {\n\t\treturn syserror.EXDEV\n\t}\n\tnp, ok := newParent.InodeOperations.(*Dir)\n\tif !ok {\n\t\treturn syserror.EXDEV\n\t}\n\treturn ramfs.Rename(ctx, op.ramfsDir, oldName, np.ramfsDir, newName, replacement)\n}", "title": "" }, { "docid": "4d4239a4039b8d822fca499cf6c1f6fb", "score": "0.42704338", "text": "func (px *Posix) FixDir(dxFolder *DxFolder) (*PosixDir, error) {\n\tif px.options.VerboseLevel > 1 {\n\t\tpx.log(\"PosixFixDir %s #objects=%d #subdirs=%d\",\n\t\t\tdxFolder.path,\n\t\t\tlen(dxFolder.dataObjects),\n\t\t\tlen(dxFolder.subdirs))\n\t}\n\n\t// The subdirectories are specified in long paths (\"/A/B/C\"). Leave just\n\t// the last part of the name (\"C\").\n\t//\n\t// Remove all subdirectories that contain a slash\n\tsubdirs := make([]string, 0)\n\tfor _, subDirName := range dxFolder.subdirs {\n\t\t// Make SURE that the subdirectory does not contain a slash.\n\t\tlastPart := strings.TrimPrefix(subDirName, dxFolder.path)\n\t\tlastPart = strings.TrimPrefix(lastPart, \"/\")\n\t\tif strings.Contains(lastPart, \"/\") {\n\t\t\tpx.log(\"Dropping subdirectory %s, it contains a slash\", lastPart)\n\t\t\tcontinue\n\t\t}\n\t\tif lastPart != filepath.Base(subDirName) {\n\t\t\tpx.log(\"Dropping subdirectory %s, it isn't the same as Base(d)=%s\",\n\t\t\t\tlastPart, filepath.Base(subDirName))\n\t\t\tcontinue\n\t\t}\n\n\t\tsubdirs = append(subdirs, filepath.Base(subDirName))\n\t}\n\tif px.options.VerboseLevel > 1 {\n\t\tpx.log(\"subdirs = %v\", subdirs)\n\t}\n\n\t// convert the map into an array. Normalize any non Posix names.\n\tvar allDxObjs []DxDescribeDataObject\n\tfor _, dxObj := range dxFolder.dataObjects {\n\t\tvar objNorm DxDescribeDataObject = dxObj\n\n\t\tif !FilenameIsPosixCompliant(objNorm.Name) {\n\t\t\t// we need to normalize the name\n\t\t\tobjNorm.Name = px.filenameNormalize(objNorm.Name)\n\t\t}\n\t\tallDxObjs = append(allDxObjs, objNorm)\n\t}\n\n\t// TODO: choose the latest object for each name. For example, if we\n\t// have two files named zoo, the toplevel one will be the most recent.\n\tuniqueFileNames := px.uniqueFileNames(allDxObjs)\n\tif px.options.VerboseLevel > 1 {\n\t\tpx.log(\"unique file names=%v\", uniqueFileNames)\n\t}\n\n\tdxObjsPerUniqueFilename := make(map[string][]DxDescribeDataObject)\n\n\t// Create a map of object names to obj describes\n\t// To be used in spreading objects across faux subdirs\n\t// objName: [obj1Desc, obj2Desc]\n\tfor _, dxObj := range allDxObjs {\n\t\tdxObjsPerUniqueFilename[dxObj.Name] = append(dxObjsPerUniqueFilename[dxObj.Name], dxObj)\n\t}\n\n\t// Iteratively, take unique files from the remaining objects, and place them in\n\t// subdirectories 1, 2, 3, ... Be careful to create unused directory names\n\tfauxSubDirs := make(map[string][]DxDescribeDataObject)\n\n\t// choose names for faux subdirs for the worst case where all objects\n\t// have the same name.\n\tvar fauxDirNames []string\n\tmaxNumDirs := len(allDxObjs)\n\tfauxDirNames = px.pickFauxDirNames(subdirs, uniqueFileNames, maxNumDirs)\n\tif px.options.Verbose {\n\t\tpx.log(\"pickFauxDirNames %v\", fauxDirNames)\n\t}\n\n\tsubdirSet := make(map[string]bool)\n\tfor _, dName := range subdirs {\n\t\tsubdirSet[dName] = true\n\t}\n\n\t// Take all the data-objects that have names that aren't already taken\n\t// up by subdirs. They go in the top level\n\tvar topLevelObjs []DxDescribeDataObject\n\tfor _, oName := range uniqueFileNames {\n\t\tdxObjs := px.SortObjectsByCtime(dxObjsPerUniqueFilename[oName])\n\t\tif px.options.VerboseLevel > 1 {\n\t\t\tpx.log(\"name=%s len(objs)=%d\", oName, len(dxObjs))\n\t\t}\n\n\t\t_, ok := subdirSet[oName]\n\t\tif !ok {\n\t\t\t// There is no directory with this name, we\n\t\t\t// place the object at the toplevel\n\t\t\ttopLevelObjs = append(topLevelObjs, dxObjs[0])\n\t\t\tdxObjs = dxObjs[1:]\n\t\t}\n\n\t\t// spread the remaining copies across the faux subdirectories\n\t\tfor i, obj := range dxObjs {\n\t\t\tdName := fauxDirNames[i]\n\t\t\tvec, ok := fauxSubDirs[dName]\n\t\t\tif !ok {\n\t\t\t\t// need to start a new faux subdir called \"dName\"\n\t\t\t\tv := make([]DxDescribeDataObject, 1)\n\t\t\t\tv[0] = obj\n\t\t\t\tfauxSubDirs[dName] = v\n\t\t\t} else {\n\t\t\t\tfauxSubDirs[dName] = append(vec, obj)\n\t\t\t}\n\t\t}\n\t}\n\n\tposixDxFolder := &PosixDir{\n\t\tpath: dxFolder.path,\n\t\tdataObjects: topLevelObjs,\n\t\tsubdirs: subdirs,\n\t\tfauxSubdirs: fauxSubDirs,\n\t}\n\tif px.options.VerboseLevel > 1 {\n\t\tpx.log(\"%v\", posixDxFolder)\n\t}\n\treturn posixDxFolder, nil\n}", "title": "" }, { "docid": "a9e18cb127e2adc15758a8add8cfe7c3", "score": "0.4262233", "text": "func (s *Storage) MoveDir(fromPath string, toPath string) error {\n\tcanonicalFromPath, err := s.ValidDir(fromPath, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tparentToPath := path.Dir(toPath)\n\tfolderName := path.Base(toPath)\n\tcanonicalToPath, err := s.ValidDir(parentToPath, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn os.Rename(canonicalFromPath, canonicalToPath+\"/\"+folderName)\n}", "title": "" }, { "docid": "f1d99173535fda9c7a64a5890a1c7702", "score": "0.42360026", "text": "func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "title": "" }, { "docid": "f48f0808991e2012b25b0d8d8edf8c26", "score": "0.42185163", "text": "func (ft *FileTree) UpdateNewFile(filename string) {\n\tft.OpenDirsTo(filename)\n\tfpath, _ := filepath.Split(filename)\n\tfpath = filepath.Clean(fpath)\n\tif fn, ok := ft.FindFile(filename); ok {\n\t\t// fmt.Printf(\"updating node for file: %v\\n\", filename)\n\t\tfn.UpdateNode()\n\t} else if fn, ok := ft.FindFile(fpath); ok {\n\t\t// fmt.Printf(\"updating node for path: %v\\n\", fpath)\n\t\tfn.UpdateNode()\n\t} else {\n\t\tlog.Printf(\"giv.FileTree UpdateNewFile: no node found for path to update: %v\\n\", filename)\n\t}\n}", "title": "" }, { "docid": "3e7a1341e4722d8ec2da89560abaf6a5", "score": "0.42159885", "text": "func (this *diskIo) truncateFileBeforeId(fileName string, id uint64, elem *diskElem, pos uint64) (string, error) {\n\tnewFileName := this.getFileNameByStartId(id)\n\t//fmt.Println(\"old filename, newfilename:\", fileName, newFileName)\n\n\toldFile, err := os.OpenFile(fileName, os.O_RDONLY, 0)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer oldFile.Close()\n\n\t_, err = oldFile.Seek(int64(pos), 0)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tnewFile, err := os.Create(newFileName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer newFile.Close()\n\n\t//convert start elem to buffer\n\telemBuff := make([]byte, DATA_BLOCK_SIZE)\n\tbinary.BigEndian.PutUint64(elemBuff[DATA_STARTID_POS : DATA_STARTID_POS+ID_LEN], elem.startId)\n\tbinary.BigEndian.PutUint64(elemBuff[DATA_ENDID_POS : DATA_ENDID_POS+ID_LEN], elem.endId)\n\tbinary.BigEndian.PutUint64(elemBuff[DATA_BUFFLEN_POS : DATA_BUFFLEN_POS+SIZE_LEN], uint64(len(elem.buff)))\n\tcopy(elemBuff[DATA_BUFF_POS : DATA_BUFF_POS+uint64(len(elem.buff))], elem.buff)\n\n\t// write to new file\n\tn, err := newFile.Write(elemBuff)\n\tif err != nil {\n\t\treturn \"\", err\n\t} else if uint64(n) != DATA_BLOCK_SIZE {\n\t\treturn \"\", errors.New(\"write elem failed\")\n\t}\n\n\t// loop copy\n\tbuff := make([]byte, IDX_MAX_SECTION_SIZE)\n\tfor {\n\t\t// read\n\t\tnRead, rdErr := oldFile.Read(buff)\n\t\tif rdErr != nil && rdErr != io.EOF {\n\t\t\treturn \"\", rdErr\n\t\t}\n\n\t\t// write\n\t\tnWrite, wrErr := newFile.Write(buff[0 : nRead])\n\t\tif wrErr != nil {\n\t\t\treturn \"\", wrErr\n\t\t} else if nWrite != nRead {\n\t\t\treturn \"\", errors.New(fmt.Sprintf(\"write file error, need to write %d, but actually write %d\\n\", nRead, nWrite))\n\t\t}\n\n\t\t// break if EOF\n\t\tif rdErr == io.EOF || uint64(nRead) != IDX_MAX_SECTION_SIZE {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn newFileName, nil\n}", "title": "" }, { "docid": "8b3b05d6b3d3b68b82b83527b0924fe0", "score": "0.4190766", "text": "func (kord *Chord) MoveFilesCheck(id uint64, fs *FileSystem) {\n\tfilesToPass := fs.MoveInternal(kord.ID, id)\n\tfor name, data := range filesToPass {\n\t\tgo func(predecessor pb.ChordClient, predID uint64, _fileName, _fileData string) {\n\t\t\tlog.Printf(cyan(\"Moving file %v-%v to our predecessor %v\"), _fileName, _fileData, predID)\n\t\t\tres, err := predecessor.MoveFileRPC(context.Background(), &pb.MoveFileArgs{Name: _fileName, Data: _fileData})\n\t\t\tkord.moveFileResponseChan <- MoveFileResponse{ret: res, err: err, predecessorID: predID, fileName: _fileName, fileData: _fileData}\n\t\t}(kord.ringMap[id].conn, id, name, data)\n\t}\n}", "title": "" }, { "docid": "db8e281b0e5d01bc343031185b192ec6", "score": "0.41854164", "text": "func (m *MockClient) MoveFile(srcFilePath, dstFilePath string) error {\n\tret := m.ctrl.Call(m, \"MoveFile\", srcFilePath, dstFilePath)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "6337f47edc31e5af5b441c3a78ce7f28", "score": "0.41821158", "text": "func (m *Master) RPCDeleteFile(args gfs.DeleteFileArg, reply *gfs.DeleteFileReply) error {\n\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCDeleteFile path <%s> start\", args.Path), gfs.MASTER, m.address)\n\tdefer gfs.DebugMsgToFile(fmt.Sprintf(\"RPCDeleteFile path <%s> end\", args.Path), gfs.MASTER, m.address)\n\tparents := getParents(args.Path)\n\tok, fileMetadatas, err := m.acquireParentsRLocks(parents)\n\tif !ok {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCDeleteFile path <%s> error <%s>\", args.Path, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\tdefer m.unlockParentsRLocks(fileMetadatas)\n\tfileMetadataFound, exist := m.fileNamespace.Get(args.Path)\n\tif !exist {\n\t\terr = fmt.Errorf(\"path %s does not exsit\", args.Path)\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCDeleteFile path <%s> error <%s>\", args.Path, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\tvar fileMetadata = fileMetadataFound.(*FileMetadata)\n\tfileMetadata.RLock()\n\tif fileMetadata.isDir {\n\t\tfileMetadata.RUnlock()\n\t\terr = fmt.Errorf(\"path %s is not a file\", args.Path)\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCDeleteFile path <%s> error <%s>\", args.Path, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\tfileMetadata.RUnlock()\n\t// may fail but without error throw\n\tm.fileNamespace.Remove(args.Path)\n\t// lazy delete\n\t// may fail\n\tm.fileNamespace.SetIfAbsent(gfs.DeletedFilePrefix+args.Path, fileMetadata)\n\treturn nil\n}", "title": "" }, { "docid": "4481ee1bef66266e842c3fbe94a937bc", "score": "0.41814727", "text": "func renameFile(oldPath, newPath string) bool {\n\tif err := os.Rename(oldPath, newPath); nil != err {\n\t\tglog.Errorf(\"Renames [%s] failed: [%s]\", oldPath, err.Error())\n\n\t\treturn false\n\t}\n\n\tglog.Infof(\"Renamed [%s] to [%s]\", oldPath, newPath)\n\n\treturn true\n}", "title": "" }, { "docid": "407fb25586f541b1ebd044dfdb0d9ac4", "score": "0.41796", "text": "func (m *MetadataMutation) OldParentID(ctx context.Context) (v int, err error) {\n\tif !m.op.Is(OpUpdateOne) {\n\t\treturn v, errors.New(\"OldParentID is only allowed on UpdateOne operations\")\n\t}\n\tif m.id == nil || m.oldValue == nil {\n\t\treturn v, errors.New(\"OldParentID requires an ID field in the mutation\")\n\t}\n\toldValue, err := m.oldValue(ctx)\n\tif err != nil {\n\t\treturn v, fmt.Errorf(\"querying old value for OldParentID: %w\", err)\n\t}\n\treturn oldValue.ParentID, nil\n}", "title": "" }, { "docid": "b53d365e8b0f8d50f6aaa9a248484040", "score": "0.417098", "text": "func MoveR(src, dst string) error {\n\tvar out error\n\tout = filepath.Walk(src, func(name string, info os.FileInfo, err error) error {\n\t\tif strings.Compare(name, src) != 0 {\n\t\t\td := strings.Replace(name, src, dst, -1)\n\t\t\terr = os.Rename(name, d)\n\t\t}\n\t\treturn err\n\t})\n\treturn out\n}", "title": "" }, { "docid": "4defbd6c319fc136eed212916d8e89a1", "score": "0.4159915", "text": "func (f *File) MoveToFile(file vfs.File) error {\n\tif err := f.CopyToFile(file); err != nil {\n\t\treturn err\n\t}\n\n\treturn f.Delete()\n}", "title": "" }, { "docid": "52ea373cd8cb665c43fc2eae0703e33a", "score": "0.4156388", "text": "func (ops *DxOps) DxRename(\n\tctx context.Context,\n\thttpClient *http.Client,\n\tprojId string,\n\tfileId string,\n\tnewName string) error {\n\tif ops.options.Verbose {\n\t\tops.log(\"file rename %s:%s %s\", projId, fileId, newName)\n\t}\n\n\tvar request RequestRename\n\trequest.ProjId = projId\n\trequest.Name = newName\n\n\tpayload, err := json.Marshal(request)\n\tif err != nil {\n\t\treturn err\n\t}\n\trepJs, err := dxda.DxAPI(\n\t\tctx, httpClient, NumRetriesDefault, &ops.dxEnv,\n\t\tfmt.Sprintf(\"%s/rename\", fileId),\n\t\tstring(payload))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar reply ReplyRename\n\tif err := json.Unmarshal(repJs, &reply); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7ec42a636847c10522757523d6b14fa5", "score": "0.41532242", "text": "func RenameFile(w http.ResponseWriter, r *http.Request) {\n\tdata := map[string]interface{}{\"succ\": true}\n\tdefer util.RetJSON(w, r, data)\n\n\tvar args map[string]interface{}\n\n\tif err := json.NewDecoder(r.Body).Decode(&args); err != nil {\n\t\tglog.Error(err)\n\t\tdata[\"succ\"] = false\n\n\t\treturn\n\t}\n\n\toldPath := args[\"oldPath\"].(string)\n\tnewPath := args[\"newPath\"].(string)\n\tsid := args[\"sid\"].(string)\n\n\twSession := session.WideSessions.Get(sid)\n\n\tif !renameFile(oldPath, newPath) {\n\t\tdata[\"succ\"] = false\n\n\t\twSession.EventQueue.Queue <- &event.Event{Code: event.EvtCodeServerInternalError, Sid: sid,\n\t\t\tData: \"can't rename file \" + oldPath}\n\t}\n}", "title": "" }, { "docid": "fc1e40fa6e70718a9dd526a7ee85a9ac", "score": "0.41212747", "text": "func (d *driver) Move(ctx context.Context, sourcePath string, destPath string) error {\n\turl, err := d.getURL()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn d.client.MoveFile(url, sourcePath, destPath)\n}", "title": "" }, { "docid": "8dcb49fb9ee657561c4663cd9594ad0a", "score": "0.41092858", "text": "func (d *Dirent) Rename(name string) error {\n\tif name == \"/\" {\n\t\tname = \"\"\n\t}\n\tif d.parent != nil {\n\t\tif name == \"\" {\n\t\t\treturn errors.New(\"non-root directory must have name\")\n\t\t}\n\t\tif _, found := d.parent.children[name]; found {\n\t\t\treturn errors.New(\n\t\t\t\t\"another entry with requested name exists in parent\")\n\t\t}\n\t}\n\n\td.name = name\n\treturn nil\n}", "title": "" }, { "docid": "4d3468e91fbc60199586471a27747d2a", "score": "0.41075", "text": "func Rename(from, to string) error {\n\tif err := os.Rename(from, to); err != nil {\n\t\treturn err\n\t}\n\n\t// Directory was renamed; sync parent dir to persist rename.\n\tpdir, err := OpenDir(filepath.Dir(to))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err = Fsync(pdir); err != nil {\n\t\tpdir.Close()\n\t\treturn err\n\t}\n\treturn pdir.Close()\n}", "title": "" }, { "docid": "11b688fc3303b1438c8f140ac7e21eab", "score": "0.4098719", "text": "func (ruo *RestaurantUpdateOne) SetParentID(id int) *RestaurantUpdateOne {\n\truo.mutation.SetParentID(id)\n\treturn ruo\n}", "title": "" }, { "docid": "9bd019e62f8c0df6d2c393475f189adb", "score": "0.40971416", "text": "func (fib *Fib) Relocate(ndtIndex uint64, oldPartition, newPartition uint8,\n\tcb RelocateCallback) (e error) {\n\tlogEntry := log.WithFields(makeLogFields(\"ndtIndex\", ndtIndex,\n\t\t\"oldPartition\", oldPartition, \"newPartition\", newPartition))\n\tif oldPartition == newPartition {\n\t\tlogEntry.Info(\"Relocate noop\")\n\t\treturn nil\n\t}\n\n\te = fib.postCommand(func(rs *urcu.ReadSide) error {\n\t\tif int(oldPartition) >= len(fib.c) {\n\t\t\treturn errors.New(\"bad old partition\")\n\t\t}\n\t\tif int(newPartition) >= len(fib.c) {\n\t\t\treturn errors.New(\"bad new partition\")\n\t\t}\n\n\t\trs.Lock()\n\t\tdefer rs.Unlock()\n\n\t\tvar ctx RelocateContext\n\t\tctx.oldFibC = fib.c[oldPartition]\n\t\tctx.newFibC = fib.c[newPartition]\n\t\tctx.newDynMp = fib.dynMps[newPartition]\n\n\t\t// find old entries\n\t\tfor n, nameV := range fib.sti[ndtIndex] {\n\t\t\tnn := nodeName{NameV: string(nameV), NComps: fib.ndt.GetPrefixLen()}\n\t\t\tn.Walk(nn, func(nn nodeName, node *node) {\n\t\t\t\tname := nn.GetName()\n\t\t\t\tif node.IsEntry || (node.MaxDepth > 0 && nn.NComps == fib.startDepth) {\n\t\t\t\t\toldEntryC := findC(ctx.oldFibC, name.GetValue(), name.ComputeHash())\n\t\t\t\t\tif oldEntryC == nil {\n\t\t\t\t\t\tpanic(fmt.Sprintf(\"entry not found %s\", name))\n\t\t\t\t\t}\n\t\t\t\t\tctx.oldEntriesC = append(ctx.oldEntriesC, oldEntryC)\n\t\t\t\t\tif oldEntryC.dyn != nil {\n\t\t\t\t\t\tctx.nOldDyns++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tlogEntry = logEntry.WithFields(makeLogFields(\"nEntries\", len(ctx.oldEntriesC),\n\t\t\t\"nSubtrees\", len(fib.sti[ndtIndex])))\n\n\t\t// allocate new dyns\n\t\tif ctx.nOldDyns > 0 {\n\t\t\tctx.newDynsC = make([]*C.FibEntryDyn, ctx.nOldDyns)\n\t\t\tif e := ctx.newDynMp.AllocBulk(ctx.newDynsC); e != nil {\n\t\t\t\treturn e\n\t\t\t}\n\t\t}\n\n\t\t// allocate new entries\n\t\tif len(ctx.oldEntriesC) > 0 {\n\t\t\tctx.newEntriesC = make([]*C.FibEntry, len(ctx.oldEntriesC))\n\t\t\tif ok := bool(C.Fib_AllocBulk(ctx.newFibC, &ctx.newEntriesC[0], C.unsigned(len(ctx.newEntriesC)))); !ok {\n\t\t\t\tctx.newDynMp.FreeBulk(ctx.newDynsC)\n\t\t\t\treturn errors.New(\"allocation error\")\n\t\t\t}\n\t\t}\n\n\t\t// insert new entries\n\t\tj := 0\n\t\tfor i, oldEntryC := range ctx.oldEntriesC {\n\t\t\tnewEntryC := ctx.newEntriesC[i]\n\t\t\t*newEntryC = *oldEntryC\n\t\t\tif oldEntryC.dyn != nil {\n\t\t\t\tnewEntryC.dyn = ctx.newDynsC[j]\n\t\t\t\tj++\n\t\t\t\tC.FibEntryDyn_Copy(newEntryC.dyn, oldEntryC.dyn)\n\t\t\t}\n\t\t\tif isNew := fib.insertC(ctx.newFibC, newEntryC); !isNew {\n\t\t\t\tnewEntry := Entry{*oldEntryC}\n\t\t\t\tpanic(fmt.Sprintf(\"entry should not exist %s\", newEntry.GetName()))\n\t\t\t}\n\t\t\tfib.nRelocatingEntriesC++\n\t\t}\n\n\t\t// invoke callback\n\t\tcbErr := cb(&ctx)\n\t\tif cbErr == nil || ctx.NoRevertOnError {\n\t\t\t// erase old entries\n\t\t\tfor _, oldEntryC := range ctx.oldEntriesC {\n\t\t\t\tfib.eraseC(ctx.oldFibC, oldEntryC)\n\t\t\t\tfib.nRelocatingEntriesC--\n\t\t\t}\n\t\t} else {\n\t\t\t// revert: erase new entries\n\t\t\tfor _, newEntryC := range ctx.newEntriesC {\n\t\t\t\tfib.eraseC(ctx.newFibC, newEntryC)\n\t\t\t\tfib.nRelocatingEntriesC--\n\t\t\t}\n\t\t}\n\n\t\treturn cbErr\n\t})\n\n\tif e != nil {\n\t\tlogEntry.WithError(e).Error(\"Relocate\")\n\t} else {\n\t\tlogEntry.Info(\"Relocate\")\n\t}\n\treturn e\n}", "title": "" }, { "docid": "f6e41872382a07c11c6522698e155e3b", "score": "0.40746677", "text": "func (driver *ClientDriver) RenameFile(cc server.ClientContext, from, to string) error {\n\tfrom = driver.baseDir + from\n\tto = driver.baseDir + to\n\treturn os.Rename(from, to)\n}", "title": "" }, { "docid": "4a0bfb3ac95064cc574bba1b8e615df6", "score": "0.40739134", "text": "func RenameDir(id string, path string, name string) {\n\n\tif last := len(path) - 1; last >= 0 && path[last] == '/' {\n\t\tpath = path[:last]\n\t}\n\n\tif IDYaRegistrado(id) {\n\n\t\tNameAux, PathAux := GetDatosPart(id)\n\n\t\tif Existe, Indice := ExisteParticion(PathAux, NameAux); Existe {\n\n\t\t\tfileMBR, err2 := os.OpenFile(PathAux, os.O_RDWR, 0666)\n\t\t\tif err2 != nil {\n\t\t\t\tfmt.Println(err2)\n\t\t\t\tfileMBR.Close()\n\t\t\t}\n\n\t\t\t// Change permissions Linux.\n\t\t\terr2 = os.Chmod(PathAux, 0666)\n\t\t\tif err2 != nil {\n\t\t\t\tlog.Println(err2)\n\t\t\t}\n\n\t\t\t//Leemos el MBR\n\t\t\tDisco1 := estructuras.MBR{}\n\t\t\tDiskSize := int(unsafe.Sizeof(Disco1))\n\t\t\tDiskData := leerBytes(fileMBR, DiskSize)\n\t\t\tbuffer := bytes.NewBuffer(DiskData)\n\t\t\terr := binary.Read(buffer, binary.BigEndian, &Disco1)\n\t\t\tif err != nil {\n\t\t\t\tfileMBR.Close()\n\t\t\t\tfmt.Println(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t//LEER EL SUPERBLOQUE\n\t\t\tInicioParticion := Disco1.Mpartitions[Indice].Pstart\n\t\t\tfileMBR.Seek(int64(InicioParticion+1), 0)\n\t\t\tSB1 := estructuras.Superblock{}\n\t\t\tSBsize := int(unsafe.Sizeof(SB1))\n\t\t\tSBData := leerBytes(fileMBR, SBsize)\n\t\t\tbuffer2 := bytes.NewBuffer(SBData)\n\t\t\terr = binary.Read(buffer2, binary.BigEndian, &SB1)\n\t\t\tif err != nil {\n\t\t\t\tfileMBR.Close()\n\t\t\t\tfmt.Println(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif SB1.MontajesCount > 0 {\n\n\t\t\t\t/////////////////////////////////////////// RECORRER Y BUSCAR FILE\n\n\t\t\t\t//NOS POSICIONAMOS DONDE EMPIEZA EL STRCUT DE LA CARPETA ROOT (primer struct AVD)\n\t\t\t\tApuntadorAVD := SB1.InicioAVDS\n\t\t\t\t//CREAMOS UN STRUCT TEMPORAL\n\t\t\t\tAVDAux := estructuras.AVD{}\n\t\t\t\tSizeAVD := int(unsafe.Sizeof(AVDAux))\n\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\tAnteriorData := leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tvar NombreAnterior [20]byte\n\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t//Vamos a comparar Padres e Hijos\n\t\t\t\tcarpetas := strings.Split(path, \"/\")\n\t\t\t\ti := 1\n\n\t\t\t\tPathCorrecto := true\n\t\t\t\tfor i < len(carpetas)-1 {\n\n\t\t\t\t\tContinuar := true\n\t\t\t\t\t//Recorremos el struct y si el apuntador indirecto a punta a otro AVD tambien lo recorreremos en caso que no se encuentre\n\t\t\t\t\t//el directorio\n\t\t\t\t\tfor Continuar {\n\t\t\t\t\t\t//Iteramos en las 6 posiciones del arreglo de subdirectoios (apuntadores)\n\t\t\t\t\t\tfor x := 0; x < 6; x++ {\n\t\t\t\t\t\t\t//Validamos que el apuntador si esté apuntando a algo\n\t\t\t\t\t\t\tif AVDAux.ApuntadorSubs[x] > 0 {\n\t\t\t\t\t\t\t\t//Con el valor del apuntador leemos un struct AVD\n\t\t\t\t\t\t\t\tAVDHijo := estructuras.AVD{}\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(AVDAux.ApuntadorSubs[x]+int32(1)), 0)\n\t\t\t\t\t\t\t\tHijoData := leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\tbuffer := bytes.NewBuffer(HijoData)\n\t\t\t\t\t\t\t\terr = binary.Read(buffer, binary.BigEndian, &AVDHijo)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Comparamos el nombre del AVD leido con el nombre del directorio que queremos verificar si existe\n\t\t\t\t\t\t\t\t//si existe el directorio retornamos true y el byte donde está dicho AVD\n\t\t\t\t\t\t\t\tvar chars [20]byte\n\t\t\t\t\t\t\t\tcopy(chars[:], carpetas[i])\n\n\t\t\t\t\t\t\t\tif string(AVDHijo.NombreDir[:]) == string(chars[:]) {\n\n\t\t\t\t\t\t\t\t\tApuntadorAVD = int32(AVDAux.ApuntadorSubs[x])\n\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\t\tbuffer2 = bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t\t\t\t\t\ti++\n\t\t\t\t\t\t\t\t\tPathCorrecto = true\n\t\t\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif Continuar == false {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Si el directorio no está en el arreglo de apuntadores directos\n\t\t\t\t\t\t//verificamos si el AVD actual apunta hacia otro AVD con otros 6 apuntadores\n\t\t\t\t\t\tif AVDAux.ApuntadorAVD > 0 {\n\n\t\t\t\t\t\t\t//Leemos el AVD (que se considera contiguo)\n\t\t\t\t\t\t\tfileMBR.Seek(int64(AVDAux.ApuntadorAVD+int32(1)), 0)\n\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Si ya no apunta a otro AVD y llegamos a esta parte, cancelamos el ciclo FOR\n\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif PathCorrecto == false {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif PathCorrecto {\n\n\t\t\t\t\tif YaExiste, ApuntadorSiguiente := ExisteSub(carpetas[len(carpetas)-1], int(ApuntadorAVD), PathAux); YaExiste {\n\n\t\t\t\t\t\tApuntadorCarpeta := int(ApuntadorAVD)\n\n\t\t\t\t\t\tApuntadorAVD = int32(ApuntadorSiguiente)\n\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\tbuffer2 = bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif sesionRoot || EscrituraPropietarioDir(&AVDAux) || EscrituraGrupoDir(&AVDAux, id) || EscrituraOtrosDir(&AVDAux) {\n\n\t\t\t\t\t\t\t//Cambiar el nombre a AVD aux y a sus extensiones si las tuviera\n\n\t\t\t\t\t\t\tif YaExiste, _ := ExisteSub(name, int(ApuntadorCarpeta), PathAux); !YaExiste {\n\n\t\t\t\t\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\n\t\t\t\t\t\t\t\tContinuar := true\n\n\t\t\t\t\t\t\t\tfor Continuar {\n\n\t\t\t\t\t\t\t\t\t//Seteamos el nuevo nombre\n\t\t\t\t\t\t\t\t\tvar NameChars [20]byte\n\t\t\t\t\t\t\t\t\tcopy(NameChars[:], name)\n\t\t\t\t\t\t\t\t\tcopy(AVDAux.NombreDir[:], NameChars[:])\n\n\t\t\t\t\t\t\t\t\t//Ahora toca reescribir el DD en su posición correspondiente\n\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\t\t\t\t\t\tavdp := &AVDAux\n\t\t\t\t\t\t\t\t\tvar binario bytes.Buffer\n\t\t\t\t\t\t\t\t\tbinary.Write(&binario, binary.BigEndian, avdp)\n\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario.Bytes())\n\n\t\t\t\t\t\t\t\t\tif AVDAux.ApuntadorAVD > 0 {\n\t\t\t\t\t\t\t\t\t\tApuntadorAVD = int32(AVDAux.ApuntadorAVD)\n\t\t\t\t\t\t\t\t\t\t//Leemos el AVD (que se considera contiguo)\n\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+int32(1)), 0)\n\t\t\t\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t//Si ya no apunta a otro AVD y llegamos a esta parte, cancelamos el ciclo FOR\n\t\t\t\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//Crear bitacora Ren\n\t\t\t\t\t\t\t\t//Creamos la bitacora para la creación de la carpeta\n\t\t\t\t\t\t\t\tBitacoraAux := estructuras.Bitacora{}\n\t\t\t\t\t\t\t\t//Seteamos el path, en este caso la primera carpeta tiene \"/\" como path\n\t\t\t\t\t\t\t\tvar PathChars [300]byte\n\t\t\t\t\t\t\t\tPathAux := path\n\t\t\t\t\t\t\t\tcopy(PathChars[:], PathAux)\n\t\t\t\t\t\t\t\tcopy(BitacoraAux.Path[:], PathChars[:])\n\t\t\t\t\t\t\t\t//Seteamos el nombre de la operacion encargada de crear carpetas \"Mkdir\"\n\t\t\t\t\t\t\t\tvar OperacionChars [16]byte\n\t\t\t\t\t\t\t\tOperacionAux := \"Ren\"\n\t\t\t\t\t\t\t\tcopy(OperacionChars[:], OperacionAux)\n\t\t\t\t\t\t\t\tcopy(BitacoraAux.Operacion[:], OperacionChars[:])\n\t\t\t\t\t\t\t\t//Seteamos el tipo con un 1 (1 significa carpeta, 2 significa archivo)\n\t\t\t\t\t\t\t\tBitacoraAux.Tipo = 1\n\t\t\t\t\t\t\t\t//Setemos el contenido\n\t\t\t\t\t\t\t\tContenidoRen := name\n\t\t\t\t\t\t\t\tvar ContenidoChars [300]byte\n\t\t\t\t\t\t\t\tcopy(ContenidoChars[:], ContenidoRen)\n\t\t\t\t\t\t\t\tcopy(BitacoraAux.Contenido[:], ContenidoChars[:])\n\t\t\t\t\t\t\t\tBitacoraAux.Size = -1\n\t\t\t\t\t\t\t\t//Seteamo la fecha de creación de la bitácora\n\t\t\t\t\t\t\t\tt := time.Now()\n\t\t\t\t\t\t\t\tvar charsTime [20]byte\n\t\t\t\t\t\t\t\tcadena := t.Format(\"2006-01-02 15:04:05\")\n\t\t\t\t\t\t\t\tcopy(charsTime[:], cadena)\n\t\t\t\t\t\t\t\tcopy(BitacoraAux.Fecha[:], charsTime[:])\n\t\t\t\t\t\t\t\t//Calculamos la posicion en la particion donde debemos escribir la bitacora\n\t\t\t\t\t\t\t\tNumeroBitacoras := int(SB1.TotalBitacoras - SB1.FreeBitacoras)\n\t\t\t\t\t\t\t\t//en este caso al ser la primera bitacora ira al inicio del bloque de bitacoras\n\t\t\t\t\t\t\t\tBitacoraPos := int(SB1.InicioBitacora) + (NumeroBitacoras * int(SB1.SizeBitacora))\n\t\t\t\t\t\t\t\t//Ahora toca escribir el struct Bitacora en su posición correspondiente\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(BitacoraPos+1), 0)\n\t\t\t\t\t\t\t\tbitacorap := &BitacoraAux\n\t\t\t\t\t\t\t\tvar binario8 bytes.Buffer\n\t\t\t\t\t\t\t\tbinary.Write(&binario8, binary.BigEndian, bitacorap)\n\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario8.Bytes())\n\n\t\t\t\t\t\t\t\t//Setear nuevas propiedades del superblock\n\t\t\t\t\t\t\t\tSB1.FreeBitacoras = SB1.FreeBitacoras - int32(1)\n\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(InicioParticion+1), 0)\n\t\t\t\t\t\t\t\t//Reescribiendo el Superbloque\n\t\t\t\t\t\t\t\tsb1 := &SB1\n\t\t\t\t\t\t\t\tvar binario1 bytes.Buffer\n\t\t\t\t\t\t\t\tbinary.Write(&binario1, binary.BigEndian, sb1)\n\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario1.Bytes())\n\t\t\t\t\t\t\t\t//Reescribir el Backup del Superbloque\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(SB1.InicioBitacora+(SB1.SizeBitacora*SB1.TotalBitacoras)+1), 0)\n\t\t\t\t\t\t\t\tsb2 := &SB1\n\t\t\t\t\t\t\t\tvar binario2 bytes.Buffer\n\t\t\t\t\t\t\t\tbinary.Write(&binario2, binary.BigEndian, sb2)\n\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario2.Bytes())\n\n\t\t\t\t\t\t\t\tcolor.Printf(\"@{!c}La carpeta @{!y}%v @{!c}fue renombrada como @{!y}%v @{!c}exitosamente.\\n\", string(NombreAnterior[:]), name)\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcolor.Printf(\"@{!r}Ya existe una carpeta llamada @{!y}%v @{!r}en la carpeta @{!y}%v.\\n\", name, string(NombreAnterior[:]))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\tcolor.Printf(\"@{!r} El usuario @{!y}%v @{!m}no tiene permisos de escritura en la carpeta @{!y}%v.\\n\", idSesion, string(NombreAnterior[:]))\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolor.Printf(\"@{!r}La carpeta @{!y}%v @{!r}no existe.\\n\", carpetas[len(carpetas)-1])\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tcolor.Println(\"@{!r} Error, una o más carpetas padre no existen.\")\n\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tcolor.Println(\"@{!r} La partición indicada no ha sido formateada.\")\n\t\t\t}\n\n\t\t\tfileMBR.Close()\n\n\t\t} else if ExisteL, IndiceL := ExisteParticionLogica(PathAux, NameAux); ExisteL {\n\n\t\t\tfileMBR, err := os.Open(PathAux)\n\t\t\tif err != nil { //validar que no sea nulo.\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tEBRAux := estructuras.EBR{}\n\t\t\tEBRSize := int(unsafe.Sizeof(EBRAux))\n\n\t\t\t//LEER EL SUPERBLOQUE\n\t\t\tInicioParticion := IndiceL + EBRSize\n\t\t\tfileMBR.Seek(int64(InicioParticion+1), 0)\n\t\t\tSB1 := estructuras.Superblock{}\n\t\t\tSBsize := int(unsafe.Sizeof(SB1))\n\t\t\tSBData := leerBytes(fileMBR, SBsize)\n\t\t\tbuffer2 := bytes.NewBuffer(SBData)\n\t\t\terr = binary.Read(buffer2, binary.BigEndian, &SB1)\n\t\t\tif err != nil {\n\t\t\t\tfileMBR.Close()\n\t\t\t\tfmt.Println(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif SB1.MontajesCount > 0 {\n\n\t\t\t\t/////////////////////////////////////////// RECORRER Y BUSCAR FILE\n\n\t\t\t\t//NOS POSICIONAMOS DONDE EMPIEZA EL STRCUT DE LA CARPETA ROOT (primer struct AVD)\n\t\t\t\tApuntadorAVD := SB1.InicioAVDS\n\t\t\t\t//CREAMOS UN STRUCT TEMPORAL\n\t\t\t\tAVDAux := estructuras.AVD{}\n\t\t\t\tSizeAVD := int(unsafe.Sizeof(AVDAux))\n\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\tAnteriorData := leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tvar NombreAnterior [20]byte\n\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t//Vamos a comparar Padres e Hijos\n\t\t\t\tcarpetas := strings.Split(path, \"/\")\n\t\t\t\ti := 1\n\n\t\t\t\tPathCorrecto := true\n\t\t\t\tfor i < len(carpetas)-1 {\n\n\t\t\t\t\tContinuar := true\n\t\t\t\t\t//Recorremos el struct y si el apuntador indirecto a punta a otro AVD tambien lo recorreremos en caso que no se encuentre\n\t\t\t\t\t//el directorio\n\t\t\t\t\tfor Continuar {\n\t\t\t\t\t\t//Iteramos en las 6 posiciones del arreglo de subdirectoios (apuntadores)\n\t\t\t\t\t\tfor x := 0; x < 6; x++ {\n\t\t\t\t\t\t\t//Validamos que el apuntador si esté apuntando a algo\n\t\t\t\t\t\t\tif AVDAux.ApuntadorSubs[x] > 0 {\n\t\t\t\t\t\t\t\t//Con el valor del apuntador leemos un struct AVD\n\t\t\t\t\t\t\t\tAVDHijo := estructuras.AVD{}\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(AVDAux.ApuntadorSubs[x]+int32(1)), 0)\n\t\t\t\t\t\t\t\tHijoData := leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\tbuffer := bytes.NewBuffer(HijoData)\n\t\t\t\t\t\t\t\terr = binary.Read(buffer, binary.BigEndian, &AVDHijo)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Comparamos el nombre del AVD leido con el nombre del directorio que queremos verificar si existe\n\t\t\t\t\t\t\t\t//si existe el directorio retornamos true y el byte donde está dicho AVD\n\t\t\t\t\t\t\t\tvar chars [20]byte\n\t\t\t\t\t\t\t\tcopy(chars[:], carpetas[i])\n\n\t\t\t\t\t\t\t\tif string(AVDHijo.NombreDir[:]) == string(chars[:]) {\n\n\t\t\t\t\t\t\t\t\tApuntadorAVD = int32(AVDAux.ApuntadorSubs[x])\n\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\t\tbuffer2 = bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t\t\t\t\t\ti++\n\t\t\t\t\t\t\t\t\tPathCorrecto = true\n\t\t\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif Continuar == false {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Si el directorio no está en el arreglo de apuntadores directos\n\t\t\t\t\t\t//verificamos si el AVD actual apunta hacia otro AVD con otros 6 apuntadores\n\t\t\t\t\t\tif AVDAux.ApuntadorAVD > 0 {\n\n\t\t\t\t\t\t\t//Leemos el AVD (que se considera contiguo)\n\t\t\t\t\t\t\tfileMBR.Seek(int64(AVDAux.ApuntadorAVD+int32(1)), 0)\n\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Si ya no apunta a otro AVD y llegamos a esta parte, cancelamos el ciclo FOR\n\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif PathCorrecto == false {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif PathCorrecto {\n\n\t\t\t\t\tif YaExiste, ApuntadorSiguiente := ExisteSub(carpetas[len(carpetas)-1], int(ApuntadorAVD), PathAux); YaExiste {\n\n\t\t\t\t\t\tApuntadorCarpeta := int(ApuntadorAVD)\n\n\t\t\t\t\t\tApuntadorAVD = int32(ApuntadorSiguiente)\n\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\tbuffer2 = bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif sesionRoot || EscrituraPropietarioDir(&AVDAux) || EscrituraGrupoDir(&AVDAux, id) || EscrituraOtrosDir(&AVDAux) {\n\n\t\t\t\t\t\t\t//Cambiar el nombre a AVD aux y a sus extensiones si las tuviera\n\n\t\t\t\t\t\t\tif YaExiste, _ := ExisteSub(name, int(ApuntadorCarpeta), PathAux); !YaExiste {\n\n\t\t\t\t\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\n\t\t\t\t\t\t\t\tContinuar := true\n\n\t\t\t\t\t\t\t\tfor Continuar {\n\n\t\t\t\t\t\t\t\t\t//Seteamos el nuevo nombre\n\t\t\t\t\t\t\t\t\tvar NameChars [20]byte\n\t\t\t\t\t\t\t\t\tcopy(NameChars[:], name)\n\t\t\t\t\t\t\t\t\tcopy(AVDAux.NombreDir[:], NameChars[:])\n\n\t\t\t\t\t\t\t\t\t//Ahora toca reescribir el DD en su posición correspondiente\n\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\t\t\t\t\t\tavdp := &AVDAux\n\t\t\t\t\t\t\t\t\tvar binario bytes.Buffer\n\t\t\t\t\t\t\t\t\tbinary.Write(&binario, binary.BigEndian, avdp)\n\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario.Bytes())\n\n\t\t\t\t\t\t\t\t\tif AVDAux.ApuntadorAVD > 0 {\n\t\t\t\t\t\t\t\t\t\tApuntadorAVD = int32(AVDAux.ApuntadorAVD)\n\t\t\t\t\t\t\t\t\t\t//Leemos el AVD (que se considera contiguo)\n\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+int32(1)), 0)\n\t\t\t\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t//Si ya no apunta a otro AVD y llegamos a esta parte, cancelamos el ciclo FOR\n\t\t\t\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//Crear bitacora Ren\n\t\t\t\t\t\t\t\t//Creamos la bitacora para la creación de la carpeta\n\t\t\t\t\t\t\t\tBitacoraAux := estructuras.Bitacora{}\n\t\t\t\t\t\t\t\t//Seteamos el path, en este caso la primera carpeta tiene \"/\" como path\n\t\t\t\t\t\t\t\tvar PathChars [300]byte\n\t\t\t\t\t\t\t\tPathAux := path\n\t\t\t\t\t\t\t\tcopy(PathChars[:], PathAux)\n\t\t\t\t\t\t\t\tcopy(BitacoraAux.Path[:], PathChars[:])\n\t\t\t\t\t\t\t\t//Seteamos el nombre de la operacion encargada de crear carpetas \"Mkdir\"\n\t\t\t\t\t\t\t\tvar OperacionChars [16]byte\n\t\t\t\t\t\t\t\tOperacionAux := \"Ren\"\n\t\t\t\t\t\t\t\tcopy(OperacionChars[:], OperacionAux)\n\t\t\t\t\t\t\t\tcopy(BitacoraAux.Operacion[:], OperacionChars[:])\n\t\t\t\t\t\t\t\t//Seteamos el tipo con un 1 (1 significa carpeta, 2 significa archivo)\n\t\t\t\t\t\t\t\tBitacoraAux.Tipo = 1\n\t\t\t\t\t\t\t\t//Setemos el contenido\n\t\t\t\t\t\t\t\tContenidoRen := name\n\t\t\t\t\t\t\t\tvar ContenidoChars [300]byte\n\t\t\t\t\t\t\t\tcopy(ContenidoChars[:], ContenidoRen)\n\t\t\t\t\t\t\t\tcopy(BitacoraAux.Contenido[:], ContenidoChars[:])\n\t\t\t\t\t\t\t\tBitacoraAux.Size = -1\n\t\t\t\t\t\t\t\t//Seteamo la fecha de creación de la bitácora\n\t\t\t\t\t\t\t\tt := time.Now()\n\t\t\t\t\t\t\t\tvar charsTime [20]byte\n\t\t\t\t\t\t\t\tcadena := t.Format(\"2006-01-02 15:04:05\")\n\t\t\t\t\t\t\t\tcopy(charsTime[:], cadena)\n\t\t\t\t\t\t\t\tcopy(BitacoraAux.Fecha[:], charsTime[:])\n\t\t\t\t\t\t\t\t//Calculamos la posicion en la particion donde debemos escribir la bitacora\n\t\t\t\t\t\t\t\tNumeroBitacoras := int(SB1.TotalBitacoras - SB1.FreeBitacoras)\n\t\t\t\t\t\t\t\t//en este caso al ser la primera bitacora ira al inicio del bloque de bitacoras\n\t\t\t\t\t\t\t\tBitacoraPos := int(SB1.InicioBitacora) + (NumeroBitacoras * int(SB1.SizeBitacora))\n\t\t\t\t\t\t\t\t//Ahora toca escribir el struct Bitacora en su posición correspondiente\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(BitacoraPos+1), 0)\n\t\t\t\t\t\t\t\tbitacorap := &BitacoraAux\n\t\t\t\t\t\t\t\tvar binario8 bytes.Buffer\n\t\t\t\t\t\t\t\tbinary.Write(&binario8, binary.BigEndian, bitacorap)\n\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario8.Bytes())\n\n\t\t\t\t\t\t\t\t//Setear nuevas propiedades del superblock\n\t\t\t\t\t\t\t\tSB1.FreeBitacoras = SB1.FreeBitacoras - int32(1)\n\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(InicioParticion+1), 0)\n\t\t\t\t\t\t\t\t//Reescribiendo el Superbloque\n\t\t\t\t\t\t\t\tsb1 := &SB1\n\t\t\t\t\t\t\t\tvar binario1 bytes.Buffer\n\t\t\t\t\t\t\t\tbinary.Write(&binario1, binary.BigEndian, sb1)\n\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario1.Bytes())\n\t\t\t\t\t\t\t\t//Reescribir el Backup del Superbloque\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(SB1.InicioBitacora+(SB1.SizeBitacora*SB1.TotalBitacoras)+1), 0)\n\t\t\t\t\t\t\t\tsb2 := &SB1\n\t\t\t\t\t\t\t\tvar binario2 bytes.Buffer\n\t\t\t\t\t\t\t\tbinary.Write(&binario2, binary.BigEndian, sb2)\n\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario2.Bytes())\n\n\t\t\t\t\t\t\t\tcolor.Printf(\"@{!c}La carpeta @{!y}%v @{!c}fue renombrada como @{!y}%v @{!c}exitosamente.\\n\", string(NombreAnterior[:]), name)\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcolor.Printf(\"@{!r}Ya existe una carpeta llamada @{!y}%v @{!r}en la carpeta @{!y}%v.\\n\", name, string(NombreAnterior[:]))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\tcolor.Printf(\"@{!r} El usuario @{!y}%v @{!m}no tiene permisos de escritura en la carpeta @{!y}%v.\\n\", idSesion, string(NombreAnterior[:]))\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolor.Printf(\"@{!r}La carpeta @{!y}%v @{!r}no existe.\\n\", carpetas[len(carpetas)-1])\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tcolor.Println(\"@{!r} Error, una o más carpetas padre no existen.\")\n\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tcolor.Println(\"@{!r} La partición indicada no ha sido formateada.\")\n\t\t\t}\n\n\t\t\tfileMBR.Close()\n\n\t\t}\n\n\t} else {\n\t\tcolor.Printf(\"@{!r}No hay ninguna partición montada con el id: @{!y}%v\\n\", id)\n\t}\n\n}", "title": "" }, { "docid": "8ad4091873e1d8ded6f4469d4af96445", "score": "0.4064773", "text": "func (ulm *updateLibraryManager) moveVerifiedUpdate(binary autoupdatableBinary, targetFilename string, stagedUpdate string) error {\n\ttargetVersion := versionFromTarget(binary, targetFilename)\n\tstagedVersionedDirectory, err := agent.MkdirTemp(targetVersion)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not create temporary directory for untarring and validating new update: %w\", err)\n\t}\n\tdefer func() {\n\t\t// In case of error, clean up the staged version\n\t\tif err := os.RemoveAll(stagedVersionedDirectory); err != nil {\n\t\t\tlevel.Debug(ulm.logger).Log(\"msg\", \"could not remove staged update\", \"err\", err, \"directory\", stagedVersionedDirectory)\n\t\t}\n\t}()\n\n\t// Untar the archive. Note that `UntarBundle` calls `filepath.Dir(destination)`, so the inclusion of `binary`\n\t// here doesn't matter as it's immediately stripped off.\n\tif err := fsutil.UntarBundle(filepath.Join(stagedVersionedDirectory, string(binary)), stagedUpdate); err != nil {\n\t\treturn fmt.Errorf(\"could not untar update to %s: %w\", stagedVersionedDirectory, err)\n\t}\n\n\t// Make sure that the binary is executable\n\tif err := os.Chmod(executableLocation(stagedVersionedDirectory, binary), 0755); err != nil {\n\t\treturn fmt.Errorf(\"could not set +x permissions on executable: %w\", err)\n\t}\n\n\t// Validate the executable\n\tif err := autoupdate.CheckExecutable(context.TODO(), executableLocation(stagedVersionedDirectory, binary), \"--version\"); err != nil {\n\t\treturn fmt.Errorf(\"could not verify executable: %w\", err)\n\t}\n\n\t// All good! Shelve it in the library under its version\n\tnewUpdateDirectory := filepath.Join(updatesDirectory(binary, ulm.baseDir), targetVersion)\n\tif err := os.Rename(stagedVersionedDirectory, newUpdateDirectory); err != nil {\n\t\treturn fmt.Errorf(\"could not move staged target %s from %s to %s: %w\", targetFilename, stagedVersionedDirectory, newUpdateDirectory, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a1d7d5113cbc9c49157edca84335283d", "score": "0.4064226", "text": "func renameAll(srcFilePath, dstFilePath string) (err error) {\n\tif srcFilePath == \"\" || dstFilePath == \"\" {\n\t\treturn errInvalidArgument\n\t}\n\n\tif err = checkPathLength(srcFilePath); err != nil {\n\t\treturn err\n\t}\n\tif err = checkPathLength(dstFilePath); err != nil {\n\t\treturn err\n\t}\n\n\tif err = reliableRename(srcFilePath, dstFilePath); err != nil {\n\t\tswitch {\n\t\tcase isSysErrNotDir(err) && !osIsNotExist(err):\n\t\t\t// Windows can have both isSysErrNotDir(err) and osIsNotExist(err) returning\n\t\t\t// true if the source file path contains an inexistant directory. In that case,\n\t\t\t// we want to return errFileNotFound instead, which will honored in subsequent\n\t\t\t// switch cases\n\t\t\treturn errFileAccessDenied\n\t\tcase isSysErrPathNotFound(err):\n\t\t\t// This is a special case should be handled only for\n\t\t\t// windows, because windows API does not return \"not a\n\t\t\t// directory\" error message. Handle this specifically here.\n\t\t\treturn errFileAccessDenied\n\t\tcase isSysErrCrossDevice(err):\n\t\t\treturn fmt.Errorf(\"%w (%s)->(%s)\", errCrossDeviceLink, srcFilePath, dstFilePath)\n\t\tcase osIsNotExist(err):\n\t\t\treturn errFileNotFound\n\t\tcase osIsExist(err):\n\t\t\t// This is returned only when destination is a directory and we\n\t\t\t// are attempting a rename from file to directory.\n\t\t\treturn errIsNotRegular\n\t\tdefault:\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "34eabae0a8991f7d17649b14e8fdd1fa", "score": "0.4062882", "text": "func renameFiles(fileList []os.FileInfo) error {\n\tfor _, fi := range fileList {\n\t\tif fi.IsDir() {\n\t\t\tif string(fi.Name()[0]) == \".\" {\n\t\t\t\t// skip this, it's a hidden directory\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif recursive {\n\t\t\t\tfiles, err := ioutil.ReadDir(fi.Name())\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"Could not list files in %s - %v\", fi.Name(), err)\n\t\t\t\t} else {\n\t\t\t\t\terr := os.Chdir(fi.Name())\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"Could not change working directory to %s, skipping it - %v\", fi.Name(), err)\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t} else {\n\t\t\t\t\t\terr := renameFiles(files)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tlog.Fatalf(\"Could not change to a parent directory we've already been to, failing - %v\", err)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\torig := fi.Name()\n\t\tcamelName := renameFile(orig)\n\t\tif camelName != orig {\n\t\t\tif !pretend {\n\t\t\t\terr := os.Rename(orig, camelName)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"Error renaming %s to %s - %v\", orig, camelName, err)\n\t\t\t\t}\n\t\t\t\tlog.Printf(\"Renamed %s to %s\", orig, camelName)\n\t\t\t} else {\n\t\t\t\tlog.Printf(\"Would have renamed %s to %s\", orig, camelName)\n\t\t\t}\n\t\t} else if verbose {\n\t\t\tlog.Printf(\"Did not have to rename %s\", orig)\n\t\t}\n\t}\n\treturn os.Chdir(\"..\")\n}", "title": "" }, { "docid": "41f4245699d322a53527d0d9c819cf32", "score": "0.40624833", "text": "func renameFile(from, to string) (err error) {\n\terr = os.Rename(from, to)\n\tif err == nil {\n\t\treturn nil\n\t}\n\terr = copyFile(from, to)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = os.RemoveAll(from)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c794bc04f01d4db45e325720d8dcf29d", "score": "0.40578276", "text": "func (o *Archive) SetOriginalArchiveID(v types.ID) {\n\to.OriginalArchiveID = v\n}", "title": "" }, { "docid": "d300cdc598690ab30e29f990139c0c31", "score": "0.40541628", "text": "func RenameFile(id string, path string, name string) {\n\n\tif IDYaRegistrado(id) {\n\n\t\tNameAux, PathAux := GetDatosPart(id)\n\n\t\tif Existe, Indice := ExisteParticion(PathAux, NameAux); Existe {\n\n\t\t\tfileMBR, err2 := os.OpenFile(PathAux, os.O_RDWR, 0666)\n\t\t\tif err2 != nil {\n\t\t\t\tfmt.Println(err2)\n\t\t\t\tfileMBR.Close()\n\t\t\t}\n\n\t\t\t// Change permissions Linux.\n\t\t\terr2 = os.Chmod(PathAux, 0666)\n\t\t\tif err2 != nil {\n\t\t\t\tlog.Println(err2)\n\t\t\t}\n\n\t\t\t//Leemos el MBR\n\t\t\tDisco1 := estructuras.MBR{}\n\t\t\tDiskSize := int(unsafe.Sizeof(Disco1))\n\t\t\tDiskData := leerBytes(fileMBR, DiskSize)\n\t\t\tbuffer := bytes.NewBuffer(DiskData)\n\t\t\terr := binary.Read(buffer, binary.BigEndian, &Disco1)\n\t\t\tif err != nil {\n\t\t\t\tfileMBR.Close()\n\t\t\t\tfmt.Println(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t//LEER EL SUPERBLOQUE\n\t\t\tInicioParticion := Disco1.Mpartitions[Indice].Pstart\n\t\t\tfileMBR.Seek(int64(InicioParticion+1), 0)\n\t\t\tSB1 := estructuras.Superblock{}\n\t\t\tSBsize := int(unsafe.Sizeof(SB1))\n\t\t\tSBData := leerBytes(fileMBR, SBsize)\n\t\t\tbuffer2 := bytes.NewBuffer(SBData)\n\t\t\terr = binary.Read(buffer2, binary.BigEndian, &SB1)\n\t\t\tif err != nil {\n\t\t\t\tfileMBR.Close()\n\t\t\t\tfmt.Println(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif SB1.MontajesCount > 0 {\n\n\t\t\t\t/////////////////////////////////////////// RECORRER Y BUSCAR FILE\n\n\t\t\t\t//NOS POSICIONAMOS DONDE EMPIEZA EL STRCUT DE LA CARPETA ROOT (primer struct AVD)\n\t\t\t\tApuntadorAVD := SB1.InicioAVDS\n\t\t\t\t//CREAMOS UN STRUCT TEMPORAL\n\t\t\t\tAVDAux := estructuras.AVD{}\n\t\t\t\tSizeAVD := int(unsafe.Sizeof(AVDAux))\n\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\tAnteriorData := leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tvar NombreAnterior [20]byte\n\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t//Vamos a comparar Padres e Hijos\n\t\t\t\tcarpetas := strings.Split(path, \"/\")\n\t\t\t\ti := 1\n\n\t\t\t\tPathCorrecto := true\n\t\t\t\tfor i < len(carpetas)-1 {\n\n\t\t\t\t\tContinuar := true\n\t\t\t\t\t//Recorremos el struct y si el apuntador indirecto a punta a otro AVD tambien lo recorreremos en caso que no se encuentre\n\t\t\t\t\t//el directorio\n\t\t\t\t\tfor Continuar {\n\t\t\t\t\t\t//Iteramos en las 6 posiciones del arreglo de subdirectoios (apuntadores)\n\t\t\t\t\t\tfor x := 0; x < 6; x++ {\n\t\t\t\t\t\t\t//Validamos que el apuntador si esté apuntando a algo\n\t\t\t\t\t\t\tif AVDAux.ApuntadorSubs[x] > 0 {\n\t\t\t\t\t\t\t\t//Con el valor del apuntador leemos un struct AVD\n\t\t\t\t\t\t\t\tAVDHijo := estructuras.AVD{}\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(AVDAux.ApuntadorSubs[x]+int32(1)), 0)\n\t\t\t\t\t\t\t\tHijoData := leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\tbuffer := bytes.NewBuffer(HijoData)\n\t\t\t\t\t\t\t\terr = binary.Read(buffer, binary.BigEndian, &AVDHijo)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Comparamos el nombre del AVD leido con el nombre del directorio que queremos verificar si existe\n\t\t\t\t\t\t\t\t//si existe el directorio retornamos true y el byte donde está dicho AVD\n\t\t\t\t\t\t\t\tvar chars [20]byte\n\t\t\t\t\t\t\t\tcopy(chars[:], carpetas[i])\n\n\t\t\t\t\t\t\t\tif string(AVDHijo.NombreDir[:]) == string(chars[:]) {\n\n\t\t\t\t\t\t\t\t\tApuntadorAVD = int32(AVDAux.ApuntadorSubs[x])\n\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\t\tbuffer2 = bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t\t\t\t\t\ti++\n\t\t\t\t\t\t\t\t\tPathCorrecto = true\n\t\t\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif Continuar == false {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Si el directorio no está en el arreglo de apuntadores directos\n\t\t\t\t\t\t//verificamos si el AVD actual apunta hacia otro AVD con otros 6 apuntadores\n\t\t\t\t\t\tif AVDAux.ApuntadorAVD > 0 {\n\n\t\t\t\t\t\t\t//Leemos el AVD (que se considera contiguo)\n\t\t\t\t\t\t\tfileMBR.Seek(int64(AVDAux.ApuntadorAVD+int32(1)), 0)\n\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Si ya no apunta a otro AVD y llegamos a esta parte, cancelamos el ciclo FOR\n\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif PathCorrecto == false {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif PathCorrecto {\n\n\t\t\t\t\t//AHORA DEBEMOS LEER EL DETALLE DIRECTORIO DE DICHO AVD\n\t\t\t\t\tDDAux := estructuras.DD{}\n\t\t\t\t\tPosicionDD := AVDAux.ApuntadorDD\n\t\t\t\t\tSizeDD := int(unsafe.Sizeof(DDAux))\n\t\t\t\t\tfileMBR.Seek(int64(PosicionDD+1), 0)\n\t\t\t\t\tDDData := leerBytes(fileMBR, int(SizeDD))\n\t\t\t\t\tbufferDD := bytes.NewBuffer(DDData)\n\t\t\t\t\terr = binary.Read(bufferDD, binary.BigEndian, &DDAux)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tContinuar := true\n\t\t\t\t\t//Recorremos el struct DD, y si el apuntador indirecto a apunta a otro DD tambien lo recorremos\n\t\t\t\t\t//en caso que no se encuentre el archivo\n\t\t\t\t\tfor Continuar {\n\t\t\t\t\t\t//Iteramos en las 5 posiciones del arreglo de archivos que tiene el DD\n\t\t\t\t\t\tfor i := 0; i < 5; i++ {\n\t\t\t\t\t\t\t//Validamos que el apuntador al inodo si esté apuntando a algo\n\t\t\t\t\t\t\tif DDAux.DDFiles[i].ApuntadorInodo > 0 {\n\t\t\t\t\t\t\t\t//Comparamos el nombre del archivo con el nombre del archivo que queremos verificar si existe\n\t\t\t\t\t\t\t\t//si existe el archivo retornamos true\n\t\t\t\t\t\t\t\tvar chars [20]byte\n\t\t\t\t\t\t\t\tcopy(chars[:], carpetas[len(carpetas)-1])\n\n\t\t\t\t\t\t\t\tif string(DDAux.DDFiles[i].Name[:]) == string(chars[:]) {\n\n\t\t\t\t\t\t\t\t\t//Con el valor del apuntador leemos un struct Inodo\n\t\t\t\t\t\t\t\t\tInodoAux := estructuras.Inodo{}\n\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(DDAux.DDFiles[i].ApuntadorInodo+int32(1)), 0)\n\t\t\t\t\t\t\t\t\tSizeInodo := int(unsafe.Sizeof(InodoAux))\n\t\t\t\t\t\t\t\t\tInodoData := leerBytes(fileMBR, int(SizeInodo))\n\t\t\t\t\t\t\t\t\tbuffer := bytes.NewBuffer(InodoData)\n\t\t\t\t\t\t\t\t\terr := binary.Read(buffer, binary.BigEndian, &InodoAux)\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif sesionRoot || EscrituraPropietarioFile(&InodoAux) || EscrituraGrupoFile(&InodoAux, id) || EscrituraOtrosFile(&InodoAux) {\n\n\t\t\t\t\t\t\t\t\t\tif YaExiste := ExisteFile(name, int(ApuntadorAVD), PathAux); !YaExiste {\n\n\t\t\t\t\t\t\t\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t\t\t\t\t\t\t\t//Seteamos el nuevo nombre\n\t\t\t\t\t\t\t\t\t\t\tvar NameChars [20]byte\n\t\t\t\t\t\t\t\t\t\t\tcopy(NameChars[:], name)\n\t\t\t\t\t\t\t\t\t\t\tcopy(DDAux.DDFiles[i].Name[:], NameChars[:])\n\n\t\t\t\t\t\t\t\t\t\t\t//Ahora toca reescribir el DD en su posición correspondiente\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(PosicionDD+1), 0)\n\t\t\t\t\t\t\t\t\t\t\tddp := &DDAux\n\t\t\t\t\t\t\t\t\t\t\tvar binario bytes.Buffer\n\t\t\t\t\t\t\t\t\t\t\tbinary.Write(&binario, binary.BigEndian, ddp)\n\t\t\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario.Bytes())\n\n\t\t\t\t\t\t\t\t\t\t\t//Crear bitacora Ren\n\t\t\t\t\t\t\t\t\t\t\t//Creamos la bitacora para la creación de la carpeta\n\t\t\t\t\t\t\t\t\t\t\tBitacoraAux := estructuras.Bitacora{}\n\t\t\t\t\t\t\t\t\t\t\t//Seteamos el path, en este caso la primera carpeta tiene \"/\" como path\n\t\t\t\t\t\t\t\t\t\t\tvar PathChars [300]byte\n\t\t\t\t\t\t\t\t\t\t\tPathAux := path\n\t\t\t\t\t\t\t\t\t\t\tcopy(PathChars[:], PathAux)\n\t\t\t\t\t\t\t\t\t\t\tcopy(BitacoraAux.Path[:], PathChars[:])\n\t\t\t\t\t\t\t\t\t\t\t//Seteamos el nombre de la operacion encargada de crear carpetas \"Mkdir\"\n\t\t\t\t\t\t\t\t\t\t\tvar OperacionChars [16]byte\n\t\t\t\t\t\t\t\t\t\t\tOperacionAux := \"Ren\"\n\t\t\t\t\t\t\t\t\t\t\tcopy(OperacionChars[:], OperacionAux)\n\t\t\t\t\t\t\t\t\t\t\tcopy(BitacoraAux.Operacion[:], OperacionChars[:])\n\t\t\t\t\t\t\t\t\t\t\t//Seteamos el tipo con un 1 (1 significa carpeta, 2 significa archivo)\n\t\t\t\t\t\t\t\t\t\t\tBitacoraAux.Tipo = 0\n\t\t\t\t\t\t\t\t\t\t\t//Setemos el contenido\n\t\t\t\t\t\t\t\t\t\t\tContenidoRen := name\n\t\t\t\t\t\t\t\t\t\t\tvar ContenidoChars [300]byte\n\t\t\t\t\t\t\t\t\t\t\tcopy(ContenidoChars[:], ContenidoRen)\n\t\t\t\t\t\t\t\t\t\t\tcopy(BitacoraAux.Contenido[:], ContenidoChars[:])\n\t\t\t\t\t\t\t\t\t\t\tBitacoraAux.Size = 0\n\t\t\t\t\t\t\t\t\t\t\t//Seteamo la fecha de creación de la bitácora\n\t\t\t\t\t\t\t\t\t\t\tt := time.Now()\n\t\t\t\t\t\t\t\t\t\t\tvar charsTime [20]byte\n\t\t\t\t\t\t\t\t\t\t\tcadena := t.Format(\"2006-01-02 15:04:05\")\n\t\t\t\t\t\t\t\t\t\t\tcopy(charsTime[:], cadena)\n\t\t\t\t\t\t\t\t\t\t\tcopy(BitacoraAux.Fecha[:], charsTime[:])\n\t\t\t\t\t\t\t\t\t\t\t//Calculamos la posicion en la particion donde debemos escribir la bitacora\n\t\t\t\t\t\t\t\t\t\t\tNumeroBitacoras := int(SB1.TotalBitacoras - SB1.FreeBitacoras)\n\t\t\t\t\t\t\t\t\t\t\t//en este caso al ser la primera bitacora ira al inicio del bloque de bitacoras\n\t\t\t\t\t\t\t\t\t\t\tBitacoraPos := int(SB1.InicioBitacora) + (NumeroBitacoras * int(SB1.SizeBitacora))\n\t\t\t\t\t\t\t\t\t\t\t//Ahora toca escribir el struct Bitacora en su posición correspondiente\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(BitacoraPos+1), 0)\n\t\t\t\t\t\t\t\t\t\t\tbitacorap := &BitacoraAux\n\t\t\t\t\t\t\t\t\t\t\tvar binario8 bytes.Buffer\n\t\t\t\t\t\t\t\t\t\t\tbinary.Write(&binario8, binary.BigEndian, bitacorap)\n\t\t\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario8.Bytes())\n\n\t\t\t\t\t\t\t\t\t\t\t//Setear nuevas propiedades del superblock\n\t\t\t\t\t\t\t\t\t\t\tSB1.FreeBitacoras = SB1.FreeBitacoras - int32(1)\n\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(InicioParticion+1), 0)\n\t\t\t\t\t\t\t\t\t\t\t//Reescribiendo el Superbloque\n\t\t\t\t\t\t\t\t\t\t\tsb1 := &SB1\n\t\t\t\t\t\t\t\t\t\t\tvar binario1 bytes.Buffer\n\t\t\t\t\t\t\t\t\t\t\tbinary.Write(&binario1, binary.BigEndian, sb1)\n\t\t\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario1.Bytes())\n\t\t\t\t\t\t\t\t\t\t\t//Reescribir el Backup del Superbloque\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(SB1.InicioBitacora+(SB1.SizeBitacora*SB1.TotalBitacoras)+1), 0)\n\t\t\t\t\t\t\t\t\t\t\tsb2 := &SB1\n\t\t\t\t\t\t\t\t\t\t\tvar binario2 bytes.Buffer\n\t\t\t\t\t\t\t\t\t\t\tbinary.Write(&binario2, binary.BigEndian, sb2)\n\t\t\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario2.Bytes())\n\n\t\t\t\t\t\t\t\t\t\t\tcolor.Printf(\"@{!c}El archivo @{!y}%v @{!c}fue renombrado como @{!y}%v @{!c}exitosamente.\\n\", string(chars[:]), name)\n\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tcolor.Printf(\"@{!r}Ya existe un archivo llamado @{!y}%v @{!r}en la carpeta @{!y}%v.\\n\", name, string(NombreAnterior[:]))\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\t\t\t\tcolor.Printf(\"@{!r} El usuario @{!y}%v @{!r}no tiene permisos de escritura sobre el archivo @{!y}%v.\\n\", idSesion, carpetas[len(carpetas)-1])\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\t\t\tbreak\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif Continuar == false {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Si el archivo no está en el arreglo de archivos\n\t\t\t\t\t\t//verificamos si el DD actual apunta hacia otro DD\n\n\t\t\t\t\t\tif DDAux.ApuntadorDD > 0 {\n\n\t\t\t\t\t\t\t//Leemos el DD (que se considera contiguo)\n\t\t\t\t\t\t\tPosicionDD = DDAux.ApuntadorDD\n\t\t\t\t\t\t\tfileMBR.Seek(int64(PosicionDD+int32(1)), 0)\n\t\t\t\t\t\t\tDDData = leerBytes(fileMBR, int(SizeDD))\n\t\t\t\t\t\t\tbufferDD = bytes.NewBuffer(DDData)\n\t\t\t\t\t\t\terr = binary.Read(bufferDD, binary.BigEndian, &DDAux)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Si ya no apunta a otro DD y llegamos a esta parte, cancelamos el ciclo FOR\n\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\tcolor.Println(\"@{!r} El archivo no existe.\")\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tcolor.Println(\"@{!r} Error, una o más carpetas padre no existen.\")\n\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tcolor.Println(\"@{!r} La partición indicada no ha sido formateada.\")\n\t\t\t}\n\n\t\t\tfileMBR.Close()\n\n\t\t} else if ExisteL, IndiceL := ExisteParticionLogica(PathAux, NameAux); ExisteL {\n\n\t\t\tfileMBR, err := os.Open(PathAux)\n\t\t\tif err != nil { //validar que no sea nulo.\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tEBRAux := estructuras.EBR{}\n\t\t\tEBRSize := int(unsafe.Sizeof(EBRAux))\n\n\t\t\t//LEER EL SUPERBLOQUE\n\t\t\tInicioParticion := IndiceL + EBRSize\n\t\t\tfileMBR.Seek(int64(InicioParticion+1), 0)\n\t\t\tSB1 := estructuras.Superblock{}\n\t\t\tSBsize := int(unsafe.Sizeof(SB1))\n\t\t\tSBData := leerBytes(fileMBR, SBsize)\n\t\t\tbuffer2 := bytes.NewBuffer(SBData)\n\t\t\terr = binary.Read(buffer2, binary.BigEndian, &SB1)\n\t\t\tif err != nil {\n\t\t\t\tfileMBR.Close()\n\t\t\t\tfmt.Println(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif SB1.MontajesCount > 0 {\n\n\t\t\t\t/////////////////////////////////////////// RECORRER Y BUSCAR FILE\n\n\t\t\t\t//NOS POSICIONAMOS DONDE EMPIEZA EL STRCUT DE LA CARPETA ROOT (primer struct AVD)\n\t\t\t\tApuntadorAVD := SB1.InicioAVDS\n\t\t\t\t//CREAMOS UN STRUCT TEMPORAL\n\t\t\t\tAVDAux := estructuras.AVD{}\n\t\t\t\tSizeAVD := int(unsafe.Sizeof(AVDAux))\n\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\tAnteriorData := leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tvar NombreAnterior [20]byte\n\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t//Vamos a comparar Padres e Hijos\n\t\t\t\tcarpetas := strings.Split(path, \"/\")\n\t\t\t\ti := 1\n\n\t\t\t\tPathCorrecto := true\n\t\t\t\tfor i < len(carpetas)-1 {\n\n\t\t\t\t\tContinuar := true\n\t\t\t\t\t//Recorremos el struct y si el apuntador indirecto a punta a otro AVD tambien lo recorreremos en caso que no se encuentre\n\t\t\t\t\t//el directorio\n\t\t\t\t\tfor Continuar {\n\t\t\t\t\t\t//Iteramos en las 6 posiciones del arreglo de subdirectoios (apuntadores)\n\t\t\t\t\t\tfor x := 0; x < 6; x++ {\n\t\t\t\t\t\t\t//Validamos que el apuntador si esté apuntando a algo\n\t\t\t\t\t\t\tif AVDAux.ApuntadorSubs[x] > 0 {\n\t\t\t\t\t\t\t\t//Con el valor del apuntador leemos un struct AVD\n\t\t\t\t\t\t\t\tAVDHijo := estructuras.AVD{}\n\t\t\t\t\t\t\t\tfileMBR.Seek(int64(AVDAux.ApuntadorSubs[x]+int32(1)), 0)\n\t\t\t\t\t\t\t\tHijoData := leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\tbuffer := bytes.NewBuffer(HijoData)\n\t\t\t\t\t\t\t\terr = binary.Read(buffer, binary.BigEndian, &AVDHijo)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Comparamos el nombre del AVD leido con el nombre del directorio que queremos verificar si existe\n\t\t\t\t\t\t\t\t//si existe el directorio retornamos true y el byte donde está dicho AVD\n\t\t\t\t\t\t\t\tvar chars [20]byte\n\t\t\t\t\t\t\t\tcopy(chars[:], carpetas[i])\n\n\t\t\t\t\t\t\t\tif string(AVDHijo.NombreDir[:]) == string(chars[:]) {\n\n\t\t\t\t\t\t\t\t\tApuntadorAVD = int32(AVDAux.ApuntadorSubs[x])\n\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(ApuntadorAVD+1), 0)\n\t\t\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\t\t\tbuffer2 = bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t\t\t\t\t\ti++\n\t\t\t\t\t\t\t\t\tPathCorrecto = true\n\t\t\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif Continuar == false {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Si el directorio no está en el arreglo de apuntadores directos\n\t\t\t\t\t\t//verificamos si el AVD actual apunta hacia otro AVD con otros 6 apuntadores\n\t\t\t\t\t\tif AVDAux.ApuntadorAVD > 0 {\n\n\t\t\t\t\t\t\t//Leemos el AVD (que se considera contiguo)\n\t\t\t\t\t\t\tfileMBR.Seek(int64(AVDAux.ApuntadorAVD+int32(1)), 0)\n\t\t\t\t\t\t\tAnteriorData = leerBytes(fileMBR, int(SizeAVD))\n\t\t\t\t\t\t\tbuffer2 := bytes.NewBuffer(AnteriorData)\n\t\t\t\t\t\t\terr = binary.Read(buffer2, binary.BigEndian, &AVDAux)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Si ya no apunta a otro AVD y llegamos a esta parte, cancelamos el ciclo FOR\n\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif PathCorrecto == false {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif PathCorrecto {\n\n\t\t\t\t\t//AHORA DEBEMOS LEER EL DETALLE DIRECTORIO DE DICHO AVD\n\t\t\t\t\tDDAux := estructuras.DD{}\n\t\t\t\t\tPosicionDD := AVDAux.ApuntadorDD\n\t\t\t\t\tSizeDD := int(unsafe.Sizeof(DDAux))\n\t\t\t\t\tfileMBR.Seek(int64(PosicionDD+1), 0)\n\t\t\t\t\tDDData := leerBytes(fileMBR, int(SizeDD))\n\t\t\t\t\tbufferDD := bytes.NewBuffer(DDData)\n\t\t\t\t\terr = binary.Read(bufferDD, binary.BigEndian, &DDAux)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tContinuar := true\n\t\t\t\t\t//Recorremos el struct DD, y si el apuntador indirecto a apunta a otro DD tambien lo recorremos\n\t\t\t\t\t//en caso que no se encuentre el archivo\n\t\t\t\t\tfor Continuar {\n\t\t\t\t\t\t//Iteramos en las 5 posiciones del arreglo de archivos que tiene el DD\n\t\t\t\t\t\tfor i := 0; i < 5; i++ {\n\t\t\t\t\t\t\t//Validamos que el apuntador al inodo si esté apuntando a algo\n\t\t\t\t\t\t\tif DDAux.DDFiles[i].ApuntadorInodo > 0 {\n\t\t\t\t\t\t\t\t//Comparamos el nombre del archivo con el nombre del archivo que queremos verificar si existe\n\t\t\t\t\t\t\t\t//si existe el archivo retornamos true\n\t\t\t\t\t\t\t\tvar chars [20]byte\n\t\t\t\t\t\t\t\tcopy(chars[:], carpetas[len(carpetas)-1])\n\n\t\t\t\t\t\t\t\tif string(DDAux.DDFiles[i].Name[:]) == string(chars[:]) {\n\n\t\t\t\t\t\t\t\t\t//Con el valor del apuntador leemos un struct Inodo\n\t\t\t\t\t\t\t\t\tInodoAux := estructuras.Inodo{}\n\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(DDAux.DDFiles[i].ApuntadorInodo+int32(1)), 0)\n\t\t\t\t\t\t\t\t\tSizeInodo := int(unsafe.Sizeof(InodoAux))\n\t\t\t\t\t\t\t\t\tInodoData := leerBytes(fileMBR, int(SizeInodo))\n\t\t\t\t\t\t\t\t\tbuffer := bytes.NewBuffer(InodoData)\n\t\t\t\t\t\t\t\t\terr := binary.Read(buffer, binary.BigEndian, &InodoAux)\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif sesionRoot || EscrituraPropietarioFile(&InodoAux) || EscrituraGrupoFile(&InodoAux, id) || EscrituraOtrosFile(&InodoAux) {\n\n\t\t\t\t\t\t\t\t\t\tif YaExiste := ExisteFile(name, int(ApuntadorAVD), PathAux); !YaExiste {\n\n\t\t\t\t\t\t\t\t\t\t\tcopy(NombreAnterior[:], AVDAux.NombreDir[:])\n\t\t\t\t\t\t\t\t\t\t\t//Seteamos el nuevo nombre\n\t\t\t\t\t\t\t\t\t\t\tvar NameChars [20]byte\n\t\t\t\t\t\t\t\t\t\t\tcopy(NameChars[:], name)\n\t\t\t\t\t\t\t\t\t\t\tcopy(DDAux.DDFiles[i].Name[:], NameChars[:])\n\n\t\t\t\t\t\t\t\t\t\t\t//Ahora toca reescribir el DD en su posición correspondiente\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(PosicionDD+1), 0)\n\t\t\t\t\t\t\t\t\t\t\tddp := &DDAux\n\t\t\t\t\t\t\t\t\t\t\tvar binario bytes.Buffer\n\t\t\t\t\t\t\t\t\t\t\tbinary.Write(&binario, binary.BigEndian, ddp)\n\t\t\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario.Bytes())\n\n\t\t\t\t\t\t\t\t\t\t\t//Crear bitacora Ren\n\t\t\t\t\t\t\t\t\t\t\t//Creamos la bitacora para la creación de la carpeta\n\t\t\t\t\t\t\t\t\t\t\tBitacoraAux := estructuras.Bitacora{}\n\t\t\t\t\t\t\t\t\t\t\t//Seteamos el path, en este caso la primera carpeta tiene \"/\" como path\n\t\t\t\t\t\t\t\t\t\t\tvar PathChars [300]byte\n\t\t\t\t\t\t\t\t\t\t\tPathAux := path\n\t\t\t\t\t\t\t\t\t\t\tcopy(PathChars[:], PathAux)\n\t\t\t\t\t\t\t\t\t\t\tcopy(BitacoraAux.Path[:], PathChars[:])\n\t\t\t\t\t\t\t\t\t\t\t//Seteamos el nombre de la operacion encargada de crear carpetas \"Mkdir\"\n\t\t\t\t\t\t\t\t\t\t\tvar OperacionChars [16]byte\n\t\t\t\t\t\t\t\t\t\t\tOperacionAux := \"Ren\"\n\t\t\t\t\t\t\t\t\t\t\tcopy(OperacionChars[:], OperacionAux)\n\t\t\t\t\t\t\t\t\t\t\tcopy(BitacoraAux.Operacion[:], OperacionChars[:])\n\t\t\t\t\t\t\t\t\t\t\t//Seteamos el tipo con un 1 (1 significa carpeta, 2 significa archivo)\n\t\t\t\t\t\t\t\t\t\t\tBitacoraAux.Tipo = 0\n\t\t\t\t\t\t\t\t\t\t\t//Setemos el contenido\n\t\t\t\t\t\t\t\t\t\t\tContenidoRen := name\n\t\t\t\t\t\t\t\t\t\t\tvar ContenidoChars [300]byte\n\t\t\t\t\t\t\t\t\t\t\tcopy(ContenidoChars[:], ContenidoRen)\n\t\t\t\t\t\t\t\t\t\t\tcopy(BitacoraAux.Contenido[:], ContenidoChars[:])\n\t\t\t\t\t\t\t\t\t\t\tBitacoraAux.Size = 0\n\t\t\t\t\t\t\t\t\t\t\t//Seteamo la fecha de creación de la bitácora\n\t\t\t\t\t\t\t\t\t\t\tt := time.Now()\n\t\t\t\t\t\t\t\t\t\t\tvar charsTime [20]byte\n\t\t\t\t\t\t\t\t\t\t\tcadena := t.Format(\"2006-01-02 15:04:05\")\n\t\t\t\t\t\t\t\t\t\t\tcopy(charsTime[:], cadena)\n\t\t\t\t\t\t\t\t\t\t\tcopy(BitacoraAux.Fecha[:], charsTime[:])\n\t\t\t\t\t\t\t\t\t\t\t//Calculamos la posicion en la particion donde debemos escribir la bitacora\n\t\t\t\t\t\t\t\t\t\t\tNumeroBitacoras := int(SB1.TotalBitacoras - SB1.FreeBitacoras)\n\t\t\t\t\t\t\t\t\t\t\t//en este caso al ser la primera bitacora ira al inicio del bloque de bitacoras\n\t\t\t\t\t\t\t\t\t\t\tBitacoraPos := int(SB1.InicioBitacora) + (NumeroBitacoras * int(SB1.SizeBitacora))\n\t\t\t\t\t\t\t\t\t\t\t//Ahora toca escribir el struct Bitacora en su posición correspondiente\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(BitacoraPos+1), 0)\n\t\t\t\t\t\t\t\t\t\t\tbitacorap := &BitacoraAux\n\t\t\t\t\t\t\t\t\t\t\tvar binario8 bytes.Buffer\n\t\t\t\t\t\t\t\t\t\t\tbinary.Write(&binario8, binary.BigEndian, bitacorap)\n\t\t\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario8.Bytes())\n\n\t\t\t\t\t\t\t\t\t\t\t//Setear nuevas propiedades del superblock\n\t\t\t\t\t\t\t\t\t\t\tSB1.FreeBitacoras = SB1.FreeBitacoras - int32(1)\n\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(InicioParticion+1), 0)\n\t\t\t\t\t\t\t\t\t\t\t//Reescribiendo el Superbloque\n\t\t\t\t\t\t\t\t\t\t\tsb1 := &SB1\n\t\t\t\t\t\t\t\t\t\t\tvar binario1 bytes.Buffer\n\t\t\t\t\t\t\t\t\t\t\tbinary.Write(&binario1, binary.BigEndian, sb1)\n\t\t\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario1.Bytes())\n\t\t\t\t\t\t\t\t\t\t\t//Reescribir el Backup del Superbloque\n\t\t\t\t\t\t\t\t\t\t\tfileMBR.Seek(int64(SB1.InicioBitacora+(SB1.SizeBitacora*SB1.TotalBitacoras)+1), 0)\n\t\t\t\t\t\t\t\t\t\t\tsb2 := &SB1\n\t\t\t\t\t\t\t\t\t\t\tvar binario2 bytes.Buffer\n\t\t\t\t\t\t\t\t\t\t\tbinary.Write(&binario2, binary.BigEndian, sb2)\n\t\t\t\t\t\t\t\t\t\t\tescribirBytes(fileMBR, binario2.Bytes())\n\n\t\t\t\t\t\t\t\t\t\t\tcolor.Printf(\"@{!c}El archivo @{!y}%v @{!c}fue renombrado como @{!y}%v @{!c}exitosamente.\\n\", string(chars[:]), name)\n\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tcolor.Printf(\"@{!r}Ya existe un archivo llamado @{!y}%v @{!r}en la carpeta @{!y}%v.\\n\", name, string(NombreAnterior[:]))\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tPathCorrecto = false\n\t\t\t\t\t\t\t\t\t\tcolor.Printf(\"@{!r} El usuario @{!y}%v @{!r}no tiene permisos de escritura sobre el archivo @{!y}%v.\\n\", idSesion, carpetas[len(carpetas)-1])\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\t\t\tbreak\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif Continuar == false {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Si el archivo no está en el arreglo de archivos\n\t\t\t\t\t\t//verificamos si el DD actual apunta hacia otro DD\n\n\t\t\t\t\t\tif DDAux.ApuntadorDD > 0 {\n\n\t\t\t\t\t\t\t//Leemos el DD (que se considera contiguo)\n\t\t\t\t\t\t\tPosicionDD = DDAux.ApuntadorDD\n\t\t\t\t\t\t\tfileMBR.Seek(int64(PosicionDD+int32(1)), 0)\n\t\t\t\t\t\t\tDDData = leerBytes(fileMBR, int(SizeDD))\n\t\t\t\t\t\t\tbufferDD = bytes.NewBuffer(DDData)\n\t\t\t\t\t\t\terr = binary.Read(bufferDD, binary.BigEndian, &DDAux)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tfileMBR.Close()\n\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Si ya no apunta a otro DD y llegamos a esta parte, cancelamos el ciclo FOR\n\t\t\t\t\t\t\tContinuar = false\n\t\t\t\t\t\t\tcolor.Println(\"@{!r} El archivo no existe.\")\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tcolor.Println(\"@{!r} Error, una o más carpetas padre no existen.\")\n\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tcolor.Println(\"@{!r} La partición indicada no ha sido formateada.\")\n\t\t\t}\n\n\t\t\tfileMBR.Close()\n\n\t\t}\n\n\t} else {\n\t\tcolor.Printf(\"@{!r}No hay ninguna partición montada con el id: @{!y}%v\\n\", id)\n\t}\n\n}", "title": "" }, { "docid": "60587dc4632ca86a051f84f97992cbd7", "score": "0.4043865", "text": "func (ru *RestaurantUpdate) SetParentID(id int) *RestaurantUpdate {\n\tru.mutation.SetParentID(id)\n\treturn ru\n}", "title": "" }, { "docid": "194154f476cb3302e8afbaeff9bf4978", "score": "0.40387028", "text": "func (s *Space) RelocateData(d DataItem, ncID uint64) (node.Node, uint64, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\treturn s.relocateData(d, ncID)\n}", "title": "" }, { "docid": "a6b55e13e998a9397833caad621d0e8b", "score": "0.40376788", "text": "func checkIfExistsAndUpdate(srcID int, allsrc *FileRaw, resFile *[]Directory) {\n\tif srcID >= 0 && (*resFile)[srcID].ID == 0 {\n\t\tparentPtr := &((*allsrc)[srcID])\n\t\t(*resFile)[srcID].update(parentPtr, allsrc, resFile)\n\t}\n}", "title": "" }, { "docid": "93ca7420211b73ad06467a244ab88ed8", "score": "0.40366656", "text": "func Move(name, dest string) (int64, error) {\n\treturn file.Move(name, dest)\n}", "title": "" }, { "docid": "14390d1f7c04c1ddc894a956d296e892", "score": "0.401844", "text": "func TestFileSet_RenameOpen(t *testing.T) {\n\tentry, fs := newTestFileSet(t)\n\tprevDxPath := entry.metadata.DxPath\n\tnewDxPath := randomDxPath()\n\terr := fs.Rename(prevDxPath, newDxPath)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texist := fs.Exists(prevDxPath)\n\tif exist {\n\t\tt.Errorf(\"After rename, the previous dxPath should not exist\")\n\t}\n\texist2 := fs.Exists(newDxPath)\n\tif !exist2 {\n\t\tt.Errorf(\"After rename, the new dxPath should exists\")\n\t}\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := os.Stat(string(testDir.Join(prevDxPath))); !os.IsNotExist(err) {\n\t\tt.Errorf(\"After rename, previous dxPath file should not exist: %v\", err)\n\t}\n\tif _, err := os.Stat(string(testDir.Join(newDxPath)) + storage.DxFileExt); err != nil {\n\t\tt.Errorf(\"After rename, the new dxPath file should exist: %v\", err)\n\t}\n\tif len(fs.filesMap) != 1 {\n\t\tt.Errorf(\"after rename, the size of filesMap is not 1: %d\", len(fs.filesMap))\n\t}\n\terr = entry.Close()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(fs.filesMap) != 0 {\n\t\tt.Errorf(\"After closing all entries, the size of filesMap is not 0: %d\", len(fs.filesMap))\n\t}\n\tnewEntry, err := fs.Open(newDxPath)\n\tif err != nil {\n\t\tt.Errorf(\"After rename, open the new file give error: %v\", err)\n\t}\n\tif len(fs.filesMap) != 1 {\n\t\tt.Errorf(\"After open the renamed file, filesmap size not 1: %d\", len(fs.filesMap))\n\t}\n\terr = newEntry.Close()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "bccbd9a06a5ef3d6be3875e1c2d798f0", "score": "0.40127304", "text": "func (e *Engine) UpdateFile(req *UpdateFileRequest) (file *domain.File, err error) {\n\tfile, err = e.sqlClient.FindFileBySlug(req.Slug)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif file.UserID != req.UserID {\n\t\terr = errors.New(\"You don't have permission to edit it\")\n\t\treturn\n\t}\n\n\tpath := file.Path\n\tif req.FileName != \"\" {\n\t\tpath = fmt.Sprintf(\"%d/%s/%s\", req.UserID, req.Slug, req.FileName)\n\t\terr = e.awsClient.UploadToS3(req.File, path)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tencryptedPassword := \"\"\n\tif req.Password != \"\" {\n\t\tencryptedPassword = domain.Encrypt(req.Password)\n\t}\n\tstatus := req.Status\n\tif status == \"\" {\n\t\tstatus = file.Status\n\t}\n\n\terr = e.sqlClient.UpdateFile(file, &domain.File{\n\t\tEncryptedPassword: encryptedPassword,\n\t\tPath: path,\n\t\tDownloadLimit: req.DownloadLimit,\n\t\tStatus: status,\n\t})\n\treturn\n}", "title": "" }, { "docid": "b123baa7dfdd7116c623fc51c27fe3fa", "score": "0.40085208", "text": "func (r *ReindexDestination) Parent(parent string) *ReindexDestination {\r\n\tr.parent = parent\r\n\treturn r\r\n}", "title": "" }, { "docid": "6f86d9b53307a8bbe8c42348aa940da1", "score": "0.39955923", "text": "func (f *finisher) parentID(fileName, dirID string) (parentID string, err error) {\n\tparent, err := f.files.ByPath(fileName, dirID)\n\n\tif parent != nil {\n\t\tparentID = parent.ID\n\t}\n\n\tif err != nil && err == app.ErrNotFound {\n\t\t// No matching file found so return empty parentID\n\t\treturn \"\", nil\n\t}\n\n\treturn parentID, err\n}", "title": "" }, { "docid": "237182a2aedb671eb8febd5deda17c65", "score": "0.39882955", "text": "func FileReplace(path string, data []byte, fmode os.FileMode) error {\n\n\tpath = filepath.FromSlash(path)\n\n\tpathOld := path + \".old\"\n\tpathNew := path + \".new\"\n\n\te, err := FileExists(pathOld)\n\tif err != nil {\n\t\treturn mdp.ErrorNew(\"FileReplace Check old file \"+pathOld, err)\n\t}\n\tif e {\n\t\terr = os.Remove(pathOld)\n\t\tif err != nil {\n\t\t\treturn mdp.ErrorNew(\"FileReplace Remove old file (1) \"+pathOld, err)\n\t\t}\n\t}\n\n\te, err = FileExists(pathNew)\n\tif err != nil {\n\t\treturn mdp.ErrorNew(\"FileReplace Check new file \"+pathNew, err)\n\t}\n\tif e {\n\t\terr = os.Remove(pathNew)\n\t\tif err != nil {\n\t\t\treturn mdp.ErrorNew(\"FileReplace Remove new file \"+pathNew, err)\n\t\t}\n\t}\n\n\terr = ioutil.WriteFile(pathNew, data, fmode)\n\tif err != nil {\n\t\treturn mdp.ErrorNew(\"FileReplace Write new file \"+pathNew, err)\n\t}\n\n\te, err = FileExists(path)\n\tif err != nil {\n\t\treturn mdp.ErrorNew(\"FileReplace Check file \"+path, err)\n\t}\n\tif e {\n\t\terr = os.Rename(path, pathOld)\n\t\tif err != nil {\n\t\t\treturn mdp.ErrorNew(\"FileReplace move \"+path+\" to new file \"+pathOld, err)\n\t\t}\n\t}\n\n\terr = os.Rename(pathNew, path)\n\tif err != nil {\n\t\treturn mdp.ErrorNew(\"FileReplace move new file \"+pathNew+\" to \"+path, err)\n\t}\n\n\te, err = FileExists(pathOld)\n\tif err != nil {\n\t\treturn mdp.ErrorNew(\"FileReplace Check old file \"+pathOld, err)\n\t}\n\tif e {\n\t\terr = os.Remove(pathOld)\n\t\tif err != nil {\n\t\t\treturn mdp.ErrorNew(\"FileReplace Remove old file (2) \"+pathOld, err)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9a312e9a045bd2e39902540a8f3cf049", "score": "0.39797038", "text": "func moveFileContents(src, dst string) (err error) {\n\tcloseInFile := true\n\tin, err := os.Open(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif closeInFile {\n\t\t\tin.Close()\n\t\t}\n\t}()\n\tout, err := os.Create(dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tcerr := out.Close()\n\t\tif err == nil {\n\t\t\terr = cerr\n\t\t}\n\t}()\n\tif _, err = io.Copy(out, in); err != nil {\n\t\treturn err\n\t}\n\terr = out.Sync()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tin.Close()\n\tcloseInFile = false\n\tos.Remove(src)\n\treturn nil\n}", "title": "" }, { "docid": "86a87a9f5517e38adb6ceb1d76161173", "score": "0.39746377", "text": "func (m *UserMutation) OldParentID(ctx context.Context) (v int, err error) {\n\tif !m.op.Is(OpUpdateOne) {\n\t\treturn v, errors.New(\"OldParentID is only allowed on UpdateOne operations\")\n\t}\n\tif m.id == nil || m.oldValue == nil {\n\t\treturn v, errors.New(\"OldParentID requires an ID field in the mutation\")\n\t}\n\toldValue, err := m.oldValue(ctx)\n\tif err != nil {\n\t\treturn v, fmt.Errorf(\"querying old value for OldParentID: %w\", err)\n\t}\n\treturn oldValue.ParentID, nil\n}", "title": "" }, { "docid": "5c2bc5b52c493e37ab5e3d741f6952a4", "score": "0.39704043", "text": "func (c *Client) FileRestart(gameID int, size int64, checksum string) (*files.RestartResult, error) {\n\treturn files.Restart(c.client, gameID, size, checksum)\n}", "title": "" }, { "docid": "b97813bf9076067021cf287f7e43f71a", "score": "0.3966287", "text": "func (fsm *FSManager) Move(oldname string, newname string) error {\n\tpage, err := Load(oldname)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = Save(newname, page.Title, page.Content)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = Delete(oldname)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d72200674bf881842dc8f39182f36b4e", "score": "0.3961206", "text": "func (root *CategoryRoot) Move(catID string, NewParent *Category) {\n\tcurrentCat, currentParent := root.FindChildByID(catID)\n\t//If parent is null, this is moving out of root\n\tif currentParent.ID == \"\" {\n\t\troot.RemoveChildByID(currentCat.ID)\n\t} else {\n\t\tcurrentParent.RemoveChildByID(currentCat.ID)\n\t}\n\t//If New Parent is null this is moving into root\n\tif NewParent.ID == \"\" {\n\t\troot.AddChild(*currentCat)\n\t} else {\n\t\tNewParent.AddChild(*currentCat)\n\t}\n}", "title": "" }, { "docid": "22abf6a9c04ece5f5a9741736d226b4f", "score": "0.39596462", "text": "func UpdatePackage(currentPath, targetPath, updateHash string) error {\n\n\t//verify target dir permission\n\tif err := CheckPermissions(targetPath); err != nil {\n\t\treturn err\n\t}\n\n\t//verify sha signature, TODO: refactor\n\tfmt.Printf(\"verified sha signature of %s\\n\", targetPath)\n\t//if updateHash != string(GenerateSha256(targetPath)) {\n\t//\treturn errors.New(\"sha hash cannot be verified of target file\")\n\t//}\n\n\texecDir := filepath.Dir(currentPath)\n\texecFilename := filepath.Base(currentPath)\n\n\t// prepare update\n\n\t// get the directory the executable exists in\n\tupdateDir := filepath.Dir(targetPath)\n\ttargetFilename := filepath.Base(targetPath)\n\n\t// Copy the contents of newbinary to a new executable file\n\tfpTarget, err := os.Open(targetPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fpTarget.Close()\n\n\tnewPath := filepath.Join(updateDir, fmt.Sprintf(\".%s.new\", targetFilename))\n\tfpNew, err := os.OpenFile(newPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = io.Copy(fpNew, fpTarget)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// close here to avoid os problems in move\n\tfpNew.Close()\n\tfmt.Printf(\"target update(%s) copied to (%s)\\n\", targetPath, newPath)\n\n\t// this is where we'll move the executable to so that we can swap in the updated replacement\n\toldPath := filepath.Dir(targetPath)\n\toldPath = filepath.Join(execDir, fmt.Sprintf(\".%s.old\", execFilename))\n\n\t// delete any existing old exec file from last update\n\tif err = os.Remove(oldPath); err == nil {\n\t\tfmt.Printf(\"cleaned old update file found on (%s)\\n\", oldPath)\n\t}\n\n\t// move the existing executable to a new file with .old suffix in the same directory\n\terr = os.Rename(currentPath, oldPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"backup current exec file(%s) to (%s)\\n\", currentPath, oldPath)\n\n\t// move the new exectuable in to become the new program\n\terr = os.Rename(newPath, currentPath)\n\tfmt.Printf(\"moved new update file(%s) to target location(%s)\\n\", newPath, currentPath)\n\n\tif err != nil {\n\t\t// move unsuccessful\n\t\t//\n\t\t// The filesystem is now in a bad state. We have successfully\n\t\t// moved the existing binary to a new location, but we couldn't move the new\n\t\t// binary to take its place. That means there is no file where the current executable binary\n\t\t// used to be!\n\t\t// Try to rollback by restoring the old binary to its original path.\n\t\trerr := os.Rename(oldPath, targetPath)\n\t\tif rerr != nil {\n\t\t\treturn rerr\n\t\t}\n\n\t\treturn err\n\t}\n\n\t// move successful, remove the old binary\n\treturn os.Remove(oldPath)\n}", "title": "" }, { "docid": "0bdaca525bd131309b18811bcdde6c9e", "score": "0.39500624", "text": "func fsRenameFile(ctx context.Context, sourcePath, destPath string) error {\n\tif err := checkPathLength(sourcePath); err != nil {\n\t\tlogger.LogIf(ctx, err)\n\t\treturn err\n\t}\n\tif err := checkPathLength(destPath); err != nil {\n\t\tlogger.LogIf(ctx, err)\n\t\treturn err\n\t}\n\n\tif err := renameAll(sourcePath, destPath); err != nil {\n\t\tlogger.LogIf(ctx, err)\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2c27880087497a7dfa91f8f3b4bfcadc", "score": "0.39443704", "text": "func (fs *FileSystem) UpdateDirMetadata(siaPath modules.SiaPath, metadata siadir.Metadata) (err error) {\n\tdir, err := fs.OpenSiaDir(siaPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\terr = errors.Compose(err, dir.Close())\n\t}()\n\treturn dir.UpdateMetadata(metadata)\n}", "title": "" }, { "docid": "dc6651287fbd7a0f88ddacea9efdd1a5", "score": "0.39381066", "text": "func (fs *FileSystem) managedDeleteFile(relPath string) (err error) {\n\t// Open the folder that contains the file.\n\tdirPath, fileName := filepath.Split(relPath)\n\tvar dir *DirNode\n\tif dirPath == string(filepath.Separator) || dirPath == \".\" || dirPath == \"\" {\n\t\tdir = &fs.DirNode // file is in the root dir\n\t} else {\n\t\tvar err error\n\t\tdir, err = fs.managedOpenDir(filepath.Dir(relPath))\n\t\tif err != nil {\n\t\t\treturn errors.AddContext(err, \"failed to open parent dir of file\")\n\t\t}\n\t\t// Close the dir since we are not returning it. The open file keeps it\n\t\t// loaded in memory.\n\t\tdefer func() {\n\t\t\terr = errors.Compose(err, dir.Close())\n\t\t}()\n\t}\n\treturn dir.managedDeleteFile(fileName)\n}", "title": "" }, { "docid": "2eddc8ef2018a00d3d361f68215c4329", "score": "0.39360285", "text": "func Move(src, dest string) error {\n\n\tinf, err := os.Lstat(dest)\n\n\t// move src to existed folder/file dest\n\tif err == nil {\n\t\tif inf.IsDir() {\n\t\t\t_, file := filepath.Split(src)\n\t\t\treturn os.Rename(src, filepath.Join(dest, file))\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"dest not folder, %s\", dest)\n\t\t}\n\t}\n\n\t// move src to unexisted folder/file dest\n\tdir, _ := filepath.Split(dest)\n\terr = os.MkdirAll(dir, os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = os.Rename(src, dest)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7f1e761afd42d9e1791675e5a21a1baf", "score": "0.3932916", "text": "func (ops *DxOps) DxMove(\n\tctx context.Context,\n\thttpClient *http.Client,\n\tprojId string,\n\tobjectIds []string,\n\tfolders []string,\n\tdestination string) error {\n\n\tif ops.options.Verbose {\n\t\tops.log(\"%s source folders=%v -> %s\", projId, folders, destination)\n\t}\n\tvar request RequestMove\n\trequest.Objects = objectIds\n\trequest.Folders = folders\n\trequest.Destination = destination\n\n\tpayload, err := json.Marshal(request)\n\tif err != nil {\n\t\treturn err\n\t}\n\trepJs, err := dxda.DxAPI(\n\t\tctx, httpClient, NumRetriesDefault, &ops.dxEnv,\n\t\tfmt.Sprintf(\"%s/move\", projId),\n\t\tstring(payload))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar reply ReplyMove\n\tif err := json.Unmarshal(repJs, &reply); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ac950e71bec0fc5efcc9142b63503546", "score": "0.39242125", "text": "func (fs *KBFSOpsStandard) Rename(\n\tctx context.Context, oldParent Node, oldName data.PathPartString,\n\tnewParent Node, newName data.PathPartString) error {\n\ttimeTrackerDone := fs.longOperationDebugDumper.Begin(ctx)\n\tdefer timeTrackerDone()\n\n\toldFB := oldParent.GetFolderBranch()\n\tnewFB := newParent.GetFolderBranch()\n\n\t// only works for nodes within the same topdir\n\tif oldFB != newFB {\n\t\treturn RenameAcrossDirsError{}\n\t}\n\n\tops := fs.getOpsByNode(ctx, oldParent)\n\treturn ops.Rename(ctx, oldParent, oldName, newParent, newName)\n}", "title": "" }, { "docid": "aace5d77d767493465c1341df1f138fc", "score": "0.3915646", "text": "func (wr *Wrangler) PlannedReparentShard(ctx context.Context, keyspace, shard string, masterElectTabletAlias, avoidMasterAlias *topodatapb.TabletAlias, waitReplicasTimeout time.Duration) (err error) {\n\t// lock the shard\n\tlockAction := fmt.Sprintf(\n\t\t\"PlannedReparentShard(%v, avoid_master=%v)\",\n\t\ttopoproto.TabletAliasString(masterElectTabletAlias),\n\t\ttopoproto.TabletAliasString(avoidMasterAlias))\n\tctx, unlock, lockErr := wr.ts.LockShard(ctx, keyspace, shard, lockAction)\n\tif lockErr != nil {\n\t\treturn lockErr\n\t}\n\tdefer unlock(&err)\n\n\t// Create reusable Reparent event with available info\n\tev := &events.Reparent{}\n\n\t// Attempt to set avoidMasterAlias if not provided by parameters\n\tif masterElectTabletAlias == nil && avoidMasterAlias == nil {\n\t\tshardInfo, err := wr.ts.GetShard(ctx, keyspace, shard)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tavoidMasterAlias = shardInfo.MasterAlias\n\t}\n\n\t// do the work\n\terr = wr.plannedReparentShardLocked(ctx, ev, keyspace, shard, masterElectTabletAlias, avoidMasterAlias, waitReplicasTimeout)\n\tif err != nil {\n\t\tevent.DispatchUpdate(ev, \"failed PlannedReparentShard: \"+err.Error())\n\t} else {\n\t\tevent.DispatchUpdate(ev, \"finished PlannedReparentShard\")\n\t}\n\treturn err\n}", "title": "" }, { "docid": "cafda6b465651a0a0d74fdb446d7b39e", "score": "0.39126146", "text": "func intermove(source, destination string) error {\n\tcmd := exec.Command(\"mv\", source, destination)\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\terr := cmd.Start()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn cmd.Wait()\n\n}", "title": "" }, { "docid": "afe734c817dd95a1ac37a67a0190f55c", "score": "0.39083892", "text": "func compareAndRenameTargetFile(target_path string, target_filehash *FileHash) {\n\tif srcFiles.doesPathExist(target_path) {\n\t\t// log.Debugf(\"Skipping: target exists in src: %v\", target_path)\n\t\treturn\n\t}\n\n\t// The target file does not exist in src, so either:\n\t// Case 1) it's been deleted in src\n\t// Case 2) it was moved/renamed in src.\n\t// To verify if Case 2, search for it by content checksum.\n\tsrc_path, found := findSrcFileWithSameContents(target_path, target_filehash)\n\tif !found {\n\t\t// There was no src file that matched the target file's contents. This means\n\t\t// the target file should be deleted... but we'll let rsync handle that.\n\t\tlog.Debugf(\"Skipping: no src file has the same size/checksum as this target: %v\", target_path)\n\t\treturn\n\t}\n\n\t// A file exists in src with exactly the same contents as target_path, so we can just\n\t// rename target_path to the src_path, so rsync will consider this\n\t// a no-op instead of expensively removing the target file and re-copying the\n\t// source file.\n\tif err := file.RenameTargetFile(targetDir, target_path, src_path, isDryRun); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "6d6f26cdb0f577341602a32c830b39e2", "score": "0.39064863", "text": "func (p *PEFile) adjustFileAlignment(pointer, fileAlignment uint32) uint32 {\n\tif fileAlignment > IMAGE_FILE_ALIGNMENT_HARDCODED_VALUE {\n\t\t// If it's not a power of two, report it:\n\t\tif !PowerOfTwo(fileAlignment) {\n\t\t\tlog.Printf(\"if FileAlignment > 512 it should be a power of 2: %x\", fileAlignment)\n\t\t}\n\t}\n\n\tif fileAlignment < IMAGE_FILE_ALIGNMENT_HARDCODED_VALUE {\n\t\treturn pointer\n\t}\n\n\treturn (pointer / IMAGE_FILE_ALIGNMENT_HARDCODED_VALUE) * IMAGE_FILE_ALIGNMENT_HARDCODED_VALUE\n}", "title": "" }, { "docid": "1854c8079d15fd0e47f926e796d57c6b", "score": "0.39050952", "text": "func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tfor {\n\t\terr = unix.Renameat(olddirfd, oldpath, newdirfd, newpath)\n\t\tif err != syscall.EINTR {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "08450d23ffb23d55ddc71434818245a7", "score": "0.39025462", "text": "func (fn *FileNode) UpdateDir() {\n\tpath := string(fn.FPath)\n\t// fmt.Printf(\"path: %v node: %v\\n\", path, fn.PathUnique())\n\tvar err error\n\trepo, rnode := fn.Repo()\n\tif repo == nil {\n\t\trtyp := vci.DetectRepo(path)\n\t\tif rtyp != vcs.NoVCS {\n\t\t\trepo, err = vci.NewRepo(\"origin\", path)\n\t\t\tif err == nil {\n\t\t\t\tfn.DirRepo = repo\n\t\t\t\tfn.UpdateRepoFiles()\n\t\t\t\trnode = fn\n\t\t\t}\n\t\t}\n\t}\n\n\tfn.SetOpen()\n\tconfig := fn.ConfigOfFiles(path)\n\tmods, updt := fn.ConfigChildren(config, ki.NonUniqueNames) // NOT unique names\n\tif mods {\n\t\t// fmt.Printf(\"got mods: %v\\n\", path)\n\t}\n\t// always go through kids, regardless of mods\n\tfor _, sfk := range fn.Kids {\n\t\tsf := sfk.Embed(KiT_FileNode).(*FileNode)\n\t\tsf.FRoot = fn.FRoot\n\t\tfp := filepath.Join(path, sf.Nm)\n\t\t// if sf.Buf != nil {\n\t\t// \tfmt.Printf(\"fp: %v nm: %v\\n\", fp, sf.Nm)\n\t\t// }\n\t\tsf.SetNodePath(fp)\n\t\tif sf.IsDir() {\n\t\t\tsf.Info.Vcs = vci.Stored // always\n\t\t} else if repo != nil {\n\t\t\trstat := rnode.RepoFiles.Status(repo, string(sf.FPath))\n\t\t\tsf.Info.Vcs = rstat\n\t\t} else {\n\t\t\tsf.Info.Vcs = vci.Stored\n\t\t}\n\t}\n\tif mods {\n\t\tfn.UpdateEnd(updt)\n\t}\n}", "title": "" }, { "docid": "1cddfc469f8b2b8b580ef03aa3476cc5", "score": "0.389977", "text": "func (m *Master) RPCCreateFile(args gfs.CreateFileArg, reply *gfs.CreateFileReply) error {\n\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCCreateFile path <%s> start\", args.Path), gfs.MASTER, m.address)\n\tdefer gfs.DebugMsgToFile(fmt.Sprintf(\"RPCCreateFile path <%s> end\", args.Path), gfs.MASTER, m.address)\n\tparents := getParents(args.Path)\n\tok, fileMetadatas, err := m.acquireParentsRLocks(parents)\n\tif !ok {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCCreateFile path <%s> error <%s>\", args.Path, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\tdefer m.unlockParentsRLocks(fileMetadatas)\n\tfileMetadata := new(FileMetadata)\n\tfileMetadata.isDir = false\n\tfileMetadata.size = 0\n\tfileMetadata.chunkHandles = nil\n\tok = m.fileNamespace.SetIfAbsent(args.Path, fileMetadata)\n\tif !ok {\n\t\terr = fmt.Errorf(\"path %s has already existed\", args.Path)\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"RPCCreateFile path <%s> error <%s>\", args.Path, err), gfs.MASTER, m.address)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9ba19470d13689a4f796cae4a7d2c499", "score": "0.3899762", "text": "func (g *Git) Move(ctx context.Context, src, dst string, del bool) error {\n\treturn g.fs.Move(ctx, src, dst, del)\n}", "title": "" } ]
658727b2eff88aa6d102d97869f9ac9d
String returns the string representation. API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".
[ { "docid": "cdc69d5f77c94a86891290595b04ddc9", "score": "0.0", "text": "func (s DeregisterDBProxyTargetsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
[ { "docid": "2167dfb1b4fc20ae5b400652926e4c69", "score": "0.64052165", "text": "func (m member) String() string {\n\tstatus := \"UP\"\n\tif m.status == memberStatusDown {\n\t\tstatus = \"DOWN\"\n\t}\n\n\treturn fmt.Sprintf(\"member: %s:%s\", m.endpoint, status)\n}", "title": "" }, { "docid": "64398c6eed3f49936dbd9aade80b76a9", "score": "0.6402677", "text": "func (s MemberDetail) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "64398c6eed3f49936dbd9aade80b76a9", "score": "0.6402677", "text": "func (s MemberDetail) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "9bd74b868abc668cfd1083349d300d9b", "score": "0.63314956", "text": "func (k Keygen) String() string {\n\treturn fmt.Sprintf(`id:%s\n\ttype:%s\n\tmember:%+v\n`, k.ID, k.Type, k.Members)\n}", "title": "" }, { "docid": "b1c122271b7dbdbf69a90fe8fcc5fdb6", "score": "0.6246913", "text": "func (m *BackendMember) String() string {\n\treturn fmt.Sprintf(\"%s-%s\", m.Name, m.Version)\n}", "title": "" }, { "docid": "d78f3e3d635e6c146c9ae4327d275e9a", "score": "0.6241347", "text": "func (s GetStudioMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3604a1d12813ce519872a998508d98c7", "score": "0.61847967", "text": "func (s GetMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "05c06261eea66baf0de25c9e924d49b1", "score": "0.61312455", "text": "func (ai *AuthInfo) String() string {\n\tkey := ai.APIKey\n\tif key != \"\" {\n\t\tkey = keyMask\n\t}\n\treturn fmt.Sprintf(\"Login:%s, ACL:%08b, APIKey: %s\", ai.Login, ai.ACL, key)\n}", "title": "" }, { "docid": "73c0cab2005d31098ef74dae88190f1f", "score": "0.60691065", "text": "func (s CreateMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "38cd2849f662f0042830dc16ae788a98", "score": "0.6062171", "text": "func (parameter *Parameter) String() string {\n\treturn parameter.Name\n}", "title": "" }, { "docid": "bd6062764f7b699f7610d2ce8970e447", "score": "0.6037958", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Params:\n\tBondDenom:\t\t\t%s\n\tMatureEpoch: %d\n \tMiningRewardParams:\t%s`,\n\t\tp.BondDenom, p.MatureEpoch, p.MiningRewardParams)\n}", "title": "" }, { "docid": "f385dfe7b1949d6f5596cdfd82a16466", "score": "0.60365945", "text": "func (s NewStudioMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d0ea624534d17dfc127136eaaaa45116", "score": "0.60350037", "text": "func (s GetStudioMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "fb2362e0eced768d81f75aa82d7037a2", "score": "0.6023305", "text": "func (s MemberId) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d5688cf4265869da41c793bab4a47d43", "score": "0.60179216", "text": "func (o VserverInfoType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "c319090d056d2cbb01401de5a32dae95", "score": "0.6015331", "text": "func (p *Param) String() string {\n\treturn p.Value\n}", "title": "" }, { "docid": "85504ef332be6c244cc1faadecf55921", "score": "0.6014966", "text": "func (p *Param) String() string {\n\tif p.Name == \"\" {\n\t\treturn \"\"\n\t}\n\n\tif 0 < len(p.Value) {\n\t\treturn p.Name + \"=\" + p.Value\n\t}\n\n\treturn p.Name\n}", "title": "" }, { "docid": "11a4e7851f5e03cc5470dce5aef81d39", "score": "0.59876555", "text": "func (s GetMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "fdb6f529ef9eac960c5f847f2feec7b8", "score": "0.5964856", "text": "func (o LunGetAttributeRequest) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "0dad5672418287d6d5aa396621f0f462", "score": "0.5945787", "text": "func (s GlobalClusterMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "93170fa32b3665a495b64847c487f650", "score": "0.592774", "text": "func (attr STUNAttribute) String() string {\n\tval := fmt.Sprintf(\" %v = \", attr.Tag)\n\tswitch attr.Tag {\n\tcase ATTR_ERROR_CODE:\n\t\tval += fmt.Sprintf(\"%d%02.2d %v\", attr.Value[2], attr.Value[3], string(attr.Value[4:]))\n\tcase ATTR_USERNAME:\n\t\tval += string(attr.Value)\n\tcase ATTR_MESSAGE_INTEGRITY:\n\t\tval += hex.EncodeToString(attr.Value)\n\tcase ATTR_FINGERPRINT:\n\t\tval += hex.EncodeToString(attr.Value)\n\tdefault:\n\t\tval += fmt.Sprintf(\"%v\", attr.Value)\n\t}\n\treturn val\n}", "title": "" }, { "docid": "676b7f1767847b291f018a06251a7765", "score": "0.59097147", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Params:\n SessionNodeCount: %d\n ClaimSubmissionWindow: %d\n Supported Blockchains %v\n ClaimExpiration %d\n ReplayAttackBurnMultiplier %d\n BlockByteSize %d\n`,\n\t\tp.SessionNodeCount,\n\t\tp.ClaimSubmissionWindow,\n\t\tp.SupportedBlockchains,\n\t\tp.ClaimExpiration,\n\t\tp.ReplayAttackBurnMultiplier,\n\t\tp.BlockByteSize)\n}", "title": "" }, { "docid": "bc3052ec2d6d17830a144a788ddc57d3", "score": "0.5905464", "text": "func (s ListMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b2d72e0c208c3077d63efc85503dc964", "score": "0.5888641", "text": "func (t MemberType) String() string {\n\tswitch t {\n\tcase MemberTypeItem:\n\t\treturn \"item\"\n\tcase MemberTypeInnerList:\n\t\treturn \"innerList\"\n\tdefault:\n\t\tpanic(\"invalidMemberType\")\n\t}\n}", "title": "" }, { "docid": "8642f64e291a8bf4480b9caaf36c3be0", "score": "0.5884398", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Params:\n Unstaking Time: %s\n Max Validators: %d\n Stake Coin Denom: %s\n Minimum Stake: \t %d\n Base Proposer Award: %d\n MaxEvidenceAge: %s\n SignedBlocksWindow: %d\n MinSignedPerWindow: %s\n DowntimeJailDuration: %s\n SlashFractionDoubleSign: %s\n SlashFractionDowntime: %s`,\n\t\tp.UnstakingTime,\n\t\tp.MaxValidators,\n\t\tp.StakeDenom,\n\t\tp.StakeMinimum,\n\t\tp.ProposerRewardPercentage,\n\t\tp.MaxEvidenceAge,\n\t\tp.SignedBlocksWindow,\n\t\tp.MinSignedPerWindow,\n\t\tp.DowntimeJailDuration,\n\t\tp.SlashFractionDoubleSign,\n\t\tp.SlashFractionDowntime)\n}", "title": "" }, { "docid": "e34b97a651b16b4015177ee2a8e53a54", "score": "0.5881365", "text": "func (s ServiceItemParamType) String() string {\n\treturn string(s)\n}", "title": "" }, { "docid": "3ffc25a4edc5ca7652c4750de89130eb", "score": "0.5880353", "text": "func (s Parameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3ffc25a4edc5ca7652c4750de89130eb", "score": "0.58799726", "text": "func (s Parameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "da80a3f6d069d1947f388ed2609d4434", "score": "0.58749497", "text": "func (p *Param) String() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn fmt.Sprintf(\"{Tag: %d, Length: %d, Data: %x}\",\n\t\tp.Tag,\n\t\tp.Length,\n\t\tp.Data,\n\t)\n}", "title": "" }, { "docid": "fe16dc01c28bc1db5bcc1e6fce1edc58", "score": "0.5853999", "text": "func (info Info) String() string {\n\tvv, _ := json.Marshal(info)\n\treturn fmt.Sprintf(\"%v\", string(vv))\n}", "title": "" }, { "docid": "4934a08b9c0a0064a3397f052bf64a8a", "score": "0.58536804", "text": "func (s ListStudioMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "498d3ee44d0104d98104a0a6c42645aa", "score": "0.5839489", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`\n\t// TODO: Return all the params as a string\n\t`, )\n}", "title": "" }, { "docid": "b656d434cfe4cd102770f626b0ac9c8d", "score": "0.5830547", "text": "func (s PutStudioMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a27dc316dcc80f5ffc61cd0a88ac429c", "score": "0.58257693", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Params:\n Unstaking Time: %s\n Max Validators: %d\n Stake Coin Denom: %s\n Minimum Stake: \t %d\n MaxEvidenceAge: %s\n SignedBlocksWindow: %d\n MinSignedPerWindow: %s\n DowntimeJailDuration: %s\n SlashFractionDoubleSign: %s\n SlashFractionDowntime: %s\n BlocksPerSession %d\n Proposer Allocation %d\n DAO allocation %d\n Maximum Chains %d\n Max Jailed Blocks %d`,\n\t\tp.UnstakingTime,\n\t\tp.MaxValidators,\n\t\tp.StakeDenom,\n\t\tp.StakeMinimum,\n\t\tp.MaxEvidenceAge,\n\t\tp.SignedBlocksWindow,\n\t\tp.MinSignedPerWindow,\n\t\tp.DowntimeJailDuration,\n\t\tp.SlashFractionDoubleSign,\n\t\tp.SlashFractionDowntime,\n\t\tp.SessionBlockFrequency,\n\t\tp.ProposerAllocation,\n\t\tp.DAOAllocation,\n\t\tp.MaximumChains,\n\t\tp.MaxJailedBlocks)\n}", "title": "" }, { "docid": "95c1313f2669e4f83ae4f94f4f4bbebd", "score": "0.5824519", "text": "func (ds *DemoStruct) String() string {\n\treturn fmt.Sprintf(\"Struct contains A: %d and B: %d\\n\", ds.a, ds.b)\n}", "title": "" }, { "docid": "758403feb1b996367a8638a78780d424", "score": "0.5804317", "text": "func (s StudioMembership) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3732459c5338d141e5aa6980607e3bb9", "score": "0.580398", "text": "func (s IsMemberInGroupsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "11c90d6ee574cda9903fc75bee8832a0", "score": "0.5796461", "text": "func (s DBClusterMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0f74112e9fdd24917c01408db883b532", "score": "0.579406", "text": "func (o *OptionalFindParameters) String() string {\n\tjson, _ := json.Marshal(o)\n\treturn string(json)\n}", "title": "" }, { "docid": "9c66cccdde8c717e9a130db2918369c1", "score": "0.579388", "text": "func (s ParameterStringFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e3bad24655e0a058cbf428367b39ef25", "score": "0.5790869", "text": "func (p *Param) String() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\n\treturn p.value\n}", "title": "" }, { "docid": "4bdadc198d62f1e37e2346471a68a7ea", "score": "0.5787878", "text": "func (o SnapmirrorPolicyInfoType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "cfb333fd252c96d817d8064335e15632", "score": "0.57863957", "text": "func (o *Webchatmemberinfo) String() string {\n \n \n \n \n \n \n \n \n \n \n \n o.CustomFields = map[string]string{\"\": \"\"} \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "3ef2e8283d89e55d5406b3b9ce0f6727", "score": "0.57762986", "text": "func (a *API) String() string {\n\tjsx, err := json.Marshal(a.pairs)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\treturn string(jsx)\n}", "title": "" }, { "docid": "14a5d8153fa38ed0e3c2c8e5825e17e4", "score": "0.57739496", "text": "func (s CreateMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "92ecd018b4ee3498cc0e6deba5d30c32", "score": "0.5770889", "text": "func (am AccessMethod) String() string {\n\treturn string(am)\n}", "title": "" }, { "docid": "e662252c3d94376352d22048ef100189", "score": "0.57701075", "text": "func (w *wrapperAttr) String() string {\n\treturn w.debugString()\n}", "title": "" }, { "docid": "e662252c3d94376352d22048ef100189", "score": "0.57701075", "text": "func (w *wrapperAttr) String() string {\n\treturn w.debugString()\n}", "title": "" }, { "docid": "a64c494bc66aef2ca57b93a58ae3502f", "score": "0.5767474", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(\"Params: \\nDexListFee:%s\\nTransferOwnershipFee:%s\\nRegisterOperatorFee:%s\\nDelistMaxDepositPeriod:%s\\n\"+\n\t\t\"DelistMinDeposit:%s\\nDelistVotingPeriod:%s\\nWithdrawPeriod:%d\\nOwnershipConfirmWindow: %s\\n\",\n\t\tp.ListFee, p.TransferOwnershipFee, p.RegisterOperatorFee, p.DelistMaxDepositPeriod, p.DelistMinDeposit, p.DelistVotingPeriod, p.WithdrawPeriod, p.OwnershipConfirmWindow)\n}", "title": "" }, { "docid": "cea0bc53ad3f69cd6e2c322b7e8b6159", "score": "0.5763967", "text": "func (t APIType) String() string {\n\treturn string(t)\n}", "title": "" }, { "docid": "8beec390094f82952ea6f19cf63d884a", "score": "0.5757676", "text": "func (p Parameters) String() string {\n\truleList := make([]string, 0, len(p.ChannelRules)+len(p.PeerRules))\n\n\tfor channel, rule := range p.ChannelRules {\n\t\truleList = append(\n\t\t\truleList, fmt.Sprintf(\"Channel: %v: %v\", channel, rule),\n\t\t)\n\t}\n\n\tfor peer, rule := range p.PeerRules {\n\t\truleList = append(\n\t\t\truleList, fmt.Sprintf(\"Peer: %v: %v\", peer, rule),\n\t\t)\n\t}\n\n\treturn fmt.Sprintf(\"rules: %v, failure backoff: %v, sweep \"+\n\t\t\"sweep conf target: %v, htlc conf target: %v,fees: %v, \"+\n\t\t\"auto budget: %v, budget refresh: %v, max auto in flight: %v, \"+\n\t\t\"minimum swap size=%v, maximum swap size=%v\",\n\t\tstrings.Join(ruleList, \",\"), p.FailureBackOff,\n\t\tp.SweepConfTarget, p.HtlcConfTarget, p.FeeLimit,\n\t\tp.AutoFeeBudget, p.AutoFeeRefreshPeriod, p.MaxAutoInFlight,\n\t\tp.ClientRestrictions.Minimum, p.ClientRestrictions.Maximum)\n}", "title": "" }, { "docid": "7fa9ae680372df047f172b65f4ed06b4", "score": "0.57530427", "text": "func (s ApiKey) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3713dcc5a10e7dd56d7d01c734b95764", "score": "0.57492995", "text": "func (s DeleteStudioMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7fd626be12ab4037caab7e22499788a8", "score": "0.57454836", "text": "func (a StringSignature) String() string {\n\tvar buf bytes.Buffer\n\tvar list StringList\n\n\tif a.OrderedList != nil {\n\t\t// element ordering is strict\n\t\tlist = a.OrderedList\n\t} else {\n\t\tif a.OptionalSet == nil {\n\t\t\tbuf.WriteByte(flagAnyItems)\n\t\t} else {\n\t\t\tbuf.WriteByte(flagAnyOrder)\n\t\t}\n\t\tlist = append(list, a.RequiredSet.List()...)\n\t\tlist = append(list, a.OptionalSet.List()...)\n\t\tlist = append(list, a.UnlikelySet.List()...)\n\t}\n\tlist = append(list, a.ExcludedSet.List()...)\n\tif a.OrderedList == nil {\n\t\tsort.Slice(list, func(a, b int) bool { return list[a] < list[b] })\n\t}\n\tfor idx, elem := range list {\n\t\tif idx != 0 {\n\t\t\tbuf.WriteString(fieldElemSep)\n\t\t}\n\t\tswitch {\n\t\tcase a.OptionalSet[elem]:\n\t\t\tbuf.WriteByte(flagOptional)\n\t\tcase a.UnlikelySet[elem]:\n\t\t\tbuf.WriteByte(flagUnlikely)\n\t\tcase a.ExcludedSet[elem]:\n\t\t\tbuf.WriteByte(flagExcluded)\n\t\t}\n\t\tbuf.WriteString(elem)\n\t}\n\treturn buf.String()\n}", "title": "" }, { "docid": "452397490de54a70517a661ad9439c16", "score": "0.5744755", "text": "func (pSrc Source) String() string {\n\treturn fmt.Sprintf(\"Param: %s (at %s)\", pSrc.Param.Name(), pSrc.Loc)\n}", "title": "" }, { "docid": "fc97c38d374d0d90343e49c5375511ff", "score": "0.57421416", "text": "func (o NvmeTargetServiceInfoType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "93361518406fb103310d7d4200a8b287", "score": "0.5736218", "text": "func (s ListGroupMembershipsForMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d16ea333c80bd3c8cff2174f0c8e4d5c", "score": "0.5735702", "text": "func (s GraphqlApi) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6397e6fe5ff6e36e0b462cc67b0b0f0e", "score": "0.5724583", "text": "func (o VolumeModifyIterRequestAttributes) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "7c6c39fcae04b2c691a273476b83d4a9", "score": "0.5714906", "text": "func (a *Args) String() string {\n\tbuf := &bytes.Buffer{}\n\n\tfmt.Fprintf(buf, \"KubeConfig: %s\\n\", a.KubeConfig)\n\tfmt.Fprintf(buf, \"ResyncPeriod: %v\\n\", a.ResyncPeriod)\n\tfmt.Fprintf(buf, \"APIAddress: %s\\n\", a.APIAddress)\n\tfmt.Fprintf(buf, \"EnableGrpcTracing: %v\\n\", a.APIAddress)\n\tfmt.Fprintf(buf, \"MaxReceivedMessageSize: %d\\n\", a.MaxReceivedMessageSize)\n\tfmt.Fprintf(buf, \"MaxConcurrentStreams: %d\\n\", a.MaxConcurrentStreams)\n\tfmt.Fprintf(buf, \"LoggingOptions: %#v\\n\", *a.LoggingOptions)\n\tfmt.Fprintf(buf, \"IntrospectionOptions: %#v\\n\", *a.IntrospectionOptions)\n\tfmt.Fprintf(buf, \"Insecure: %v\\n\", a.Insecure)\n\tfmt.Fprintf(buf, \"AccessListFile: %s\\n\", a.AccessListFile)\n\tfmt.Fprintf(buf, \"EnableServer: %v\\n\", a.EnableServer)\n\tfmt.Fprintf(buf, \"KeyFile: %s\\n\", a.CredentialOptions.KeyFile)\n\tfmt.Fprintf(buf, \"CertificateFile: %s\\n\", a.CredentialOptions.CertificateFile)\n\tfmt.Fprintf(buf, \"CACertificateFile: %s\\n\", a.CredentialOptions.CACertificateFile)\n\tfmt.Fprintf(buf, \"ConfigFilePath: %s\\n\", a.ConfigPath)\n\tfmt.Fprintf(buf, \"MeshConfigFile: %s\\n\", a.MeshConfigFile)\n\tfmt.Fprintf(buf, \"DomainSuffix: %s\\n\", a.DomainSuffix)\n\treturn buf.String()\n}", "title": "" }, { "docid": "90987eec34713e8499e30cf764b63eba", "score": "0.57104135", "text": "func (s *Supporters) String() string {\n\tstructBuilder := stringify.StructBuilder(\"Supporters\")\n\ts.ForEach(func(supporter Supporter) {\n\t\tstructBuilder.AddField(stringify.StructField(supporter.String(), \"true\"))\n\t})\n\n\treturn structBuilder.String()\n}", "title": "" }, { "docid": "87d36bad45dc012340cbc6922380b18a", "score": "0.5709513", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`oracle Params:\n MaxRawRequestCount: %d\n MaxAskCount: %d\n ExpirationBlockCount: %d\n BaseRequestGas %d\n PerValidatorRequestGas: %d\n SamplingTryCount: %d\n OracleRewardPercentage: %d\n InactivePenaltyDuration: %d\n`,\n\t\tp.MaxRawRequestCount,\n\t\tp.MaxAskCount,\n\t\tp.ExpirationBlockCount,\n\t\tp.BaseRequestGas,\n\t\tp.PerValidatorRequestGas,\n\t\tp.SamplingTryCount,\n\t\tp.OracleRewardPercentage,\n\t\tp.InactivePenaltyDuration,\n\t)\n}", "title": "" }, { "docid": "aa886d9ed2414ee91e49e81fa61b7afa", "score": "0.5701529", "text": "func (p *Parameter) String() string {\n\tvar strBuilder strings.Builder\n\tif len(p.value) > 0 {\n\t\tstrBuilder.WriteString(\";\")\n\t\tstrBuilder.WriteString(p.name)\n\t\tstrBuilder.WriteString(\"=\")\n\t\tfor i, elValue := range p.value {\n\t\t\tif (i != 0) {\n\t\t\t\tstrBuilder.WriteString(\",\")\n\t\t\t}\n\t\t\t// be sure it has no \" chars\n\t\t\telValue = strings.ReplaceAll(elValue, \"\\\"\", \"\")\n\n\t\t\t// is has special chars, enclose quote the value\n\t\t\tif (strings.ContainsAny(elValue, \":;,\")) {\n\t\t\t\telValue = \"\\\"\" +elValue + \"\\\"\"\n\t\t\t}\n\t\t\tstrBuilder.WriteString(elValue)\n\t\t}\n\t}\n\treturn strBuilder.String()\n}", "title": "" }, { "docid": "05c123f93f222656e1cd07c1a3db6741", "score": "0.56980574", "text": "func (s InstanceInformationStringFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "5b232685d8af5bb7bc994e3be090a3a2", "score": "0.5693774", "text": "func (s StartMonitoringMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d5c176efe97b1fa06576a247a3c03282", "score": "0.5691452", "text": "func (s ListGroupMembershipsForMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4d917aae248dfc89ba0efe1823ea079d", "score": "0.5685762", "text": "func (pe *Permission) String() string {\n\tvar builder strings.Builder\n\tbuilder.WriteString(\"Permission(\")\n\tbuilder.WriteString(fmt.Sprintf(\"id=%v\", pe.ID))\n\tbuilder.WriteString(\", create_time=\")\n\tbuilder.WriteString(pe.CreateTime.Format(time.ANSIC))\n\tbuilder.WriteString(\", update_time=\")\n\tbuilder.WriteString(pe.UpdateTime.Format(time.ANSIC))\n\tbuilder.WriteString(\", name=\")\n\tbuilder.WriteString(pe.Name)\n\tbuilder.WriteString(\", service=\")\n\tbuilder.WriteString(pe.Service)\n\tbuilder.WriteString(\", path=\")\n\tbuilder.WriteString(pe.Path)\n\tbuilder.WriteString(\", action=\")\n\tbuilder.WriteString(pe.Action)\n\tbuilder.WriteString(\", desc=\")\n\tbuilder.WriteString(pe.Desc)\n\tbuilder.WriteByte(')')\n\treturn builder.String()\n}", "title": "" }, { "docid": "c9594694ec1b77b76e69ebd7d2dd05ab", "score": "0.56635827", "text": "func (p Params) String() string {\n\tvar sb strings.Builder\n\n\tsb.WriteString(\"Params: \\n\")\n\tsb.WriteString(fmt.Sprintf(\"MemoCostPerByte: %v\\n\", p.MemoCostPerByte))\n\tsb.WriteString(fmt.Sprintf(\"MaxMemoCharacters: %d\\n\", p.MaxMemoCharacters))\n\tsb.WriteString(fmt.Sprintf(\"TxSigLimit: %d\\n\", p.TxSigLimit))\n\tsb.WriteString(fmt.Sprintf(\"SigVerifyCostED25519: %d\\n\", p.SigVerifyCostED25519))\n\tsb.WriteString(fmt.Sprintf(\"SigVerifyCostSecp256k1: %d\\n\", p.SigVerifyCostSecp256k1))\n\n\treturn sb.String()\n}", "title": "" }, { "docid": "0191d5117621e90237177634213ad1b4", "score": "0.5663263", "text": "func (ci ContractInfo) String() string {\r\n\treturn fmt.Sprintf(`ContractInfo\r\n\tAddress: %s,\r\n\tCodeID: %d, \r\n\tOwner: %s,\r\n\tInitMsg: %s,\r\n\tMigratable %v,\r\n\t`,\r\n\t\tci.Address, ci.CodeID, ci.Owner, ci.InitMsg, ci.Migratable)\r\n}", "title": "" }, { "docid": "546ce52b8ff455ad343da0fff48d6626", "score": "0.5657705", "text": "func (s ListStudioMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "ad5db2d1893e6a9a021897bc46121062", "score": "0.56575304", "text": "func (m *GrpcAPIService) String() string { return proto.CompactTextString(m) }", "title": "" }, { "docid": "b6a944c2f0c2fe0ff4798faf23081f94", "score": "0.56551415", "text": "func (o objKey) String() string {\n\treturn fmt.Sprintf(\"{name: %s, kind: %s}\", o.name, o.kind)\n}", "title": "" }, { "docid": "ce1ff35d7825f522462738151df24b09", "score": "0.5653763", "text": "func (tv targetValue) String() string {\n\tstr := \"\"\n\tfor name, t := range tv {\n\t\tstr += fmt.Sprintf(\"%s:%v,\", name, t.filters)\n\t}\n\treturn str\n}", "title": "" }, { "docid": "e4fcd4a95386dc56bb8f1eef3526f20c", "score": "0.5648323", "text": "func (s VgwTelemetry) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4ff841f08b8ab98ab566ba53e1db2b19", "score": "0.56408846", "text": "func (acl *ACL) String() string {\n\tb, _ := json.Marshal(acl.BasicNet)\n\treturn string(b)\n}", "title": "" }, { "docid": "e48cc421d8de6ecad5a5da1526316415", "score": "0.5637539", "text": "func (s ListMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "071f27bff813a853faa044bb03c23f84", "score": "0.5635881", "text": "func (s *Struct) String() string {\n\tn := s.JSONName\n\tif !s.Required {\n\t\tn += \",omitempty\"\n\t}\n\tstr := fmt.Sprintf(\"%s\\t%s\\t`json:%q`\", s.Name, s.Type, n)\n\tif s.Comment != \"\" {\n\t\tstr = fmt.Sprintf(\"%s // %s\", str, s.Comment)\n\t}\n\treturn str\n}", "title": "" }, { "docid": "5f9bd0990d60878954a88c3fa971a060", "score": "0.56345344", "text": "func (s IsMemberInGroupsInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "61b9ead56774282db4e04c4b70570b94", "score": "0.56327796", "text": "func (s ParameterMetadata) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e041c6be9c819de6a5d40d1fd63acfc8", "score": "0.5628308", "text": "func (s ParametersFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6e4534d097926bf78e30faa03a4dbfa2", "score": "0.56263417", "text": "func (s EncryptionInfo) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "15b198ef69a6aad0707bb9925723c63d", "score": "0.5624862", "text": "func (s ExtendedKeyUsage) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "268a4463dc63dba5dc20fcc6a523a9da", "score": "0.5623729", "text": "func (base *BaseACL) String() string {\n\treturn \"Name: \" + base.GetName() + \" , Desc: \" + base.GetDesc()\n}", "title": "" }, { "docid": "6abb4b696861cf3dfebc31273b2d5302", "score": "0.5619566", "text": "func (p ProviderName) String() string {\n\treturn string(p)\n}", "title": "" }, { "docid": "4767230259dacd452a336e7b6839a017", "score": "0.56194985", "text": "func (s ModifyKeyPairAttributeOutput) String() string {\n\treturn volcengineutil.Prettify(s)\n}", "title": "" }, { "docid": "a0949773d9b7f69a9d1f555cbc7f82f0", "score": "0.56122726", "text": "func (self MethodSignature) String() string {\n\treturn self.ParameterString() + self.Return.TypeString()\n}", "title": "" }, { "docid": "c65607261ff7910b87a59112b68b15a1", "score": "0.5609498", "text": "func (info Info) String() string {\n\tstr, _ := json.Marshal(info)\n\treturn string(str)\n}", "title": "" }, { "docid": "ad6be9545d9d15f60d668b21f278605a", "score": "0.56086856", "text": "func (s ModifyInstanceAttributeOutput) String() string {\n\treturn volcengineutil.Prettify(s)\n}", "title": "" }, { "docid": "89adaa65fc12b8a29fde91a5723898e1", "score": "0.5608068", "text": "func (ins *Set) String() string {\n\treturn fmt.Sprintf(\"reflect.Set(%s, %s, %s)\", ins.Object, ins.Prop, ins.Value)\n}", "title": "" }, { "docid": "8fa7afa5ac5a2c97fe24e4fda6cc062a", "score": "0.5607939", "text": "func (u UserPermission) String() string {\n\tju, _ := json.Marshal(u)\n\treturn string(ju)\n}", "title": "" }, { "docid": "4ffbcd9574e45a0435cc3ad5b7e0eef3", "score": "0.5606568", "text": "func (s DeleteStudioMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "fafd22c80468fed6306bc8c7bd78b444", "score": "0.55999315", "text": "func (s PassThroughSettings) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "251dbf05230fc3fa6d8de106cd37b1a8", "score": "0.5598999", "text": "func (c simpleComplexType) String() string {\n\tstr := fmt.Sprintf(\"%g\", c.v)\n\treturn str[1 : len(str)-1] // remove the parentesis.\n}", "title": "" }, { "docid": "7e79460ac22daa31054a6c4642f58803", "score": "0.5598728", "text": "func (s PutStudioMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "fe34e2882d491b26bff4d4f71b956a82", "score": "0.55916905", "text": "func (u user) String() string {\n\ts := fmt.Sprintf(\"Name: %s %s\\n\", u.First, u.Last)\n\ts = s + fmt.Sprintf(\"Age: %d\\n\", u.Age)\n\tfor i, v := range u.Sayings {\n\t\ts = s + fmt.Sprintf(\"Saying %d: %s\\n\", i, v)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "0d4dfeb8fd902b515f05c05129702a9a", "score": "0.55900717", "text": "func (s OptionGroupMembership) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e72f6230a5690cdc3e2b9353a55a9b30", "score": "0.5578096", "text": "func Test_BackendMember_String(t *testing.T) {\n\tm := BackendMember{Name: \"Test Backend\"}\n\texpected := fmt.Sprintf(\"%s-%s\", m.Name, m.Version)\n\tassert.Equal(t, m.String(), expected, \"BackendMember.String() returned unexpected result\")\n}", "title": "" }, { "docid": "dd787611e238123a7e49d47670308dee", "score": "0.55728114", "text": "func (s ParameterDefinition) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "70654039945d2320f4eee3aa3a793d94", "score": "0.5569108", "text": "func (s KeyValuePair) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0d59af40419fa1a7e554add9370a0079", "score": "0.55637133", "text": "func (m Detail) String() string {\n\treturn fmt.Sprintf(\"Detail(searchedBy=%q found=%q matcher=%q)\", m.SearchedBy, m.Found, m.Matcher)\n}", "title": "" }, { "docid": "1d4e7d34766971f14676e1ed1bb0333d", "score": "0.5563642", "text": "func (s DocumentParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
a32d8f3ba3dfc678dd00dc1c73425f47
SetModifiedAt sets the ModifiedAt field's value.
[ { "docid": "ba816455386cb2669af7a94597cbb0bf", "score": "0.8134268", "text": "func (s *AlertManagerDefinitionDescription) SetModifiedAt(v time.Time) *AlertManagerDefinitionDescription {\n\ts.ModifiedAt = &v\n\treturn s\n}", "title": "" } ]
[ { "docid": "f02f4aeca463b0f29ed2c0b845bbdf93", "score": "0.8407471", "text": "func (m *FileMutation) SetModifiedAt(t time.Time) {\n\tm.modified_at = &t\n}", "title": "" }, { "docid": "31d53ae6441e8f6f1e52280857bcdfa4", "score": "0.8253048", "text": "func (o *Dashboard) SetModifiedAt(v time.Time) {\n\to.ModifiedAt = &v\n}", "title": "" }, { "docid": "ecc2629872e4a5f97b4d0fa3ac2d8286", "score": "0.82484967", "text": "func (s *RuleGroupsNamespaceDescription) SetModifiedAt(v time.Time) *RuleGroupsNamespaceDescription {\n\ts.ModifiedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "b40bc8031448f9d10df6cd86a1e59ea8", "score": "0.8192705", "text": "func (fu *FileUpdate) SetModifiedAt(t time.Time) *FileUpdate {\n\tfu.mutation.SetModifiedAt(t)\n\treturn fu\n}", "title": "" }, { "docid": "b572cb7b5a1cbcc373bd3c0743ad7025", "score": "0.8174281", "text": "func (s *LoggingConfigurationMetadata) SetModifiedAt(v time.Time) *LoggingConfigurationMetadata {\n\ts.ModifiedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "763e219178b95eb2582c31cd7905f388", "score": "0.8160156", "text": "func (o *PartialAPIKeyAttributes) SetModifiedAt(v string) {\n\to.ModifiedAt = &v\n}", "title": "" }, { "docid": "0b1a296ed2425a48a2a063bfd143f9fe", "score": "0.81559885", "text": "func (s *RuleGroupsNamespaceSummary) SetModifiedAt(v time.Time) *RuleGroupsNamespaceSummary {\n\ts.ModifiedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "22d2db05e474cfd54f4481f5ed6b24d0", "score": "0.814152", "text": "func (s *SamplingRuleRecord) SetModifiedAt(v time.Time) *SamplingRuleRecord {\n\ts.ModifiedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "404a03cfc3490f618e678b59ca3de5b1", "score": "0.80882984", "text": "func (fuo *FileUpdateOne) SetModifiedAt(t time.Time) *FileUpdateOne {\n\tfuo.mutation.SetModifiedAt(t)\n\treturn fuo\n}", "title": "" }, { "docid": "968a337bcc670906cfca8574dc93d686", "score": "0.66684806", "text": "func (e *NamespaceWrapper) SetUpdatedAt(t time.Time) {\n\te.UpdatedAt = t\n}", "title": "" }, { "docid": "4b7ba24552782ff0beb41e8022842581", "score": "0.64662266", "text": "func (o *NormalizedProject) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = v\n}", "title": "" }, { "docid": "72e4a471bc2939ae4abfbca71f7006f9", "score": "0.6414871", "text": "func (m *ArticleMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "3b85db99b1c12fda091e34301d5b3e99", "score": "0.64118606", "text": "func (m *PetMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "d72ac2f887b1fcc840e5ee0dbc4ed2b3", "score": "0.64016443", "text": "func (o *SelfServiceError) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = &v\n}", "title": "" }, { "docid": "914efc6ac11eb315c5aeb2c541eeb7f8", "score": "0.63520676", "text": "func (m *CommentMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "a5372f979fee210964b706f59850c75e", "score": "0.6346125", "text": "func (m *ClinicMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "c919c730592b3c029529ac3c935e2e65", "score": "0.633667", "text": "func (m *UserMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "c919c730592b3c029529ac3c935e2e65", "score": "0.633667", "text": "func (m *UserMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "07a39f5f483fbc7e98185ba93d79c04d", "score": "0.63249105", "text": "func (m *OnenotePage) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n m.lastModifiedDateTime = value\n}", "title": "" }, { "docid": "0a7b8444d1a23d74b792dc55bc72e643", "score": "0.63208014", "text": "func (c *Creator) UpdatedAt(updatedAt *time.Time) *Creator {\n\tc.updatedAt = updatedAt\n\treturn c\n}", "title": "" }, { "docid": "3488cf6ec1a4b53dbb8871f813780023", "score": "0.6279043", "text": "func (m *VeterinarianMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "6dc87c344ba5332f3a44bf40683acf6e", "score": "0.62766683", "text": "func (e *BaseEntity) SetUpdatedAt(t time.Time) {\n\te.UpdatedAt = &t\n}", "title": "" }, { "docid": "17794a9741d8d41e8fd75e240b49dc84", "score": "0.62562895", "text": "func (fu *FileUpdate) SetNillableModifiedAt(t *time.Time) *FileUpdate {\n\tif t != nil {\n\t\tfu.SetModifiedAt(*t)\n\t}\n\treturn fu\n}", "title": "" }, { "docid": "4db029e26f80d7ddc6a1be59f7fce894", "score": "0.6253992", "text": "func (m *TagMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "4d175a966a4ed2c53df3d6b166dfb41d", "score": "0.6245591", "text": "func (o *PayrollItem) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt.Set(&v)\n}", "title": "" }, { "docid": "675a6ade95dfcead05dbcb7c1fb72234", "score": "0.6240522", "text": "func (m *AppointmentMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "b3cb557fc606967ca351ae5055cc3aa9", "score": "0.6233578", "text": "func (o *Metadata) SetModified(v time.Time) {\n\to.Modified = &v\n}", "title": "" }, { "docid": "fe71c5321b16197b7b64189fc078647a", "score": "0.622396", "text": "func (m *Tag) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n m.lastModifiedDateTime = value\n}", "title": "" }, { "docid": "d4574eceaf081f089d96b6d092a3b30a", "score": "0.619808", "text": "func (o *Component) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = &v\n}", "title": "" }, { "docid": "feb6dc5c26d23b0a55d7c4cddfac4392", "score": "0.61583877", "text": "func (c *Updater) UpdatedAt(updatedAt *time.Time) *Updater {\n\tc.updatedAt = updatedAt\n\treturn c\n}", "title": "" }, { "docid": "cb917905ac3ae857da64c6599a4a08f3", "score": "0.6144476", "text": "func (nc *NodeCreate) SetUpdatedAt(t time.Time) *NodeCreate {\n\tnc.mutation.SetUpdatedAt(t)\n\treturn nc\n}", "title": "" }, { "docid": "a42e4b9ac5e079bd56f3e47f0da65809", "score": "0.61421174", "text": "func (muo *MessageUpdateOne) SetUpdatedAt(t time.Time) *MessageUpdateOne {\n\tmuo.updated_at = &t\n\treturn muo\n}", "title": "" }, { "docid": "2be73e0cccd21996f3b05a735e5369e6", "score": "0.61365324", "text": "func (m *ChatMessage) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n err := m.GetBackingStore().Set(\"lastModifiedDateTime\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "511a753097e3b226d0d758ada20d714b", "score": "0.61330247", "text": "func (weu *WorkExperienceUpdate) SetUpdatedAt(t time.Time) *WorkExperienceUpdate {\n\tweu.mutation.SetUpdatedAt(t)\n\treturn weu\n}", "title": "" }, { "docid": "7f70d1ff705b4f7777ec05f8d6123d9b", "score": "0.6131329", "text": "func (o *DetailedSegmentAllOf) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = &v\n}", "title": "" }, { "docid": "5baef9df970f93d586407ed853f61404", "score": "0.6129081", "text": "func (weuo *WorkExperienceUpdateOne) SetUpdatedAt(t time.Time) *WorkExperienceUpdateOne {\n\tweuo.mutation.SetUpdatedAt(t)\n\treturn weuo\n}", "title": "" }, { "docid": "1570b40c0d39b3461630bfc1978db14f", "score": "0.6128551", "text": "func (o *UserTag) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = v\n}", "title": "" }, { "docid": "81411f0703d14906e29cfdb762940694", "score": "0.6120768", "text": "func (m *Attachment) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n m.lastModifiedDateTime = value\n}", "title": "" }, { "docid": "1ac919c0e286a09423fc6100acf5428b", "score": "0.6116132", "text": "func (fuo *FileUpdateOne) SetNillableModifiedAt(t *time.Time) *FileUpdateOne {\n\tif t != nil {\n\t\tfuo.SetModifiedAt(*t)\n\t}\n\treturn fuo\n}", "title": "" }, { "docid": "90fecc04c067cc5074fc3f6bde33d684", "score": "0.61070776", "text": "func (o *OAuth2Client) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = &v\n}", "title": "" }, { "docid": "a2594b2a576a9ff2cdecf140fc830a9e", "score": "0.60951424", "text": "func (o *UserDetail) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = v\n}", "title": "" }, { "docid": "e2d7e4153a0a81bc03486f3bd58ec35f", "score": "0.6094261", "text": "func (tc *TemplateCreate) SetUpdatedAt(t time.Time) *TemplateCreate {\n\ttc.mutation.SetUpdatedAt(t)\n\treturn tc\n}", "title": "" }, { "docid": "85ef0a20007a078dfa8d38e0aaaaa764", "score": "0.60834056", "text": "func (o *V2Monitor) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = &v\n}", "title": "" }, { "docid": "4bd2f31b3fc700099ab07a48758ad056", "score": "0.6072495", "text": "func (smaruo *SysMenuActionResourceUpdateOne) SetUpdatedAt(t time.Time) *SysMenuActionResourceUpdateOne {\n\tsmaruo.mutation.SetUpdatedAt(t)\n\treturn smaruo\n}", "title": "" }, { "docid": "b7eba263e46a38030d80231888f683b1", "score": "0.60685664", "text": "func (pc *ProductCreate) SetUpdatedAt(t time.Time) *ProductCreate {\n\tpc.updated_at = &t\n\treturn pc\n}", "title": "" }, { "docid": "9816435e32faff8bfa2febb3b13b8f4c", "score": "0.60685307", "text": "func (m *CustomerMutation) SetUpdatedAt(t time.Time) {\n\tm.updated_at = &t\n}", "title": "" }, { "docid": "6783d4beb9181d4231dc9101b9211559", "score": "0.6065947", "text": "func (mc *MessageCreate) SetUpdatedAt(t time.Time) *MessageCreate {\n\tmc.updated_at = &t\n\treturn mc\n}", "title": "" }, { "docid": "c67ebbb2db9c66e2946628a1b21bfa69", "score": "0.60654575", "text": "func (m *OnenotePage) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n err := m.GetBackingStore().Set(\"lastModifiedDateTime\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "569b03ed126cdd5f8fc8ccc3f27c2bf1", "score": "0.6046002", "text": "func (gru *GithubRepositoryUpdate) SetUpdatedAt(t time.Time) *GithubRepositoryUpdate {\n\tgru.mutation.SetUpdatedAt(t)\n\treturn gru\n}", "title": "" }, { "docid": "9865b04222e624612bbe7a374bc60f20", "score": "0.6041506", "text": "func (o *AppMetaData) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = &v\n}", "title": "" }, { "docid": "3f6fa859387d97df4ca825903bc7dff1", "score": "0.6032615", "text": "func (mu *MessageUpdate) SetUpdatedAt(t time.Time) *MessageUpdate {\n\tmu.updated_at = &t\n\treturn mu\n}", "title": "" }, { "docid": "7a65f786155bebbdae949fdf2f1fb526", "score": "0.6027705", "text": "func (s *GetImageSetOutput) SetUpdatedAt(v time.Time) *GetImageSetOutput {\n\ts.UpdatedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "4ac5f0215aefab122a4ec9f6801d535d", "score": "0.6020006", "text": "func (smaru *SysMenuActionResourceUpdate) SetUpdatedAt(t time.Time) *SysMenuActionResourceUpdate {\n\tsmaru.mutation.SetUpdatedAt(t)\n\treturn smaru\n}", "title": "" }, { "docid": "d37f852a55e991e571b1b1e2cb14bd94", "score": "0.60190296", "text": "func (gruo *GithubRepositoryUpdateOne) SetUpdatedAt(t time.Time) *GithubRepositoryUpdateOne {\n\tgruo.mutation.SetUpdatedAt(t)\n\treturn gruo\n}", "title": "" }, { "docid": "e3b6a497bcc900d9a7c2e7625abd86a9", "score": "0.6013619", "text": "func (ou *OrderUpdate) SetUpdatedAt(t time.Time) *OrderUpdate {\n\tou.mutation.SetUpdatedAt(t)\n\treturn ou\n}", "title": "" }, { "docid": "00e823c7c1fb4ae57ad897e63a8354c0", "score": "0.6004291", "text": "func (ouo *OrderUpdateOne) SetUpdatedAt(t time.Time) *OrderUpdateOne {\n\touo.mutation.SetUpdatedAt(t)\n\treturn ouo\n}", "title": "" }, { "docid": "9247aa32e0007798c3e2b6ccfd71d010", "score": "0.5998309", "text": "func (oc *OrderCreate) SetUpdatedAt(t time.Time) *OrderCreate {\n\toc.mutation.SetUpdatedAt(t)\n\treturn oc\n}", "title": "" }, { "docid": "b665544c6836f91c4e71e73abc80b8d3", "score": "0.59969664", "text": "func (o *RUMApplicationAttributes) SetUpdatedAt(v int64) {\n\to.UpdatedAt = v\n}", "title": "" }, { "docid": "ccf0ff46609ad1cdc4ce836da46d146b", "score": "0.5991359", "text": "func (pc *ProcessCreate) SetUpdatedAt(t time.Time) *ProcessCreate {\n\tpc.mutation.SetUpdatedAt(t)\n\treturn pc\n}", "title": "" }, { "docid": "47af86b55e41ab9acd0cede9f61b3e83", "score": "0.597814", "text": "func (metadata *TransactionMetadata) SetModified(modified bool) {\n\tmetadata.modifiedMutex.Lock()\n\tdefer metadata.modifiedMutex.Unlock()\n\n\tmetadata.modified = modified\n}", "title": "" }, { "docid": "fb19b5c95097071dd6063d3b1fa4e70d", "score": "0.5976282", "text": "func (juo *JobUpdateOne) SetUpdatedAt(t time.Time) *JobUpdateOne {\n\tjuo.mutation.SetUpdatedAt(t)\n\treturn juo\n}", "title": "" }, { "docid": "fe98ba0866a766fda17c10f88b2f5d01", "score": "0.59757084", "text": "func (o *Currency) SetUpdatedAt(v time.Time) {\n\to.UpdatedAt = &v\n}", "title": "" }, { "docid": "e8e6081779370b1cd72bc71a3f098d7c", "score": "0.5973987", "text": "func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate {\n\tuc.updated_at = &t\n\treturn uc\n}", "title": "" }, { "docid": "f0837f529cb41a92d1dfdef901fd9d02", "score": "0.5973961", "text": "func (vuc *VacUserCreate) SetUpdatedAt(t time.Time) *VacUserCreate {\n\tvuc.mutation.SetUpdatedAt(t)\n\treturn vuc\n}", "title": "" }, { "docid": "eff47866c3477314b8bffca386381077", "score": "0.5973413", "text": "func (kssu *K8sStatefulSetUpdate) SetUpdatedAt(t time.Time) *K8sStatefulSetUpdate {\n\tkssu.mutation.SetUpdatedAt(t)\n\treturn kssu\n}", "title": "" }, { "docid": "584ef8a787ff0c0f03eae08fa96fe3c8", "score": "0.59667194", "text": "func (ju *JobUpdate) SetUpdatedAt(t time.Time) *JobUpdate {\n\tju.mutation.SetUpdatedAt(t)\n\treturn ju\n}", "title": "" }, { "docid": "1cb1ea2950f3586f92df6f5e78cd5edc", "score": "0.596298", "text": "func (o *ReposListParams) SetUpdatedAt(updatedAt *string) {\n\to.UpdatedAt = updatedAt\n}", "title": "" }, { "docid": "48869323cfe412952e22624bd69ec096", "score": "0.5945685", "text": "func (kssuo *K8sStatefulSetUpdateOne) SetUpdatedAt(t time.Time) *K8sStatefulSetUpdateOne {\n\tkssuo.mutation.SetUpdatedAt(t)\n\treturn kssuo\n}", "title": "" }, { "docid": "10d494320e168af15a8c658f6eff2158", "score": "0.59312105", "text": "func (dmc *DeathMannerCreate) SetUpdatedAt(t time.Time) *DeathMannerCreate {\n\tdmc.mutation.SetUpdatedAt(t)\n\treturn dmc\n}", "title": "" }, { "docid": "4b21dff35fd17b306074b0a0dc20010f", "score": "0.5925699", "text": "func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne {\n\tuuo.mutation.SetUpdatedAt(t)\n\treturn uuo\n}", "title": "" }, { "docid": "ac61d12516f62cc3be763ffbe29701ac", "score": "0.5907412", "text": "func (ttrc *TemplateTagRelationCreate) SetUpdatedAt(t time.Time) *TemplateTagRelationCreate {\n\tttrc.mutation.SetUpdatedAt(t)\n\treturn ttrc\n}", "title": "" }, { "docid": "840c58c957e908a9378fe916285d7f9e", "score": "0.5903827", "text": "func (gsc *GoodsSpuCreate) SetUpdatedAt(t time.Time) *GoodsSpuCreate {\n\tgsc.mutation.SetUpdatedAt(t)\n\treturn gsc\n}", "title": "" }, { "docid": "83d0c11283f6fbc6d17dd19d10e26d4a", "score": "0.59023106", "text": "func (u *DeathMannerUpsertOne) SetUpdatedAt(v time.Time) *DeathMannerUpsertOne {\n\treturn u.Update(func(s *DeathMannerUpsert) {\n\t\ts.SetUpdatedAt(v)\n\t})\n}", "title": "" }, { "docid": "bcc3df0e8ea1c2dad4827246ed284524", "score": "0.58996975", "text": "func (cuo *ClusterUpdateOne) SetUpdatedAt(t time.Time) *ClusterUpdateOne {\n\tcuo.mutation.SetUpdatedAt(t)\n\treturn cuo\n}", "title": "" }, { "docid": "25fd5152c7b3d405da9a0be6342fedab", "score": "0.5899476", "text": "func (kcuo *K8sClusterUpdateOne) SetUpdatedAt(t time.Time) *K8sClusterUpdateOne {\n\tkcuo.mutation.SetUpdatedAt(t)\n\treturn kcuo\n}", "title": "" }, { "docid": "e73a37ddf7b7980d4d9c7277629ee533", "score": "0.589563", "text": "func (rc *RouteCreate) SetUpdatedAt(t time.Time) *RouteCreate {\n\trc.mutation.SetUpdatedAt(t)\n\treturn rc\n}", "title": "" }, { "docid": "10ed729312a9198e7a14c3fb8f4a6eff", "score": "0.5890397", "text": "func (ac *AlertCreate) SetUpdatedAt(t time.Time) *AlertCreate {\n\tac.mutation.SetUpdatedAt(t)\n\treturn ac\n}", "title": "" }, { "docid": "ffc1d29464c0c4b14294c84b25499315", "score": "0.5887501", "text": "func (m *TeamworkDevice) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n err := m.GetBackingStore().Set(\"lastModifiedDateTime\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "210b6c62b434ba02cbf33ba2fc1f2527", "score": "0.588457", "text": "func (rc *RoleCreate) SetUpdatedAt(t time.Time) *RoleCreate {\n\trc.mutation.SetUpdatedAt(t)\n\treturn rc\n}", "title": "" }, { "docid": "599e6a3f6b09f11f90a3bb68ef2ba9ce", "score": "0.58837837", "text": "func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate {\n\tuu.mutation.SetUpdatedAt(t)\n\treturn uu\n}", "title": "" }, { "docid": "a3d5c15ece2fea8ca2251ed463e14616", "score": "0.58737886", "text": "func (uec *UserExtendCreate) SetUpdatedAt(t time.Time) *UserExtendCreate {\n\tuec.mutation.SetUpdatedAt(t)\n\treturn uec\n}", "title": "" }, { "docid": "8f1c4bf9dde33f0fd60a573435cff30a", "score": "0.58717906", "text": "func (sdic *SysDictItemCreate) SetUpdatedAt(t time.Time) *SysDictItemCreate {\n\tsdic.mutation.SetUpdatedAt(t)\n\treturn sdic\n}", "title": "" }, { "docid": "046e5dacd307abb9b7b5af57c6097a90", "score": "0.5867893", "text": "func (s *DatastoreSummary) SetUpdatedAt(v time.Time) *DatastoreSummary {\n\ts.UpdatedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "b1007ab31d5c0d141b35586f2e068d7a", "score": "0.58587694", "text": "func (o *PartialAPIKeyAttributes) GetModifiedAt() string {\n\tif o == nil || o.ModifiedAt == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.ModifiedAt\n}", "title": "" }, { "docid": "cd5d6b27ea435f97052bc01031c9d4b8", "score": "0.5855356", "text": "func (cuo *CategoryUpdateOne) SetUpdatedAt(t time.Time) *CategoryUpdateOne {\n\tcuo.mutation.SetUpdatedAt(t)\n\treturn cuo\n}", "title": "" }, { "docid": "6c7a437692d310bbd35463953cd20ce0", "score": "0.58491623", "text": "func (o *Ticket) SetModifiedOn(v time.Time) {\n\to.ModifiedOn = &v\n}", "title": "" }, { "docid": "6e4b438c38618677c23e3ff1e7038524", "score": "0.5841527", "text": "func (s *UpdateImageSetMetadataOutput) SetUpdatedAt(v time.Time) *UpdateImageSetMetadataOutput {\n\ts.UpdatedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "077887f028bfa30ec75d177fa301ceca", "score": "0.5841502", "text": "func (m *MobileApp) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n err := m.GetBackingStore().Set(\"lastModifiedDateTime\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "0fffb58dd9d6b3e5890d63e97a6a18cd", "score": "0.5840745", "text": "func (_options *ListManagedKeysOptions) SetUpdatedAt(updatedAt string) *ListManagedKeysOptions {\n\t_options.UpdatedAt = core.StringPtr(updatedAt)\n\treturn _options\n}", "title": "" }, { "docid": "941266cd88c16d6391f9912d458b14ac", "score": "0.5838778", "text": "func (sduo *SysDictUpdateOne) SetUpdatedAt(t time.Time) *SysDictUpdateOne {\n\tsduo.mutation.SetUpdatedAt(t)\n\treturn sduo\n}", "title": "" }, { "docid": "83cc7aeaa3adb7fc01d473d1a85eb368", "score": "0.5838131", "text": "func (s *ImageSetsMetadataSummary) SetUpdatedAt(v time.Time) *ImageSetsMetadataSummary {\n\ts.UpdatedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "d68b23fb535c1aaa0b520d5b7f1a5b85", "score": "0.5829683", "text": "func (_options *ListManagedKeysFromKeystoreOptions) SetUpdatedAt(updatedAt string) *ListManagedKeysFromKeystoreOptions {\n\t_options.UpdatedAt = core.StringPtr(updatedAt)\n\treturn _options\n}", "title": "" }, { "docid": "13a5278450046c79029becc536e74098", "score": "0.5813394", "text": "func (u *DeathMannerUpsert) SetUpdatedAt(v time.Time) *DeathMannerUpsert {\n\tu.Set(deathmanner.FieldUpdatedAt, v)\n\treturn u\n}", "title": "" }, { "docid": "960303b83958c7a8f77bfa6566bed4bb", "score": "0.5811081", "text": "func (cu *ClusterUpdate) SetUpdatedAt(t time.Time) *ClusterUpdate {\n\tcu.mutation.SetUpdatedAt(t)\n\treturn cu\n}", "title": "" }, { "docid": "936f257bf9445505c084a87580f5e587", "score": "0.58046865", "text": "func (m *DeviceManagementReusablePolicySetting) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n err := m.GetBackingStore().Set(\"lastModifiedDateTime\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "f14da1bfb5a0ff3218b3834217910312", "score": "0.57944953", "text": "func (mtuo *MetricTypeUpdateOne) SetUpdatedAt(t time.Time) *MetricTypeUpdateOne {\n\tmtuo.mutation.SetUpdatedAt(t)\n\treturn mtuo\n}", "title": "" }, { "docid": "611d5e9a98601e4aa78c2a7aa1bdc052", "score": "0.5793182", "text": "func (m *Trending) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n m.lastModifiedDateTime = value\n}", "title": "" }, { "docid": "260205bfbf3c3873efebde583a46dbb9", "score": "0.57835865", "text": "func (m *PolicyBase) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n err := m.GetBackingStore().Set(\"lastModifiedDateTime\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "7df93f1343c075f2d8c7e05b75a2f8fc", "score": "0.5781564", "text": "func (kcu *K8sClusterUpdate) SetUpdatedAt(t time.Time) *K8sClusterUpdate {\n\tkcu.mutation.SetUpdatedAt(t)\n\treturn kcu\n}", "title": "" }, { "docid": "2cc164783bdd3095e2c7d6755449aa4e", "score": "0.57782423", "text": "func (sdu *SysDictUpdate) SetUpdatedAt(t time.Time) *SysDictUpdate {\n\tsdu.mutation.SetUpdatedAt(t)\n\treturn sdu\n}", "title": "" } ]
3695679f6826d0e58ece38987e049d5b
Run executes the step
[ { "docid": "0555a6e92016e425b7fda04a54ba134f", "score": "0.6332595", "text": "func (s *AssignScenarioInCompass) Run() error {\n\treturn s.director.AddScenarioToRuntime(s.runtimeID, defaultScenarioName)\n}", "title": "" } ]
[ { "docid": "9229a054853525f9f5c35fadf7cee6eb", "score": "0.7811717", "text": "func (s *Step) Run() error {\n\treturn s.Fn(nil)\n}", "title": "" }, { "docid": "79fce994a576fef16657a79452630fd5", "score": "0.7049012", "text": "func Run(s *core.Session) error {\n\tfirst := true\n\tfor i, step := range s.Steps {\n\t\tif first {\n\t\t\tExecute(step, s)\n\t\t\tfirst = false\n\t\t\tcontinue\n\t\t}\n\t\tstep.StepNo = i\n\t\tresult, err := Execute(step, s)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Failed to execute step %d\", step.StepNo)\n\t\t\treturn err\n\t\t}\n\t\tif result != step.Expect {\n\t\t\treturn UnexpectedResultError(step.Expect, result)\n\t\t}\n\t}\n\tlog.Printf(\"All steps in session %s run successfully\", s.ID)\n\treturn nil\n}", "title": "" }, { "docid": "61e21643f32ba6d8f39c8f294ceee572", "score": "0.69284415", "text": "func (o *operation) run() {\n\tstep := logging.NewStep(fmt.Sprintf(\"%s/%d\", o.simulator.Name, getSimulatorID()), \"Run %s\", o.name)\n\tstep.Start()\n\tif err := o.f(o.simulator); err != nil {\n\t\tstep.Fail(err)\n\t} else {\n\t\tstep.Complete()\n\t}\n}", "title": "" }, { "docid": "a6ef50815d1e179dfa12f8d9fac5c3df", "score": "0.68954", "text": "func (step *dummy) Run(ctx context.Context) error {\n\t// increase counter\n\tdefer func() {\n\t\tstep.counter++\n\t}()\n\n\tif i, ok := ctx.Value(\"dummy\").(int); ok {\n\t\tif i == step.i {\n\t\t\t// error case\n\t\t\t// return step, because it is error interface implements\n\t\t\treturn fmt.Errorf(\"dummy: Error from %d\", step.i)\n\t\t}\n\t}\n\n\t// all other cases - success\n\treturn nil\n}", "title": "" }, { "docid": "bbbfd312e9be8870cba49f72f27aa059", "score": "0.6851882", "text": "func (s *Suite) Run() {\n\ts.osExit(s.run())\n}", "title": "" }, { "docid": "b3cf4f43fc6b247b3ffadee4e46e8e2b", "score": "0.6745015", "text": "func (is *step) Run(inctx context.Context, hosts []resources.Host, v data.Map, s resources.FeatureSettings) (_ resources.UnitResults, ferr fail.Error) {\n\toutcomes := &unitResults{}\n\n\tselect {\n\tcase <-inctx.Done():\n\t\treturn outcomes, fail.AbortedError(inctx.Err())\n\tdefault:\n\t}\n\n\tif is.Serial || s.Serialize {\n\t\treturn is.loopSeriallyOnHosts(inctx, hosts, v)\n\t}\n\n\treturn is.loopConcurrentlyOnHosts(inctx, hosts, v)\n}", "title": "" }, { "docid": "c6098bf3fe0972fc5f45d1cb9bc7480d", "score": "0.66665125", "text": "func (r *Runner) Run() error {\n\treturn run(r)\n}", "title": "" }, { "docid": "227b8254b907ca36861814d68e0b8203", "score": "0.66439193", "text": "func (r *simpleWarehouseRobot) Run() common.Trace {\n\tr.tick += 1\n\tr.Plan()\n\treturn r.Execute()\n}", "title": "" }, { "docid": "79bc77cf4765d2e9a1875010ec5f79ff", "score": "0.65708596", "text": "func (t *T) Run() {\n\tt.Started()\n\tdefer t.job.Stopped(t)\n\n\ts := t.Op()\n\tfor t.state.Runnable() && s != nil {\n\t\ts = t.Step(s)\n\t}\n}", "title": "" }, { "docid": "abb266cd2e60e2fd464434b0021e9e2a", "score": "0.65257823", "text": "func (_m *Runner) Run() {\n\t_m.Called()\n}", "title": "" }, { "docid": "64ed2034eafa38269acd661618800908", "score": "0.64654344", "text": "func (is *step) Run(task concurrency.Task, hosts []resources.Host, v data.Map, s resources.FeatureSettings) (outcomes resources.UnitResults, xerr fail.Error) {\n\toutcomes = &unitResults{}\n\n\tif task.Aborted() {\n\t\tif lerr, err := task.LastError(); err == nil {\n\t\t\treturn outcomes, fail.AbortedError(lerr, \"aborted\")\n\t\t}\n\t\treturn outcomes, fail.AbortedError(nil, \"aborted\")\n\t}\n\n\tif is.Serial || s.Serialize {\n\t\t// logrus.Warnf(\"TBR: Installing %s feature serialized\", is.Worker.feature.GetName())\n\t\treturn is.loopSeriallyOnHosts(task, hosts, v)\n\t}\n\n\t// logrus.Warnf(\"TBR: Installing %s feature in parallel\", is.Worker.feature.GetName())\n\treturn is.loopConcurrentlyOnHosts(task, hosts, v)\n}", "title": "" }, { "docid": "ff740ad2da5bd5a7f0c47692378e9d83", "score": "0.6460611", "text": "func (s *Suite) Run(t *testing.T) {\n\tsuite.Run(t, s)\n}", "title": "" }, { "docid": "d544d11daf10fb22aa2b75c427b2373c", "score": "0.64327437", "text": "func (ts *WeighingTaskSet) Run() {\n\tr := rand.New(rand.NewSource(time.Now().UnixNano()))\n\troll := r.Intn(ts.offset)\n\ttask := ts.GetTask(roll)\n\ttask.Fn(1)\n}", "title": "" }, { "docid": "271ced1d2315f6c21510c9a18a250b44", "score": "0.6430464", "text": "func (p *Pipeline) Run() {\n\tp.sh.Ok()\n\thandleError(p.sh, p.run())\n}", "title": "" }, { "docid": "275411ce789919089ae2d520006bddf6", "score": "0.64016443", "text": "func (ts *WeighingTaskSet) Run() {\r\n\tr := rand.New(rand.NewSource(time.Now().UnixNano()))\r\n\troll := r.Intn(ts.offset)\r\n\ttask := ts.GetTask(roll)\r\n\ttask.Fn()\r\n}", "title": "" }, { "docid": "e1e97cd84da8bba8a5c8d75416c4754b", "score": "0.63318014", "text": "func (o *Options) Run() {\n\to.Validate()\n\n\tpr := o.CreatePullRequest()\n\n\tbuildNumber := o.findNextBuildNumber()\n\n\to.waitForPullRequestToMerge(pr)\n\n\to.verifyPreviewEnvironment(pr)\n\n\treleasePA := o.waitForReleasePipelineToComplete(buildNumber)\n\to.waitForPromotePullRequestToMerge(releasePA)\n}", "title": "" }, { "docid": "ae113757b99c7d70636901ed2c35b54c", "score": "0.632827", "text": "func (i *Interpreter) Run() error {\n\tfor {\n\t\tif err := i.Step(); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "66d62bc22c5c86c307815974590a7a69", "score": "0.63201576", "text": "func (e *EvaluatorSuite) Run(ctx sessionctx.Context, input, output *chunk.Chunk) error {\n\tif e.defaultEvaluator != nil {\n\t\terr := e.defaultEvaluator.run(ctx, input, output)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif e.columnEvaluator != nil {\n\t\treturn e.columnEvaluator.run(ctx, input, output)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fcb599fe87f8f3e160d41d04543c5722", "score": "0.6293919", "text": "func (stm *StageManager) Run() {\n\t// 1: parser params\n\tstm.runParamsParsedStage()\n\t// 2: init\n\tstm.runInitStage()\n\t// 3: pre start\n\tstm.runPreStartStage()\n\t// 4: run\n\tstm.runStartStage()\n\t// 5: after start\n\tstm.runAfterStartStage()\n\n\tstm.SetState(Running)\n}", "title": "" }, { "docid": "cfe986cbc7f338490fc78bd914c5e065", "score": "0.6293837", "text": "func (c *Command) Run(ctx context.Context) error {\n\t_, err := c.RunWithValue(ctx)\n\treturn err\n}", "title": "" }, { "docid": "a41e6cea20dc7a12c88f5e766ab60fdc", "score": "0.6286179", "text": "func (e Executor) Run(ctx context.Context, step venom.TestStep) (interface{}, error) {\n\t// Transform step to Executor instance.\n\tif err := mapstructure.Decode(step, &e); err != nil {\n\t\treturn nil, err\n\t}\n\t// Connect to the database and ping it.\n\tvenom.Debug(ctx, \"connecting to database %s, %s\\n\", e.Driver, e.DSN)\n\tdb, err := sqlx.Connect(e.Driver, e.DSN)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"failed to connect to database\")\n\t}\n\tdefer db.Close()\n\n\tresults := []QueryResult{}\n\t// Execute commands on database\n\t// if the argument is specified.\n\tif len(e.Commands) != 0 {\n\t\tfor i, s := range e.Commands {\n\t\t\tvenom.Debug(ctx, \"Executing command number %d\\n\", i)\n\t\t\trows, err := db.Queryx(s)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrapf(err, \"failed to exec command number %d\", i)\n\t\t\t}\n\t\t\tr, err := handleRows(rows)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrapf(err, \"failed to parse SQL rows for command number %d\", i)\n\t\t\t}\n\t\t\tresults = append(results, QueryResult{Rows: r})\n\t\t}\n\t} else if e.File != \"\" {\n\t\tworkdir := venom.StringVarFromCtx(ctx, \"venom.testsuite.workdir\")\n\t\tfile := path.Join(workdir, e.File)\n\t\tvenom.Debug(ctx, \"loading SQL file from %s\\n\", file)\n\t\tsbytes, errs := os.ReadFile(file)\n\t\tif errs != nil {\n\t\t\treturn nil, errs\n\t\t}\n\t\trows, err := db.Queryx(string(sbytes))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"failed to exec SQL file %q\", file)\n\t\t}\n\t\tr, err := handleRows(rows)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"failed to parse SQL rows for SQL file %q\", file)\n\t\t}\n\t\tresults = append(results, QueryResult{Rows: r})\n\t}\n\tr := Result{Queries: results}\n\treturn r, nil\n}", "title": "" }, { "docid": "ee4b284bafd00a98760ec59992e9979c", "score": "0.6282496", "text": "func (m *Mux) Run(req api.Request) (api.Response, error) {\n\tvar spec = &struct {\n\t\tInteractionID int `json:\"interactionId\"`\n\t\tHTTPRoot string `json:\"httpRoot\"`\n\t}{}\n\terr := req.ReadBodyInto(spec)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp := &StepResponse{}\n\n\tinteraction := m.Pact.GetInteraction(spec.InteractionID)\n\tresp.Diff = interaction.Run(spec.HTTPRoot)\n\n\tresp.Next = m.Pact.NextAfter(spec.InteractionID)\n\treturn resp, nil\n}", "title": "" }, { "docid": "b7b0d11434ac0d7e0a47d4c0f09b6f24", "score": "0.6273237", "text": "func (ssp *StepsSequencePerformer) RunWithLog(le *log.Entry) (err error) {\n\tfor i, step := range *ssp.steps {\n\t\tle.Infof(\"=== Step #%d ===\", i+1)\n\t\tle.Info(step.Description())\n\t\terr = step.Perform()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\ttaskprinter.New(step.Task()).LogTaskState(le)\n\t\tle.Info(step.ResultMessage())\n\t\tif step.Task().IsOptimalSolution {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "01d02f6b26f5f618c02a3f6b1945dd64", "score": "0.6268731", "text": "func (h *Machine) Run() {\n\tfor {\n\t\th.Step()\n\t\tif h.Halted() {\n\t\t\tfmt.Printf(\"Program terminated with: %q\\n\", h.state)\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "61a65b45392496ad1737e659e3968355", "score": "0.6266048", "text": "func (s *Summarizer) Run(obj interface{}) map[string]int {\n\ts.fulfill()\n\ts.walk(s.RootExpression, obj)\n\treturn s.Result\n}", "title": "" }, { "docid": "c811a792584b04a052a0594e27f40a5c", "score": "0.6259026", "text": "func (w *Wizard) Run(store forest.Store) error {\n\terr := w.ConfigureIdentity(store)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error configuring user identity: %v\", err)\n\t}\n\tidentity, err := w.IdentityNode(store)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error getting identity node: %w\", err)\n\t}\n\tkey, err := identity.PublicKey.AsEntity()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error extracting key: %v\", err)\n\t}\n\tpgpIds := []string{}\n\tfor keyID := range key.Identities {\n\t\tpgpIds = append(pgpIds, keyID)\n\t}\n\tw.PGPUser = pgpIds[0]\n\treturn nil\n}", "title": "" }, { "docid": "49f5f564591cb781a5e74b417a0540aa", "score": "0.6245912", "text": "func (f RunnerFunc) Run(h Handler) (Result, error) {\n\treturn f(h)\n}", "title": "" }, { "docid": "fc50885da3ff827316a5194dcc52675c", "score": "0.6243779", "text": "func (t *ManagePO) Run(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"run is running \" + function)\n\treturn t.Invoke(stub, function, args)\n}", "title": "" }, { "docid": "fbbc75262e8b8d8dd1926b8349fbd163", "score": "0.6231231", "text": "func (p *program) run() int {\n\tvar res int\n\tfor res == 0 {\n\t\tres = p.step()\n\t}\n\treturn res\n}", "title": "" }, { "docid": "b04ec4effe0106b64ebe5819433a0c3f", "score": "0.623063", "text": "func Run() error {\n\treturn global.Run()\n}", "title": "" }, { "docid": "855a05746d470a84400ce3307a38c995", "score": "0.6205356", "text": "func (bf *Brainfuck) Run() error {\n\tvar err error\n\tvar finished bool\n\tfor finished, err = bf.Step(); !finished && err == nil; finished, err = bf.Step() {\n\t\t// intentionally empty, all work are done in Step()\n\t}\n\treturn err\n}", "title": "" }, { "docid": "45540ffb277d038cf017a0d5e0f4d9ac", "score": "0.62038416", "text": "func (t Test) Run() {\n\tfmt.Printf(\"[test] %v\\n\", t.Args) // DEBUG\n}", "title": "" }, { "docid": "b777deb28c40f37a56c3aec388b7537b", "score": "0.6187819", "text": "func Run(g *genny.Generator) (genny.Results, error) {\n\treturn RunNew(g, nil)\n}", "title": "" }, { "docid": "def47c66075f57371ff15490d832dbb6", "score": "0.61852723", "text": "func Run(ctx context.Context) error {\n\treturn nil\n}", "title": "" }, { "docid": "99f0e83cd35f64f8c1edf774dd6711d2", "score": "0.61784494", "text": "func (ana *Maker) Run() error {\n\n\t// Create histograms via event loops\n\terr := ana.RunEventLoops()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Plot each variable x selection, overlaying samples.\n\terr = ana.PlotVariables()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Print processing report\n\tana.PrintReport()\n\n\t// Print slow functions\n\tana.PrintSlowTreeFuncs()\n\n\t// Return\n\treturn nil\n}", "title": "" }, { "docid": "a6bc729b8c8136194ebf45a3aa65870b", "score": "0.61731327", "text": "func (p *Prompts) Run() {\n\tp.scenario = []Step{}\n\n\tfor {\n\t\tprompt := p.currentPrompt\n\t\trenderPrompt(p.writer, prompt)\n\n\t\tinputs, nextPrompt, err := p.parse()\n\n\t\tif err != nil {\n\t\t\trenderError(p.writer, prompt, err)\n\t\t}\n\n\t\tp.appendScenario(prompt.PromptString(), inputs, err)\n\n\t\tif nextPrompt == nil {\n\t\t\treturn\n\t\t}\n\n\t\trenderSeparator(p.writer, prompt)\n\n\t\tp.currentPrompt = nextPrompt\n\t}\n}", "title": "" }, { "docid": "9c5f4d150f2ee403704310c168561cc7", "score": "0.6144739", "text": "func (em *Emulator) Run() (err error) {\n em.Running = true\n\n for em.Running {\n err = em.RunOne()\n if err != nil {\n return err\n }\n }\n\n return nil\n}", "title": "" }, { "docid": "26dc74e49bfb3cd0b35b5a8e4da007b9", "score": "0.61443496", "text": "func (r *Reporter) Run() {\n\tr.reporter.Run()\n}", "title": "" }, { "docid": "6ecf77a0670bb11c8838d5292b6ddf13", "score": "0.6139797", "text": "func (this Renderer) Run(vars map[string]interface{}, next func()) {\n\tV(vars).Render(this.Template)\n}", "title": "" }, { "docid": "e2412c492a5d996ed83638a63cdfcf1c", "score": "0.61359465", "text": "func (p *Pipeline) Run() {\n\tp.configure()\n\tfor n, s := range p.Stages {\n\t\tp.l.Infof(\"running stage %d\", n)\n\t\ts.Run()\n\t}\n}", "title": "" }, { "docid": "fbf637752bff869238c737e25c9d94a1", "score": "0.6118829", "text": "func (o *Options) Run() error {\n\tvar err error\n\to.ClientFactory, err = factory.NewClientFactory()\n\tif err != nil {\n\t\treturn err\n\t}\n\to.ClientFactory.Batch = o.BatchMode\n\to.ClientFactory.DevelopmentJenkinsURL = o.JenkinsSelector.DevelopmentJenkinsURL\n\n\tjenkinsClient, err := o.CreateJenkinsClientFromSelector(&o.JenkinsSelector)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif o.Dir == \"\" {\n\t\to.Dir, err = os.Getwd()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif o.Jenkinsfile == \"\" {\n\t\to.Jenkinsfile = jenkinsfile.Name\n\t}\n\tgitInfo, err := o.FindGitInfo(o.Dir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbranch, err := o.Git().Branch(o.Dir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif branch == \"\" {\n\t\tbranch = \"master\"\n\t}\n\n\treturn o.TriggerPipeline(jenkinsClient, gitInfo, branch)\n}", "title": "" }, { "docid": "4b1f6fdbad0fa9557b54699c28db1737", "score": "0.6109175", "text": "func (t *SimpleChaincode) Run(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"run is running \" + function)\n\treturn t.Invoke(stub, function, args)\n}", "title": "" }, { "docid": "e5bd074c5167cf9af8874b1285664cfe", "score": "0.60917264", "text": "func (sim *Simulation) Run() {\n\ttargetString := sim.target.Text('f', 0)\n\tfmt.Printf(\"Solving for: %s\\n\\n\", targetString)\n\n\tstartedAt := time.Now()\n\tfor {\n\t\tif sim.Step() {\n\t\t\tfmt.Printf(\"Iteration %d — SOLVED: %s\\n\\n\", sim.iteration, targetString)\n\t\t\tbreak\n\t\t} else if sim.iteration%100 == 0 {\n\t\t\tfmt.Printf(\"Iteration %d — solving for: %s\\n\", sim.iteration, targetString)\n\n\t\t\tvar maxFitness *big.Float = nil\n\t\t\tvar fittestChromosome *Chromosome = nil\n\t\t\tfor _, simC := range sim.population {\n\t\t\t\tif maxFitness == nil || simC.fitness.Cmp(maxFitness) > 0 {\n\t\t\t\t\tmaxFitness = simC.fitness\n\t\t\t\t\tfittestChromosome = simC.c\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfmt.Printf(\"\\n%s\\n\\n\", fittestChromosome.VerboseString())\n\t\t}\n\t}\n\telapsed := time.Since(startedAt)\n\n\tfor _, chromosome := range sim.Solutions() {\n\t\tfmt.Printf(\"%s\\n\\n\\n\", chromosome.VerboseString())\n\t}\n\n\tfmt.Printf(\"Elapsed time: %s\\n\", elapsed)\n\tavgIterationTime := time.Duration(uint(elapsed) / sim.iteration)\n\tfmt.Printf(\"Avg iteration runtime: %s\\n\", avgIterationTime)\n\n\tfmt.Println()\n}", "title": "" }, { "docid": "a9c2be496fcaacd719cb531dd6f4862e", "score": "0.609123", "text": "func (_e *BatchRunner_Expecter) Run(ctx interface{}) *BatchRunner_Run_Call {\n\treturn &BatchRunner_Run_Call{Call: _e.mock.On(\"Run\", ctx)}\n}", "title": "" }, { "docid": "4bfea6cfa802abadbc085b35a3268520", "score": "0.60884446", "text": "func Run() error {\n\tr := &runner{\n\t\tconfig: defaultConfiguration(),\n\t\tlog: logray.New(),\n\t}\n\treturn r.Run()\n}", "title": "" }, { "docid": "0033703f728af8c0fc72f103fc293694", "score": "0.60827917", "text": "func (app *App) Run() error {\n\treturn app.RunWithArgs(os.Args[1:])\n}", "title": "" }, { "docid": "69650beaf090cfb686aba6b251a9b7cf", "score": "0.6082769", "text": "func (a *Action) Run(input *ActionInput) (*ActionOutput, error) {\n\tif err := input.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\t// Put any custom code you want in here!\n\treturn &ActionOutput{}, nil\n}", "title": "" }, { "docid": "e7c6d9ff2aed9249fb9a5c77774b9a7a", "score": "0.6082091", "text": "func (h *Handler) Run() {\n\tvar err error\n\n\tif err = h.ConfigureBackend(); err != nil {\n\t\tlog.Println(\"Configuring backend failed!\")\n\t\th.abort(err)\n\t\treturn\n\t}\n\n\tif err = h.ConnectToBackend(); err != nil {\n\t\tlog.Println(\"Connecting to backend failed!\")\n\t\th.abort(err)\n\t\treturn\n\t}\n\n\tif h.EventNotifier == nil {\n\t\th.abort(errors.New(\"ERROR! EventNotifier was not set in example handler\"))\n\t\treturn\n\t}\n\n\th.Pipe()\n}", "title": "" }, { "docid": "32a5b43d56b3573be0133ae9d8f3b7ce", "score": "0.6080704", "text": "func Run(yml string, env string) int {\n\treader, e := os.Open(yml)\n\tif e != nil {\n\t\tlog.Printf(\"Unable to read %s\\n\", yml)\n\t\treturn 1\n\t}\n\tpipeline := parser.ReadPipelineDef(reader)\n\tpath, _ := os.Getwd()\n\tr := &inner{\n\t\timage: pipeline.Image,\n\t\thostPath: path,\n\t\tenvironment: env,\n\t\tuseDockerService: pipeline.Options.Docker,\n\t}\n\tdefer r.Close()\n\tr.Setup()\n\teR := r.Run(pipeline.Pipelines.Default[0].Step.Scripts)\n\tif eR != nil {\n\t\tlog.Println(\"error when running\", eR)\n\t\treturn 1\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "ef89f88cbd9634863a7a9938b62f0d79", "score": "0.60798615", "text": "func (r *Runner) Run(ctx context.Context, node syntax.Node) error {\n\tif !r.didReset {\n\t\tr.Reset()\n\t}\n\tr.fillExpandConfig(ctx)\n\tr.err = nil\n\tr.shellExited = false\n\tr.filename = \"\"\n\tswitch x := node.(type) {\n\tcase *syntax.File:\n\t\tr.filename = x.Name\n\t\tr.stmts(ctx, x.Stmts)\n\t\tif !r.shellExited {\n\t\t\tr.exitShell(ctx, r.exit)\n\t\t}\n\tcase *syntax.Stmt:\n\t\tr.stmt(ctx, x)\n\tcase syntax.Command:\n\t\tr.cmd(ctx, x)\n\tdefault:\n\t\treturn fmt.Errorf(\"node can only be File, Stmt, or Command: %T\", x)\n\t}\n\tif r.exit != 0 {\n\t\tr.setErr(NewExitStatus(uint8(r.exit)))\n\t}\n\tif r.Vars != nil {\n\t\tr.writeEnv.Each(func(name string, vr expand.Variable) bool {\n\t\t\tr.Vars[name] = vr\n\t\t\treturn true\n\t\t})\n\t}\n\treturn r.err\n}", "title": "" }, { "docid": "be85b37751d4a778c5b2b22e86a96ecc", "score": "0.6074731", "text": "func Run(task Task, waiter *Waiter) { global.Run(task, waiter) }", "title": "" }, { "docid": "92243fab87195dc10752a4ceb8c38223", "score": "0.60724723", "text": "func Run() {\n\tgo chooseStrategy(0)\n}", "title": "" }, { "docid": "92a24d556912e765afd84b17dfcc91c1", "score": "0.60712045", "text": "func (f *Flow) Run(ctx context.Context, args ...string) int {\n\tif ctx == nil {\n\t\tctx = context.Background()\n\t}\n\n\tflow := &flowRunner{\n\t\toutput: f.Output,\n\t\tparams: f.params,\n\t\ttasks: f.tasks,\n\t\tverbose: f.VerboseParam(),\n\t\tworkDir: f.WorkDirParam(),\n\t\tdefaultTask: f.DefaultTask,\n\t}\n\n\tif flow.output == nil {\n\t\tflow.output = os.Stdout\n\t}\n\n\treturn flow.Run(ctx, args)\n}", "title": "" }, { "docid": "dc9295c4b641beea45d38817bc5b030c", "score": "0.6064416", "text": "func (p *GasOutputsProcessor) Run(ctx context.Context) error {\n\tnode, closer, err := p.opener.Open(ctx)\n\tif err != nil {\n\t\treturn xerrors.Errorf(\"open lens: %w\", err)\n\t}\n\tdefer closer()\n\n\t// Loop until context is done or processing encounters a fatal error\n\treturn wait.RepeatUntil(ctx, batchInterval, func(ctx context.Context) (bool, error) {\n\t\treturn p.processBatch(ctx, node)\n\t})\n}", "title": "" }, { "docid": "3061ca6bf36ab8ba0ad28c32fa9eceec", "score": "0.6056581", "text": "func (a *args) Run(ctx context.Context, g source.Getter, s storage.Storer) error {\n\tif g == nil {\n\t\treturn errors.New(\"no getter provided\")\n\t}\n\tif s == nil {\n\t\treturn errors.New(\"no storer provided\")\n\t}\n\n\tif err := getStore(ctx, g, s); err != nil {\n\t\treturn err\n\t}\n\n\tlog.Info().Msg(\"data retrieved and stored\")\n\n\treturn nil\n}", "title": "" }, { "docid": "9cfa4b77044412eca6741b4ecb1a33da", "score": "0.6055559", "text": "func (job RunnerJob) Run() {\n\tvar logger = logrus.WithField(\"name\", job.target.Name)\n\tlogger.Infof(\"Running test [%s (%s)]\", job.target.Name, job.target.URL)\n\tresult := job.target.Run()\n\tlogger.WithField(\"status\", result.Status)\n\tif err := job.db.SaveResult(result); err != nil {\n\t\tlogger.Errorf(\"failed to save result %v\", err)\n\t}\n\n\tif result.Status != 200 {\n\t\tlogger.Errorf(\"Test %s failed\", job.target.Name)\n\t\tnotification.NotifySlack(result.Error, fmt.Sprintf(\"Test [%s (%s)] failed\", job.target.Name, job.target.URL), job.Config)\n\t\treturn\n\t}\n\tlogger.Infof(\"Test [%s (%s)] succeeded\", job.target.Name, job.target.URL)\n}", "title": "" }, { "docid": "b9640908625cba3935b1a947a646a1b8", "score": "0.6049511", "text": "func (vm *VM)Run() {\n for {\n word := vm.op()\n switch word {\n case 0:\n os.Exit(0)\n case 1:\n vm.setOp()\n case 2:\n vm.pushOp()\n case 3:\n vm.popOp()\n case 4:\n vm.eqOp()\n case 5:\n vm.gtOp()\n case 6:\n vm.jump()\n case 7:\n vm.jtOp()\n case 8:\n vm.jfOp()\n case 9:\n vm.addOp()\n case 10:\n vm.multOp()\n case 11:\n vm.modOp()\n case 12:\n vm.andOp()\n case 13:\n vm.orOp()\n case 14:\n vm.notOp()\n case 15:\n vm.rmemOp()\n case 16:\n vm.wmemOp()\n case 17:\n vm.callOp()\n case 18:\n vm.retOp()\n case 19:\n vm.outOp()\n case 20:\n vm.inOp()\n case 21:\n vm.noopOp()\n }\n }\n}", "title": "" }, { "docid": "3b5fed4b369aea2494f0ad0318c5a32b", "score": "0.60442054", "text": "func (music *MusicPipeline) Run() {\n}", "title": "" }, { "docid": "32b07a846951f9af831eedd64c4c6cff", "score": "0.6043881", "text": "func (r *runner) Run() error {\n\tr.log.Info(\"Launching KurmaOS\\n\\n\")\n\n\tfor _, f := range setupFunctions {\n\t\tif err := f(r); err != nil {\n\t\t\tr.log.Errorf(\"ERROR: %v\", err)\n\t\t\treturn fmt.Errorf(\"%v: %v\", f, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ff1a02ccf3f7418c4b01bb1ee11c6476", "score": "0.60410386", "text": "func (o *binaryOutput) Run(ctx context.Context, requests RequestService, statuses StatusService, moduleID string) error {\n\t// Nothing to do here\n\t<-ctx.Done()\n\treturn nil\n}", "title": "" }, { "docid": "e2c8cb2522eaaf106c0618c2d87c629a", "score": "0.6038456", "text": "func Run() (err error) {\n\treturn Default.Run()\n}", "title": "" }, { "docid": "cf07436b602405adcdf0947fddeaa12f", "score": "0.60372573", "text": "func Run() {\r\n\trunAddBook()\r\n\t//runAdjustRating()\r\n\t//runGetBook()\r\n\trunGetAllBooks()\r\n\t//runDeleteBook()\r\n\t//runChangeStatus()\r\n\t//runCollapse()\r\n}", "title": "" }, { "docid": "9cd0dd7c7b37fba7176a1af8c766ee36", "score": "0.60356647", "text": "func (f *Flow) Run(fn func()) *Flow {\n\tf.add(action{\n\t\tkind: actionRun,\n\t\tfn: fn,\n\t})\n\n\treturn f\n}", "title": "" }, { "docid": "4946f07acc5579db0ac2816635d45188", "score": "0.60310936", "text": "func (d *Docker) RunStep(step *model.Step, invID string, idx int) (int64, error) {\n\tvar (\n\t\terr error\n\t\twd, containerID string\n\t)\n\n\tstepIdx := strconv.Itoa(idx)\n\n\tif containerID, err = d.CreateContainerFromStep(step, invID); err != nil {\n\t\treturn -1, err\n\t}\n\n\twd, err = os.Getwd()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tstdoutpath := path.Join(wd, VOLUMEDIR, step.Stdout(stepIdx))\n\tlogcabin.Info.Printf(\"path to the step stdout log file: %s\\n\", stdoutpath)\n\tstdoutFile, err := os.Create(stdoutpath)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tdefer stdoutFile.Close()\n\n\tstderrpath := path.Join(wd, VOLUMEDIR, step.Stderr(stepIdx))\n\tlogcabin.Info.Printf(\"path to the step stderr log file: %s\\n\", stderrpath)\n\tstderrFile, err := os.Create(stderrpath)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tdefer stderrFile.Close()\n\n\treturn d.runContainer(containerID, stdoutFile, stderrFile)\n}", "title": "" }, { "docid": "b85f531fdb197cf82c42dbc069730153", "score": "0.6026517", "text": "func Run() error {\n\tcfg := config{}\n\tif err := env.Parse(&cfg); err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tagent, err := oauth.NewFlowAgent(cfg.clientID, cfg.clientSecret, \"localhost\", cfg.port)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdoneChan, errChan := agent.Start()\n\tlog.Printf(\"click me: %s\", agent.UserOAuthURL())\n\tselect {\n\tcase done := <-doneChan:\n\t\tif !done {\n\t\t\treturn errors.New(\"something went wrong with the token exchange\")\n\t\t}\n\tcase err := <-errChan:\n\t\treturn err\n\t}\n\n\tlog.Printf(\"token exchange went fine. starting up firehose\")\n\tfirehose(agent.AccessToken())\n\treturn nil\n}", "title": "" }, { "docid": "737e7b2d89227892298f43d4de34558b", "score": "0.60132736", "text": "func Run(options RunOptions) {\n\tif options.IsAbort {\n\t\trunState := loadState(options.Command)\n\t\tabortRunState := runState.CreateAbortRunState()\n\t\trunSteps(&abortRunState, options)\n\t} else if options.IsContinue {\n\t\trunState := loadState(options.Command)\n\t\tif runState.RunStepList.isEmpty() {\n\t\t\tutil.ExitWithErrorMessage(\"Nothing to continue\")\n\t\t}\n\t\tgit.EnsureDoesNotHaveConflicts()\n\t\trunSteps(&runState, options)\n\t} else if options.IsSkip {\n\t\trunState := loadState(options.Command)\n\t\tskipRunState := runState.CreateSkipRunState()\n\t\trunSteps(&skipRunState, options)\n\t} else if options.IsUndo {\n\t\trunState := loadState(options.Command)\n\t\tundoRunState := runState.CreateUndoRunState()\n\t\tif undoRunState.RunStepList.isEmpty() {\n\t\t\tutil.ExitWithErrorMessage(\"Nothing to undo\")\n\t\t} else {\n\t\t\trunSteps(&undoRunState, options)\n\t\t}\n\t} else {\n\t\tclearSavedState(options.Command)\n\t\trunSteps(&RunState{\n\t\t\tCommand: options.Command,\n\t\t\tRunStepList: options.StepListGenerator(),\n\t\t}, options)\n\t}\n}", "title": "" }, { "docid": "e5b0bc3d1c45a40cc7f162d5f5f74ac7", "score": "0.60099", "text": "func (s *StepShutdown) Run(state multistep.StateBag) multistep.StepAction {\n\tui := state.Get(\"ui\").(packer.Ui)\n\td := state.Get(\"driver\").(*Driver)\n\tvm := state.Get(\"vm\").(*object.VirtualMachine)\n\n\tui.Say(\"Shut down VM...\")\n\n\terr := d.StartShutdown(vm)\n\tif err != nil {\n\t\tstate.Put(\"error\", fmt.Errorf(\"Cannot shut down VM: %v\", err))\n\t\treturn multistep.ActionHalt\n\t}\n\n\ttimeoutvalue := time.Second * 300\n\tlog.Printf(\"Waiting max %s for shutdown to complete\", timeoutvalue)\n\terr = d.WaitForShutdown(vm, timeoutvalue)\n\tif err != nil {\n\t\tstate.Put(\"error\", err)\n\t\treturn multistep.ActionHalt\n\t}\n\n\tui.Say(\"VM stopped\")\n\treturn multistep.ActionContinue\n}", "title": "" }, { "docid": "c1bff384d326fbd9ac3331373ab1910b", "score": "0.6008723", "text": "func (c *controllerImpl) Run(name string) (constants.Statistics, []int, bool) {\n\tIDs, savedToDb, stats := c.runSet(fmt.Sprintf(\"^%s$\", name))\n\n\tif len(stats) == 0 {\n\t\t// TODO: Add logic for when no matching test cases are found\n\t\treturn constants.Statistics{}, []int{}, false\n\t}\n\n\treturn stats[0], IDs, savedToDb\n}", "title": "" }, { "docid": "39ff28f0e145a9d9b939d4a6de067dcc", "score": "0.60062724", "text": "func (f *FileUploader) Run() {\n\tvar filePath string\n\tfor filePath = <-f.Input; filePath != \"\"; filePath = <-f.Input {\n\t\tret, err := uploadFileToWorkspace(f.HasSSL, f.WsID, filePath)\n\t\tif err != nil {\n\t\t\tlog.Println(\" uploadFileToWorkspace err:\", err)\n\t\t}\n\t\tprintResult(ret)\n\t}\n}", "title": "" }, { "docid": "ee33d9f6c5c59f77106d2d717361dd57", "score": "0.6000419", "text": "func (gmk *Gomoku) Run() {\n\tgmk.Turn = false\n\tfor gmk.Live && !gmk.Turn {\n\t\tfmt.Println(\"DEBUG expecting input from Piskvork\")\n\t\tif gmk.scanner.Scan() == false {\n\t\t\tbreak\n\t\t}\n\t\tmessage := gmk.scanner.Text()\n\t\tfmt.Println(\"DEBUG Recieved: \" + message)\n\t\twords := strings.Fields(message)\n\t\tif len(words) != 0 {\n\t\t\tcall := messageProcessorsMap[words[0]]\n\t\t\tif call != nil {\n\t\t\t\tcall(gmk, words[1:])\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"DEBUG Don't know what to do with: \" + words[0])\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a92ceb3dd2520392d78b09e4f0b797cc", "score": "0.59977823", "text": "func (o *Options) Run() error {\n\treturn nil\n}", "title": "" }, { "docid": "bfb429c917184b514d86f25778555460", "score": "0.599348", "text": "func Run() {\n\tif modl == nil {\n\t\tcreateModel(false)\n\t}\n\t//assuming that it comes from the main go routine\n\tif modl.activeRunner == nil {\n\t\tpanic(\"runner is nil\")\n\t}\n\n\tif modl.activeRunner.getInternalId() != 0 {\n\t\tpanic(\"it comes from not from the main go routine\")\n\t}\n\n\tmodl.simulationActive = true\n\tmodl.control()\n\n}", "title": "" }, { "docid": "5d21f5465169a36d4d6b9c378106d66f", "score": "0.59927595", "text": "func (f *Fake) Run(ctx context.Context, invoke *Invocation) error {\n\tif f.RunFunc == nil {\n\t\treturn fmt.Errorf(\"fake run: RunFunc not set\")\n\t}\n\treturn f.RunFunc(ctx, invoke)\n}", "title": "" }, { "docid": "c92bd6585e24734db96f658714e15176", "score": "0.59871364", "text": "func (sd *StepDef) run() interface{} {\n\ttyp := sd.hv.Type()\n\tif len(sd.args) < typ.NumIn() {\n\t\treturn fmt.Errorf(\"func expects %d arguments, which is more than %d matched from step\", typ.NumIn(), len(sd.args))\n\t}\n\tvar values []reflect.Value\n\tfor i := 0; i < typ.NumIn(); i++ {\n\t\tparam := typ.In(i)\n\t\tswitch param.Kind() {\n\t\tcase reflect.Int:\n\t\t\ts, err := sd.shouldBeString(i)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tv, err := strconv.ParseInt(s, 10, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(`cannot convert argument %d: \"%s\" to int: %s`, i, s, err)\n\t\t\t}\n\t\t\tvalues = append(values, reflect.ValueOf(int(v)))\n\t\tcase reflect.Int64:\n\t\t\ts, err := sd.shouldBeString(i)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tv, err := strconv.ParseInt(s, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(`cannot convert argument %d: \"%s\" to int64: %s`, i, s, err)\n\t\t\t}\n\t\t\tvalues = append(values, reflect.ValueOf(int64(v)))\n\t\tcase reflect.Int32:\n\t\t\ts, err := sd.shouldBeString(i)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tv, err := strconv.ParseInt(s, 10, 32)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(`cannot convert argument %d: \"%s\" to int32: %s`, i, s, err)\n\t\t\t}\n\t\t\tvalues = append(values, reflect.ValueOf(int32(v)))\n\t\tcase reflect.Int16:\n\t\t\ts, err := sd.shouldBeString(i)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tv, err := strconv.ParseInt(s, 10, 16)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(`cannot convert argument %d: \"%s\" to int16: %s`, i, s, err)\n\t\t\t}\n\t\t\tvalues = append(values, reflect.ValueOf(int16(v)))\n\t\tcase reflect.Int8:\n\t\t\ts, err := sd.shouldBeString(i)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tv, err := strconv.ParseInt(s, 10, 8)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(`cannot convert argument %d: \"%s\" to int8: %s`, i, s, err)\n\t\t\t}\n\t\t\tvalues = append(values, reflect.ValueOf(int8(v)))\n\t\tcase reflect.String:\n\t\t\ts, err := sd.shouldBeString(i)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tvalues = append(values, reflect.ValueOf(s))\n\t\tcase reflect.Float64:\n\t\t\ts, err := sd.shouldBeString(i)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tv, err := strconv.ParseFloat(s, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(`cannot convert argument %d: \"%s\" to float64: %s`, i, s, err)\n\t\t\t}\n\t\t\tvalues = append(values, reflect.ValueOf(v))\n\t\tcase reflect.Float32:\n\t\t\ts, err := sd.shouldBeString(i)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tv, err := strconv.ParseFloat(s, 32)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(`cannot convert argument %d: \"%s\" to float32: %s`, i, s, err)\n\t\t\t}\n\t\t\tvalues = append(values, reflect.ValueOf(float32(v)))\n\t\tcase reflect.Ptr:\n\t\t\targ := sd.args[i]\n\t\t\tswitch param.Elem().String() {\n\t\t\tcase \"gherkin.DocString\":\n\t\t\t\tv, ok := arg.(*gherkin.DocString)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(`cannot convert argument %d: \"%v\" of type \"%T\" to *gherkin.DocString`, i, arg, arg)\n\t\t\t\t}\n\t\t\t\tvalues = append(values, reflect.ValueOf(v))\n\t\t\tcase \"gherkin.DataTable\":\n\t\t\t\tv, ok := arg.(*gherkin.DataTable)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(`cannot convert argument %d: \"%v\" of type \"%T\" to *gherkin.DocString`, i, arg, arg)\n\t\t\t\t}\n\t\t\t\tvalues = append(values, reflect.ValueOf(v))\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"the argument %d type %T is not supported\", i, arg)\n\t\t\t}\n\t\tcase reflect.Slice:\n\t\t\tswitch param {\n\t\t\tcase typeOfBytes:\n\t\t\t\ts, err := sd.shouldBeString(i)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tvalues = append(values, reflect.ValueOf([]byte(s)))\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"the slice argument %d type %s is not supported\", i, param.Kind())\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"the argument %d type %s is not supported\", i, param.Kind())\n\t\t}\n\t}\n\treturn sd.hv.Call(values)[0].Interface()\n}", "title": "" }, { "docid": "535df82c350b84d2d1bd802195e524d6", "score": "0.59832007", "text": "func (c *Component) Run(ctx context.Context) error {\n\t<-ctx.Done()\n\treturn nil\n}", "title": "" }, { "docid": "2a00c82e5fbe1406573dbe6c43844839", "score": "0.5975185", "text": "func (a GreedyBestFirst) Run(ctx search.Context, e environments.Environment) (search.Result, error) {\n\ta.setStart(e.Start())\n\n\tnode, err := a.findGoal(e)\n\tif err != nil {\n\t\treturn search.Result{}, err\n\t}\n\n\treturn search.Result{\n\t\tNode: node,\n\t\tIterations: a.iterations,\n\t\tEnvironment: e,\n\t}, nil\n}", "title": "" }, { "docid": "2d7296fc97e6d5621b86e4e589340f27", "score": "0.59730643", "text": "func Run() string {\n\tsettings := setFlowFileAsVariables()\n\tvariables := executeFlow(settings)\n\ttemplate := settings[\"template\"].(string)\n\treturn parseTemplate(template, variables)\n}", "title": "" }, { "docid": "548342d9ee11f0ff66dc82a6cdf0ce7f", "score": "0.59693944", "text": "func (t *SimpleChaincode) Run(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\t// Print debug message\n\tfmt.Println(\"Run() is running: \" + function)\n\t// Pass arguments to Invoke()\n\treturn t.Invoke(stub, function, args)\n}", "title": "" }, { "docid": "442b660c5f0a98d7d18bb68145d26d37", "score": "0.5960629", "text": "func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error) {\n\tstate := new(multistep.BasicStateBag)\n\tstate.Put(\"config\", b.config)\n\tstate.Put(\"comm\", &b.config.Comm)\n\tstate.Put(\"hook\", hook)\n\tstate.Put(\"ui\", ui)\n\n\tsteps := []multistep.Step{}\n\n\tsteps = append(steps,\n\t\t&StepConnect{\n\t\t\tconfig: &b.config.ConnectConfig,\n\t\t},\n\t\t&StepCreateVM{\n\t\t\tconfig: &b.config.CreateConfig,\n\t\t},\n\t\t&StepConfigureHardware{\n\t\t\tconfig: &b.config.HardwareConfig,\n\t\t},\n\t)\n\n\tif b.config.Comm.Type != \"none\" {\n\t\tsteps = append(steps,\n\t\t\t&StepRun{},\n\t\t\t&communicator.StepConnect{\n\t\t\t\tConfig: &b.config.Comm,\n\t\t\t\tHost: commHost,\n\t\t\t\tSSHConfig: sshConfig,\n\t\t\t},\n\t\t\t&common.StepProvision{},\n\t\t\t&StepShutdown{},\n\t\t)\n\t}\n\n\tsteps = append(steps,\n\t\t&StepCreateSnapshot{\n\t\t\tcreateSnapshot: b.config.CreateSnapshot,\n\t\t},\n\t\t&StepConvertToTemplate{\n\t\t\tConvertToTemplate: b.config.ConvertToTemplate,\n\t\t},\n\t)\n\n\t// Run!\n\tb.runner = common.NewRunner(steps, b.config.PackerConfig, ui)\n\tb.runner.Run(state)\n\n\t// If there was an error, return that\n\tif rawErr, ok := state.GetOk(\"error\"); ok {\n\t\treturn nil, rawErr.(error)\n\t}\n\n\t// If we were interrupted or cancelled, then just exit.\n\tif _, ok := state.GetOk(multistep.StateCancelled); ok {\n\t\treturn nil, errors.New(\"Build was cancelled.\")\n\t}\n\n\tif _, ok := state.GetOk(multistep.StateHalted); ok {\n\t\treturn nil, errors.New(\"Build was halted.\")\n\t}\n\n\tartifact := &Artifact{\n\t\tName: b.config.VMName,\n\t\tVM: state.Get(\"vm\").(*object.VirtualMachine),\n\t}\n\treturn artifact, nil\n}", "title": "" }, { "docid": "ff9becb8866121d65caf83ed3b54ec0c", "score": "0.5960394", "text": "func (fn RunnerFunc) Run(ctx context.Context) error {\n\treturn fn(ctx)\n}", "title": "" }, { "docid": "4d6ef3a8adff7c529dcd991c78a6e4d7", "score": "0.5957263", "text": "func (p *ActorStateProcessor) Run(ctx context.Context) error {\n\tnode, closer, err := p.opener.Open(ctx)\n\tif err != nil {\n\t\treturn xerrors.Errorf(\"open lens: %w\", err)\n\t}\n\tdefer closer()\n\n\t// Loop until context is done or processing encounters a fatal error\n\treturn wait.RepeatUntil(ctx, batchInterval, func(ctx context.Context) (bool, error) {\n\t\treturn p.processBatch(ctx, node)\n\t})\n}", "title": "" }, { "docid": "f5a96f5c6e457af7e6e9fb510261e407", "score": "0.595663", "text": "func (c *Code) Run(v Validater, expected []byte, r io.Reader, w, e io.Writer) (string, error) {\n\tcmd, err := c.buildCmd(1)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcmd.Stdin, cmd.Stdout, cmd.Stderr = r, w, e\n\treturn c.judge(cmd, v, expected), nil\n}", "title": "" }, { "docid": "d9b2a4846a91524c6c4463dfb8ca20f4", "score": "0.59484506", "text": "func (a *Aggregator) Run() error {\n\tos.MkdirAll(a.tmpDir, os.ModePerm)\n\tdefer os.RemoveAll(a.tmpDir)\n\n\tif err := a.shuffle(); err != nil {\n\t\treturn err\n\t}\n\treturn a.aggregateTop()\n}", "title": "" }, { "docid": "95134a167871de8f0b792cd25b0b796a", "score": "0.59451526", "text": "func (t *ManageForm) Run(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\r\n\tfmt.Println(\"run is running \" + function)\r\n\treturn t.Invoke(stub, function, args)\r\n}", "title": "" }, { "docid": "33c3ecb07a7e2b2b0089efade5a0bbdb", "score": "0.5944302", "text": "func (proj *projector) Run(ctx context.Context, category string, entityID uuid.UUID) (interface{}, error) {\n\treturn proj.run(ctx, category+\"-\"+entityID.String())\n}", "title": "" }, { "docid": "6d71de689d5f75ef09f1e770ca5d3255", "score": "0.5932207", "text": "func (cmd *TaskRunCommand) Run() error {\n\tfmt.Println(\"Not implemented yet.\")\n\treturn nil\n}", "title": "" }, { "docid": "aa7b21c0446fe0a304eb2c9ed848fab4", "score": "0.5931132", "text": "func (sm *stateMachine) Run(transitionType TransitionType, stateSwitch StateSwitch, args TransitionArgs) error {\n\ttransByType, ok := sm.transitionRules[transitionType]\n\tif !ok {\n\t\treturn NoMatchForTransitionType\n\t}\n\n\tfor _, tr := range transByType {\n\t\tallow, err := tr.IsAllowedToRun(stateSwitch, args)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif allow {\n\t\t\tif tr.Transition != nil {\n\t\t\t\tif err := tr.Transition(stateSwitch, args); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif err := stateSwitch.SetState(tr.DestinationState); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif tr.PostTransition != nil {\n\t\t\t\treturn tr.PostTransition(stateSwitch, args)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn NoConditionPassedToRunTransaction\n}", "title": "" }, { "docid": "845d8293bd070e7959550344920d0c25", "score": "0.59290195", "text": "func RunStep(state ProgramState, program []int) (ProgramState, error) {\n\tvar ip int = state.IP\n\tvar opcode Opcode\n\tswitch program[ip] {\n\tcase 1:\n\t\tadd := AddOpcode{program[ip+1], program[ip+2], program[ip+3]}\n\t\topcode = add\n\t\t//fmt.Printf(\"IP: %v Add @%v (%v) to @%v (%v) -> %v\\n\", ip, add.Operand1Pos, program[add.Operand1Pos], add.Operand2Pos, program[add.Operand2Pos], add.OutputPos)\n\tcase 2:\n\t\tmul := MultiplyOpcode{program[ip+1], program[ip+2], program[ip+3]}\n\t\topcode = mul\n\t\t//fmt.Printf(\"IP: %v Mul @%v (%v) to @%v (%v) -> %v\\n\", ip, mul.Operand1Pos, program[mul.Operand1Pos], mul.Operand2Pos, program[mul.Operand2Pos], mul.OutputPos)\n\tcase 99:\n\t\treturn ProgramState{-1}, nil\n\t}\n\treturn opcode.Execute(state, program)\n}", "title": "" }, { "docid": "a9e8574880a407d1f18c6eef0fe752e4", "score": "0.5924011", "text": "func (chain *PhaseChain) Run() error {\n\tfor _, phase := range chain.phases {\n\t\tif phase.ShouldRun() {\n\t\t\terr := phase.Run()\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tchain.afterRun()\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "29c63660c3d9045bb2c10639313d9979", "score": "0.59190434", "text": "func (runner *suiteRunner) run(t *testing.T) {\n\tsuiteName := reflect.Indirect(reflect.ValueOf(runner.suite)).Type().Name()\n\tt.Run(suiteName, func(t *testing.T) {\n\t\tif runner.runError == nil && len(runner.tests) > 0 {\n\t\t\tif runner.checkFixtureArgs(t) {\n\t\t\t\trunner.runFixture(t, runner.setUpSuite, \"\", nil)\n\t\t\t\tt.Cleanup(func() {\n\t\t\t\t\trunner.runFixture(t, runner.tearDownSuite, \"\", nil)\n\t\t\t\t})\n\n\t\t\t\tfor i := 0; i != len(runner.tests); i++ {\n\t\t\t\t\trunner.forkTest(t, runner.tests[i])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "20ed8c7b931760bbcff294c67c5410d0", "score": "0.5917388", "text": "func (o *OrganizerModern) Run() {\n\tif o.only != nil {\n\t\to.runTest(o.only)\n\t\treturn\n\t}\n\n\tfor _, test := range o.tests {\n\t\to.runTest(&test)\n\t}\n}", "title": "" }, { "docid": "23125c5434a1ad9ed21045369a18a223", "score": "0.5915604", "text": "func Run() {\n\tDefaultManager.Run()\n}", "title": "" }, { "docid": "f6b1c70a70da6a58fcd04fef08179e5d", "score": "0.5915116", "text": "func (h *Harness) Run() *report.Testsuites {\n\th.Setup()\n\th.RunTests()\n\th.Report()\n\treturn h.report\n}", "title": "" }, { "docid": "8c2dcc723ee1e11037d422f51ed69ea8", "score": "0.59107095", "text": "func (sc Subcmds) Run(args []string) error {\n\treturn sc.RunWithName(\"\", args)\n}", "title": "" }, { "docid": "6a6b50164bec2c8201d79da6414b91dd", "score": "0.59094274", "text": "func (pow *ProofOfWork) Run() (int, []byte) {\n\t// TODO(student)\n\treturn 0, []byte{}\n}", "title": "" }, { "docid": "f2bd252341669fccd4a604625bda1fd4", "score": "0.5905262", "text": "func (w *Runner) Run() error {\n\tdefer func() {\n\t\tw.d = make([]Starter, 0)\n\t}()\n\tfor _, d := range w.d {\n\t\td := d\n\t\tw.eg.Go(func() error {\n\t\t\treturn <-d.Start(w.ctx)\n\t\t})\n\t}\n\n\treturn w.eg.Wait()\n}", "title": "" }, { "docid": "1c9396d56cc9529e3d6eced9e5b6f4af", "score": "0.5896531", "text": "func (v *Version) Run(args []string) int {\n\tfmt.Fprint(v.Stdout, \"Vault Initializer Version - 0.01\\n\")\n\treturn 0\n}", "title": "" }, { "docid": "a230d99914b2cc7300a1ab2e510b78d8", "score": "0.5894294", "text": "func (s *scenario) Run(w io.Writer) restify.ScenarioResult {\n\tio.WriteString(w, fmt.Sprintf(\n\t\t\"Start running test scenario: name=%s, env=%s, desc=%s, cases=%d\\r\\n\",\n\t\ts.name, s.environment, s.description, len(s.cases)))\n\n\ttestResults := []restify.TestResult{}\n\thttpClient := http.Client{}\n\nloop:\n\tfor i, tc := range s.cases {\n\t\tio.WriteString(w, fmt.Sprintf(\n\t\t\t\"%d. Test case: name=%s desc=%s onfail=%s delay=%s\\r\\n\",\n\t\t\t(i+1), tc.Name, tc.Description, tc.Pipeline.OnFailure, tc.Pipeline.Delay))\n\n\t\ttr := restify.NewTestResult(s, i)\n\n\t\t//Parse any cache needed\n\t\ttc.Request.Parse(s.cache)\n\t\t// tc.Expect.Parse(s.cache)\n\t\tpayload, _ := json.Marshal(tc.Request.Payload)\n\n\t\t//Setup HTTP request\n\t\treq, err := http.NewRequest(tc.Request.Method, tc.Request.URL, bytes.NewBuffer(payload))\n\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to create request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if err != nil {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to create request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Success = true\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\tcontinue loop\n\t\t}\n\n\t\t//Add headers to request\n\t\tfor key, head := range tc.Request.Headers {\n\t\t\treq.Header.Add(key, head)\n\t\t}\n\n\t\t//trace HTTP\n\t\tvar start, connect, dns, tlsHandshake time.Time\n\t\ttrace := &httptrace.ClientTrace{\n\t\t\tDNSStart: func(dsi httptrace.DNSStartInfo) { dns = time.Now() },\n\t\t\tDNSDone: func(ddi httptrace.DNSDoneInfo) {\n\t\t\t\ttr.TimingDNS = time.Since(dns)\n\t\t\t},\n\n\t\t\tTLSHandshakeStart: func() { tlsHandshake = time.Now() },\n\t\t\tTLSHandshakeDone: func(cs tls.ConnectionState, err error) {\n\t\t\t\ttr.TimingHandshake = time.Since(tlsHandshake)\n\t\t\t},\n\n\t\t\tConnectStart: func(network, addr string) { connect = time.Now() },\n\t\t\tConnectDone: func(network, addr string, err error) {\n\t\t\t\ttr.TimingConnected = time.Since(connect)\n\t\t\t},\n\n\t\t\tGotFirstResponseByte: func() {\n\t\t\t\ttr.TimingFirstByte = time.Since(start)\n\t\t\t},\n\t\t}\n\t\treq = req.WithContext(httptrace.WithClientTrace(req.Context(), trace))\n\n\t\t//Initiate HTTP request\n\t\tstart = time.Now()\n\t\tres, err := httpClient.Do(req)\n\t\ttr.TimingTotal = time.Since(start)\n\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to execute request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if err != nil {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to execute request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Success = true\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\t\t\tcontinue loop\n\t\t}\n\n\t\ttr.ResponseCode = res.StatusCode\n\t\ttr.ResponseSize = res.ContentLength\n\n\t\t//Assert response body first so we print the response JSON before anything else\n\t\tbody, err := ioutil.ReadAll(res.Body)\n\t\tres.Body.Close()\n\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to get response body: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if err != nil {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to get response body: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Success = true\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\tcontinue loop\n\t\t} else {\n\t\t\tio.WriteString(w, fmt.Sprintf(\"%d. Got response body: %s\\r\\n\", (i+1), string(body)))\n\t\t}\n\n\t\t//Assert status code\n\t\tif res.StatusCode != tc.Expect.StatusCode && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%d. Expectation failed. Expect status: %d, got: %d\\r\\n\",\n\t\t\t\t(i + 1), tc.Expect.StatusCode, res.StatusCode)\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if res.StatusCode != tc.Expect.StatusCode {\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%d. Expectation failed. Expect status: %d, got: %d\\r\\n\",\n\t\t\t\t(i + 1), tc.Expect.StatusCode, res.StatusCode)\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Success = true\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\tcontinue loop\n\t\t}\n\n\t\t// Evaluate every rule\n\t\tpair := make(map[string]interface{})\n\t\tjson.Unmarshal(body, &pair) //\tconvert []byte to map[string]interface{}\n\n\t\tfor k, v := range s.cache { //\tadd all cache to pair\n\t\t\tvar cache map[string]interface{}\n\t\t\tjson.Unmarshal(v, &cache)\n\t\t\tpair[k] = cache\n\t\t}\n\n\t\tfor _, expr := range tc.Expect.Evaluate { //\tforeach rule in evaluate\n\t\t\tisValid := expr.IsTrue(pair)\n\t\t\tif !isValid && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\t\tmsg := fmt.Sprintf(\"%d. Expression Failed : Status %t\\r\\n\", (i + 1), isValid)\n\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\ttr.Message = msg\n\t\t\t\ttestResults = append(testResults, tr)\n\n\t\t\t\treturn testResults\n\t\t\t} else if !isValid {\n\t\t\t\tmsg := fmt.Sprintf(\"%d. Expression Failed : Status %t\\r\\n\", (i + 1), isValid)\n\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\ttr.Success = true\n\t\t\t\ttr.Message = msg\n\t\t\t\ttestResults = append(testResults, tr)\n\n\t\t\t\tcontinue loop\n\t\t\t} else {\n\t\t\t\tmsg := fmt.Sprintf(\"%d. Expression Success: Status %t\\r\\n\", (i + 1), isValid)\n\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t//cache if needed\n\t\tif tc.Pipeline.Cache {\n\t\t\ts.cache[tc.Pipeline.CacheAs] = body\n\t\t}\n\n\t\tmsg := fmt.Sprintf(\"%d. Success\\r\\n\", (i + 1))\n\t\tio.WriteString(w, msg)\n\n\t\ttr.Success = true\n\t\ttr.Message = msg\n\t\ttestResults = append(testResults, tr)\n\n\t\ttc.Pipeline.Delay = restify.Delay(strings.TrimSpace(string(tc.Pipeline.Delay)))\n\t\tif !tc.Pipeline.Delay.IsZero() {\n\t\t\tdelay, _ := time.ParseDuration(string(tc.Pipeline.Delay))\n\t\t\ttime.Sleep(delay)\n\t\t}\n\t}\n\n\treturn restify.ScenarioResult(testResults)\n}", "title": "" }, { "docid": "9441940f18a1ee0318ae4ad1f5b991f5", "score": "0.5879725", "text": "func (h *Human) Run() {\n\th.age++\n\th.updateAgeRange()\n\n\tif h.age == h.childAge {\n\t\tfor i := 0; i < numChilds(); i++ {\n\t\t\th.BornNewChild()\n\t\t}\n\t} else if h.age == h.deathAge {\n\t\th.Die()\n\t}\n}", "title": "" }, { "docid": "2dddfd5edecc00fd834e13d9dc306f44", "score": "0.58730406", "text": "func (em *Emulator) Run() {\n\tem.running = true\n\n\tfor em.running {\n\t\tem.RunOne()\n\t}\n}", "title": "" } ]
7ea5b828dc6d6e7a3b572b8e36de3dce
Call twirp.ServerHooks.ResponsePrepared if the hook is available
[ { "docid": "ddf1287dc573a57e248ccc0ca9a92d54", "score": "0.78205836", "text": "func callResponsePrepared(ctx context.Context, h *twirp.ServerHooks) context.Context {\n\tif h == nil || h.ResponsePrepared == nil {\n\t\treturn ctx\n\t}\n\treturn h.ResponsePrepared(ctx)\n}", "title": "" } ]
[ { "docid": "27bba788f2d6c777f5166bdee2f5957f", "score": "0.68071187", "text": "func ResponsePreparedCallback(ctx context.Context) context.Context {\n\treturn ctx\n}", "title": "" }, { "docid": "9cd30b2ef2424e801eb581e33b3bbc5a", "score": "0.6448635", "text": "func callResponseSent(ctx context.Context, h *twirp.ServerHooks) {\n\tif h == nil || h.ResponseSent == nil {\n\t\treturn\n\t}\n\th.ResponseSent(ctx)\n}", "title": "" }, { "docid": "9cd30b2ef2424e801eb581e33b3bbc5a", "score": "0.6448635", "text": "func callResponseSent(ctx context.Context, h *twirp.ServerHooks) {\n\tif h == nil || h.ResponseSent == nil {\n\t\treturn\n\t}\n\th.ResponseSent(ctx)\n}", "title": "" }, { "docid": "9cd30b2ef2424e801eb581e33b3bbc5a", "score": "0.6448635", "text": "func callResponseSent(ctx context.Context, h *twirp.ServerHooks) {\n\tif h == nil || h.ResponseSent == nil {\n\t\treturn\n\t}\n\th.ResponseSent(ctx)\n}", "title": "" }, { "docid": "9cd30b2ef2424e801eb581e33b3bbc5a", "score": "0.6448635", "text": "func callResponseSent(ctx context.Context, h *twirp.ServerHooks) {\n\tif h == nil || h.ResponseSent == nil {\n\t\treturn\n\t}\n\th.ResponseSent(ctx)\n}", "title": "" }, { "docid": "9cd30b2ef2424e801eb581e33b3bbc5a", "score": "0.6448635", "text": "func callResponseSent(ctx context.Context, h *twirp.ServerHooks) {\n\tif h == nil || h.ResponseSent == nil {\n\t\treturn\n\t}\n\th.ResponseSent(ctx)\n}", "title": "" }, { "docid": "9cd30b2ef2424e801eb581e33b3bbc5a", "score": "0.6448635", "text": "func callResponseSent(ctx context.Context, h *twirp.ServerHooks) {\n\tif h == nil || h.ResponseSent == nil {\n\t\treturn\n\t}\n\th.ResponseSent(ctx)\n}", "title": "" }, { "docid": "9cd30b2ef2424e801eb581e33b3bbc5a", "score": "0.6448635", "text": "func callResponseSent(ctx context.Context, h *twirp.ServerHooks) {\n\tif h == nil || h.ResponseSent == nil {\n\t\treturn\n\t}\n\th.ResponseSent(ctx)\n}", "title": "" }, { "docid": "9cd30b2ef2424e801eb581e33b3bbc5a", "score": "0.6448635", "text": "func callResponseSent(ctx context.Context, h *twirp.ServerHooks) {\n\tif h == nil || h.ResponseSent == nil {\n\t\treturn\n\t}\n\th.ResponseSent(ctx)\n}", "title": "" }, { "docid": "f91e94fc217226658d6c72b873285341", "score": "0.61734205", "text": "func (k <%= pluginInternal %>) OnResponse(ctx context.Context, p spec.APIProxy, c controller.Controller, r *http.Request, resp *http.Response, span opentracing.Span) error {\n\treturn nil\n}", "title": "" }, { "docid": "fc757e324a03d16f916f8ba760a67cf5", "score": "0.5826396", "text": "func (g *jsiiProxy_GatewayResponse) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tg,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "50a6d134ae5f161197a1b1f039a51393", "score": "0.57796913", "text": "func (g *jsiiProxy_GatewayResponse) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tg,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "f8505b7a3b5c4900c6d34c145ae92d58", "score": "0.57501566", "text": "func hookResponse(command string, resJSON string, isDebug bool, isJSONRes bool) string {\n\trescueStdout := os.Stdout\n\tr, w, _ := os.Pipe()\n\tos.Stdout = w\n\n\tdisplaymgr.PrintResponse(command, resJSON, false, false, false)\n\n\tw.Close()\n\tout, _ := ioutil.ReadAll(r)\n\tos.Stdout = rescueStdout\n\n\treturn string(out)\n}", "title": "" }, { "docid": "3c472a4dcc2b2932e972f7e0f749a2d2", "score": "0.537206", "text": "func (c *jsiiProxy_CfnResponsePlan) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "d79d38fe5ab99d7caeada224f045d375", "score": "0.53570163", "text": "func (c *jsiiProxy_CfnGatewayResponse) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "8953bd24b40755b51b209a1886abcd8d", "score": "0.535338", "text": "func (srv *PBServer) Prepare(ctx context.Context, args *replication.PrepareArgs) (*replication.PrepareReply, error) {\n\tlog.Printf(\"Server %d: Prep starting on {%d}\\n\", srv.me, args.Index)\n\n\tif srv.status != NORMAL {\n\t\treturn &replication.PrepareReply{\n\t\t\tSuccess: false,\n\t\t\tView: srv.currentView,\n\t\t}, nil\n\t}\n\n\tcallback := make(chan bool)\n\n\tlog.Printf(\"Server %d: Prep sending {%d} to CPP\\n\", srv.me, args.Index)\n\tsrv.prepChan <- &callbackArg{\n\t\tcallback: callback,\n\t\targs: args,\n\t\thandled: false,\n\t}\n\n\treply := &replication.PrepareReply{\n\t\tSuccess: <-callback,\n\t\tView: srv.currentView,\n\t}\n\n\tlog.Printf(\"Server %d: Prep ack {%v} from CPP for message of idx {%d}, returning\\n\", srv.me, reply.Success, args.Index)\n\n\tclose(callback)\n\n\treturn reply, nil\n}", "title": "" }, { "docid": "186026ee78145c6422201f4d3d2d3dfa", "score": "0.53455484", "text": "func (c *jsiiProxy_CfnIntegrationResponseV2) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "f7d8be0a3514ac6f600f4aa438714f82", "score": "0.53252184", "text": "func OnBeforeResponse(callback func(client *Client, request *Request, response *Message)) {\n\ton(\"before-response\", func(args ...interface{}) {\n\t\tif len(args) > 2 {\n\t\t\tcallback(args[0].(*Client), args[1].(*Request), args[2].(*Message))\n\t\t}\n\t})\n}", "title": "" }, { "docid": "c84060593ae7c80e3284d9aa0c3a6d5d", "score": "0.5312953", "text": "func (c *jsiiProxy_CfnRouteResponseV2) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "3d1ac023b8686ba548c73582ac8022fd", "score": "0.5305427", "text": "func prereceiveHook(vars map[string]string) ([]byte, error) {\n\tvar out bytes.Buffer\n\t// We parse the template anew each receive in case it has changed.\n\tt, err := template.New(\"hooks\").Parse(PrereceiveHookTpl)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\terr = t.Execute(&out, vars)\n\treturn out.Bytes(), err\n}", "title": "" }, { "docid": "d64ce75c16394d572c943299b4956403", "score": "0.5303786", "text": "func (options) HookResponse(f ResponseHookFunc) Option {\n\treturn func(r *Request) {\n\t\tr.responseHookFuncs = append(r.responseHookFuncs, f)\n\t}\n}", "title": "" }, { "docid": "cd503fbabba1c59f8dcde8b1846a9162", "score": "0.5290125", "text": "func (c *jsiiProxy_CfnRouteResponseV2) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "7dad3c424bde53d342e985564c1bc717", "score": "0.52860284", "text": "func init() {\n\tAddPlugin(10000, Funcs{afterRespond: recordStats})\n}", "title": "" }, { "docid": "6ea4e3105b2e0f5483c2383184e12d71", "score": "0.5281906", "text": "func PrepareResponse(result interface{}) ([]byte, error) {\n\tswitch responseType {\n\tcase teamsResponseType:\n\t\tswitch castResult := result.(type) {\n\t\tcase *v1.Pod:\n\t\t\treturn renderTeamsPodCard([]v1.Pod{*castResult})\n\t\tcase *v1.PodList:\n\t\t\treturn renderTeamsPodCard(castResult.Items)\n\t\tcase nil:\n\t\t\treturn []byte(\"ok\"), nil // if nil then we presume that the command was executed successfully\n\t\tdefault:\n\t\t\treturn nil, errors.New(fmt.Sprintf(\"unknown type returned from execute command: %s\", reflect.TypeOf(castResult)))\n\t\t}\n\tdefault:\n\t\treturn nil, errors.New(\"unknown response type: \" + responseType)\n\t}\n}", "title": "" }, { "docid": "d14229d7889d2f5cd850aa5540f9d07a", "score": "0.52641904", "text": "func (c *jsiiProxy_CfnIntegrationResponseV2) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "c4bc06557fcfc87bac83d0d87a7b263f", "score": "0.52602273", "text": "func (s *Server) hook(rw http.ResponseWriter, req *http.Request) {\n\tdefer req.Body.Close()\n\n\t// decode JSON body into data structure\n\tdecoder := json.NewDecoder(req.Body)\n\tvar hook api.NsolidHook\n\terr := decoder.Decode(&hook)\n\tif err != nil {\n\t\tfmt.Printf(\"WARN: Failed to parse hook payload: %s\\n\", err)\n\t\trw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// ignore webhooks for events other than nsolid-process-blocked\n\tif hook.Event != \"nsolid-process-blocked\" {\n\t\tfmt.Printf(\"Ignoring unknown event type '%s'\\n\", hook.Event)\n\t\trw.WriteHeader(http.StatusNoContent)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"Handling Hook (Blocked For: %d)\\n\", hook.BlockedFor)\n\tfmt.Printf(\"Stack:\\n%v\\n\", hook.Stack)\n\n\t// spin off processing into goroutine. After this point, there's no reason to keep the client waiting\n\tgo s.transformAndStore(hook.Stack, hook.BlockedFor)\n\trw.WriteHeader(http.StatusNoContent)\n}", "title": "" }, { "docid": "cef4ffb588c0261a3ceaac30571e326d", "score": "0.52562356", "text": "func (c *jsiiProxy_CfnGatewayResponse) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "f08bd6e75f41e85838912d01f1af6334", "score": "0.5249981", "text": "func finalize(\n\trequest *generic.SyncHookRequest,\n\tresponse *generic.SyncHookResponse,\n) error {\n\tglog.Infof(\"Starting hello world finalize\")\n\tdefer glog.Infof(\"Completed hello world finalize\")\n\n\tif request.Attachments.IsEmpty() {\n\t\tresponse.Finalized = true\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dd41ea6e238f33b72ed4fe7d2573f887", "score": "0.5236229", "text": "func (q *QsPlayerSpeech) Prepare() {\n}", "title": "" }, { "docid": "dffb8652786ca27c5444294f2dbda739", "score": "0.5220769", "text": "func (a *jsiiProxy_ApplicationListener) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\ta,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "7feabc9f9147fcc1c2c60444c8404014", "score": "0.52192837", "text": "func (c *jsiiProxy_CfnResponsePlan) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "7253d00dd84aa1a0b62e4e624fbb7829", "score": "0.52023053", "text": "func (p *jsiiProxy_Provider) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tp,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "10a847dbf774cd21d4e5cf564a8528da", "score": "0.51559246", "text": "func (t *Tracker) listenForResponses() {\n\tfor {\n\t\tconn := t.responseListener.NextConn()\n\t\tif conn == nil {\n\t\t\treturn\n\t\t}\n\n\t\tgo t.handleConn(conn)\n\t}\n}", "title": "" }, { "docid": "9ec76434aa509e931d44477fdbac018c", "score": "0.51488173", "text": "func (b *jsiiProxy_BaseListener) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tb,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "597ee75a567aa16ce938318476e393b2", "score": "0.5146468", "text": "func (c *jsiiProxy_Canary) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "dcf7c6fc9b021cbb2141e3eef3a320bc", "score": "0.51312387", "text": "func (p *jsiiProxy_ProxyResource) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tp,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "d458034c3966d9a49f6016195426077e", "score": "0.5122292", "text": "func (w *WebRequest) OnResponseStarted(callback func(details Object)) {\n\tw.o.Get(\"onResponseStarted\").Call(\"addListener\", callback)\n}", "title": "" }, { "docid": "747e7e7b5b1bc6b9863cc85b566c33bf", "score": "0.5105191", "text": "func isHTTPProbeReady(res *http.Response) bool {\n\t// response status code between 200-399 indicates success\n\treturn res.StatusCode >= 200 && res.StatusCode < 400\n}", "title": "" }, { "docid": "f74cf0d300ecfa00734ff31ea590d61e", "score": "0.5096801", "text": "func (ogPacket originalPacketDetails) prepareSpoofedResponse(dns *layers.DNS, cDetails poisonCommandDetails) *layers.DNS {\n\n\twritePacket := false\n\tvar websiteAtIndex int\n\tif dns.ANCount == 0 {\n\t\tfor _, dnsQuestion := range dns.Questions {\n\t\t\twebsite := string(dnsQuestion.Name)\n\t\t\tvar answerRecord layers.DNSResourceRecord\n\t\t\tif cDetails.hostfile != \"\" {\n\t\t\t\twebsiteAtIndex = contains(cDetails.websiteNames, website)\n\t\t\t\tif websiteAtIndex == -1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twebsiteAtIndex = 0 //default\n\t\t\t}\n\t\t\twritePacket = true\n\t\t\tspoofedIp := net.ParseIP(cDetails.redirectLocations[websiteAtIndex])\n\t\t\t// fmt.Print(\"Spoofed IP: \", spoofedIp)\n\n\t\t\tanswerRecord.IP = spoofedIp\n\t\t\tdns.ANCount += 1\n\n\t\t\tanswerRecord.Type = layers.DNSTypeA\n\t\t\tanswerRecord.Name = []byte(dnsQuestion.Name)\n\t\t\tanswerRecord.Class = layers.DNSClassIN\n\t\t\tdns.QR = true\n\t\t\tdns.OpCode = layers.DNSOpCodeNotify\n\t\t\tdns.AA = true\n\t\t\tdns.Answers = append(dns.Answers, answerRecord)\n\t\t\tdns.ResponseCode = layers.DNSResponseCodeNoErr\n\t\t}\n\t}\n\tif writePacket {\n\t\treturn dns\n\t} else {\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "29f5d9eb8cc0a6cb2a1e9d9d9183694f", "score": "0.50927836", "text": "func InitResponseServer() {\n\t// Message handler\n\thttp.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tdecoder := json.NewDecoder(r.Body)\n\t\tvar data map[string]interface{}\n\t\terr := decoder.Decode(&data)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Couldn't read request body: %s\", err)\n\t\t\treturn\n\t\t}\n\t\tlog.Infof(\"Got request body: %s\", data)\n\t\troute := \"\"\n\t\tif data[\"route\"] != nil {\n\t\t\troute = data[\"route\"].(string)\n\t\t}\n\t\tdataBody := interface{}(nil)\n\t\tif data[\"data\"] != nil {\n\t\t\tdataBody = data[\"data\"].(interface{})\n\t\t}\n\t\t// try to get config\n\t\tconfigBody := interface{}(nil)\n\t\tif data[\"config\"] != nil {\n\t\t\tconfigBody = data[\"config\"].(interface{})\n\t\t}\n\t\treplyTo := \"\"\n\t\tif data[\"replyTo\"] != nil {\n\t\t\treplyTo = data[\"replyTo\"].(string)\n\t\t}\n\t\tpayload := Payload{Data: dataBody, Config: configBody}\n\t\tbody, errMarshal := json.Marshal(payload)\n\t\tif errMarshal != nil {\n\t\t\tlog.Errorf(\"Couldn't marshal body\")\n\t\t\treturn\n\t\t}\n\t\terr = ch.Publish(\n\t\t\tconfig.Exchange, // exchange\n\t\t\troute, // routing key\n\t\t\tfalse, // mandatory\n\t\t\tfalse, // immediate\n\t\t\tamqp.Publishing{\n\t\t\t\tContentType: \"text/plain\",\n\t\t\t\tBody: []byte(body),\n\t\t\t\tReplyTo: replyTo,\n\t\t\t})\n\t\tfailOnError(err, \"Failed to publish a message\")\n\t\tlog.Infof(\" [x] Sent to %s - %s\", route, body)\n\t})\n\t// Health checks handler\n\thttp.HandleFunc(\"/health\", func(w http.ResponseWriter, r *http.Request) {\n\t\tlog.Infof(\" [x] Healthcheck..\")\n\t})\n\terr := http.ListenAndServe(config.ServerListen, nil)\n\tfailOnError(err, \"Failed to start a server\")\n\tlog.Infof(\"Started server on: %s\", config.ServerListen)\n}", "title": "" }, { "docid": "0e20dcd472fe054a651536e5181d3197", "score": "0.5082052", "text": "func (r *jsiiProxy_RestApi) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tr,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "aa0bd99563503e629835ee549caba546", "score": "0.5079442", "text": "func (r *jsiiProxy_Resource) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tr,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "e83ffe795a7c830a5c26e2cdf7a9c718", "score": "0.5059869", "text": "func (p *jsiiProxy_ProxyResource) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tp,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "7cd72510d22f6cf020832b6360b84500", "score": "0.50490135", "text": "func (s *jsiiProxy_SpecRestApi) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\ts,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "904416c0706772d7189a9be4cceccece", "score": "0.5041875", "text": "func (r *RespawnTimes) Prepare() {\n}", "title": "" }, { "docid": "e1c3601979994bc86653f5cbc3216542", "score": "0.5038882", "text": "func (p *jsiiProxy_Provider) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tp,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "ab70890632b5cfe037dd06e2d2175691", "score": "0.5025217", "text": "func (p *Pbft) PrePrepare(r *PaxiBFT.Request, s *[]byte, slt int) {\n\tlog.Debugf(\"<--------------------PrePrepare------------------>\")\n\n\t_, ok := p.log[p.slot]\n\tif !ok {\n\t\tp.log[p.slot] = &entry{\n\t\t\tballot: p.ballot,\n\t\t\tview: p.view,\n\t\t\tcommand: r.Command,\n\t\t\tcommit: false,\n\t\t\tactive: false,\n\t\t\tLeader: false,\n\t\t\trequest: r,\n\t\t\ttimestamp: time.Now(),\n\t\t\tDigest: GetMD5Hash(r),\n\t\t\tQ1: PaxiBFT.NewQuorum(),\n\t\t\tQ2: PaxiBFT.NewQuorum(),\n\t\t\tQ3: PaxiBFT.NewQuorum(),\n\t\t\tQ4: PaxiBFT.NewQuorum(),\n\t\t}\n\t}\n\n\tp.Broadcast(PrePrepare{\n\t\tBallot: p.ballot,\n\t\tID: p.ID(),\n\t\tView: p.view,\n\t\tSlot: slt,\n\t\tRequest: *r,\n\t\tDigest: *s,\n\t\tCommand: r.Command,\n\t})\n\tlog.Debugf(\"++++++ PrePrepare Done ++++++\")\n}", "title": "" }, { "docid": "db894e1879493f33701f0a6b454b3622", "score": "0.50187266", "text": "func (r *jsiiProxy_RestApiBase) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tr,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "8f60bdfd61f7d1ee3665ac5714026eb3", "score": "0.49985653", "text": "func (r *jsiiProxy_Resource) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tr,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "37579cad49da83e33c3b2be9fee16c70", "score": "0.49863818", "text": "func (c *jsiiProxy_Canary) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "1b38ec9c46659cd818986fc9f12ed197", "score": "0.49771708", "text": "func (l *Launcher) Prepare() {\n}", "title": "" }, { "docid": "679a724da77629d96806ce64612def97", "score": "0.4963342", "text": "func (w *response) Hijack() { w.hijacked = true }", "title": "" }, { "docid": "aaa2e1420e335243fec8c47a8c0a5f89", "score": "0.4959071", "text": "func (ctx *context) Respond(bytes []byte) {\n\tctx.response = bytes\n}", "title": "" }, { "docid": "f0612d8e0e4d2384195ec0e4e5a791d9", "score": "0.4955297", "text": "func HandleHookedRequest(r http.ResponseWriter, req *http.Request) {\n\tr.Header().Add(\"Content-Type\", \"application/json\")\n\n\tif req.ContentLength < 1 {\n\t\tr.WriteHeader(http.StatusBadRequest)\n\t\tr.Write([]byte(fmt.Sprintf(`{\"message\": \"no text passed. Cannot run sentiment analysis\"}`)))\n\t\tlog.Printf(\"POST /task > ERROR: no text passed\\n\")\n\t\treturn\n\t}\n\n\tdata, err := ioutil.ReadAll(req.Body)\n\tif err != nil && err != io.EOF {\n\t\tr.WriteHeader(http.StatusInternalServerError)\n\t\tr.Write([]byte(fmt.Sprintf(`{\"message\": \"ERROR: error reading request body\", \"error\": \"%v\"}`, err.Error())))\n\t\tlog.Printf(\"POST /task > ERROR: error reading request\\n\\t%v\\n\", err)\n\t\treturn\n\t}\n\n\tj := TaskJSON{}\n\terr = json.Unmarshal(data, &j)\n\tif err != nil {\n\t\tr.WriteHeader(http.StatusBadRequest)\n\t\tr.Write([]byte(fmt.Sprintf(`{\"message\": \"ERROR: error unmarshalling given JSON into expected format\", \"error\": \"%v\"}`, err.Error())))\n\t\tlog.Printf(\"POST /task > ERROR: error unmarshalling given JSON\\n\\t%v\\n\", err)\n\t\treturn\n\t}\n\n\t// * Perform the GET hook * //\n\tseries, text, lang, err := GetHookResponse(j)\n\tif err != nil {\n\t\tr.WriteHeader(http.StatusInternalServerError)\n\t\tr.Write([]byte(fmt.Sprintf(`{\"message\": \"ERROR: unable to get text from hook request with configured parameters\", \"error\": %v}`, err)))\n\t\tlog.Printf(\"POST /task > ERROR: error getting hooked response\\n\\t%v\\n\", err)\n\t\treturn\n\t}\n\n\tresp := []byte{}\n\n\tanalysis := model.SentimentAnalysis(text, lang)\n\n\tif series == nil {\n\t\tresp, err = json.Marshal(analysis)\n\t} else {\n\t\tfor i := range series {\n\t\t\tseries[i].Score = model.SentimentAnalysis(series[i].Text, lang).Score\n\t\t}\n\t\tresp, err = json.Marshal(TimeSeriesResponse{\n\t\t\tMetadata: analysis,\n\t\t\tSeries: series,\n\t\t})\n\t}\n\n\tif err != nil {\n\t\tr.WriteHeader(http.StatusInternalServerError)\n\t\tr.Write([]byte(fmt.Sprintf(`{\"message\": \"ERROR: unable to marshal sentiment analysis into JSON\", \"error\": \"%v\"}`, err.Error())))\n\t\tlog.Printf(\"POST /task > ERROR: error marshalling sentiment analysis into JSON\\n\\t%v\\n\", err)\n\t\treturn\n\t}\n\n\tr.WriteHeader(http.StatusOK)\n\tr.Write(resp)\n\n\thookCount++\n\tcount++\n\tlog.Printf(\"POST /task [len(text) = %v]\\n\", len(text))\n}", "title": "" }, { "docid": "6e5f54be1a0d4577ad55c6ac37a3c364", "score": "0.49540693", "text": "func GotStreamedMapResponse() {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tlastStreamedMapResponse = time.Now()\n\tselfCheckLocked()\n}", "title": "" }, { "docid": "83842d6f9c88f08466feeeb7c1c16da7", "score": "0.49447286", "text": "func (g *HttpGetter) OnResponse(f ResponseCallback) {\n\tif f == nil {\n\t\tg.rcb = rcb\n\t} else {\n\t\tg.rcb = f\n\t}\n}", "title": "" }, { "docid": "348931c81579e9c7ff084edd511e9189", "score": "0.49368578", "text": "func (m *jsiiProxy_Method) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tm,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "f458db6c9118cd4ac1378c05caabb2ea", "score": "0.4926382", "text": "func (p *proxier) forwardResponse(r *Response) {\n\tlistener, ok := p.listeners.Load(r.Id)\n\tif !ok {\n\t\t// It's possible the listener timed out. Ignore the response and move on.\n\t\treturn\n\t}\n\tlistener.(chan *Response) <- r\n}", "title": "" }, { "docid": "9a350ae29395eee7483d46bf24f33a4e", "score": "0.4925934", "text": "func (r *jsiiProxy_RestApi) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tr,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "cdf9535954f2bf0d8a0fb67bcdb9bed5", "score": "0.49258596", "text": "func (w *response) needsSniff() bool {\n\t_, haveType := w.handlerHeader[\"Content-Type\"]\n\treturn !w.cw.wroteHeader && !haveType && w.written < sniffLen\n}", "title": "" }, { "docid": "f7ef91a1047e3dc8ce554f6be7a2f316", "score": "0.49181545", "text": "func (s stats) printResponse() {\n\tif len(s.responses) == 0 {\n\t\treturn\n\t}\n\ts.resTex.RLock()\n\tdefer s.resTex.RUnlock()\n\tsort.Sort(s.responses)\n\tfmt.Println(\"Responses:\")\n\tfor i := range s.responses {\n\t\tfmt.Printf(\"%3d %d\\n\", s.responses[i].count, s.responses[i].code)\n\t}\n\tfmt.Println()\n}", "title": "" }, { "docid": "a629e4d6bb58a469845bae66b4b2f686", "score": "0.49168476", "text": "func (rsp *ResponseWrapper) markHijacked() {\n\tif rsp == nil {\n\t\treturn\n\t}\n\trsp.hijacked = true\n\t// mark all responses to the root handler\n\trsp.derivedFrom.markHijacked()\n}", "title": "" }, { "docid": "b4475206fcfd362f80f360241eeb2bd2", "score": "0.49165022", "text": "func (r *jsiiProxy_ResourceBase) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tr,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "a968777cb488fafde2ff0eeaf9a8a018", "score": "0.49152544", "text": "func (c *Context) IsResponded() bool { return c.res.Wrote }", "title": "" }, { "docid": "e3c6ec3dbd7cfae69773dfd423d0b7b6", "score": "0.49120262", "text": "func (r *Response) ready() bool {\n\tif r.proto == \"\" {\n\t\treturn false\n\t}\n\tif 0 > r.statusCode || r.statusCode > 600 {\n\t\treturn false\n\t}\n\tif r.statusMSg == \"\" {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "baf5ef85951ea2df4d8376ecbcd60fc9", "score": "0.49055344", "text": "func (p *Pbft) HandlePrepare(m Prepare) {\n\tlog.Debugf(\"<--------------------HandlePrepare------------------>\")\n\tlog.Debugf(\" Sender %v \", m.ID)\n\tlog.Debugf(\"p.slot=%v\", p.slot)\n\tlog.Debugf(\"m.slot=%v\", m.Slot)\n\n\te, ok := p.log[m.Slot]\n\n\tif !ok {\n\t\tlog.Debugf(\"we create a log\")\n\t\tp.log[m.Slot] = &entry{\n\t\t\tballot: p.ballot,\n\t\t\tview: p.view,\n\t\t\tcommand: m.Command,\n\t\t\tcommit: false,\n\t\t\tactive: false,\n\t\t\tLeader: false,\n\t\t\trequest: &m.Request,\n\t\t\ttimestamp: time.Now(),\n\t\t\tDigest: GetMD5Hash(&m.Request),\n\t\t\tQ1: PaxiBFT.NewQuorum(),\n\t\t\tQ2: PaxiBFT.NewQuorum(),\n\t\t\tQ3: PaxiBFT.NewQuorum(),\n\t\t\tQ4: PaxiBFT.NewQuorum(),\n\t\t}\n\t}\n\te, ok = p.log[m.Slot]\n\te.Q1.ACK(m.ID)\n\n\tif e.Q1.Majority(){\n\t\te.Q1.Reset()\n\t\te.Pstatus = PREPARED\n\t\tp.Broadcast(Commit{\n\t\t\tBallot: p.ballot,\n\t\t\tID: p.ID(),\n\t\t\tView: p.view,\n\t\t\tSlot: m.Slot,\n\t\t\tDigest: m.Digest,\n\t\t})\n\t}\n\tif e.Cstatus == COMMITTED && e.Pstatus == PREPARED && e.Rstatus == RECEIVED{\n\t\te.commit = true\n\t\tp.exec()\n\t}\n\tlog.Debugf(\"++++++ HandlePrepare Done ++++++\")\n}", "title": "" }, { "docid": "6b7b88e21e0d12960b2fcd3fedab49fd", "score": "0.48849794", "text": "func (r *jsiiProxy_ResourceBase) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tr,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "7809320f0782e9852bf2c9953de83c8d", "score": "0.48784792", "text": "func Ready(w http.ResponseWriter, r *http.Request) {\n\tInfo(r, \"HTTP startup probe succeeded\")\n\tw.WriteHeader(200)\n}", "title": "" }, { "docid": "8d0e6a46fc383ae81e773ca395194e5b", "score": "0.48729852", "text": "func (c *jsiiProxy_CallApiGatewayHttpApiEndpoint) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "cb5e36e9b446b4c28a59baf5229b4681", "score": "0.4862731", "text": "func (d *jsiiProxy_Deployment) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\td,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "3ece7b8f23d56be33693eebdfe36c2ce", "score": "0.48577854", "text": "func (s *jsiiProxy_SageMakerUpdateEndpoint) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\ts,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "ac275ae5c08ccd308a5d658e26cdaec6", "score": "0.48561692", "text": "func (c *jsiiProxy_CustomResource) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "91591ceb2b9e5e435fabddff38ed346e", "score": "0.48484445", "text": "func (d *jsiiProxy_Deployment) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\td,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "f3ca4f4c43060f315a4fd985048f22be", "score": "0.48482707", "text": "func (s *Sender) Prepare() error {\n\tlog.Logger.WithField(\"pipe\", s.config.PipeName).Info(\"sender module is preparing...\")\n\ts.runningClient.RegisterListener(s.listener)\n\tfor _, runningForwarder := range s.runningForwarders {\n\t\terr := runningForwarder.Prepare(s.runningClient.GetConnectedClient())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\ts.sendCounter = telemetry.NewCounter(\"sender_output_count\", \"Total number of the output count in the Sender.\", \"pipe\", \"status\", \"type\")\n\treturn nil\n}", "title": "" }, { "docid": "5763123d1a0d2f10256def5e600cca5f", "score": "0.4842742", "text": "func serverCallb(req interface{}, conn net.Conn, quitch <-chan bool) {\n\tvar buf [1024]byte\n\n\tswitch req.(type) {\n\tcase *protobuf.StatisticsRequest:\n\t\tprotobuf.EncodeAndWrite(conn, buf[:], testStatisticsResponse)\n\tcase *protobuf.ScanRequest:\n\t\tprotobuf.EncodeAndWrite(conn, buf[:], testResponseStream)\n\tcase *protobuf.ScanAllRequest:\n\t\tprotobuf.EncodeAndWrite(conn, buf[:], testResponseStream)\n\t}\n}", "title": "" }, { "docid": "76ae52c0ad44089926dd604cd5258a4e", "score": "0.48376355", "text": "func serverResponseListener() {\n\tserver := rpc.NewServer()\n\tserverResponseRPC := new(ServerCommunication)\n\terr := server.Register(serverResponseRPC)\n\tif err != nil {\n\t\tlog.Fatalf(\"Format of service ServerCommunication isn't correct. %s\", err)\n\t}\n\n\toldMux := http.DefaultServeMux\n mux := http.NewServeMux()\n http.DefaultServeMux = mux\n\tserver.HandleHTTP(rpc.DefaultRPCPath, rpc.DefaultDebugPath)\n\thttp.DefaultServeMux = oldMux\n\n\tlistener, _ := net.Listen(\"tcp\", \":\"+SERVER_RPC_PORT)\n\thttp.Serve(listener, mux)\n}", "title": "" }, { "docid": "a8d1cef1d4df8f02dc162074d9ad7443", "score": "0.48361254", "text": "func (action *Action) Prepare(w http.ResponseWriter, r *http.Request) {\n\tbase := &action.Base\n\taction.App = AppFromContext(r.Context())\n\tbase.Prepare(w, r, action.App.ctx, action.App.config.SSEUpdateFrequency)\n\tif action.R.Context() != nil {\n\t\taction.Log = log.Ctx(action.R.Context())\n\t} else {\n\t\taction.Log = log.DefaultLogger\n\t}\n}", "title": "" }, { "docid": "7aa85a81c2f2c60a97092b4450ba9d49", "score": "0.48312423", "text": "func (c *jsiiProxy_CfnListener) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "2eb88936c08f81f3460e4300f7324350", "score": "0.48300076", "text": "func (b *BannedIps) Prepare() {\n}", "title": "" }, { "docid": "3b8148b723db0f991caad1470eb65e4b", "score": "0.48226637", "text": "func (c *client) prepare(op int, id int, r int, a string, p string) reply {\n\tvar m request\n\n\tm = request{op, id, r, a, p}\n\trep := c.send(m)\n\treturn rep\n}", "title": "" }, { "docid": "f2e356052388e0918be10ba3fda420b6", "score": "0.48226282", "text": "func (ep *Entrypoint) prepare(router http.Handler) error {\n\tvar (\n\t\terr error\n\t\ttlsConfig *tls.Config\n\t\tlistener net.Listener\n\t)\n\n\tif tlsConfig, err = ep.createTLSConfig(); err != nil {\n\t\treturn err\n\t}\n\n\tlistener, err = net.Listen(\"tcp\", ep.configuration.Address)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tep.listener = listener\n\tep.server = &http.Server{\n\t\tAddr: ep.configuration.Address,\n\t\tHandler: ep.buildRouter(router),\n\t\tTLSConfig: tlsConfig,\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "79fa3210df3e2aff2d5f9054861db5dc", "score": "0.48203892", "text": "func (s *Runtime) ResponseSent() error {\n\ts.ManagedThread.Lock()\n\tdefer s.ManagedThread.Unlock()\n\terr := s.currentState.ResponseSent()\n\tif err == nil {\n\t\ts.responseTime = time.Now()\n\t}\n\treturn err\n}", "title": "" }, { "docid": "531795d72e2dd6cc72b248918fa9570e", "score": "0.48154262", "text": "func Init() {\n\tetc.HtpErrCb = func(r *http.Request, w http.ResponseWriter, good bool, code int, data string) {\n\t\twriteAPIResponse(r, w, good, code, data)\n\t}\n}", "title": "" }, { "docid": "9fe839071a6c6f008e8352f739b9ed5a", "score": "0.48122698", "text": "func (r *jsiiProxy_RestApiBase) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tr,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "f7b3bb40f24c9b8375b3ac6811a4e2be", "score": "0.48104188", "text": "func (b *jsiiProxy_BaseListener) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\tb,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "c3fa20a4a8ae30716753f15d7e5081e5", "score": "0.4805808", "text": "func (t *Trace) GotFirstResponseByte() {\n\tt.firstByte = time.Now()\n\tklog.V(7).Infof(\"%s - got first reponse byte\", t.Host)\n}", "title": "" }, { "docid": "de87405f1432dcf5fcc0247eac52bfd4", "score": "0.48033985", "text": "func (s *jsiiProxy_Stage) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\ts,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "15ce840d1f42c34f73e0232df7f08ada", "score": "0.47958276", "text": "func (s *jsiiProxy_SageMakerUpdateEndpoint) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\ts,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "89451f72fcf144043d79f6dd0437ae0e", "score": "0.47940895", "text": "func (_Vesting *VestingCallerSession) IsPrepared() (bool, error) {\n\treturn _Vesting.Contract.IsPrepared(&_Vesting.CallOpts)\n}", "title": "" }, { "docid": "1397e9d20ce156d7cc748d2ae542a277", "score": "0.47901425", "text": "func (s *jsiiProxy_Stage) OnPrepare() {\n\t_jsii_.InvokeVoid(\n\t\ts,\n\t\t\"onPrepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" }, { "docid": "28a55a928e35976e3acae9688874bc97", "score": "0.4789932", "text": "func (c *Context) SetResponse(res http.ResponseWriter) { c.res.SetWriter(res) }", "title": "" }, { "docid": "84ec626262a79f515b118e71302798f5", "score": "0.47746015", "text": "func bailResponse(response *http.Response, msg string, args ...interface{}) {\n\tmsg = fmt.Sprintf(msg, args...)\n\t// ok to ignore error here\n\tb, _ := ioutil.ReadAll(response.Body)\n\trespMsg := fmt.Sprintf(\"server returned [%d]: %s\", response.StatusCode, b)\n\tfmt.Fprintln(os.Stderr, fmt.Sprintf(\"%s: %s\", msg, respMsg))\n\tos.Exit(1)\n}", "title": "" }, { "docid": "a7a1f58f3f8161636f99442435e061a4", "score": "0.47736448", "text": "func (u *jsiiProxy_UntrustedCodeBoundaryPolicy) Prepare() {\n\t_jsii_.InvokeVoid(\n\t\tu,\n\t\t\"prepare\",\n\t\tnil, // no parameters\n\t)\n}", "title": "" } ]
a80a311aa68892bc86d879a0e182a1e7
What to do if the body is larger than can be inspected. Valid values are `CONTINUE` (default), `MATCH` and `NO_MATCH`.
[ { "docid": "ea6963bc8dd2c7c424dff6df675805ba", "score": "0.0", "text": "func (o WebAclRuleStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBodyOutput) OversizeHandling() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementNotStatementStatementRegexMatchStatementFieldToMatchJsonBody) *string {\n\t\treturn v.OversizeHandling\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" } ]
[ { "docid": "7d62c0e4fb56a93e06f3dd2340826647", "score": "0.5383553", "text": "func match(tpl, body []ast.Stmt) bool {\n\tfmt.Printf(\"check type %v %v\\n\", len(tpl), len(body))\n\treturn false\n}", "title": "" }, { "docid": "912993210e6eb31e586a060c40cd8d49", "score": "0.51508", "text": "func requestBodyRemains(rc io.ReadCloser) bool {\n\tif rc == NoBody {\n\t\treturn false\n\t}\n\tswitch v := rc.(type) {\n\tcase *expectContinueReader:\n\t\treturn requestBodyRemains(v.readCloser)\n\tcase *body:\n\t\treturn v.bodyRemains()\n\tdefault:\n\t\tpanic(\"unexpected type \" + fmt.Sprintf(\"%T\", rc))\n\t}\n}", "title": "" }, { "docid": "860286a9e38c27e2497035a0d4958bca", "score": "0.49036407", "text": "func (rcv *Block) MutateBodyLength(n int64) bool {\n\treturn rcv._tab.MutateInt64(rcv._tab.Pos+flatbuffers.UOffsetT(16), n)\n}", "title": "" }, { "docid": "27d06ef6dca5b9ac4b6b324fc2030157", "score": "0.48457944", "text": "func (_ WordLength) OK(request *Request, reply *Reply, b bool) error { return nil }", "title": "" }, { "docid": "efa7392e5a493e684fd802ea95311579", "score": "0.48169556", "text": "func (m *PacketParserMock) MinimockParsePacketBodyDone() bool {\n\tfor _, e := range m.ParsePacketBodyMock.expectations {\n\t\tif mm_atomic.LoadUint64(&e.Counter) < 1 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// if default expectation was set then invocations count should be greater than zero\n\tif m.ParsePacketBodyMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterParsePacketBodyCounter) < 1 {\n\t\treturn false\n\t}\n\t// if func was set then invocations count should be greater than zero\n\tif m.funcParsePacketBody != nil && mm_atomic.LoadUint64(&m.afterParsePacketBodyCounter) < 1 {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "2fec1c598024e86aa6c293e9a6a5b753", "score": "0.4711801", "text": "func TestBody(t *testing.T) {\n\ts := ParseMsg(\"fake\\r\\nheader\\r\\n\\r\\nbody ...\\r\\n\\r\\n\")\n\tif s.Body != \"body ...\\r\\n\\r\\n\" {\n\t\tt.Errorf(\"[TestBody] Error getting the right body from the string.\")\n\t}\n}", "title": "" }, { "docid": "306a5256cb66802da700c7c9acc8966e", "score": "0.4673548", "text": "func (e *TestMilter) Body(m *milter.Modifier) (milter.Response, error) {\n\t// prepare buffer\n\t_ = bytes.NewReader(e.message.Bytes())\n\tfmt.Println(\"size of body: \", e.message.Len())\n\tm.AddHeader(\"name\", \"value\")\n\tm.AddRecipient(\"some.new.rcpt@example.com\")\n\tm.ChangeFrom(\"new.from@example.com\")\n\tm.ChangeHeader(0, \"Subject\", \"New Subject\")\n\tm.DeleteRecipient(\"to@example.com\")\n\tm.InsertHeader(0, \"new\", \"value\")\n\tm.ReplaceBody([]byte(\"new body\"))\n\n\t// accept message by default\n\treturn milter.RespAccept, nil\n}", "title": "" }, { "docid": "0de64a5b2a62d09603cceed07b70db59", "score": "0.46271548", "text": "func parseBody(r *http.Request, dest interface{}) (int, error) {\n\t// Read the body of the request.\n\tbody, err := ioutil.ReadAll(io.LimitReader(r.Body, 1048576))\n\n\t// Were we able to read the request?\n\tif err == nil {\n\t\t// We were able to read it, so let's see if the data was valid.\n\t\terr = json.Unmarshal(body, &dest)\n\n\t\t// Was the data valid?\n\t\tif err == nil {\n\t\t\t// Data was valid.\n\t\t\treturn http.StatusOK, nil\n\t\t} else {\n\t\t\t// Data was invalid, so let the user know.\n\t\t\treturn http.StatusBadRequest, errors.New(\"Malformed request body.\")\n\t\t}\n\t} else {\n\t\t// There was an error. Send our error as the response.\n\t\treturn http.StatusBadRequest,\n\t\t\terrors.New(\"Could not read request. Size of request might be too large.\")\n\t}\n}", "title": "" }, { "docid": "a963bec58b3570aa62e8f2b196010535", "score": "0.45967767", "text": "func (s *BasePlSqlParserListener) ExitBody(ctx *BodyContext) {}", "title": "" }, { "docid": "5bc8bdc28d77f2a88b5ff33dc4bed552", "score": "0.4587007", "text": "func (msg *Message) bodyLen() (int, bool) {\n\t// If we have no header or message is nil, we return 0, false\n\tif msg == nil || msg.header == nil {\n\t\treturn 0, false\n\t}\n\n\t// If the len is indicated in the header, use it\n\tif bLen := msg.header.bodyLen(); bLen != 0 {\n\t\treturn bLen, true\n\t}\n\n\t// ReaderLen is the len of the reader\n\trlen, found := readerLen(msg.Body)\n\n\t// If we didn't find anything, return 0, false\n\treturn rlen, found\n}", "title": "" }, { "docid": "5f219fb53543d60c922b4465fc7b836c", "score": "0.4579982", "text": "func (f NoOpFilter) EvaluateBody(span sdk.Span, body []byte) bool {\n\treturn false\n}", "title": "" }, { "docid": "e664c017289718729182fc8761354c2c", "score": "0.4543919", "text": "func (body Body) Len() int { return int(body.size) }", "title": "" }, { "docid": "4b733d7d2e5629f38b11f208ba91afd3", "score": "0.45416337", "text": "func (s *BasecluListener) ExitBody(ctx *BodyContext) {}", "title": "" }, { "docid": "ae38d1f78c2fe5456c7b70b7d2aea340", "score": "0.45076084", "text": "func (p *MultiProxy) Check(b []byte, _ []interface{}) (bool, int) {\n\trequired := 0\n\n\tfor _, v := range p.match {\n\t\tif len(v) > len(b) {\n\n\t\t\tif bytes.Compare(v[:len(b)], b) == 0 {\n\t\t\t\t// We found the smallest potential future match\n\t\t\t\trequired = len(v)\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else if bytes.Compare(b[:len(v)], v) == 0 {\n\t\t\treturn true, 0\n\t\t}\n\t}\n\n\treturn false, required\n}", "title": "" }, { "docid": "2a56264cbf951d3240c02302718fc84e", "score": "0.44722182", "text": "func (b *Builder) Match(msg *insightV1.LogMessage) bool {\n\tfor _, m := range b.chain {\n\t\tif !m.Match(msg) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "268cb2bb92c4ef1384c6940fc224f2e7", "score": "0.44696113", "text": "func doFindLargerSize(size int64, pattern string) bool {\n\ti, err := humanize.ParseBytes(pattern)\n\tfatalIf(probe.NewError(err), \"Error parsing string passed to flag larger\")\n\n\treturn int64(i) < size\n}", "title": "" }, { "docid": "6eea8fbb830f23f95631111c75ca7eef", "score": "0.4462692", "text": "func (f Fetcher) processBody() []byte {\n\tb, err := io.ReadAll(f.resp.Body)\n\tf.resp.Body.Close()\n\tif f.resp.StatusCode >= 300 {\n\t\tlog.Fatalf(\"Response failed with status code: %d\\n and body: %s\\n\", f.resp.StatusCode, b)\n\t}\n\tcheck(err)\n\treturn b\n}", "title": "" }, { "docid": "102d2a50b8cbad553bd64f66d75388c3", "score": "0.44598207", "text": "func expandCaseBody(args *Cell, count int) (*Cell, *Cell) {\n\tif args == Nil {\n\t\treturn Nil, Nil\n\t} else {\n\t\tclause := args.Head() // ((dN..) eN..) or (else e..)\n\t\ttest, body := clause.Car, clause.Tail()\n\t\trest := args.Tail()\n\t\tif rest == Nil && test == Else_ { // (else e..)\n\t\t\tbind := __(thunk_, &Cell{Lambda_, &Cell{Nil, body}})\n\t\t\tcond := __(Else_, __(thunk_))\n\t\t\treturn __(bind), __(cond)\n\t\t} else { // ((d..) e...)\n\t\t\tthunkN := NewSym(fmt.Sprintf(\"thunk%d\", count))\n\t\t\tbind := __(thunkN, &Cell{Lambda_, &Cell{Nil, body}})\n\t\t\tcond := __(__(memv_, key_, __(Quote_, test)), __(thunkN))\n\t\t\tbaseBinds, baseConds := expandCaseBody(rest, count+1)\n\t\t\treturn &Cell{bind, baseBinds}, &Cell{cond, baseConds}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5c0134a614018fe2eb04521bb7b91d80", "score": "0.44288328", "text": "func (e *TestMilter) Body(m *Modifier) (Response, error) {\n\t// prepare buffer\n\t_ = bytes.NewReader(e.message.Bytes())\n\n\tm.AddHeader(\"name\", \"value\")\n\tm.AddRecipient(\"some.new.rcpt@example.com\")\n\tm.ChangeFrom(\"new.from@example.com\")\n\tm.ChangeHeader(0, \"Subject\", \"New Subject\")\n\tm.DeleteRecipient(\"to@example.com\")\n\tm.InsertHeader(0, \"new\", \"value\")\n\tm.ReplaceBody([]byte(\"new body\"))\n\n\t// accept message by default\n\treturn RespAccept, nil\n}", "title": "" }, { "docid": "7fc893c297c2786c060a3f962a57d5e8", "score": "0.44075733", "text": "func (ra *ResponseAsserter) BodySize(exp int) *ResponseAsserter {\n\tif act := ra.rec.Body.Len(); act != exp {\n\t\tra.fail.Fatalf(\"body size: got: '%d', exp: '%d'\", act, exp)\n\t}\n\n\treturn ra\n}", "title": "" }, { "docid": "0e612060f1b3b42b805da102661f80e3", "score": "0.43958595", "text": "func (o *InlineResponse200115) GetBodyOk() (*string, bool) {\n\tif o == nil || o.Body == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Body, true\n}", "title": "" }, { "docid": "722ac97ab62792363c7abb4d34627ebe", "score": "0.43934426", "text": "func processBodyIfNecessary(req *http.Request) io.Reader {\n\tswitch req.Header.Get(\"Content-Encoding\") {\n\tdefault:\n\t\treturn req.Body\n\n\tcase \"gzip\":\n\t\treturn gunzippedBodyIfPossible(req.Body)\n\n\tcase \"deflate\", \"zlib\":\n\t\treturn zlibUncompressedbody(req.Body)\n\t}\n}", "title": "" }, { "docid": "ab579c3fa6fe199054c140e55cdddd10", "score": "0.43771988", "text": "func TestNestIfThen(t *testing.T) {\n\tf := New(nil, nil)\n\tf.AddWord(\": nest ( w -- w w | 0 ) DUP IF DUP IF DUP + THEN DUP + THEN ;\")\n\ta, _ := f.Addr(\"nest\")\n\tfor _, j := range f.Memory[a : a+16] {\n\t\tfmt.Printf(\"%x \", j)\n\t}\n\tf.Push(30)\n\tRunWord(\"nest\", f, t)\n\tx := f.Pop()\n\tfmt.Println()\n\tif x != 120 {\n\t\tt.Fatal(\"should have been 120 but was\", x)\n\t}\n}", "title": "" }, { "docid": "356151036f41ced6de6289b5ec035892", "score": "0.4376705", "text": "func (req *Request) OK(body string) {\n\treq.Reply(http.StatusOK, body)\n}", "title": "" }, { "docid": "c720ce41211a78d1b3110315b401d1df", "score": "0.43619445", "text": "func Match(e *message.Entity, c *imap.SearchCriteria) (bool, error) {\n\t// TODO: support encoded header fields for Bcc, Cc, From, To\n\t// TODO: add header size for Larger and Smaller\n\n\th := mail.Header{e.Header}\n\n\tif !c.SentBefore.IsZero() || !c.SentSince.IsZero() {\n\t\tt, err := h.Date()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tt = t.Round(24 * time.Hour)\n\n\t\tif !c.SentBefore.IsZero() && !t.Before(c.SentBefore) {\n\t\t\treturn false, nil\n\t\t}\n\t\tif !c.SentSince.IsZero() && !t.After(c.SentSince) {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\tfor key, wantValues := range c.Header {\n\t\tvalues, ok := e.Header[key]\n\t\tfor _, wantValue := range wantValues {\n\t\t\tif wantValue == \"\" && !ok {\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\tif wantValue != \"\" {\n\t\t\t\tok := false\n\t\t\t\tfor _, v := range values {\n\t\t\t\t\tif matchString(v, wantValue) {\n\t\t\t\t\t\tok = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !ok {\n\t\t\t\t\treturn false, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor _, body := range c.Body {\n\t\tif ok, err := matchBody(e, body); err != nil || !ok {\n\t\t\treturn false, err\n\t\t}\n\t}\n\tfor _, text := range c.Text {\n\t\t// TODO: also match header fields\n\t\tif ok, err := matchBody(e, text); err != nil || !ok {\n\t\t\treturn false, err\n\t\t}\n\t}\n\n\tif c.Larger > 0 || c.Smaller > 0 {\n\t\tn, err := bodyLen(e)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tif c.Larger > 0 && uint32(n) < c.Larger {\n\t\t\treturn false, nil\n\t\t}\n\t\tif c.Smaller > 0 && uint32(n) > c.Smaller {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\tfor _, not := range c.Not {\n\t\tok, err := Match(e, not)\n\t\tif err != nil || ok {\n\t\t\treturn false, err\n\t\t}\n\t}\n\tfor _, or := range c.Or {\n\t\tok1, err := Match(e, or[0])\n\t\tif err != nil {\n\t\t\treturn ok1, err\n\t\t}\n\n\t\tok2, err := Match(e, or[1])\n\t\tif err != nil || (!ok1 && !ok2) {\n\t\t\treturn false, err\n\t\t}\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "64f432737f3ea36a3906b61f50ddcb8f", "score": "0.43576288", "text": "func (s *IfStmt) Body() Node {\n\tif s.IfStmt.Body == nil {\n\t\treturn nil\n\t}\n\treturn s.findChildByAstNode(s.IfStmt.Body)\n}", "title": "" }, { "docid": "7c490149d859e0b8e5a2a821fe00aa77", "score": "0.43538925", "text": "func match(m *dns.Msg) (*dns.Msg, bool) {\n\t// only delay pkts with RD bit \n\treturn m, m.MsgHdr.RecursionDesired == true\n}", "title": "" }, { "docid": "397ffde3ead4f8a7a57ba2b20a21ae25", "score": "0.43515542", "text": "func doFindSmallerSize(size int64, pattern string) bool {\n\ti, err := humanize.ParseBytes(pattern)\n\tfatalIf(probe.NewError(err), \"Error parsing string passed to flag smaller\")\n\n\treturn int64(i) > size\n}", "title": "" }, { "docid": "29f57d76e04c9df62f6d3be3d0fc2d93", "score": "0.43489182", "text": "func (s *BaseSyslParserListener) ExitElse_block_stmt(ctx *Else_block_stmtContext) {}", "title": "" }, { "docid": "834869971361bc8dddee5660a99f11d9", "score": "0.43440247", "text": "func (o *Post) GetBodyOk() (AnyOfmicrosoftGraphItemBody, bool) {\n\tif o == nil || o.Body == nil {\n\t\tvar ret AnyOfmicrosoftGraphItemBody\n\t\treturn ret, false\n\t}\n\treturn *o.Body, true\n}", "title": "" }, { "docid": "50092b99bda0ee0415b3babe94211e20", "score": "0.43380317", "text": "func (o *InlineResponse20049Post) GetBodyOk() (*string, bool) {\n\tif o == nil || o.Body == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Body, true\n}", "title": "" }, { "docid": "97d59f9e4a14849dd69f2b8d01b2472f", "score": "0.43373907", "text": "func (s *headerMatcher) Match(exists []byte, appender []byte, start int, end int) bool {\n\treturn appender[end] == '\\n' && !s.matchHeader(exists, appender[start:end])\n}", "title": "" }, { "docid": "646a5b79db684236a4b31fa329435fca", "score": "0.43335664", "text": "func shouldEncodeBody(response *events.APIGatewayProxyResponse, body []byte) bool {\n\tif contentEncoding := response.Headers[\"Content-Encoding\"]; contentEncoding != \"\" && contentEncoding != \"identity\" {\n\t\treturn true\n\t}\n\tfor _, b := range body {\n\t\tswitch b {\n\t\tcase '\\t', '\\r', '\\n':\n\t\t\tcontinue\n\t\t}\n\t\tif b < 0x20 || b > 0x7f {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "06b4b35b9578ad7afbcdfe49fbb78f1a", "score": "0.42978013", "text": "func (s Scanner) match(expected byte) bool {\n\tif s.reachedEnd() {\n\t\treturn false\n\t}\n\n\tif s.peek() == expected {\n\t\ts.current++\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "136c8d22b76b99827237eb7c5964ceaa", "score": "0.42935276", "text": "func deepMatch(body string)string{\n\tvar re *regexp.Regexp\n\tvar res_l []string\n\tmap_l := make(map[string]int)\n\t// Php\n\tre, _ = regexp.Compile(`\\.php|\\.phtml`)\n\tres_l = re.FindAllString(body, -1)\n\tmap_l[\"Php\"] = len(res_l)\n\t// Java\n\tre, _ = regexp.Compile(`\\.jsp|\\.jspx|.do|\\.wss|\\.action`)\n\tres_l = re.FindAllString(body, -1)\n\tmap_l[\"Java\"] = len(res_l)\n\t// Asp\n\tre, _ = regexp.Compile(`\\.asp|\\.aspx|(__VIEWSTATE\\W*)`)\n\tres_l = re.FindAllString(body, -1)\n\tmap_l[\"Asp\"] = len(res_l)\n\t// Python\n\tre, _ = regexp.Compile(`\\.py`)\n\tres_l = re.FindAllString(body, -1)\n\tmap_l[\"Python\"] = len(res_l)\n\t// Ruby\n\tre, _ = regexp.Compile(`\\.rb|\\.rhtml`)\n\tres_l = re.FindAllString(body, -1)\n\tmap_l[\"Ruby\"] = len(res_l)\n\t// Perl\n\tre, _ = regexp.Compile(`\\.pl|\\.cgi`)\n\tres_l = re.FindAllString(body, -1)\n\tmap_l[\"Perl\"] = len(res_l)\n\n\t// Find the Most Counts as the standard of Most possible\n\tlang, max_cnt := utils.MaxMap(map_l)\n\tif max_cnt > 2{\n\t\treturn lang\n\t}else{\n\t\treturn \"Unknown\"\n\t}\n}", "title": "" }, { "docid": "2b8076153453162670cd319baa08c72c", "score": "0.42856568", "text": "func (pr httpProber) ProbeForBody(req *http.Request, timeout time.Duration) (probe.Result, string, string, error) {\n\tpr.transport.DisableCompression = true // removes Accept-Encoding header\n\tclient := &http.Client{\n\t\tTimeout: timeout,\n\t\tTransport: pr.transport,\n\t\tCheckRedirect: RedirectChecker(pr.followNonLocalRedirects),\n\t}\n\treturn DoHTTPProbe(req, client)\n}", "title": "" }, { "docid": "ad46b0b4938ffc174d6730df4cd98602", "score": "0.4285168", "text": "func (env *Env) CheckBlock(pdu *libcoap.Pdu) (bool, *string, *libcoap.Block) {\n blockValue, err := pdu.GetOptionIntegerValue(libcoap.OptionBlock2)\n if err != nil {\n log.WithError(err).Warn(\"Get block2 option value failed.\")\n return false, nil, nil\n\t}\n block := libcoap.IntToBlock(int(blockValue))\n\n size2Value, err := pdu.GetOptionIntegerValue(libcoap.OptionSize2)\n\tif err != nil {\n\t\tlog.WithError(err).Warn(\"Get size 2 option value failed.\")\n return false, nil, nil\n }\n\n eTag := pdu.GetOptionOpaqueValue(libcoap.OptionEtag)\n\n if block != nil {\n isMoreBlock := true\n blockKey := eTag + string(pdu.Token)\n // If block.M = 1, block is more block. If block.M = 0, block is last block\n if block.M == libcoap.MORE_BLOCK {\n log.Debugf(\"Response block is comming (eTag=%+v, block=%+v, size2=%+v) for request (token=%+v), waiting for the next block.\", eTag, block.ToString(), size2Value, pdu.Token)\n if block.NUM == 0 {\n env.responseBlocks[blockKey] = pdu\n initialBlockSize := env.InitialRequestBlockSize()\n secondBlockSize := env.SecondRequestBlockSize()\n // Check what block_size is used for block2 option\n // If the initialBlockSize is set: client will always request with block2 option\n // If the initialBlockSize is not set and the secondBlockSize is set: if the secondBlockSize is greater than the\n // recommended block size -> use the recommended block size, reversely, use the configured block size\n // If both initialBlockSize and secondBlockSize are not set -> use the recommended block size\n if initialBlockSize == nil && secondBlockSize != nil {\n if *secondBlockSize > block.SZX {\n log.Warn(\"Second block size must not greater thans block size received from server\")\n block.NUM += 1\n } else {\n block.NUM = 1 << uint(block.SZX - *secondBlockSize)\n block.SZX = *secondBlockSize\n }\n } else {\n block.NUM += 1\n }\n } else {\n if data, ok := env.responseBlocks[blockKey]; ok {\n env.responseBlocks[blockKey].Data = append(data.Data, pdu.Data...)\n block.NUM += 1\n } else {\n log.Warnf(\"The block version is not unknown. Re-request from the first block\")\n delete(env.responseBlocks, blockKey)\n block.NUM = 0\n }\n }\n block.M = 0\n return isMoreBlock, &eTag, block\n } else if block.M == libcoap.LAST_BLOCK {\n log.Debugf(\"Response block is comming (eTag=%+v, block=%+v, size2=%+v), this is the last block.\", eTag, block.ToString(), size2Value)\n isMoreBlock = false\n if data, ok := env.responseBlocks[blockKey]; ok {\n env.responseBlocks[blockKey].Data = append(data.Data, pdu.Data...)\n } else if block.NUM > 0 {\n log.Warnf(\"The block version is not unknown. Re-request from the first block\")\n delete(env.responseBlocks, blockKey)\n block.NUM = 0\n isMoreBlock = true\n }\n return isMoreBlock, &eTag, block\n }\n }\n return false, nil, nil\n}", "title": "" }, { "docid": "11423d6da9f6c811a882c7a246c4b426", "score": "0.42744762", "text": "func redactBody(ruleMatch HTTPMatch, r *http.Request) error {\n\tif r.Body == nil {\n\t\treturn nil\n\t}\n\n\tbody, err := ioutil.ReadAll(r.Body)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tredactedBody := []byte{}\n\tcontentType := getContentType(r)\n\n\tif contentType != \"\" {\n\t\tredactedBody, err = mapBody(ruleMatch, contentType, body)\n\t}\n\n\tcontentLength := len(redactedBody)\n\n\tr.Body = ioutil.NopCloser(bytes.NewReader(redactedBody))\n\tr.Header.Set(\"Content-Length\", strconv.Itoa(contentLength))\n\tr.ContentLength = int64(contentLength)\n\n\treturn err\n}", "title": "" }, { "docid": "c43421fb06719b0736ce3281012c041d", "score": "0.42713815", "text": "func (m *PacketParserMock) MinimockParsePacketBodyInspect() {\n\tfor _, e := range m.ParsePacketBodyMock.expectations {\n\t\tif mm_atomic.LoadUint64(&e.Counter) < 1 {\n\t\t\tm.t.Error(\"Expected call to PacketParserMock.ParsePacketBody\")\n\t\t}\n\t}\n\n\t// if default expectation was set then invocations count should be greater than zero\n\tif m.ParsePacketBodyMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterParsePacketBodyCounter) < 1 {\n\t\tm.t.Error(\"Expected call to PacketParserMock.ParsePacketBody\")\n\t}\n\t// if func was set then invocations count should be greater than zero\n\tif m.funcParsePacketBody != nil && mm_atomic.LoadUint64(&m.afterParsePacketBodyCounter) < 1 {\n\t\tm.t.Error(\"Expected call to PacketParserMock.ParsePacketBody\")\n\t}\n}", "title": "" }, { "docid": "6d2662393e58ac2d54516eb55fa4312c", "score": "0.4239819", "text": "func (s *BasePlSqlParserListener) ExitType_body(ctx *Type_bodyContext) {}", "title": "" }, { "docid": "17b02a7177943bdb0bc3f8888ba7ce43", "score": "0.42357546", "text": "func requestOk(w http.ResponseWriter, r *http.Request) bool {\n\tif r.Body == nil {\n\t\thttp.Error(w, \"Please send a request body\", 400)\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "85ef5fed013a512ae00c12c781a21573", "score": "0.42313993", "text": "func (s *BasePlSqlParserListener) ExitMaxsize_clause(ctx *Maxsize_clauseContext) {}", "title": "" }, { "docid": "04da79cd9626f844376bc4501bedbe12", "score": "0.4230158", "text": "func (matcher *Matcher) MatchSize(length int) bool {\n\t// Iterate over all the sizes accepted as valid\n\t//\n\t// Sizes codes don't support AND conditions.\n\tfor _, size := range matcher.Size {\n\t\t// Continue if the size doesn't match\n\t\tif length != size {\n\t\t\tcontinue\n\t\t}\n\t\t// Return on the first match.\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "f6a5423027297522303d9c8fa9d115b5", "score": "0.42246184", "text": "func (w *response) bodyAllowed() bool {\n\tif !w.wroteHeader {\n\t\tpanic(\"\")\n\t}\n\treturn bodyAllowedForStatus(w.status)\n}", "title": "" }, { "docid": "19c2f0402c44621874c7903f147062de", "score": "0.42089662", "text": "func (l *Lexer) Expect(r rune) bool {\n\treturn l.Peek() == r\n}", "title": "" }, { "docid": "140d00a07b0731e3ac9cfc3e1c696e8b", "score": "0.41999495", "text": "func (s *BasePlSqlParserListener) ExitSize_clause(ctx *Size_clauseContext) {}", "title": "" }, { "docid": "4c4fd5127d0ba1597f3e3edcaded1f02", "score": "0.41982168", "text": "func (bc *BodyCollection) HandleModBody() {\n\tselect {\n\tdefault:\n\tcase mod := <-bc.modBodyCh:\n\t\tvar found, modified = 0, 0\n\t\tfor i, size := 0, len(bc.arr); i < size; i++ {\n\t\t\tif mod.class != \"\" && mod.class == bc.arr[i].Class ||\n\t\t\t\tmod.name != \"\" && mod.name == bc.arr[i].Name ||\n\t\t\t\tmod.id == bc.arr[i].Id {\n\t\t\t\tfound++\n\t\t\t\tif bc.arr[i].ApplyMods(mod.mods) {\n\t\t\t\t\tmodified++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tswitch {\n\t\tcase found == 0:\n\t\t\tbc.modBodyResultCh <- grpcsimcb.NoMatch\n\t\tcase modified == 0:\n\t\t\tbc.modBodyResultCh <- grpcsimcb.ModNone\n\t\tcase found == modified:\n\t\t\tbc.modBodyResultCh <- grpcsimcb.ModAll\n\t\tdefault:\n\t\t\tbc.modBodyResultCh <- grpcsimcb.ModSome\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a3121a12a53ded28ade7a39738ceb91f", "score": "0.4197767", "text": "func (s *BaseSyslParserListener) ExitIf_stmt(ctx *If_stmtContext) {}", "title": "" }, { "docid": "7a10301f84ab7e3e32be145d15985d11", "score": "0.41943863", "text": "func bodyIsClosed(resp *http.Response) (isClosed bool) {\n\tif verifier, ofCorrectType := resp.Body.(*bodyCloseVerifier); ofCorrectType {\n\t\tisClosed = verifier.bodyClosed\n\t}\n\treturn\n}", "title": "" }, { "docid": "c8d85f7f006278c401a5f62ca6e6c08e", "score": "0.41936702", "text": "func (r ApiCreateHyperflexFeatureLimitInternalRequest) IfMatch(ifMatch string) ApiCreateHyperflexFeatureLimitInternalRequest {\n\tr.ifMatch = &ifMatch\n\treturn r\n}", "title": "" }, { "docid": "4fd981fd3ef5ee503e4a3224329baa2c", "score": "0.41866556", "text": "func (s *BaseEvent) ParseBody( body []byte, parseAll bool ) error {\n s.part1.EventType = EV_UNKNOWN;\n var numSections,part1Size,part2Size,sysSize,execSize uint\n\n if numParams,err:=fmt.Sscanf(string(body), \"%02d,1,%06d,1,%06d,1,%06d,1,%06d\\n\",&numSections,&part1Size,&part2Size,&sysSize,&execSize); numParams!=5 {\n s.errString = fmt.Sprintf( \"ParseBody error: only parsed %d parameters from frame:'%s' - err:\", numParams, body ) + err.Error()\n return s\n } // if\n if numSections != 4 {\n s.errString = fmt.Sprintf( \"ParseBody error expected 4 sections found %d\", numSections )\n return s\n } // if\n if part1Size == 0 {\n s.errString = \"ParseBody error part1 cannot be empty\"\n return s\n } // if\n\n startOffset := uint(BLOCK_HEADER_LEN);\n s.part1Json = body[startOffset:startOffset+part1Size]\n startOffset += part1Size\n if err:=s.parsePart1(); err != nil { return err }\n \n if part2Size > 0 {\n s.part2Json = body[startOffset:startOffset+part2Size]\n startOffset += part2Size\n if parseAll {\n if err:=s.parsePart2(); err != nil { return err }\n s.part2JsonExtracted = true\n } else {\n s.part2JsonExtracted = false\n } // else parseAll\n\n } // if\n if sysSize > 0 {\n s.sysParamsJson = body[startOffset:startOffset+sysSize]\n startOffset += sysSize\n if parseAll {\n if err:=s.parseSysParams(); err != nil { return err }\n s.sysParamsExtracted = true\n } else {\n s.sysParamsExtracted = false\n } // else parseAll\n } // if\n if execSize > 0 {\n s.execParamsJson = body[startOffset:startOffset+execSize]\n startOffset += execSize\n if parseAll {\n if err:=s.parseExecParams(); err != nil { return err }\n s.execParamsExtracted = true\n } else {\n s.execParamsExtracted = false\n } // else parseAll\n } // if\n\n Log.Printf( \"parseBody: sections:%d part1Size:%d part2Size:%d sysSize:%d execSize:%d\",numSections,part1Size,part2Size,sysSize,execSize )\n return nil\n}", "title": "" }, { "docid": "2d885757b21a2dc0045f1004cfd01f6e", "score": "0.4176511", "text": "func (l *Limit) OK(file file.Filer) bool {\r\n\tif l.max == 0 {\r\n\t\treturn true\r\n\t}\r\n\tl.current++\r\n\tif l.current <= l.max {\r\n\t\treturn true\r\n\t}\r\n\treturn false\r\n}", "title": "" }, { "docid": "39daa124042a0eb53d016bcbc84ebed5", "score": "0.4175786", "text": "func BodyMatches(pattern string) Matcher {\n\treturn bodyMatcher{re: regexp.MustCompile(pattern)}\n}", "title": "" }, { "docid": "e0a32235ce044618e4ba7ccd93f36430", "score": "0.41732606", "text": "func (c *Client) getTargetBlockOrLatest(\n\tctx context.Context,\n\theight int64,\n\twitness provider.Provider,\n) (bool, *types.LightBlock, error) {\n\tlightBlock, err := witness.LightBlock(ctx, 0)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tif lightBlock.Height == height {\n\t\t// the witness has caught up to the height of the provider's signed header. We\n\t\t// can resume with checking the hashes.\n\t\treturn true, lightBlock, nil\n\t}\n\n\tif lightBlock.Height > height {\n\t\t// the witness has caught up. We recursively call the function again. However in order\n\t\t// to avoud a wild goose chase where the witness sends us one header below and one header\n\t\t// above the height we set a timeout to the context\n\t\tlightBlock, err := witness.LightBlock(ctx, height)\n\t\treturn true, lightBlock, err\n\t}\n\n\treturn false, lightBlock, nil\n}", "title": "" }, { "docid": "5b2024896cfdf90df6851ea51848cc36", "score": "0.41720343", "text": "func (vm *VM) Compile(source string, chunk *Chunk) (int, bool) {\n\tvar scanner Scanner\n\tvar parser Parser\n\tscanner.Init(source)\n\tparser.scanner = &scanner\n\tparser.chunk = chunk\n\tparser.backpatch = map[string][]Label{}\n\tparser.labels = map[string]byte{}\n\tparser.advance()\n\tfor parser.previous.Type != EOF {\n\t\tparser.statement()\n\t\tif parser.errorState {\n\t\t\tparser.synchronize()\n\t\t}\n\t}\n\tparser.consume(EOF, \"Expected EOF.\")\n\tparser.emitHalt()\n\tparser.checkLabels()\n\treturn parser.size, !parser.hasError\n}", "title": "" }, { "docid": "a7f4b5cd781b0f94151f0899e8494201", "score": "0.41669074", "text": "func (ctx *serverRequestContextImpl) TryReadBody(body interface{}) (bool, error) {\n\tbuf, err := ctx.ReadBodyBytes()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tempty := len(buf) == 0\n\tif !empty {\n\t\terr = json.Unmarshal(buf, body)\n\t\tif err != nil {\n\t\t\treturn true, caerrors.NewHTTPErr(400, caerrors.ErrBadReqBody, \"Invalid request body: %s; body=%s\",\n\t\t\t\terr, string(buf))\n\t\t}\n\t}\n\treturn empty, nil\n}", "title": "" }, { "docid": "81e4abed04811d35ccf6ada545246a1b", "score": "0.4164585", "text": "func (e *Engine) gotoLoopEnd() *BrainfuckError {\n\tlvl := 0\n\ttlvl := 0\n\tfor e.commandIdx += 1; e.commandIdx < len(e.commands); e.commandIdx++ {\n\t\tswitch e.commands[e.commandIdx] {\n\t\tcase C_JMPFOR:\n\t\t\tlvl++\n\t\t\ttlvl++\n\t\tcase C_JMPBAC:\n\t\t\tif lvl > 0 {\n\t\t\t\tlvl--\n\t\t\t} else if lvl < 0 {\n\t\t\t\treturn e.newError(\"nest level too low in gotoLoopStart()\")\n\t\t\t} else {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\treturn e.newError(fmt.Sprintf(\"gotoLoopEnd finished without finding C_JMPBAC [%d]\", tlvl))\n}", "title": "" }, { "docid": "b81ff142bc0291c39cabc963710157aa", "score": "0.41583422", "text": "func (s *BasecluListener) ExitRoutine_body(ctx *Routine_bodyContext) {}", "title": "" }, { "docid": "874d071fd3af828a83509c2d044edc5e", "score": "0.41471854", "text": "func (m *MultiFilter) EvaluateBody(span sdk.Span, body []byte) bool {\n\tfor _, f := range (*m).filters {\n\t\tif f.EvaluateBody(span, body) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "26bee075439f1ad16452b9fb8bde06c9", "score": "0.41442454", "text": "func (p *Parser) match(tokenType TokenType) bool {\n\tif !p.check(tokenType) {\n\t\treturn false\n\t}\n\tp.advance()\n\treturn true\n}", "title": "" }, { "docid": "44c9cc8e99daef8faf6ff707616fc023", "score": "0.41433224", "text": "func headersCheck(c *gin.Context) {\n\tif c.GetHeader(\"Content-Type\") != \"application/json\" {\n\t\tc.AbortWithStatusJSON(http.StatusBadRequest, msg(\"request payload not recognized\"))\n\t\treturn\n\t}\n\tc.Next()\n}", "title": "" }, { "docid": "e4f85507865910eeff58e649a1108f4d", "score": "0.41396663", "text": "func (c *Completer) Match(ctx *Context, content IContent, line interface{}, index int) (int, bool) {\n\treturn -1, false\n}", "title": "" }, { "docid": "ed8148409a604d12283ee9b3c0985da5", "score": "0.41395319", "text": "func TestConnBodyLen(t *testing.T) {\n\tn, _ := openConn(t)\n\tconn_headers := check11(TEST_HEADERS)\n\tc, e := Connect(n, conn_headers)\n\tif e != nil {\n\t\tt.Errorf(\"Expected no connect error, got [%v]\\n\", e)\n\t}\n\tif len(c.ConnectResponse.Body) != 0 {\n\t\tt.Errorf(\"Expected body length 0, got [%v]\\n\", len(c.ConnectResponse.Body))\n\t}\n\t_ = c.Disconnect(empty_headers)\n\t_ = closeConn(t, n)\n}", "title": "" }, { "docid": "ae896aae7927e3deb01832f932e98a19", "score": "0.41357616", "text": "func (m *fetchMetadataReqMatcher) matchesV1(x interface{}) bool {\n\treq, ok := x.(*rpc.FetchBlocksMetadataRawRequest)\n\tif !ok {\n\t\treturn false\n\t}\n\n\tif m.shard != req.Shard {\n\t\treturn false\n\t}\n\n\tif m.limit != req.Limit {\n\t\treturn false\n\t}\n\n\tif m.pageToken == nil {\n\t\tif req.PageToken != nil {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tif req.PageToken == nil {\n\t\t\treturn false\n\t\t}\n\t\tif *req.PageToken != *m.pageToken {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif m.includeSizes == nil {\n\t\tif req.IncludeSizes != nil {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tif req.IncludeSizes == nil {\n\t\t\treturn false\n\t\t}\n\t\tif *req.IncludeSizes != *m.includeSizes {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "f2717be2bd365c735673a494923d2160", "score": "0.41337126", "text": "func (s *BasePlSqlParserListener) ExitFunction_body(ctx *Function_bodyContext) {}", "title": "" }, { "docid": "0c5da57ef76788e8826f53dee8c22cfa", "score": "0.41274643", "text": "func (p *Parser) statement() {\n\tswitch {\n\tcase p.match(NEWLINE):\n\t\treturn\n\tcase p.match(INBOX):\n\t\tp.inbox()\n\t\tp.size += 1\n\tcase p.match(OUTBOX):\n\t\tp.outbox()\n\t\tp.size += 1\n\tcase p.match(JUMP):\n\t\tp.jump()\n\t\tp.size += 1\n\tcase p.match(JUMPZ):\n\t\tp.jumpIfZero()\n\t\tp.size += 1\n\tcase p.match(JUMPN):\n\t\tp.jumpIfNegative()\n\t\tp.size += 1\n\tcase p.match(COPYFROM):\n\t\tp.copyfrom()\n\t\tp.size += 1\n\tcase p.match(COPYTO):\n\t\tp.copyto()\n\t\tp.size += 1\n\tcase p.match(ADD):\n\t\tp.add()\n\t\tp.size += 1\n\tcase p.match(SUB):\n\t\tp.sub()\n\t\tp.size += 1\n\tcase p.match(BUMPUP):\n\t\tp.bumpUp()\n\t\tp.size += 1\n\tcase p.match(BUMPDN):\n\t\tp.bumpDown()\n\t\tp.size += 1\n\tcase p.match(LABEL):\n\t\tp.labelDeclaration()\n\tcase p.match(EOF):\n\t\treturn\n\tdefault:\n\t\tp.exprStatement()\n\t}\n}", "title": "" }, { "docid": "742dc7eedca00af722f226899f0f22df", "score": "0.4126943", "text": "func doCopyRequestBody(\n\tbodyReader io.ReadCloser, buffer []byte, contentLength, written int64, file *os.File, writer io.Writer, options *Options,\n) (newWritten int64, shouldContinue bool, err error) {\n\t// Byte loop that copies from the download reader to the file and writer\n\tfor {\n\t\tvar bytesRead int\n\t\tvar writerErr, fileErr error\n\t\tbytesRead, err = bodyReader.Read(buffer)\n\t\tif bytesRead > 0 {\n\t\t\t_, writerErr = writer.Write(buffer[:bytesRead])\n\t\t\tif writerErr != nil {\n\t\t\t\t// If the writer at any point returns an error, we should abort and do nothing further\n\t\t\t\tcloseErr := bodyReader.Close()\n\t\t\t\tif closeErr != nil {\n\t\t\t\t\toptions.Errorf(\"dlstream.doCopyRequestBody: Error closing body reader: %v\", err)\n\t\t\t\t}\n\t\t\t\treturn written, false, writerErr // Bounce back the error\n\t\t\t}\n\t\t\t_, fileErr = file.Write(buffer[:bytesRead])\n\t\t\tif fileErr != nil {\n\t\t\t\t// When the file returns an error, this is also pretty fatal, so abort\n\t\t\t\tcloseErr := bodyReader.Close()\n\t\t\t\tif closeErr != nil {\n\t\t\t\t\toptions.Errorf(\"dlstream.doCopyRequestBody: Error closing body reader: %v\", err)\n\t\t\t\t}\n\t\t\t\treturn written, false, fmt.Errorf(\"error writing to file: %w\", fileErr)\n\t\t\t}\n\t\t}\n\n\t\twritten += int64(bytesRead)\n\n\t\tswitch {\n\t\tcase errors.Is(err, io.EOF):\n\t\t\t_ = bodyReader.Close()\n\t\t\tif written != contentLength {\n\t\t\t\toptions.Errorf(\"dlstream.doCopyRequestBody: Download done yet incomplete, total: %d, expected: %d\", written, contentLength)\n\t\t\t\treturn written, false, ErrInconsistentDownload\n\t\t\t}\n\t\t\toptions.Infof(\"dlstream.doCopyRequestBody: Download complete, %d bytes\", written)\n\t\t\treturn written, false, nil // YES, we have a complete download :)\n\t\tcase shouldRetryRequest(err):\n\t\t\t_ = bodyReader.Close()\n\t\t\toptions.Infof(\n\t\t\t\t\"dlstream.doCopyRequestBody: Error reading from response body: %v, total: %d, currently written: %d, retrying\",\n\t\t\t\terr, contentLength, written,\n\t\t\t)\n\t\t\tretryWait(options)\n\t\t\treturn written, true, err\n\t\tcase err != nil:\n\t\t\t_ = bodyReader.Close()\n\t\t\toptions.Errorf(\n\t\t\t\t\"dlstream.doCopyRequestBody: Error reading from response body: %v, total: %d, currently written: %d, unrecoverable error, will not retry\",\n\t\t\t\terr, contentLength, written,\n\t\t\t)\n\t\t\treturn written, false, err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ad1d13226537b6c6bddce834839790ae", "score": "0.41251385", "text": "func (s *BasePlSqlParserListener) ExitCase_else_part(ctx *Case_else_partContext) {}", "title": "" }, { "docid": "beddf0ab400973831aa656797a4538f8", "score": "0.41209358", "text": "func readBody(msg []byte, state *readState) error {\n\tline := msg[0 : len(msg)-2]\n\tvar err error\n\tif line[0] == '$' {\n\t\t// bulk reply\n\t\tstate.bulkLen, err = strconv.ParseInt(string(line[1:]), 10, 64)\n\t\tif err != nil {\n\t\t\treturn errors.New(\"protocol error: \" + string(msg))\n\t\t}\n\t\tif state.bulkLen <= 0 { // null bulk in multi bulks\n\t\t\tstate.args = append(state.args, []byte{})\n\t\t\tstate.bulkLen = 0\n\t\t}\n\t} else {\n\t\tstate.args = append(state.args, line)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bec7f6688f27e96d798ebca29c65127c", "score": "0.41186923", "text": "func ObjectWhile(vm *VM, target, locals Interface, msg *Message) (result Interface) {\n\tif err := msg.AssertArgCount(\"Object while\", 2); err != nil {\n\t\treturn vm.IoError(err)\n\t}\n\tcond := msg.ArgAt(0)\n\tm := msg.ArgAt(1)\n\tfor {\n\t\t// It's possible for a loop condition to evaluate to a Stop. Io's\n\t\t// behavior, due to the way it implements control flow as a coroutine\n\t\t// attribute, is to respect them wherever they occur, but I believe\n\t\t// that is more likely to lead to unexplained stalling. We will instead\n\t\t// accept continues and breaks as normal values.\n\t\tc, ok := CheckStop(cond.Eval(vm, locals), LoopStops)\n\t\tif !ok {\n\t\t\treturn c\n\t\t}\n\t\tif !vm.AsBool(c) {\n\t\t\treturn result\n\t\t}\n\t\tresult = m.Eval(vm, locals)\n\t\tif rr, ok := CheckStop(result, NoStop); !ok {\n\t\t\tswitch s := rr.(Stop); s.Status {\n\t\t\tcase ContinueStop:\n\t\t\t\tresult = s.Result\n\t\t\tcase BreakStop:\n\t\t\t\treturn s.Result\n\t\t\tcase ReturnStop, ExceptionStop:\n\t\t\t\treturn rr\n\t\t\tdefault:\n\t\t\t\tpanic(fmt.Sprintf(\"iolang: invalid Stop: %#v\", rr))\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3f35b1a2ab1f34b7065763d5da709faf", "score": "0.4117519", "text": "func (rcv *Block) BodyLength() int64 {\n\treturn rcv._tab.GetInt64(rcv._tab.Pos + flatbuffers.UOffsetT(16))\n}", "title": "" }, { "docid": "cb4c132ce32d0fe4620b40cba1de0f8b", "score": "0.41143775", "text": "func (s *IdeaScanner) Scan() bool {\n\tsbuf := bytes.NewBuffer(make([]byte, 0, 4096))\n\n\t// Scan the Header\n\tif s.nextHeader != nil {\n\t\t_, err := sbuf.Write(s.nextHeader)\n\t\tif err != nil {\n\t\t\ts.lastError = err\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tfor s.scanner.Scan() {\n\t\t\tline := s.scanner.Text()\n\n\t\t\tif i := strings.Index(line, \"## [\"); i >= 0 {\n\t\t\t\t_, err := sbuf.Write(s.scanner.Bytes())\n\t\t\t\tif err != nil {\n\t\t\t\t\ts.lastError = err\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tgoto scanBody\n\t\t\t}\n\t\t}\n\n\t\t// Scanned all the lines and didn't find a header\n\t\ts.lastError = s.scanner.Err()\n\t\treturn false\n\t}\n\nscanBody:\n\ts.nextHeader = nil\n\n\tfor s.scanner.Scan() {\n\t\tline := s.scanner.Text()\n\n\t\t// Look for the start of another Idea\n\t\tif i := strings.Index(line, \"## [\"); i >= 0 {\n\t\t\ts.nextHeader = s.scanner.Bytes()\n\t\t\tbreak\n\t\t}\n\n\t\t// Look for the ClosedAt timestamp\n\t\tif _, err := time.Parse(time.UnixDate, line[:len(line)-1]); err == nil {\n\t\t\tbreak\n\t\t}\n\n\t\t// Add this line to the body\n\t\tif _, err := sbuf.Write(s.scanner.Bytes()); err != nil {\n\t\t\ts.lastError = err\n\t\t\treturn false\n\t\t}\n\t}\n\n\tpbuf := bufio.NewReader(bytes.NewReader(sbuf.Bytes()))\n\n\t// Grab the complete header line as a string\n\tlineBytes, err := pbuf.ReadBytes('\\n')\n\tif err != nil {\n\t\ts.lastError = err\n\t\treturn false\n\t}\n\tline := string(lineBytes)\n\n\t// Parse the Status, Id, Name\n\tstatus, id, name, err := parseHeader(line)\n\tif err != nil {\n\t\ts.lastError = err\n\t\treturn false\n\t}\n\n\t// Parse the Body\n\tbodyBytes, err := ioutil.ReadAll(pbuf)\n\tif err != nil {\n\t\ts.lastError = err\n\t\treturn false\n\t}\n\n\ts.lastIdea = &Idea{\n\t\tStatus: status,\n\t\tId: id,\n\t\tName: name,\n\t\tBody: string(bytes.TrimSpace(bodyBytes)) + \"\\n\",\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "9703510116949ed53097506f8df1d092", "score": "0.41107252", "text": "func (a BlogAuthor) shouldMatchAuthorBody() {\n\thasNonNilBodyFields := a.Avatar != \"\" || a.Bio != \"\" || a.Facebook != \"\" || a.Google_plus != \"\" || a.Linkedin != \"\" || a.Twitter != \"\" || a.Website != \"\"\n\tblankAuthorBody := authorBody{}\n\tif a.Body == blankAuthorBody && hasNonNilBodyFields {\n\t\tpanic(\"Some authors have empty bodies, but non-empty counterpart fields.\")\n\t}\n\tif a.Avatar != a.Body.Avatar {\n\t\tpanic(\"Not all authors avatars match their body avatars.\")\n\t}\n\tif a.Bio != a.Body.Bio {\n\t\tpanic(\"Not all author bios match their body bios.\")\n\t}\n\tif a.Facebook != a.Body.Facebook {\n\t\tpanic(\"Not all author facebooks math their body facebooks.\")\n\t}\n\tif a.Google_plus != a.Body.Google_plus {\n\t\tpanic(\"Not all author google_pluses math their body google_plus.\")\n\t}\n\tif a.Linkedin != a.Body.Linkedin {\n\t\tpanic(\"Not all author linkedin match their body linkedin.\")\n\t}\n\tif a.Twitter != a.Body.Twitter {\n\t\tpanic(\"Not all author twitter match their body twitter.\")\n\t}\n\tif a.Website != a.Body.Website {\n\t\tpanic(\"Not all author websites match their body websites.\")\n\t}\n}", "title": "" }, { "docid": "5d4853646e5324185ac87cd697084508", "score": "0.41093484", "text": "func mustFlow(g *ast.CommentGroup, limit int) bool {\n\tvar exceed bool\n\t// \"/*\" comment blocks not supported.\n\tfor _, comment := range g.List {\n\t\tif strings.HasPrefix(comment.Text, \"/*\") {\n\t\t\treturn false\n\t\t}\n\t\tif len(comment.Text) > limit {\n\t\t\texceed = true\n\t\t}\n\n\t}\n\treturn exceed\n}", "title": "" }, { "docid": "02b4cf5bfad73cbe6aed87e9e867c236", "score": "0.41057602", "text": "func (re *Regexp) Match(b []byte) bool\t{ return len(re.doExecute(\"\", b, 0)) > 0 }", "title": "" }, { "docid": "a98556c2a328dcb63977be16aaf001c9", "score": "0.4104685", "text": "func (s *amqpStream) decodeBodyFrame(buf []byte) (ok bool, complete bool) {\n\ts.message.body = append(s.message.body, buf...)\n\n\tdebugf(\"A body frame of %d bytes long has been transmitted\",\n\t\tlen(buf))\n\t//is the message complete ? If yes, let's publish it\n\n\tcomplete = uint64(len(s.message.body)) >= s.message.bodySize\n\treturn true, complete\n}", "title": "" }, { "docid": "4f6948b5e4f14d61f432f846ceb1bbf1", "score": "0.4097372", "text": "func (w walk) reachedMaxDepth() bool {\n\treturn len(w) > maxDepth\n}", "title": "" }, { "docid": "2720c7af0535c642dcf8d17c7b86b6cf", "score": "0.40913406", "text": "func ExpectsBody(body string) Verifier {\n\treturn func(r *http.Response, b []byte) (bool, error) {\n\t\tif string(b) == body {\n\t\t\treturn true, nil\n\t\t}\n\t\treturn false, fmt.Errorf(\"unexpected body: want %q, got %q\", body, string(b))\n\t}\n}", "title": "" }, { "docid": "7c0ff74705d4e42bc8f471c613b278c3", "score": "0.4091053", "text": "func (a *Assembler) Update(chunk Chunk) bool {\n\tnum, count := chunk.Sequence()\n\tif a.fullMsg == nil {\n\t\ta.fullMsg = make([][]byte, count)\n\t}\n\tif count != len(a.fullMsg) || num >= count {\n\t\treturn false\n\t}\n\tbody := chunk.Body()\n\n\tif a.fullMsg[num] == nil {\n\t\ta.totalBytes += len(body)\n\t\tif a.maxMessageSize > 0 && a.totalBytes > a.maxMessageSize {\n\t\t\treturn false\n\t\t}\n\t\ta.fullMsg[num] = body\n\t\ta.processed++\n\t}\n\treturn a.processed == len(a.fullMsg)\n}", "title": "" }, { "docid": "4b3212605860eadadce322ee5ddc1d88", "score": "0.40897545", "text": "func (r ApiUpdateHyperflexFeatureLimitInternalRequest) IfMatch(ifMatch string) ApiUpdateHyperflexFeatureLimitInternalRequest {\n\tr.ifMatch = &ifMatch\n\treturn r\n}", "title": "" }, { "docid": "e592c2e3dd7ef204da1b96407ce26a7c", "score": "0.40836808", "text": "func (res sinkBase) Match(c eventbus.ConstraintMatcher) bool {\n\treturn sinkMatch(res.request, c)\n}", "title": "" }, { "docid": "eae455caf29ed2997a95dc4478dd4e64", "score": "0.40805355", "text": "func (s *WhileStmt) isDone(env *Env) (done bool) { //todo\n\tdefer func() {\n\t\tif e := recover(); e != nil {\n\t\t\tswitch e.(type) { // error type case\n\t\t\tcase ContinueErr:\n\t\t\t\tdone = false\n\t\t\t\treturn\n\t\t\tcase BreakErr:\n\t\t\t\tdone = true\n\t\t\t\treturn\n\t\t\tdefault:\n\t\t\t\tpanic(e)\n\t\t\t}\n\t\t}\n\t}()\n\tfor isTruthy(s.condition.eval(env)) {\n\t\ts.body.execute(env)\n\t}\n\treturn true\n}", "title": "" }, { "docid": "225648c098440d659f8c8b0b7e524aaf", "score": "0.4079379", "text": "func (m Match) Ok() bool { return len(m.Errors) == 0 }", "title": "" }, { "docid": "21fdb1076bf8e79b29557f01ff1f7573", "score": "0.40736657", "text": "func MessageIsEndOfLine(vm *VM, target, locals Interface, msg *Message) Interface {\n\treturn vm.IoBool(target.(*Message).IsTerminator())\n}", "title": "" }, { "docid": "e386603be1d93ad93c6774ca578eaba9", "score": "0.40707994", "text": "func (n *NewLineMatcher) Match(exists []byte, appender []byte, start int, end int) bool {\n\treturn appender[end] == '\\n'\n}", "title": "" }, { "docid": "a8e6b50e573540b8f8a80f68b1bab07b", "score": "0.40689778", "text": "func WhileAcceptable(r Relevance) Nom {\n\tconst funcName = \"WhileAcceptable\"\n\n\treturn func(ctx context.Context, p Plate) (err error) {\n\t\tvar startPos int\n\t\tif startPos, err = p.TellPosition(ctx); err != nil {\n\t\t\treturn WrapBreadcrumb(err, funcName, -1)\n\t\t}\n\n\t\tvar (\n\t\t\tcount, iterations int\n\t\t\tb byte\n\t\t)\n\t\tfor {\n\t\t\tif b, err = p.PeekByte(ctx); err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tif count == 0 && iterations == 0 {\n\t\t\t\t\t\treturn WrapBreadcrumb(io.ErrUnexpectedEOF, funcName, iterations)\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\treturn WrapBreadcrumb(err, funcName, iterations)\n\t\t\t}\n\n\t\t\tvar (\n\t\t\t\tgood bool\n\t\t\t\tleftBytes int\n\t\t\t)\n\t\t\tif good, leftBytes = r.IsAcceptable(count, b); !good {\n\t\t\t\tif iterations > 0 {\n\t\t\t\t\t_ = p.SeekPosition(ctx, startPos)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif _, err = p.NextByte(ctx); err != nil {\n\t\t\t\treturn WrapBreadcrumb(err, funcName, iterations)\n\t\t\t}\n\t\t\tcount++\n\n\t\t\tif leftBytes == 0 {\n\t\t\t\tif startPos, err = p.TellPosition(ctx); err != nil {\n\t\t\t\t\treturn WrapBreadcrumb(err, funcName, iterations)\n\t\t\t\t}\n\t\t\t\tcount = 0\n\t\t\t\titerations++\n\t\t\t}\n\t\t}\n\t\tif iterations == 0 {\n\t\t\treturn WrapBreadcrumb(\n\t\t\t\tErrExpectationFailed{\n\t\t\t\t\tExpected: r,\n\t\t\t\t\tHave: b,\n\t\t\t\t},\n\t\t\t\tfuncName,\n\t\t\t\titerations,\n\t\t\t)\n\t\t}\n\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "7485579a9cdf62af2964d04d40cd9959", "score": "0.40645382", "text": "func (r ApiCreateBulkMoDeepClonerRequest) IfMatch(ifMatch string) ApiCreateBulkMoDeepClonerRequest {\n\tr.ifMatch = &ifMatch\n\treturn r\n}", "title": "" }, { "docid": "7f2823c7e5dac9764b4512f61ff28106", "score": "0.406178", "text": "func BodyContains(expected string) echo.Checker {\n\treturn Each(func(r echoClient.Response) error {\n\t\tif !strings.Contains(r.RawContent, expected) {\n\t\t\treturn fmt.Errorf(\"want %q in body but not found: %s\", expected, r.RawContent)\n\t\t}\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "86e822c6a19393664b172072c8fbefa9", "score": "0.40617526", "text": "func (r ApiPatchHyperflexFeatureLimitInternalRequest) IfMatch(ifMatch string) ApiPatchHyperflexFeatureLimitInternalRequest {\n\tr.ifMatch = &ifMatch\n\treturn r\n}", "title": "" }, { "docid": "3c33aee777d74a377f9c449be9989220", "score": "0.40606856", "text": "func (s *BasePlSqlParserListener) ExitContinue_statement(ctx *Continue_statementContext) {}", "title": "" }, { "docid": "9e4cd4b3acef92f9430298fc6fad4be9", "score": "0.405948", "text": "func finished(inputIndex, inputSize, patternIndex, patternSize int) bool {\n\treturn inputIndex == inputSize && patternIndex == patternSize\n}", "title": "" }, { "docid": "d5bc12d7f5a49727f94998e5dd3ae3f8", "score": "0.4058908", "text": "func maxBodySize(sz int64) func(next http.Handler) http.Handler {\n\treturn func(next http.Handler) http.Handler {\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tr.Body = http.MaxBytesReader(w, r.Body, sz)\n\t\t\tnext.ServeHTTP(w, r)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "522233870f5c776a3b5312e88b63c077", "score": "0.40545058", "text": "func (r *Request) RestartableBody(getBody func() io.Reader) *Request {\n\tpanic(\"TODO\")\n\treturn r\n}", "title": "" }, { "docid": "55bc3c591d96921dd69af96665f64af6", "score": "0.40536955", "text": "func checkTailCursor( c mongo.Cursor ) ( doBreak, hasNext bool ){\n\n\tif err := c.Err(); err != nil {\n\t\tlog.Println( fmt.Sprint( \"mongo permanent cursor error: \", err,\"\\n\") )\n\t\treturn true, false\n\t}\n\n\thasNext = \tc.HasNext()\n\n\t// AFTER hasNext check !\n\talive := false\n\tif c.GetId() > 0 {\n\t\talive = true\n\t}\n\n\n\tif alive == false || hasNext == false {\n\n\n\t\tif !alive {\n\t\t\tfmt.Print( fmt.Sprintf( \" cursor is dead - id %v.\", c.GetId()) )\n\t\t}\n\n\t\tif hasNext == false {\n\t\t\tfmt.Print( \" hasNext() is false - await is over.\")\n\t\t}\n\n\t\tfmt.Print( fmt.Sprintf( \" stillSeeking/Dead/Exhausted %v (max %v).\", countNoNextValue, noNextValueMax) )\n\n\t\tcountNoNextValue++\n\t\tif countNoNextValue > noNextValueMax {\n\t\t\treturn true , hasNext\n\t\t}\n\n\t}\n\n\treturn false, hasNext\t\t\t\n\n\n}", "title": "" }, { "docid": "a4832870d35ec734bb27b41969057ccb", "score": "0.40523413", "text": "func bodyAllowedForStatus(status int) bool {\n\tswitch {\n\tcase status >= 100 && status <= 199:\n\t\treturn false\n\tcase status == 204:\n\t\treturn false\n\tcase status == 304:\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "7055cb0f4aa01661ea63eac72e2b2b31", "score": "0.40512055", "text": "func (s *BasePlSqlParserListener) ExitIf_statement(ctx *If_statementContext) {}", "title": "" }, { "docid": "d9a5914e141efe6c85a443218d9b8fa2", "score": "0.4046677", "text": "func (s *BasePlSqlParserListener) EnterBody(ctx *BodyContext) {}", "title": "" }, { "docid": "f4a6e47275c3172362772117a5ab1b29", "score": "0.4044156", "text": "func MessageNextIgnoreEndOfLines(vm *VM, target, locals Interface, msg *Message) Interface {\n\tm := target.(*Message)\n\t// I think the original returns the terminator at the end of the chain if\n\t// that is encountered, but that seems like a breach of contract.\n\tfor m.Next.IsTerminator() {\n\t\tif m.Next == nil {\n\t\t\treturn vm.Nil\n\t\t}\n\t\tm = m.Next\n\t}\n\treturn m\n}", "title": "" }, { "docid": "48778d6a8dd636e1252299b97a9b2e19", "score": "0.40441418", "text": "func (b *BlockChain) maybeAcceptHeader(header *wire.BlockHeader, utreexoStartRoot *chaincfg.UtreexoRootHint, flags BehaviorFlags) error {\n\t// Check if the previous block header exists\n\tprevHash := &header.PrevBlock\n\tprevNode := b.index.LookupNode(prevHash)\n\tif prevNode == nil {\n\t\tstr := fmt.Sprintf(\"previous header %s is unknown\", prevHash)\n\t\treturn ruleError(ErrPreviousHeaderUnknown, str)\n\t}\n\n\t// Check sanity. This includes timestamp checking\n\terr := checkBlockHeaderSanity(header, b.chainParams.PowLimit, b.timeSource, flags)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create a new block node for the block and add it to the node index.\n\tnewNode := newBlockNode(header, prevNode)\n\tb.index.AddNodeNoDirty(newNode)\n\tnewNode.BuildAncestor()\n\n\t// If we're in utreexo root verify mode and is\n\t// verifying from the genesis, return here\n\tif utreexoStartRoot == nil {\n\t\treturn nil\n\t}\n\n\t// If we're in utreexo root verify mode, set the bestChain tip\n\t//\n\t// TODO We're hashing twice per header here since there's a\n\t// hash in checkBlockHeaderSanity\n\tif header.BlockHash() == *utreexoStartRoot.Hash {\n\t\tlog.Infof(\"Setting the starting block to verify at height %v\",\n\t\t\tutreexoStartRoot.Height)\n\t\t// This node is now the end of the best chain.\n\t\tb.bestChain.SetTip(newNode)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0fa041e1db60ca5174e5be27f19ee662", "score": "0.40425828", "text": "func outgoingLength(r *http.Request) int64 {\n\tif r.Body == nil || r.Body == http.NoBody {\n\t\treturn 0\n\t}\n\tif r.ContentLength != 0 {\n\t\treturn r.ContentLength\n\t}\n\treturn -1\n}", "title": "" }, { "docid": "771dea507553cc47ea4efbb4a1afdcbb", "score": "0.4040878", "text": "func shouldLiEnd(input []byte, valid func([]byte) bool, skipFuncs []func([]byte) int) (shouldEnd bool, isPara bool, idx int, addSkipFunc bool) {\n\t//fmt.Printf(\"shouldLiEnd, invoke apply, len of skiper: %d, input=%s\\n\",len(skipFuncs),input[idx:])\n\tidx = applySkipFuncs(input, skipFuncs)\n\tif len(input[idx:]) == 0 {\n\t\treturn true, false, 0, false\n\t}\n\n\tisBlank, delta := IsBlankLine(input[idx:])\n\tif isBlank {\n\t\tidx += delta\n\t\tif IsIndented(input[idx:], indentSize) {\n\t\t\tisPara = true\n\t\t\tshouldEnd = false\n\t\t} else {\n\t\t\tisPara = false\n\t\t\tshouldEnd = true\n\t\t}\n\t} else {\n\t\tisPara = false\n\t\tif IsIndented(input[idx:], indentSize) {\n\t\t\t//&& valid(input[idx:])\n\t\t\taddSkipFunc = true\n\t\t\tshouldEnd = false\n\t\t} else {\n\t\t\tshouldEnd = true\n\t\t}\n\t}\n\n\treturn\n}", "title": "" } ]
b64b92649d8b64e47fc679853d3a178a
Inlined returns a newly instantiated statement.Statement object used for filtering inlined Role Policies
[ { "docid": "aa578a1c7afdcebd34eeb53f9fb0cf38", "score": "0.7646342", "text": "func (r *Role) Inlined(t *testing.T, doc *policy.Document) *statement.Statement {\n\tif r.role == nil {\n\t\tt.Errorf(\"failed to call Inlined() before calling, call First() or Assert()\")\n\t\treturn nil\n\t}\n\tif doc == nil {\n\t\tstatements, err := r.inlined()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"failed to query inlined policies: %v\", err)\n\t\t\treturn nil\n\t\t}\n\t\tdoc = &policy.Document{Statement: statements}\n\t}\n\treturn statement.New(doc)\n}", "title": "" } ]
[ { "docid": "c72df4944f0faa2fed2075fc4c59d2b2", "score": "0.54102445", "text": "func (*ShowRoles) StatementTag() string { return \"SHOW ROLES\" }", "title": "" }, { "docid": "311de81a51de7bac5d94d883af7170e4", "score": "0.5357093", "text": "func (*ShowRoleGrants) StatementTag() string { return \"SHOW GRANTS ON ROLE\" }", "title": "" }, { "docid": "fbfa0e8576d0ff81bf945f02b5239a29", "score": "0.53515035", "text": "func (*ShowRoles) StatementType() StatementType { return Rows }", "title": "" }, { "docid": "9ff0660c8dbdba45bf05b584d33534fa", "score": "0.5266877", "text": "func (*ShowRoleGrants) StatementType() StatementType { return Rows }", "title": "" }, { "docid": "9c2e0a88b3c7dad8935b28a34b6cd24b", "score": "0.51359344", "text": "func (r *Role) Statement(t *testing.T) *statement.Statement {\n\tdoc := r.Document(t)\n\treturn statement.New(doc)\n}", "title": "" }, { "docid": "1affdd54a2c5a846783e76ebae23160d", "score": "0.48490155", "text": "func (s *BasePostgreSQLParserListener) EnterCreate_policy_stmt(ctx *Create_policy_stmtContext) {}", "title": "" }, { "docid": "33e7c2243d3443f27b8db2d8b316de96", "score": "0.48395136", "text": "func (s *BasePostgreSQLParserListener) EnterAlter_policy_stmt(ctx *Alter_policy_stmtContext) {}", "title": "" }, { "docid": "2baaed71dca3750a8f367cdde6be1d1f", "score": "0.47385332", "text": "func (s *BasePlSqlParserListener) EnterInvoker_rights_clause(ctx *Invoker_rights_clauseContext) {}", "title": "" }, { "docid": "8952596cca97ce8b80eaf051f9e83650", "score": "0.45725498", "text": "func Predicate() *Statement {\n\t// notest\n\treturn newStatement().Predicate()\n}", "title": "" }, { "docid": "547d976f89cd8c8bc8a3f816aa649e7c", "score": "0.4550298", "text": "func (s *BasePostgreSQLParserListener) EnterAlter_role_stmt(ctx *Alter_role_stmtContext) {}", "title": "" }, { "docid": "1058c9e5367e3420676209e77a9ba803", "score": "0.45313936", "text": "func (o RoleOutput) AssumeRolePolicy() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Role) pulumi.StringOutput { return v.AssumeRolePolicy }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0264b772d9c0eb2ced890c110785e36b", "score": "0.4521993", "text": "func (s *BasePostgreSQLParserListener) EnterCreate_role_stmt(ctx *Create_role_stmtContext) {}", "title": "" }, { "docid": "be1d53603c535b3b689f589c2937410f", "score": "0.44592357", "text": "func getIAMPolicy(w io.Writer, resourceID string) error {\n\t// resourceID := \"projects/myproject/locations/us/taxonomies/1234\"\n\tctx := context.Background()\n\tpolicyClient, err := datacatalog.NewPolicyTagManagerClient(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"datacatalog.NewPolicyTagManagerClient: %w\", err)\n\t}\n\tdefer policyClient.Close()\n\n\treq := &iampb.GetIamPolicyRequest{\n\t\tResource: resourceID,\n\t\tOptions: &iampb.GetPolicyOptions{\n\t\t\tRequestedPolicyVersion: 3,\n\t\t},\n\t}\n\tpolicy, err := policyClient.GetIamPolicy(ctx, req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"GetIamPolicy: %w\", err)\n\t}\n\tfmt.Fprintf(w, \"Policy has version %d with Etag %x and %d bindings\\n\", policy.Version, policy.Etag, len(policy.Bindings))\n\tif len(policy.Bindings) > 0 {\n\t\tfor _, binding := range policy.Bindings {\n\t\t\tfmt.Fprintf(w, \"\\trole %s with %d members: (%s)\\n\", binding.Role, len(binding.Members), strings.Join(binding.Members, \", \"))\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e87dde8993f7e423b6f417d5897814ea", "score": "0.44367665", "text": "func (*ShowGrants) StatementTag() string { return \"SHOW GRANTS\" }", "title": "" }, { "docid": "fc700f01a229f440c341c38795104e9f", "score": "0.44278717", "text": "func (*CreateRole) StatementTag() string { return \"CREATE ROLE\" }", "title": "" }, { "docid": "32cf5d8d6fc3f2f9fbbf5377801c65ee", "score": "0.44249538", "text": "func (s *BasePlSqlParserListener) EnterModifier_clause(ctx *Modifier_clauseContext) {}", "title": "" }, { "docid": "02afe99f70985d845214fd1c3fc97a26", "score": "0.44184428", "text": "func (*ShowGrants) StatementType() StatementType { return Rows }", "title": "" }, { "docid": "3f51028a18509666b075de95c76c2110", "score": "0.4410044", "text": "func (*RevokeRole) StatementType() StatementType { return DDL }", "title": "" }, { "docid": "8fd98d3c745a431c142874beb909326e", "score": "0.43799472", "text": "func (*RevokeRole) StatementTag() string { return \"REVOKE\" }", "title": "" }, { "docid": "d0d8e88429bbf457c415711113becced", "score": "0.43698493", "text": "func (s *BaseSOQLListener) EnterWith_plain_clause(ctx *With_plain_clauseContext) {}", "title": "" }, { "docid": "cbae2a533e723ff43b2a9c7c07f0eb22", "score": "0.43575045", "text": "func (*GrantRole) StatementType() StatementType { return DDL }", "title": "" }, { "docid": "3129aa5b4cf954fe5615f1a485a30618", "score": "0.4337422", "text": "func (o EntityOutput) Policies() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *Entity) pulumi.StringArrayOutput { return v.Policies }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "ec9ae08eedd03c956624b2638fd2d5bb", "score": "0.43274835", "text": "func (s *BaseSolidityListener) EnterInlineAssemblyStatement(ctx *InlineAssemblyStatementContext) {}", "title": "" }, { "docid": "ef5c097f171a44d3f6bd1d17216af78e", "score": "0.43214405", "text": "func (g *Group) Predicate() *Statement {\n\t// notest\n\ts := Predicate()\n\tg.items = append(g.items, s)\n\treturn s\n}", "title": "" }, { "docid": "fa7bebb8a63fb90cfba8a2e5833ec473", "score": "0.43157867", "text": "func (*AlterRole) StatementTag() string { return \"ALTER ROLE\" }", "title": "" }, { "docid": "8105a0f948ded1a3742f9bf78eb4f303", "score": "0.43134186", "text": "func (*CannedOptPlan) StatementType() StatementType { return Rows }", "title": "" }, { "docid": "960c71d5d1d83ea28fc25badce052e88", "score": "0.43133414", "text": "func Trustlines(mods ...qm.QueryMod) trustlineQuery {\n\tmods = append(mods, qm.From(\"\\\"trustlines\\\"\"))\n\treturn trustlineQuery{NewQuery(mods...)}\n}", "title": "" }, { "docid": "abf6b9738ffe2eb001c947dc8080ff6a", "score": "0.42844078", "text": "func (p *Policy) AsJSON() (string, error) {\n\tif len(p.unconditionalAction) > 0 {\n\t\tp.Statement = append(p.Statement, &Statement{\n\t\t\tEffect: StatementEffectAllow,\n\t\t\tAction: stringorslice.Of(p.unconditionalAction.List()...),\n\t\t\tResource: stringorslice.String(\"*\"),\n\t\t})\n\t}\n\tif len(p.clusterTaggedAction) > 0 {\n\t\tp.Statement = append(p.Statement, &Statement{\n\t\t\tEffect: StatementEffectAllow,\n\t\t\tAction: stringorslice.Of(p.clusterTaggedAction.List()...),\n\t\t\tResource: stringorslice.String(\"*\"),\n\t\t\tCondition: Condition{\n\t\t\t\t\"StringEquals\": map[string]string{\n\t\t\t\t\t\"aws:ResourceTag/KubernetesCluster\": p.clusterName,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t}\n\tif len(p.clusterTaggedCreateAction) > 0 {\n\t\tp.Statement = append(p.Statement, &Statement{\n\t\t\tEffect: StatementEffectAllow,\n\t\t\tAction: stringorslice.Of(p.clusterTaggedCreateAction.List()...),\n\t\t\tResource: stringorslice.String(\"*\"),\n\t\t\tCondition: Condition{\n\t\t\t\t\"StringEquals\": map[string]string{\n\t\t\t\t\t\"aws:RequestTag/KubernetesCluster\": p.clusterName,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\t// ec2:CreateSecurityGroup needs some special care as it also interacts with vpc, which do not support RequestTag.\n\t\t// We also do not require VPCs to be tagged, so we are not sending any conditions, allowing SGs to be created in any VPC.\n\t\tif p.clusterTaggedCreateAction.Has(\"ec2:CreateSecurityGroup\") {\n\t\t\tp.Statement = append(p.Statement, &Statement{\n\t\t\t\tEffect: StatementEffectAllow,\n\t\t\t\tAction: stringorslice.Of(\"ec2:CreateSecurityGroup\"),\n\t\t\t\tResource: stringorslice.String(fmt.Sprintf(\"arn:%s:ec2:*:*:vpc/*\", p.partition)),\n\t\t\t})\n\t\t}\n\t}\n\tif len(p.Statement) == 0 {\n\t\treturn \"\", fmt.Errorf(\"policy contains no statement\")\n\t}\n\n\tj, err := json.MarshalIndent(p, \"\", \" \")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error marshaling policy to JSON: %v\", err)\n\t}\n\treturn string(j), nil\n}", "title": "" }, { "docid": "2590063fd48823ed2b36da1803d335cb", "score": "0.42772418", "text": "func In() *Statement {\n\t// notest\n\treturn newStatement().In()\n}", "title": "" }, { "docid": "9ffca2d2169a1e2b57a6c279be90f88c", "score": "0.42764238", "text": "func (s *BasePostgreSQLParserListener) EnterSet_role_stmt(ctx *Set_role_stmtContext) {}", "title": "" }, { "docid": "a94a341358c0a70718f07a1e40ed2364", "score": "0.42712986", "text": "func (o WebAclRuleOutput) Statement() WebAclRuleStatementOutput {\n\treturn o.ApplyT(func(v WebAclRule) WebAclRuleStatement { return v.Statement }).(WebAclRuleStatementOutput)\n}", "title": "" }, { "docid": "040640e6ad28a8914081c22ae1e8ac27", "score": "0.4237081", "text": "func (_ValidatorService *ValidatorServiceFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*ValidatorServiceRoleGrantedIterator, error) {\n\n\tvar roleRule []interface{}\n\tfor _, roleItem := range role {\n\t\troleRule = append(roleRule, roleItem)\n\t}\n\tvar accountRule []interface{}\n\tfor _, accountItem := range account {\n\t\taccountRule = append(accountRule, accountItem)\n\t}\n\tvar senderRule []interface{}\n\tfor _, senderItem := range sender {\n\t\tsenderRule = append(senderRule, senderItem)\n\t}\n\n\tlogs, sub, err := _ValidatorService.contract.FilterLogs(opts, \"RoleGranted\", roleRule, accountRule, senderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ValidatorServiceRoleGrantedIterator{contract: _ValidatorService.contract, event: \"RoleGranted\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "5bbe1e1b434b1ba82ff93b44ae0ee5cb", "score": "0.4230412", "text": "func (o PipelineOutput) Role() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Pipeline) pulumi.StringOutput { return v.Role }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "495c65a59d166b65c5fd7fa335b74cf0", "score": "0.4229973", "text": "func (s *BasePlSqlParserListener) EnterLogical_expression(ctx *Logical_expressionContext) {}", "title": "" }, { "docid": "292a95f6e083cfd0d06bb1b97b3913b7", "score": "0.42144543", "text": "func (s *BaseSolidityListener) EnterStatement(ctx *StatementContext) {}", "title": "" }, { "docid": "d7dd1d07821cda607cf7e315a93fb487", "score": "0.42136127", "text": "func Custom(options Options, statements ...Code) *Statement {\n\treturn newStatement().Custom(options, statements...)\n}", "title": "" }, { "docid": "2ea68576db53c649a5921dcb5f78d51e", "score": "0.4205726", "text": "func (a *GormAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error {\n\tline := apiModel.CasbinRule{}\n\tline.PType = ptype\n\tvar filter []string\n\tfilter = append(filter, \"p_type=?\")\n\tval := []interface{}{line.PType}\n\tif fieldIndex <= 0 && 0 < fieldIndex+len(fieldValues) {\n\t\tline.V0 = fieldValues[0-fieldIndex]\n\t\tif line.V0 != \"\" {\n\t\t\tfilter = append(filter, \"v0=?\")\n\t\t\tval = append(val, line.V0)\n\t\t}\n\t}\n\tif fieldIndex <= 1 && 1 < fieldIndex+len(fieldValues) {\n\t\tline.V1 = fieldValues[1-fieldIndex]\n\t\tif line.V1 != \"\" {\n\t\t\tfilter = append(filter, \"v1=?\")\n\t\t\tval = append(val, line.V1)\n\t\t}\n\t}\n\tif fieldIndex <= 2 && 2 < fieldIndex+len(fieldValues) {\n\t\tline.V2 = fieldValues[2-fieldIndex]\n\t\tif line.V2 != \"\" {\n\t\t\tfilter = append(filter, \"v2=?\")\n\t\t\tval = append(val, line.V2)\n\t\t}\n\t}\n\tif fieldIndex <= 3 && 3 < fieldIndex+len(fieldValues) {\n\t\tline.V3 = fieldValues[3-fieldIndex]\n\t\tif line.V3 != \"\" {\n\t\t\tfilter = append(filter, \"v3=?\")\n\t\t\tval = append(val, line.V3)\n\t\t}\n\t}\n\tif fieldIndex <= 4 && 4 < fieldIndex+len(fieldValues) {\n\t\tline.V4 = fieldValues[4-fieldIndex]\n\t\tif line.V4 != \"\" {\n\t\t\tfilter = append(filter, \"v4=?\")\n\t\t\tval = append(val, line.V4)\n\t\t}\n\t}\n\tif fieldIndex <= 5 && 5 < fieldIndex+len(fieldValues) {\n\t\tline.V5 = fieldValues[5-fieldIndex]\n\t\tif line.V5 != \"\" {\n\t\t\tfilter = append(filter, \"v5=?\")\n\t\t\tval = append(val, line.V5)\n\t\t}\n\t}\n\t//_, err := a.o.Delete(&line, filter...)\n\tvar params []interface{}\n\tparams = append(params, strings.Join(filter, \" and \"))\n\tparams = append(params, val...)\n\t//do := a.o.Delete(apiModel.CasbinRule{}, \"p_type=? and v0=? and v1=? and v2=? and v3=? and v4=? and v5=?\", line.PType,\n\t//\tline.V0,\n\t//\tline.V1,\n\t//\tline.V2,\n\t//\tline.V3,\n\t//\tline.V4,\n\t//\tline.V5)\n\tdo := a.o.Delete(apiModel.CasbinRule{}, params...)\n\treturn do.Error\n}", "title": "" }, { "docid": "36effc23e9b7274db03b615148bf8f34", "score": "0.420317", "text": "func Role(v string) Condition {\n\treturn condition{\n\t\tquery: \"role=?\",\n\t\tparams: []interface{}{v},\n\t\tt: QsWhere,\n\t}\n}", "title": "" }, { "docid": "990dd4865badb90db932a79a464d6dbc", "score": "0.41866496", "text": "func (_ERC20TokenInterface *ERC20TokenInterfaceFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20TokenInterfaceApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _ERC20TokenInterface.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ERC20TokenInterfaceApprovalIterator{contract: _ERC20TokenInterface.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "f80ca6288f09adc9ff188d410b6a6e0a", "score": "0.41721877", "text": "func (a CasbinAdapter) loadRolePolicy(m casbinModel.Model) error {\n\tpaginationParam := dto.PaginationParam{PageSize: 9999, Current: 1}\n\troleQR, err := a.roleRepository.Query(&models.RoleQueryParam{\n\t\tStatus: 1, PaginationParam: paginationParam,\n\t})\n\n\tif err != nil {\n\t\treturn err\n\t} else if len(roleQR.List) == 0 {\n\t\treturn nil\n\t}\n\n\troleMenuQR, err := a.roleMenuRepository.Query(&models.RoleMenuQueryParam{\n\t\tPaginationParam: paginationParam,\n\t})\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmRoleMenus := roleMenuQR.List.ToRoleIDMap()\n\n\tmenuResourceQR, err := a.menuActionResourceRepository.Query(\n\t\t&models.MenuActionResourceQueryParam{PaginationParam: paginationParam},\n\t)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmMenuResources := menuResourceQR.List.ToActionIDMap()\n\n\tfor _, role := range roleQR.List {\n\t\tmcache := make(map[string]struct{})\n\t\troleMenus, ok := mRoleMenus[role.ID]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, actionID := range roleMenus.ToActionIDs() {\n\t\t\tmrs, ok := mMenuResources[actionID]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor _, mr := range mrs {\n\t\t\t\tif mr.Path == \"\" || mr.Method == \"\" {\n\t\t\t\t\tcontinue\n\t\t\t\t} else if _, ok := mcache[mr.Path+mr.Method]; ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tmcache[mr.Path+mr.Method] = struct{}{}\n\t\t\t\tline := fmt.Sprintf(\"p,%s,%s,%s\", role.ID, mr.Path, mr.Method)\n\t\t\t\tpersist.LoadPolicyLine(line, m)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "20a45e3db7d0065a02580da9398eba45", "score": "0.41475013", "text": "func (*ShowConstraints) StatementType() StatementType { return Rows }", "title": "" }, { "docid": "578e02912fd106c0979a2240f5149bc4", "score": "0.41448486", "text": "func (srq *SysRoleQuery) Where(ps ...predicate.SysRole) *SysRoleQuery {\n\tsrq.predicates = append(srq.predicates, ps...)\n\treturn srq\n}", "title": "" }, { "docid": "79fe67e712c125d7edc3a445e14b1f67", "score": "0.414387", "text": "func (_SampleCrowdsaleToken *SampleCrowdsaleTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*SampleCrowdsaleTokenApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _SampleCrowdsaleToken.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SampleCrowdsaleTokenApprovalIterator{contract: _SampleCrowdsaleToken.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "9bdbc7498dc0259ab133fa83a1c23523", "score": "0.41435504", "text": "func (s *BaseIDLListener) EnterReadonly_attr_declarator(ctx *Readonly_attr_declaratorContext) {}", "title": "" }, { "docid": "effdd79db2d72537d28499508e11e56f", "score": "0.41008037", "text": "func (*GrantRole) StatementTag() string { return \"GRANT\" }", "title": "" }, { "docid": "355410ee13edd82106b3b6c054d09338", "score": "0.41004115", "text": "func Predicate(predicate string) RawExpression {\n\treturn Expr(EscapePredicate(predicate))\n}", "title": "" }, { "docid": "537c234b4b8e134aa61950077a070006", "score": "0.40976053", "text": "func (m *LicenseMutation) Where(ps ...predicate.License) {\n\tm.predicates = append(m.predicates, ps...)\n}", "title": "" }, { "docid": "8d7cfeed6ef5a7d4e225d76bb22346d5", "score": "0.40975177", "text": "func (s *BaseSolidityListener) EnterExpressionStatement(ctx *ExpressionStatementContext) {}", "title": "" }, { "docid": "9535d2087b4c2bafea6d4fc910a9476e", "score": "0.40949088", "text": "func (s *BasePostgreSQLParserListener) EnterPredicate(ctx *PredicateContext) {}", "title": "" }, { "docid": "c7257301db66a147b5ffed6ab248121e", "score": "0.40907246", "text": "func (o RoleOutput) BypassRowLevelSecurity() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *Role) pulumi.BoolPtrOutput { return v.BypassRowLevelSecurity }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "b63ed9af64f9d6dc1d708aa637a21ad9", "score": "0.4089247", "text": "func (s PermissionPolicyStatement) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d8486e30e6f21b91affe9d20ed7845df", "score": "0.4072507", "text": "func (s *Statement) In() *Statement {\n\t// notest\n\tt := token{\n\t\tcontent: \"in\",\n\t\ttyp: keywordToken,\n\t}\n\t*s = append(*s, t)\n\treturn s\n}", "title": "" }, { "docid": "d022ee187974cacad547f933d30f6404", "score": "0.40677804", "text": "func (_LiquidityPool *LiquidityPoolFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*LiquidityPoolApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _LiquidityPool.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LiquidityPoolApprovalIterator{contract: _LiquidityPool.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "7273eb4034eb28b3aba91b3d23a4e31e", "score": "0.40670824", "text": "func (s *BaseplucidListener) EnterWhere_clause(ctx *Where_clauseContext) {}", "title": "" }, { "docid": "7d53b143d854f8c977ff52c5ccc3a52a", "score": "0.40653643", "text": "func (s *BasePlSqlParserListener) EnterWhere_clause(ctx *Where_clauseContext) {}", "title": "" }, { "docid": "93189fc871a312bf305a0581a911de5a", "score": "0.405366", "text": "func (r *Role) Filter(filter shared.Filter) *Role {\n\tr.filters = append(r.filters, filter)\n\treturn r\n}", "title": "" }, { "docid": "c19e16acf18211bb14a91f5940b924f5", "score": "0.40523726", "text": "func (s *Statement) Predicate() *Statement {\n\t// notest\n\tt := token{\n\t\tcontent: \"predicate\",\n\t\ttyp: keywordToken,\n\t}\n\t*s = append(*s, t)\n\treturn s\n}", "title": "" }, { "docid": "17eb57f5444e312131821925df5c21db", "score": "0.4051762", "text": "func (o RoleOutput) AssumeRole() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Role) pulumi.StringPtrOutput { return v.AssumeRole }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "7a5639c71ae65472740e3493c27209db", "score": "0.40277058", "text": "func (o AspectTypeIamMemberOutput) Role() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AspectTypeIamMember) pulumi.StringOutput { return v.Role }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d752ff4af1a73ec0beb5b7432ade70ad", "score": "0.40254426", "text": "func (c *CompilerRego) compileStatement(stmt *ast.ActionStatement, lineNum int) (string, error) {\n\tcompiled := []string{}\n\taction := stmt.Token.Literal\n\tswitch action {\n\tcase \"allow\":\n\t\tcompiled = append(compiled, \"allow {\")\n\tcase \"deny\":\n\t\tcompiled = append(compiled, \"deny {\")\n\t}\n\n\tsub, err := c.compileSubject(stmt.Subject)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tcompiled = append(compiled, sub)\n\n\tvrb, err := c.compileVerb(stmt.Verb)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tcompiled = append(compiled, vrb)\n\n\ttp, err := c.compileTypePattern(stmt.TypePattern)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tcompiled = append(compiled, tp)\n\n\tcnds, err := c.compileWhereClause(stmt.WhereClause, lineNum)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif cnds != \"\" {\n\t\tcompiled = append(compiled, cnds)\n\t}\n\n\tcompiled = append(compiled, \"}\")\n\n\treturn strings.Join(compiled, \"\\n\"), nil\n}", "title": "" }, { "docid": "4768f32c4d3067b1b74b5c6e4aa49ea1", "score": "0.4025049", "text": "func (_AssetManager *AssetManagerFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*AssetManagerRoleGrantedIterator, error) {\n\n\tvar roleRule []interface{}\n\tfor _, roleItem := range role {\n\t\troleRule = append(roleRule, roleItem)\n\t}\n\tvar accountRule []interface{}\n\tfor _, accountItem := range account {\n\t\taccountRule = append(accountRule, accountItem)\n\t}\n\tvar senderRule []interface{}\n\tfor _, senderItem := range sender {\n\t\tsenderRule = append(senderRule, senderItem)\n\t}\n\n\tlogs, sub, err := _AssetManager.contract.FilterLogs(opts, \"RoleGranted\", roleRule, accountRule, senderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AssetManagerRoleGrantedIterator{contract: _AssetManager.contract, event: \"RoleGranted\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "8b6e33754f018260fe2b0129fc41747f", "score": "0.40127835", "text": "func (ps *PolicyStatement) Allows() *PolicyStatement {\n\tif ps.Effect != \"\" {\n\t\treturn ps\n\t}\n\tps.Effect = effectAllow\n\treturn ps\n}", "title": "" }, { "docid": "14bb7098b19ed60aa581e4f5b5975ba0", "score": "0.40126142", "text": "func (_StandardToken *StandardTokenFilterer) FilterApproval(opts *bind.FilterOpts, _owner []common.Address, _spender []common.Address) (*StandardTokenApprovalIterator, error) {\n\n\tvar _ownerRule []interface{}\n\tfor _, _ownerItem := range _owner {\n\t\t_ownerRule = append(_ownerRule, _ownerItem)\n\t}\n\tvar _spenderRule []interface{}\n\tfor _, _spenderItem := range _spender {\n\t\t_spenderRule = append(_spenderRule, _spenderItem)\n\t}\n\n\tlogs, sub, err := _StandardToken.contract.FilterLogs(opts, \"Approval\", _ownerRule, _spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StandardTokenApprovalIterator{contract: _StandardToken.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "14bb7098b19ed60aa581e4f5b5975ba0", "score": "0.40126142", "text": "func (_StandardToken *StandardTokenFilterer) FilterApproval(opts *bind.FilterOpts, _owner []common.Address, _spender []common.Address) (*StandardTokenApprovalIterator, error) {\n\n\tvar _ownerRule []interface{}\n\tfor _, _ownerItem := range _owner {\n\t\t_ownerRule = append(_ownerRule, _ownerItem)\n\t}\n\tvar _spenderRule []interface{}\n\tfor _, _spenderItem := range _spender {\n\t\t_spenderRule = append(_spenderRule, _spenderItem)\n\t}\n\n\tlogs, sub, err := _StandardToken.contract.FilterLogs(opts, \"Approval\", _ownerRule, _spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StandardTokenApprovalIterator{contract: _StandardToken.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "7976004b0a72797338ed8da888a567dd", "score": "0.4006562", "text": "func (ie *IndexEditor) StatementStarted(ctx context.Context) {\n}", "title": "" }, { "docid": "742ff1e828bd36e055bc0134b3ee8bea", "score": "0.4006383", "text": "func (o BackendServiceOutput) SecurityPolicy() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *BackendService) pulumi.StringOutput { return v.SecurityPolicy }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "df673e65840e744783bc31ef0e9fd3d9", "score": "0.40058187", "text": "func (*ShowConstraints) StatementTag() string { return \"SHOW CONSTRAINTS\" }", "title": "" }, { "docid": "a52c22a392f17d126f42133639f517c4", "score": "0.39973956", "text": "func (a *jsiiProxy_AutoScalingGroup) AddToRolePolicy(statement awsiam.PolicyStatement) {\n\t_jsii_.InvokeVoid(\n\t\ta,\n\t\t\"addToRolePolicy\",\n\t\t[]interface{}{statement},\n\t)\n}", "title": "" }, { "docid": "e60b5d41268b4b4455d43d44c0b58f54", "score": "0.3996659", "text": "func (_MintableToken *MintableTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*MintableTokenApprovalIterator, error) {\r\n\r\n\tvar ownerRule []interface{}\r\n\tfor _, ownerItem := range owner {\r\n\t\townerRule = append(ownerRule, ownerItem)\r\n\t}\r\n\tvar spenderRule []interface{}\r\n\tfor _, spenderItem := range spender {\r\n\t\tspenderRule = append(spenderRule, spenderItem)\r\n\t}\r\n\r\n\tlogs, sub, err := _MintableToken.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn &MintableTokenApprovalIterator{contract: _MintableToken.contract, event: \"Approval\", logs: logs, sub: sub}, nil\r\n}", "title": "" }, { "docid": "6a3301a941024243ff6d3e593f350046", "score": "0.39962065", "text": "func (o ResourcePolicyOutput) Policy() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ResourcePolicy) pulumi.StringOutput { return v.Policy }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "08c719f055ba17198b95308daa830810", "score": "0.39918217", "text": "func Policy(driver, dsn string, verbose bool) {\n\tfmt.Println(\"Running policy queries\")\n}", "title": "" }, { "docid": "c430ce8f3cff9a2f6977993b2510f3fc", "score": "0.39862844", "text": "func (_StandardToken *StandardTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*StandardTokenApprovalIterator, error) {\r\n\r\n\tvar ownerRule []interface{}\r\n\tfor _, ownerItem := range owner {\r\n\t\townerRule = append(ownerRule, ownerItem)\r\n\t}\r\n\tvar spenderRule []interface{}\r\n\tfor _, spenderItem := range spender {\r\n\t\tspenderRule = append(spenderRule, spenderItem)\r\n\t}\r\n\r\n\tlogs, sub, err := _StandardToken.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn &StandardTokenApprovalIterator{contract: _StandardToken.contract, event: \"Approval\", logs: logs, sub: sub}, nil\r\n}", "title": "" }, { "docid": "9c78d9d43463aecd87ee1c501fd70209", "score": "0.39830723", "text": "func (_RepublicToken *RepublicTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*RepublicTokenApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _RepublicToken.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RepublicTokenApprovalIterator{contract: _RepublicToken.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "17abecad441e55533dab7ada7a1c1d3f", "score": "0.3982324", "text": "func (_StandardToken *StandardTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*StandardTokenApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _StandardToken.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StandardTokenApprovalIterator{contract: _StandardToken.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "9018235a2d584a2662e938cc911a701a", "score": "0.39800864", "text": "func (*ShowRanges) StatementType() StatementType { return Rows }", "title": "" }, { "docid": "b256bce259d7bf49cfcf329c2424069e", "score": "0.3965975", "text": "func NewPolicyStatement() *PolicyStatement {\n\treturn &PolicyStatement{\n\t\tSid: \"\",\n\t\tEffect: \"\",\n\t\tPrincipal: map[string][]string{},\n\t\tAction: []action{},\n\t\tResource: []string{},\n\t}\n}", "title": "" }, { "docid": "9dad3d1e9943db314afe01a099d81041", "score": "0.39632285", "text": "func (o AttestorIamMemberOutput) Role() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AttestorIamMember) pulumi.StringOutput { return v.Role }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ee3deed2c08148940e1274bf6d6476f5", "score": "0.3962664", "text": "func (s *BasePlSqlParserListener) EnterSwallow_to_semi(ctx *Swallow_to_semiContext) {}", "title": "" }, { "docid": "0ddcc717acc5f326e577b55a79ab3144", "score": "0.39622113", "text": "func (_CivilPLCRVotingContract *CivilPLCRVotingContractFilterer) FilterVotingRightsGranted(opts *bind.FilterOpts, voter []common.Address) (*CivilPLCRVotingContractVotingRightsGrantedIterator, error) {\n\n\tvar voterRule []interface{}\n\tfor _, voterItem := range voter {\n\t\tvoterRule = append(voterRule, voterItem)\n\t}\n\n\tlogs, sub, err := _CivilPLCRVotingContract.contract.FilterLogs(opts, \"_VotingRightsGranted\", voterRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CivilPLCRVotingContractVotingRightsGrantedIterator{contract: _CivilPLCRVotingContract.contract, event: \"_VotingRightsGranted\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "e6ad27d4ad9d4ec93fa8477f8577f825", "score": "0.3955859", "text": "func (_Bridge *BridgeFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*BridgeRoleGrantedIterator, error) {\n\n\tvar roleRule []interface{}\n\tfor _, roleItem := range role {\n\t\troleRule = append(roleRule, roleItem)\n\t}\n\tvar accountRule []interface{}\n\tfor _, accountItem := range account {\n\t\taccountRule = append(accountRule, accountItem)\n\t}\n\tvar senderRule []interface{}\n\tfor _, senderItem := range sender {\n\t\tsenderRule = append(senderRule, senderItem)\n\t}\n\n\tlogs, sub, err := _Bridge.contract.FilterLogs(opts, \"RoleGranted\", roleRule, accountRule, senderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BridgeRoleGrantedIterator{contract: _Bridge.contract, event: \"RoleGranted\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "6ebba3169d961624fcc44f9ebaa3d623", "score": "0.39541382", "text": "func (s *BaseSOQLListener) EnterWhere_clause(ctx *Where_clauseContext) {}", "title": "" }, { "docid": "63807164709812d7c2fb8ea68b7883f3", "score": "0.3946823", "text": "func (sp *SQSPolicy) AddStatement(statement *SQSPolicyStatement) error {\n\tif statement.Sid == \"\" {\n\t\treturn fmt.Errorf(\"Sid cannot be empty\")\n\t}\n\tif statement.Effect == \"\" {\n\t\treturn fmt.Errorf(\"Effect cannot be empty\")\n\t}\n\tif statement.Principal == \"\" {\n\t\treturn fmt.Errorf(\"Principal cannot be empty\")\n\t}\n\tif statement.Action == \"\" {\n\t\treturn fmt.Errorf(\"Action cannot be empty\")\n\t}\n\tif statement.Resource == \"\" {\n\t\treturn fmt.Errorf(\"Resource cannot be empty\")\n\t}\n\tif len(statement.Condition.ArnEquals) == 0 {\n\t\treturn fmt.Errorf(\"Condition.ArnEquals cannot be empty\")\n\t}\n\tsp.Statement = append(sp.Statement, *statement)\n\n\treturn nil\n}", "title": "" }, { "docid": "d4b2f5b071c02d09701d35b0f903de0c", "score": "0.39444318", "text": "func (s *BaseSOQLListener) EnterWith_clause(ctx *With_clauseContext) {}", "title": "" }, { "docid": "645cc9620fa775dd1a1cc55025a952e5", "score": "0.39440808", "text": "func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _ERC20.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ERC20ApprovalIterator{contract: _ERC20.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "645cc9620fa775dd1a1cc55025a952e5", "score": "0.39440808", "text": "func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _ERC20.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ERC20ApprovalIterator{contract: _ERC20.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "645cc9620fa775dd1a1cc55025a952e5", "score": "0.39431134", "text": "func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _ERC20.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ERC20ApprovalIterator{contract: _ERC20.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "b0b69d8cadfaab5c9c29420574f30837", "score": "0.39426637", "text": "func (_SRTToken *SRTTokenFilterer) FilterApproval(opts *bind.FilterOpts, _owner []common.Address, _spender []common.Address) (*SRTTokenApprovalIterator, error) {\n\n\tvar _ownerRule []interface{}\n\tfor _, _ownerItem := range _owner {\n\t\t_ownerRule = append(_ownerRule, _ownerItem)\n\t}\n\tvar _spenderRule []interface{}\n\tfor _, _spenderItem := range _spender {\n\t\t_spenderRule = append(_spenderRule, _spenderItem)\n\t}\n\n\tlogs, sub, err := _SRTToken.contract.FilterLogs(opts, \"Approval\", _ownerRule, _spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SRTTokenApprovalIterator{contract: _SRTToken.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "1169622edc4a9dc3bf9441d62e6548cf", "score": "0.39416298", "text": "func (BaseMixin) Policy() ent.Policy {\n\treturn privacy.Policy{\n\t\tMutation: privacy.MutationPolicy{\n\t\t\trule.DenyIfNoViewer(),\n\t\t},\n\t\tQuery: privacy.QueryPolicy{\n\t\t\trule.AllowIfAdmin(),\n\t\t\t// Filter out entities that are not connected to the tenant.\n\t\t\t// If the viewer is admin, this policy rule is skipped above.\n\t\t\trule.FilterTenantRule(),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "b9c6f1be067d1abedba6f58f03c5156f", "score": "0.39376277", "text": "func (s *BasePostgreSQLParserListener) EnterRole_name_list(ctx *Role_name_listContext) {}", "title": "" }, { "docid": "03822b5898e11be9f3848ab267f07cab", "score": "0.39374506", "text": "func (p *Policy) Generate() (*xds_rbac.Policy, error) {\n\tpolicy := &xds_rbac.Policy{}\n\n\t// Construct the Principals ------------------------\n\tvar finalPrincipals []*xds_rbac.Principal\n\n\t// Each RuleList follows OR semantics with other RuleList in the list of RuleList\n\tfor _, principalRuleList := range p.Principals {\n\t\t// 'principalRuleList' corresponds to a single Principal in an RBAC policy.\n\t\t// This Principal can be defined in terms of one of AND or OR rules.\n\t\t// When AND/OR semantics are not required to define multiple rules corresponding\n\t\t// to this principal, a single Rule in either the AndRules or OrRules will suffice.\n\n\t\tif len(principalRuleList.AndRules) != 0 && len(principalRuleList.OrRules) != 0 {\n\t\t\treturn nil, errors.New(\"Principal rule cannot have both AND & OR rules at the same time\")\n\t\t}\n\n\t\tvar currentPrincipal *xds_rbac.Principal\n\n\t\tswitch {\n\t\tcase len(principalRuleList.AndRules) != 0:\n\t\t\t// Combine all the AND rules for this Principal rule with AND semantics\n\t\t\tvar andPrincipalRules []*xds_rbac.Principal\n\t\t\tfor _, andPrincipalRule := range principalRuleList.AndRules {\n\t\t\t\t// Fill in the authenticated principal types\n\t\t\t\tif andPrincipalRule.Attribute == DownstreamAuthPrincipal {\n\t\t\t\t\tauthPrincipal := GetAuthenticatedPrincipal(andPrincipalRule.Value)\n\t\t\t\t\tandPrincipalRules = append(andPrincipalRules, authPrincipal)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentPrincipal = andPrincipals(andPrincipalRules)\n\n\t\tcase len(principalRuleList.OrRules) != 0:\n\t\t\t// Combine all the OR rules for this Principal rule with OR semantics\n\t\t\tvar orPrincipalRules []*xds_rbac.Principal\n\t\t\tfor _, orPrincipalRule := range principalRuleList.OrRules {\n\t\t\t\t// Fill in the authenticated principal types\n\t\t\t\tif orPrincipalRule.Attribute == DownstreamAuthPrincipal {\n\t\t\t\t\tauthPrincipal := GetAuthenticatedPrincipal(orPrincipalRule.Value)\n\t\t\t\t\torPrincipalRules = append(orPrincipalRules, authPrincipal)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentPrincipal = orPrincipals(orPrincipalRules)\n\n\t\tdefault:\n\t\t\t// Neither AND/OR rules set, set principal to Any\n\t\t\tcurrentPrincipal = getAnyPrincipal()\n\t\t}\n\n\t\tfinalPrincipals = append(finalPrincipals, currentPrincipal)\n\t}\n\tif len(p.Principals) == 0 {\n\t\t// No principals specified for this policy, allow ANY\n\t\tfinalPrincipals = append(finalPrincipals, getAnyPrincipal())\n\t}\n\n\tpolicy.Principals = finalPrincipals\n\n\t// Construct the Permissions ---------------------------\n\tvar finalPermissions []*xds_rbac.Permission\n\n\t// Each RuleList follows OR semantics with other RuleList in the list of RuleList\n\tfor _, permissionRuleList := range p.Permissions {\n\t\t// 'principalRuleList' corresponds to a single Principal in an RBAC policy.\n\t\t// This Principal can be defined in terms of one of AND or OR rules.\n\t\t// When AND/OR semantics are not required to define multiple rules corresponding\n\t\t// to this principal, a single Rule in either the AndRules or OrRules will suffice.\n\n\t\tif len(permissionRuleList.AndRules) != 0 && len(permissionRuleList.OrRules) != 0 {\n\t\t\treturn nil, errors.New(\"Permission rule cannot have both AND & OR rules at the same time\")\n\t\t}\n\n\t\tvar currentPermission *xds_rbac.Permission\n\n\t\tswitch {\n\t\tcase len(permissionRuleList.AndRules) != 0:\n\t\t\t// Combine all the AND rules for this Permission rule with AND semantics\n\t\t\tvar andPermissionRules []*xds_rbac.Permission\n\t\t\tfor _, andPermissionRule := range permissionRuleList.AndRules {\n\t\t\t\t// Fill in the destination port permission\n\t\t\t\tif andPermissionRule.Attribute == DestinationPort {\n\t\t\t\t\tport, err := strconv.ParseUint(andPermissionRule.Value, 10, 32)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, errors.Errorf(\"Error parsing destination port value %s\", andPermissionRule.Value)\n\t\t\t\t\t}\n\t\t\t\t\tportPermission := GetDestinationPortPermission(uint32(port))\n\t\t\t\t\tandPermissionRules = append(andPermissionRules, portPermission)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentPermission = andPermissions(andPermissionRules)\n\n\t\tcase len(permissionRuleList.OrRules) != 0:\n\t\t\t// Combine all the OR rules for this Permission rule with OR semantics\n\t\t\tvar orPermissionRules []*xds_rbac.Permission\n\t\t\tfor _, orPermissionRule := range permissionRuleList.OrRules {\n\t\t\t\t// Fill in the destination port permission\n\t\t\t\tif orPermissionRule.Attribute == DestinationPort {\n\t\t\t\t\tport, err := strconv.ParseUint(orPermissionRule.Value, 10, 32)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, errors.Errorf(\"Error parsing destination port value %s\", orPermissionRule.Value)\n\t\t\t\t\t}\n\t\t\t\t\tportPermission := GetDestinationPortPermission(uint32(port))\n\t\t\t\t\torPermissionRules = append(orPermissionRules, portPermission)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentPermission = orPermissions(orPermissionRules)\n\n\t\tdefault:\n\t\t\t// Neither AND/OR rules set, set permission to Any\n\t\t\tcurrentPermission = getAnyPermission()\n\t\t}\n\n\t\tfinalPermissions = append(finalPermissions, currentPermission)\n\t}\n\tif len(p.Permissions) == 0 {\n\t\t// No permissions specified for this policy, allow ANY\n\t\tfinalPermissions = append(finalPermissions, getAnyPermission())\n\t}\n\n\tpolicy.Permissions = finalPermissions\n\n\treturn policy, nil\n}", "title": "" }, { "docid": "7ca87c9f72ffdb3f379b083f7a9c48b0", "score": "0.39368188", "text": "func (_Swappair *SwappairFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*SwappairApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _Swappair.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SwappairApprovalIterator{contract: _Swappair.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "d3ae0109aab74bbfbbd9ecf9613b73da", "score": "0.39355394", "text": "func NewStatement(effect Effect, role string, projects, resources, actions []string) (Statement, error) {\n\tif role == \"\" && len(actions) == 0 {\n\t\treturn Statement{},\n\t\t\terrors.New(\"unsupported statement variant: you must pass a role, a non-empty array of actions, or both\")\n\t}\n\n\tid, err := uuid.New()\n\tif err != nil {\n\t\treturn Statement{}, storage_errors.ErrGenerateUUID\n\t}\n\n\treturn Statement{\n\t\tEffect: effect,\n\t\tRole: role,\n\t\tProjects: projects,\n\t\tActions: actions,\n\t\tResources: resources,\n\t\tID: id,\n\t}, nil\n}", "title": "" }, { "docid": "cd95b26361819cd70071820ee7f91e3a", "score": "0.39310256", "text": "func (_MainnetLoomTokenContract *MainnetLoomTokenContractFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*MainnetLoomTokenContractApprovalIterator, error) {\n\n\tvar ownerRule []interface{}\n\tfor _, ownerItem := range owner {\n\t\townerRule = append(ownerRule, ownerItem)\n\t}\n\tvar spenderRule []interface{}\n\tfor _, spenderItem := range spender {\n\t\tspenderRule = append(spenderRule, spenderItem)\n\t}\n\n\tlogs, sub, err := _MainnetLoomTokenContract.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MainnetLoomTokenContractApprovalIterator{contract: _MainnetLoomTokenContract.contract, event: \"Approval\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "738acf3b641c1cf9c0aee766d4c74b71", "score": "0.39285663", "text": "func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) {\r\n\r\n\tvar ownerRule []interface{}\r\n\tfor _, ownerItem := range owner {\r\n\t\townerRule = append(ownerRule, ownerItem)\r\n\t}\r\n\tvar spenderRule []interface{}\r\n\tfor _, spenderItem := range spender {\r\n\t\tspenderRule = append(spenderRule, spenderItem)\r\n\t}\r\n\r\n\tlogs, sub, err := _ERC20.contract.FilterLogs(opts, \"Approval\", ownerRule, spenderRule)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn &ERC20ApprovalIterator{contract: _ERC20.contract, event: \"Approval\", logs: logs, sub: sub}, nil\r\n}", "title": "" }, { "docid": "d25340cf30c9473a76832c2595873ee8", "score": "0.39215323", "text": "func (*AlterRole) StatementType() StatementType { return Ack }", "title": "" }, { "docid": "b3bc1aa68384964504fcd465ea730764", "score": "0.39185613", "text": "func (s *BasecminusListener) EnterStatementList(ctx *StatementListContext) {}", "title": "" }, { "docid": "a90bb306aca26b40df2d5709c7305a16", "score": "0.39178252", "text": "func Private() *Statement {\n\t// notest\n\treturn newStatement().Private()\n}", "title": "" }, { "docid": "3c0cfc9ebb4f303f674b4127e1921670", "score": "0.39109161", "text": "func (o WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementIpSetReferenceStatementOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementNotStatementStatementAndStatementStatementAndStatementStatementIpSetReferenceStatement) string {\n\t\treturn v.Arn\n\t}).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "402eaab592f3b643997b006972aa1bd1", "score": "0.3910834", "text": "func (a CasbinAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error {\n\treturn nil\n}", "title": "" }, { "docid": "52e7842ebfe6ffb785b7a53f0a3e76c6", "score": "0.39097887", "text": "func (*Revoke) StatementTag() string { return \"REVOKE\" }", "title": "" } ]
a6909ae51ae8204fa7684ddbb0990594
AppendChild adds a child to the section
[ { "docid": "fc7523cd98d50e641fa25dcbf1f2854b", "score": "0.6749374", "text": "func (t *Assignment) AppendChild(child htmlgen.Section) {\n\tt.format.AppendChild(child)\n}", "title": "" } ]
[ { "docid": "c30343b11f35559f4a22dc76450810f2", "score": "0.60342824", "text": "func appendChild(parent Container, line *string, indent *int, lines []string, i *int, l *int) error {\n\tvar child *Element\n\tvar err error\n\tswitch p := parent.(type) {\n\tcase *Block:\n\t\tchild, err = NewElement(*line, *i+1, *indent, nil, nil, p)\n\tcase *Element:\n\t\tchild, err = NewElement(*line, *i+1, *indent, p, nil, nil)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tparent.AppendChild(child)\n\t*i++\n\terr = appendChildren(child, lines, i, l, child.Indent, child.RawContent, child.Type)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aeb4f19626a2605b43386b69c78bce9b", "score": "0.5905751", "text": "func (t *Tab) Append(name string, child Control) {\n\tt.InsertAt(name, len(t.children), child)\n}", "title": "" }, { "docid": "7637467cec68347112c43481d94e280d", "score": "0.5688665", "text": "func (TextNode) AddChild(n Node) {\n}", "title": "" }, { "docid": "dca16d62399f7a2e5d753ffb9e16ed27", "score": "0.56800634", "text": "func appendChild(node *html.Node, child *html.Node) {\n\tif child.Parent != nil {\n\t\ttemp := cloneNode(child)\n\t\tnode.AppendChild(temp)\n\t\tchild.Parent.RemoveChild(child)\n\t\treturn\n\t}\n\n\tnode.AppendChild(child)\n}", "title": "" }, { "docid": "a2ae08d1a1428704bb7ff64ed4f482ec", "score": "0.56341904", "text": "func (e *Element) AddChild(s Component) {\n\te.Children = append(e.Children, s)\n}", "title": "" }, { "docid": "989fcfbb798ef706494522f8cd8467b7", "score": "0.5587123", "text": "func (a *AST) AppendChild(child AST) {\n\ta.Children = append(a.Children, child)\n}", "title": "" }, { "docid": "a8d88195a6ced3e32582b08070070c62", "score": "0.55537456", "text": "func (e *Element) AddChild(name string, o *Element) {\n\to.onAdd(name, e.ChildCount(), e)\n\te.children.Put(name, o)\n}", "title": "" }, { "docid": "d336229ff4ba4fd50f22cafc9134c86c", "score": "0.55411714", "text": "func (b *Builder) AddChild(name, middleText string, attr map[string]string) *Builder {\n\te := Element{Name: name, MiddleText: middleText, Attrs: attr}\n\tb.Root.Children = append(b.Root.Children, &e)\n\treturn b\n}", "title": "" }, { "docid": "2296ef157e4ad31e08203ebe4cc5f140", "score": "0.5494285", "text": "func (g *Grid) Append(child Control, left, top, xspan, yspan int, hexpand bool, uialign Align, vexpand bool, valign Align) {\n\tc := (*C.uiControl)(nil)\n\tif child != nil {\n\t\tc = touiControl(child.LibuiControl())\n\t}\n\tC.uiGridAppend(g.g, c, C.int(left), C.int(top), C.int(xspan), C.int(yspan), frombool(hexpand), C.uiAlign(uialign), frombool(vexpand), C.uiAlign(valign))\n\tg.children = append(g.children, child)\n}", "title": "" }, { "docid": "e682bb1f6691d63c4dec78006834936e", "score": "0.54780346", "text": "func (v *TextView) AddChildAtAnchor(child IWidget, anchor *TextChildAnchor) {\n\tC.gtk_text_view_add_child_at_anchor(v.native(), child.toWidget(), anchor.native())\n}", "title": "" }, { "docid": "2161ba645819000683f51db45e7cfa2c", "score": "0.54182696", "text": "func (a *AudioSampleEntryBox) AddChild(b Box) {\n\tswitch b.Type() {\n\tcase \"esds\":\n\t\ta.Esds = b.(*EsdsBox)\n\t}\n\n\ta.Children = append(a.Children, b)\n}", "title": "" }, { "docid": "c1457d5e284caeef6dccf234aef8fe83", "score": "0.54178864", "text": "func (n *NoInlineAttr) AddChild(node Node) {\n\tn.Children = append(n.Children, node)\n}", "title": "" }, { "docid": "2885ccf90d113cbf83a23e204ff95249", "score": "0.5375281", "text": "func (x *Section) Append(p paragraph) {\n\tx.paragraphs = append(x.paragraphs, p)\n}", "title": "" }, { "docid": "3e58bc8c0d9026c167175d6b171f28b3", "score": "0.53710973", "text": "func (sb SectionBody) AppendSection(dest []byte) []byte {\n\tdest = append(dest, byte(SingleDocument))\n\tdest = append(dest, sb.Document...)\n\treturn dest\n}", "title": "" }, { "docid": "c8c87b423cf348f959301b4f2d488154", "score": "0.5350685", "text": "func (w *WidgetImplement) AddChild(self, child Widget) {\n\tw.children = append(w.children, child)\n\tchild.SetParent(self)\n}", "title": "" }, { "docid": "186628025d9ca5c4c60217d5e934892d", "score": "0.5268127", "text": "func (el *HTMLElement) Append(node Compilable) {\n\tel.children = append(el.children, node)\n}", "title": "" }, { "docid": "903c31ff93da7bb20cd329d728cd5bd5", "score": "0.52522707", "text": "func Section(props *SectionProps, children ...Element) *SectionElem {\n\trProps := &_SectionProps{\n\t\tBasicHTMLElement: newBasicHTMLElement(),\n\t}\n\n\tif props != nil {\n\t\tprops.assign(rProps)\n\t}\n\n\treturn &SectionElem{\n\t\tElement: createElement(\"section\", rProps, children...),\n\t}\n}", "title": "" }, { "docid": "4f2a00e698edb546de8b3f3dfdd2c054", "score": "0.5201443", "text": "func (CodeNode) AddChild(n Node) {\n}", "title": "" }, { "docid": "2e6c53bfaa2664261018b47dc1cb212a", "score": "0.5187346", "text": "func (p *jsonOutputNode) AddChild(attr string, child outputNode) {\n\ta := p.data[attr]\n\tif a == nil {\n\t\t// Need to do this because we cannot cast nil interface to\n\t\t// []map[string]interface{}.\n\t\ta = make([]map[string]interface{}, 0, 5)\n\t}\n\tp.data[attr] = append(a.([]map[string]interface{}),\n\t\tchild.(*jsonOutputNode).data)\n}", "title": "" }, { "docid": "31f5e6052214a9a27f1d3d871cc438f4", "score": "0.5163672", "text": "func (htmlDoc *htmlDocument) append(e element) {\n\thtmlDoc.elements = append(htmlDoc.elements, e)\n}", "title": "" }, { "docid": "f30a4c87196849cca0afd544866ddf11", "score": "0.51607955", "text": "func insertChild(children []*nodeHeader, child *nodeHeader, idx int) {\n\t// Append to \"grow\" the slice, should never reallocate so we don't need to\n\t// return the slice to the caller since the underlying node array has been\n\t// modified as desired.\n\tchildren = append(children, child)\n\tcopy(children[idx+1:], children[idx:])\n\tchildren[idx] = child\n}", "title": "" }, { "docid": "158bb84fefe47cfc78815e1b013c6307", "score": "0.51015866", "text": "func (n *FloatingLiteral) AddChild(node Node) {\n\tn.ChildNodes = append(n.ChildNodes, node)\n}", "title": "" }, { "docid": "e147b191aa0d94c28bd2a37b12ba32d3", "score": "0.50957197", "text": "func (o Chapter) AddSection(i int, name string, apiVersion *string) (outputs.Section, error) {\n\terr := o.hugo.addSection(o.part.name, o.name, name)\n\tif err != nil {\n\t\treturn Section{}, err\n\t}\n\treturn Section{\n\t\thugo: o.hugo,\n\t\tpart: o.part,\n\t\tchapter: &o,\n\t}, nil\n}", "title": "" }, { "docid": "5d46892526c317bfd27557ce3055dffb", "score": "0.5063639", "text": "func (xp *XMLPath) AddChild(elemName string) {\n\txp.ElemNames = append(xp.ElemNames, elemName)\n}", "title": "" }, { "docid": "360ca8f4165c4edad46e126391eb3e59", "score": "0.5062733", "text": "func (p *protoOutputNode) AddChild(attr string, child outputNode) {\n\tp.Node.Children = append(p.Node.Children, child.(*protoOutputNode).Node)\n}", "title": "" }, { "docid": "eb6e87608a7f443cacaf2476655b09e7", "score": "0.5060925", "text": "func (c *ConfigParser) addSection(section string) {\n\toptions := make(map[string]string)\n\tinterpolate := make(map[string]InterpolateObj)\n\tsd := SectionData{options, interpolate}\n\tc.sections[section] = sd\n}", "title": "" }, { "docid": "695b4a360f4153da0272a342b05c2ac1", "score": "0.50551957", "text": "func (b *Block) AppendChild(child *Block, childType models.ParentsType) {\n\tb.mutex.Lock()\n\tdefer b.mutex.Unlock()\n\n\tswitch childType {\n\tcase models.StrongParentType:\n\t\tb.strongChildren = append(b.strongChildren, child)\n\tcase models.WeakParentType:\n\t\tb.weakChildren = append(b.weakChildren, child)\n\tcase models.ShallowLikeParentType:\n\t\tb.likedInsteadChildren = append(b.likedInsteadChildren, child)\n\t}\n}", "title": "" }, { "docid": "2a7c80a4a084ad461e5a33923451ea28", "score": "0.50472313", "text": "func (e *dataUsageEntry) addChild(hash dataUsageHash) {\n\tif _, ok := e.Children[hash.Key()]; ok {\n\t\treturn\n\t}\n\tif e.Children == nil {\n\t\te.Children = make(dataUsageHashMap, 1)\n\t}\n\te.Children[hash.Key()] = struct{}{}\n}", "title": "" }, { "docid": "d1a032afdf1145ebd4d50047d5551742", "score": "0.5020334", "text": "func (parent *Node) AddChild(cur *Node) *Node {\n\treturn makeNode(C.xmlAddChild(parent.Ptr, cur.Ptr))\n}", "title": "" }, { "docid": "3bb72f079646ed4711858a2739df9bea", "score": "0.50010777", "text": "func (e *Element) InsertChild(name string, index int, o *Element) {\n\tif index == e.ChildCount() {\n\t\te.AddChild(name, o)\n\t\treturn\n\t}\n\n\te.projectIndex(&index)\n\to.onAdd(name, index, e)\n\te.children.Insert(name, index, o)\n\te.updateIndexes(index, e.ChildCount()-1)\n}", "title": "" }, { "docid": "20cd595abdc6e77a995e087044fde295", "score": "0.49904305", "text": "func (f *Fragment) AddChild(b Box) {\n\tswitch b.Type() {\n\tcase \"prft\":\n\t\tf.Prft = b.(*PrftBox)\n\tcase \"moof\":\n\t\tf.Moof = b.(*MoofBox)\n\tcase \"mdat\":\n\t\tf.Mdat = b.(*MdatBox)\n\t}\n\tf.Children = append(f.Children, b)\n}", "title": "" }, { "docid": "61e2a2a7f515b76921e16fbb268b65b8", "score": "0.49805987", "text": "func (sds SectionDocumentSequence) AppendSection(dest []byte) []byte {\n\tdest = append(dest, byte(DocumentSequence))\n\tdest = appendInt32(dest, sds.Size)\n\tdest = appendCString(dest, sds.Identifier)\n\n\tfor _, doc := range sds.Documents {\n\t\tdest = append(dest, doc...)\n\t}\n\n\treturn dest\n}", "title": "" }, { "docid": "e52413cdd3c3c476054b49bd09f7b1f8", "score": "0.49406716", "text": "func (e *Element) Append(elem *Element) {\n\tif e == elem {\n\t\treturn\n\t}\n\te.Children = append(e.Children, elem)\n}", "title": "" }, { "docid": "466d5182df036c0a4ffe01ad35dfad5a", "score": "0.49376363", "text": "func (v *StackPanel) AddChild(e ...Element) {\n\tv.childs = append(v.childs, e...)\n\tfor _, c := range e {\n\t\tc.SetParent(v)\n\t}\n}", "title": "" }, { "docid": "eab1446ee8dcf752c2cf74a8b31b1952", "score": "0.4925555", "text": "func (c *component) addChild(child Component) {\n\tc.isClean = false\n\tc.children = append(c.children, child)\n}", "title": "" }, { "docid": "3e28cf17cc6449dc231f1ad8b8998b97", "score": "0.48990554", "text": "func AddChild(parent *Node, child *Node) {\n\tparent.Children = append(parent.Children, child)\n}", "title": "" }, { "docid": "f4267d98a7b84939a806145e49b5a35c", "score": "0.48599175", "text": "func (d *DinfBox) AddChild(box Box) {\n\n\tswitch box.Type() {\n\tcase \"dref\":\n\t\td.Dref = box.(*DrefBox)\n\t}\n\td.Children = append(d.Children, box)\n}", "title": "" }, { "docid": "8e1bf76b6a6fae87bbecb6052f6cee21", "score": "0.4859005", "text": "func (s *WidgetBase) Append(w Widget) {\n\ts.children = append(s.children, w)\n\tw.SetParent(s)\n}", "title": "" }, { "docid": "b48e226b7ff8cccc8b3c0d2a83f34be6", "score": "0.48471743", "text": "func (p *PlainTextBuilder) CreateSection(section string) {\n\t// ˅\n\tp.buffer.WriteString(\"* \" + section + \"\\n\") // Section\n\tp.buffer.WriteString(\"\\n\") // Blank line\n\t// ˄\n}", "title": "" }, { "docid": "56657c9702c5cdeba1fdcfecbe2acee1", "score": "0.481056", "text": "func (self *Graphics) AddChildAt(child *DisplayObject, index int) *DisplayObject{\n return &DisplayObject{self.Object.Call(\"addChildAt\", child, index)}\n}", "title": "" }, { "docid": "6094160a0d409796840bd29541a144b9", "score": "0.4803627", "text": "func (p *Page) Append(info SectionInfo, key interface{}, value interface{}) {\n\tfor i, match := range *p {\n\t\tif match.Key == info.Key {\n\t\t\tmatch.Content = append(match.Content, Item{Key: key, Value: value})\n\t\t\t(*p)[i] = match\n\t\t\treturn\n\t\t}\n\t}\n\t*p = append(*p, Section{SectionInfo: info, Content: []Item{{Key: key, Value: value}}})\n}", "title": "" }, { "docid": "0a47cf6c4f9cd34632b2c6483a49fb13", "score": "0.4799732", "text": "func (b *BaseElement) AdoptChild(c ElementI) {\n\tb.Children = append(b.Children, c)\n\tc.OnAdopted(b.This)\n\n\t// Recalculate our style after adopting.\n\tb.SetDirty(true)\n\tb.CalculateStyle()\n}", "title": "" }, { "docid": "3b9f520f5ee31309513e842c01e155ee", "score": "0.47885987", "text": "func (g *Group) AddChild(s Shape) {\n\ts.SetParent(g)\n\tg.shapes = append(g.shapes, s)\n\tmin, max := g.getBounds()\n\tg.bounds = [2]*algebra.Vector{min, max}\n}", "title": "" }, { "docid": "82ed0b2322bb24f0b2952d5341a5ee52", "score": "0.4764855", "text": "func (self *StraightLineTrack) Add(child Object) {\n\tself.childs = append(self.childs, child)\n}", "title": "" }, { "docid": "93e06929703cc1bd98adb651b5e35fa4", "score": "0.46853602", "text": "func (v *TextView) AddChildInWindow(child IWidget, tp TextWindowType, xpos, ypos int) {\n\tC.gtk_text_view_add_child_in_window(v.native(), child.toWidget(), C.GtkTextWindowType(tp), C.gint(xpos), C.gint(ypos))\n}", "title": "" }, { "docid": "fe7dc40e0fbc8065434ca80146b11aac", "score": "0.46678838", "text": "func (schema *Schema) AddSection(section string, sT *SchemaKV) (addErr error) {\n\tif schema.HasSection(section) { // Section already exists\n\t\taddErr = ErrSectionExists\n\t\treturn\n\t}\n\n\tschema.Map[section] = sT\n\tschema.Order = append(schema.Order, section) // Append to the existing order\n\treturn\n}", "title": "" }, { "docid": "4812d181af2b702f43a27564c5451846", "score": "0.46645477", "text": "func (bp *Blueprint) AddElement(blueprint etree.Document) {\n\tbp.XMLData.Root().AddChild(blueprint.Root())\n}", "title": "" }, { "docid": "59b00a755607407d936371af0ca42f8c", "score": "0.46604446", "text": "func (d *Display) AddSection(header string) *Section {\n\td.mutex.Lock()\n\tdefer d.mutex.Unlock()\n\n\ts := newSection(header, func(handler DisplayUpdateHandler) {\n\t\td.gui.Update(func(g *gocui.Gui) (err error) {\n\t\t\tv, err := g.View(header)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tv.Clear()\n\t\t\thandler(v)\n\t\t\treturn\n\t\t})\n\t})\n\n\td.sections = append(d.sections, s)\n\tsort.Slice(d.sections, func(i int, j int) bool {\n\t\treturn d.sections[i].Header < d.sections[j].Header\n\t})\n\n\td.gui.Update(d.Layout)\n\treturn s\n}", "title": "" }, { "docid": "4203f89aadccabf4abc19f8f633dbd57", "score": "0.46475857", "text": "func Section_(children ...HTML) HTML {\n return Section(nil, children...)\n}", "title": "" }, { "docid": "b627bc03c764ef3f7ed98bcd6d35b713", "score": "0.4646858", "text": "func (n *BaseNode) AddChild(i Node) {\n\t// Lock\n\tn.m.Lock()\n\n\t// Node doesn't exist\n\tif _, ok := n.children[i.Metadata().Name]; ok {\n\t\tn.m.Unlock()\n\t\treturn\n\t}\n\n\t// Add child\n\tn.children[i.Metadata().Name] = i\n\n\t// Unlock\n\tn.m.Unlock()\n\n\t// Send event\n\t// Mutex should be unlocked at this point\n\tn.eh.Emit(Event{\n\t\tName: n.et(EventTypeChildAdded),\n\t\tPayload: i,\n\t\tTarget: n.target,\n\t})\n}", "title": "" }, { "docid": "580dcacb2eeb626c56fc3b3c7a6a56ce", "score": "0.46428484", "text": "func (n *nodeHeader) addChild(txn *Txn, c byte, child *nodeHeader) *nodeHeader {\n\tswitch n.typ {\n\tcase typLeaf:\n\t\t// Leaves have no children\n\t\treturn nil\n\n\tcase typNode4:\n\t\treturn n.node4().addChild(txn, c, child)\n\n\tcase typNode16:\n\t\treturn n.node16().addChild(txn, c, child)\n\n\tcase typNode48:\n\t\treturn n.node48().addChild(txn, c, child)\n\n\tcase typNode256:\n\t\treturn n.node256().addChild(txn, c, child)\n\t}\n\tpanic(\"invalid type\")\n}", "title": "" }, { "docid": "bbc9adc17ccee4ffa8f759f32940d800", "score": "0.46348277", "text": "func (e *Element) AddChild(els ...interface{}) error {\n\tfor _, elm := range els {\n\t\tswitch el := elm.(type) {\n\t\tcase xml.Attr:\n\t\t\te.SetAttribute(el)\n\t\tcase *Element:\n\t\t\te.children = append(e.children, el)\n\t\tdefault:\n\t\t\treturn errors.New(\"expected xml.Attr or *Element\")\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "647003c89d59bf1b4cdc09242a5f59fc", "score": "0.46166185", "text": "func (s *Section) AppendItem(item Fb) error { // nolint: gocyclo\n\tif s.sections != nil && len(s.sections) > 0 {\n\t\treturn makeError(ErrUnsupportedNestedItem, \"Can't mix nested sections with formatted text in section\")\n\t}\n\tpass := false\n\tif _, ok := item.(*p); ok {\n\t\tpass = true\n\t} else if _, ok := item.(*Poem); ok {\n\t\tpass = true\n\t} else if _, ok := item.(*Cite); ok {\n\t\tpass = true\n\t} else if _, ok := item.(*empty); ok {\n\t\tpass = true\n\t} else if _, ok := item.(*Table); ok {\n\t\tpass = true\n\t} else if _, ok := item.(*Image); ok {\n\t\tif s.items != nil && len(s.items) > 0 {\n\t\t\tpass = true\n\t\t} else {\n\t\t\treturn makeError(ErrUnsupportedNestedItem, \"Can't use type %T as first element in section\", item)\n\t\t}\n\t}\n\tif !pass {\n\t\treturn makeError(ErrUnsupportedNestedItem, \"Can't use type %T in section\", item)\n\t}\n\tif s.items == nil {\n\t\ts.items = []Fb{item}\n\t} else {\n\t\ts.items = append(s.items, item)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25351993a6c1abac122784c5ae2fbb39", "score": "0.4614526", "text": "func (r *CheckGroup) Append(option string) {\n\tr.Options = append(r.Options, option)\n\n\tr.Refresh()\n}", "title": "" }, { "docid": "c3a994185f231154c0710b3f03584244", "score": "0.4607803", "text": "func (b *CodeBlock) AddChild(n Node) {\n\tb.Children = append(b.Children, n)\n}", "title": "" }, { "docid": "8f885fc55307b2b61d4ca2a50839ebef", "score": "0.45999494", "text": "func (l *Buffered) AddAnchor(parent Logger) Logger {\n\tlineNum := atomic.AddInt32(&l.openAnchors, 1)\n\tl.ch <- bufmsg{Type: mtAddLine, Line: lineNum}\n\tonClose := func() {\n\t\tatomic.AddInt32(&l.openAnchors, -1)\n\t\tl.ch <- bufmsg{Type: mtRemoveLine, Line: lineNum}\n\t}\n\treturn newAnchor(parent, lineNum, onClose)\n}", "title": "" }, { "docid": "7d32545f8543d4a569f8c0071baff7fd", "score": "0.45847556", "text": "func (s *Section) AddSection(item *Section) error {\n\tif s.items != nil && len(s.items) > 0 {\n\t\treturn makeError(ErrUnsupportedNestedItem, \"Can't mix nested sections with formatted text in section\")\n\t}\n\tif s.sections == nil {\n\t\ts.sections = []*Section{item}\n\t} else {\n\t\ts.sections = append(s.sections, item)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "018e48e626b706278d8457805b583190", "score": "0.45725104", "text": "func Section(attrs []htmlgo.Attribute, children ...HTML) HTML {\n\treturn &htmlgo.Tree{Tag: \"section\", Attributes: attrs, Children: children}\n}", "title": "" }, { "docid": "ec2983aa675939a713eaf283e8771873", "score": "0.45628724", "text": "func (d *device) addChild(child Device) {\n\tkey := child.getKey()\n\td.children[key] = child\n\td.childKeys = append(d.childKeys, key)\n\tsort.Strings(d.childKeys)\n\tchild.setParent(d)\n}", "title": "" }, { "docid": "ea75e7a01acd920a8e7952f457479af8", "score": "0.45518944", "text": "func (t *DiskTree) addChild(root *disknode, edgename, key string, value []string) {\n\tnewnode := new(disknode)\n\tnewnode.Value = value\n\tnewnode.Edgename = edgename\n\tnewnode.Key = key\n\tnewnode.Hash = smash(key)\n\tnewnode.Parent = root.Hash\n\tif root.Children == nil {\n\t\troot.Children = make(map[string]string)\n\t}\n\troot.Children[string(edgename[0])] = newnode.Hash\n\tdebugf(\"add disk child %+v\\n\", newnode)\n\tt.write(root)\n\tt.write(newnode)\n}", "title": "" }, { "docid": "6888cbdf54b36f3d5056d8f05aa11464", "score": "0.45354092", "text": "func (e *Element) onAdd(name string, index int, parent *Element) {\n\tif e.Parent != nil { // just in case\n\t\te.Parent.RemoveChild(e.name)\n\t}\n\n\te.Parent = parent\n\te.name = name\n\te.index = index\n\tif parent.Scene != nil {\n\t\te.init(parent.Scene)\n\t}\n}", "title": "" }, { "docid": "5839d9ae681f6795c6e498a781ce0b5c", "score": "0.45344695", "text": "func add_section_name(\npar int32,/* parent of new node */\nc int,/* right or left? */\nname[]rune,/* section name */\nispref bool/* are we adding a prefix or a full name? */)int32{\np:=int32(len(name_dir))/* new node */\nname_dir= append(name_dir,name_info{})\nname_dir[p].llink= -1\ninit_node(p)\nif ispref{\nname_dir= append(name_dir,name_info{})\nname_dir[p+1].llink= -1\ninit_node(p+1)\n}\nname_dir[p].ispref= ispref\nname_dir[p].name= append(name_dir[p].name,int32(len(name)))/* length of section name */\nname_dir[p].name= append(name_dir[p].name,name...)\nname_dir[p].llink= -1\nname_dir[p].rlink= -1\ninit_node(p)\nif par==-1{\nname_root= p\n}else{\nif c==less{\nname_dir[par].llink= p\n}else{\nname_dir[par].rlink= p\n}\n}\nreturn p\n}", "title": "" }, { "docid": "4eadee82dac8cd7a2f29535b07ea41f2", "score": "0.4532544", "text": "func (m *MdiaBox) AddChild(box Box) {\n\n\tswitch box.Type() {\n\tcase \"mdhd\":\n\t\tm.Mdhd = box.(*MdhdBox)\n\tcase \"hdlr\":\n\t\tm.Hdlr = box.(*HdlrBox)\n\tcase \"elng\":\n\t\tm.Elng = box.(*ElngBox)\n\tcase \"minf\":\n\t\tm.Minf = box.(*MinfBox)\n\tcase \"elst\":\n\t\tm.Elst = box.(*ElstBox)\n\t}\n\tm.Children = append(m.Children, box)\n}", "title": "" }, { "docid": "8f7510dd3dbba190e37850f7288c4333", "score": "0.4525664", "text": "func addOption(c *ConfigParser, section, option, value string) {\n\tc.sections[section].options[option] = value\n}", "title": "" }, { "docid": "4b89ef596f65eea0aeaeb31a3c77c57a", "score": "0.45130613", "text": "func (s *Server) AddChild(address string) error {\n\tif len(s.Children) == s.ChildNumber {\n\t\treturn ServerFullError{s.Address}\n\t}\n\n\ts.Children[s.ChildNumber] = address\n\ts.ChildNumber++\n\n\treturn nil\n}", "title": "" }, { "docid": "e1932cabe9525c5cbcc2821285a31502", "score": "0.4487472", "text": "func (node *URLNode) AddChild(childURL string) *URLNode {\n\t// Don't add child node if root node is nil\n\t// The root node (and all the following nodes) will be nil if --show-tree\n\t// flag is set to false\n\tif node == nil {\n\t\treturn nil\n\t}\n\tnode.Lock()\n\tnewChild := URLNode{url: childURL}\n\tnode.children = append(node.children, &newChild)\n\tnode.Unlock()\n\treturn &newChild\n}", "title": "" }, { "docid": "14b1c1c002e401e3678d0bf644a96ef8", "score": "0.44871202", "text": "func (p Path) Add(child string) Path {\r\n\tret := Path(fmt.Sprint(p, string(os.PathSeparator), child))\r\n\treturn ret\r\n}", "title": "" }, { "docid": "1eef052437a9da47bc38125694cb20da", "score": "0.44832098", "text": "func (n *Node) AddChild(c *Node) {\n\tc.Parent = n\n\t//fmt.Println(\"child\", c.Value, \"parent\", c.Parent)\n\tc.Next = nil\n\tc.prev = nil\n\tn.Children.Insert(c)\n}", "title": "" }, { "docid": "d959b82bb439d01f7a931fd72910fdcd", "score": "0.444845", "text": "func (b *bar) append(object fyne.CanvasObject) {\n\tif b.Hidden && object.Visible() {\n\t\tobject.Hide()\n\t}\n\tb.children = append(b.children, object)\n\n\tb.Refresh()\n}", "title": "" }, { "docid": "91f0c564d6e99292bdbadd1c2357087d", "score": "0.44375324", "text": "func (d *D) Append(name string, value interface{}) {\n\t*d = append(*d, DocItem{name, value})\n}", "title": "" }, { "docid": "7b5f7c2b532c218511c47e3c676f99c4", "score": "0.44226503", "text": "func (n *Node) AddChild(childNode *Node) {\n\tchildNode.Parent = n\n\tn.Children = append(n.Children, childNode)\n}", "title": "" }, { "docid": "002c014ea16d9ba6411b80692e7e0843", "score": "0.4416742", "text": "func (sc *BaseSmartContract) AddChild(child object.Child) (string, error) {\n\tkey, err := sc.ChildStorage.Set(child)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn key, nil\n}", "title": "" }, { "docid": "973fda6e27081e8dce448566d6b1c684", "score": "0.44086918", "text": "func (t *TagNode) AppendNode(n Node) Node {\n\tt.children = append(t.children, n)\n\treturn n\n}", "title": "" }, { "docid": "f4635c4e1dc86543dc1281ce6050805a", "score": "0.44043258", "text": "func (self *Dll) Append(str string){\n\tnewNode := new(node)\n\tnewNode.data = str\n\tself.pushBack(newNode)\n}", "title": "" }, { "docid": "cd812cf02bb67358e75a2f004075dba7", "score": "0.4392291", "text": "func (this *TrieNode) AddChild(c rune) *TrieNode {\n\tvar t *TrieNode\n\tif val, ok := this.children[c]; ok {\n\t\tt = val\n\t} else {\n\t\tt = NewTrieNode(c)\n\t\tthis.children[c] = t\n\t}\n\treturn t\n}", "title": "" }, { "docid": "0dd588232243cd3accc134943aea564c", "score": "0.43891355", "text": "func (s *nodeBlock) insertChildAt(index int, n *nodeBlock) {\n\t_ = s._children[maxChildren-1-s.childrenSize]\n\tcopy(s._children[index+1:], s._children[index:])\n\tcopy(s.childrenOffset[index+1:], s.childrenOffset[index:])\n\ts._children[index] = n\n\ts.childrenOffset[index] = n.offset\n\ts.childrenSize++\n\ts.markDirty()\n}", "title": "" }, { "docid": "80d329eeae02ebfed14444a9656ec568", "score": "0.43804997", "text": "func (self *TileSprite) AddChildAt(child *DisplayObject, index int) *DisplayObject{\n return &DisplayObject{self.Object.Call(\"addChildAt\", child, index)}\n}", "title": "" }, { "docid": "723ef4650d95105deea5e2cacd26655d", "score": "0.43765026", "text": "func (s *Section) add(k, v []byte) {\n\ts.Keys = append(s.Keys, k)\n\ts.Values = append(s.Values, v)\n}", "title": "" }, { "docid": "7ce7bfc71dc2cebdb511e41d5e778e70", "score": "0.4359085", "text": "func (t General) AddChild(i, elem int) General {\n\tn := t[i]\n\n\tif n.IsLeaf() {\n\t\tt = append(t, Node{\n\t\t\tLeftChild: -1,\n\t\t\tRightSibling: -1,\n\t\t\tParent: i, // fix this\n\t\t\tValue: elem,\n\t\t})\n\n\t\tn.LeftChild = len(t) - 1\n\n\t\treturn t\n\t}\n\n\tlastChild := t[n.LeftChild]\n\n\tfor lastChild.RightSibling != -1 {\n\t\tlastChild = t[lastChild.RightSibling]\n\t}\n\n\tt = append(t, Node{\n\t\tLeftChild: -1,\n\t\tRightSibling: -1,\n\t\tParent: lastChild.Parent,\n\t\tValue: elem,\n\t})\n\n\treturn t\n}", "title": "" }, { "docid": "a08dc030cbd4b512df663c10d3d7e1c9", "score": "0.43579692", "text": "func (w WatWorkspace) Append(name, contents string) error {\n\tpath := filepath.Join(w.root, kWatDirName, name)\n\tfile, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, permFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"os.OpenFile: %v\", err)\n\t}\n\tdefer file.Close()\n\n\t_, err = file.WriteString(contents)\n\treturn err\n\n}", "title": "" }, { "docid": "fee9f3eaa2a319c2b386ea15674c8ed5", "score": "0.43553302", "text": "func (b *Builder) AddHTMLPart(html []byte, file ...string) (err error) {\n\tfor i := range file {\n\t\tfile, err := os.Open(file[i])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tb.htmlRelatedFiles = append(b.htmlRelatedFiles, file)\n\t}\n\tb.htmlPart = html\n\treturn nil\n}", "title": "" }, { "docid": "4bbc44ed5440f5737e53bdca40918e20", "score": "0.43186268", "text": "func (s *Site) AddPageToParent(child, parent string) {\n\ts.mu.Lock()\n\ts.HashMap[parent] = append(s.HashMap[parent], child)\n\ts.mu.Unlock()\n}", "title": "" }, { "docid": "69924428cace243426323ca9e41d952b", "score": "0.43179432", "text": "func (c *Cfg) Add(child *Cfg) *Cfg {\n\tif child.parent != nil {\n\t\tpanic(\"cli: command already has a parent: \" + child.Name)\n\t}\n\tif child.parent = c; c.cmds == nil {\n\t\tc.cmds = make(map[string]*Cfg)\n\t}\n\tfor name, i := child.Name, 0; ; name = name[i+1:] {\n\t\tif i = strings.IndexByte(name, nameSep); i < 0 {\n\t\t\ti = len(name)\n\t\t}\n\t\tif i == 0 {\n\t\t\tpanic(\"cli: missing command name\")\n\t\t}\n\t\tif _, dup := c.cmds[name[:i]]; dup {\n\t\t\tpanic(\"cli: duplicate command name: \" + name[:i])\n\t\t}\n\t\tif c.cmds[name[:i]] = child; i == len(name) {\n\t\t\treturn child\n\t\t}\n\t}\n}", "title": "" }, { "docid": "01aa54732fb8eec1afa0e30924796768", "score": "0.42938522", "text": "func (s *Section) CreateSection() (*Section, error) {\n\tif s.items != nil && len(s.items) > 0 {\n\t\treturn nil, makeError(ErrUnsupportedNestedItem, \"Can't mix nested sections with formatted text in section\")\n\t}\n\titem := &Section{}\n\tif s.sections == nil {\n\t\ts.sections = []*Section{item}\n\t} else {\n\t\ts.sections = append(s.sections, item)\n\t}\n\treturn item, nil\n}", "title": "" }, { "docid": "98266780eb03811d9d962deadeed5abe", "score": "0.428308", "text": "func (tk *Tokens) addRef(token Token) {\n\tif len(tk.Sections) <= tk.SectionIndex {\n\t\tsectionType := []string{TokenSectionPositive, TokenSectionNegative, TokenSectionZero, TokenSectionText}[tk.SectionIndex]\n\t\tfor i := len(tk.Sections) - 1; i < tk.SectionIndex; i++ {\n\t\t\ttk.Sections = append(tk.Sections, Section{Type: sectionType})\n\t\t}\n\t}\n\ttk.Sections[tk.SectionIndex].Items = append(tk.Sections[tk.SectionIndex].Items, token)\n}", "title": "" }, { "docid": "5000d8e055af7a78dbce1bb37c60a5d1", "score": "0.42739198", "text": "func (ss *SectionSlice) Append(s ...*Section) *SectionSlice {\n\t*ss = append(*ss, s...)\n\treturn ss\n}", "title": "" }, { "docid": "8d04d81630e942c4028b5d795d24047b", "score": "0.42692515", "text": "func (m *MvexBox) AddChild(box Box) {\n\n\tswitch box.Type() {\n\tcase \"mehd\":\n\t\tm.Mehd = box.(*MehdBox)\n\tcase \"trex\":\n\t\tif m.Trex == nil {\n\t\t\tm.Trex = box.(*TrexBox)\n\t\t}\n\t\tm.Trexs = append(m.Trexs, box.(*TrexBox))\n\t}\n\tm.Children = append(m.Children, box)\n}", "title": "" }, { "docid": "5a815ba432e005d2b8e1c814c483b725", "score": "0.4258948", "text": "func (s *SegmentChangesWrapper) AddToSegment(segmentName string, keys []string) error {\n\treturn errSegmentStorageNotImplementedMethod\n}", "title": "" }, { "docid": "ea5282022787bb646748bd55fa8c53ad", "score": "0.42572597", "text": "func AppendToFstab(label string, fs string, mountPoint string) error {\n\tfstabEntry := fmt.Sprintf(\"LABEL=%s %s %s defaults 0 1\\n\", label, mountPoint, fs)\n\n\tf, err := os.OpenFile(\"/etc/fstab\", os.O_APPEND|os.O_WRONLY, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer f.Close()\n\n\tif _, err = f.WriteString(fstabEntry); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a944aa97271d7cca10a2582b2ac177b4", "score": "0.42528832", "text": "func (ini *INI) AddSection(name string) *INISection {\n\tsec := &INISection{\n\t\tFields: make(map[string]*INIField),\n\t}\n\tini.Sections[name] = sec\n\tini.Order = append(ini.Order, name)\n\treturn sec\n}", "title": "" }, { "docid": "1726dcfc25b430e9c8ce2971c45d69d9", "score": "0.42426255", "text": "func (buf *Buf) appendNode(bn *BufNode) {\n\tif buf.H == nil {\n\t\tbuf.H = bn\n\t\tbn.Prev = nil\n\t\treturn\n\t}\n\n\tn := buf.H\n\tfor n.Next != nil {\n\t\tn = n.Next\n\t}\n\tn.Next = bn\n\tbn.Prev = n\n}", "title": "" }, { "docid": "1e9dd947ab506a5fd6c4032854d61315", "score": "0.42361918", "text": "func (self *Graphics) AddChild(child *DisplayObject) *DisplayObject{\n return &DisplayObject{self.Object.Call(\"addChild\", child)}\n}", "title": "" }, { "docid": "851918d63b664dba81936161a8aa00b9", "score": "0.42351273", "text": "func (d *Directory) addUnixFSChild(c child) error {\n\tif uio.UseHAMTSharding {\n\t\t// If the directory HAMT implementation is being used and this\n\t\t// directory is actually a basic implementation switch it to HAMT.\n\t\tif basicDir, ok := d.unixfsDir.(*uio.BasicDirectory); ok {\n\t\t\thamtDir, err := basicDir.SwitchToSharding(d.ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\td.unixfsDir = hamtDir\n\t\t}\n\t}\n\n\terr := d.unixfsDir.AddChild(d.ctx, c.Name, c.Node)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1573003cf7ea3fcd789713588c317016", "score": "0.42288586", "text": "func (c *Converter) appendText() {\n\tvar last *Block\n\tif len(c.blocks) > 0 {\n\t\tlast = c.blocks[len(c.blocks)-1]\n\t}\n\n\tif last != nil && last.Type == \"section\" {\n\t\tlast.Text.Text += c.buf.String()\n\t} else {\n\t\tc.blocks = append(c.blocks, &Block{\n\t\t\tType: \"section\",\n\t\t\tText: &Text{\n\t\t\t\tType: textTypeMrkdwn,\n\t\t\t\tText: c.buf.String(),\n\t\t\t},\n\t\t})\n\t}\n\tc.buf.Reset()\n}", "title": "" }, { "docid": "414671e1f24b0dd1867a697341799d98", "score": "0.422552", "text": "func (d *Directory) AddChild(name string, nd ipld.Node) error {\n\td.lock.Lock()\n\tdefer d.lock.Unlock()\n\n\t_, err := d.childUnsync(name)\n\tif err == nil {\n\t\treturn ErrDirExists\n\t}\n\n\terr = d.dagService.Add(d.ctx, nd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = d.addUnixFSChild(child{name, nd})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\td.modTime = time.Now()\n\treturn nil\n}", "title": "" }, { "docid": "d5febd73368fd22978a7ff55df6ff8d9", "score": "0.42215478", "text": "func (wrap *TitleWrap) Append(title *Title) {\n\twrap.Titles = append(wrap.Titles, title)\n}", "title": "" }, { "docid": "09533f79f714a24f585902febfaa81c8", "score": "0.42182934", "text": "func appendChildren(parent element, rslt *result, lines []string, i *int, l int, src *source, opts *Options, f *File) error {\n\tfor *i < l {\n\t\t// Fetch a line.\n\t\tln := newLine(*i+1, lines[*i], opts, f)\n\n\t\t// Check if the line is a child of the parent.\n\t\tok, err := ln.childOf(parent)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif !ok {\n\t\t\treturn nil\n\t\t}\n\n\t\tchild, err := newElement(ln, rslt, src, parent, opts)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tparent.AppendChild(child)\n\n\t\t*i++\n\n\t\tif child.CanHaveChildren() {\n\t\t\tif err := appendChildren(child, rslt, lines, i, l, src, opts, f); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1754b5e491b3ca3f3b3f629d6b692020", "score": "0.42181015", "text": "func (f *Builder) AppendBlockOn(ctx context.Context, parent *types.TipSet) *types.BlockHeader {\n\treturn f.Build(ctx, parent, 1, nil).At(0)\n}", "title": "" }, { "docid": "dd205e28221cb6fc40ee3ffe18c035ce", "score": "0.42118317", "text": "func (self *CircularTrack) Add(child Object) {\n\tself.childs = append(self.childs, child)\n}", "title": "" }, { "docid": "afa361d051fe2cd09e655e673c951ae9", "score": "0.4200646", "text": "func (cfw *CoverageDataWriter) AppendSegment(args map[string]string, visitor CounterVisitor) error {\n\tcfw.stab = &stringtab.Writer{}\n\tcfw.stab.InitWriter()\n\tcfw.stab.Lookup(\"\")\n\n\tvar err error\n\tfor k, v := range args {\n\t\tcfw.stab.Lookup(k)\n\t\tcfw.stab.Lookup(v)\n\t}\n\n\tws := &slicewriter.WriteSeeker{}\n\tif err = cfw.writeSegmentPreamble(args, ws); err != nil {\n\t\treturn err\n\t}\n\tif err = cfw.writeCounters(visitor, ws); err != nil {\n\t\treturn err\n\t}\n\tif err = cfw.patchSegmentHeader(ws); err != nil {\n\t\treturn err\n\t}\n\tif err := cfw.writeBytes(ws.BytesWritten()); err != nil {\n\t\treturn err\n\t}\n\tif err = cfw.writeFooter(); err != nil {\n\t\treturn err\n\t}\n\tif err := cfw.w.Flush(); err != nil {\n\t\treturn fmt.Errorf(\"write error: %v\", err)\n\t}\n\tcfw.stab = nil\n\treturn nil\n}", "title": "" } ]
ce6aade709cb074f09f948070f3b0409
Command executes a shell command.
[ { "docid": "7ca3261b2d542d047a11693c6780391f", "score": "0.7144929", "text": "func Command(command string) *exec.Cmd {\n\treturn exec.Command(\"sh\", \"-c\", command)\n}", "title": "" } ]
[ { "docid": "de73148250b9a625a38313ee36aaf1ee", "score": "0.70053", "text": "func (d *DUT) Command(name string, args ...string) *ssh.Cmd {\n\t// It is fine even if d.hst is nil; subsequent method calls will just fail.\n\treturn d.hst.Command(name, args...)\n}", "title": "" }, { "docid": "da992ff2e2133491d58041567937d887", "score": "0.68964523", "text": "func (i SyncServerImpl) Command(ctx context.Context, input *proto.CommandInput) (*proto.CommandOutput, error) {\n\n\tcmdOutput := proto.CommandOutput{}\n\n\tswitch input.CommandType {\n\tcase proto.CommandType_Shell:\n\t\tcmdOutput.CommandType = proto.CommandType_Shell\n\t\tcmd := exec.Command(\"/bin/sh\", \"-c\", input.Command)\n\t\tout, err := cmd.CombinedOutput()\n\t\tif err != nil {\n\t\t\tcmdOutput.Error = err.Error()\n\t\t}\n\t\tcmdOutput.Response = string(out)\n\t}\n\treturn &cmdOutput, nil\n}", "title": "" }, { "docid": "f6a02912b5fba090043fbdcc812243d0", "score": "0.6837632", "text": "func Command(command string, a ...string) (output string, err error) {\n\tvar out []byte\n\targs := strings.Split(command, \" \")\n\tif len(args) > 1 {\n\t\tcommand = args[0]\n\t\targs = append(args[1:], a...)\n\t} else {\n\t\targs = a\n\t}\n\tout, err = exec.Command(command, args...).Output()\n\n\tif err == nil {\n\t\toutput = string(out)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "11a31ce842fb7ba7dd56489f33ef05ca", "score": "0.6808996", "text": "func (s *ShellTask) Command(ctx context.Context, name string, arg ...string) (*exec.Cmd, error) {\n\tcmd, err := s.command(ctx, name, arg...)\n\tif err != nil {\n\t\tutil.FileLogger().Warnf(\"Failed to create command %s. Error: %s\", name, err.Error())\n\t\treturn nil, err\n\t}\n\tcmd.Env = append(cmd.Env, s.userEnv(ctx, cmd.Dir)...)\n\treturn cmd, nil\n}", "title": "" }, { "docid": "3364747d458eac646590eced115feb2d", "score": "0.677617", "text": "func (agi *AGI) Command(cmd string) (Response, error) {\n\treturn agi.execute(cmd + \"\\n\")\n}", "title": "" }, { "docid": "ce4b1b421ec1fc7ea0dd78769106cdb3", "score": "0.67540735", "text": "func Command(ctx context.Context, name string, arg ...string) *Cmd {\n\tlog.Debugf(\"The standard command '%s %q' will be executed...\", name, arg)\n\tinnerCmd := exec.CommandContext(ctx, name, arg...)\n\treturn &Cmd{Cmd: innerCmd}\n}", "title": "" }, { "docid": "127e861a55e358a06164116803f6e0f8", "score": "0.66934556", "text": "func Command(t *testing.T, command string) {\n\t_, err := exec.LookPath(command)\n\tif err != nil {\n\t\tt.Skipf(\"%s command not found in $PATH\", command)\n\t}\n}", "title": "" }, { "docid": "2e53f26a30d751572f34e8dd6a2f54fd", "score": "0.6625314", "text": "func (b *Batch) Command(cmd string) {\n\tb.call(\"nvim_command\", nil, cmd)\n}", "title": "" }, { "docid": "f3b9218b49bb31f0f1e9a8db3999101c", "score": "0.6608409", "text": "func (r *runner) Command(cmd string, ep *transport.Endpoint, auth transport.AuthMethod) (common.Command, error) {\n\t// auth not allowed since git protocol doesn't support authentication\n\tif auth != nil {\n\t\treturn nil, transport.ErrInvalidAuthMethod\n\t}\n\tc := &command{command: cmd, endpoint: ep}\n\tif err := c.connect(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn c, nil\n}", "title": "" }, { "docid": "28feb1b6dabf05d5977a6290e3ba51b4", "score": "0.66074157", "text": "func (adpt *DockerBinaryAdapter) Command(client *docker.Client) *posix.Cmd {\n\timage := fmt.Sprintf(\"%s:%s\", adpt.Image(), adpt.Tag())\n\n\tcmd := client.Run(image, []string{\n\t\t\"sh\",\n\t\t\"-c\",\n\t\tfmt.Sprintf(\"'cp -av $(which docker) /share/%s'\", adpt.FileName()),\n\t}, docker.RunOption{\n\t\tEntrypoint: (func(str string) *string { return &str })(\"\"),\n\t\tVolume: []string{\n\t\t\tfmt.Sprintf(\"%s:/share\", context.BinaryPath()),\n\t\t},\n\t})\n\n\treturn cmd\n}", "title": "" }, { "docid": "942a5ae69fc06bfc413452d8ccf63d4c", "score": "0.6570432", "text": "func (v *Nvim) Command(cmd string) error {\n\treturn v.call(\"nvim_command\", nil, cmd)\n}", "title": "" }, { "docid": "ce8af2b0674f3ac6ddccf9024bcf88b3", "score": "0.6568941", "text": "func (r *Runner) Command() ([]byte, error) {\n\tvar cmd bytes.Buffer\n\tif err := cmdTemplate.Execute(&cmd, r); err != nil {\n\t\treturn []byte{}, fmt.Errorf(\"failed templating command: %v\", err)\n\t}\n\treturn cmd.Bytes(), nil\n}", "title": "" }, { "docid": "f68d0bee5bb80e58c2c74b7e64dfa232", "score": "0.65654236", "text": "func (c *Cgroup) Command(name string, arg ...string) *Cmd {\n\treturn c.Wrap(exec.Command(name, arg...))\n}", "title": "" }, { "docid": "4687d3f3d86fb1f150bb70e0c0238e13", "score": "0.6513241", "text": "func Command(name string, arg ...string) *exec.Cmd {\n\tcmd := exec.Command(name, arg...)\n\tfixCmd(name, cmd)\n\treturn cmd\n}", "title": "" }, { "docid": "3ba5f2552ae52f5f1b29608996fdd12e", "score": "0.64758277", "text": "func executeCommand(cmd string) (string, error) {\n\targs, err := shellwords.Parse(cmd)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tbuf := new(bytes.Buffer)\n\n\trootCmd.SetOut(buf)\n\trootCmd.SetErr(buf)\n\trootCmd.SetArgs(args)\n\n\tlogger.stderr = rootCmd.ErrOrStderr()\n\n\t_, err = rootCmd.ExecuteC()\n\tresult := buf.String()\n\n\treturn result, err\n}", "title": "" }, { "docid": "09638b1145b5306af1e07e74bc37b109", "score": "0.64631104", "text": "func (r Remote) Command(session string, hostID string, cmd string) (CmdResponse, error) {\n\tres, err := r.impl.Command(context.Background(), &pb.CommandRequest{Session: session,\n\t\tHostId: hostID,\n\t\tCommand: cmd})\n\tif err != nil {\n\t\treturn CmdResponse{}, err\n\t}\n\treturn CmdResponse{Stdout: res.Stdout, Stderr: res.Stderr, ExitCode: int(res.ExitCode)}, nil\n}", "title": "" }, { "docid": "9140864162fc4930e696184d108a23c6", "score": "0.6444968", "text": "func (f *Fs) Command(ctx context.Context, commandName string, args []string,\n\topt map[string]string) (result interface{}, err error) {\n\t// fs.Debugf(f, \"command %v, args: %v, opts:%v\", commandName, args, opt)\n\tswitch commandName {\n\tcase operationRename:\n\t\tif len(args) < 2 {\n\t\t\treturn nil, fmt.Errorf(\"path to object or its new name to rename is empty\")\n\t\t}\n\t\tremote := args[0]\n\t\tnewName := args[1]\n\t\treturn f.rename(ctx, remote, newName)\n\tcase operationListMultiPart:\n\t\treturn f.listMultipartUploadsAll(ctx)\n\tcase operationCleanup:\n\t\tmaxAge := 24 * time.Hour\n\t\tif opt[\"max-age\"] != \"\" {\n\t\t\tmaxAge, err = fs.ParseDuration(opt[\"max-age\"])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"bad max-age: %w\", err)\n\t\t\t}\n\t\t}\n\t\treturn nil, f.cleanUp(ctx, maxAge)\n\tdefault:\n\t\treturn nil, fs.ErrorCommandNotFound\n\t}\n}", "title": "" }, { "docid": "688bb7612a9f7dc46d4493eb948986ae", "score": "0.6444479", "text": "func executeCommand(cmd string) (string, error) {\n\targs, err := shellwords.Parse(cmd)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tbuf := new(bytes.Buffer)\n\n\trootCmd.SetOut(buf)\n\trootCmd.SetErr(buf)\n\trootCmd.SetArgs(args)\n\n\t_, err = rootCmd.ExecuteC()\n\tresult := buf.String()\n\n\treturn result, err\n}", "title": "" }, { "docid": "22a4b6182b64ccd2163bd35ada3a244c", "score": "0.64414734", "text": "func (n *NSDClient) Command(command string) (io.Reader, error) {\n\t//TODO: Currently assumes connection close.\n\t// Should check if connection is available to use\n\terr := n.attemptConnection()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Format and send the command\n\t_, err = fmt.Fprintf(n.Connection, \"%s%d %s\\n\", n.protocol.Prefix, n.protocol.Version, command)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tr := bufio.NewReader(n.Connection)\n\terr = n.peekError(r)\n\treturn r, err\n}", "title": "" }, { "docid": "2270ee373ed7261b54900c96b51baa24", "score": "0.640952", "text": "func RunCommand(input string) (string, error) {\n\targs, err := shellquote.Split(input)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(args) == 0 {\n\t\treturn \"\", errors.New(\"No arguments\")\n\t}\n\tinputCmd := args[0]\n\n\treturn ExecCommand(inputCmd, args[1:]...)\n}", "title": "" }, { "docid": "c47d26fc0e21e7787d793120d0f4eddc", "score": "0.6403575", "text": "func (h OsHelperImpl) RunCommand(executable string, args ...string) (string, error) {\n\tcmd := exec.Command(executable, args...)\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\treturn string(out), err\n\t}\n\treturn string(out), nil\n}", "title": "" }, { "docid": "1dc8f0834baa5b2fb5acefb2625974c8", "score": "0.6399091", "text": "func RunCommand(command string) ([]byte, error) {\n\tcmd := exec.Command(\"bash\", \"-c\", command)\n\treturn cmd.Output()\n}", "title": "" }, { "docid": "3095b4f109fb567cb393dd1bd76ebdbe", "score": "0.639418", "text": "func (p *PaloAlto) Command(command string) (string, error) {\n\tvar output commandOutput\n\tresty.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true})\n\n\tresp, err := resty.R().Get(fmt.Sprintf(\"%s&key=%s&type=op&cmd=%s\", p.URI, p.Key, command))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to run command '%s' - %s\", command, err)\n\t}\n\n\terr = xml.Unmarshal([]byte(resp.String()), &output)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn output.Data, nil\n}", "title": "" }, { "docid": "a8fefeae387e7f7cf70ce5b3918a9b19", "score": "0.6372232", "text": "func Command(name string, arg ...string) *Cmd {\n\treturn &Cmd{\n\t\tCmd: exec.Command(name, arg...),\n\t}\n}", "title": "" }, { "docid": "f12da2a74495d516f0f0e6538bdd09f6", "score": "0.6340801", "text": "func (s srv) Command(ctx context.Context, req *pb.CommandRequest) (*pb.CommandResponse, error) {\n\tlog.Debugf(\"Received cmd request: %+v\", req)\n\tsession, h, err := server.GetHostAndSession(req.Session, req.HostId)\n\tif err != nil {\n\t\tlog.Debugf(\"Cannot get host: %v\", err)\n\t\treturn nil, err\n\t}\n\tresponse, err := h.RunCmd(h.NewCtx(), session, req.Command, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &pb.CommandResponse{Stdout: response.Out,\n\t\tStderr: response.Err,\n\t\tExitCode: int64(response.ExitCode)}, nil\n}", "title": "" }, { "docid": "f3bbcdd3cccb3f91a0c77be8c2a2bab4", "score": "0.6327835", "text": "func (c *Client) RunCommand(cmd string) error {\n\treturn runPassthrough(c.Command(cmd))\n}", "title": "" }, { "docid": "b91665272eec72177599abd2fd8250d3", "score": "0.63240373", "text": "func (cmdExecutorImp) ExecuteCommand(command string, args ...string) ([]byte, error) {\n\t// decoupling exec.Command for easy testability\n\treturn exec.Command(command, args...).CombinedOutput()\n}", "title": "" }, { "docid": "fde928e442e6d86afdba7d070d5f9909", "score": "0.63181907", "text": "func ShellCommand(command string) *exec.Cmd {\n\tshellCommand := []string{\"sh\", \"-c\", strings.TrimSpace(command)}\n\n\treturn exec.Command(shellCommand[0], shellCommand[1:]...)\n}", "title": "" }, { "docid": "c86d0a1893f26e1110739501c4982805", "score": "0.63161486", "text": "func ExampleShell_NewCommand() {\n\t// Creating specific shell\n\tsh := New(\"/bin/bash\", []string{\"-c\"})\n\n\t// Creating a command from specific shell\n\tcmd := sh.NewCommand(\"echo\")\n\t// ...\n\tres, err := cmd.Exec(\"text 1\")\n\t// ...\n\tres, err = cmd.Exec(\"text 2\")\n\t// ...\n\t_, _ = res, err\n}", "title": "" }, { "docid": "bfdc047cb3fcccb927f1a2cdcd8ae037", "score": "0.63152975", "text": "func (c *Client) Command(ctx context.Context, log logrus.FieldLogger, stdout, stderr io.Writer, args ...string) error {\n\terr := c.command(ctx, log, stdout, stderr, &pb.CommandArgs{\n\t\tArgs: args,\n\t})\n\treturn trace.Wrap(err)\n}", "title": "" }, { "docid": "604a5b64cc825b580d6dba1805c6f3b8", "score": "0.6310764", "text": "func (a *App) ExecuteCommand(cmd Command) (string, error) {\n\t// Look for command in PATH or local directory. Also checks for executable permissions\n\tpath, execErr := exec.LookPath(cmd.Executable)\n\tif execErr != nil {\n\t\t// File isn't in PATH, not executable or should have ./ in front of it\n\t\treturn \"\", fmt.Errorf(\"%s\\nuse \\\"./\\\" for local files or provide an absolute path\", execErr)\n\t}\n\n\tvar args []string\n\tif cmd.HasArgs() {\n\t\targs = cmd.Args\n\t}\n\n\tc := exec.Command(path, args...)\n\tstdOut := &bytes.Buffer{}\n\tc.Stdout = stdOut\n\tcmdErr := c.Run()\n\tif cmdErr != nil {\n\t\t// non-zero exit, return the error message (and Stderr if not empty) for display\n\t\tif exitErr, ok := cmdErr.(*exec.ExitError); ok {\n\t\t\tif len(exitErr.Stderr) > 0 {\n\t\t\t\treturn string(exitErr.Stderr), cmdErr\n\t\t\t}\n\t\t\treturn stdOut.String(), cmdErr\n\t\t}\n\t\treturn \"\", cmdErr\n\t}\n\t// Do we want to do something with the output?\n\t//log.Printf(\"%s successful, output: %s\", cmd.Executable, stdOut.String())\n\treturn stdOut.String(), nil\n}", "title": "" }, { "docid": "83251ca1ca7f688ad1de636444b5f2bb", "score": "0.63071907", "text": "func Command(cmd string, args ...string) *osexec.Cmd {\n\treturn Builder.Command(cmd, args...)\n}", "title": "" }, { "docid": "f2267e83625906b40743776d79372578", "score": "0.63069785", "text": "func RunCommand(conn *ssh.Client, cmd string) (string, error) {\n\tsess, err := conn.NewSession()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer sess.Close()\n\n\tsessStdOut, err := sess.StdoutPipe()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to connect stdout pipi\")\n\t}\n\n\tsessStderr, err := sess.StderrPipe()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to connect stderr pipe\")\n\t}\n\n\tif err = sess.Run(cmd); err != nil {\n\t\treturn \"\", errors.Wrapf(err, \"failed to run the command: %s\", cmd)\n\t}\n\n\tstringOut, err := readerToString(sessStdOut)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to read the stdout\")\n\t}\n\n\tstringErr, err := readerToString(sessStderr)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to read the stderr\")\n\t}\n\n\tif len(stringErr) > 0 {\n\t\treturn \"\", errors.Errorf(\"The command returned with the following error: %s\", stringErr)\n\t}\n\n\treturn stringOut, nil\n}", "title": "" }, { "docid": "4b5b09f0d3c099b431a1736f4a9a6bed", "score": "0.6293952", "text": "func (c *Client) RunCommand(cmd string, converter Converter) ([]byte, error) {\n\tlog.V(4).Info(\"running haproxy command\", \"command\", cmd)\n\tbuffer, err := c.runCommandWithRetries(cmd, maxRetries)\n\tif err != nil {\n\t\tlog.V(0).Info(\"haproxy dynamic config API command failed\", \"command\", cmd, \"error\", err)\n\t\treturn nil, err\n\t}\n\n\tresponse := buffer.Bytes()\n\tlog.V(4).Info(\"haproxy command returned\", \"response\", string(response))\n\tif converter == nil {\n\t\treturn response, nil\n\t}\n\n\treturn converter.Convert(response)\n}", "title": "" }, { "docid": "c55f19d20a7a7acc7755050a38adfb21", "score": "0.6276322", "text": "func (l *Launcher) Command(name string, arg ...string) *exec.Cmd {\n\tbin := \"\"\n\tfunc() {\n\t\tdefer LockPort(l.Lock)()\n\t\tbin = GetLeaklessBin()\n\t}()\n\n\tuid := fmt.Sprintf(\"%x\", utils.RandBytes(16))\n\taddr := l.serve(uid)\n\n\targ = append([]string{uid, addr, name}, arg...)\n\treturn exec.Command(bin, arg...)\n}", "title": "" }, { "docid": "e31449ee338eef38fbcceadc54c786d2", "score": "0.6271094", "text": "func (e *ShellExecutor) RunCommand(shellCommand string) error {\n\targs := []string{}\n\tfor _, arg := range e.args {\n\t\targs = append(args, arg)\n\t}\n\targs = append(args, shellCommand)\n\tcommand := exec.Command(e.shell, args...)\n\tcommand.Stdin = e.in\n\tcommand.Stdout = e.out\n\tcommand.Stderr = e.err\n\treturn command.Run()\n}", "title": "" }, { "docid": "d1b6214f15276a9000a9bd5ef978dea7", "score": "0.62629235", "text": "func Command(name string, args ...string) *Cmd {\n\treturn &Cmd{\n\t\tCmd: exec.Command(name, args...),\n\t}\n}", "title": "" }, { "docid": "d34c60cda0dc5c4efd3cecb7e918f3c3", "score": "0.62569183", "text": "func (r *Runnable) RunCommand(args []string, env []string) error {\n\targs = append([]string{\"-c\", r.Command, \"sh\"}, args...)\n\tcmd := exec.Command(\"sh\", args...)\n\tcmd.Env = append(os.Environ(), env...)\n\tcmd.Stdin = os.Stdin\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\treturn r.runInternal(cmd)\n}", "title": "" }, { "docid": "55581e19f29e9ebbfe86fe007155cc77", "score": "0.6249583", "text": "func (c *Client) Command(cmd string, expectCode int) (int, string, error) {\n\terr := c.conn.PrintfLine(cmd)\n\tif err != nil {\n\t\treturn 0, \"\", err\n\t}\n\treturn c.conn.ReadCodeLine(expectCode)\n}", "title": "" }, { "docid": "cac4aad75ecda1624482c0444ca9247e", "score": "0.6239003", "text": "func (r *Receiver) Command(what string, when ...session.TStep) *tReger {\n\treturn r.makeRegistrator().Command(what, when...)\n}", "title": "" }, { "docid": "8842324e2033f47996d9b4ee4db6d94e", "score": "0.6232081", "text": "func RunCommand(command string, args ...string) {\n\tcmd := exec.Command(command, args...)\n\tcmdReader, err := cmd.StderrPipe()\n\tCatch(err, \"An error occurred while setting up stderr pipeline\", false)\n\n\tscanner := bufio.NewScanner(cmdReader)\n\tgo func() {\n\t\tfor scanner.Scan() {\n\t\t\tfmt.Printf(\"\\t gopack > %s\\n\", scanner.Text())\n\t\t}\n\t}()\n\n\tCatch(cmd.Start(), \"An error occurred in command start\", true)\n\tCatch(cmd.Wait(), \"An error occurred in command wait\", true)\n}", "title": "" }, { "docid": "b29d47cdb0559a66fbd6ec380bc23e9a", "score": "0.6219012", "text": "func (*command) Run(command string) ([]byte, error) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", command)\n\toutput, err := cmd.CombinedOutput()\n\n\tif err != nil {\n\t\tlog.Info(string(output))\n\t\tlog.Info(err)\n\t\treturn output, err\n\t}\n\n\treturn output, nil\n}", "title": "" }, { "docid": "cf15cdccc9bfb19fb63724211aba9b5c", "score": "0.62154543", "text": "func Command(bin string, argv []string, baseDir string) ([]byte, error) {\n\tcmd := exec.Command(bin, argv...)\n\tif baseDir != \"\" {\n\t\tcmd.Dir = baseDir\n\t}\n\tvar stdout bytes.Buffer\n\tvar stderr bytes.Buffer\n\tcmd.Stdout = &stdout\n\tcmd.Stderr = &stderr\n\terr := cmd.Run()\n\tif err != nil {\n\t\treturn stdout.Bytes(), fmt.Errorf(\"%s: %s\", err, stderr.Bytes())\n\t}\n\treturn stdout.Bytes(), nil\n}", "title": "" }, { "docid": "1af30613bc3bc021134d3b1e38b179ee", "score": "0.61995584", "text": "func RunCommand(cmd *exec.Cmd) (bytes.Buffer){\n\tvar out bytes.Buffer\n\tcmd.Stdout = &out\n\terr := cmd.Run()\n\n\tif err != nil{\n\t\tlog.Fatal(err)\n\t}\n\treturn out\n}", "title": "" }, { "docid": "79f94bd860de00dc05f3e8a79415ee6f", "score": "0.6197659", "text": "func Command(args ...string) *Cmd {\n\tcmd := reexec.Command(args...)\n\treturn &Cmd{\n\t\tCmd: cmd,\n\t}\n}", "title": "" }, { "docid": "3cdf0aead527d605cc1e7442b7bdf08f", "score": "0.6196141", "text": "func Command(command string, args ...string) Cmd {\n\treturn Cmd{Command: append([]string{command}, args...)}\n}", "title": "" }, { "docid": "c68c021eb1476fcf4ab7353b27ff2779", "score": "0.61950606", "text": "func (hc *HSJRFIDClient) Command(payload string) (string, error) {\n\treturn \"\", nil\n}", "title": "" }, { "docid": "d3c93f26a1dc47805dffef5a2a85314c", "score": "0.6194849", "text": "func runCommand() {\n\targs := flag.Args()\n\tif len(args) == 0 {\n\t\tdie(errors.New(\"Must supply a command\"))\n\t}\n\tcmdStr := strings.Join(args, \" \")\n\n\twin.Addr(\",\")\n\twin.Write(\"data\", nil)\n\twin.Ctl(\"clean\")\n\twin.Fprintf(\"body\", \"$ %s\\n\", cmdStr)\n\n\tcmd := exec.Command(args[0], args[1:]...)\n\tr, w, err := os.Pipe()\n\tif err != nil {\n\t\tdie(err)\n\t}\n\tdefer r.Close()\n\tcmd.Stdout = w\n\tcmd.Stderr = w\n\n\tif err := cmd.Start(); err != nil {\n\t\twin.Fprintf(\"body\", \"%s: %s\\n\", cmdStr, err)\n\t\treturn\n\t}\n\tw.Close()\n\tio.Copy(BodyWriter{win}, r)\n\tif err := cmd.Wait(); err != nil {\n\t\twin.Fprintf(\"body\", \"%s: %s\\n\", cmdStr, err)\n\t}\n\n\twin.Fprintf(\"body\", \"%s\\n\", time.Now())\n\twin.Fprintf(\"addr\", \"#0\")\n\twin.Ctl(\"dot=addr\")\n\twin.Ctl(\"show\")\n\twin.Ctl(\"clean\")\n}", "title": "" }, { "docid": "d73c710825eb531c2f0126126ec80281", "score": "0.61785233", "text": "func Command(name string, arg ...string) *Cmd {\n\tc := new(Cmd)\n\n\tc.OutputPrefix = \"\"\n\tc.ShowOutput = false\n\tc.DropEmptyLines = true\n\n\tc.InputChan = nil\n\tc.OutputChan = nil\n\n\tc.Cmd = exec.Command(name, arg...)\n\n\treturn c\n}", "title": "" }, { "docid": "0e6e5280e37e763d65a618382ce2a6aa", "score": "0.61726457", "text": "func Command(ctx context.Context, arg ...string) *Cmd {\n\treturn &Cmd{\n\t\tctx: ctx,\n\t\targs: arg,\n\t}\n}", "title": "" }, { "docid": "53e162c85ff6ca6f4f78ef81c66cea63", "score": "0.6170471", "text": "func shellCommand(name string, args ...string) ShellCmd {\n\tcmd := exec.Command(name, args...)\n\toutpipe, _ := cmd.StdoutPipe()\n\terrpipe, _ := cmd.StderrPipe()\n\toutreader := bufio.NewReader(outpipe)\n\terrreader := bufio.NewReader(errpipe)\n\n\treturn ShellCmd{cmd, outreader, errreader, nil}\n}", "title": "" }, { "docid": "eb958e245d31bdd9b5a62467be75a794", "score": "0.61600304", "text": "func executeShellCommand(command string) error {\n\tlog.Debugf(\"[iptables] %s\", command)\n\tcmd := exec.Command(\"sh\", \"-c\", command)\n\terr := cmd.Start()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn cmd.Wait()\n}", "title": "" }, { "docid": "f512841ce659e2418c4e77f150470e41", "score": "0.6134005", "text": "func (db *Database) Command(cmd string, args ...interface{}) *ResultSet {\n\trs := newResultSet(cmd)\n\tif db.dbClosed {\n\t\trs.err = &DatabaseClosedError{db}\n\t\treturn rs\n\t}\n\turp, err := db.pullURP()\n\tdefer db.pushURP(urp)\n\tif err != nil {\n\t\trs.err = err\n\t\treturn rs\n\t}\n\turp.command(rs, false, cmd, args...)\n\treturn rs\n}", "title": "" }, { "docid": "2368dd4775f30d3e5eb8ff1d03e61be9", "score": "0.6133609", "text": "func (r Retriever) Command(cmd, repo string) error {\n\tswitch cmd {\n\tcase \"get\":\n\t\tif repo == \"\" {\n\t\t\treturn errors.New(\"repo is not specified\")\n\t\t}\n\t\tif _, resource, _ := gop.ProcessRepo(repo); resource != \"\" {\n\t\t\t_, _, err := r.Retrieve(repo)\n\t\t\treturn err\n\t\t} else {\n\t\t\treturn r.Get(repo)\n\t\t}\n\tcase \"update\":\n\t\tif repo == \"\" {\n\t\t\treturn r.UpdateAll()\n\t\t} else {\n\t\t\treturn r.Update(repo)\n\t\t}\n\tcase \"init\":\n\t\treturn r.Init()\n\t}\n\treturn r.Update(repo)\n}", "title": "" }, { "docid": "fb4dacb5b95e3abfb011ca50b17147a4", "score": "0.6132362", "text": "func (rmc *RmClient) RunCommand(cmd string) ([]string, error) {\n\n\tlog.Println(\"Running command\")\n\n\toutput := new(strings.Builder)\n\n\tsess, err := rmc.Connection.NewSession()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer sess.Close()\n\n\tsessStdOut, err := sess.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t//go io.Copy(os.Stdout, sessStdOut)\n\tgo io.Copy(output, sessStdOut)\n\tsessStderr, err := sess.StderrPipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t//go io.Copy(os.Stderr, sessStderr)\n\tgo io.Copy(output, sessStderr)\n\n\t//log.Printf(\"Executing: %s\", cmd)\n\terr = sess.Run(cmd)\n\ttime.Sleep(1 * time.Second)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toutRaw := strings.Split(output.String(), \"\\n\")\n\tout := []string{}\n\n\tfor _, line := range outRaw {\n\t\tif len(line) > 0 {\n\t\t\tout = append(out, line)\n\t\t}\n\t}\n\n\treturn out, nil\n}", "title": "" }, { "docid": "e2183f7cc78d08c3bc1cc42fa3768f6a", "score": "0.61319804", "text": "func (c *Cmd) Command() *exec.Cmd {\n\tc.ensureCmd()\n\treturn c.runtimeCmd\n}", "title": "" }, { "docid": "26d7e74580a49071fd7a898703cce3ef", "score": "0.612487", "text": "func ExecCommand(cmd string) (string, error) {\n\tsubstring := strings.Fields(cmd)\n\tname := substring[0]\n\targs := substring[1:]\n\tout, err := exec.Command(name, args...).CombinedOutput()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"exec failed %s %v\", cmd, err)\n\t}\n\treturn string(out), err\n}", "title": "" }, { "docid": "36126683548226aa6448076a6171ba4f", "score": "0.61216736", "text": "func Command(name string, args ...string) *Cmd {\n\treturn New(exec.Command(name, args...))\n}", "title": "" }, { "docid": "bb6956f2aa0c5a9a93fe51cbf7c716c3", "score": "0.6119834", "text": "func ExampleNewCommand() {\n\t// Creating a command from default shell\n\tcmd := NewCommand(\"echo\")\n\t// ...\n\tres, err := cmd.Exec(\"text 1\")\n\t// ...\n\tres, err = cmd.Exec(\"text 2\")\n\t// ...\n\t_, _ = res, err\n}", "title": "" }, { "docid": "cc160677f0aec1744565a2d26bc63af3", "score": "0.61186296", "text": "func shellCommand(args []string) *exec.Cmd {\n\tshell := os.Getenv(\"SHELL\")\n\n\tswitch filepath.Base(shell) {\n\tcase \"bash\", \"zsh\":\n\t\targs = append([]string{\"-i\", \"-c\"}, args...)\n\tdefault:\n\t\treturn nil\n\t}\n\n\treturn exec.Command(shell, args...)\n}", "title": "" }, { "docid": "86a93c5976c3fd5fdcb3425d098e1526", "score": "0.61047417", "text": "func ExecCommand(command string) *exec.Cmd {\n\tshell := os.Getenv(\"SHELL\")\n\tif len(shell) == 0 {\n\t\tshell = \"sh\"\n\t}\n\treturn exec.Command(shell, \"-c\", command)\n}", "title": "" }, { "docid": "af493c384153fd4086ebe228f4f99c7e", "score": "0.6103073", "text": "func GitCommand(serviceDir string, command string) (result string, err error) {\n out, err := exec.Command(\n \"sh\", \n \"-c\", \n\t\t\"( cd \" + serviceDir + \" && \" + command + \")\" ).Output()\n\t\n\treturn string(out), err\n}", "title": "" }, { "docid": "afa9403e79e93859ff80caf8a6f7921f", "score": "0.60896087", "text": "func RunCommand(consumer *state.Consumer, cmdTokens []string) (int, error) {\n\tconsumer.Infof(\"→ Running command:\")\n\tconsumer.Infof(\" %s\", strings.Join(cmdTokens, \" ::: \"))\n\n\tcmd := exec.Command(cmdTokens[0], cmdTokens[1:]...)\n\tcmd.Stdout = loggerwriter.New(consumer, \"out\")\n\tcmd.Stderr = loggerwriter.New(consumer, \"err\")\n\n\terr := cmd.Run()\n\tif err != nil {\n\t\tif exitError, ok := err.(*exec.ExitError); ok {\n\t\t\tif status, ok := exitError.Sys().(syscall.WaitStatus); ok {\n\t\t\t\treturn status.ExitStatus(), nil\n\t\t\t}\n\t\t}\n\n\t\treturn 127, err\n\t}\n\n\treturn 0, nil\n}", "title": "" }, { "docid": "4a4c0f1b99156d49c6feccae1a5bc709", "score": "0.60891837", "text": "func (fake *FakeExec) Command(cmd string, args ...string) exec.Cmd {\n\tif fake.DisableScripts {\n\t\tfakeCmd := &FakeCmd{DisableScripts: true}\n\t\treturn InitFakeCmd(fakeCmd, cmd, args...)\n\t}\n\tfakeCmd := fake.nextCommand(cmd, args)\n\tif fake.ExactOrder {\n\t\targv := append([]string{cmd}, args...)\n\t\tfc := fakeCmd.(*FakeCmd)\n\t\tif cmd != fc.Argv[0] {\n\t\t\tpanic(fmt.Sprintf(\"received command: %s, expected: %s\", cmd, fc.Argv[0]))\n\t\t}\n\t\tif len(argv) != len(fc.Argv) {\n\t\t\tpanic(fmt.Sprintf(\"command (%s) received with extra/missing arguments. Expected %v, Received %v\", cmd, fc.Argv, argv))\n\t\t}\n\t\tfor i, a := range argv[1:] {\n\t\t\tif a != fc.Argv[i+1] {\n\t\t\t\tpanic(fmt.Sprintf(\"command (%s) called with unexpected argument. Expected %s, Received %s\", cmd, fc.Argv[i+1], a))\n\t\t\t}\n\t\t}\n\t}\n\treturn fakeCmd\n}", "title": "" }, { "docid": "c7370f997ff53fb8c7070c1b4075882e", "score": "0.6083224", "text": "func RunCommand(c string) (*exec.Cmd, error) {\n\targs := regexp.MustCompile(\" +\").Split(c, -1)\n\tcmd := exec.Command(args[0], args[1:]...)\n\terr := cmd.Start()\n\tif err != nil {\n\t\treturn cmd, err\n\t}\n\tgo func() {\n\t\tcmd.Wait()\n\t}()\n\treturn cmd, nil\n}", "title": "" }, { "docid": "301984a3d8978792ea37b7ce66930fef", "score": "0.6082333", "text": "func Command(cmd []string) {\n\tswitch cmd[0] {\n\tcase \"serve\":\n\t\tserve()\n\t\tbreak\n\tcase \"test\":\n\t\tfmt.Println(\"test\")\n\t\tbreak\n\t}\n}", "title": "" }, { "docid": "9801eac9247a9b0a207eb7046c98bfea", "score": "0.60821545", "text": "func (s *MockSSHClient) RunCommand(cmd string) (string, error) {\n\tif s.MockRunCommand != nil {\n\t\treturn s.MockRunCommand(cmd)\n\t}\n\treturn \"\", nil\n}", "title": "" }, { "docid": "b2e9f7eeda24e8ae78cf7de3d74d249a", "score": "0.60734093", "text": "func (g *Gateway) command(cmd string, data map[string]interface{}) error {\n\treturn g.commandWithSid(cmd, data, g.deviceID)\n}", "title": "" }, { "docid": "f9a945889074bdfae154ec671ed0526a", "score": "0.6070276", "text": "func (l *localMachine) RunCommand(cmd string, args ...string) (string, error) {\n\tc := exec.Command(cmd, args...)\n\tout, err := c.CombinedOutput()\n\treturn string(out), err\n}", "title": "" }, { "docid": "8cb9756e4250cfd7ce7472f90980e21c", "score": "0.60659105", "text": "func executeCommand(\n\toutputChannel chan string,\n\terrorChannel chan error,\n\tbinary string,\n\targuments ...string) {\n\n\t// Run the command\n\tout, err := exec.Command(binary, arguments...).Output()\n\n\t// Pipe to respective channels\n\tif err != nil {\n\t\terrorChannel <- err\n\t} else {\n\t\toutputChannel <- fmt.Sprintf(\"%s\", out)\n\t}\n}", "title": "" }, { "docid": "5fa52e4c8f82bf46f67675c7e13d97e7", "score": "0.60588807", "text": "func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[string]string) (out interface{}, err error) {\n\tswitch name {\n\tcase \"decode\":\n\t\tout := make([]string, 0, len(arg))\n\t\tfor _, encryptedFileName := range arg {\n\t\t\tfileName, err := f.DecryptFileName(encryptedFileName)\n\t\t\tif err != nil {\n\t\t\t\treturn out, fmt.Errorf(\"failed to decrypt: %s: %w\", encryptedFileName, err)\n\t\t\t}\n\t\t\tout = append(out, fileName)\n\t\t}\n\t\treturn out, nil\n\tcase \"encode\":\n\t\tout := make([]string, 0, len(arg))\n\t\tfor _, fileName := range arg {\n\t\t\tencryptedFileName := f.EncryptFileName(fileName)\n\t\t\tout = append(out, encryptedFileName)\n\t\t}\n\t\treturn out, nil\n\tdefault:\n\t\treturn nil, fs.ErrorCommandNotFound\n\t}\n}", "title": "" }, { "docid": "0dea4725507592166164c8be8d78ead3", "score": "0.604367", "text": "func Command(t testing.TB, name string, args ...string) *exec.Cmd {\n\tt.Helper()\n\treturn CommandContext(t, context.Background(), name, args...)\n}", "title": "" }, { "docid": "da9ffae0b5b245944163fc1ce23cd8a9", "score": "0.60398614", "text": "func (ins *Instance) RunCommand(cmd string) ssh.Result {\n\tif ins.ExternalIP == \"\" {\n\t\tins.populateExternalIP()\n\t}\n\treturn ssh.Run(cmd, ins.ExternalIP, ins.SshUser, ins.SshKey)\n}", "title": "" }, { "docid": "49a84a5531dc7c5b34562225f5b96e4a", "score": "0.6039473", "text": "func RunCommand(cmd string) error {\n\tsubstring := strings.Fields(cmd)\n\tname := substring[0]\n\targs := substring[1:]\n\terr := exec.Command(name, args...).Run()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"run failed %s %v\", cmd, err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "c57da077a3f48244a51451f90d7ea661", "score": "0.6039463", "text": "func (a *App) executeCommand(c *Command, args []string) error {\n\tif c.Handler == nil {\n\t\treturn fmt.Errorf(\"%v does not have a handler.\", c.Name)\n\t}\n\treturn c.Handler(a, args)\n}", "title": "" }, { "docid": "2c13531f4648bd765765295c52471879", "score": "0.603475", "text": "func Command(arguments ...string) *Cmd {\n\tres := new(Cmd)\n\tres.Arguments = arguments\n\tres.Stdout = NullLog\n\tres.Stderr = NullLog\n\treturn res\n}", "title": "" }, { "docid": "cf108e9efbfbd97dcc4d9861d7d5ecb0", "score": "0.60305417", "text": "func (c Cli) command(dir string, params ...string) *exec.Cmd {\n\tcmd := exec.Command(c.cmd, params...)\n\tcmd.Dir = dir\n\n\treturn cmd\n}", "title": "" }, { "docid": "dd73cac5ab68ed1eac8941ba22a4a8e1", "score": "0.60098314", "text": "func Command(args []string) {\n\tcore, err := tools.MakeCoreInHomeDirectory()\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %s\\n\", err)\n\t}\n\n\tctx := context.Background()\n\terr = core.Run(ctx, args)\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %s\\n\", err)\n\t}\n}", "title": "" }, { "docid": "42d2d2902d6ec14c22887b7d5f3b7ee2", "score": "0.600055", "text": "func RunCommand(cmd *Command, def *Definition, in *Input, env []string, out *Output) error {\n\tif cmd.Configure != nil {\n\t\tcmd.Configure(def)\n\t}\n\n\terr := MapInput(def, in, env)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn cmd.Execute(in, out)\n}", "title": "" }, { "docid": "eaef4b954842b7edcf2b849427f8eb82", "score": "0.59973097", "text": "func (c *Client) RunCommand(path string) ([]byte, error) {\n\tvar client http.Client\n\n\thost := c.apiHost\n\tif !strings.HasPrefix(\"host\", \"http\") {\n\t\thost = \"http://\" + host\n\t}\n\n\treq, err := http.NewRequest(\"GET\", host+path, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Add(\"Authorization\", \"Basic \"+basicAuth(c.apiUsername, c.apiPassword))\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn body, nil\n}", "title": "" }, { "docid": "509d32311e7f0e26280a56fc7936c589", "score": "0.59884435", "text": "func RunCommand(command string, args ...string) *Result {\n\treturn RunCmd(Command(command, args...))\n}", "title": "" }, { "docid": "6917edc327d2b00d9e203f5d692c36bc", "score": "0.5980349", "text": "func runCommand(ctx context.Context, logger *Logger, command command) error {\n\tif len(command.Commands) == 0 {\n\t\treturn ErrIllegalCommand\n\t}\n\n\tfound := false\n\tfor _, candidate := range allowedCommands {\n\t\tif command.Commands[0] == candidate {\n\t\t\tfound = true\n\t\t}\n\t}\n\tif !found {\n\t\treturn ErrIllegalCommand\n\t}\n\n\tcmd := exec.CommandContext(ctx, command.Commands[0], command.Commands[1:]...)\n\tcmd.Dir = command.Dir\n\tcmd.Env = command.Env\n\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstderr, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog15.Info(fmt.Sprintf(\"Running command: %s\", strings.Join(command.Commands, \" \")))\n\n\twg := wgWrap(func() {\n\t\tlogger.RecordCommand(command.Commands, stdout, stderr)\n\t})\n\n\tif err := cmd.Start(); err != nil {\n\t\treturn err\n\t}\n\n\twg.Wait()\n\n\tif err := cmd.Wait(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a850a8e6ef972a7a7e7313d29ec0a1e2", "score": "0.59800833", "text": "func (c *Client) Command(ctx context.Context, id, command, user, key, password string, timeoutSec int) (string, error) {\n\tform := url.Values{\"command\": {command}, \"user\": {user}}\n\tif len(key) > 0 {\n\t\tform.Add(\"key\", key)\n\t}\n\tif len(password) > 0 {\n\t\tform.Add(\"password\", password)\n\t}\n\tif timeoutSec > 0 {\n\t\tform.Add(\"timeout\", strconv.Itoa(timeoutSec))\n\t}\n\tbody := strings.NewReader(form.Encode())\n\tresp, err := c.request(ctx, http.MethodPost, c.endpoint+nodesResource+\"/\"+id+\"/command\", body, http.StatusOK)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer c.safeClose(resp.Body)\n\tresult, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to read response: %v\", err)\n\t}\n\treturn string(result), nil\n}", "title": "" }, { "docid": "d86e65ece13b29c3b5244b78e162a6bd", "score": "0.5979833", "text": "func runCommand(cmd ...string) (string, error) {\n\treturn runCommandInDir(\"\", cmd)\n}", "title": "" }, { "docid": "f4a1241d2474713bfadf8b02c3466170", "score": "0.5976814", "text": "func execCommand(command string, args []string, dir string, env []string) error {\n\tcmd := exec.Command(command, args...)\n\tcmd.Env = append(os.Environ(), env...)\n\tcmd.Dir = dir\n\tcmd.Stdin = os.Stdin\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stdout\n\tcolor.Cyan(\"\\nExecuting command:\\n\")\n\tfmt.Println(cmd.String())\n\tfmt.Println()\n\treturn cmd.Run()\n}", "title": "" }, { "docid": "8d27582937fc4dbf033712d3a93828ca", "score": "0.5970269", "text": "func (q QuteBrowserInstance) ExecuteCommand(command []byte) {\n\tq.pipe.Write(command)\n}", "title": "" }, { "docid": "21e155b345dbd621c6d9b4376d9a47de", "score": "0.59676903", "text": "func RunCommand(command string, args []string) {\n\n\tcmd := exec.Command(command, args...)\n\tlog.Println(\"Executing: \", cmd)\n\n\t//create a pipe for the output of the script\n\tcmdReader, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\tlog.Fatal(\"Error creating StdoutPipe\", err)\n\t}\n\n\t//tail the output of the command\n\tscanner := bufio.NewScanner(cmdReader)\n\tgo func() {\n\t\tfor scanner.Scan() {\n\t\t\tfmt.Printf(\"\\t > %s\\n\", scanner.Text())\n\t\t}\n\t}()\n\n\t//start and wait for the command to finish\n\tif err := cmd.Start(); err != nil {\n\t\tlog.Fatal(\"Error starting command\", err)\n\t}\n\n\tif err := cmd.Wait(); err != nil {\n\t\tlog.Fatal(\"Error waiting for command\", err)\n\t}\n}", "title": "" }, { "docid": "015a0131943495c620a34c7a1fd7cd1d", "score": "0.596593", "text": "func ExecCommand(command string, args ...interface{}) (string, string, error) {\n\n\tfmtCommand := fmt.Sprintf(command, args...)\n\n\tsplitCommand := strings.Split(fmtCommand, \" \")\n\n\tlogger.Info(\"Executing command :: %s :: with args :: %v => %s\", command, args, fmtCommand)\n\n\tcmdName := splitCommand[0]\n\tcmdArgs := splitCommand[1:len(splitCommand)]\n\n\tcmd := exec.Command(cmdName, cmdArgs...)\n\n\tvar stdout bytes.Buffer\n\tcmd.Stdout = &stdout\n\n\tvar stderr bytes.Buffer\n\tcmd.Stderr = &stderr\n\n\terr := cmd.Run()\n\n\treturn stdout.String(), stderr.String(), err\n}", "title": "" }, { "docid": "d78ccf656ca7ddb0bcac03b344b30547", "score": "0.59638524", "text": "func runCommand(t testing.TestingT, command Command) (*output, error) {\n\tcommand.Logger.Logf(t, \"Running command %s with args %s\", command.Command, command.Args)\n\n\tcmd := exec.Command(command.Command, command.Args...)\n\tcmd.Dir = command.WorkingDir\n\tcmd.Stdin = os.Stdin\n\tcmd.Env = formatEnvVars(command)\n\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstderr, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = cmd.Start()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toutput, err := readStdoutAndStderr(t, command.Logger, stdout, stderr)\n\tif err != nil {\n\t\treturn output, err\n\t}\n\n\treturn output, cmd.Wait()\n}", "title": "" }, { "docid": "7c7190d26da635737b36372eb6b7ec4e", "score": "0.59563255", "text": "func (mc *MultiCommand) Command(cmd string, args ...interface{}) {\n\trs := newResultSet(cmd)\n\tmc.rs.resultSets = append(mc.rs.resultSets, rs)\n\tmc.urp.command(rs, false, cmd, args...)\n}", "title": "" }, { "docid": "6c9d984abf390a4ee62c009721dc0ee5", "score": "0.59530926", "text": "func ExecCommand(name string, arg ...string) (string, error) {\n\tvar err error\n\tcmd := exec.Command(name, arg...)\n\toutputBytes := &bytes.Buffer{}\n\tcmd.Stdout = outputBytes\n\tcmd.Stderr = outputBytes\n\terr = cmd.Start()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\terr = cmd.Wait() // wait for command to finish\n\toutstring := outputBytes.String()\n\treturn outstring, err\n}", "title": "" }, { "docid": "35a1b3026f0198896f7097d4e320f45e", "score": "0.59530157", "text": "func (s *SSH) RunCommand(n node.Node, command string, options node.ConnectionOpts) (string, error) {\n\tt := func() (interface{}, bool, error) {\n\t\toutput, err := s.doCmd(n, options, command, options.IgnoreError)\n\t\tif err != nil {\n\t\t\treturn \"\", true, &node.ErrFailedToRunCommand{\n\t\t\t\tAddr: n.Name,\n\t\t\t\tCause: fmt.Sprintf(\"unable to run cmd (%v): %v\", command, err),\n\t\t\t}\n\t\t}\n\t\treturn output, false, nil\n\t}\n\n\toutput, err := task.DoRetryWithTimeout(t, options.Timeout, options.TimeBeforeRetry)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn output.(string), nil\n}", "title": "" }, { "docid": "df9fad970a49242ea72c2379fef49cee", "score": "0.5943107", "text": "func (c *Client) Command(remoteCmd string) *exec.Cmd {\n\targs := c.sshArgs()\n\targs = append(args, c.targetHost())\n\tif remoteCmd != \"\" {\n\t\targs = append(args, remoteCmd)\n\t}\n\tcmd := exec.Command(\"ssh\", args...)\n\tc.addEnvironment(cmd)\n\treturn cmd\n}", "title": "" }, { "docid": "ad8547cd31f3022acd63b40214ccf9db", "score": "0.5934161", "text": "func (client *SSHClient) RunCommand(cmd *SSHCommand) error {\n\tsession, err := client.newSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer session.Close()\n\n\t_, err = runCommand(session, cmd)\n\treturn err\n}", "title": "" }, { "docid": "54e5de2edbacad3e7190a72ae1276c8c", "score": "0.59281415", "text": "func Command(prompter string, remote *url.URL, command string) (*exec.Cmd, error) {\n\t// Validate the URL protocol.\n\tif remote.Protocol != url.Protocol_SSH {\n\t\treturn nil, errors.New(\"non-SSH URL provided\")\n\t}\n\n\t// Locate the SSH command.\n\tssh, err := sshCommand()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to identify SSH executable\")\n\t}\n\n\t// Compute the target.\n\ttarget := remote.Hostname\n\tif remote.Username != \"\" {\n\t\ttarget = fmt.Sprintf(\"%s@%s\", remote.Username, remote.Hostname)\n\t}\n\n\t// Set up arguments. We intentionally don't use compression on SSH commands\n\t// since the agent stream uses the FLATE algorithm internally and it's much\n\t// more efficient to compress at that layer, even with the slower Go\n\t// implementation.\n\tvar sshArguments []string\n\tsshArguments = append(sshArguments, timeoutArgument())\n\tif remote.Port != 0 {\n\t\tsshArguments = append(sshArguments, \"-p\", fmt.Sprintf(\"%d\", remote.Port))\n\t}\n\tsshArguments = append(sshArguments, target, command)\n\n\t// Create the process.\n\tsshProcess := exec.Command(ssh, sshArguments...)\n\n\t// Force it to run detached.\n\tsshProcess.SysProcAttr = processAttributes()\n\n\t// Create a copy of the current environment.\n\tenvironment := os.Environ()\n\n\t// Add locale environment variables.\n\tenvironment = addLocaleVariables(environment)\n\n\t// Set prompting environment variables\n\tenvironment, err = setPrompterVariables(environment, prompter)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to create prompter environment\")\n\t}\n\n\t// Set the environment.\n\tsshProcess.Env = environment\n\n\t// Done.\n\treturn sshProcess, nil\n}", "title": "" }, { "docid": "a2c7c2004ff626864a56db1016817244", "score": "0.59240746", "text": "func RunCommand(name string, args ...string) error {\n\tc := exec.Command(name, args...)\n\tc.Stdout = &Writer{Prefix: name + Split, Writer: os.Stdout}\n\tc.Stderr = &Writer{Prefix: name + Split, Writer: os.Stderr}\n\tif err := c.Run(); err != nil {\n\t\treturn fmt.Errorf(\"%s%s%w\", name, Split, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4beb6a667d56260ec7d575697336fba2", "score": "0.59208083", "text": "func (a *awsApp) RunCommand(cmd *exec.Cmd) error {\n\tenvironmentVariables, err := a.GetEnvVars()\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\n\tlog.Debugf(\"Running command: %q\", cmd)\n\n\tcmd.Stdout = a.cf.Stdout()\n\tcmd.Stderr = a.cf.Stderr()\n\tcmd.Stdin = os.Stdin\n\tcmd.Env = os.Environ()\n\tfor key, value := range environmentVariables {\n\t\tcmd.Env = append(cmd.Env, fmt.Sprintf(\"%s=%s\", key, value))\n\t}\n\n\tif err := a.cf.RunCommand(cmd); err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a9691730ee59dd0fcdad176a25533d5d", "score": "0.5920261", "text": "func RunCommand(t testing.TestingT, command Command) {\n\terr := RunCommandE(t, command)\n\trequire.NoError(t, err)\n}", "title": "" }, { "docid": "7e66d349bca795fdcfbab37384ce21b8", "score": "0.5905762", "text": "func (c *CLIMethods) RunCommand(path string, args []string, debug bool) {\n\tcmd := exec.Command(path, args...)\n\n\tvar log helpers.Logger\n\n\tvar b []byte\n\n\tb, err := cmd.CombinedOutput()\n\n\tif err != nil {\n\t\tcolor.Red(\"😡 {Error}: \\n\" + string(err.Error()))\n\t\t// Error log\n\t\terrorLog := \"Log: \" + helpers.NewSHA1Hash(16) + \" -> \" + path + \" \" + strings.Join(args, \",\") + \"\\n\" + \"---------------------------------------------------------------------------\" + \"\\n\" + \"---------------------------------------------------------------------------\" + \"\\n\" + \"[ERROR] \\n\" + err.Error() + \"\\n\" + \"---------------------------------------------------------------------------\" + \"\\n\" + \"---------------------------------------------------------------------------\" + \"\\n\\n\"\n\n\t\tlog.CreateLoggerFileAndPopulate(errorLog)\n\t}\n\n\tcolor.Green(string(b[:len(b)]))\n\n\toutputLog := \"Log: \" + helpers.NewSHA1Hash(16) + \" -> \" + path + \" \" + strings.Join(args, \",\") + \"\\n\" + \"---------------------------------------------------------------------------\" + \"\\n\" + \"---------------------------------------------------------------------------\" + \"\\n\" + \"[OUTPUT] \\n\" + string(b[:len(b)]) + \"\\n\" + \"---------------------------------------------------------------------------\" + \"\\n\" + \"---------------------------------------------------------------------------\" + \"\\n\\n\"\n\n\tlog.CreateLoggerFileAndPopulate(outputLog)\n}", "title": "" }, { "docid": "6c05631e9845718d0a27119e5c5c41fe", "score": "0.59012", "text": "func ExecuteCommand(directory string, envVars []string, failFatal bool, showOutput bool, name string, arg ...string) ([]byte, []byte) {\n\tcmd := exec.Command(name, arg...)\n\n\t// set additional modifiers\n\tif directory != \"\" {\n\t\tcmd.Dir = directory\n\t}\n\tcmd.Env = os.Environ()\n\tfor _, envVar := range envVars {\n\t\tcmd.Env = append(cmd.Env, envVar)\n\n\t}\n\tvar outb, errb bytes.Buffer\n\tcmd.Stdout = &outb\n\tcmd.Stderr = &errb\n\terr := cmd.Run()\n\n\t// show output of command\n\tif showOutput {\n\t\tlog.Println(outb.String())\n\t}\n\n\tif err != nil {\n\t\tif failFatal {\n\t\t\tlog.Fatalf(\"Error applying command %s (%s): %s - %s\\n\", name, arg, err, errb.String())\n\t\t} else {\n\t\t\tlog.Printf(\"Error applying command %s (%s): %s - %s\\n\", name, arg, err, errb.String())\n\t\t}\n\t}\n\treturn outb.Bytes(), errb.Bytes()\n}", "title": "" } ]
6cfdf5e33dac5471f584614fbfbd1c1a
Ipv4Segment returns from NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_SegmentPath the path struct for its child "ipv4segment".
[ { "docid": "282379a66fa402dfd4667902b0ecf046", "score": "0.8489024", "text": "func (n *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_SegmentPath) Ipv4Segment() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4SegmentPath {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4SegmentPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-segment\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" } ]
[ { "docid": "e8bc61cda77fa42e4b5bb9eb50b158dd", "score": "0.80101305", "text": "func (n *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_SegmentPathAny) Ipv4Segment() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4SegmentPathAny {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4SegmentPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-segment\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "73ff9a61d96c7ea6ea15dc902ade6c79", "score": "0.7898669", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment) GetIpv4Segment() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4Segment {\n\tif s != nil && s.Ipv4Segment != nil {\n\t\treturn s.Ipv4Segment\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "341e3b1833cff8ef8dd7e5e66c417d97", "score": "0.6947986", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment) GetOrCreateIpv4Segment() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4Segment {\n\tif s.Ipv4Segment != nil {\n\t\treturn s.Ipv4Segment\n\t}\n\ts.Ipv4Segment = &NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4Segment{}\n\treturn s.Ipv4Segment\n}", "title": "" }, { "docid": "7913769128b04af98ec8f39c2f0aba90", "score": "0.65469664", "text": "func (n *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4SegmentPath) Address() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4Segment_AddressPath {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4Segment_AddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "c8cc9169759efdc4fad01921a2ffbdf8", "score": "0.64829624", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPath) RemoteIpv4Address() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_RemoteIpv4AddressPath {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_RemoteIpv4AddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"remote-ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "7a3234fe095590a4e6399090c3779e62", "score": "0.6379513", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPath) RemoteIpv4Address() *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_RemoteIpv4AddressPath {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_RemoteIpv4AddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"remote-ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "c2bfce48b6becd163bd0e3b6bf1555e8", "score": "0.63387996", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4Segment) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4Segment\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "81e35e9f416a94900de431179133e23f", "score": "0.61351645", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPath) Segment(Index uint64) *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPath {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segments\", \"segment\"},\n\t\t\tmap[string]interface{}{\"index\": Index},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b003287496fe687d4b21189277f38c19", "score": "0.61259323", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPath) Segment(Index uint64) *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPath {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segments\", \"segment\"},\n\t\t\tmap[string]interface{}{\"index\": Index},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0f965049fee3c4ae2b93cac6bc5aa340", "score": "0.6118611", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPath) LocalIpv4Address() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_LocalIpv4AddressPath {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_LocalIpv4AddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"local-ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d166feea0a3349b4eb74d11f72c66617", "score": "0.6031262", "text": "func GetSegmentPath(entity Entity) string {\n\treturn entity.GetEntityData().SegmentPath\n}", "title": "" }, { "docid": "205da9e38d8f0499b1e2042ba33db41c", "score": "0.5953362", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPath) LocalIpv4Address() *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_LocalIpv4AddressPath {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_LocalIpv4AddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"local-ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "05f8c5d0a0dd0040bb67448b35781103", "score": "0.5937261", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_SubtlvPath) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "3335630d44eaf46e908b48e4c1325c71", "score": "0.5930319", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_SubtlvPath) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "023b50514e300ccecbc81c1f45b25427", "score": "0.58816975", "text": "func (n *Interface_RoutedVlanPath) Ipv4() *Interface_RoutedVlan_Ipv4Path {\n\treturn &Interface_RoutedVlan_Ipv4Path{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "3255ade30ece7c7269291c134f84ac5e", "score": "0.5870052", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_SubtlvPath) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f904351140709b2f27984b17511f17d6", "score": "0.5868463", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_SubtlvPath) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "7730e2e13fe01d15e93618a002b3a487", "score": "0.5860405", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_SubtlvPath) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "231038d49a7b07820a980d5289a950a3", "score": "0.5854288", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_As4SegmentPath) Type() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_As4Segment_TypePath {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_As4Segment_TypePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"type\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "535a71ff4c57ede0a986fd0364e7f428", "score": "0.5842005", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_SubtlvPath) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "acd78c1085649f0cc578aeeb9efeb8c2", "score": "0.58310497", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_SubtlvPath) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "9987e82239a2e2299dd50138b82875d3", "score": "0.5798044", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny) RemoteIpv4Address() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_RemoteIpv4AddressPathAny {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_RemoteIpv4AddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"remote-ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8d818fe4b2b15ad58c8d9d361a664844", "score": "0.57959133", "text": "func (n *Interface_SubinterfacePath) Ipv4() *Interface_Subinterface_Ipv4Path {\n\treturn &Interface_Subinterface_Ipv4Path{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f12508456e96fbbad08df879868399d5", "score": "0.57906955", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_SubtlvPath) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "206fda78d11f24803a94b83793c6e99c", "score": "0.5779142", "text": "func (n *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4SegmentPathAny) Address() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4Segment_AddressPathAny {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_Ipv4Segment_AddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a25cc5463460cd03c408ab1530a01244", "score": "0.5733626", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_As4SegmentPath) Member() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_As4Segment_MemberPath {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_As4Segment_MemberPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"member\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "9d3b43f2e9ebcc9c2930b69f75ab228f", "score": "0.56979567", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPathAny) Segment(Index uint64) *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segments\", \"segment\"},\n\t\t\tmap[string]interface{}{\"index\": Index},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f5af08824ad5d3b932281f027f65dca9", "score": "0.5692179", "text": "func (n *NetworkInstance_SegmentRouting_TePolicy_CandidatePathPath) SegmentList(Id uint32) *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentListPath {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentListPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-lists\", \"segment-list\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "07faf3ec32b6ae528241c306b0309a75", "score": "0.5652249", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPathAny) Segment(Index uint64) *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segments\", \"segment\"},\n\t\t\tmap[string]interface{}{\"index\": Index},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "85e03d7f31051ca0320b96c7d6d75aae", "score": "0.5646467", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4SrlgPath) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4Srlg_Ipv4NeighborAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4Srlg_Ipv4NeighborAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "bc54f4ba5a0c50b9b3963e38f0b5c67a", "score": "0.5645027", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4SrlgPath) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4Srlg_Ipv4InterfaceAddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4Srlg_Ipv4InterfaceAddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6da48863ad29ee6819bc74a80296650b", "score": "0.5614774", "text": "func (n *NetworkInstance_Protocol_Isis_Interface_Level_AfPath) SegmentRouting() *NetworkInstance_Protocol_Isis_Interface_Level_Af_SegmentRoutingPath {\n\treturn &NetworkInstance_Protocol_Isis_Interface_Level_Af_SegmentRoutingPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-routing\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "33d47dd33ad03b602646e97d315122cc", "score": "0.5573458", "text": "func (n *Acl_AclSet_AclEntryPath) Ipv4() *Acl_AclSet_AclEntry_Ipv4Path {\n\treturn &Acl_AclSet_AclEntry_Ipv4Path{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "7f8fb5f3ba2e37d7597e764120f41d98", "score": "0.5566595", "text": "func GetSegment(ip string) string {\n\tmatch, err := gregex.MatchString(`^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$`, ip)\n\tif err != nil || len(match) < 4 {\n\t\treturn \"\"\n\t}\n\treturn fmt.Sprintf(\"%s.%s.%s\", match[1], match[2], match[3])\n}", "title": "" }, { "docid": "6faf187ec7d7a28fcd7d455c9301006b", "score": "0.55534965", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny) RemoteIpv4Address() *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_RemoteIpv4AddressPathAny {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_RemoteIpv4AddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"remote-ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "315256d6374bc406885b53e5d9373305", "score": "0.5540728", "text": "func (n *Interface_SubinterfacePathAny) Ipv4() *Interface_Subinterface_Ipv4PathAny {\n\treturn &Interface_Subinterface_Ipv4PathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0a93efe2f6552e681cb6c770a4136da6", "score": "0.5508381", "text": "func (n *NetworkInstance_PolicyForwarding_Policy_RulePath) Ipv4() *NetworkInstance_PolicyForwarding_Policy_Rule_Ipv4Path {\n\treturn &NetworkInstance_PolicyForwarding_Policy_Rule_Ipv4Path{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "c30fcb58cbc7d3a78a4827af3392f2a6", "score": "0.54825985", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPath) SegmentAny() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segments\", \"segment\"},\n\t\t\tmap[string]interface{}{\"index\": \"*\"},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "27a53e69a62e50c576cfbc6d9a5b9396", "score": "0.5481032", "text": "func (n *NetworkInstance_SegmentRouting_TePolicy_CandidatePathPathAny) SegmentList(Id uint32) *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentListPathAny {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentListPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-lists\", \"segment-list\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "9b5452b3eb7e80213b7aca4c044764cf", "score": "0.5441414", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_SubtlvPath) SegmentList(InstanceId uint64) *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPath {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-lists\", \"segment-list\"},\n\t\t\tmap[string]interface{}{\"instance-id\": InstanceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "4691b84b593c1c8019b52d128ac117d5", "score": "0.54309684", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ce0e3f5c11fb1e732d7c385eb91af530", "score": "0.541771", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny) LocalIpv4Address() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_LocalIpv4AddressPathAny {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_LocalIpv4AddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"local-ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "e80b7a6a33bc26b5ce764f26c2b7f933", "score": "0.5417051", "text": "func (n *Interface_RoutedVlanPathAny) Ipv4() *Interface_RoutedVlan_Ipv4PathAny {\n\treturn &Interface_RoutedVlan_Ipv4PathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "53830d7356959d31ca223a7744b19fd4", "score": "0.5411868", "text": "func (n *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentListPath) Id() *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_IdPath {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_IdPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"id\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "257f3852f88ac00fb2d3d63ec5264091", "score": "0.54081625", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_SubtlvPathAny) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "de6a5f0267e5babedcbc8c0ebe6da1b6", "score": "0.54025245", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPath) SegmentAny() *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segments\", \"segment\"},\n\t\t\tmap[string]interface{}{\"index\": \"*\"},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "1dc889bbb3912d3be8f5e211d33d4ede", "score": "0.537446", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_SubtlvPathAny) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "738f51a0bba423ffd2516e1edb83e83d", "score": "0.5373681", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_SubtlvPath) SegmentList(InstanceId uint64) *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPath {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-lists\", \"segment-list\"},\n\t\t\tmap[string]interface{}{\"instance-id\": InstanceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "7032abda50e5e795beabf30df946b01c", "score": "0.5368714", "text": "func (n *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_RouterInformation_TlvPath) SegmentRoutingAlgorithm() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_RouterInformation_Tlv_SegmentRoutingAlgorithmPath {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_RouterInformation_Tlv_SegmentRoutingAlgorithmPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-routing-algorithm\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d0514da266341592d84bad2a1ab3e423", "score": "0.53355277", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_SubtlvPathAny) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b12de339baec0b0095b5159fa4f2a81b", "score": "0.5335378", "text": "func PathSegmenter(path string, start int) (segment string, next int) {\n\tif len(path) == 0 || start < 0 || start > len(path)-1 {\n\t\treturn \"\", -1\n\t}\n\tend := strings.IndexRune(path[start+1:], '/') // next '/' after 0th rune\n\tif end == -1 {\n\t\treturn path[start:], -1\n\t}\n\treturn path[start : start+end+1], start + end + 1\n}", "title": "" }, { "docid": "f82fbcc6f78ea68988723a04153b977b", "score": "0.5325537", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_SubtlvPathAny) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "db65ca292df1d934a106f45b01dbd76e", "score": "0.5310042", "text": "func (s *NetworkInstance_Protocol_Isis_Interface_Level_Af) GetSegmentRouting() *NetworkInstance_Protocol_Isis_Interface_Level_Af_SegmentRouting {\n\tif s != nil && s.SegmentRouting != nil {\n\t\treturn s.SegmentRouting\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8017723a4766df7c62abbdaeae245aed", "score": "0.5296493", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_SubtlvPathAny) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a0267a7b819ce93a51b536693ee65673", "score": "0.5288368", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_SubtlvPathAny) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8c3cab084c6d39a2a717acea998b6bb6", "score": "0.5262467", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_SubtlvPathAny) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_Ipv4InterfaceAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "40ca8ed97e312cce38c75f3575afd378", "score": "0.5260424", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_SubtlvPathAny) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_Ipv4NeighborAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "00534ea853ce3ea72b1e0fd33aedbb36", "score": "0.52603", "text": "func (n *System_Dns_HostEntryPath) Ipv4Address() *System_Dns_HostEntry_Ipv4AddressPath {\n\treturn &System_Dns_HostEntry_Ipv4AddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "023ff4831f1b7bf0ca71ea60f09b5a7a", "score": "0.51988953", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_SubtlvPathAny) SegmentList(InstanceId uint64) *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPathAny {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-lists\", \"segment-list\"},\n\t\t\tmap[string]interface{}{\"instance-id\": InstanceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "21e3201638a9aaf42de783f52ed1149c", "score": "0.5173045", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_RouterInformation_Tlv) GetSegmentRoutingAlgorithm() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_RouterInformation_Tlv_SegmentRoutingAlgorithm {\n\tif s != nil && s.SegmentRoutingAlgorithm != nil {\n\t\treturn s.SegmentRoutingAlgorithm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "480889c3904267f0019e59487d662cca", "score": "0.5148802", "text": "func (this *VDENetworkEndpoint) GetIPv4CIDRAddress() string {\n\tif this.address == nil {\n\t\treturn \"\"\n\t}\n\n\tif this.address.IsUnspecified() {\n\t\treturn \"\"\n\t}\n\n\tsuffix, _ := this.addressNet.Mask.Size()\n\t// Get a stringified CIDR address\n\treturn this.address.String() + \"/\" + fmt.Sprintf(\"%d\", suffix)\n}", "title": "" }, { "docid": "54acbd0498608e66cb4392902d36c8dc", "score": "0.514555", "text": "func (n *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_RouterInformation_TlvPath) SegmentRoutingSidLabelRange() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_RouterInformation_Tlv_SegmentRoutingSidLabelRangePath {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_RouterInformation_Tlv_SegmentRoutingSidLabelRangePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-routing-sid-label-range\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b9c83530e157602f2ce9e432bc59d2fe", "score": "0.5144679", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_SubtlvPathAny) SegmentList(InstanceId uint64) *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPathAny {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-lists\", \"segment-list\"},\n\t\t\tmap[string]interface{}{\"instance-id\": InstanceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "da2d45cb0908dece112b4dd215b51c9a", "score": "0.51361287", "text": "func (n *NetworkInstance_Protocol_Isis_Interface_Level_AfPathAny) SegmentRouting() *NetworkInstance_Protocol_Isis_Interface_Level_Af_SegmentRoutingPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Interface_Level_Af_SegmentRoutingPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-routing\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a42a67020433f24c89d061b7d8dfbac6", "score": "0.5133702", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny) LocalIpv4Address() *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_LocalIpv4AddressPathAny {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_LocalIpv4AddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"local-ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d6990c619188cb367a3b80c97b42c7ae", "score": "0.5130996", "text": "func (n *NetworkInstance_Protocol_Isis_Interface_Level_AdjacencyPath) NeighborIpv4Address() *NetworkInstance_Protocol_Isis_Interface_Level_Adjacency_NeighborIpv4AddressPath {\n\treturn &NetworkInstance_Protocol_Isis_Interface_Level_Adjacency_NeighborIpv4AddressPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"neighbor-ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "62f3bf21d6616fc27c3d680a7d2d19a1", "score": "0.5127011", "text": "func (n *Bgp_Rib_AttrSet_As4SegmentPath) Type() *Bgp_Rib_AttrSet_As4Segment_TypePath {\n\treturn &Bgp_Rib_AttrSet_As4Segment_TypePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"type\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "65307f8d1e67b2b4b716c4cb8cf80148", "score": "0.51184314", "text": "func (s *CampaignResponse) SetSegmentId(v string) *CampaignResponse {\n\ts.SegmentId = &v\n\treturn s\n}", "title": "" }, { "docid": "034c52fcfdcaa75064de10574243b05b", "score": "0.5114794", "text": "func (n *Bgp_Neighbor_AfiSafiPath) SrtePolicyIpv4() *Bgp_Neighbor_AfiSafi_SrtePolicyIpv4Path {\n\treturn &Bgp_Neighbor_AfiSafi_SrtePolicyIpv4Path{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"srte-policy-ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "5929a0525a5ba2ceb5300b1d1b7ec665", "score": "0.5102722", "text": "func (n *Acl_AclSet_AclEntryPathAny) Ipv4() *Acl_AclSet_AclEntry_Ipv4PathAny {\n\treturn &Acl_AclSet_AclEntry_Ipv4PathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ae96a09e7264bf4b6de9f782665241f6", "score": "0.5081911", "text": "func (n *NetworkInstancePath) SegmentRouting() *NetworkInstance_SegmentRoutingPath {\n\treturn &NetworkInstance_SegmentRoutingPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-routing\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "3c07a04aadfbbd95b22e75a775f31c24", "score": "0.5077993", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPath) Sid() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_SidPath {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_Segment_SidPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"sid\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f1ad869df6a105ca34e890504f57d122", "score": "0.5074849", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_As4SegmentPathAny) Type() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_As4Segment_TypePathAny {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_As4Segment_TypePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"type\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "1f8f7e6e8f8f9d73e9b296c5a39b6a94", "score": "0.5049272", "text": "func (s *Interface_Subinterface) GetIpv4() *Interface_Subinterface_Ipv4 {\n\tif s != nil && s.Ipv4 != nil {\n\t\treturn s.Ipv4\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4f8f4af32247e0a9a6d5ad26fa602dc0", "score": "0.5043572", "text": "func (n *System_Dns_HostEntryPathAny) Ipv4Address() *System_Dns_HostEntry_Ipv4AddressPathAny {\n\treturn &System_Dns_HostEntry_Ipv4AddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"ipv4-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b9fa19ec1367fa97b7298f58b447c150", "score": "0.5043369", "text": "func (o LookupSiteToSiteVpnAttachmentResultOutput) SegmentName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LookupSiteToSiteVpnAttachmentResult) *string { return v.SegmentName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "60a9b50b0b136c107f12fe6599fc2205", "score": "0.50309587", "text": "func (s *WriteCampaignRequest) SetSegmentId(v string) *WriteCampaignRequest {\n\ts.SegmentId = &v\n\treturn s\n}", "title": "" }, { "docid": "293e0ab57d4d917a3c2e04f470b78f6e", "score": "0.50282854", "text": "func (s *ExportJobResource) SetSegmentId(v string) *ExportJobResource {\n\ts.SegmentId = &v\n\treturn s\n}", "title": "" }, { "docid": "3e7b0149ba5b472172e09ea188a5045e", "score": "0.50275373", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AfiSafiPath) Ipv4SrtePolicy() *NetworkInstance_Protocol_Bgp_Rib_AfiSafi_Ipv4SrtePolicyPath {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AfiSafi_Ipv4SrtePolicyPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-srte-policy\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a36677ab12ee159f08ff57f593bf3a75", "score": "0.50168693", "text": "func (s *ImportJobResource) SetSegmentId(v string) *ImportJobResource {\n\ts.SegmentId = &v\n\treturn s\n}", "title": "" }, { "docid": "860a3335b14a90d605696c107ad912ed", "score": "0.5016783", "text": "func (n *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPathAny) SegmentAny() *Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny {\n\treturn &Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segments\", \"segment\"},\n\t\t\tmap[string]interface{}{\"index\": \"*\"},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "3bd878c3e36571a3e125352e6e8e39c7", "score": "0.50149816", "text": "func (s *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv) GetIpv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddress {\n\tif s != nil && s.Ipv4InterfaceAddress != nil {\n\t\treturn s.Ipv4InterfaceAddress\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4158bb873d440ad46dc0c280822df9b9", "score": "0.5009953", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentListPathAny) SegmentAny() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_TunnelEncapsulation_Tunnel_Subtlv_SegmentList_SegmentPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segments\", \"segment\"},\n\t\t\tmap[string]interface{}{\"index\": \"*\"},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d4c031695f9ffcb4c1c839203b04f1e4", "score": "0.50071126", "text": "func (n *NetworkInstance_Protocol_Isis_GlobalPath) SegmentRouting() *NetworkInstance_Protocol_Isis_Global_SegmentRoutingPath {\n\treturn &NetworkInstance_Protocol_Isis_Global_SegmentRoutingPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"segment-routing\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ddcace05eaa066d19bdbb799312dbd5e", "score": "0.5004008", "text": "func (n *Bgp_Global_AfiSafiPath) SrtePolicyIpv4() *Bgp_Global_AfiSafi_SrtePolicyIpv4Path {\n\treturn &Bgp_Global_AfiSafi_SrtePolicyIpv4Path{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"srte-policy-ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0918ca5aa5ccbb6b027f03648f907bb5", "score": "0.5000042", "text": "func (n *NetworkInstance_Protocol_Bgp_Rib_AttrSet_AggregatorPath) As4() *NetworkInstance_Protocol_Bgp_Rib_AttrSet_Aggregator_As4Path {\n\treturn &NetworkInstance_Protocol_Bgp_Rib_AttrSet_Aggregator_As4Path{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"as4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "c79c0fa33e80b349d0bf5d735174b43c", "score": "0.4995912", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4SrlgPathAny) Ipv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4Srlg_Ipv4NeighborAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4Srlg_Ipv4NeighborAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"ipv4-neighbor-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6f2e631bdfdd8c86a202dc2e9203e950", "score": "0.4988094", "text": "func (s *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv) GetIpv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4InterfaceAddress {\n\tif s != nil && s.Ipv4InterfaceAddress != nil {\n\t\treturn s.Ipv4InterfaceAddress\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "57b1d4187ca44eb77e233671a6bae27f", "score": "0.4984685", "text": "func (t *SrlNokiaSystem_System_NetworkInstance_Protocols_Evpn_EthernetSegments_BgpInstance_EthernetSegment_Routes_EthernetSegment) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaSystem_System_NetworkInstance_Protocols_Evpn_EthernetSegments_BgpInstance_EthernetSegment_Routes_EthernetSegment\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3d1858f5696d130969a52e8c474f22b4", "score": "0.49806476", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4SrlgPathAny) Ipv4InterfaceAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4Srlg_Ipv4InterfaceAddressPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv4Srlg_Ipv4InterfaceAddressPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"ipv4-interface-address\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "2ee6106cb5ae0c099f4bd5237d61a14a", "score": "0.49781087", "text": "func (in *Segment) DeepCopy() *Segment {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Segment)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "e77ee98b45234a0a974991ecc3cb9547", "score": "0.49761108", "text": "func (n *NetworkInstance_Protocol_Bgp_Neighbor_AfiSafiPath) SrtePolicyIpv4() *NetworkInstance_Protocol_Bgp_Neighbor_AfiSafi_SrtePolicyIpv4Path {\n\treturn &NetworkInstance_Protocol_Bgp_Neighbor_AfiSafi_SrtePolicyIpv4Path{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"srte-policy-ipv4\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "68e63d5d3ccf298e5a5d849f3526158e", "score": "0.4973441", "text": "func (n *NetworkInstance_AftsPath) Ipv4Entry(Prefix string) *NetworkInstance_Afts_Ipv4EntryPath {\n\treturn &NetworkInstance_Afts_Ipv4EntryPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"ipv4-unicast\", \"ipv4-entry\"},\n\t\t\tmap[string]interface{}{\"prefix\": Prefix},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ab76fa7a6c301ae069193bde09fd6624", "score": "0.49609944", "text": "func (p List) Segment() *Segment {\n\treturn p.seg\n}", "title": "" }, { "docid": "fe27136f470e55700cd5e413dc1860b7", "score": "0.49488008", "text": "func (s *Segment) ID() SegmentID {\n\treturn s.id\n}", "title": "" }, { "docid": "cce1b2bc12b4d94c4b1f4d8d17466840", "score": "0.4945633", "text": "func (t *Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv) GetIpv4InterfaceAddress() *Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4InterfaceAddress {\n\tif t != nil && t.Ipv4InterfaceAddress != nil {\n\t\treturn t.Ipv4InterfaceAddress\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "30f89f827307e30dac1e83e344bba03d", "score": "0.49402228", "text": "func (s *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv) GetIpv4NeighborAddress() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_IsisNeighborAttribute_Neighbor_Instance_Subtlv_Ipv4NeighborAddress {\n\tif s != nil && s.Ipv4NeighborAddress != nil {\n\t\treturn s.Ipv4NeighborAddress\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "889beea48f1510f26af6d6a90e26608e", "score": "0.49314338", "text": "func (t *Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv) GetIpv4InterfaceAddress() *Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_Ipv4InterfaceAddress {\n\tif t != nil && t.Ipv4InterfaceAddress != nil {\n\t\treturn t.Ipv4InterfaceAddress\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ff6b519f232bebe99509bfccd3811dcb", "score": "0.49253148", "text": "func (s *EventStartCondition) SetSegmentId(v string) *EventStartCondition {\n\ts.SegmentId = &v\n\treturn s\n}", "title": "" }, { "docid": "409f2a122afc6c4227004f81c9b2a671", "score": "0.4920505", "text": "func (mpd *MPD) GetSegmentList() SegmentList {\n return mpd.Period.Adapt.Rep.SegmentL\n}", "title": "" } ]
88934aa53a2f2e5f70c7b0b4e5178274
Less helps implement sort.Interface.
[ { "docid": "f02e290250887d02131d5dcbd448bb55", "score": "0.0", "text": "func (p People) Less(i, j int) bool {\n\treturn p[i] < p[j]\n}", "title": "" } ]
[ { "docid": "86d8652713533a371e9a1b3ff79ac65a", "score": "0.7343534", "text": "func (p *Vector) Less(i, j int) bool\t{ return p.a[i].(LessInterface).Less(p.a[j]) }", "title": "" }, { "docid": "770f785637de1828df7477c269c7363a", "score": "0.72595835", "text": "func (s Sorter) Less(i, j int) bool { return s.L(i, j) }", "title": "" }, { "docid": "7deb800a13b6a530954271cccf2e9a88", "score": "0.7054473", "text": "func (b *Sortable) Less(i, j int) bool {\r\n\tfor _, c := range b.Comparators {\r\n\t\tif c(i, j) {\r\n\t\t\treturn true\r\n\t\t} else if c(j, i) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t}\r\n\treturn false\r\n}", "title": "" }, { "docid": "5a14b3fee80de8e94cbc16c9f9895e26", "score": "0.68266726", "text": "func (s *listSorter) Less(i, j int) bool {\n\treturn s.by(&s.theList[i], &s.theList[j])\n}", "title": "" }, { "docid": "5a14b3fee80de8e94cbc16c9f9895e26", "score": "0.68266726", "text": "func (s *listSorter) Less(i, j int) bool {\n\treturn s.by(&s.theList[i], &s.theList[j])\n}", "title": "" }, { "docid": "2976f074dc7ad473328a514ce9bd9cf5", "score": "0.6823137", "text": "func (s *sorter) Less(i, j int) bool { return s.vals[i] < s.vals[j] }", "title": "" }, { "docid": "91a33271fa55de3493266e3065a4a108", "score": "0.67828345", "text": "func (s *Sortable) Less(i, j int) bool {\n\tvi := s.List[i].Get(s.Field)\n\tvj := s.List[j].Get(s.Field)\n\treturn vi.String() < vj.String()\n}", "title": "" }, { "docid": "4854cb79977ffb066cd5e55e096637b1", "score": "0.6769085", "text": "func (l Linkers) Less(i, j int) bool {\n\treturn true\n}", "title": "" }, { "docid": "9fa6baf9501f0bf8a5921c705e876dc0", "score": "0.6718908", "text": "func (d Data) Less(i, j int) bool {\n\treturn d.Items[i].(Compare).Less(d.Items[j])\n}", "title": "" }, { "docid": "62cfb985b2c3b70ac32da26d957894fb", "score": "0.6712742", "text": "func (s *Sorter) Less(i, j int) bool {\n\treturn s.by(&s.rows[i], &s.rows[j])\n}", "title": "" }, { "docid": "0798d4d82415b24c11bd9fc2d631ee8b", "score": "0.6711719", "text": "func (s *tableCreateDemoSorter) Less(i, j int) bool {\n\treturn s.by(s.tableCreateDemos[i], s.tableCreateDemos[j])\n}", "title": "" }, { "docid": "d83426ffa2b2131173b07590986ed832", "score": "0.66103745", "text": "func (s *fileSorter) Less(i, j int) bool {\n\treturn s.by(&s.files[i], &s.files[j])\n}", "title": "" }, { "docid": "1a402cab692cd8b9346c8973999712db", "score": "0.6554694", "text": "func (ps *sortable) Less(i, j int) bool {\n\tif ps.list[i].GetTreeNode() == nil && ps.list[j].GetTreeNode() == nil {\n\t\treturn ps.hashes[i] < ps.hashes[j]\n\t}\n\tif ps.list[i].GetTreeNode() != nil && ps.list[j].GetTreeNode() != nil {\n\t\tc := ps.list[i].GetTreeNode().GetName().Compare(ps.list[j].GetTreeNode().GetName())\n\t\tif c == 0 {\n\t\t\treturn ps.hashes[i] < ps.hashes[j]\n\t\t}\n\t\treturn c < 0\n\t}\n\treturn ps.list[i].GetTreeNode() == nil\n}", "title": "" }, { "docid": "43827a4977e668d3b0fea7439c146a3b", "score": "0.653329", "text": "func (s *carSorter) Less(i, j int) bool {\n\treturn s.by(s.cars[i], s.cars[j])\n}", "title": "" }, { "docid": "b6e828de150bee4b1649a8b9dde3f9a4", "score": "0.65217596", "text": "func (a ThingSlice) Less(i, j int) bool {\n\tswitch a[i].(type) {\n\tcase string:\n\t\treturn a[i].(string) < a[j].(string)\n\tcase float64:\n\t\treturn a[i].(float64) < a[j].(float64)\n\tcase int:\n\t\t// Unlikely to get here because all Javascript numbers are floats!\n\t\treturn a[i].(int) < a[j].(int)\n\tdefault:\n\t\tLog(ERROR, nil, \"ThingSlice.Less\", \"error\", \"unsupported type\", \"things\", a)\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "68853d5b1ac04ffa8251da85b0d93379", "score": "0.6521622", "text": "func (s *cardSorter) Less(i, j int) bool {\n\treturn s.by(&s.cards[i], &s.cards[j])\n}", "title": "" }, { "docid": "3e1f51ad89f823801e4f3f97f5802795", "score": "0.6520141", "text": "func (s sortableCacheSources) Less(i, j int) bool {\n\treturn s[i].CachePolicy.LastUsed.Before(s[j].CachePolicy.LastUsed)\n}", "title": "" }, { "docid": "6db7f04a4aa7fc6cec847012adbfb77b", "score": "0.6488383", "text": "func (ms *MultiSorter) Less(i, j int) bool {\n\tp, q := ms.values[i], ms.values[j]\n\tv := &ValuerEval{Valuer: MultiValuer(ms.valuer)}\n\tfor _, field := range ms.fields {\n\t\tn := field.Uname\n\t\tvp, _ := p[n]\n\t\tvq, _ := q[n]\n\t\tif vp == nil && vq != nil {\n\t\t\treturn false\n\t\t} else if vp != nil && vq == nil {\n\t\t\treturn true\n\t\t} else if vp == nil && vq == nil {\n\t\t\treturn false\n\t\t}\n\t\tswitch {\n\t\tcase v.simpleDataEval(vp, vq, ast.LT):\n\t\t\treturn field.Ascending\n\t\tcase v.simpleDataEval(vq, vp, ast.LT):\n\t\t\treturn !field.Ascending\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "22ab519fa13e7bbf22d6f9b71b706ed6", "score": "0.64712167", "text": "func (ss *Slice) Less(i, j int) bool { return ss.lessFn(ss.Get(i), ss.Get(j)) }", "title": "" }, { "docid": "edd8605319865247fd05e7d6b1b4d6e9", "score": "0.646127", "text": "func (x SortSlice[E]) Less(i, j int) bool { return x[i] < x[j] || (isNaN(x[i]) && !isNaN(x[j])) }", "title": "" }, { "docid": "8c68d1ab6de52aeca4738447ae9cbd57", "score": "0.6459943", "text": "func (p ModuleList) Less(i, j int) bool { return p[i].Name() < p[j].Name() }", "title": "" }, { "docid": "e5d307b1b1eb9433db7522f7df0933ef", "score": "0.64271635", "text": "func (t stakeTicketSorter) Less(i, j int) bool {\n\tiHash := t[i].tx.CachedTxHash()[:]\n\tjHash := t[j].tx.CachedTxHash()[:]\n\treturn bytes.Compare(iHash, jHash) < 0\n}", "title": "" }, { "docid": "9710a6d23db5e786ce4acfef9037c3b1", "score": "0.64215326", "text": "func (a ByName) Less(i, j int) bool { return a[i][:2] < a[j][:2] }", "title": "" }, { "docid": "96182cf36ff3e6b7e9c227140ad69322", "score": "0.6412124", "text": "func (s *jobSorter) Less(i, j int) bool {\n\treturn s.by(&s.jobs[i], &s.jobs[j])\n}", "title": "" }, { "docid": "5f7bb4d9f17792de3a957f9b549453e0", "score": "0.6408379", "text": "func (s SortableAccountMeta) Less(i int, j int) bool {\n\tif s[i].isPayer != s[j].isPayer {\n\t\treturn s[i].isPayer\n\t}\n\tif s[i].isProgram != s[j].isProgram {\n\t\treturn !s[i].isProgram\n\t}\n\n\tif s[i].IsSigner != s[j].IsSigner {\n\t\treturn s[i].IsSigner\n\t}\n\tif s[i].IsWritable != s[j].IsWritable {\n\t\treturn s[i].IsWritable\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "84d08f93e3bf8bce2a34f1e1686099ab", "score": "0.6407775", "text": "func (s *nodeSorter) Less(i, j int) bool {\n\treturn s.by(s.nodes[i], s.nodes[j])\n}", "title": "" }, { "docid": "482785bae69f762aeee1a79ff0635fd9", "score": "0.6403938", "text": "func Sort(slice interface{}, lessOrCompareFunc interface{}) {\n\tldsort.Sort(slice, lessOrCompareFunc)\n}", "title": "" }, { "docid": "23a320917a6e1587f9f6fca298df7c62", "score": "0.6403337", "text": "func (ms multiSortSlice) Less(i, j int) bool {\n\treturn getLessValue(reflect.ValueOf(ms[i]).FieldByName(getKey()), reflect.ValueOf(ms[j]).FieldByName(getKey()))\n}", "title": "" }, { "docid": "2f85744a706e1701835e43806ba60b81", "score": "0.6402087", "text": "func (rs repoSort) Less(i, j int) bool {\n\ta, b := rs[i], rs[j]\n\n\tif a.RemoteURI != \"\" && b.RemoteURI == \"\" {\n\t\treturn false\n\t}\n\n\tif a.RemoteURI == \"\" && b.RemoteURI != \"\" {\n\t\treturn true\n\t}\n\n\tif a.Type == \"hosted\" && b.Type != \"hosted\" {\n\t\treturn true\n\t}\n\n\tif a.Type != \"hosted\" && b.Type == \"hosted\" {\n\t\treturn false\n\t}\n\n\treturn a.Name < b.Name\n}", "title": "" }, { "docid": "5f1a5c494435392e5b10ec1974b0a0ce", "score": "0.6399319", "text": "func (s sortNames) Less(i, j int) bool {\n\tswitch ti := s[i].(type) {\n\tcase int:\n\t\tswitch tj := s[j].(type) {\n\t\tcase int:\n\t\t\treturn ti < tj\n\t\tcase string:\n\t\t\treturn false\n\t\t}\n\t\treturn false\n\tcase string:\n\t\tswitch tj := s[j].(type) {\n\t\tcase int:\n\t\t\treturn true\n\t\tcase string:\n\t\t\treturn ti < tj\n\t\t}\n\t\treturn false\n\tcase nil:\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "26c1c8ec26f46defabe65e25279d324c", "score": "0.63939124", "text": "func (p PagesSlice) Less(i, j int) bool {\n\td := p[i].Date.Unix() - p[j].Date.Unix()\n\tif d < 0 {\n\t\treturn false\n\t} else if d > 0 {\n\t\treturn true\n\t}\n\treturn p[i].Title < p[j].Title\n}", "title": "" }, { "docid": "11fe2c4a0b07609618fa913889f52e5f", "score": "0.6393438", "text": "func (node *List) SortBy(less func(i, j int) bool) error {\n\tif !node.IsList() {\n\t\treturn log.ERR_NO_SUPPORT\n\t}\n\n\tvar o func(i, j int) bool\n\tnode.lessFn, o = less, node.lessFn\n\tsort.Sort(node)\n\tnode.lessFn = o\n\n\treturn nil\n}", "title": "" }, { "docid": "679fe596971e23ac74da58e71622fef1", "score": "0.6383655", "text": "func (s *newStructSelectSorter) Less(i, j int) bool {\n\treturn s.by(s.newStructSelects[i], s.newStructSelects[j])\n}", "title": "" }, { "docid": "a3910c077a182e2c3a8f549623ec72fd", "score": "0.63650995", "text": "func (sf SortableFeature) Less(i int, j int) bool {\n\treturn sf.Feature.NumData[sf.Cases[i]] < sf.Feature.NumData[sf.Cases[j]]\n\n}", "title": "" }, { "docid": "5dc91201c2e61627185bf63f92f0479e", "score": "0.6358349", "text": "func (svl SVList) Less(i, j int) bool {\n\treturn Less(svl[i], svl[j])\n}", "title": "" }, { "docid": "eaa57945ce2ce6a2f7172f90a7e45ebf", "score": "0.6356673", "text": "func (p *Join) less() StringSliceComparator {\r\n\treturn (&SortKeys{\r\n\t\tKeys: p.LeftKeys,\r\n\t\tNumeric: p.Numeric,\r\n\t}).AsStringSliceComparator()\r\n}", "title": "" }, { "docid": "8d5dcd8ec0c25abb242a439bd1b0289e", "score": "0.6341182", "text": "func (ms *MultiSorter) Less(i, j int) bool {\n\tp, q := ms.nodes[i], ms.nodes[j]\n\t// Try all but the last comparison.\n\tvar k int\n\tfor k = 0; k < len(ms.less)-1; k++ {\n\t\tless := ms.less[k]\n\t\tswitch {\n\t\tcase less(p, q):\n\t\t\t// p < q, so we have a decision.\n\t\t\treturn true\n\t\tcase less(q, p):\n\t\t\t// p > q, so we have a decision.\n\t\t\treturn false\n\t\t}\n\t\t// p == q; try the next comparison.\n\t}\n\t// All comparisons to here said \"equal\", so just return whatever\n\t// the final comparison reports.\n\treturn ms.less[k](p, q)\n}", "title": "" }, { "docid": "254a692be22c997bd9cadd5bc7d6232e", "score": "0.63310117", "text": "func (this *replaceList) Less(i, j int) bool {\n\tl, r := this.list[i], this.list[j]\n\treturn l.value > r.value\n}", "title": "" }, { "docid": "5da85cab3b629de4f46c2cd9f353c818", "score": "0.6297199", "text": "func (s *planetSorter) Less(i, j int) bool {\n\treturn s.by(&s.planets[i], &s.planets[j])\n}", "title": "" }, { "docid": "d07d4f48652b0d9f605abe7d2dcc37ad", "score": "0.6281748", "text": "func (it sortableFieldMeta) Less(i, j int) bool {\n\treturn it[i].Name < it[j].Name\n}", "title": "" }, { "docid": "fcc8a0285640d174785d224a1f222bed", "score": "0.6281007", "text": "func (a Int) Less(b Item) bool {\n\treturn a < b.(Int)\n}", "title": "" }, { "docid": "7cb631f76fec7aa9038bf10a8ce4a80a", "score": "0.6275712", "text": "func (s *ptSorter) Less(i, j int) bool {\n\treturn s.by(s.points[i], s.points[j])\n}", "title": "" }, { "docid": "5b385c059620ef6b028063e71303ac7c", "score": "0.6273111", "text": "func (v Effs) Sort(comp func(a, b Effect) bool) {\n\tif len(v) < 2 {\n\t\treturn\n\t}\n\t// Template is part of its self, how amazing\n\tps := make(templates.IntVec, 2, len(v))\n\tps[0], ps[1] = -1, len(v)\n\n\tvar (\n\t\tp Effect\n\n\t\tl, e, s, j int\n\t)\n\n\tfor {\n\t\tl = len(ps)\n\n\t\te = ps[l-1] - 1\n\t\tif e <= 0 {\n\t\t\treturn\n\t\t}\n\n\t\ts = ps[l-2] + 1\n\t\tp = v[e]\n\n\t\tif s < e {\n\t\t\tfor j = s; j < e; j++ {\n\t\t\t\tif comp(v[j], p) {\n\t\t\t\t\tv.Swap(s, j)\n\t\t\t\t\ts++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tv.Swap(s, e)\n\t\t\tps.Insert(l-1, s)\n\t\t} else {\n\t\t\tps = ps[:l-1]\n\t\t}\n\t}\n}", "title": "" }, { "docid": "98833cfe58a964575fb9d0160703f413", "score": "0.6270041", "text": "func (slice ocrResults) Less(i, j int) bool {\n\treturn slice[i].path < slice[j].path\n}", "title": "" }, { "docid": "4fff0ac9025c01c66943cef879c8d83f", "score": "0.62649536", "text": "func (b Benchs) Less(i, j int) bool {\n\treturn b.Bs[i].NsPerOp < b.Bs[j].NsPerOp\n}", "title": "" }, { "docid": "8ed89e15bce346e02605415ac68b86f7", "score": "0.62590724", "text": "func (list List) Less(i, j int) bool {\n\treturn list[i].Name < list[j].Name\n}", "title": "" }, { "docid": "8ed89e15bce346e02605415ac68b86f7", "score": "0.62590724", "text": "func (list List) Less(i, j int) bool {\n\treturn list[i].Name < list[j].Name\n}", "title": "" }, { "docid": "3e3756d18e48e66d3a2d5d766943387d", "score": "0.6256896", "text": "func (l byName) Less(i, j int) bool {\n\tif l.Items[i].IsDir && !l.Items[j].IsDir {\n\t\treturn true\n\t}\n\n\tif !l.Items[i].IsDir && l.Items[j].IsDir {\n\t\treturn false\n\t}\n\n\treturn natural.Less(strings.ToLower(l.Items[j].Name), strings.ToLower(l.Items[i].Name))\n}", "title": "" }, { "docid": "7bd701eb52776e8f2a98ab6b865ae6e7", "score": "0.62519014", "text": "func (s *seqSorter) Less(i, j int) bool {\n\treturn s.by(s.seqs[i], s.seqs[j])\n}", "title": "" }, { "docid": "1342ccfa4e569b9f3bb1125f18ff5f30", "score": "0.62249875", "text": "func (vs ValueSorter) Less(i int, j int) bool {\n\treturn vs.vals[i] < vs.vals[j]\n}", "title": "" }, { "docid": "0a1dfa0fd0d8744d4cada00637a921c5", "score": "0.62139136", "text": "func (s sortRunes) Less(i, j int) bool {\n return s[i] < s[j]\n}", "title": "" }, { "docid": "aa2d74450762cac4ec3ce53a78600486", "score": "0.62115335", "text": "func (s priorityItems) Less(i, j int) bool {\n\treturn s[i].Compare(s[j]) < 0\n}", "title": "" }, { "docid": "beff7c357a349f6760f6be521239c0d0", "score": "0.61961764", "text": "func (s SortByDate) Less(i, j int) bool {\n\ta, b := s[i], s[j]\n\n\tif a.Before(&b) {\n\t\treturn true\n\t}\n\n\tif a.After(&b) {\n\t\treturn false\n\t}\n\n\treturn a.Tag < b.Tag\n}", "title": "" }, { "docid": "7287111d200faeb4995cc5b1eaa9b791", "score": "0.6193262", "text": "func (vd FunctionDefinitions) Less(i, j int) bool {\n\treturn vd[i].Name < vd[j].Name\n}", "title": "" }, { "docid": "5f966d0f707bf17432f5d548b2384780", "score": "0.6190417", "text": "func (s indexStatusSorter) Less(i, j int) bool {\n\tif s[i].Name < s[j].Name {\n\t\treturn true\n\t}\n\n\tif s[i].Name > s[j].Name {\n\t\treturn false\n\t}\n\n\tif s[i].Collection < s[j].Collection {\n\t\treturn true\n\t}\n\n\tif s[i].Collection > s[j].Collection {\n\t\treturn false\n\t}\n\n\tif s[i].Scope < s[j].Scope {\n\t\treturn true\n\t}\n\n\tif s[i].Scope > s[j].Scope {\n\t\treturn false\n\t}\n\n\treturn s[i].Bucket < s[j].Bucket\n}", "title": "" }, { "docid": "11833f8beef7d78f806bd234f3f7442b", "score": "0.6190107", "text": "func (ms *Models) Less(i, j int) bool {\n\ta := ms.l[i]\n\tb := ms.l[j]\n\n\tif a.Name < b.Name {\n\t\treturn true\n\t} else if a.Name > b.Name {\n\t\treturn false\n\t}\n\n\treturn a.Version < b.Version\n}", "title": "" }, { "docid": "76778bc8c29e752467e979e68df1ba7f", "score": "0.6185736", "text": "func (ops OpList) Less(i, j int) bool {\n\tif ops[i].Service == ops[j].Service {\n\t\tif len(ops[i].Tags) == 1 && len(ops[j].Tags) == 1 {\n\t\t\tif ops[i].Tags[0] == ops[j].Tags[0] {\n\t\t\t\treturn ops[i].Method < ops[j].Method\n\t\t\t}\n\t\t\treturn ops[i].Tags[0] < ops[j].Tags[0]\n\t\t}\n\t\treturn ops[i].OperationID < ops[j].OperationID\n\t}\n\treturn ops[i].Service < ops[j].Service\n}", "title": "" }, { "docid": "1db2dc6fbf8e5f4736db877acc3d6bc7", "score": "0.61823064", "text": "func (os Objects) Less(i, j int) bool { return os[i].Weight < os[j].Weight }", "title": "" }, { "docid": "db4125fbc92ed42f87c25b44a890ab4d", "score": "0.6182128", "text": "func (l reflectWithStringSlice) Less(i, j int) bool {\n\treturn l[i].s < l[j].s\n}", "title": "" }, { "docid": "ca7f72d4d2e4e12d674034cf18514a99", "score": "0.61688066", "text": "func (c cardList) Less(i, j int) bool {\n\treturn c[i].value > c[j].value\n}", "title": "" }, { "docid": "bfe77269a6c10cb9171a196ebcd98982", "score": "0.615314", "text": "func (o *oracle) Less(i, j int) bool {\n\treturn o.data[i] < o.data[j]\n}", "title": "" }, { "docid": "24247da830e41dfcf13e1be170d6c656", "score": "0.6135388", "text": "func (z Zaehlerstaende) Less(i, j int) bool {\n\treturn z[i].Ablesedatum.After(z[j].Ablesedatum)\n}", "title": "" }, { "docid": "bbe9e1cbebc4b1fbab33a4b56de7122d", "score": "0.6134717", "text": "func (list NodeList) Less(i, j int) bool {\n\treturn list[i].Index < list[j].Index\n}", "title": "" }, { "docid": "d75e7d0af8ee9b9bc7fd1c132098f3fd", "score": "0.61334854", "text": "func (taskList TaskList) Less(i, j int) bool {\n\treturn taskList[i].GetPriority() > taskList[j].GetPriority()\n}", "title": "" }, { "docid": "b348d72f31be8899ec11eac9e2dff8e0", "score": "0.61287624", "text": "func (p byName) Less(i, j int) bool {\n\treturn p[i].name < p[j].name\n}", "title": "" }, { "docid": "16953cba8c8bdb4d8e11d6e77efe9b42", "score": "0.6126783", "text": "func (s byPriority) Less(i, j int) bool {\n\tvar prio1, prio2 uint = 50, 50\n\n\tif prior1, ok := s[i].(Priority); ok {\n\t\tprio1 = prior1.Priority()\n\t}\n\tif prior2, ok := s[j].(Priority); ok {\n\t\tprio2 = prior2.Priority()\n\t}\n\n\treturn prio1 > prio2\n}", "title": "" }, { "docid": "dda51907cb0bbc8118d657ef1cb8d03f", "score": "0.61204123", "text": "func (spf sortPlanFiles) Less(i, j int) bool {\n\t_, parti, err := JobPartPlanFileName(spf.Files[i].Name()).Parse()\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"error parsing the JobPartPlanfile name %s. Failed with error %s\", spf.Files[i].Name(), err.Error()))\n\t}\n\t_, partj, err := JobPartPlanFileName(spf.Files[j].Name()).Parse()\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"error parsing the JobPartPlanfile name %s. Failed with error %s\", spf.Files[j].Name(), err.Error()))\n\t}\n\treturn parti < partj\n}", "title": "" }, { "docid": "69192154e4dc56ca01e627539ecb961f", "score": "0.61194247", "text": "func (d *issueSorter) Less(i, j int) bool {\n\treturn d.by(&d.issues[i], &d.issues[j])\n}", "title": "" }, { "docid": "85e9009e7494009f80a85d45f2bade2a", "score": "0.61099464", "text": "func (s *txSorter) Less(i, j int) bool {\n\treturn s.transactions[i].Timestamp.Before(s.transactions[j].Timestamp)\n}", "title": "" }, { "docid": "40b953de3bd8e38692b1611bd837a00c", "score": "0.61051124", "text": "func (f functionSlice) Less(i, j int) bool {\n\treturn f[i].Line < f[j].Line || f[i].Line == f[j].Line && f[i].Name < f[j].Name\n}", "title": "" }, { "docid": "9cbf51764485981942289853b93d6391", "score": "0.60863954", "text": "func (s *errataSorter) Less(i, j int) bool {\n\treturn s.by(&s.errata[i], &s.errata[j])\n}", "title": "" }, { "docid": "b5bd5aa9441c0c7ac949e9d4efaf04c4", "score": "0.6086316", "text": "func (idx ArticleIndex) Less(i, j int) bool {\n\treturn idx[j].Created.Before(idx[i].Created)\n}", "title": "" }, { "docid": "e23a0885741285d44548a73a7002b370", "score": "0.60832393", "text": "func (s *sectionDetailSorter) Less(i, j int) bool {\n\treturn s.by(&s.details[i], &s.details[j])\n}", "title": "" }, { "docid": "c2964d6856a14ab8904e1e3ee4a0e3dc", "score": "0.6082429", "text": "func (s *stringSorter) Less(x, y int) bool {\n\treturn s.by(&s.data[x], &s.data[y])\n}", "title": "" }, { "docid": "9d6329f224cabf98cf68e1fba8803d23", "score": "0.608102", "text": "func (b ByName) Less(i, j int) bool { return b[i].Name < b[j].Name }", "title": "" }, { "docid": "5b07a28ae4cb7849f78331d71ecc8ac8", "score": "0.60760504", "text": "func (ts TableStats) Less(i, j int) bool {\n\t// Sort with most recent first.\n\treturn ts[i].CreatedAt().Unix() > ts[j].CreatedAt().Unix()\n}", "title": "" }, { "docid": "cfbbcc96d5bc71263605975fe392f612", "score": "0.60743296", "text": "func (a Atoms) Less(i, j int) bool {\n\treturn a[i].atom < a[j].atom\n}", "title": "" }, { "docid": "b5e67a11e0c27613b718b8da3c941cd3", "score": "0.6073203", "text": "func Less(frame wdte.Frame, args ...wdte.Func) wdte.Func {\n\tif len(args) <= 1 {\n\t\treturn wdteutil.SaveArgsReverse(wdte.GoFunc(Less), args...)\n\t}\n\n\ta1 := args[0]\n\tif _, ok := a1.(error); ok {\n\t\treturn a1\n\t}\n\n\ta2 := args[1]\n\tif _, ok := a2.(error); ok {\n\t\treturn a2\n\t}\n\n\tif cmp, ok := a1.(wdte.Comparer); ok {\n\t\tc, ord := cmp.Compare(a2)\n\t\tif ord {\n\t\t\treturn wdte.Bool(c < 0)\n\t\t}\n\t}\n\n\tif cmp, ok := a2.(wdte.Comparer); ok {\n\t\tc, ord := cmp.Compare(a1)\n\t\tif ord {\n\t\t\treturn wdte.Bool(c > 0)\n\t\t}\n\t}\n\n\treturn wdte.Error{\n\t\tErr: fmt.Errorf(\"Unable to compare %v and %v\", a1, a2),\n\t\tFrame: frame,\n\t}\n}", "title": "" }, { "docid": "9ed563f8493bf89ba3fdbf9cbbffff96", "score": "0.60724247", "text": "func (g Genres) Less(i, j int) bool {\n\treturn g[i] < g[j]\n}", "title": "" }, { "docid": "c0872e9468d3f25088ec1c0663979046", "score": "0.60682106", "text": "func (s *containerSorter) Less(i, j int) bool {\n\treturn s.by(s.containers[i], s.containers[j])\n}", "title": "" }, { "docid": "4e2addfff3b75d69be08ad68aef9bbfd", "score": "0.60647583", "text": "func (vs VersionSlice) Less(i, j int) bool {\n\treturn Vercmp(vs[i], vs[j]) == -1\n}", "title": "" }, { "docid": "2dd5cc4094c6decdafc8ccc1b100ac35", "score": "0.60483813", "text": "func SortRepeated(lessFunc interface{}) cmp.Option {\n\tt, ok := checkTTBFunc(lessFunc)\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"invalid less function: %T\", lessFunc))\n\t}\n\n\tvar opt cmp.Option\n\tvar sliceType reflect.Type\n\tswitch vf := reflect.ValueOf(lessFunc); {\n\tcase t.Implements(enumV2Type):\n\t\tet := reflect.Zero(t).Interface().(protoreflect.Enum).Type()\n\t\tlessFunc = func(x, y Enum) bool {\n\t\t\tvx := reflect.ValueOf(et.New(x.Number()))\n\t\t\tvy := reflect.ValueOf(et.New(y.Number()))\n\t\t\treturn vf.Call([]reflect.Value{vx, vy})[0].Bool()\n\t\t}\n\t\topt = FilterDescriptor(et.Descriptor(), cmpopts.SortSlices(lessFunc))\n\t\tsliceType = reflect.SliceOf(enumReflectType)\n\tcase t.Implements(messageV2Type):\n\t\tmt := reflect.Zero(t).Interface().(protoreflect.ProtoMessage).ProtoReflect().Type()\n\t\tlessFunc = func(x, y Message) bool {\n\t\t\tmx := mt.New().Interface()\n\t\t\tmy := mt.New().Interface()\n\t\t\tproto.Merge(mx, x)\n\t\t\tproto.Merge(my, y)\n\t\t\tvx := reflect.ValueOf(mx)\n\t\t\tvy := reflect.ValueOf(my)\n\t\t\treturn vf.Call([]reflect.Value{vx, vy})[0].Bool()\n\t\t}\n\t\topt = FilterDescriptor(mt.Descriptor(), cmpopts.SortSlices(lessFunc))\n\t\tsliceType = reflect.SliceOf(messageReflectType)\n\tdefault:\n\t\tswitch t {\n\t\tcase reflect.TypeOf(bool(false)):\n\t\tcase reflect.TypeOf(int32(0)):\n\t\tcase reflect.TypeOf(int64(0)):\n\t\tcase reflect.TypeOf(uint32(0)):\n\t\tcase reflect.TypeOf(uint64(0)):\n\t\tcase reflect.TypeOf(float32(0)):\n\t\tcase reflect.TypeOf(float64(0)):\n\t\tcase reflect.TypeOf(string(\"\")):\n\t\tcase reflect.TypeOf([]byte(nil)):\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"invalid element type: %v\", t))\n\t\t}\n\t\topt = cmpopts.SortSlices(lessFunc)\n\t\tsliceType = reflect.SliceOf(t)\n\t}\n\n\treturn cmp.FilterPath(func(p cmp.Path) bool {\n\t\t// Filter to only apply to repeated fields within a message.\n\t\tif t := p.Index(-1).Type(); t == nil || t != sliceType {\n\t\t\treturn false\n\t\t}\n\t\tif t := p.Index(-2).Type(); t == nil || t.Kind() != reflect.Interface {\n\t\t\treturn false\n\t\t}\n\t\tif t := p.Index(-3).Type(); t == nil || t != messageReflectType {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}, opt)\n}", "title": "" }, { "docid": "74834a3af46cc5c94ea7b745087b6e29", "score": "0.6043931", "text": "func (heros Herosclice ) Less(i, j int) bool{\n\tif heros[i].Age > heros[j].Age {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "b52b454b24853dfa8757897028c7b326", "score": "0.60415184", "text": "func (s PropertyList) Less(i, j int) bool {\n\treturn s[i].Id < s[j].Id\n}", "title": "" }, { "docid": "a0fa5e2b766200b07f947c1f62a0341f", "score": "0.604137", "text": "func (s ByViewers) Less(i, j int) bool {\n\treturn s.ChanViewersList[i].Viewers < s.ChanViewersList[j].Viewers\n}", "title": "" }, { "docid": "31faec713049b6d3d6ca53ecf32adfe6", "score": "0.6036724", "text": "func (a blockAry) Less(i, j int) bool {\n\treturn a[i].Offset < a[j].Offset\n}", "title": "" }, { "docid": "7202869150e5f4a770044673d5b07998", "score": "0.60313314", "text": "func (c codeBlockSlice) Less(i, j int) bool {\n\treturn c[i].Order < c[j].Order\n}", "title": "" }, { "docid": "7b6bff8bbeed7d7e87e7c43d4b787be9", "score": "0.6027354", "text": "func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {\n\tif h, ok := a.t.(tHelper); ok {\n\t\th.Helper()\n\t}\n\treturn Less(a.t, e1, e2, msgAndArgs...)\n}", "title": "" }, { "docid": "39bb1f11f76bb82e40fe8ffbc81afaed", "score": "0.6022521", "text": "func (a SortResultsByCol) Less(i, j int) bool {\n\tif a.Col == SORT_COUNT {\n\t\tt1 := a.Results[i].Count\n\t\tt2 := a.Results[j].Count\n\n\t\treturn t1 > t2\n\t}\n\n\tt1 := a.Results[i].Hists[a.Col].Mean()\n\tt2 := a.Results[j].Hists[a.Col].Mean()\n\treturn t1 > t2\n}", "title": "" }, { "docid": "5960fa6a74d53fd0ba53067211563a84", "score": "0.6018523", "text": "func (b ByFrontEndValue) Less(i, j int) bool {\n\tif b[i].FrontendValue-b[i].BackendValue < b[j].FrontendValue-b[j].BackendValue {\n\t\treturn true\n\t}\n\tif b[i].FrontendValue-b[i].BackendValue == b[j].FrontendValue-b[j].BackendValue {\n\t\tif b[i].FrontendValue < b[j].FrontendValue {\n\t\t\treturn true\n\t\t}\n\t\tif b[i].FrontendValue == b[j].FrontendValue {\n\t\t\treturn b[i].BackendValue < b[j].BackendValue\n\t\t}\n\n\t}\n\treturn false\n}", "title": "" }, { "docid": "df4a32458c7d3286d67698a27b78e958", "score": "0.60126346", "text": "func OrderedBy(less ...lessFunc) *MultiSorter {\n\treturn &MultiSorter{\n\t\tless: less,\n\t}\n}", "title": "" }, { "docid": "6f93d76a1505018060a13ea190b68912", "score": "0.6012199", "text": "func (b brownianStateSlice) Less(i, j int) bool {\n\treturn b[i].t <= b[j].t\n}", "title": "" }, { "docid": "784cb24886a3795e6c4b39ad9a0738b1", "score": "0.6010803", "text": "func (s fltSliceAsc) Less(i, j int) bool {\n\treturn s.Float64Slice.All()[i].(float64) < s.Float64Slice.All()[j].(float64)\n}", "title": "" }, { "docid": "098e4e9e3bf4b4add0258548846c9641", "score": "0.60090387", "text": "func (s SelectorStyles) Less(i, j int) bool {\n\tsi, sj := s[i].weight(), s[j].weight()\n\tif si.A < sj.A {\n\t\treturn true\n\t} else if si.A == sj.A {\n\t\tif si.B < sj.B {\n\t\t\treturn true\n\t\t} else if si.B == sj.B {\n\t\t\tif si.C < sj.C {\n\t\t\t\treturn true\n\t\t\t} else if si.C == sj.C && si.D < sj.D {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d36780f899bbc5a0f2f4f655934a94e3", "score": "0.6002035", "text": "func less(a, b interface{}) (bool, error) {\n\tif reflect.TypeOf(a).Kind() != reflect.TypeOf(b).Kind() {\n\t\treturn false, errors.New(\"two params with different types\")\n\t}\n\tif !reflect.TypeOf(a).Comparable() {\n\t\treturn false, errors.New(\"not comparable\")\n\t}\n\tswitch a.(type) {\n\tcase int8, int16, int32, int64, int, uint8, uint16, uint32, uint64, uint:\n\t\treturn reflect.ValueOf(a).Int() < reflect.ValueOf(b).Int(), nil\n\tcase float32, float64:\n\t\treturn reflect.ValueOf(a).Float() < reflect.ValueOf(b).Float(), nil\n\tcase string:\n\t\treturn reflect.ValueOf(a).String() < reflect.ValueOf(b).String(), nil\n\tdefault:\n\t\treturn false, errors.New(\"type unsupported\")\n\t}\n}", "title": "" }, { "docid": "f6fc729a79e815e56657649c3959f63a", "score": "0.59934795", "text": "func (ss specs) Less(i, j int) bool {\n\tif ss[i].q > ss[j].q {\n\t\treturn true\n\t}\n\tif ss[i].q == ss[j].q {\n\t\tif ss[i].val == \"*\" || strings.HasSuffix(ss[i].val, \"/*\") {\n\t\t\treturn true\n\t\t}\n\n\t\tif ss[j].val == \"*\" || strings.HasSuffix(ss[j].val, \"/*\") {\n\t\t\treturn false\n\t\t}\n\n\t\treturn i < j\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "f6fc729a79e815e56657649c3959f63a", "score": "0.59934795", "text": "func (ss specs) Less(i, j int) bool {\n\tif ss[i].q > ss[j].q {\n\t\treturn true\n\t}\n\tif ss[i].q == ss[j].q {\n\t\tif ss[i].val == \"*\" || strings.HasSuffix(ss[i].val, \"/*\") {\n\t\t\treturn true\n\t\t}\n\n\t\tif ss[j].val == \"*\" || strings.HasSuffix(ss[j].val, \"/*\") {\n\t\t\treturn false\n\t\t}\n\n\t\treturn i < j\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b2e1bacf45777819f793870e62165850", "score": "0.5963627", "text": "func (b ByVersion) Less(i, j int) bool {\n\tcmp := version.CompareSimple(version.Normalize(b[i].ID), version.Normalize(b[j].ID))\n\n\tif cmp == 0 {\n\t\treturn b[i].ID < b[j].ID\n\t}\n\n\treturn cmp < 0\n}", "title": "" }, { "docid": "adfe02b399de4140388c991c70c6dd90", "score": "0.59593767", "text": "func (s Seq) Less(i, j int) bool {\n\tvi, _ := strconv.Atoi(s.seq[i])\n\tvj, _ := strconv.Atoi(s.seq[j])\n\treturn vi < vj\n}", "title": "" }, { "docid": "57add742ee18c10c897f934f20de5845", "score": "0.59559625", "text": "func (ci *ckindex) less(idx int, ts int64) (record, error) {\n\tif err := ci.acquireRead(); err != nil {\n\t\treturn record{}, err\n\t}\n\n\tr, err := ci.lessInt(idx, ts)\n\tci.releaseRead()\n\treturn r, err\n}", "title": "" }, { "docid": "b28eba09379c9fd3ba789ea3bb1987c5", "score": "0.59441257", "text": "func (list IPv4List) Less(i, j int) bool {\n\tcmp, _ := list[i].Cmp(list[j])\n\treturn cmp == -1\n}", "title": "" } ]
b4523a96952f8fd96658c35330151f3a
Count returns the count of all ScheduleSubject records in the query.
[ { "docid": "a9e8f025e136a88404f43442e6475ef1", "score": "0.8782654", "text": "func (q scheduleSubjectQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count schedule_subject rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" } ]
[ { "docid": "0a592fa1ced59357edde985b7284ceaf", "score": "0.6425641", "text": "func (esq *EventSeverityQuery) Count(ctx context.Context) (int, error) {\n\tif err := esq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn esq.sqlCount(ctx)\n}", "title": "" }, { "docid": "c5900497a1bfce8f5e960330d77e0530", "score": "0.6416247", "text": "func (s *NewsService) Count(rs app.RequestScope) (int, error) {\n\treturn s.dao.Count(rs)\n}", "title": "" }, { "docid": "efb781bdbb4eb334af416bf5b94c545b", "score": "0.63495576", "text": "func (q subscriberQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count subscribers rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "888f96a3f153040ec682da94d5194c51", "score": "0.63377076", "text": "func (wq *WorkflowQuery) Count(ctx context.Context) (int, error) {\n\tif err := wq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn wq.sqlCount(ctx)\n}", "title": "" }, { "docid": "c923328f28d507c51ef3689937abe0fb", "score": "0.6205251", "text": "func (pq *ParticipantQuery) Count(ctx context.Context) (int, error) {\n\tif err := pq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn pq.sqlCount(ctx)\n}", "title": "" }, { "docid": "8e5866776756402ed7f7ea78874ac853", "score": "0.6203731", "text": "func (q rssAnnouncementQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count rss_announcements rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "43ce13227d30f86e5d04c35203b0501f", "score": "0.620287", "text": "func Count(query db.Q) (int, error) {\n\treturn db.CountQ(Collection, query)\n}", "title": "" }, { "docid": "1a83beb84561c923c1560493247aa457", "score": "0.6155387", "text": "func (pgq *PlayGroupQuery) Count(ctx context.Context) (int, error) {\n\tif err := pgq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn pgq.sqlCount(ctx)\n}", "title": "" }, { "docid": "99d947b9a415d0175aae2276460f85af", "score": "0.6131879", "text": "func (qs ConstraintQuerySet) Count() (int, error) {\n\tvar count int\n\terr := qs.db.Count(&count).Error\n\treturn count, err\n}", "title": "" }, { "docid": "9c619bc336c16c91c84923332b1ab204", "score": "0.6116772", "text": "func (wtq *WorkerTypeQuery) Count(ctx context.Context) (int, error) {\n\tif err := wtq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn wtq.sqlCount(ctx)\n}", "title": "" }, { "docid": "07500614cefbde9f98260df67e77a3cf", "score": "0.6075378", "text": "func (rrq *ReserveRoomQuery) Count(ctx context.Context) (int, error) {\n\tif err := rrq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn rrq.sqlCount(ctx)\n}", "title": "" }, { "docid": "11eceadcb4d85639746b19ece5e76296", "score": "0.6064759", "text": "func (s *StatsPeriodStore) Count(q *StatsPeriodQuery) (int64, error) {\n\treturn s.Store.Count(q)\n}", "title": "" }, { "docid": "b1584e1322aa85aba695207fc7b63d3c", "score": "0.60485595", "text": "func (cq *CartQuery) Count(ctx context.Context) (int, error) {\n\tif err := cq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn cq.sqlCount(ctx)\n}", "title": "" }, { "docid": "0e8dbd6e439c05d1f10387160e375355", "score": "0.60130835", "text": "func (rdq *ResultsDefinitionQuery) Count(ctx context.Context) (int, error) {\n\tif err := rdq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn rdq.sqlCount(ctx)\n}", "title": "" }, { "docid": "9a19d022ca2fd9bbd39837c0101b1b3f", "score": "0.59844357", "text": "func (rq *RemedyQuery) Count(ctx context.Context) (int, error) {\n\tif err := rq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn rq.sqlCount(ctx)\n}", "title": "" }, { "docid": "7a1edce556f9184422a89c83ee7b574b", "score": "0.5980226", "text": "func (mm *Model) Count(query interface{}) (int, error) {\n\treturn mm.executeInt(func(c CachedCollection) (int, error) {\n\t\treturn c.Count(query)\n\t})\n}", "title": "" }, { "docid": "0bdd11c6aad255b24b6721087132932b", "score": "0.5972101", "text": "func (sch *schema) Count(filter []byte) int {\n\tvar filterQuery interface{}\n\tbson.UnmarshalJSON(filter, &filterQuery)\n\tquery := sch.Collection.Find(filterQuery).Sort(\"_id\")\n\n\tcount, _ := query.Count()\n\treturn count\n}", "title": "" }, { "docid": "20b27ed545f999df2d1b58a065e94058", "score": "0.59652144", "text": "func (q emailQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"mysql: failed to count email rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "c7e5d644b3a58b1455ec4331be823be7", "score": "0.59620506", "text": "func (q instrumentClassQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count instrument_class rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "1d832c6bc9c95d17a989a57996204e44", "score": "0.59595466", "text": "func (q *DeferredQuery) Count() (int, error) {\n\topt := mopt.Count()\n\tfilter := q.Filter\n\tif filter == nil {\n\t\tfilter = bson.D{}\n\t}\n\tc, err := q.Coll.CountDocuments(nil, filter, opt)\n\treturn int(c), err\n}", "title": "" }, { "docid": "1c98f0d7cc7ab3a4d647a7610a31de6d", "score": "0.5945932", "text": "func (rq *ReceiptQuery) Count(ctx context.Context) (int, error) {\n\tif err := rq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn rq.sqlCount(ctx)\n}", "title": "" }, { "docid": "de2140f3cab92f90b9dd24ba5ce2eda0", "score": "0.5945236", "text": "func (q notificationQuery) Count(exec boil.Executor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count notification rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "e4e5ae64da8de6682875a977124d9f29", "score": "0.5929486", "text": "func (wewq *WorkflowEventsWaitQuery) Count(ctx context.Context) (int, error) {\n\tif err := wewq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn wewq.sqlCount(ctx)\n}", "title": "" }, { "docid": "4a1a02a06f370eba70183d35914b4859", "score": "0.5906125", "text": "func (s *SessionStore) Count(q *SessionQuery) (int64, error) {\n\treturn s.Store.Count(q)\n}", "title": "" }, { "docid": "07b5593ec21ba95a951072f947f92589", "score": "0.5901513", "text": "func (pq *PersonQuery) Count(ctx context.Context) (int, error) {\n\tif err := pq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn pq.sqlCount(ctx)\n}", "title": "" }, { "docid": "12ace73fb9a4c72c9eb6ac6794c1d8a3", "score": "0.5900618", "text": "func (q authMessageQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count auth_message rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "943a6b48959c588a050c1cabfe544b7f", "score": "0.58956665", "text": "func (ksq *KqiSourceQuery) Count(ctx context.Context) (int, error) {\n\tif err := ksq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn ksq.sqlCount(ctx)\n}", "title": "" }, { "docid": "f06849a3ba42328d19b502a21da48916", "score": "0.5890759", "text": "func (q cmfTurntableQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count cmf_turntable rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "76ac903aec949f24017320a69ce93547", "score": "0.58843726", "text": "func (q channelQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count channels rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "29764c4456221ece14ac65353483e909", "score": "0.5860141", "text": "func (q jetQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count jets rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "e291b73be1b48350774d48ff470f77be", "score": "0.58582354", "text": "func Count(s Session, dbname string, collection string, query map[string]interface{}) (int, error) {\n\treturn s.DB(dbname).C(collection).Find(query).Count()\n}", "title": "" }, { "docid": "36d84b244d4edd962c0d609a8dbbbf9b", "score": "0.58541274", "text": "func (s *PersonStore) Count(q *PersonQuery) (int64, error) {\n\treturn s.Store.Count(q)\n}", "title": "" }, { "docid": "d9d9f5a5798e68b356fd188b8c46e027", "score": "0.58358175", "text": "func (h *handler) Count(ctx context.Context, params db.Params) int {\n\tbsonFilter := bson.M{}\n\tfor key, val := range params.Filter {\n\t\tbsonFilter[key] = val\n\t}\n\tcount, _ := h.getDatabase(params.Database).C(params.Collection).Find(bsonFilter).Count()\n\treturn count\n}", "title": "" }, { "docid": "70d9009f2b831c257f123ba7776f7fb7", "score": "0.5824155", "text": "func (t *Table) Count(cond *ConditionList) (*QueryResult, error) {\n\treturn t.query(cond, &SDK.QueryInput{\n\t\tSelect: pointers.String(SelectCount),\n\t})\n}", "title": "" }, { "docid": "8d43dd8e52602c7803cfab5f7fd1e90e", "score": "0.58160293", "text": "func CountSchedulesCon(db *sql.DB) ([]Contribution, error) {\n\trows, err := db.Query(\"select sched, count(sched) \" +\n\t\t\"from contributes \" +\n\t\t\"group by sched \" +\n\t\t\"order by count(sched) desc\")\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer rows.Close()\n\n\tamounts := make([]Contribution, 0, 6)\n\tfor rows.Next() {\n\t\tvar amount Contribution\n\t\terr = rows.Scan(&amount.Sched, &amount.Count)\n\t\tif err == nil {\n\t\t\tamounts = append(amounts, amount)\n\t\t}\n\t}\n\n\treturn amounts, nil\n\n}", "title": "" }, { "docid": "c26f8b7a8b5cb35e8d18e3104abc889c", "score": "0.5814455", "text": "func (s *GodrorStorage) CountUsersBySubjectFK(db XODB, subject string, queryArgs *UserQueryArguments) (int, error) {\n\tqueryArgs = ApplyUserQueryArgsDefaults(queryArgs)\n\n\tdead := \"NULL\"\n\tif *queryArgs.Dead {\n\t\tdead = \"NOT NULL\"\n\t}\n\n\tvar params []interface{}\n\tplaceHolders := \"\"\n\tparams = append(params, subject)\n\tplaceHolders = fmt.Sprintf(`%s \"subject\" = :%d AND `, placeHolders, len(params))\n\n\tvar err error\n\tvar sqlstr = fmt.Sprintf(`SELECT count(*) from \"AC\".\"user\" WHERE %s \"deleted_date\" IS %s`, placeHolders, dead)\n\ts.Logger.Info(sqlstr)\n\n\tvar count int\n\terr = db.QueryRow(sqlstr, params...).Scan(&count)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\treturn count, nil\n}", "title": "" }, { "docid": "c6367b257dd85573e96dccf619c5203d", "score": "0.5799688", "text": "func (irq *InstanceRuntimeQuery) Count(ctx context.Context) (int, error) {\n\tif err := irq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn irq.sqlCount(ctx)\n}", "title": "" }, { "docid": "a8df0d7fd9a698dde555308f1c7c2a6b", "score": "0.57926726", "text": "func (epdq *EquipmentPortDefinitionQuery) Count(ctx context.Context) (int, error) {\n\treturn epdq.sqlCount(ctx)\n}", "title": "" }, { "docid": "da6229752305875b598aee4b4132a4a1", "score": "0.57809937", "text": "func (rlq *RuleLimitQuery) Count(ctx context.Context) (int, error) {\n\tif err := rlq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn rlq.sqlCount(ctx)\n}", "title": "" }, { "docid": "0341686492e9d22b8ecf09384e303dc3", "score": "0.57803786", "text": "func (q automodRuleDatumQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count automod_rule_data rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "edd4d539293705cc39d0934ee727f79d", "score": "0.57735187", "text": "func (c *Core) Count(ctx context.Context, filter QueryFilter) (int, error) {\n\treturn c.storer.Count(ctx, filter)\n}", "title": "" }, { "docid": "47c4f2f884b2e58e84996df8f78708e9", "score": "0.57635677", "text": "func (rq *RentQuery) Count(ctx context.Context) (int, error) {\n\tif err := rq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn rq.sqlCount(ctx)\n}", "title": "" }, { "docid": "d4329a25f871a688191f2e78149d38b6", "score": "0.57634515", "text": "func (cq *ConfirmationQuery) Count(ctx context.Context) (int, error) {\n\tif err := cq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn cq.sqlCount(ctx)\n}", "title": "" }, { "docid": "073e68dd8b96cc2cca156154e91e6997", "score": "0.576132", "text": "func (q cvtermsynonymQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"chado: failed to count cvtermsynonym rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "6980e4ffb562813fb57a1de049d07b97", "score": "0.5757035", "text": "func (instance *DSInstance) Count(ctx context.Context, query *datastore.Query) (int, error) {\n\treturn instance.client.Count(ctx, query)\n}", "title": "" }, { "docid": "dfc9acb823eadc243e71d41767a9aa43", "score": "0.5746944", "text": "func (q bookCategoryAssignQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count book_category_assign rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "6b5fd78fd2f1a4b407388d0f56265285", "score": "0.57427514", "text": "func (hq *HarborQuery) Count(ctx context.Context) (int, error) {\n\tif err := hq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn hq.sqlCount(ctx)\n}", "title": "" }, { "docid": "449889827937def41850490335076be8", "score": "0.57406884", "text": "func (q jobQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count jobs rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "98633783978a880b298de394aed22bc1", "score": "0.5734499", "text": "func (bcq *BaselineClassQuery) Count(ctx context.Context) (int, error) {\n\tif err := bcq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn bcq.sqlCount(ctx)\n}", "title": "" }, { "docid": "305d2e7c2976c2e2128fe593bbb3308a", "score": "0.57321346", "text": "func (q projectQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count project rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "5b175a58d9412338c410d5949ad9f7a9", "score": "0.5728638", "text": "func (dao *ArticleDAO) Count(rs app.RequestScope, filter string) (int, error) {\n\tvar count int\n\tq := rs.Tx().Select(\"COUNT(*)\").From(\"article\")\n\tif filter != \"\" {\n\t\tq.Where(dbx.Like(\"title\", filter))\n\t}\n\terr := q.Row(&count)\n\treturn count, err\n}", "title": "" }, { "docid": "10f37cd38844b77f48cc6ffbad6caae3", "score": "0.5728466", "text": "func (osq *OfflineSessionQuery) Count(ctx context.Context) (int, error) {\n\tif err := osq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn osq.sqlCount(ctx)\n}", "title": "" }, { "docid": "012d974cd05709abf46864cd119231b6", "score": "0.57225126", "text": "func (s *CategoryService) Count(rs app.RequestScope) (int, error) {\n\treturn s.dao.Count(rs)\n}", "title": "" }, { "docid": "0e68d2b56c10903aaf8321e4a90ccfbc", "score": "0.5722408", "text": "func (q organismQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"chado: failed to count organism rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "2053b4794ab1fd120a6a77ac05f203df", "score": "0.5714102", "text": "func (sq *ServerQuery) Count(ctx context.Context) (int, error) {\n\tif err := sq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn sq.sqlCount(ctx)\n}", "title": "" }, { "docid": "25e9a40688a4e34aa867842144031c41", "score": "0.57124805", "text": "func (omq *OutcomeMeasureQuery) Count(ctx context.Context) (int, error) {\n\tif err := omq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn omq.sqlCount(ctx)\n}", "title": "" }, { "docid": "493de13b8423a36f2fdc0fbdd58791eb", "score": "0.5710291", "text": "func (eq *EntityQuery) Count(ctx context.Context) (int, error) {\n\tif err := eq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn eq.sqlCount(ctx)\n}", "title": "" }, { "docid": "e92b7fc58a4cc87db1d884cca7f24776", "score": "0.57099396", "text": "func (fdq *FurnitureDetailQuery) Count(ctx context.Context) (int, error) {\n\tif err := fdq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn fdq.sqlCount(ctx)\n}", "title": "" }, { "docid": "ed1165713a36d80d7b7efb010f4e962a", "score": "0.5709906", "text": "func (siq *SubItemQuery) Count(ctx context.Context) (int, error) {\n\tif err := siq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn siq.sqlCount(ctx)\n}", "title": "" }, { "docid": "dea94e001b5d251bab504290093feb6a", "score": "0.5708056", "text": "func (q *Query) Count() (n int, err error) {\n\treturn q.q.Count()\n}", "title": "" }, { "docid": "6c41eda463bec8ad15c9c9eb776edd61", "score": "0.5704577", "text": "func (q projectQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count projects rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "64cdc0558d95a59079b9e3892fb49297", "score": "0.56984013", "text": "func (klq *K8sLabelQuery) Count(ctx context.Context) (int, error) {\n\tif err := klq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn klq.sqlCount(ctx)\n}", "title": "" }, { "docid": "4695dca2f32817fa733f144a7c9ad51d", "score": "0.5671875", "text": "func (q authQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count auths rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "fcfe9472eee6f67333136e6ca03b95e4", "score": "0.5662344", "text": "func (fq *ForumQuery) Count(ctx context.Context) (int, error) {\n\tif err := fq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn fq.sqlCount(ctx)\n}", "title": "" }, { "docid": "72dbc7489605f7ec62691c2002fd836a", "score": "0.5658952", "text": "func (tq *TeamQuery) Count(ctx context.Context) (int, error) {\n\tctx = setContextOp(ctx, tq.ctx, \"Count\")\n\tif err := tq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn withInterceptors[int](ctx, tq, querierCount[*TeamQuery](), tq.inters)\n}", "title": "" }, { "docid": "09ff5683aca197281e4618654b8bba36", "score": "0.5654233", "text": "func (igq *ItemGroupQuery) Count(ctx context.Context) (int, error) {\n\tif err := igq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn igq.sqlCount(ctx)\n}", "title": "" }, { "docid": "475a6efa6fe681fc0c1e877be4497a38", "score": "0.5644737", "text": "func Count(collection string, query interface{}) (int, error) {\n\n\tsession, db, err := GetGlobalSessionFactory().GetSession()\n\tif err != nil {\n\t\tgrip.Errorf(\"error establishing db connection: %+v\", err)\n\n\t\treturn 0, err\n\t}\n\tdefer session.Close()\n\n\treturn db.C(collection).Find(query).Count()\n}", "title": "" }, { "docid": "5404537e11f9628b840281e0f6d761bf", "score": "0.5636869", "text": "func (q taskQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count tasks rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "966a0154056f0528e0c98139eebd59d5", "score": "0.5629118", "text": "func (pq *PrizeQuery) Count(ctx context.Context) (int, error) {\n\tif err := pq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn pq.sqlCount(ctx)\n}", "title": "" }, { "docid": "48c3f5df57b614f9496048eeb24e6a5c", "score": "0.56288534", "text": "func (q sourceQuery) Count(exec boil.Executor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"mdbmodels: failed to count sources rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "b45f619960dbcda1839973d4445251a3", "score": "0.56256396", "text": "func (csq *ChatStoreQuery) Count(ctx context.Context) (int, error) {\n\tcount, err := dal.Chats(csq.Mods...).Count(ctx, csq.Store.getExecutor(ctx))\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn int(count), nil\n}", "title": "" }, { "docid": "fb83a3a5dea3d2bf93eb849d1eab6e5c", "score": "0.5613627", "text": "func (vq *VehicleQuery) Count(ctx context.Context) (int, error) {\n\tif err := vq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn vq.sqlCount(ctx)\n}", "title": "" }, { "docid": "9aa7e3b155a06882612cf45e58d67abd", "score": "0.56133693", "text": "func (q sourceQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"mdbmdbmodels: failed to count sources rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "2dd0e96f58a100378b105ae63e6d6a3d", "score": "0.5611028", "text": "func (eq *EntryQuery) Count(ctx context.Context) (int, error) {\n\tctx = setContextOp(ctx, eq.ctx, \"Count\")\n\tif err := eq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn withInterceptors[int](ctx, eq, querierCount[*EntryQuery](), eq.inters)\n}", "title": "" }, { "docid": "3ca84c11ad4ca0c038efabf9ce6fd6af", "score": "0.56046313", "text": "func (q ticketQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count tickets rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "6725f5fdccb7cf9da17f2ad72f961c3c", "score": "0.55961865", "text": "func (wfq *WithFieldsQuery) Count(ctx context.Context) (int, error) {\n\tif err := wfq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn wfq.sqlCount(ctx)\n}", "title": "" }, { "docid": "373ed5d5efdc45dacb156e28814aa4b1", "score": "0.55848515", "text": "func (qs SysDBQuerySet) Count() (int, error) {\n\tvar count int\n\terr := qs.db.Count(&count).Error\n\treturn count, err\n}", "title": "" }, { "docid": "c4c2e4e9d69f28e75a814897d8a9bf32", "score": "0.55830663", "text": "func (osq *OfflineSessionQuery) Count(ctx context.Context) (int, error) {\n\tctx = setContextOp(ctx, osq.ctx, \"Count\")\n\tif err := osq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn withInterceptors[int](ctx, osq, querierCount[*OfflineSessionQuery](), osq.inters)\n}", "title": "" }, { "docid": "171b4d7858807c0e82a6b05cffbf4436", "score": "0.55817884", "text": "func (ecpq *EntityContactPointQuery) Count(ctx context.Context) (int, error) {\n\tif err := ecpq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn ecpq.sqlCount(ctx)\n}", "title": "" }, { "docid": "8b9828ecbe395ccb361db2e004964972", "score": "0.55806917", "text": "func (qs GroupQuerySet) Count() (int, error) {\n\tvar count int\n\terr := qs.db.Count(&count).Error\n\treturn count, err\n}", "title": "" }, { "docid": "a1ea16009a90c4a03c81d34aebdb5112", "score": "0.55797416", "text": "func (q publisherSearchIdxQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count publisher_search_idx rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "3c57fc357b8df06d0dad81128535e227", "score": "0.5569175", "text": "func (q stockKeepingUnitContentQuery) Count(exec boil.Executor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"db: failed to count stock_keeping_unit_content rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "a8821355dec9a1f16591d08ccb3cdfa9", "score": "0.55625254", "text": "func (q currentChartDataMinutelyQuery) Count(exec boil.Executor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count current_chart_data_minutely rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "b53f4f45b6ea00e763a7a73e1e0241c2", "score": "0.5546676", "text": "func (o *StorageNetAppSnapshotPolicySchedule) GetCount() int64 {\n\tif o == nil || o.Count == nil {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\treturn *o.Count\n}", "title": "" }, { "docid": "f4328bfcc211a9057a37aeb3a84e5f87", "score": "0.5526723", "text": "func (q dMessageEmbedQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count d_message_embeds rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "cdc167c95f6304ac8e2033481889f6b3", "score": "0.5523822", "text": "func (mq *MongoQuery) Count() (num int, err error) {\n\tnum, err = mq.Query.Count()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn num, nil\n}", "title": "" }, { "docid": "6ba2844bd8317b673aeccb2fcb9d7339", "score": "0.5519507", "text": "func (tbl AssociationTable) Count(wh where.Expression) (count int64, err error) {\n\twhs, args := where.Where(wh, tbl.Dialect().Quoter())\n\treturn tbl.CountWhere(whs, args...)\n}", "title": "" }, { "docid": "32455fa27b197ad37913e06e1dbae4f9", "score": "0.5514404", "text": "func (s *Session) Count() (int64, error) {\n\ts.initStatemnt()\n\ts.Columns(\"count(*)\")\n\tsql, args, err := s.statement.ToSQL()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\ts.logger.Debugf(\"[Session Count] sql: %s, args: %v\", sql, args)\n\tvar count int64\n\ts.initCtx()\n\trows, err := s.QueryContext(s.ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\trows.Next()\n\terr = rows.Scan(&count)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn count, nil\n}", "title": "" }, { "docid": "8036feec6491f2f5f50898c23f76c600", "score": "0.5513555", "text": "func (s *RepositoryService) Count(rs app.RequestScope) (int64, error) {\n\treturn s.dao.Count(rs.DB())\n}", "title": "" }, { "docid": "78d76c6e3a1c8f6fca0daf9a76a77f94", "score": "0.5508647", "text": "func (q authUserUserPermissionQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count auth_user_user_permissions rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "0234f6ab80dc343d018169b07331e6c5", "score": "0.5505917", "text": "func (ouq *OrgUnitQuery) Count(ctx context.Context) (int, error) {\n\tif err := ouq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn ouq.sqlCount(ctx)\n}", "title": "" }, { "docid": "018d00adadf3a7ca70dd08b6a09dcf02", "score": "0.55027354", "text": "func (m *Member) Count() (count int64, err error) {\r\n\terr = DBConn.Table(m.TableName()).Where(`ecosystem=?`, m.ecosystem).Count(&count).Error\r\n\treturn\r\n}", "title": "" }, { "docid": "dcb74894e618de18adec73826cafb553", "score": "0.55004114", "text": "func (q assetQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to count asset rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "81a04d753cdf4b040f4026b412947d33", "score": "0.5498336", "text": "func (r *SmscSessionRepository) Count() (int, error) {\n\tcnt := 0\n\terr := app.BuntDBInMemory.View(func(tx *buntdb.Tx) error {\n\t\treturn tx.Ascend(SMSC_SESSION_PREFIX, func(key, value string) bool {\n\t\t\tcnt++\n\t\t\treturn true\n\t\t})\n\t})\n\treturn cnt, err\n}", "title": "" }, { "docid": "95c152bba19d424b310ab4f54e1c4d66", "score": "0.54950106", "text": "func (t *TaskRepository) Count() (count int, err error) {\n\terr = t.db.View(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(\"task\"))\n\t\tif b == nil {\n\t\t\treturn nil\n\t\t}\n\t\tcount = b.Stats().KeyN\n\t\treturn nil\n\t})\n\treturn count, err\n}", "title": "" }, { "docid": "2c9ae6e5391cc28f321f4d10c82fd55b", "score": "0.54904145", "text": "func (q activityLogQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"dbmodel: failed to count activity_logs rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "5cc440810bb85bc810f92c81e601be67", "score": "0.54860616", "text": "func (q stockCvtermQuery) Count() (int64, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"chado: failed to count stock_cvterm rows\")\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "6a18d4f1d602fe82b1797362d49f4fb9", "score": "0.5483501", "text": "func (deq *DentalExpenseQuery) Count(ctx context.Context) (int, error) {\n\tif err := deq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn deq.sqlCount(ctx)\n}", "title": "" }, { "docid": "3fd45546f9c65b3494982914a2138511", "score": "0.54822844", "text": "func (sq *ShopQuery) Count(ctx context.Context) (int, error) {\n\treturn sq.sqlCount(ctx)\n}", "title": "" }, { "docid": "57652c5abad52692815bfd3a48a12bdb", "score": "0.5474254", "text": "func Count() Aggregate {\n\treturn Aggregate{\n\t\tSQL: func(s *sql.Selector) string {\n\t\t\treturn sql.Count(\"*\")\n\t\t},\n\t}\n}", "title": "" } ]
4f0a5d771560492f6bf14691c41ed9f3
Deactivate a worker (reconciles the cluster)
[ { "docid": "af9a22b2acefedc107e9271ae9cbd4a5", "score": "0.68977386", "text": "func (cwa *WzCtrlWorkersAPI) Deactivate() {}", "title": "" } ]
[ { "docid": "f33076022b1df6434cbad024a8ab5d23", "score": "0.6046286", "text": "func (srv *Server) stop() error {\n\tlog.CRPC_log(log.LOGLEVEL_INFO, \"Stopping workers...\")\n\n\t// First stop all worker threads\n\tfor i := uint(0); i < srv.workers; i++ {\n\t\t_, err := srv.backend_router.SendMessage(\n\t\t\tnewBackendMessage([]byte(fmt.Sprintf(\"%d\", i)),\n\t\t\t\tnewClientMessage([]byte(\"BOGUS_RQID\"), []byte{0xde, 0xad, 0xde, 0xad}, MAGIC_STOP_STRING)).serializeBackendMessage())\n\t\tif err != nil {\n\t\t\tlog.CRPC_log(log.LOGLEVEL_ERRORS, \"Could not send stop message to load balancer, exiting!\", err.Error())\n\n\t\t\treturn err\n\t\t}\n\t}\n\n\tsock, err := zmq.NewSocket(zmq.REQ)\n\n\tlog.CRPC_log(log.LOGLEVEL_DEBUG, \"Stopping balancer thread...\")\n\n\tif err != nil {\n\t\tlog.CRPC_log(log.LOGLEVEL_ERRORS, \"Could not create socket for stopping!\")\n\n\t\treturn err\n\t}\n\n\tworker_identity := \"_x\"\n\terr = sock.SetIdentity(worker_identity)\n\n\tif err != nil {\n\t\tlog.CRPC_log(log.LOGLEVEL_ERRORS, \"Could not set identity on socket for stopping, exiting!\", err.Error())\n\n\t\treturn err\n\t}\n\n\terr = sock.Connect(BACKEND_ROUTER_PATH)\n\n\tif err != nil {\n\t\tlog.CRPC_log(log.LOGLEVEL_ERRORS, \"Could not connect to load balancer thread, exiting!\", err.Error())\n\n\t\treturn err\n\t}\n\n\t_, err = sock.SendMessage(newClientMessage([]byte(\"__BOGUS_REQ_ID\"), []byte(\"___BOGUS_clientId\"), MAGIC_STOP_STRING).serializeClientMessage())\n\n\tif err != nil {\n\t\tlog.CRPC_log(log.LOGLEVEL_ERRORS, \"Could not send stop message to load balancer, exiting!\", err.Error())\n\n\t\treturn err\n\t}\n\n\t// Wait for ack\n\t_, err = sock.RecvMessageBytes(0)\n\n\tif err != nil {\n\t\tlog.CRPC_log(log.LOGLEVEL_ERRORS, \"Could not send stop message to load balancer, exiting!\", err.Error())\n\n\t\treturn err\n\t}\n\n\tlog.CRPC_log(log.LOGLEVEL_INFO, \"Stopped RPC server and workers\")\n\n\tsock.Close()\n\n\treturn nil\n}", "title": "" }, { "docid": "4602f6e6a4ee19cd86f47af0fb98632a", "score": "0.599138", "text": "func (a *apiServer) Deactivate(ctx context.Context, req *ec.DeactivateRequest) (resp *ec.DeactivateResponse, retErr error) {\n\t// must not deactivate while paused\n\tif a.env.mode == PausedMode {\n\t\treturn nil, errors.New(\"cannot deactivate paused cluster; unpause first\")\n\t}\n\tif _, err := col.NewSTM(ctx, a.env.EtcdClient, func(stm col.STM) error {\n\t\terr := a.enterpriseTokenCol.ReadWrite(stm).Delete(enterpriseTokenKey)\n\t\tif err != nil && !col.IsErrNotFound(err) {\n\t\t\treturn errors.EnsureStack(err)\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := a.env.TxnEnv.WithWriteContext(ctx, func(txCtx *txncontext.TransactionContext) error {\n\t\terr := a.configCol.ReadWrite(txCtx.SqlTx).Delete(configKey)\n\t\tif err != nil && !col.IsErrNotFound(err) {\n\t\t\treturn errors.EnsureStack(err)\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Wait until watcher observes the write\n\tif err := backoff.Retry(func() error {\n\t\trecord, ok := a.enterpriseTokenCache.Load().(*ec.EnterpriseRecord)\n\t\tif !ok {\n\t\t\treturn errors.Errorf(\"could not retrieve enterprise expiration time\")\n\t\t}\n\t\tif record.License != nil {\n\t\t\treturn errors.Errorf(\"enterprise still activated\")\n\t\t}\n\t\treturn nil\n\t}, backoff.RetryEvery(time.Second)); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ec.DeactivateResponse{}, nil\n}", "title": "" }, { "docid": "fc548eed7099b86348e03f51133cc72b", "score": "0.5962439", "text": "func (fs *Datastore) deactivate() {\n\tfs.shutdownLock.Lock()\n\tdefer fs.shutdownLock.Unlock()\n\tif fs.shutdown {\n\t\treturn\n\t}\n\tfs.shutdown = true\n\tclose(fs.checkpointCh)\n\t<-fs.done\n}", "title": "" }, { "docid": "b69caab7e448934fbfade4c587533f66", "score": "0.59415406", "text": "func (w *worker) Terminate() {\n}", "title": "" }, { "docid": "f530fa0a62a97c7803f75e8a6197918d", "score": "0.5941517", "text": "func (cc *CeleryClient) StopWorker() {\n\tcc.worker.StopWorker()\n}", "title": "" }, { "docid": "ed3ded56818100b3a4a9eb2ed52cb59b", "score": "0.5899462", "text": "func (p Pool) StopWorker() {\n\t// Invoke in parallel so it doesn't block.\n\tgo func() {\n\t\tp <- nil\n\t}()\n}", "title": "" }, { "docid": "479fbce92af9107ffa7a3200ce765513", "score": "0.586379", "text": "func (c *Client) Detach(addr string) error {\n\tdata, err := proto.WorkerData{Addr: addr}.Encode()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = c.request(&proto.Request{\n\t\tOp: proto.Detach,\n\t\tData: data,\n\t})\n\treturn err\n}", "title": "" }, { "docid": "cfb116ab00ef8d7439e473cc1270ead8", "score": "0.57841116", "text": "func (dj *DockerJob) Deactivate() {\n\tlogrus.Debugf(\"Deactivating: %s\", dj.ID)\n\tdj.Active = false\n}", "title": "" }, { "docid": "6f0d25303bc5df93b5d687beecbd4c19", "score": "0.5782244", "text": "func (p *Pool[T, U, C, CT, TF]) revertWorker(worker *goWorker[T, U, C, CT, TF]) bool {\n\tif capacity := p.Cap(); capacity > 0 && p.Running() > capacity || p.IsClosed() {\n\t\tp.cond.Broadcast()\n\t\treturn false\n\t}\n\tworker.recycleTime.Store(time.Now())\n\tp.lock.Lock()\n\n\tif p.IsClosed() {\n\t\tp.lock.Unlock()\n\t\treturn false\n\t}\n\n\terr := p.workers.insert(worker)\n\tif err != nil {\n\t\tp.lock.Unlock()\n\t\tif err == errQueueIsFull && p.waitingTask.Load() > 0 {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\t// Notify the invoker stuck in 'retrieveWorker()' of there is an available worker in the worker queue.\n\tp.cond.Signal()\n\tp.lock.Unlock()\n\treturn true\n}", "title": "" }, { "docid": "dfab48e7b5f3c9146e6907cc7953fc3a", "score": "0.5747182", "text": "func (f *replicationTaskFetcherWorker) Stop() {\n\tif !atomic.CompareAndSwapInt32(\n\t\t&f.status,\n\t\tcommon.DaemonStatusStarted,\n\t\tcommon.DaemonStatusStopped,\n\t) {\n\t\treturn\n\t}\n\n\tf.logger.Info(\"Replication task fetcher worker stopped.\")\n}", "title": "" }, { "docid": "951e9cce82016f9ec463e17fd1feee5a", "score": "0.5695133", "text": "func (sparkWorkerDeployment SparkWorkerDeployment) removeWorker(podName string) error {\n\tif podName!=\"\"{\n\t\thasError := false\n\t\tworkersNum:=len(sparkWorkerDeployment.getWorkers(&hasError))\n\t\tif hasError {return errors.New(\"failed to get pods information\")}\n\t\t\tsparkWorkerDeployment.deploymentClient.DeletePod(podName)\n\t\tfor {\n\t\t\thasError = false\n\t\t\tupdatedWorkersNum:=len(sparkWorkerDeployment.getWorkers(&hasError))\n\t\t\tif hasError {return errors.New(\"failed to get pods information\")}\n\t\t\tif workersNum>updatedWorkersNum {\n\t\t\t\tdelete(sparkWorkerDeployment.workerNameToNet,podName)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttime.Sleep(1000*time.Millisecond)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a1cf6121e8fa9b1289e2d189ea2063e4", "score": "0.56854635", "text": "func (ap *activePluginsHost) deactivate(reg *Registration) {\n\tap.mu.Lock()\n\tdefer ap.mu.Unlock()\n}", "title": "" }, { "docid": "14726dd49756b74f85e8859c6e840190", "score": "0.5662386", "text": "func (p *WorkerPool) DropWorker() {\n\tif p.nWorkers == 1 {\n\t\treturn\n\t}\n\tw := p.workers[len(p.workers)-1]\n\tw.Stop()\n\tp.workers = p.workers[:len(p.workers)-1]\n\tp.nWorkers--\n}", "title": "" }, { "docid": "6ee0b58856a6c21a0ca81837f218be15", "score": "0.5644228", "text": "func (wl *WorkerList) Deregister(uuid boruta.WorkerUUID) error {\n\twl.mutex.Lock()\n\tdefer wl.mutex.Unlock()\n\tworker, ok := wl.workers[uuid]\n\tif !ok {\n\t\treturn ErrWorkerNotFound\n\t}\n\tif worker.State != boruta.MAINTENANCE && worker.State != boruta.FAIL {\n\t\treturn ErrNotInFailOrMaintenance\n\t}\n\tclose(worker.backgroundOperation)\n\tdelete(wl.workers, uuid)\n\treturn nil\n}", "title": "" }, { "docid": "f9f46721ca2d562e67ea522de3c5dbf7", "score": "0.56429285", "text": "func (s *server) DeregisterWorker(ctx context.Context, r *pb.DeregisterReq) (*pb.DeregisterRes, error) {\n\n\tdelWorker(r.WorkerID)\n\n\tres := pb.DeregisterRes{\n\t\tSuccess: true,\n\t}\n\n\tlog.Printf(\"Worker with ID: %s is offline\\n\", r.WorkerID)\n\treturn &res, nil\n}", "title": "" }, { "docid": "40004de93c543ee585551cc7bd9c23cf", "score": "0.56173795", "text": "func (d *Dispatcher) dropWorker() {\n\twg := sync.WaitGroup{}\n\twg.Add(1)\n\td.shutdown <- &wg\n\twg.Wait()\n}", "title": "" }, { "docid": "12394ecbec49e4c6659d1037216a7fe6", "score": "0.5556801", "text": "func (w Worker) Stop() {\n\tgo func() {\n\t\tw.QuitChan <- true\n\t}()\n}", "title": "" }, { "docid": "12394ecbec49e4c6659d1037216a7fe6", "score": "0.5556801", "text": "func (w Worker) Stop() {\n\tgo func() {\n\t\tw.QuitChan <- true\n\t}()\n}", "title": "" }, { "docid": "824158f5f958cdfa8f5ce1cb76df195c", "score": "0.55527705", "text": "func Deactivate() (err error) {\n\tdefer func() {\n\t\tif rec := recover(); rec != nil {\n\t\t\terr = errors.New(\"already deactivated\")\n\t\t}\n\t}()\n\tclose(stopChan)\n\tstopChan = make(chan struct{})\n\treturn\n}", "title": "" }, { "docid": "fcf8c0a12462844b1bd78344b11ec394", "score": "0.5551264", "text": "func (t *WorkerTask) tearDown() error {\n\treturn t.cluster.Delete()\n}", "title": "" }, { "docid": "fcf8c0a12462844b1bd78344b11ec394", "score": "0.5551264", "text": "func (t *WorkerTask) tearDown() error {\n\treturn t.cluster.Delete()\n}", "title": "" }, { "docid": "4ced90e9c1ee16c0fcf6a8b0757932fa", "score": "0.55234236", "text": "func (s *ServerConfig) stopWorker(c *gin.Context) {\n\tc.Header(\"Content-Type\", \"application/json\")\n\n\tworkerId, err := SafeObjectId(c.Param(\"id\"))\n\tif err != nil {\n\t\tc.String(http.StatusInternalServerError, MakeErrorString(err.Error()))\n\t\treturn\n\t}\n\n\tw, err := s.DB.GetWorker(workerId)\n\tif err != nil {\n\t\tc.String(http.StatusInternalServerError, MakeErrorString(err.Error()))\n\t\treturn\n\t}\n\n\tw.Stopped = true\n\terr = s.DB.UpdateWorker(&w)\n\tif err != nil {\n\t\tc.String(http.StatusInternalServerError, MakeErrorString(err.Error()))\n\t\treturn\n\t}\n\n\tc.String(http.StatusOK, `{}`)\n}", "title": "" }, { "docid": "655aaa583d52e3ec48693a724d9b406f", "score": "0.5515225", "text": "func (client *BorutaClient) Deregister(uuid boruta.WorkerUUID) error {\n\tpath := client.url + \"workers/\" + string(uuid) + \"/deregister\"\n\tresp, err := http.Post(path, \"\", nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn processResponse(resp, nil)\n}", "title": "" }, { "docid": "8be9f380ab3581fae75f936875bcfe5a", "score": "0.5497912", "text": "func (worker *Worker) Delete(disconnect bool) {\n\tif disconnect {\n\t\tworker.Send(mdapi.MDPW_DISCONNECT, \"\", []string{})\n\t}\n\n\tif worker.service != nil {\n\t\tworker.service.waiting = delWorker(worker.service.waiting, worker)\n\t}\n\tworker.broker.waiting = delWorker(worker.broker.waiting, worker)\n\tdelete(worker.broker.workers, worker.id_string)\n}", "title": "" }, { "docid": "6419cf3034b400bc077cf24b34c07f08", "score": "0.5475752", "text": "func (worker *Worker) Terminate(req int, res *int) error {\n worker.Working = 0\n worker.doneChan<-1\n *res = 0\n return nil\n}", "title": "" }, { "docid": "5d08afb1d8d77d14ba1286eca405d91e", "score": "0.54657644", "text": "func (op IntegratedServiceOperator) Deactivate(ctx context.Context, clusterID uint, spec integratedservices.IntegratedServiceSpec) error {\n\tif err := op.clusterService.CheckClusterReady(ctx, clusterID); err != nil {\n\t\treturn err\n\t}\n\n\tctx, err := op.ensureOrgIDInContext(ctx, clusterID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tboundSpec, err := bindIntegratedServiceSpec(spec)\n\tif err != nil {\n\t\treturn integratedservices.InvalidIntegratedServiceSpecError{\n\t\t\tIntegratedServiceName: integratedServiceName,\n\t\t\tProblem: err.Error(),\n\t\t}\n\t}\n\n\tif boundSpec.Grafana.SecretId == \"\" {\n\t\t// Grafana secret generated in activation flow, delete it\n\t\tif err := op.deleteGrafanaSecret(ctx, clusterID); err != nil && !isSecretNotFoundError(err) {\n\t\t\treturn errors.WrapIf(err, \"failed to delete Grafana secret\")\n\t\t}\n\t}\n\n\tif boundSpec.Prometheus.Ingress.SecretID == \"\" {\n\t\t// Prometheus secret generated in activation flow, delete it\n\t\tif err := op.deletePrometheusSecret(ctx, clusterID); err != nil && !isSecretNotFoundError(err) {\n\t\t\treturn errors.WrapIf(err, \"failed to delete Prometheus secret\")\n\t\t}\n\t}\n\n\t// delete prometheus operator deployment\n\tif err := op.helmService.DeleteDeployment(ctx, clusterID, prometheusOperatorReleaseName, op.config.Namespace); err != nil {\n\t\treturn errors.WrapIfWithDetails(err, \"failed to delete deployment\", \"release\", prometheusOperatorReleaseName)\n\t}\n\n\t// delete prometheus pushgateway deployment\n\tif err := op.helmService.DeleteDeployment(ctx, clusterID, prometheusPushgatewayReleaseName, op.config.Namespace); err != nil {\n\t\treturn errors.WrapIfWithDetails(err, \"failed to delete deployment\", \"release\", prometheusPushgatewayReleaseName)\n\t}\n\n\t// delete custom resources\n\tif err := op.cleanupCRDs(ctx, clusterID); err != nil {\n\t\top.logger.Warn(\"failed to delete CRDs\", map[string]interface{}{\"failures\": err})\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3964eae43b950fffb8647ad38b977dd3", "score": "0.54394114", "text": "func delWorker(id string) {\n\tworkersMutex.Lock()\n\tdefer workersMutex.Unlock()\n\n\tif _, ok := workers[id]; ok {\n\t\tdelete(workers, id)\n\t}\n}", "title": "" }, { "docid": "d9961e8b7fe68fedf825ce5254b5fbdb", "score": "0.5412165", "text": "func deactivate() {\n activeMutex.Lock()\n active--\n activeMutex.Unlock()\n}", "title": "" }, { "docid": "d9961e8b7fe68fedf825ce5254b5fbdb", "score": "0.5412165", "text": "func deactivate() {\n activeMutex.Lock()\n active--\n activeMutex.Unlock()\n}", "title": "" }, { "docid": "9118e6bafee2aa156b37b713ab0b299c", "score": "0.54009527", "text": "func (workers workerList) relieve() {\n\tdoneJobs := workers.getDoneWorkers()\n\tfor _, doneJob := range doneJobs {\n\t\tworkers[doneJob].name = \"\"\n\t}\n}", "title": "" }, { "docid": "706a5a82eb2a99e1940dbd8ebba4e451", "score": "0.5385103", "text": "func (sparkWorkerDeployment SparkWorkerDeployment) removeAllWorker() {\n\tsparkWorkerDeployment.deploymentClient.DeletePodWithLabel(sparkWorkerDeployment.labels)\n}", "title": "" }, { "docid": "6a1ef8b4fef9cf0c4c64ef9d827d7c3d", "score": "0.53770995", "text": "func (helper *ClientHelper) StopWorker(worker worker.Worker) {\n\tworker.Stop()\n}", "title": "" }, { "docid": "ebbfa7c3e74eb7e097d49baa5bf303b3", "score": "0.53734064", "text": "func StopWorkerNode(node int) error {\n\treturn manageWorker(\"stop\", node)\n}", "title": "" }, { "docid": "b9f60edd5f69e798040969a4b316ad06", "score": "0.53411204", "text": "func (w *worker) Stop() {\n\tw.pool.Stop()\n}", "title": "" }, { "docid": "8c47697e35cfc97b7bdad97564edd625", "score": "0.5340794", "text": "func (manager *ScheduleManager) stopWorkers(strategy *definition.Strategy) error {\n\tdefer manager.workerSet.Delete(strategy.ID)\n\n\tworkers := manager.workerSet.WorkersFor(strategy.ID)\n\tif len(workers) == 0 {\n\t\treturn nil\n\t}\n\n\twg := sync.WaitGroup{}\n\tfor _, w := range workers {\n\t\twg.Add(1)\n\t\tgo func(w types.Worker) {\n\t\t\tdefer wg.Done()\n\t\t\tdefer func() {\n\t\t\t\tif err := recover(); err != nil {\n\t\t\t\t\tlog.Errorf(\"Stop worker %s failed: %v\", strategy.ID, err)\n\t\t\t\t\ttraceData := utils.StackTraceData()\n\t\t\t\t\tdefer traceData.Recycle()\n\t\t\t\t\tlog.Error(\"Trace: \", traceData.String())\n\t\t\t\t}\n\t\t\t}()\n\t\t\tw.Stop(strategy.ID, strategy.Parameter)\n\t\t}(w)\n\t}\n\n\twg.Wait()\n\treturn nil\n}", "title": "" }, { "docid": "9020cbb25f33989ea8861fffc2b1b960", "score": "0.5337453", "text": "func (w worker) Stop() {\n\tgo func() {\n\t\tw.quit <- true\n\t}()\n}", "title": "" }, { "docid": "d45a8e21cf2c4deb21321c2348e76199", "score": "0.5332692", "text": "func (w Worker) Stop() {\n\tgo func() {\n\t\tw.quit <- true\n\t}()\n}", "title": "" }, { "docid": "d45a8e21cf2c4deb21321c2348e76199", "score": "0.5332692", "text": "func (w Worker) Stop() {\n\tgo func() {\n\t\tw.quit <- true\n\t}()\n}", "title": "" }, { "docid": "d45a8e21cf2c4deb21321c2348e76199", "score": "0.5332692", "text": "func (w Worker) Stop() {\n\tgo func() {\n\t\tw.quit <- true\n\t}()\n}", "title": "" }, { "docid": "d45a8e21cf2c4deb21321c2348e76199", "score": "0.5332692", "text": "func (w Worker) Stop() {\n\tgo func() {\n\t\tw.quit <- true\n\t}()\n}", "title": "" }, { "docid": "823532398c21f30c9e69df11208fe978", "score": "0.53321964", "text": "func (d Driver) DestroyWorker(project, branch string) error {\n\tkubifiedProj := strings.Replace(project, \"/\", \"-\", -1)\n\tdeletePayload := map[string]string{\n\t\t\"kind\": \"Pod\",\n\t\t\"apiVersion\": \"v1\",\n\t\t\"gracePeriodSeconds\": \"5\",\n\t}\n\tbody, marshErr := json.Marshal(deletePayload)\n\tif marshErr != nil {\n\t\treturn marshErr\n\t}\n\treturn d.destroy(\n\t\tfmt.Sprintf(\"/api/v1/namespaces/maestro/pods/%s-%s\", kubifiedProj, branch),\n\t\t\"delete maestro worker\",\n\t\tbody,\n\t)\n}", "title": "" }, { "docid": "9efb79f0ecabf97a7086f4bd555f9157", "score": "0.5290362", "text": "func (bs *blockSyncer) Stop(ctx context.Context) error {\n\tlogger.Debug().Msg(\"Stopping block syncer\")\n\tif err := bs.chaser.Stop(ctx); err != nil {\n\t\treturn err\n\t}\n\treturn bs.worker.Stop(ctx)\n}", "title": "" }, { "docid": "5dc45c2d1f4cbac2bda050f042e0e738", "score": "0.52834827", "text": "func (w worker) stop() {\n\tgo func() {\n\t\tw.quit <- true\n\t}()\n}", "title": "" }, { "docid": "5dc45c2d1f4cbac2bda050f042e0e738", "score": "0.52834827", "text": "func (w worker) stop() {\n\tgo func() {\n\t\tw.quit <- true\n\t}()\n}", "title": "" }, { "docid": "d567eb4e5e72f5a646102e34c4975f9d", "score": "0.5280569", "text": "func (w *Worker) Stop() {\n\tc := make(chan struct{})\n\tw.shutdown <- c\n\t<-c\n}", "title": "" }, { "docid": "871cc29f311d0ff1ff9e502bf2632613", "score": "0.52743816", "text": "func (v *VolumeAttachmentHandler) DeleteWorker(desiredWorker chan *storagev1.VolumeAttachment) {\n\tklog.V(4).Infof(\"Deleting an existing worker %v. Current active workers %d - %v\", desiredWorker, len(v.workers), v.workers)\n\n\tv.Lock()\n\tdefer v.Unlock()\n\n\tfinalWorkers := []chan *storagev1.VolumeAttachment{}\n\n\tfor i, worker := range v.workers {\n\t\tif worker == desiredWorker {\n\t\t\tclose(worker)\n\t\t\tklog.V(4).Infof(\"Deleting worker %d from worker list\", i)\n\t\t} else {\n\t\t\tfinalWorkers = append(finalWorkers, worker)\n\t\t}\n\t}\n\n\tv.workers = finalWorkers\n\tklog.V(4).Infof(\"Successfully removed worker. Current active workers %d - %v\", len(v.workers), v.workers)\n}", "title": "" }, { "docid": "ef0f78eb3386421156bae4e18d337a17", "score": "0.52713543", "text": "func (w Worker) Stop() {\n\tfmt.Println(\"\\nWorkers stopped\")\n\tgo func() {\n\t\tw.quit <- true\n\t}()\n}", "title": "" }, { "docid": "6cd8fa987e30883b49aeede328993efe", "score": "0.5249004", "text": "func (f *taskFetcherImpl) Stop() {\n\tif !atomic.CompareAndSwapInt32(\n\t\t&f.status,\n\t\tcommon.DaemonStatusStarted,\n\t\tcommon.DaemonStatusStopped,\n\t) {\n\t\treturn\n\t}\n\n\tclose(f.shutdownChan)\n\tfor _, worker := range f.workers {\n\t\tworker.Stop()\n\t}\n\tf.logger.Info(\"Replication task fetcher stopped.\")\n}", "title": "" }, { "docid": "6369585433cb5e615269daf55d4fdc0d", "score": "0.52455485", "text": "func deactivate(ctx context.Context, actor Actor) error {\n\treply, err := invoke(ctx, \"DELETE\", map[string]string{\"path\": actorRuntimeRoutePrefix + actor.Type + \"/\" + actor.ID}, actor.Type+\":deactivate\")\n\tif err != nil {\n\t\tif err != ctx.Err() {\n\t\t\tlogger.Debug(\"deactivate failed to invoke %s: %v\", actorRuntimeRoutePrefix+actor.Type+\"/\"+actor.ID, err)\n\t\t}\n\t\treturn err\n\t}\n\tif reply.StatusCode >= http.StatusBadRequest {\n\t\tlogger.Error(\"deactivate %v returned status %v with body %s\", actor, reply.StatusCode, reply.Payload)\n\t} else {\n\t\tlogger.Debug(\"deactivate %v returned status %v with body %s\", actor, reply.StatusCode, reply.Payload)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dd7fd32cc3f637eea0941bfa8b79c892", "score": "0.52444094", "text": "func (s *StateManager) Deactivate(ctx context.Context) (errRet error) {\n\tctx, stage := timing.Start(ctx, \"multivm_state_deactivate\")\n\tdefer stage.End()\n\n\t// NB: We deactivate in reverse order using defer so that if any one part\n\t// panics, the rest will still complete.\n\n\t// NB: Keep this first, so that it runs last.\n\tdefer func() {\n\t\tif errRet == nil {\n\t\t\t// We are no longer active if nothing has failed.\n\t\t\ts.active = false\n\t\t}\n\t}()\n\n\tif s.cr != nil {\n\t\tdefer func() {\n\t\t\tchrome.Unlock()\n\t\t\tif err := s.cr.Close(ctx); err != nil {\n\t\t\t\tif errRet == nil {\n\t\t\t\t\terrRet = errors.Wrap(err, \"failed to deactivate Chrome\")\n\t\t\t\t} else {\n\t\t\t\t\ttesting.ContextLog(ctx, \"Failed to deactivate Chrome: \", err)\n\t\t\t\t}\n\t\t\t}\n\t\t\ts.cr = nil\n\t\t}()\n\t}\n\n\tif s.keyboard != nil {\n\t\tdefer func() {\n\t\t\tif err := s.keyboard.Close(); err != nil {\n\t\t\t\tif errRet == nil {\n\t\t\t\t\terrRet = errors.Wrap(err, \"failed to deactivate keyboard\")\n\t\t\t\t} else {\n\t\t\t\t\ttesting.ContextLog(ctx, \"Failed to deactivate keyboard: \", err)\n\t\t\t\t}\n\t\t\t}\n\t\t\ts.keyboard = nil\n\t\t}()\n\t}\n\n\tfor k, v := range s.vms {\n\t\tdefer func(k string, v VMActivation) {\n\t\t\tif err := v.Deactivate(ctx); err != nil {\n\t\t\t\tif errRet == nil {\n\t\t\t\t\terrRet = errors.Wrapf(err, \"failed to deactivate %s\", k)\n\t\t\t\t} else {\n\t\t\t\t\ttesting.ContextLogf(ctx, \"Failed to deactivate %s: %v\", k, err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelete(s.vms, k)\n\t\t}(k, v)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0861ebf82914a85e4014e4024afd90c4", "score": "0.5240041", "text": "func (s *Scheduler) dec() {\n\tif atomic.AddInt64(&s.workers, -1) == 0 {\n\t\tselect {\n\t\tcase <-s.done:\n\t\t\t// Select on s.done to guard from closing the channel twice.\n\t\t\treturn\n\t\tdefault:\n\t\t\tclose(s.done)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8de7bea88e2e0c1f9e14ff154aec7c21", "score": "0.52374375", "text": "func closeWorker() {\n\ttime.Sleep(4 * time.Second)\n\tos.Exit(0)\n}", "title": "" }, { "docid": "2a5119ea68393614451cd6d5744e3600", "score": "0.52279073", "text": "func (worker *Checker) Stop() error {\n\tworker.tomb.Kill(nil)\n\treturn worker.tomb.Wait()\n}", "title": "" }, { "docid": "f20d7c1357b78c7c305c16171480fd04", "score": "0.52247596", "text": "func (s *Server) RemoveWorker(worker Worker) {\n\n\ts.Lock()\n\tdefer s.Unlock()\n\n\tfor i := range s.workers {\n\t\tif s.workers[i] == worker {\n\t\t\tcopy(s.workers[i:], s.workers[i+1:])\n\t\t\ts.workers[len(s.workers)-1] = nil\n\t\t\ts.workers = s.workers[:len(s.workers)-1]\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n\n}", "title": "" }, { "docid": "7f1f1b844ecb7701c2d02b749f1a2c45", "score": "0.5224299", "text": "func (m *T) reassign(actDesc *actor.Descriptor, changes map[Worker]eventType, doneCh chan none.T) {\n\tdefer func() { doneCh <- none.V }()\n\n\tfor worker, event := range changes {\n\t\tswitch event {\n\t\tcase evWorkerStopped:\n\t\t\texecutor := m.assignments[worker]\n\t\t\tif executor == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdelete(m.assignments, worker)\n\t\t\tm.references[executor] = m.references[executor] - 1\n\t\t\tactDesc.Log().Infof(\"Unassign: worker=%s, executor=%s(ref=%d)\", worker, executor, m.references[executor])\n\n\t\tcase evWorkerSpawned:\n\t\t\texecutor := m.assignments[worker]\n\t\t\tif executor != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tm.resolveBroker(actDesc, worker)\n\n\t\tcase evReassignNeeded:\n\t\t\tm.resolveBroker(actDesc, worker)\n\t\t}\n\t}\n\t// All broker assignments have been propagated to workers, so it is safe to\n\t// close executors that are not used anymore.\n\tfor executor, referenceCount := range m.references {\n\t\tif referenceCount != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tactDesc.Log().Infof(\"Stopping executor: %s\", executor)\n\t\texecutor.Stop()\n\t\tdelete(m.references, executor)\n\t\tif m.connections[executor.BrokerConn()] == executor {\n\t\t\tdelete(m.connections, executor.BrokerConn())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d58c74d5348afaba49dea2c16dfb15c5", "score": "0.5209953", "text": "func (s *Switch) Unblock() error { return s.r.send(Event{op: OpChange, idx: s.idx, soft: false}) }", "title": "" }, { "docid": "4ae17f637bc0c7e5dd350413f2f2efaf", "score": "0.5206131", "text": "func (w Worker) Stop() {\n\tgo func() {\n\t\tw.stop <- true\n\t}()\n}", "title": "" }, { "docid": "885c19314c8bf266820e6df82858b048", "score": "0.51903164", "text": "func DropWorker() error {\n\tif dispatcher == nil {\n\t\treturn errors.New(errNotInitialised)\n\t}\n\n\tdispatcher.dropWorker()\n\treturn nil\n}", "title": "" }, { "docid": "e71de1cf8fd939d62634a3831c7ea2f8", "score": "0.5174074", "text": "func (w *Worker) Stop() {\n\tgo func() {\n\t\tw.QuitChan <- true\n\t}()\n}", "title": "" }, { "docid": "e71de1cf8fd939d62634a3831c7ea2f8", "score": "0.5174074", "text": "func (w *Worker) Stop() {\n\tgo func() {\n\t\tw.QuitChan <- true\n\t}()\n}", "title": "" }, { "docid": "e71de1cf8fd939d62634a3831c7ea2f8", "score": "0.5174074", "text": "func (w *Worker) Stop() {\n\tgo func() {\n\t\tw.QuitChan <- true\n\t}()\n}", "title": "" }, { "docid": "e71de1cf8fd939d62634a3831c7ea2f8", "score": "0.5174074", "text": "func (w *Worker) Stop() {\n\tgo func() {\n\t\tw.QuitChan <- true\n\t}()\n}", "title": "" }, { "docid": "6c4ec5f3dedcabbe27d2baf6a52d8d57", "score": "0.5170588", "text": "func (manager *Manager) BroadcastStop() {\n\tfor _, worker := range manager.workers {\n\t\tif worker.Done != true {\n\t\t\tworker.SendStop()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c3331b1c99e420e273f5f39ea4845743", "score": "0.5165775", "text": "func (p *StaticPool) destroyWorker(w *Worker, caused interface{}) {\n\tgo func() {\n\t\terr := w.Stop()\n\t\tif err != nil {\n\t\t\tp.throw(EventWorkerError, WorkerError{Worker: w, Caused: err})\n\t\t}\n\t}()\n\n\tselect {\n\tcase <-w.waitDone:\n\t\t// worker is dead\n\t\tp.throw(EventWorkerDestruct, w)\n\n\tcase <-time.NewTimer(p.cfg.DestroyTimeout).C:\n\t\t// failed to stop process in given time\n\t\tif err := w.Kill(); err != nil {\n\t\t\tp.throw(EventWorkerError, WorkerError{Worker: w, Caused: err})\n\t\t}\n\n\t\tp.throw(EventWorkerKill, w)\n\t}\n}", "title": "" }, { "docid": "4a79a6bc8fe80edeccb3af7b919098c8", "score": "0.5161498", "text": "func (bs *BrokerState) StopBroker(req StopBrokerReq, res *StopBrokerRes) (err error) {\n\tif !req.Restart {\n\t\tfor _, worker := range bs.Workers {\n\t\t\tworker.Call(StopWorker, StopWorkerReq{}, &StopWorkerRes{})\n\t\t}\n\t}\n\tbs.Stopper <- req.Restart\n\treturn nil\n}", "title": "" }, { "docid": "4472e30856e8dce3d12010ea5556ad33", "score": "0.51491266", "text": "func NewUserDeactivationWorker(ctx context.Context, app application.Application) UserDeactivationWorker {\n\tw := &userDeactivationWorker{\n\t\tworker.Worker{\n\t\t\tCtx: ctx,\n\t\t\tApp: app,\n\t\t\tOwner: worker.GetLockOwner(ctx),\n\t\t\tName: \"user-deactivation\",\n\t\t},\n\t}\n\tw.Do = w.deactivateUsers\n\treturn w\n}", "title": "" }, { "docid": "3db5546c01d4bf492fbeeef1b7b67c0a", "score": "0.51480544", "text": "func (cwa *WzCtrlWorkersAPI) Remove() {}", "title": "" }, { "docid": "63424686d7674e4165f3d12428f2cf95", "score": "0.5145123", "text": "func (w *AsWorker) Stop() {\n\tw.Quit <- 0\n}", "title": "" }, { "docid": "031acc6142260c24d37f4a6fa6ca5e18", "score": "0.51039517", "text": "func (t *Task) DeactivateTask(caller string) error {\n\tt.ActivatedBy = caller\n\tt.Activated = false\n\tt.ScheduledTime = util.ZeroTime\n\treturn UpdateOne(\n\t\tbson.M{\n\t\t\tIdKey: t.Id,\n\t\t},\n\t\tbson.M{\n\t\t\t\"$set\": bson.M{\n\t\t\t\tActivatedKey: false,\n\t\t\t\tScheduledTimeKey: util.ZeroTime,\n\t\t\t},\n\t\t},\n\t)\n}", "title": "" }, { "docid": "70c7205e9a829c9e17359d69aef39ce3", "score": "0.51029456", "text": "func Stop(dirConfig *home.EdwardConfiguration, c *services.ServiceConfig, cfg services.OperationConfig, overrides services.ContextOverride, task tracker.Task, pool *worker.Pool) error {\n\tinstance, err := Load(dirConfig, &processes.Processes{}, c, overrides)\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\tif instance.Pid == 0 {\n\t\tinstance.clearState()\n\t\treturn nil\n\t}\n\terr = pool.Enqueue(func() error {\n\t\treturn errors.WithStack(instance.StopSync(cfg, overrides, task))\n\t})\n\treturn errors.WithStack(err)\n}", "title": "" }, { "docid": "bbad9b9cc57be973d304f15c931574f5", "score": "0.5101689", "text": "func (server *Server) DeactivateNode(certname string) (*CommandResponse, error) {\n\tcertnameJson, err := json.Marshal(certname)\n\tif(err != nil) {\n\t\treturn nil, err\n\t}\n\n\tcommandResponse, err := server.SubmitCommand(\"deactivate node\", 1, string(certnameJson[:]))\n\treturn commandResponse, err\n}", "title": "" }, { "docid": "206dc16b4f76dff064fa0951b7368e7e", "score": "0.50977826", "text": "func worker() {\n\t// use a defer code to free this resource\n\t// called in the reverse order first B then A\n\tdefer cleanup(\"A\")\n\tdefer cleanup(\"B\")\n\n\tfmt.Println(\"worker\")\n}", "title": "" }, { "docid": "24e5aa6b860ed011c5229ba217430f88", "score": "0.50964254", "text": "func (c *Client) Deactivate() int {\n\treturn int(C.jack_deactivate(c.ptr))\n}", "title": "" }, { "docid": "ee6ba679894929c231fc648c12d03178", "score": "0.5094706", "text": "func (m *T) reassign(actDesc *actor.Descriptor, change *mappingChanges, doneCh chan none.T) {\n\tdefer func() { doneCh <- none.V }()\n\n\t// Travers through stopped workers and dereference brokers assigned to them.\n\tfor worker := range change.stopped {\n\t\texecutor := m.assignments[worker]\n\t\tdelete(m.assignments, worker)\n\t\tdelete(change.spawned, worker)\n\t\tif executor != nil {\n\t\t\tm.references[executor] = m.references[executor] - 1\n\t\t\tactDesc.Log().Infof(\"unassign %s -> %s (ref=%d)\", worker, executor, m.references[executor])\n\t\t}\n\t}\n\t// Weed out workers that have already been closed.\n\tfor worker := range change.outdated {\n\t\tif _, ok := m.assignments[worker]; !ok {\n\t\t\tdelete(change.outdated, worker)\n\t\t}\n\t}\n\t// Run resolution for the created and outdated workers.\n\tfor worker := range change.spawned {\n\t\tm.resolveBroker(actDesc, worker)\n\t}\n\tfor worker := range change.outdated {\n\t\tm.resolveBroker(actDesc, worker)\n\t}\n\t// All broker assignments have been propagated to workers, so it is safe to\n\t// close executors that are not used anymore.\n\tfor executor, referenceCount := range m.references {\n\t\tif referenceCount != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tactDesc.Log().Infof(\"decomission %s\", executor)\n\t\texecutor.Stop()\n\t\tdelete(m.references, executor)\n\t\tif m.connections[executor.BrokerConn()] == executor {\n\t\t\tdelete(m.connections, executor.BrokerConn())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cf6c71eb04edc1a3747ac011f298523c", "score": "0.50906956", "text": "func (pw *PoolWorker) Stop() {\n\tclose(pw.channel)\n}", "title": "" }, { "docid": "d69fa6e0dc52224b1a09c8e616ab645c", "score": "0.50891876", "text": "func (p *Pool) Stop() {\n\tpool := *p\n\tfor i := range pool.Workers {\n\t\tw := *(pool.Workers[i])\n\t\tw.StopChan <- true\n\t\tlog.Println(\"Stopped worker\", i)\n\t}\n}", "title": "" }, { "docid": "77710f6590de7b23fdc84ad5a011005c", "score": "0.50855523", "text": "func (bb *Bitbucket) Deactivate(u *model.User, r *model.Repo, link string) error {\n\tclient := NewClientToken(\n\t\tbb.Client,\n\t\tbb.Secret,\n\t\t&oauth2.Token{\n\t\t\tAccessToken: u.Token,\n\t\t\tRefreshToken: u.Secret,\n\t\t},\n\t)\n\n\tlinkurl, err := url.Parse(link)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// see if the hook already exists. If yes be sure to\n\t// delete so that multiple messages aren't sent.\n\thooks, _ := client.ListHooks(r.Owner, r.Name, &ListOpts{})\n\tfor _, hook := range hooks.Values {\n\t\thookurl, err := url.Parse(hook.Url)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif hookurl.Host == linkurl.Host {\n\t\t\tclient.DeleteHook(r.Owner, r.Name, hook.Uuid)\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fe5b9ce2ff4946b5b16270a8780f1465", "score": "0.5082794", "text": "func (l *Learner) Stop() {\n\t//TODO(student): Task 3 - distributed implementation\n\tl.stopChan <- 0\n}", "title": "" }, { "docid": "b391c927d8e4afd99aac6d726e6ce589", "score": "0.5077371", "text": "func (w Worker) destroy() {\r\n\tw.quit <- 0\r\n}", "title": "" }, { "docid": "cdd48a9669006868f34a1728012cdb05", "score": "0.5071484", "text": "func (p *Pool) Remove(w *Worker) {\n\tfor i, worker := range p.workers {\n\t\tif worker == w {\n\t\t\tp.workers = append(p.workers[:i], p.workers[i+1:]...)\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8133e566a54d71e46fb51fff02c436a0", "score": "0.5069008", "text": "func (instance *Cluster) Stop(ctx context.Context) (xerr fail.Error) {\n\tdefer fail.OnPanic(&xerr)\n\n\tif instance == nil || instance.IsNull() {\n\t\treturn fail.InvalidInstanceError()\n\t}\n\tif ctx == nil {\n\t\treturn fail.InvalidParameterCannotBeNilError(\"ctx\")\n\t}\n\n\ttask, xerr := concurrency.TaskFromContext(ctx)\n\txerr = debug.InjectPlannedFail(xerr)\n\tif xerr != nil {\n\t\tswitch xerr.(type) {\n\t\tcase *fail.ErrNotAvailable:\n\t\t\ttask, xerr = concurrency.VoidTask()\n\t\t\tif xerr != nil {\n\t\t\t\treturn xerr\n\t\t\t}\n\t\tdefault:\n\t\t\treturn xerr\n\t\t}\n\t}\n\n\tif task.Aborted() {\n\t\treturn fail.AbortedError(nil, \"aborted\")\n\t}\n\n\ttracer := debug.NewTracer(task, tracing.ShouldTrace(\"resources.cluster\")).Entering()\n\tdefer tracer.Exiting()\n\n\t// make sure no other parallel actions interferes\n\tinstance.lock.Lock()\n\tdefer instance.lock.Unlock()\n\n\t// If the Cluster is stopped, do nothing\n\tvar prevState clusterstate.Enum\n\tprevState, xerr = instance.unsafeGetState()\n\txerr = debug.InjectPlannedFail(xerr)\n\tif xerr != nil {\n\t\treturn xerr\n\t}\n\tswitch prevState {\n\tcase clusterstate.Removed:\n\t\treturn fail.NotAvailableError(\"Cluster is being removed\")\n\tcase clusterstate.Stopped:\n\t\treturn nil\n\tcase clusterstate.Stopping:\n\t\txerr = retry.WhileUnsuccessful(\n\t\t\tfunc() error {\n\t\t\t\tstate, innerErr := instance.unsafeGetState()\n\t\t\t\tif innerErr != nil {\n\t\t\t\t\treturn innerErr\n\t\t\t\t}\n\n\t\t\t\tif state == clusterstate.Removed {\n\t\t\t\t\treturn retry.StopRetryError(fail.NotAvailableError(\"Cluster is being removed\"))\n\t\t\t\t}\n\n\t\t\t\tif state != clusterstate.Stopped {\n\t\t\t\t\treturn fail.NotAvailableError(\"current state of Cluster is '%s'\", state.String())\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\ttemporal.GetDefaultDelay(),\n\t\t\ttemporal.GetExecutionTimeout(),\n\t\t)\n\t\txerr = debug.InjectPlannedFail(xerr)\n\t\tif xerr != nil {\n\t\t\tswitch xerr.(type) {\n\t\t\tcase *fail.ErrTimeout:\n\t\t\t\treturn fail.Wrap(xerr.Cause(), \"timeout\")\n\t\t\tcase *retry.ErrStopRetry:\n\t\t\t\treturn fail.Wrap(xerr.Cause(), \"stopping retries\")\n\t\t\tdefault:\n\t\t\t\treturn xerr\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tcase clusterstate.Nominal, clusterstate.Degraded:\n\t\t// continue\n\tdefault:\n\t\t// If the Cluster is not in state Nominal or Degraded, can't stop\n\t\treturn fail.NotAvailableError(\"failed to stop Cluster because of it's current state: %s\", prevState.String())\n\t}\n\n\t// First mark Cluster to be in state Stopping\n\txerr = instance.Alter(func(_ data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Alter(clusterproperty.StateV1, func(clonable data.Clonable) fail.Error {\n\t\t\tstateV1, ok := clonable.(*propertiesv1.ClusterState)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.ClusterState' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tstateV1.State = clusterstate.Stopping\n\t\t\treturn nil\n\t\t})\n\t})\n\txerr = debug.InjectPlannedFail(xerr)\n\tif xerr != nil {\n\t\treturn xerr\n\t}\n\n\tif task.Aborted() {\n\t\treturn fail.AbortedError(nil, \"aborted\")\n\t}\n\n\t// Then stop it and mark it as STOPPED on success\n\treturn instance.Alter(func(clonable data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\tvar (\n\t\t\tnodes []string\n\t\t\tmasters []string\n\t\t\tgatewayID, secondaryGatewayID string\n\t\t)\n\t\tinnerXErr := props.Inspect(clusterproperty.NodesV3, func(clonable data.Clonable) fail.Error {\n\t\t\tnodesV3, ok := clonable.(*propertiesv3.ClusterNodes)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv3.ClusterNodes' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tmasters = make([]string, 0, len(nodesV3.Masters))\n\t\t\tfor _, v := range nodesV3.Masters {\n\t\t\t\tif node, found := nodesV3.ByNumericalID[v]; found {\n\t\t\t\t\tmasters = append(masters, node.ID)\n\t\t\t\t}\n\t\t\t}\n\t\t\tnodes = make([]string, 0, len(nodesV3.PrivateNodes))\n\t\t\tfor _, v := range nodesV3.PrivateNodes {\n\t\t\t\tif node, found := nodesV3.ByNumericalID[v]; found {\n\t\t\t\t\tnodes = append(nodes, node.ID)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif innerXErr != nil {\n\t\t\treturn fail.Wrap(innerXErr, \"failed to get list of hosts\")\n\t\t}\n\n\t\tinnerXErr = props.Inspect(clusterproperty.NetworkV3, func(clonable data.Clonable) fail.Error {\n\t\t\tnetworkV3, ok := clonable.(*propertiesv3.ClusterNetwork)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv2.ClusterNetwork' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tgatewayID = networkV3.GatewayID\n\t\t\tsecondaryGatewayID = networkV3.SecondaryGatewayID\n\t\t\treturn nil\n\t\t})\n\t\tif innerXErr != nil {\n\t\t\treturn innerXErr\n\t\t}\n\n\t\t// Stop nodes\n\t\ttaskGroup, innerXErr := concurrency.NewTaskGroupWithParent(task, concurrency.InheritParentIDOption)\n\t\tif innerXErr != nil {\n\t\t\treturn innerXErr\n\t\t}\n\n\t\t// FIXME: if there's a problem starting things don't return, note the problem, break if needed, then abort and wait.\n\t\tvar problems []error\n\n\t\tfor _, n := range nodes {\n\t\t\tif _, innerXErr = taskGroup.Start(instance.taskStopHost, n); innerXErr != nil {\n\t\t\t\tproblems = append(problems, innerXErr)\n\t\t\t\tabErr := taskGroup.Abort()\n\t\t\t\tif abErr != nil {\n\t\t\t\t\tlogrus.Warnf(\"problem aborting taskgroup: %v\", abErr)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// Stop masters\n\t\tfor _, n := range masters {\n\t\t\tif _, innerXErr = taskGroup.Start(instance.taskStopHost, n); innerXErr != nil {\n\t\t\t\tproblems = append(problems, innerXErr)\n\t\t\t\tabErr := taskGroup.Abort()\n\t\t\t\tif abErr != nil {\n\t\t\t\t\tlogrus.Warnf(\"problem aborting taskgroup: %v\", abErr)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// Stop gateway(s)\n\t\tif _, innerXErr = taskGroup.Start(instance.taskStopHost, gatewayID); innerXErr != nil {\n\t\t\tproblems = append(problems, innerXErr)\n\t\t\tabErr := taskGroup.Abort()\n\t\t\tif abErr != nil {\n\t\t\t\tlogrus.Warnf(\"problem aborting taskgroup: %v\", abErr)\n\t\t\t}\n\t\t}\n\n\t\tif secondaryGatewayID != \"\" {\n\t\t\tif _, innerXErr = taskGroup.Start(instance.taskStopHost, secondaryGatewayID); innerXErr != nil {\n\t\t\t\tproblems = append(problems, innerXErr)\n\t\t\t\tabErr := taskGroup.Abort()\n\t\t\t\tif abErr != nil {\n\t\t\t\t\tlogrus.Warnf(\"problem aborting taskgroup: %v\", abErr)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif _, innerXErr = taskGroup.WaitGroup(); innerXErr != nil {\n\t\t\tif len(problems) > 0 {\n\t\t\t\t_ = innerXErr.AddConsequence(fail.NewErrorList(problems))\n\t\t\t}\n\t\t\treturn innerXErr\n\t\t}\n\t\tif len(problems) > 0 {\n\t\t\treturn fail.NewErrorList(problems)\n\t\t}\n\n\t\treturn props.Alter(clusterproperty.StateV1, func(clonable data.Clonable) fail.Error {\n\t\t\tstateV1, ok := clonable.(*propertiesv1.ClusterState)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv1.ClusterState' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\t\t\tstateV1.State = clusterstate.Stopped\n\t\t\treturn nil\n\t\t})\n\t})\n}", "title": "" }, { "docid": "fc7d2cff35b64c139d286a5caaa1d1bf", "score": "0.50669104", "text": "func (w *FetchWorker) Stop(wg *sync.WaitGroup) {\n\tif w.Running {\n\t\tw.StoppedChan = make(chan bool)\n\t\tclose(w.StopChan)\n\t\t<-w.StoppedChan\n\t\twg.Done()\n\t\tw.Running = false\n\t}\n}", "title": "" }, { "docid": "22e451313cab3fce081a750d4f0cb985", "score": "0.50572634", "text": "func (f *taskFetcherFactoryImpl) Stop() {\n\tif !atomic.CompareAndSwapInt32(\n\t\t&f.status,\n\t\tcommon.DaemonStatusStarted,\n\t\tcommon.DaemonStatusStopped,\n\t) {\n\t\treturn\n\t}\n\n\tf.clusterMetadata.UnRegisterMetadataChangeCallback(f)\n\tf.fetchersLock.Lock()\n\tdefer f.fetchersLock.Unlock()\n\tfor _, fetcher := range f.fetchers {\n\t\tfetcher.Stop()\n\t}\n\tf.logger.Info(\"Replication task fetchers stopped.\")\n}", "title": "" }, { "docid": "6f9ed445c53a6676ba3eb1b00335677e", "score": "0.50551295", "text": "func (mr *MapReduce) KillWorkers() *list.List {\n l := list.New()\n for _, w := range mr.Workers {\n DPrintf(\"DoWork: shutdown %s\\n\", w.address)\n args := &ShutdownArgs{}\n var reply ShutdownReply;\n ok := call(w.address, \"Worker.Shutdown\", args, &reply)\n if ok == false {\n fmt.Printf(\"DoWork: RPC %s shutdown error\\n\", w.address)\n } else {\n l.PushBack(reply.Njobs)\n }\n }\n return l\n}", "title": "" }, { "docid": "6f9ed445c53a6676ba3eb1b00335677e", "score": "0.50551295", "text": "func (mr *MapReduce) KillWorkers() *list.List {\n l := list.New()\n for _, w := range mr.Workers {\n DPrintf(\"DoWork: shutdown %s\\n\", w.address)\n args := &ShutdownArgs{}\n var reply ShutdownReply;\n ok := call(w.address, \"Worker.Shutdown\", args, &reply)\n if ok == false {\n fmt.Printf(\"DoWork: RPC %s shutdown error\\n\", w.address)\n } else {\n l.PushBack(reply.Njobs)\n }\n }\n return l\n}", "title": "" }, { "docid": "6f9ed445c53a6676ba3eb1b00335677e", "score": "0.50551295", "text": "func (mr *MapReduce) KillWorkers() *list.List {\n l := list.New()\n for _, w := range mr.Workers {\n DPrintf(\"DoWork: shutdown %s\\n\", w.address)\n args := &ShutdownArgs{}\n var reply ShutdownReply;\n ok := call(w.address, \"Worker.Shutdown\", args, &reply)\n if ok == false {\n fmt.Printf(\"DoWork: RPC %s shutdown error\\n\", w.address)\n } else {\n l.PushBack(reply.Njobs)\n }\n }\n return l\n}", "title": "" }, { "docid": "6f9ed445c53a6676ba3eb1b00335677e", "score": "0.50551295", "text": "func (mr *MapReduce) KillWorkers() *list.List {\n l := list.New()\n for _, w := range mr.Workers {\n DPrintf(\"DoWork: shutdown %s\\n\", w.address)\n args := &ShutdownArgs{}\n var reply ShutdownReply;\n ok := call(w.address, \"Worker.Shutdown\", args, &reply)\n if ok == false {\n fmt.Printf(\"DoWork: RPC %s shutdown error\\n\", w.address)\n } else {\n l.PushBack(reply.Njobs)\n }\n }\n return l\n}", "title": "" }, { "docid": "b6559a37ca94a908508c6f05ddfbe9da", "score": "0.5040178", "text": "func RaceDisable()", "title": "" }, { "docid": "115da99c802c848503c5955678c576c6", "score": "0.5038698", "text": "func (p *Pool) taskDown() {\n\tp.currentLoad.Add(-1)\n}", "title": "" }, { "docid": "85221ae3e19aa88230915d63c459f4e4", "score": "0.5035611", "text": "func (client *PartnerTopicsClient) Deactivate(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsDeactivateOptions) (PartnerTopicsDeactivateResponse, error) {\n\treq, err := client.deactivateCreateRequest(ctx, resourceGroupName, partnerTopicName, options)\n\tif err != nil {\n\t\treturn PartnerTopicsDeactivateResponse{}, err\n\t}\n\tresp, err := client.con.Pipeline().Do(req)\n\tif err != nil {\n\t\treturn PartnerTopicsDeactivateResponse{}, err\n\t}\n\tif !resp.HasStatusCode(http.StatusOK) {\n\t\treturn PartnerTopicsDeactivateResponse{}, client.deactivateHandleError(resp)\n\t}\n\treturn client.deactivateHandleResponse(resp)\n}", "title": "" }, { "docid": "101cb696acccca28f280c81fea4ec48f", "score": "0.50212514", "text": "func (w *worker) stop() error {\n\tif w.termC == nil {\n\t\tpanic(\"worker was not started successfully\")\n\t}\n\tselect {\n\tcase <-w.termC:\n\t\t// Worker already terminated.\n\t\tif w.client == nil {\n\t\t\t// stop already called.\n\t\t\treturn w.waitErr\n\t\t}\n\t\t// Possible unexpected termination.\n\t\tw.client.Close()\n\t\tw.cmd = nil\n\t\tw.client = nil\n\t\treturn w.waitErr\n\tdefault:\n\t\t// Worker still running.\n\t}\n\n\t// Tell the worker to stop by closing fuzz_in. It won't actually stop until it\n\t// finishes with earlier calls.\n\tcloseC := make(chan struct{})\n\tgo func() {\n\t\tw.client.Close()\n\t\tclose(closeC)\n\t}()\n\n\tsig := os.Interrupt\n\tif runtime.GOOS == \"windows\" {\n\t\t// Per https://golang.org/pkg/os/#Signal, “Interrupt is not implemented on\n\t\t// Windows; using it with os.Process.Signal will return an error.”\n\t\t// Fall back to Kill instead.\n\t\tsig = os.Kill\n\t}\n\n\tt := time.NewTimer(workerTimeoutDuration)\n\tfor {\n\t\tselect {\n\t\tcase <-w.termC:\n\t\t\t// Worker terminated.\n\t\t\tt.Stop()\n\t\t\t<-closeC\n\t\t\tw.cmd = nil\n\t\t\tw.client = nil\n\t\t\treturn w.waitErr\n\n\t\tcase <-t.C:\n\t\t\t// Timer fired before worker terminated.\n\t\t\tw.interrupted = true\n\t\t\tswitch sig {\n\t\t\tcase os.Interrupt:\n\t\t\t\t// Try to stop the worker with SIGINT and wait a little longer.\n\t\t\t\tw.cmd.Process.Signal(sig)\n\t\t\t\tsig = os.Kill\n\t\t\t\tt.Reset(workerTimeoutDuration)\n\n\t\t\tcase os.Kill:\n\t\t\t\t// Try to stop the worker with SIGKILL and keep waiting.\n\t\t\t\tw.cmd.Process.Signal(sig)\n\t\t\t\tsig = nil\n\t\t\t\tt.Reset(workerTimeoutDuration)\n\n\t\t\tcase nil:\n\t\t\t\t// Still waiting. Print a message to let the user know why.\n\t\t\t\tfmt.Fprintf(w.coordinator.opts.Log, \"waiting for fuzzing process to terminate...\\n\")\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f7009de63819c2eaad089d3bb14852e5", "score": "0.49957183", "text": "func (mr *Master) KillWorkers() *list.List {\n l := list.New()\n for _, w := range mr.workers {\n DPrintf(\"DoWork: shutdown %s\\n\", w.address)\n args := &ShutdownArgs{}\n var reply ShutdownReply;\n ok := call(w.address, \"Worker.Shutdown\", args, &reply)\n if ok == false {\n DPrintf(\"DoWork: RPC %s shutdown error\\n\", w.address)\n } else {\n l.PushBack(reply.Njobs)\n }\n }\n return l\n}", "title": "" }, { "docid": "1e2a6ee28c1897c90d6bcf7c0ec469b5", "score": "0.4992056", "text": "func Deactivate() {\n\tactive = false\n\ttraveledTime = nil\n\ttraveledAt = time.Time{}\n\ttimeScale = 1\n\tlocation = nil\n\tactiveMu.Unlock()\n}", "title": "" }, { "docid": "9d35432612161c3b9cba290d0e755927", "score": "0.498731", "text": "func RemoveWorker(worker Worker) {\n\tdefaultSojuServer.RemoveWorker(worker)\n\treturn\n}", "title": "" }, { "docid": "220cacf59c8b70ecdffb8aa6de35bd65", "score": "0.49871188", "text": "func (p *PerformanceData) Deactivate() {\n\tp.Active = false // Deactivate Active Perfomance\n\tp.Iterations = 0 // Reset Iteration Counter\n\tp.Interval = p.SlowInterval // Restore Interval Check Speed\n}", "title": "" }, { "docid": "c1d6837f8c2aa1a0a3f8cce8dcea8105", "score": "0.49864075", "text": "func worker(cannel chan bool) {\n\tfor {\n\t\tselect {\n\t\tdefault:\n\t\t\tfmt.Println(\"hello\")\n\t\t// 正常工作\n\t\tcase <-cannel:\n\t\t\t// 退出\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6ff0ad5e5de71202d676c4577b154701", "score": "0.4982875", "text": "func (br *BackgroundRunner) Disable() {\n\t_, e := br.runner.Current()\n\tif e != nil {\n\t\te.End()\n\t\t<-e.Done()\n\t}\n}", "title": "" }, { "docid": "24012c83040df260188538ba6716e6f6", "score": "0.49726915", "text": "func (w *Window) ThreadDeactivate(thread *Thread) ThreadError {\n\treturn w.context.ThreadDeactivate(thread)\n}", "title": "" }, { "docid": "c6876f3724eabd48b3c5c55b0ddcaf7c", "score": "0.49715433", "text": "func (wp *WorkerPool) Stop() error {\n\n\tif wp.state == notRunning {\n\t\treturn nil\n\t}\n\twp.cancelFunc()\n\twp.DoneWg.Wait()\n\twp.state = notRunning\n\treturn nil\n}", "title": "" }, { "docid": "f664224a5c2820321e34988f8a32adb5", "score": "0.49675846", "text": "func Stop() {\n\tdefaultWorker.Stop()\n}", "title": "" } ]
a74a5642557f1e4b325a2e327444c87f
attempt to convert spec to struct and return: the converted struct (if successful) the name of the struct success/failure as boolean
[ { "docid": "1e7f975ba7a29de7eacf3ee82876c8e1", "score": "0.6481424", "text": "func toStruct(spec ast.Spec) (*ast.StructType, string, bool) {\n\ttypeSpec, ok := spec.(*ast.TypeSpec)\n\tif !ok {\n\t\treturn nil, \"\", false\n\t}\n\n\tstructType, ok := typeSpec.Type.(*ast.StructType)\n\tif !ok {\n\t\treturn nil, \"\", false\n\t}\n\treturn structType, typeSpec.Name.Name, true\n}", "title": "" } ]
[ { "docid": "03ae347fa5c1bb88d97108d5c277bf36", "score": "0.5598895", "text": "func (o *ServiceConfiguration) GetSpecOk() (*ServiceConfigurationSpec, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Spec, true\n}", "title": "" }, { "docid": "20e69bae1f3f6b8b6bc9d43186eb64f8", "score": "0.55224943", "text": "func getCurrSpec(o *unstructured.Unstructured) (interface{}, bool, error) {\n\tcurrSpec, found, err := unstructured.NestedFieldNoCopy(o.Object, \"spec\")\n\tif !found {\n\t\tlog.Error(err, \"No .spec found in current AmbassadorInstallation\")\n\t\treturn nil, false, nil\n\t}\n\tif err != nil {\n\t\tlog.Error(err, \"when trying to get current .spec\")\n\t\treturn nil, true, err\n\t}\n\n\treturn currSpec, true, nil\n}", "title": "" }, { "docid": "94dcd8f66b621e8e64fd9126902e250b", "score": "0.54679674", "text": "func (_f6 *FakeStructer) StructResultsForCall(ident1 struct {\n\ta string\n\tb string\n}) (ident2 struct {\n\tc string\n\td string\n}, found bool) {\n\tfor _, call := range _f6.StructCalls {\n\t\tif reflect.DeepEqual(call.Parameters.Ident1, ident1) {\n\t\t\tident2 = call.Results.Ident2\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "dc5593fb8ac564eb2614b1a4df46c92d", "score": "0.5464126", "text": "func (*Test1_Cont1A_Cont2A) IsYANGGoStruct() {}", "title": "" }, { "docid": "dc5593fb8ac564eb2614b1a4df46c92d", "score": "0.5464126", "text": "func (*Test1_Cont1A_Cont2A) IsYANGGoStruct() {}", "title": "" }, { "docid": "689cef5ff82685d7e1dc431139d3058d", "score": "0.54157543", "text": "func (_f12 *FakeStructer) NamedStructResultsForCall(a struct {\n\ta string\n\tb string\n}) (z struct {\n\tc string\n\td string\n}, found bool) {\n\tfor _, call := range _f12.NamedStructCalls {\n\t\tif reflect.DeepEqual(call.Parameters.A, a) {\n\t\t\tz = call.Results.Z\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "5ec3bde08b102c40b0a435a793fdb558", "score": "0.5385972", "text": "func TestStruct(t *testing.T) {\n\ttype tcase struct {\n\t\tin interface{}\n\t\terr error\n\t}\n\n\ttype (\n\t\tInts struct {\n\t\t\tInt8 int8\n\t\t\tInt16 int16\n\t\t\tInt32 int32\n\t\t}\n\t\tUints struct {\n\t\t\tUint8 uint8\n\t\t\tUint16 uint16\n\t\t\tUint32 uint32\n\t\t}\n\t\tVersion1 struct {\n\t\t\tversion [4]uint\n\t\t\tflag [1]bool\n\t\t}\n\t\tVersion2 struct {\n\t\t\tversion [4]uint\n\t\t\tflag bool\n\t\t\tLen [16]int\n\t\t}\n\t\tVersion3 struct {\n\t\t\tversion [4]uint\n\t\t\tflag bool\n\t\t\t_ [7]int // reserved\n\t\t\tLen [16]int\n\t\t\t_ [4]int // reserved\n\t\t\tChecksum [32]uint32\n\t\t}\n\t\tBroken1 struct {\n\t\t\tX [64]int64\n\t\t\tY [64]int64\n\t\t}\n\t\tBroken2 struct {\n\t\t\tData [32]int8\n\t\t}\n\t\tBroken3 struct {\n\t\t\tData [2]float32\n\t\t}\n\t\tBroken4 struct {\n\t\t\tData float32\n\t\t}\n\t\tBroken5 struct {\n\t\t\tVersion1\n\t\t}\n\t\tBroken6 struct{}\n\t)\n\n\tfor _, tc := range []tcase{\n\t\t{Ints{}, nil},\n\t\t{Uints{}, nil},\n\t\t{Version1{}, nil},\n\t\t{Version2{}, nil},\n\t\t{Version3{}, nil},\n\t\t{0, ErrNotAStruct},\n\t\t{Broken1{}, ErrStructOverflow},\n\t\t{Broken2{}, ErrFieldOverflow},\n\t\t{Broken3{}, ErrFieldType},\n\t\t{Broken4{}, ErrFieldBadType},\n\t\t{Broken5{}, ErrEmbeddedField},\n\t\t{Broken6{}, ErrEmptyStruct},\n\t} {\n\t\tlabel := fmt.Sprintf(\"testpkg/%s_gen.go\", reflect.TypeOf(tc.in).Name())\n\t\tt.Run(label, func(t *testing.T) {\n\t\t\tbuf := new(bytes.Buffer)\n\t\t\terr := GenPackedStruct(buf, &Config{PkgName: \"testpkg\"}, tc.in)\n\t\t\tswitch {\n\t\t\tcase tc.err == nil && err != nil:\n\t\t\t\tt.Fatal(err)\n\t\t\tcase tc.err != nil && err == nil:\n\t\t\t\tt.Fatal(\"expected error not found\")\n\t\t\tcase tc.err != nil && err != nil:\n\t\t\t\tvar serr Error\n\t\t\t\tswitch {\n\t\t\t\tcase !errors.As(err, &serr):\n\t\t\t\t\tt.Fatalf(\"got %T; want %T\", err, serr)\n\t\t\t\tcase !errors.Is(err, tc.err):\n\t\t\t\t\tt.Fatalf(\"got %q; want %q\", serr, tc.err.Error())\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif tc.err != nil || err != nil {\n\t\t\t\t// Do not create invalid files.\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tout, err := os.Create(label)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer out.Close()\n\t\t\t_, err = io.Copy(out, buf)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "0fa38424ad642f2a17841e562633d875", "score": "0.5354791", "text": "func (*Test1_Cont1A_List2A) IsYANGGoStruct() {}", "title": "" }, { "docid": "0fa38424ad642f2a17841e562633d875", "score": "0.5354791", "text": "func (*Test1_Cont1A_List2A) IsYANGGoStruct() {}", "title": "" }, { "docid": "2115bbe42d70678d7c83645e2e5f7f65", "score": "0.5336251", "text": "func (*OnfTest1_Cont1A_Cont2A) IsYANGGoStruct() {}", "title": "" }, { "docid": "795f56e78b2a2b42f50eb046ad366598", "score": "0.53280145", "text": "func (*Test1_Cont1A) IsYANGGoStruct() {}", "title": "" }, { "docid": "795f56e78b2a2b42f50eb046ad366598", "score": "0.53280145", "text": "func (*Test1_Cont1A) IsYANGGoStruct() {}", "title": "" }, { "docid": "a8caa944e13a41a7cc3964398dff07b1", "score": "0.5314397", "text": "func (*OnfTest1_Cont1A) IsYANGGoStruct() {}", "title": "" }, { "docid": "0182a0b65d6038eeb997139eb35d6469", "score": "0.5313842", "text": "func (o *ModelsBackupJob) GetBackupSpecOk() (map[string]interface{}, bool) {\n\tif o == nil || o.BackupSpec == nil {\n\t\treturn nil, false\n\t}\n\treturn o.BackupSpec, true\n}", "title": "" }, { "docid": "1b23f7164d79b2329906d95922961e1d", "score": "0.5307847", "text": "func (v *validate) GetStructFieldOK() (reflect.Value, reflect.Kind, bool) {\n\tcurrent, kind, _, found := v.getStructFieldOKInternal(v.slflParent, v.ct.param)\n\treturn current, kind, found\n}", "title": "" }, { "docid": "1b23f7164d79b2329906d95922961e1d", "score": "0.5307847", "text": "func (v *validate) GetStructFieldOK() (reflect.Value, reflect.Kind, bool) {\n\tcurrent, kind, _, found := v.getStructFieldOKInternal(v.slflParent, v.ct.param)\n\treturn current, kind, found\n}", "title": "" }, { "docid": "dd0bf98529499460ab6898d8a2e0c3bf", "score": "0.52901083", "text": "func (g *Guestfs) Internal_test_rstruct (val string) (*PV, *GuestfsError) {\n if g.g == nil {\n return &PV{}, closed_handle_error (\"internal_test_rstruct\")\n }\n\n c_val := C.CString (val)\n defer C.free (unsafe.Pointer (c_val))\n\n r := C.guestfs_internal_test_rstruct (g.g, c_val)\n\n if r == nil {\n return &PV{}, get_error_from_handle (g, \"internal_test_rstruct\")\n }\n defer C.guestfs_free_lvm_pv (r)\n return return_PV (r), nil\n}", "title": "" }, { "docid": "a005545d8b606e8bfb8fc7ab884ff095", "score": "0.52694017", "text": "func (o *DeviceInfo) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.5257663", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.5257663", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.5257663", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.5257663", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.5257663", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.5257663", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.5257663", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "177dd92ca1bed62d79e871e01be94370", "score": "0.5251397", "text": "func (d *structData) WalkStruct(rv reflect.Value) (bool, error) {\n\tif rv.Type().Kind() == reflect.Ptr {\n\t\telemv := reflect.New(rv.Type().Elem())\n\t\tok, err := d.WalkStruct(elemv.Elem())\n\t\tif ok == false || err != nil {\n\t\t\treturn ok, err\n\t\t}\n\t\terr = SetValue(rv, elemv)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\treturn true, nil\n\t}\n\tif rv.Type().Kind() != reflect.Struct {\n\t\treturn false, nil\n\t}\n\ta := d.assembler\n\trt := rv.Type()\n\tfl := rt.NumField()\n\tci := !a.Config().CaseSensitive\n\tvalue := reflect.Indirect(rv)\n\tfor i := 0; i < fl; i++ {\n\t\tvar part Part\n\t\tvar ok bool\n\t\tfield := rt.Field(i)\n\t\tif field.PkgPath != \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tstep := NewFieldStep(&field)\n\t\tfv := value.Field(i)\n\t\t//Call checktype to verify type and init value if necessary(for example,lazyloader and lazyloadfunc)\n\t\ttp, err := a.WithChild(nil, step).CheckType(fv)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif tp == TypeUnkonwn {\n\t\t\tcontinue\n\t\t}\n\t\ttag, err := a.Config().GetTag(rt, field)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif tag.Ignored {\n\t\t\tcontinue\n\t\t}\n\t\tif d.IsAnonymous(field, tag) {\n\t\t\t_, err := d.WalkStruct(indirectReflectValue(fv))\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif tag.Name != \"\" {\n\t\t\tpart, ok = d.valuemap[tag.Name]\n\t\t}\n\t\tif !ok {\n\t\t\tpart, ok = d.valuemap[field.Name]\n\t\t}\n\t\tif !ok && ci {\n\t\t\tpart, ok = d.civaluemap[strings.ToLower(field.Name)]\n\t\t}\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\t_, err = a.Config().Unifiers.Unify(a.WithChild(part, step), fv)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t}\n\terr := SetValue(rv, value)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn true, nil\n\n}", "title": "" }, { "docid": "dc03ce14b09d6dee9ff8ac3970fdc1c7", "score": "0.52489287", "text": "func IsStructBased(kind string) bool {\n\tspl := strings.Split(kind, \".\")\n\tlast := spl[len(spl)-1]\n\tfirstChar := string(last[0])\n\treturn firstChar == strings.ToUpper(firstChar)\n}", "title": "" }, { "docid": "cedd3abe2113c52f0849de956b013d00", "score": "0.52419806", "text": "func (o *ModelsBackupJob) GetDataServiceSpecOk() (map[string]interface{}, bool) {\n\tif o == nil || o.DataServiceSpec == nil {\n\t\treturn nil, false\n\t}\n\treturn o.DataServiceSpec, true\n}", "title": "" }, { "docid": "a945e245a73e94a751c34f177b7f2e40", "score": "0.5241632", "text": "func (o *WorkflowApiAllOf) GetResponseSpecOk() (*interface{}, bool) {\n\tif o == nil || o.ResponseSpec == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ResponseSpec, true\n}", "title": "" }, { "docid": "a69249eafef5cec21e9ab35d0f5e8fae", "score": "0.5241157", "text": "func (o *LicensedWorkload) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "e08d574409058ce430c22a087ae6a71d", "score": "0.52294934", "text": "func (*OnfTest1_Cont1A_List2A) IsYANGGoStruct() {}", "title": "" }, { "docid": "f28b237aba3c5ec86bfad3bcd639caf5", "score": "0.5184655", "text": "func (*Component_Subcomponent) IsYANGGoStruct() {}", "title": "" }, { "docid": "f28b237aba3c5ec86bfad3bcd639caf5", "score": "0.5184655", "text": "func (*Component_Subcomponent) IsYANGGoStruct() {}", "title": "" }, { "docid": "f28b237aba3c5ec86bfad3bcd639caf5", "score": "0.5184655", "text": "func (*Component_Subcomponent) IsYANGGoStruct() {}", "title": "" }, { "docid": "f28b237aba3c5ec86bfad3bcd639caf5", "score": "0.5183014", "text": "func (*Component_Subcomponent) IsYANGGoStruct() {}", "title": "" }, { "docid": "d3618a50a381a47837e60b2acfc7a94e", "score": "0.51807266", "text": "func (o *V1NetworkPolicy) GetSpecOk() (*V1NetworkPolicySpec, bool) {\n\tif o == nil || o.Spec == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Spec, true\n}", "title": "" }, { "docid": "6aaf2809d8204e98ef6c0697be8f414d", "score": "0.5163636", "text": "func (s *SyntheticsTest) GetNameOk() (string, bool) {\n\tif s == nil || s.Name == nil {\n\t\treturn \"\", false\n\t}\n\treturn *s.Name, true\n}", "title": "" }, { "docid": "dce5c7b8b1a2f2fb0e34718b146fd3ea", "score": "0.51578707", "text": "func (o *SystemInfo) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "def4258c80ebb03bcacc1f12ca9207e4", "score": "0.5154791", "text": "func (*Component_Cpu) IsYANGGoStruct() {}", "title": "" }, { "docid": "def4258c80ebb03bcacc1f12ca9207e4", "score": "0.5154791", "text": "func (*Component_Cpu) IsYANGGoStruct() {}", "title": "" }, { "docid": "def4258c80ebb03bcacc1f12ca9207e4", "score": "0.5154791", "text": "func (*Component_Cpu) IsYANGGoStruct() {}", "title": "" }, { "docid": "def4258c80ebb03bcacc1f12ca9207e4", "score": "0.5154791", "text": "func (*Component_Cpu) IsYANGGoStruct() {}", "title": "" }, { "docid": "9225a34f878c7fcdae982cbb915ccefd", "score": "0.5154275", "text": "func TestParseDesc(t *testing.T) {\n\ttmust := func(tm time.Time, err error) time.Time {\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\treturn tm\n\t}\n\ttestdata := []struct {\n\t\tname, str string\n\t\twant KInfo\n\t}{\n\t\t{\n\t\t\tname: \"normboot\",\n\t\t\tstr: normboot,\n\t\t\twant: KInfo{\n\t\t\t\tRelease: \"4.19.16-norm_boot\",\n\t\t\t\tVersion: \"#300 SMP Fri Jan 25 16:32:19 UTC 2019\",\n\t\t\t\tBuilder: \"user@host\",\n\t\t\t\tBuildNum: 300,\n\t\t\t\tBuildTime: tmust(time.Parse(time.RFC3339, \"2019-01-25T16:32:19Z\")), // equivalent\n\t\t\t\tMaj: 4,\n\t\t\t\tMin: 19,\n\t\t\t\tPatch: 16,\n\t\t\t\tLocalVer: \"norm_boot\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"ancient\",\n\t\t\tstr: ancient,\n\t\t\twant: KInfo{\n\t\t\t\tRelease: \"2.6.24.111\",\n\t\t\t\tVersion: \"#606 Mon Apr 14 00:06:11 CEST 2014\",\n\t\t\t\tBuilder: \"\",\n\t\t\t\tBuildNum: 606,\n\t\t\t\tBuildTime: tmust(time.Parse(time.RFC3339, \"2014-04-14T00:06:11Z\")), // equivalent\n\t\t\t\tMaj: 2,\n\t\t\t\tMin: 6,\n\t\t\t\tPatch: 24,\n\t\t\t\tLocalVer: \"\",\n\t\t\t},\n\t\t},\n\t}\n\tfor _, td := range testdata {\n\t\tt.Run(td.name, func(t *testing.T) {\n\t\t\tki, err := ParseDesc(td.str)\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t\tif !ki.Equal(td.want) {\n\t\t\t\tt.Error(\"mismatch\")\n\t\t\t}\n\t\t\tif t.Failed() {\n\t\t\t\tt.Logf(\"\\nwant %#v\\ngot %#v\", td.want, ki)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "af20287a232f89d3502c49356b5fbb40", "score": "0.5151987", "text": "func (src Source) IsStructMap() {}", "title": "" }, { "docid": "8a45d0eb2f7ca6608c73b583bc0f4d30", "score": "0.5146197", "text": "func ValidStruct(s interface{}) (bool, validator.ValidationErrors) {\n\terrorsMap := GetValidator().Struct(s)\n\treturn errorsMap == nil, errorsMap\n}", "title": "" }, { "docid": "dc9486cc21898430d514ed70b47bbe70", "score": "0.51459956", "text": "func (o *EnvironmentShortRepresentation) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "a3b3d125dca700e438787c9c98d2b55b", "score": "0.51417303", "text": "func CompareStruct(\n\tcfg *ackgenconfig.Config,\n\tr *model.CRD,\n\t// struct informing code generator how to compare the field values\n\tcompareConfig *ackgenconfig.CompareFieldConfig,\n\t// struct describing the SDK type of the field being compared\n\tshape *awssdkmodel.Shape,\n\t// String representing the name of the variable that is of type\n\t// `*ackcompare.Delta`. We will generate Go code that calls the `Add()`\n\t// method of this variable when differences between fields are detected.\n\tdeltaVarName string,\n\t// String representing the name of the variable that represents the first\n\t// CR under comparison. This will typically be something like\n\t// \"a.ko.Spec.Name\". See `templates/pkg/resource/delta.go.tpl`.\n\tfirstResVarName string,\n\t// String representing the name of the variable that represents the second\n\t// CR under comparison. This will typically be something like\n\t// \"b.ko.Spec.Name\". See `templates/pkg/resource/delta.go.tpl`.\n\tsecondResVarName string,\n\t// String indicating the current field path being evaluated, e.g.\n\t// \"Author.Name\". This does not include the top-level Spec or Status\n\t// struct.\n\tfieldPath string,\n\t// Number of levels of indentation to use\n\tindentLevel int,\n) string {\n\tout := \"\"\n\n\tfieldConfigs := cfg.ResourceFields(r.Names.Original)\n\n\tfor _, memberName := range shape.MemberNames() {\n\t\tmemberShapeRef := shape.MemberRefs[memberName]\n\t\t// TODO(jaypipes): This is fragile. We actually need to have a way of\n\t\t// normalizing names in a lossless fashion...\n\t\tmemberNames := names.New(memberName)\n\t\tmemberNameClean := memberNames.Camel\n\n\t\t// this is the \"path\" to the field within the structs being compared.\n\t\t// This is passed down into the compareXXX functions recursively and\n\t\t// appended to with each level of nested structs we recurse into.\n\t\tmemberFieldPath := fieldPath + \".\" + memberNameClean\n\t\tindent := strings.Repeat(\"\\t\", indentLevel)\n\t\tfirstResAdaptedVarName := firstResVarName + \".\" + memberNameClean\n\t\tsecondResAdaptedVarName := secondResVarName + \".\" + memberNameClean\n\n\t\tvar compareConfig *ackgenconfig.CompareFieldConfig\n\t\tfieldConfig := fieldConfigs[memberFieldPath]\n\t\tif fieldConfig != nil {\n\t\t\tcompareConfig = fieldConfig.Compare\n\t\t}\n\n\t\tif compareConfig != nil && compareConfig.IsIgnored {\n\t\t\tcontinue\n\t\t}\n\n\t\tmemberShape := memberShapeRef.Shape\n\n\t\t// if ackcompare.HasNilDifference(a.ko.Spec.Name, b.ko.Spec.Name == nil) {\n\t\t// delta.Add(\"Spec.Name\", a.ko.Spec.Name, b.ko.Spec.Name)\n\t\t// }\n\t\tnilCode := compareNil(\n\t\t\tcompareConfig,\n\t\t\tmemberShape,\n\t\t\tdeltaVarName,\n\t\t\tfirstResAdaptedVarName,\n\t\t\tsecondResAdaptedVarName,\n\t\t\tmemberFieldPath,\n\t\t\tindentLevel,\n\t\t)\n\n\t\tif nilCode != \"\" {\n\t\t\t// else if a.ko.Spec.Name != nil && b.ko.Spec.Name != nil {\n\t\t\tout += fmt.Sprintf(\n\t\t\t\t\"%s else if %s != nil && %s != nil {\\n\",\n\t\t\t\tnilCode, firstResAdaptedVarName, secondResAdaptedVarName,\n\t\t\t)\n\t\t\tindentLevel++\n\t\t}\n\t\tswitch memberShape.Type {\n\t\tcase \"structure\":\n\t\t\t// Recurse through all the struct's fields and subfields, building\n\t\t\t// nested conditionals and calls to `delta.Add()`...\n\t\t\tout += CompareStruct(\n\t\t\t\tcfg, r,\n\t\t\t\tcompareConfig,\n\t\t\t\tmemberShape,\n\t\t\t\tdeltaVarName,\n\t\t\t\tfirstResAdaptedVarName,\n\t\t\t\tsecondResAdaptedVarName,\n\t\t\t\tmemberFieldPath,\n\t\t\t\tindentLevel,\n\t\t\t)\n\t\tcase \"list\":\n\t\t\t// Returns Go code that compares all the elements of the slice fields...\n\t\t\tout += compareSlice(\n\t\t\t\tcfg, r,\n\t\t\t\tcompareConfig,\n\t\t\t\tmemberShape,\n\t\t\t\tdeltaVarName,\n\t\t\t\tfirstResAdaptedVarName,\n\t\t\t\tsecondResAdaptedVarName,\n\t\t\t\tmemberFieldPath,\n\t\t\t\tindentLevel,\n\t\t\t)\n\t\tcase \"map\":\n\t\t\t// Returns Go code that compares all the elements of the map fields...\n\t\t\tout += compareMap(\n\t\t\t\tcfg, r,\n\t\t\t\tcompareConfig,\n\t\t\t\tmemberShape,\n\t\t\t\tdeltaVarName,\n\t\t\t\tfirstResAdaptedVarName,\n\t\t\t\tsecondResAdaptedVarName,\n\t\t\t\tmemberFieldPath,\n\t\t\t\tindentLevel,\n\t\t\t)\n\t\tdefault:\n\t\t\t// if *a.ko.Spec.Name != *b.ko.Spec.Name {\n\t\t\t// delta.Add(\"Spec.Name\", a.ko.Spec.Name, b.ko.Spec.Name)\n\t\t\t// }\n\t\t\tout += compareScalar(\n\t\t\t\tcompareConfig,\n\t\t\t\tmemberShape,\n\t\t\t\tdeltaVarName,\n\t\t\t\tfirstResAdaptedVarName,\n\t\t\t\tsecondResAdaptedVarName,\n\t\t\t\tmemberFieldPath,\n\t\t\t\tindentLevel,\n\t\t\t)\n\t\t}\n\t\tif nilCode != \"\" {\n\t\t\t// }\n\t\t\tout += fmt.Sprintf(\n\t\t\t\t\"%s}\\n\", indent,\n\t\t\t)\n\t\t\tindentLevel--\n\t\t}\n\t}\n\treturn out\n}", "title": "" }, { "docid": "8b30ef2f03205b9182520811d7c10465", "score": "0.5132251", "text": "func (fr *FissionResources) specExists(resource interface{}, compareMetadata bool, compareSpec bool) *metav1.ObjectMeta {\n\tswitch typedres := resource.(type) {\n\tcase *ArchiveUploadSpec:\n\t\tfor _, aus := range fr.archiveUploadSpecs {\n\t\t\tif compareMetadata && aus.Name != typedres.Name {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif compareSpec &&\n\t\t\t\t!(reflect.DeepEqual(aus.RootDir, typedres.RootDir) &&\n\t\t\t\t\treflect.DeepEqual(aus.IncludeGlobs, typedres.IncludeGlobs) &&\n\t\t\t\t\treflect.DeepEqual(aus.ExcludeGlobs, typedres.ExcludeGlobs)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn &metav1.ObjectMeta{Name: aus.Name}\n\t\t}\n\t\treturn nil\n\tcase *crd.Package:\n\t\tfor _, p := range fr.packages {\n\t\t\tif compareMetadata && !reflect.DeepEqual(p.Metadata, typedres.Metadata) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif compareSpec && !reflect.DeepEqual(p.Spec, typedres.Spec) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn &p.Metadata\n\t\t}\n\t\treturn nil\n\n\tdefault:\n\t\t// XXX not implemented\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "ce91ec2fb867578ef4d937f89393c3dd", "score": "0.5127973", "text": "func (*OnfTest1_Cont1A_List4) IsYANGGoStruct() {}", "title": "" }, { "docid": "a8c3079f5bb4f926f850599dc3b9bdf2", "score": "0.5119604", "text": "func (*Test1_Cont1BState_List2B) IsYANGGoStruct() {}", "title": "" }, { "docid": "a8c3079f5bb4f926f850599dc3b9bdf2", "score": "0.5119604", "text": "func (*Test1_Cont1BState_List2B) IsYANGGoStruct() {}", "title": "" }, { "docid": "9b19213278024e875e0115afd93d4063", "score": "0.51089394", "text": "func (*Test1_Cont1BState) IsYANGGoStruct() {}", "title": "" }, { "docid": "9b19213278024e875e0115afd93d4063", "score": "0.51089394", "text": "func (*Test1_Cont1BState) IsYANGGoStruct() {}", "title": "" }, { "docid": "e3e798a9985b86b2ec5d933d51c3be21", "score": "0.51022786", "text": "func getTransform(specObj spec) transformFunc {\n\ttform, ok := validSpecTypes[*specObj.Operation]\n\tif ok == false {\n\t\treturn transformPass\n\t}\n\treturn tform\n}", "title": "" }, { "docid": "22244b8eda0e179fcf620936b19885ec", "score": "0.5092926", "text": "func (*Component_Backplane) IsYANGGoStruct() {}", "title": "" }, { "docid": "22244b8eda0e179fcf620936b19885ec", "score": "0.5092926", "text": "func (*Component_Backplane) IsYANGGoStruct() {}", "title": "" }, { "docid": "22244b8eda0e179fcf620936b19885ec", "score": "0.5092926", "text": "func (*Component_Backplane) IsYANGGoStruct() {}", "title": "" }, { "docid": "22244b8eda0e179fcf620936b19885ec", "score": "0.5092926", "text": "func (*Component_Backplane) IsYANGGoStruct() {}", "title": "" }, { "docid": "92728a492c666d89d80de5fbd311fe3a", "score": "0.5087146", "text": "func TestStructType(t *testing.T) {\n\tstructID := test.ID_validation_test_interfaces_StructE__\n\tshortName := \"StructE\"\n\tfullIdentifier := \"mojo.test.StructE\"\n\tfields := map[int]string{\n\t\t0: \"StructD\",\n\t\t1: \"DataPipeConsumer\",\n\t}\n\n\t// Extract *UserDefinedType from the validation test's Descriptor using structID.\n\tudt := test_descriptor[structID]\n\tif udt == nil {\n\t\tt.Fatalf(\"Descriptor did not contain %s\", structID)\n\t}\n\n\t// The *UserDefinedType must be a *UserDefinedTypeStructType.\n\tudst, ok := udt.(*mojom_types.UserDefinedTypeStructType)\n\tif !ok {\n\t\tt.Fatalf(\"*UserDefinedType for %s was not *UserDefinedTypeStructType\", structID)\n\t}\n\n\t// The UserDefinedTypeStructType has a MojomStruct inside.\n\tms := udst.Value\n\n\t// Check that the generator produced the short name.\n\tif ms.DeclData == nil || ms.DeclData.ShortName == nil {\n\t\tt.Fatalf(\"Declaration Data's ShortName for %s is missing\", structID)\n\t}\n\tif *ms.DeclData.ShortName != shortName {\n\t\tt.Fatalf(\"Declaration Data's ShortName for %s was %s, expected %s\", structID, *ms.DeclData.ShortName, shortName)\n\t}\n\tif ms.DeclData.FullIdentifier == nil {\n\t\tt.Fatalf(\"Declaration Data's FullIdentifier for %s is missing\", structID)\n\t}\n\tif *ms.DeclData.FullIdentifier != fullIdentifier {\n\t\tt.Fatalf(\"Declaration Data's FullIdentifier for %s was %s, expected %s\", structID, *ms.DeclData.FullIdentifier, fullIdentifier)\n\t}\n\n\t// Verify that the number of fields matches the expected ones.\n\tif got, expected := len(ms.Fields), len(fields); got != expected {\n\t\tt.Fatalf(\"MojomStruct for %s had %d fields, but expected %d\", structID, got, expected)\n\t}\n\n\t// Go through each StructField, checking DeclData and the Type of each field.\n\t// Note that since ms.Fields is a slice, the \"ordinal\" is the index.\n\tfor i, field := range ms.Fields {\n\t\texpectedFieldShortName := fields[i]\n\t\t// Check that the ShortName is correct.\n\t\tif field.DeclData == nil || field.DeclData.ShortName == nil || *field.DeclData.ShortName != expectedFieldShortName {\n\t\t\tt.Fatalf(\"StructField for %s at ordinal %d did not have ShortName %s\", structID, i, expectedFieldShortName)\n\t\t}\n\n\t\t// Special case each field since we know what's inside.\n\t\tswitch i {\n\t\tcase 0:\n\t\t\tttr, ok := field.Type.(*mojom_types.TypeTypeReference)\n\t\t\tif !ok {\n\t\t\t\tt.Fatalf(\"StructField %s's field 0 didn't have Type *TypeTypeReference\", structID)\n\t\t\t}\n\n\t\t\t// TypeTypeReference.Value is a TypeReference\n\t\t\texpectedReferenceID := test.ID_validation_test_interfaces_StructD__\n\t\t\tif *ttr.Value.Identifier != expectedReferenceID {\n\t\t\t\tt.Fatalf(\"TypeReference Identifier got %s, but expected %s\", *ttr.Value.Identifier, expectedReferenceID)\n\t\t\t}\n\t\t\tif *ttr.Value.TypeKey != expectedReferenceID {\n\t\t\t\tt.Fatalf(\"TypeReference TypeKey got %s, but expected %s\", *ttr.Value.TypeKey, expectedReferenceID)\n\t\t\t}\n\t\tcase 1:\n\t\t\ttht, ok := field.Type.(*mojom_types.TypeHandleType)\n\t\t\tif !ok {\n\t\t\t\tt.Fatalf(\"StructField %s's field 1 didn't have Type *TypeHandleType\", structID)\n\t\t\t}\n\n\t\t\t// TypeHandleType.Value is a HandleType\n\t\t\tif tht.Value.Nullable {\n\t\t\t\tt.Fatalf(\"StructField %s's field 1 should have a non-nullable TypeHandle\", structID)\n\t\t\t}\n\t\t\tif tht.Value.Kind != mojom_types.HandleType_Kind_DataPipeConsumer {\n\t\t\t\tt.Fatalf(\"StructField %s's field 1 has the wrong kind\", structID)\n\t\t\t}\n\t\tdefault:\n\t\t\tt.Fatalf(\"There should not be a field %d for MojomStruct %s\", i, structID)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2c7513512ae7f3dc113c7eb426c6745c", "score": "0.50807744", "text": "func (*OnfTest1_Cont1A_List5) IsYANGGoStruct() {}", "title": "" }, { "docid": "0350cab1f4c1f3282185e00f48467d90", "score": "0.506919", "text": "func (o *EquipmentSwitchCard) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "b770a7117115f2196bd5e9867fb5e4bd", "score": "0.50574523", "text": "func (*Component_Temperature) IsYANGGoStruct() {}", "title": "" }, { "docid": "b770a7117115f2196bd5e9867fb5e4bd", "score": "0.50574523", "text": "func (*Component_Temperature) IsYANGGoStruct() {}", "title": "" }, { "docid": "b770a7117115f2196bd5e9867fb5e4bd", "score": "0.5056624", "text": "func (*Component_Temperature) IsYANGGoStruct() {}", "title": "" }, { "docid": "b770a7117115f2196bd5e9867fb5e4bd", "score": "0.5055821", "text": "func (*Component_Temperature) IsYANGGoStruct() {}", "title": "" }, { "docid": "3d7b059b47e922b21a95d25500ca7d91", "score": "0.50526804", "text": "func (*Component_Fan) IsYANGGoStruct() {}", "title": "" }, { "docid": "3d7b059b47e922b21a95d25500ca7d91", "score": "0.50526804", "text": "func (*Component_Fan) IsYANGGoStruct() {}", "title": "" }, { "docid": "3d7b059b47e922b21a95d25500ca7d91", "score": "0.50526804", "text": "func (*Component_Fan) IsYANGGoStruct() {}", "title": "" }, { "docid": "3d7b059b47e922b21a95d25500ca7d91", "score": "0.50526804", "text": "func (*Component_Fan) IsYANGGoStruct() {}", "title": "" }, { "docid": "14be2dc1a6423ebef3c37a24fd920381", "score": "0.5046638", "text": "func (ef *EsimFactory) parseStruct() bool {\n\texists, err := filedir.IsExistsDir(ef.structDir)\n\tif err != nil {\n\t\tef.logger.Panicf(err.Error())\n\t}\n\n\tif !exists {\n\t\tef.logger.Panicf(\"%s dir not exists\", ef.structDir)\n\t}\n\n\tfiles, err := ioutil.ReadDir(ef.structDir)\n\tif err != nil {\n\t\tef.logger.Panicf(err.Error())\n\t}\n\n\tfor _, fileInfo := range files {\n\t\text := path.Ext(fileInfo.Name())\n\t\tif ext != \".go\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// 不复制测试文件\n\t\tif strings.Contains(fileInfo.Name(), \"_test\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tef.filesName = append(ef.filesName, fileInfo.Name())\n\n\t\tif !fileInfo.IsDir() && !ef.found {\n\t\t\tsrc, err := ioutil.ReadFile(ef.structDir + \"/\" + fileInfo.Name())\n\t\t\tif err != nil {\n\t\t\t\tef.logger.Panicf(err.Error())\n\t\t\t}\n\n\t\t\tstrSrc := string(src)\n\t\t\tfset := token.NewFileSet() // positions are relative to fset\n\t\t\tf, err := parser.ParseFile(fset, \"\", strSrc, parser.ParseComments)\n\t\t\tif err != nil {\n\t\t\t\tef.logger.Panicf(err.Error())\n\t\t\t}\n\n\t\t\tef.parseDecls(src, fileInfo, f)\n\t\t}\n\t}\n\n\treturn ef.found\n}", "title": "" }, { "docid": "592f496c37929a1bf4b7bf7ef1f52af0", "score": "0.5044272", "text": "func (o *Device) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "6c7c7774c8884f1694e286cd97302583", "score": "0.5039388", "text": "func (s *SyntheticsDevice) GetNameOk() (string, bool) {\n\tif s == nil || s.Name == nil {\n\t\treturn \"\", false\n\t}\n\treturn *s.Name, true\n}", "title": "" }, { "docid": "64f46d66f916fa37fb00ed6e3958d8de", "score": "0.5032722", "text": "func (*System_Cpu_Wait) IsYANGGoStruct() {}", "title": "" }, { "docid": "64f46d66f916fa37fb00ed6e3958d8de", "score": "0.5032722", "text": "func (*System_Cpu_Wait) IsYANGGoStruct() {}", "title": "" }, { "docid": "64f46d66f916fa37fb00ed6e3958d8de", "score": "0.5032722", "text": "func (*System_Cpu_Wait) IsYANGGoStruct() {}", "title": "" }, { "docid": "64f46d66f916fa37fb00ed6e3958d8de", "score": "0.5032722", "text": "func (*System_Cpu_Wait) IsYANGGoStruct() {}", "title": "" }, { "docid": "36406c3eba85c2fcb49758f332bc9b3d", "score": "0.502147", "text": "func (*Mpls) IsYANGGoStruct() {}", "title": "" }, { "docid": "36406c3eba85c2fcb49758f332bc9b3d", "score": "0.502147", "text": "func (*Mpls) IsYANGGoStruct() {}", "title": "" }, { "docid": "36406c3eba85c2fcb49758f332bc9b3d", "score": "0.502147", "text": "func (*Mpls) IsYANGGoStruct() {}", "title": "" }, { "docid": "29c5e82dff053bbda206ca02eaa075a7", "score": "0.5019343", "text": "func checkSpec(spec *pb.ChaincodeSpec) error {\n\t// Don't allow nil value\n\tif spec == nil {\n\t\treturn errors.New(\"Expected chaincode specification, nil received\")\n\t}\n\n\tplatform, err := platforms.Find(spec.Type)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to determine platform type: %s\", err)\n\t}\n\n\treturn platform.ValidateSpec(spec)\n}", "title": "" }, { "docid": "e51c8b8e13b47a6cac6a982063f2c5ff", "score": "0.501629", "text": "func (*Component_Transceiver) IsYANGGoStruct() {}", "title": "" }, { "docid": "e51c8b8e13b47a6cac6a982063f2c5ff", "score": "0.5016173", "text": "func (*Component_Transceiver) IsYANGGoStruct() {}", "title": "" }, { "docid": "e51c8b8e13b47a6cac6a982063f2c5ff", "score": "0.5016173", "text": "func (*Component_Transceiver) IsYANGGoStruct() {}", "title": "" }, { "docid": "0f05e5e54635855829f87b7ac846c04c", "score": "0.50153786", "text": "func (o *PipelineStepStateReady) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "93d3f2f8661fa6115798695ebbf0409f", "score": "0.50121033", "text": "func validateStruct(q interface{}) bool {\n\tvalidate := validator.New()\n\terr := validate.Struct(q)\n\treturn err == nil\n}", "title": "" }, { "docid": "c186f6a45d5df01b1c43373022004c99", "score": "0.50028014", "text": "func getSpecFromUnstrutured(obj *unstructured.Unstructured) (map[string]interface{}, error) {\n\tspec, ok, err := unstructured.NestedMap(obj.UnstructuredContent(), \"spec\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"try to acquire spec failed, %v\", err)\n\t}\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"try to acquire spec failed, no field spec for obj %s\", obj.GetName())\n\t}\n\treturn spec, nil\n}", "title": "" }, { "docid": "f1f54020ea2e9a623e3c7fd62a8bc827", "score": "0.49927095", "text": "func pathToResult(p contract.Path) (hasChanges, hasSpecChanges bool) {\n\treturn true, len(p) == 0 || (len(p) > 0 && p[0] == \"spec\")\n}", "title": "" }, { "docid": "2732e1ce9658815d74796001d3b24b9f", "score": "0.49879128", "text": "func (*OnfTest1_Cont1BState) IsYANGGoStruct() {}", "title": "" }, { "docid": "7a40fcdd6db4cdbf081acae28a4e1f7e", "score": "0.4979026", "text": "func TestStructName(t *testing.T) {\n\ttests := []struct {\n\t\tname string // name is the name of the test.\n\t\tinElement *yang.Entry // inElement is a mock YANG Entry representing the struct.\n\t\twantCompressed string // wantCompressed is the expected name with compression enabled.\n\t\twantUncompressed string // wantUncompressed is the expected name with compression disabled.\n\t}{{\n\t\tname: \"/interfaces/interface/config/description\",\n\t\tinElement: &yang.Entry{\n\t\t\tName: \"description\",\n\t\t\tParent: &yang.Entry{\n\t\t\t\tName: \"config\",\n\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\tName: \"interface\",\n\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\tName: \"interfaces\",\n\t\t\t\t\t\tDir: map[string]*yang.Entry{\n\t\t\t\t\t\t\t\"interface\": {\n\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\t\tName: \"openconfig-interfaces\",\n\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\twantCompressed: \"Interface_Description\",\n\t\twantUncompressed: \"OpenconfigInterfaces_Interfaces_Interface_Config_Description\",\n\t}, {\n\t\tname: \"/interfaces/interface/hold-time/config/up\",\n\t\tinElement: &yang.Entry{\n\t\t\tName: \"up\",\n\t\t\tParent: &yang.Entry{\n\t\t\t\tName: \"config\",\n\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\tName: \"hold-time\",\n\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\tName: \"interface\",\n\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\t\tName: \"interfaces\",\n\t\t\t\t\t\t\tDir: map[string]*yang.Entry{\n\t\t\t\t\t\t\t\t\"interface\": {\n\t\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\t\t\tName: \"openconfig-interfaces\",\n\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\twantCompressed: \"Interface_HoldTime_Up\",\n\t\twantUncompressed: \"OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config_Up\",\n\t}, {\n\t\tname: \"/interfaces/interface/subinterfaces/subinterface/ipv4/addresses/address/config/ip\",\n\t\tinElement: &yang.Entry{\n\t\t\tName: \"ip\",\n\t\t\tParent: &yang.Entry{\n\t\t\t\tName: \"config\",\n\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\tName: \"address\",\n\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\tName: \"addresses\",\n\t\t\t\t\t\tDir: map[string]*yang.Entry{\n\t\t\t\t\t\t\t\"address\": {\n\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\t\tName: \"ipv4\",\n\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\t\t\tName: \"subinterface\",\n\t\t\t\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\t\t\t\tName: \"subinterfaces\",\n\t\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{\n\t\t\t\t\t\t\t\t\t\t\"subinterface\": {\n\t\t\t\t\t\t\t\t\t\t\tName: \"subinterface\",\n\t\t\t\t\t\t\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\t\t\t\t\tName: \"interface\",\n\t\t\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\t\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\t\t\t\t\t\tName: \"interfaces\",\n\t\t\t\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{\n\t\t\t\t\t\t\t\t\t\t\t\t\"interface\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\t\t\t\t\t\t\tListAttr: &yang.ListAttr{},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tParent: &yang.Entry{\n\t\t\t\t\t\t\t\t\t\t\t\tName: \"openconfig-interfaces\",\n\t\t\t\t\t\t\t\t\t\t\t\tDir: map[string]*yang.Entry{},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\twantCompressed: \"Interface_Subinterface_Ipv4_Address_Ip\",\n\t\twantUncompressed: \"OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv4_Addresses_Address_Config_Ip\",\n\t}}\n\n\tfor _, tt := range tests {\n\t\tfor compress, expected := range map[bool]string{false: tt.wantUncompressed, true: tt.wantCompressed} {\n\t\t\ts := newGenState()\n\t\t\tif out := s.structName(tt.inElement, compress, false); out != expected {\n\t\t\t\tt.Errorf(\"%s (compress: %v): shortName output invalid - got: %s, want: %s\", tt.name, compress, out, expected)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3cd82a7b4735b58ac0b052712fde86fe", "score": "0.49765587", "text": "func (o *MonitorStateGroup) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "49710c10ec78a198208875082a819ef9", "score": "0.49756518", "text": "func (o *ComputePersonality) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "a2a6569e0740129ffb4a9f5dee361e41", "score": "0.49724123", "text": "func (o *GroupComponent) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "2b2717b57e0c26612735e32fef66d54a", "score": "0.49705616", "text": "func (o *PortStatusDTO) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "2bdcb71b325b253fab5b215159ff87a5", "score": "0.496974", "text": "func (*System_Cpu_Nice) IsYANGGoStruct() {}", "title": "" }, { "docid": "2bdcb71b325b253fab5b215159ff87a5", "score": "0.496974", "text": "func (*System_Cpu_Nice) IsYANGGoStruct() {}", "title": "" }, { "docid": "2bdcb71b325b253fab5b215159ff87a5", "score": "0.496974", "text": "func (*System_Cpu_Nice) IsYANGGoStruct() {}", "title": "" }, { "docid": "2bdcb71b325b253fab5b215159ff87a5", "score": "0.496974", "text": "func (*System_Cpu_Nice) IsYANGGoStruct() {}", "title": "" }, { "docid": "51a126bdb8177b7da13758271898506d", "score": "0.4963813", "text": "func (o *VersionMetaData) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "title": "" }, { "docid": "717fd02ddea3ac1fe254af9716f568e8", "score": "0.49598762", "text": "func (*OpticalAmplifier) IsYANGGoStruct() {}", "title": "" }, { "docid": "a07ae73903633abe61c65537dd34278e", "score": "0.49594122", "text": "func (o *TrashStructureGroup) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "title": "" } ]
c0c196e0895d7c455420ce307c93c733
Deprecated: Use ListObjectsResponse.ProtoReflect.Descriptor instead.
[ { "docid": "f032c20abe3a12c8b499ed26d3cd619d", "score": "0.7175952", "text": "func (*ListObjectsResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_node_nodepb_node_proto_rawDescGZIP(), []int{23}\n}", "title": "" } ]
[ { "docid": "ecaad6fb3b09a6fc1ba123092bce08e6", "score": "0.7260731", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_gce_api_projects_v1_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "8899b0ea25da787a33bd01dd06e59b1d", "score": "0.7247838", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_messages_messages_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "b463901b47c0f1dc837c68f87974247f", "score": "0.71254784", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{29}\n}", "title": "" }, { "docid": "c8d683b2e8a1b4db11202036a7fa94c2", "score": "0.708884", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_ice_cream_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "d2b73404d82ff7f1399c2a76e4f3c7f1", "score": "0.70796156", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_internal_protos_api_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "e7984b2fe7542a4195d91761b3b95871", "score": "0.7031678", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_users_v1_users_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "2592fba3eaf5dfc81b11cd5482ad5e6a", "score": "0.7021013", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_tag_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "6730c7f53593194d72e3e92fc5e8c538", "score": "0.70202845", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_crud_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "1fdf8c0c484667c511e5acedebe5ef11", "score": "0.6974251", "text": "func (*ListResponse_ListEntry) Descriptor() ([]byte, []int) {\n\treturn file_pkg_messages_messages_proto_rawDescGZIP(), []int{3, 0}\n}", "title": "" }, { "docid": "775bef8802fbf5a621760d19829e35f1", "score": "0.697318", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_ts_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "42b23b95e996d670560c6a3c745bbadb", "score": "0.69513774", "text": "func (*ListObjectsRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_node_nodepb_node_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "8d5e57167d8160b67fb9d8afce6d22d1", "score": "0.69007134", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "bced07a448f5b2b58229b4e2b3e0740c", "score": "0.6897675", "text": "func (*ListResourcesResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_discovery_discovery_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "86b27e82b78103894c9e5db70a0deac0", "score": "0.6892009", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_sketchit_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "3c06638b42fe9fe97b7bdda54a9a046b", "score": "0.68847585", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_server_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "77eb3271c32ad417c1dd2c81be6ec255", "score": "0.68845314", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_playstore_playstore_proto_rawDescGZIP(), []int{84}\n}", "title": "" }, { "docid": "56081e316b7a646b2f601dbc9323bc24", "score": "0.68680906", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_catalog_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "7be187a27180636512cfd600591b6a3e", "score": "0.6854145", "text": "func (*ListResp) Descriptor() ([]byte, []int) {\n\treturn file_idl_pbkafka_kafka_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "5999094ffa88b4ddeeb5f672a8e8f8b5", "score": "0.68330127", "text": "func (*ListObjectsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_storage_v1_storage_proto_rawDescGZIP(), []int{42}\n}", "title": "" }, { "docid": "2655e0c4c40a6e44869335a61cdefef1", "score": "0.6805227", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_log_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "8c418802b9fbc40018b99c59da82761f", "score": "0.67995375", "text": "func (*ListMetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_proto_api_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "cd7c1c73be9db9d9341d8f2a732b9078", "score": "0.6773645", "text": "func (*ListObjectsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_storage_v1_storage_proto_rawDescGZIP(), []int{39}\n}", "title": "" }, { "docid": "2bdeaabe859fcd1e591bbe6e1f367ff2", "score": "0.676989", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_gce_api_projects_v1_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "f16cd90ea6a860be153eaee405953cd9", "score": "0.67644596", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_internal_protos_api_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "2735e4416ca3cbc54634b889c3044076", "score": "0.6763835", "text": "func (*ListResp) Descriptor() ([]byte, []int) {\n\treturn file_idl_pbdomain_domain_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "5c6a9d7e7854af6a63fdc4762e9f09a6", "score": "0.67379", "text": "func (*ListDetailResp) Descriptor() ([]byte, []int) {\n\treturn file_idl_pbkafka_kafka_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "f55d63c293de6fc7e941988b0bb0fa76", "score": "0.6710118", "text": "func (*ListDeletionResponse) Descriptor() ([]byte, []int) {\n\treturn file_dps_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "ddc79e1e966ea482f3969283a0e3b196", "score": "0.6709043", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "a35389ca2260c5dbd62fea370540027c", "score": "0.6707735", "text": "func (*DeleteObjectResponse) Descriptor() ([]byte, []int) {\n\treturn file_object_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "e3eca628f26a41d5fc2d525f8a7318ef", "score": "0.67031556", "text": "func (*ListPodsResponse) Descriptor() ([]byte, []int) {\n\treturn file_k8s_v1_k8s_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "5fbe4b973ccc847b77bbedae927249a4", "score": "0.67026883", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_messages_messages_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "6103dd5aea85e2fa956a1021743f741e", "score": "0.6699652", "text": "func (*ListTodosResponse) Descriptor() ([]byte, []int) {\n\treturn file_todolistpb_todolist_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "7960261ff6ae0c5a3d995c2b733de794", "score": "0.66908455", "text": "func (*ListResourcesRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_discovery_discovery_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "30b019458c0b1844e5e285eb897c2b90", "score": "0.66837883", "text": "func (*ListResponce) Descriptor() ([]byte, []int) {\n\treturn file_grpc_atlant_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "a673c3eb5c07cc2d807951c1f27ab2b8", "score": "0.6681297", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_ice_cream_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "10323b17b404a3a3419905858f8110d3", "score": "0.6676958", "text": "func (*ListPersonsResponse) Descriptor() ([]byte, []int) {\n\treturn file_person_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "97edec2b28ee56c7ff83f202d378d71a", "score": "0.6670432", "text": "func (*ListDetailResp) Descriptor() ([]byte, []int) {\n\treturn file_idl_pbdomain_domain_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "1e318ddef7afec48ccfcb1b702bb77f2", "score": "0.6668249", "text": "func (*GetDeviceListResponse) Descriptor() ([]byte, []int) {\n\treturn file_m2m_m2mserver_device_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "734da2ac56aec5890cdd91ac377d4aa8", "score": "0.6664427", "text": "func (*GetFriendListResp) Descriptor() ([]byte, []int) {\n\treturn file_onebot_api_proto_rawDescGZIP(), []int{43}\n}", "title": "" }, { "docid": "3c000ee4bbba132773f8fda01635f91e", "score": "0.6626534", "text": "func (*ListMetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_carbonapi_v2_pb_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "b79ec740b120eb3fac24af9818fb2bf0", "score": "0.66180426", "text": "func (*ListDevicesResponse) Descriptor() ([]byte, []int) {\n\treturn file_device_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "3f2d76b6192a96c14eb5f9f014b89a43", "score": "0.6617232", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_atlant_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "a6dafcfe0a6a6e125acc748b242f90c1", "score": "0.6614796", "text": "func (*ListModelsResponse) Descriptor() ([]byte, []int) {\n\treturn file_juzu_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "63fedd118c210e96ec3db5366f726625", "score": "0.6610685", "text": "func (*ListMembersResponse) Descriptor() ([]byte, []int) {\n\treturn file_federation_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "a6d54c8d70b50da3271edf8615c24686", "score": "0.6609654", "text": "func (*ListPrivateConnectionsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_datastream_v1alpha1_datastream_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "9c831cee5e73a53b8e24a40c86304845", "score": "0.66062725", "text": "func (x *fastReflection_ResponseListSnapshots) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ResponseListSnapshots\n}", "title": "" }, { "docid": "5e2a6506af232723589aae98c66e18c9", "score": "0.6603644", "text": "func (*ListServicesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_monitoring_v3_service_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "9c4c817e062054a716c9b60b12f3588a", "score": "0.6600729", "text": "func (*BatchGetMethodDescriptorsResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_audit_proto_v1alpha2_method_descriptor_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "0a9cb523d367116a50580e0dda63a455", "score": "0.65967923", "text": "func (*ListNodeResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_resource_manager_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "24215b8a3d47df7aedebef911bb60270", "score": "0.65897906", "text": "func (*WatchMethodDescriptorsResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_audit_proto_v1alpha2_method_descriptor_service_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "ffd80cbd5d77af8fe31bcddbacd40078", "score": "0.6586077", "text": "func (*GetPropertyLabelsResponse) Descriptor() ([]byte, []int) {\n\treturn file_mixer_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "51c6451a70fca800d5077fb1f082c9fa", "score": "0.65814936", "text": "func (*ListConversationMembersResponse) Descriptor() ([]byte, []int) {\n\treturn file_box_conversation_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "de9cc349709510c2f64969cfc5ddd60e", "score": "0.6580945", "text": "func (*ListMethodDescriptorsResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_audit_proto_v1alpha2_method_descriptor_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "c8b7829eb5afa5468599357162ed5e5a", "score": "0.6577753", "text": "func (*ListServiceLevelObjectivesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_monitoring_v3_service_service_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "631dbeb2b12945f3df1ac2171526e68d", "score": "0.656857", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{28}\n}", "title": "" }, { "docid": "f43206670a1dbec0e3dace8597d92344", "score": "0.6563901", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_server_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "9efa48977abb3e927be3d0d9a5709863", "score": "0.65630174", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_tag_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "7bb6f0490d012337814eb9d2a595cd6b", "score": "0.6561473", "text": "func (*ListVersionsResponse) Descriptor() ([]byte, []int) {\n\treturn file_aiocean_polvo_v1_polvo_service_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "4eeb2cc5c1b21c97cebf1e7c6dd9a24d", "score": "0.6560013", "text": "func (*ListTeams_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_Organization_proto_rawDescGZIP(), []int{12, 0}\n}", "title": "" }, { "docid": "eae0eaabb06bc6677c941903af74ac64", "score": "0.6558762", "text": "func (*ListModelsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_retail_v2_model_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "a39e4128d26d6f6b516f9f377987ab07", "score": "0.65575016", "text": "func (*ListLinkResponse) Descriptor() ([]byte, []int) {\n\treturn file_link_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "c6891f5c4cfe25eabe6f078a36a0d1a5", "score": "0.65558624", "text": "func (*ListOptions) Descriptor() ([]byte, []int) {\n\treturn file_k8s_v1_k8s_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "3ea95a636875087f617938f075c2ad2a", "score": "0.65546274", "text": "func (*ListResourcesResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_google_cloudprober_rds_proto_rds_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "d6007d7760b737f271228b432dfbf42d", "score": "0.65524566", "text": "func (*ListMetricsRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_proto_api_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "8a6411e6ddf517c258cbd2798397aadc", "score": "0.65513194", "text": "func (x *fastReflection_ResponseInfo) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ResponseInfo\n}", "title": "" }, { "docid": "fd65d06fddeca0beba40b51391d9bb53", "score": "0.6551016", "text": "func (*ListModelsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_retail_v2beta_model_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "561e9cdc1e747e7baaaac5ee8bfabf34", "score": "0.6547904", "text": "func (*TeamList) Descriptor() ([]byte, []int) {\n\treturn file_api_kato_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "5936d442c7656f89b92fb53f9ab1b411", "score": "0.65474063", "text": "func (*ListServicesResponse) Descriptor() ([]byte, []int) {\n\treturn file_services_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "675c69642a47d7e9844e8a96b3755e1b", "score": "0.6541809", "text": "func (*CollectionListResponse) Descriptor() ([]byte, []int) {\n\treturn file_filer_proto_rawDescGZIP(), []int{32}\n}", "title": "" }, { "docid": "fde47eca5f835b3734d0df089d1abf1b", "score": "0.6541106", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_crud_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "50b34d6d2b1a21db3f8d628440801fea", "score": "0.6538388", "text": "func (*ListConversationResponse) Descriptor() ([]byte, []int) {\n\treturn file_box_conversation_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "15f77fc71b8ee20ca0df295ade697586", "score": "0.65352756", "text": "func (*ListFailedResponse) Descriptor() ([]byte, []int) {\n\treturn file_dps_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "ff975097cfd65a8e1090ab3971605b77", "score": "0.65333253", "text": "func (*FlagsListResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_sql_v1_cloud_sql_flags_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "4f417842cfc3973a0f8028e71eb9ed60", "score": "0.6532178", "text": "func (*ListServicesResponse) Descriptor() ([]byte, []int) {\n\treturn file_mindmeld_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "bb23719bdbd946fc1244cf72da7ffa86", "score": "0.65290433", "text": "func (*ListSentboxMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_usersd_pb_usersd_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "016ca2f88bd3ff8210c3524395223836", "score": "0.6526513", "text": "func (*ListRulesResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_v1_rules_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "2bdf8721d280ba2a1d147be818380986", "score": "0.6525066", "text": "func (*ListModelsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{109}\n}", "title": "" }, { "docid": "024714be46867fe96a064494a425604c", "score": "0.6517742", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_config_config_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "d2ca0d3ea0824934637230a6cad457d9", "score": "0.650889", "text": "func (*ListInboxMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_usersd_pb_usersd_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "66591bd6bdeb97dba1f862dde86709a0", "score": "0.6507062", "text": "func (*ListMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_messaging_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "5aacff22bae035304fe74f4a7d6493f1", "score": "0.6502587", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_ts_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "c29a670658009f89f73b4348ad702c82", "score": "0.6498559", "text": "func (*ListPropertiesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_analytics_admin_v1beta_analytics_admin_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "2ffbfe26418ff8a5bac9754c346398f1", "score": "0.6495006", "text": "func (*ListDocsV1Response) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_docs_api_ocp_docs_api_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "3934139460db0ec9b0510cb97c65b9f2", "score": "0.64903545", "text": "func (x *fastReflection_Response) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_Response\n}", "title": "" }, { "docid": "5aa678e788b43e3f730460f16f33f908", "score": "0.64801806", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_users_v1_users_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "78f75a669d42c530dcc30594b56d9c67", "score": "0.6479634", "text": "func (*ListDataItemsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_datalabeling_v1beta1_data_labeling_service_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "3f8945f178bf490c630b62abd98c010f", "score": "0.6476257", "text": "func (*ListVehiclesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_maps_fleetengine_v1_vehicle_api_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "2556204aac7706af10496af90fc17a99", "score": "0.6472947", "text": "func (*ItemsListResponse) Descriptor() ([]byte, []int) {\n\treturn file_items_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "787e83b171e1aa10916b2ec9536d8aca", "score": "0.64686275", "text": "func (*DeprecateDomainResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_api_v1_service_domain_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "72ee4dfa8c3cb455e1847f180b835d7f", "score": "0.6465361", "text": "func (*PipelineLabelListResponse) Descriptor() ([]byte, []int) {\n\treturn file_label_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "d285292a0c32ad0f8a110a5b60e6c2dd", "score": "0.646418", "text": "func (*ListEntriesResponse) Descriptor() ([]byte, []int) {\n\treturn file_filer_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "1183bbc79a401583078cf748cf0e3a69", "score": "0.64540094", "text": "func (*FindMonitoredModels_Response) Descriptor() ([]byte, []int) {\n\treturn file_monitoring_MonitoredModel_proto_rawDescGZIP(), []int{3, 0}\n}", "title": "" }, { "docid": "866f470348e3bdb63a064fba93432595", "score": "0.6453673", "text": "func (*ListCollectionsResponse) Descriptor() ([]byte, []int) {\n\treturn file_sketchit_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "1d8899af44f58829e4690cd831cbfc47", "score": "0.645355", "text": "func (*ListVersionsResponse) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_k8s_v1_version_service_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "1b93276349cf17c2fce0085b30f2e5a3", "score": "0.6451429", "text": "func (*OrderListResponse) Descriptor() ([]byte, []int) {\n\treturn file_order_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "00ed103da5faaf672a2fdf5cfd9aee5a", "score": "0.6448329", "text": "func (*ListInstancesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_datafusion_v1beta1_v1beta1_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "18fc583bd82ce44ff3cf0ad1f4cd42dc", "score": "0.6448122", "text": "func (*ListReq) Descriptor() ([]byte, []int) {\n\treturn file_idl_pbkafka_kafka_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "18f6c7834011339cfbb697a28429d275", "score": "0.644731", "text": "func (*ListRulesResponse) Descriptor() ([]byte, []int) {\n\treturn file_public_rules_rules_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "45d95c26d24f2cc364fe1fd1513c304d", "score": "0.6445631", "text": "func (*ListCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{247}\n}", "title": "" }, { "docid": "800ed0830b866444a6c2b21bf3832c60", "score": "0.64430046", "text": "func (*ListActionsResponse) Descriptor() ([]byte, []int) {\n\treturn file_list_actions_proto_rawDescGZIP(), []int{1}\n}", "title": "" } ]
f0a502cf1734659c38056098082955fe
saveHandler executes save action
[ { "docid": "d38435fc10a6022f515201fc09641cb3", "score": "0.72320724", "text": "func saveHandler(p *Page, w http.ResponseWriter, r *http.Request) {\n\terr := p.save()\n\tif err != nil {\n\t\thandleCommonErrors(err, w)\n\t\treturn\n\t}\n\thttp.Redirect(w, r, \"/view/\"+slug.Slug(p.Title), http.StatusFound)\n}", "title": "" } ]
[ { "docid": "24663781784dbdecc5cd582c93f4ee32", "score": "0.7159451", "text": "func saveHandler(w http.ResponseWriter, r *http.Request, title string) {\n\tbody := r.FormValue(\"body\")\n\tp := &Page{Title: title, Body: []byte(body)}\n\tid := newID()\n\tstart := time.Now()\n\terr := p.save(newContextWithParentID(r.Context(), id))\n\tsendSpan(\"ioutil.WriteFile\", id, start, r.Context(), map[string]interface{}{\"title\": title, \"bodylen\": len(body), \"error\": err})\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\thttp.Redirect(w, r, \"/view/\"+title, http.StatusFound)\n}", "title": "" }, { "docid": "119f6aa41de07f3c791ffe684f39b4fc", "score": "0.71175796", "text": "func SaveHandler(writer http.ResponseWriter, request *http.Request, title string) {\n\tbody := request.FormValue(\"body\")\n\n\tlog.Println(\"saving page \" + title)\n\tpage := &models.Page{Title: title, Body: body}\n\n\terr := page.Save()\n\n\tif err != nil {\n\t\thttp.Error(writer, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\thttp.Redirect(writer, request, \"/view/\"+title, http.StatusFound)\n\n}", "title": "" }, { "docid": "151eb214a1b2da5c252da13c736faa3b", "score": "0.7020237", "text": "func SaveHandler(w http.ResponseWriter, r *http.Request) (int, error) {\n\tvalid, _ := ValidURLFromCtx(r.Context())\n\tbody := r.FormValue(\"body\")\n\tp := NewPage(valid, []byte(body))\n\terr := p.save()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\thttp.Redirect(w, r, \"/view/\"+p.Path, http.StatusFound)\n\treturn http.StatusFound, nil\n}", "title": "" }, { "docid": "9ae6adf8f5b264e4f63be95c49506b0a", "score": "0.6940453", "text": "func SaveHandler(w http.ResponseWriter, r *http.Request) {\n\tuser, err := auth.GetAuthenticatedUser(r)\n\tif err != nil {\n\t\thttp.Redirect(w, r, \"/login\", http.StatusFound)\n\t\treturn\n\t}\n\n\thash := r.FormValue(\"hash\")\n\tparent := r.FormValue(\"parent\")\n\troot := r.FormValue(\"root\")\n\ttext := r.FormValue(\"text\")\n\n\tif hash == \"\" {\n\t\thash = GenerateMessageHash(text)\n\t}\n\n\tif root == \"\" {\n\t\troot = hash\n\t}\n\n\tm := &Message{Hash: hash, Parent: parent, Root: root, User: user.Key, Text: text}\n\terr = repo.Save(m)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\thttp.Redirect(w, r, \"/i/\"+root, http.StatusFound)\n}", "title": "" }, { "docid": "fc996fbeadbb80d59ae513f991222af2", "score": "0.6868111", "text": "func saveHandler(w http.ResponseWriter, r *http.Request, title string) {\n\tbody := r.FormValue(\"body\")\n\tp := &Page{Title: title, Body: []byte(body)} // []byte(body) converts the string to a slice of bytes\n\terr := p.save() // This writes the data in the form to the file\n\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\thttp.Redirect(w, r, \"/view/\"+title, http.StatusFound)\n}", "title": "" }, { "docid": "5d137c47344cbcdf206b59395ea61b2a", "score": "0.6822356", "text": "func saveHandler(ctx context.Context, in *common.InvocationEvent) (out *common.Content, err error) {\n\tsaveReqCtr.Inc()\n\tvar req frontend.SaveReq\n\tif err := json.Unmarshal(in.Data, &req); err != nil {\n\t\tlogger.Printf(\"saveHandler json.Unmarshal err: %s\", err.Error())\n\t\treturn nil, err\n\t}\n\t// create the client\n\tclient, err := dapr.NewClient()\n\tif err != nil {\n\t\tlogger.Printf(\"saveHandler dapr err: %s\", err.Error())\n\t\treturn nil, err\n\t}\n\t// update latency metric\n\tepoch := time.Now()\n\tservLat := epoch.UnixMilli() - req.SendUnixMilli\n\t// generate a post id\n\tpostId := util.PostId(req.UserId, req.SendUnixMilli)\n\t// decode & save images if any\n\timages := make([]string, 0)\n\tif len(req.Images) > 0 {\n\t\titems := make([]*dapr.SetStateItem, 0)\n\t\t// decode\n\t\tfor i, d := range(req.Images) {\n\t\t\timageId := util.ImageId(postId, i)\n\t\t\tdbytes, err := base64.StdEncoding.DecodeString(d)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Printf(\"saveHandler err decoding base64 image %s: %s\",\n\t\t\t\t\timageId, err.Error())\n\t\t\t\treturn nil, err\n\t\t\t} else {\n\t\t\t\timages = append(images, imageId)\n\t\t\t\tnewItem := &dapr.SetStateItem{\n\t\t\t\t\tEtag: nil,\n\t\t\t\t\tKey: imageId,\n\t\t\t\t\t// Metadata: map[string]string{\n\t\t\t\t\t// \t\"created-on\": time.Now().UTC().String(),\n\t\t\t\t\t// },\n\t\t\t\t\tMetadata: nil,\n\t\t\t\t\tValue: dbytes,\n\t\t\t\t\tOptions: &dapr.StateOptions{\n\t\t\t\t\t\t// Concurrency: dapr.StateConcurrencyLastWrite,\n\t\t\t\t\t\tConsistency: dapr.StateConsistencyStrong,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\titems = append(items, newItem)\n\t\t\t}\n\t\t}\n\t\t// update latency metric\n\t\tservLat += time.Now().UnixMilli() - epoch.UnixMilli()\n\t\tepoch = time.Now()\n\t\t// save\n\t\terr := client.SaveBulkState(ctx, imageStore, items...)\n\t\tif err != nil {\n\t\t\tlogger.Printf(\"saveHandler err saving to %s: %s\",\n\t\t\t\timageStore, err.Error())\n\t\t\treturn nil, err\n\t\t}\n\t\t// update latency metric\n\t\tstoreLat := time.Now().UnixMilli() - epoch.UnixMilli()\n\t\tupdateStoreLatHist.Observe(float64(storeLat))\n\t\tepoch = time.Now()\n\t}\n\n\t// save the PostCont\n\tsaveReq := post.SavePostReq{\n\t\tPostId: postId,\n\t\tPostCont: post.PostCont{\n\t\t\tUserId: req.UserId,\n\t\t\tText: req.Text,\n\t\t\tImages: images,\n\t\t},\n\t\t// sender side timestamp in unix millisecond\n\t\tSendUnixMilli: time.Now().UnixMilli(),\n\t}\n\tsaveReqData, err := json.Marshal(saveReq)\n\tif err != nil {\n\t\tlogger.Printf(\"saveHanlder json.Marshal (saveReq) err: %s\", err.Error())\n\t\treturn nil, err\n\t}\n\tcontent := &dapr.DataContent{\n\t\tContentType: \"application/json\",\n\t\tData: saveReqData,\n\t}\n\t// update latency metric\n\tservLat += time.Now().UnixMilli() - epoch.UnixMilli()\n\t// invoke dapr-post\n\tsaveRespData, err := client.InvokeMethodWithContent(ctx, \"dapr-post\", \"save\", \"post\", content)\t\n\tif err != nil {\n\t\tlogger.Printf(\"invoke dapr-post:save err: %s\", err.Error())\n\t\treturn nil, err\n\t}\n\t// update latency metric\n\tvar saveResp post.UpdatePostResp\n\tif err := json.Unmarshal(saveRespData, &saveResp); err != nil {\n\t\tlogger.Printf(\"saveHandler json.Unmarshal (saveRespData) err: %s\", err.Error())\n\t\treturn nil, err\n\t} else {\n\t\tservLat += time.Now().UnixMilli() - saveResp.SendUnixMilli\n\t\tepoch = time.Now()\n\t}\n\t// issue request for timeline update\n\ttimelineReq := timeline.UpdateReq{\n\t\tUserId: req.UserId,\n\t\tPostId: postId,\n\t\tAdd: true,\n\t\tImageIncluded: len(images) > 0,\n\t\tClientUnixMilli: req.SendUnixMilli, \n\t\tSendUnixMilli: time.Now().UnixMilli(),\n\t}\n\ttlUpdateReqCtr.Inc()\n\tif err := client.PublishEventfromCustomContent(ctx, timelinePubsub, timelineTopic, timelineReq); err != nil {\n\t\tlogger.Printf(\"saveHandler err publish to pubsub %s topic %s: %s\", \n\t\t\ttimelinePubsub, timelineTopic, err.Error())\n\t\treturn nil, err\n\t}\n\t// issue request for object detection\n\tif len(images) > 0 {\n\t\tobjReq := objectdetect.Req{\n\t\t\tPostId: postId,\n\t\t\tImages: images,\n\t\t\tClientUnixMilli: req.SendUnixMilli, \n\t\t\tSendUnixMilli: time.Now().UnixMilli(),\n\t\t}\n\t\tif err := client.PublishEventfromCustomContent(ctx, objectPubsub, objectTopic, objReq); err != nil {\n\t\t\tlogger.Printf(\"saveHandler err publish to pubsub %s topic %s: %s\", \n\t\t\t\tobjectPubsub, objectTopic, err.Error())\n\t\t\treturn nil, err\n\t\t}\n\t\tobjDetReqCtr.Inc()\n\t}\n\t// issue request for sentiment analysis\n\tsentiReq := sentiment.Req{\n\t\tPostId: postId,\n\t\tText: req.Text,\n\t\tImageIncluded: len(images) > 0,\n\t\tClientUnixMilli: req.SendUnixMilli, \n\t\tSendUnixMilli: time.Now().UnixMilli(),\n\t}\n\tif err := client.PublishEventfromCustomContent(ctx, sentiPubsub, sentiTopic, sentiReq); err != nil {\n\t\tlogger.Printf(\"saveHandler err publish to pubsub %s topic %s: %s\", \n\t\t\tsentiPubsub, sentiTopic, err.Error())\n\t\treturn nil, err\n\t}\n\tsentiReqCtr.Inc()\n\t// update latency metric\n\tendEpoch := time.Now()\n\tservLat += endEpoch.UnixMilli() - epoch.UnixMilli()\n\tif len(images) > 0 {\n\t\tsaveReqImgLatHist.Observe(float64(servLat))\n\t\t// end-to-end latency metric\n\t\te2ePostSaveImgLatHist.Observe(float64(endEpoch.UnixMilli() - req.SendUnixMilli))\n\t} else {\n\t\tsaveReqLatHist.Observe(float64(servLat))\n\t\t// end-to-end latency metric\n\t\te2ePostSaveLatHist.Observe(float64(endEpoch.UnixMilli() - req.SendUnixMilli))\n\t}\n\t\n\t// create response\n\tresp := frontend.UpdateResp{\n PostId: postId,\n }\n respData, err := json.Marshal(resp)\n\tif err != nil {\n\t\tlogger.Printf(\"saveHandler json.Marshal (respData) err: %s\", err.Error())\n\t\treturn nil, err\n\t}\n\tout = &common.Content{\n\t\tContentType: \"application/json\",\n\t\tData: respData,\n\t}\n\treturn\n}", "title": "" }, { "docid": "e739f75e0fadf62a4770cbc4c1d37529", "score": "0.6818479", "text": "func saveHandler(w http.ResponseWriter, r *http.Request) {\n\n\tpostInx, _ := strconv.Atoi(r.URL.Path[len(\"/save/\"):])\n\tif posts[postInx] == \"\" {\n\t\tpostInx = len(posts) + 1\n\t}\n\n\tbody := r.FormValue(\"body\")\n\n\tposts[postInx] = body\n\thttp.Redirect(w, r, \"/\", http.StatusFound)\n}", "title": "" }, { "docid": "e5bee8508c0b458b0535b39c47ae05e2", "score": "0.67566293", "text": "func handlerSave(w http.ResponseWriter, r *http.Request) {\n\tif !handleCORS(w, r) {\n\t\treturn\n\t}\n\n\t// Check method and read POST body.\n\t// Limit is set to maxSize+1 to allow distinguishing between exactly maxSize\n\t// and larger than maxSize requests.\n\trequestBody := getPostBody(w, r, *maxSize+1)\n\tif requestBody == nil {\n\t\treturn\n\t}\n\tif len(requestBody) > *maxSize {\n\t\tstorageError(w, http.StatusBadRequest, \"Program too large.\")\n\t\treturn\n\t}\n\n\t// TODO(ivanpi): Check if bundle is parseable. Format/lint?\n\n\tbLink, bData, err := storage.StoreBundleLinkAndData(string(requestBody))\n\tif err != nil {\n\t\tstorageInternalError(w, \"Error storing bundle: \", err)\n\t\treturn\n\t}\n\n\tstorageRespond(w, http.StatusOK, fullResponseFromLinkAndData(bLink, bData))\n}", "title": "" }, { "docid": "2aefd1447b0634460956c66bc4e4af85", "score": "0.6732744", "text": "func saveHandler(res http.ResponseWriter, req *http.Request, title string) {\n\tbody := req.FormValue(\"body\")\n\tpage := &Page{ Title : title, Body : []byte(body), Path : VIEWPATH }\n toggleUnderscores(&page.Title, true)\n\terr := page.save()\n\tif(err != nil){\n\t\thttp.Error(res, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\thttp.Redirect(res, req, VIEWPATH + title, http.StatusFound)\n}", "title": "" }, { "docid": "e046fd68b2400eff600e512db5a6e816", "score": "0.67293686", "text": "func postSaveHandler(w http.ResponseWriter, r *http.Request) {\n\tif r.Method != \"POST\" {\n\t\thttp.NotFound(w, r)\n\t\treturn\n\t}\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tError.Println(err)\n\t}\n\tvar fields map[string]interface{}\n\terr = json.Unmarshal(body, &fields)\n\tif err != nil {\n\t\tError.Println(err)\n\t}\n\tfields[\"SubmitTime\"] = recordTimestamp()\n\tassignment := Assignment{}\n\terr = mapstructure.Decode(fields, &assignment)\n\tif err != nil {\n\t\tError.Println(err)\n\t}\n\tif assignment.Task.ProjectOptions.DemoMode {\n\t\tError.Println(errors.New(\"can't save a demo project\"))\n\t\twriteNil(w)\n\t\treturn\n\t}\n\t// TODO: don't send all events to front end,\n\t// and append these events to most recent\n\terr = storage.Save(assignment.GetKey(), assignment.GetFields())\n\tif err != nil {\n\t\tError.Println(err)\n\t\twriteNil(w)\n\t} else {\n\t\tresponse, err := json.Marshal(0)\n\t\tif err != nil {\n\t\t\tError.Println(err)\n\t\t\twriteNil(w)\n\t\t} else {\n\t\t\t_, err = w.Write(response)\n\t\t\tif err != nil {\n\t\t\t\tError.Println(err)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "377123f1a33d415cecba69040f970497", "score": "0.66467696", "text": "func saveNewHandler(w http.ResponseWriter, r *http.Request) {\n\ttitle := r.FormValue(\"title\")\n\tbody := r.FormValue(\"body\")\n\tp := &Page{Title: title, Body: []byte(body)}\n\tsaveHandler(p, w, r)\n}", "title": "" }, { "docid": "3d703e73d0edcbba6fd18011595921b6", "score": "0.66181713", "text": "func saveEditHandler(w http.ResponseWriter, r *http.Request, title string) {\n\tbody := r.FormValue(\"body\")\n\tp := &Page{Title: title, Body: []byte(body)}\n\tsaveHandler(p, w, r)\n}", "title": "" }, { "docid": "65f170e73f48d9432f25c941dd8f64eb", "score": "0.6448023", "text": "func saveHandler(w http.ResponseWriter, r *http.Request, name string) {\n\tabout := r.FormValue(\"about\")\n\tdog := &Dog{Name: name, About: []byte(about)}\n\terr := dog.save()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\thttp.Redirect(w, r, \"/dog/\"+name, http.StatusFound)\n}", "title": "" }, { "docid": "ecb6b5e7cc4f76151df90e81a4110aa3", "score": "0.6324861", "text": "func saveHandler(w http.ResponseWriter, r *http.Request) {\n\n\tvar newData []row\n\tsessionIsValid, err := checkSession(w, r)\n\tif err != nil {\n\t\thttp.Error(w, \"there was a problem checking your session\", http.StatusUnauthorized)\n\t\treturn\n\t}\n\tif r.Method == \"POST\" && sessionIsValid {\n\t\t// read the body data\n\t\tbody, err := ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"there was a problem reading the data that was recieved\", http.StatusInternalServerError)\n\t\t}\n\t\terr = json.Unmarshal(body, &newData)\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"there was a problem handling the data that was recieved\", http.StatusInternalServerError)\n\t\t}\n\n\t\tdb, err := bolt.Open(\"data.db\", 0600, nil)\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"there was a problem opening the database\", http.StatusInternalServerError)\n\t\t}\n\t\tdefer db.Close()\n\n\t\tvar saved []string\n\t\tvar alreadyExisted []string\n\n\t\t// save each value to the db\n\t\tfor _, row := range newData {\n\t\t\tdb.Update(\n\t\t\t\tfunc(tx *bolt.Tx) error {\n\t\t\t\t\tb, err := tx.CreateBucketIfNotExists([]byte(\"data\"))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"create bucket: %s\", err)\n\t\t\t\t\t}\n\t\t\t\t\tcurrVal := b.Get([]byte(row.ID))\n\t\t\t\t\tif currVal != nil {\n\t\t\t\t\t\t// then the survey with the same ID had already been saved\n\t\t\t\t\t\talreadyExisted = append(alreadyExisted, row.ID)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdataToSave, err := json.Marshal(row.Data)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb.Put([]byte(row.ID), []byte(dataToSave))\n\t\t\t\t\t\tsaved = append(saved, row.ID)\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\t\tfmt.Println(\"saved:\", saved)\n\t\tfmt.Println(\"already:\", alreadyExisted)\n\t\ttype result struct {\n\t\t\tSaved []string\n\t\t\tUnsaved []string\n\t\t}\n\t\ttoWrite, err := json.Marshal(result{\n\t\t\tSaved: saved,\n\t\t\tUnsaved: alreadyExisted,\n\t\t})\n\t\tfmt.Println(string(toWrite))\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"there was a problem preparing the response\", http.StatusInternalServerError)\n\t\t}\n\t\tw.Write(toWrite)\n\n\t\t// return http response with ids of values that failed\n\n\t} else {\n\t\thttp.Error(w, \"your message was not a POST message\", http.StatusBadRequest)\n\t}\n\n}", "title": "" }, { "docid": "fadd06c2536a8da07dd74a0f10e95d24", "score": "0.62073755", "text": "func (gh *GRCHandler) CheckSaveHandler(w http.ResponseWriter, r *http.Request, db *badger.DB, repo string) {\n\tvar resultCheck check.ChecksResult\n\n\tbody, errGetBody := ioutil.ReadAll(r.Body)\n\tif errGetBody != nil {\n\t\tlog.Println(\"ERROR: from r.Body:\", errGetBody)\n\t\thttp.Error(w, \"Could not analyze the repository: \"+errGetBody.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tdefer r.Body.Close()\n\n\tif err := json.Unmarshal(body, &resultCheck); err != nil {\n\t\tlog.Println(\"ERROR: from download.Clean:\", err)\n\t\thttp.Error(w, \"Could not download the repository: \"+err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tbranch := check.GetBranchNameFromQuery(repo, r.URL.Query().Get(\"branch\"))\n\n\tlog.Printf(\"Save check repo %q branch %q...\", repo, branch)\n\n\tif err := saveChecksResp(db, &resultCheck, repo, branch); err != nil {\n\t\tlog.Println(\"ERROR: from saveChecksResp:\", err)\n\t\thttp.Error(w, \"Could not analyze the repository: \"+err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "9a496bad24e5e87b24b8d9b5d94a546b", "score": "0.60049826", "text": "func (f *follow) save() {\n\tctx := context.Background()\n\n\tw := c.bucket.Object(objEvents).NewWriter(ctx)\n\tdefer w.Close()\n\tif err := json.NewEncoder(w).Encode(f.Events); err != nil {\n\t\tlog.Printf(\"Saving %v failed: %v\", objEvents, err)\n\t}\n\n\tw = c.bucket.Object(objFollowers).NewWriter(ctx)\n\tdefer w.Close()\n\tif err := json.NewEncoder(w).Encode(f.Followers); err != nil {\n\t\tlog.Printf(\"Saving %v failed: %v\", objFollowers, err)\n\t}\n\n\tw = c.bucket.Object(objFollowing).NewWriter(ctx)\n\tdefer w.Close()\n\tif err := json.NewEncoder(w).Encode(f.Following); err != nil {\n\t\tlog.Printf(\"Saving %v failed: %v\", objFollowing, err)\n\t}\n\n\t// Goinsta state\n\tw = c.bucket.Object(objGoinsta).NewWriter(ctx)\n\tdefer w.Close()\n\tif err := goinsta.Export(c.ig, w); err != nil {\n\t\tlog.Println(\"Goinsta export failed: \", err)\n\t}\n}", "title": "" }, { "docid": "3ec8016625ea1cde3a74c2f7fbbdf119", "score": "0.5961502", "text": "func saveHandler(w http.ResponseWriter, r *http.Request) {\n // title := r.URL.Path[len(\"/save/\"):]\n title, err := getTitle(w, r)\n if err != nil {\n return\n }\n\n\n body_str := r.FormValue(\"body\")\n p := &Page{Title: title, Body:[]byte(body_str)}\n p.save()\n http.Redirect(w, r, \"/view/\"+title, http.StatusFound)\n\n}", "title": "" }, { "docid": "3ebf853ff2541833a2a0b8695b87b4bc", "score": "0.5958985", "text": "func (pa *PushActions) Save(db *sql.DB) (err error) {\n\t_, err = db.Exec(\n\t\t`INSERT INTO 'PushActions' (\n\t\t\t'When'\n\t\t\t, 'PluginName'\n\t\t\t, 'Channel'\n\t\t\t, 'Request'\n\t\t\t, 'Response'\n\t\t\t, 'Before'\n\t\t\t, 'After'\n\t\t\t, 'IsError')\n\t\tVALUES (?, ?, ?, ?, ?, ?, ?, ?)`,\n\t\ttime.Now(),\n\t\tpa.PluginName,\n\t\tpa.Channel,\n\t\tpa.Request,\n\t\tpa.Response,\n\t\tpa.Before,\n\t\tpa.After,\n\t\tpa.IsError)\n\n\treturn\n}", "title": "" }, { "docid": "4f83eb6afba92814352431e7dbb843eb", "score": "0.59072524", "text": "func (obj *Object) save() {\n\tif obj.saver != nil {\n\t\tso := obj.serialize()\n\t\tobj.saver <- so\n\t}\n}", "title": "" }, { "docid": "05e0289a405c673a0e14565400dfa90f", "score": "0.5898879", "text": "func Save() error { return d.Save() }", "title": "" }, { "docid": "4fee42c17c2733fe26da32d7fec6cc1a", "score": "0.5887924", "text": "func (s *Server) HandleExportsSave() func(c *gin.Context) {\n\treturn func(c *gin.Context) {\n\t\tvar form exportFormData\n\t\terr := c.Bind(&form)\n\t\tif err != nil {\n\t\t\tErrorPage(c, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tctx := c.Request.Context()\n\t\tm := TemplateMap{}\n\n\t\tdb := database.New(s.env.Database())\n\t\trecord, err := s.getExportConfig(ctx, db, c.Param(\"id\"))\n\t\tif err != nil {\n\t\t\tErrorPage(c, fmt.Sprintf(\"Failed to load export config: %s\", err))\n\t\t\treturn\n\t\t}\n\n\t\tif err := form.PopulateExportConfig(record); err != nil {\n\t\t\tErrorPage(c, fmt.Sprintf(\"error processing export config: %v\", err))\n\t\t\treturn\n\t\t}\n\n\t\tupdateFn := db.AddExportConfig\n\t\tif record.ConfigID != 0 {\n\t\t\tupdateFn = db.UpdateExportConfig\n\t\t}\n\t\tif err := updateFn(ctx, record); err != nil {\n\t\t\tErrorPage(c, fmt.Sprintf(\"Error writing export config: %v\", err))\n\t\t\treturn\n\t\t}\n\n\t\tm.AddSuccess(fmt.Sprintf(\"Updated export config #%v\", record.ConfigID))\n\t\tc.Redirect(http.StatusSeeOther, fmt.Sprintf(\"/exports/%d\", record.ConfigID))\n\t}\n}", "title": "" }, { "docid": "8ec0a96de40cadc6385fb8e387b99f6d", "score": "0.5879878", "text": "func (target *AMQPTarget) Save(eventData event.Event) error {\n\tif target.store != nil {\n\t\treturn target.store.Put(eventData)\n\t}\n\tch, err := target.channel()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tcErr := ch.Close()\n\t\tlogger.LogOnceIf(context.Background(), cErr, target.ID())\n\t}()\n\n\treturn target.send(eventData, ch)\n}", "title": "" }, { "docid": "9e386355df1508addabc2750f2deff0b", "score": "0.58588773", "text": "func (h *Handler) Save(response http.ResponseWriter, request *http.Request) {\n\n\tvar property Property\n\n\tbody, err := ioutil.ReadAll(request.Body)\n\tif err != nil {\n\t\twriteErr(response, err)\n\t}\n\n\terr = json.Unmarshal(body, &property)\n\tif err != nil {\n\t\twriteErr(response, err)\n\t\treturn\n\t}\n\n\tcount, _ := h.repo.Count()\n\n\tif count > 0 {\n\t\tprops, err := h.repo.FindAll()\n\t\tif err != nil {\n\t\t\twriteErr(response, err)\n\t\t\treturn\n\t\t}\n\t\tproperty.ID = props[0].ID\n\t\th.repo.Update(property)\n\t} else {\n\t\terr := h.repo.Store(property)\n\t\tif err != nil {\n\t\t\twriteErr(response, err)\n\t\t\treturn\n\t\t}\n\t}\n\n\terr = json.NewEncoder(response).Encode(\"{\\\"status\\\":\\\"ok\\\"}\")\n\tif err != nil {\n\t\twriteErr(response, err)\n\t}\n}", "title": "" }, { "docid": "d37a2aaf864a17270717d3f88a50971c", "score": "0.58450466", "text": "func (server *ShipyardService) save() error {\n\tdata, err := json.Marshal(server)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = ioutil.WriteFile(server.datafile, data, 0600)\n\treturn err\n}", "title": "" }, { "docid": "5ecc723d8d20c8ba32c98b428de03f02", "score": "0.5837572", "text": "func SaveBankHandler(w http.ResponseWriter, r *http.Request) {\n\tvar bank Bank\n\tb, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tjson.Unmarshal(b, &bank)\n\t// call save bank service call\n\tcreated, err := bank.SaveBank()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// marshal to JSON && return the created bank\n\tjs, err := json.Marshal(created) // convert bank struct to JSON\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write(js)\n\treturn\n}", "title": "" }, { "docid": "a98f1bc084909229e1f272287af616b0", "score": "0.58349955", "text": "func (act *Actions) Save() error {\n\tdata, err := json.MarshalIndent(act, \"\", \"\\t\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ioutil.WriteFile(act.filename, data, 0600)\n}", "title": "" }, { "docid": "2417d676e35a0e35d08677ee525140a8", "score": "0.5832143", "text": "func (we *workflowEntries) save() error {\n\n\tdbFile, err := os.OpenFile(we.DBFile, os.O_RDWR|os.O_CREATE, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := dbFile.Truncate(0); err != nil {\n\t\tlog.Error(err)\n\t}\n\n\t_, err = dbFile.Seek(0, 0)\n\tif err != nil {\n\t\tlog.Error(err)\n\t}\n\n\tdefer func() {\n\t\tif err := dbFile.Close(); err != nil {\n\t\t\tlog.Errorf(\"Error closing filename %v\", err)\n\t\t}\n\t}()\n\n\tdata, err := json.Marshal(we.Entries)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = dbFile.Write(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := dbFile.Sync(); err != nil {\n\t\tlog.Errorf(\"Error syncing db file %v\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d56e58515f00746d9e060dbff54df7b6", "score": "0.58191866", "text": "func (gs *GenericState) Save(db *AgentDB) error {\n\tgs.Debug().Object(\"generic\", LogGeneric(*gs)).Msg(\"save generic file\")\n\treturn db.SaveGeneric(gs.next)\n}", "title": "" }, { "docid": "18d1e821f7f5bc0dc130068edf27f65b", "score": "0.57957697", "text": "func (ch *ContextHandler) Save() {\n\tout, _ := yaml.Marshal(*ch)\n\n\tif err := ioutil.WriteFile(contextFilePath, out, 0644); err != nil {\n\t\tlog.Fatalf(\"could not write to '%s': %s\\n\", contextFilePath, err)\n\t}\n}", "title": "" }, { "docid": "ac20ced7ff9410030e9b979aa04f2ab0", "score": "0.577931", "text": "func (h *HandlersWithDBStore) PostHandler(w http.ResponseWriter, r *http.Request) {\n\tbody, err := io.ReadAll(r.Body)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\thttp.Error(w, \"unable to parse body\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tlongURL, err := url.Parse(string(body))\n\tif err != nil {\n\t\thttp.Error(w, \"Unable to parse URL\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tid, err := PostInDBReturnID(h.Rdb, longURL)\n\n\tif err != nil {\n\t\thttp.Error(w, \"No URL recieved\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusCreated)\n\tw.Write([]byte(h.Conf.BaseURL + \"/\" + id))\n\tfiledb.WriteAll(h.Rdb, *h.Conf)\n}", "title": "" }, { "docid": "24b18a9d3260cd1e5cd0384e537d8cdf", "score": "0.57683736", "text": "func (j *jrpcServer) saveHndl(id uint64, params json.RawMessage) (rr jrpc.Response) {\n\n\t// unmarshal request\n\trec := dataRecord{}\n\tif err := json.Unmarshal(params, &rec); err != nil {\n\t\treturn jrpc.Response{Error: err.Error()}\n\t}\n\n\trecID := fmt.Sprintf(\"%d\", rand.Int63n(99999999999)) // make a random ID for stored record\n\tj.synced(func() {\n\t\tj.data[recID] = rec\n\t})\n\n\t// encode response (recID)\n\treturn jrpc.EncodeResponse(id, recID, nil)\n}", "title": "" }, { "docid": "d5d460c2626251ea4203aa22f4863e25", "score": "0.57431865", "text": "func (f *File) save() error {\n\tdata, err := json.Marshal(f.data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to marshal backend data to json: %s\", err)\n\t}\n\terr = ioutil.WriteFile(f.filePath, data, filePerm)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to openfile to write to: %s\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2e63d60fa04c9727807aa45cf6a1e7e0", "score": "0.57326084", "text": "func handleSaveQuote(w http.ResponseWriter, req *http.Request) {\n\tbody, err := ioutil.ReadAll(req.Body)\n\tif err != nil {\n\t\tlog.Error(err)\n\t\tw.WriteHeader(http.StatusServiceUnavailable)\n\t\treturn\n\t}\n\n\tq, merr := marshallReq(body)\n\tif merr != nil {\n\t\tlog.Error(merr)\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tdefer req.Body.Close()\n\treq.Body = ioutil.NopCloser(bytes.NewReader(body))\n\n\tif err := validateHeader(w, req); err != nil {\n\t\treturn\n\t}\n\n\t//fix pointer deref\n\tif err := validateReq(*q); err != nil {\n\t\tlog.Error(err)\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tjson.NewEncoder(w).Encode(err)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-type\", \"application/json\")\n\n\tif merr != nil {\n\t\tlog.Error(merr)\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t} else {\n\t\tif r, serr := save(q); serr != nil {\n\t\t\tlog.Error(serr)\n\t\t\tw.WriteHeader(http.StatusServiceUnavailable)\n\t\t} else {\n\t\t\tdata, _ := json.Marshal(r)\n\t\t\tw.WriteHeader(http.StatusCreated)\n\t\t\tfmt.Fprintf(w, \"%s\", data)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5a35241c262e83561ec6a1a70531cdc7", "score": "0.57253253", "text": "func (be *Backend) Save(ctx context.Context, h restic.Handle, rd io.Reader) error {\n\tdebug.Log(\"Save %v\", h)\n\n\tif err := h.Valid(); err != nil {\n\t\treturn err\n\t}\n\n\tobjName := be.Filename(h)\n\t// debug.Log(\"Save key:%v\", objName)\n\t_, err := be.bucket.GetObjectMeta(objName)\n\n\tif err == nil {\n\t\tdebug.Log(\"%v already exists\", h)\n\t\treturn errors.New(\"key already exists\")\n\t}\n\n\treturn errors.Wrap(be.bucket.PutObject(objName, rd), \"bucket.PutObject\")\n}", "title": "" }, { "docid": "11c86bdc491951df284e11950a7c333d", "score": "0.5724816", "text": "func (b *restBackend) Save(h backend.Handle, p []byte) (err error) {\n\tif err := h.Valid(); err != nil {\n\t\treturn err\n\t}\n\n\t<-b.connChan\n\tresp, err := b.client.Post(restPath(b.url, h), \"binary/octet-stream\", bytes.NewReader(p))\n\tb.connChan <- struct{}{}\n\n\tif resp != nil {\n\t\tdefer func() {\n\t\t\te := resp.Body.Close()\n\n\t\t\tif err == nil {\n\t\t\t\terr = e\n\t\t\t}\n\t\t}()\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\treturn fmt.Errorf(\"unexpected HTTP response code %v\", resp.StatusCode)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "64ec944ffcda6d04696d111ddf396be3", "score": "0.5714591", "text": "func (s *Service) Save(path string, dummy *int) error {\n\t<-s.initialized\n\n\t// TODO\n\treturn nil\n}", "title": "" }, { "docid": "22b673b1a5290ffc67bc1f2a70be9fd8", "score": "0.5712232", "text": "func (s *BasePMMPostListener) EnterSavecmd(ctx *SavecmdContext) {}", "title": "" }, { "docid": "326c4ebeba5603a372b3f3d9d22c0a24", "score": "0.56762266", "text": "func saveLoadedOnSubmit(file multipart.File, handler *multipart.FileHeader) {\n\n\tcwd, _ := os.Getwd()\n\tf, err := os.OpenFile(cwd+CHATFILESSENTDIR+handler.Filename, os.O_WRONLY|os.O_CREATE, 0666)\n\tif err != nil {\n\t\tfmt.Println(\"Error in ceating file to save in sent folder : err - \", err)\n\t\treturn\n\t}\n\tdefer f.Close()\n\n\t_, err = io.Copy(f, file)\n\tif err != nil {\n\t\tfmt.Println(\"Error in copying file to new created file - \", err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "ce5e95b5d69c976fa38121624b8b1a81", "score": "0.5675303", "text": "func (a *API) save(username string, w http.ResponseWriter, r *http.Request) error {\n\tif err := a.mc[username].CreateFile(r.URL.Path, r.Body); err != nil {\n\t\thttp.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\t\treturn fmt.Errorf(\"internal server error: %v\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "64354c7d3c4ef1c87a2207048bcd9888", "score": "0.5670705", "text": "func Save(a interface{}) (err error) {\n\tencryptRecord(a)\n\tif Database.Type == \"mysql\" {\n\t\ta = fixDates(a)\n\t}\n\tTimeMetric(\"uadmin/db/duration\", 1000, func() {\n\t\terr = db.Save(a).Error\n\t\tfor fmt.Sprint(err) == \"database is locked\" {\n\t\t\ttime.Sleep(time.Millisecond * 100)\n\t\t\terr = db.Save(a).Error\n\t\t}\n\t})\n\tif err != nil {\n\t\tTrail(ERROR, \"DB error in Save(%v). %s\", getModelName(a), err.Error())\n\t\treturn err\n\t}\n\terr = customSave(a)\n\tif err != nil {\n\t\tTrail(ERROR, \"DB error in customSave(%v). %s\", getModelName(a), err.Error())\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24c4b655cd2a37eaeef9fcd11094fd32", "score": "0.5664238", "text": "func (c *Client) Save() error {\n\treturn Send(c, []byte(\"SAVE\")).nilOrErr()\n}", "title": "" }, { "docid": "1f8ea0856553b498a95c22a877fe640b", "score": "0.5643904", "text": "func (item *ShopItem) Save() {\n\tDB.Set(\"ShopItem\", item.ID, item)\n}", "title": "" }, { "docid": "01dda8da0a962f58034dbac381659696", "score": "0.56390953", "text": "func (target *PeerRESTClientTarget) Save(eventData event.Event) error {\n\treturn target.send(eventData)\n}", "title": "" }, { "docid": "ce54ef306640ef9fd52ea57fec013e82", "score": "0.5638876", "text": "func (p *PluginService) Save2DB() {\n\n}", "title": "" }, { "docid": "848a274e358a88cfc17fb80d2e91a6e9", "score": "0.56273717", "text": "func (si *SlackItem) Save(db *sql.DB) (err error) {\n\t_, err = db.Exec(\n\t\t\"INSERT OR IGNORE INTO 'SlackItem' ('ID', 'Name', 'Type') VALUES (?, ?, ?)\",\n\t\tsi.ID, si.Name, si.Type)\n\treturn\n}", "title": "" }, { "docid": "a3e592bee382fe5d27bd96fa0f9aea9d", "score": "0.56191", "text": "func (res *Resource) CallSave(result interface{}, context *qor.Context) error {\n\treturn res.SaveHandler(result, context)\n}", "title": "" }, { "docid": "73c5137e8dc886885b2bbe5db6b72e01", "score": "0.56020015", "text": "func (n *Notify) Save() {\n\n\tif (len(n.UIDs) > 0) && (config.AppConf.DB.Type == \"sqlite3\") {\n\t\tn.UIDsStr = strings.Join(n.UIDs, \";\")\n\t}\n\n\tdb.Stor.Db().Save(n)\n}", "title": "" }, { "docid": "a4253fe353daca0d8e5599c49edf859d", "score": "0.5583947", "text": "func (fs *fileStore) Save(where string, what []byte) error {\n\tfs.lock(where)\n\tdefer fs.unlock(where)\n\treturn ioutil.WriteFile(fs.pathFor(where), what, 0600)\n}", "title": "" }, { "docid": "04d27a386df7f04c3c3c509db54dc3fd", "score": "0.5580734", "text": "func (bs *BookStore) Save(b *Book) error {\n\t//This function demonstrates function references in Go\n\t//Store.Update takes a function as an argument\n\treturn bs.store.Update(func(tx *bolt.Tx) error {\n\t\tvalue, err := json.Marshal(b)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t//Add the key/value pair to the bucket\n\t\ttx.Bucket(bs.bucketName).Put([]byte(b.ID), value)\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "e71f90df6ca73064b316be1df354160a", "score": "0.55726963", "text": "func (ah *AdminHelpedit) Save(ctx context.Context) error {\n\tif ah.Exists() {\n\t\treturn ah.Update(ctx)\n\t}\n\n\treturn ah.Insert(ctx)\n}", "title": "" }, { "docid": "c9ff684bfb56726fd8fe39b66bae4ee8", "score": "0.556444", "text": "func (store *Store) Save() error {\n\tdata, err := json.Marshal(store)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := os.WriteFile(accountsFile, data, 0644); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b041345587667aa41f686d41cc674bcb", "score": "0.5541833", "text": "func (s State) Save(filename string) error {\n\treturn nil\n}", "title": "" }, { "docid": "51acf44b77d9c53ef476d1d6c667f5c9", "score": "0.55342543", "text": "func (m *Model) save(model *Model) (err error) {\n\n}", "title": "" }, { "docid": "f1e8f4927abf57ab2c6837711434174d", "score": "0.55334336", "text": "func (_m *Persistence) Save(r persistence.Storable) error {\n\targs := _m.Called(r)\n\treturn args.Error(0)\n}", "title": "" }, { "docid": "02fbe53f0ca73af90ad66ea7ca78d5b5", "score": "0.55283487", "text": "func (a *CasbinAdapter) SavePolicy(model casbinModel.Model) error {\n\treturn nil\n}", "title": "" }, { "docid": "f3fd7596157917466a59c9680b7dba9c", "score": "0.55203855", "text": "func (l *Log) Save(dbs MongoDBDatabase) <-chan Result {\n\tc := make(chan Result, 256)\n\n\tgo func() {\n\t\tdefer close(c)\n\t\tif l.ID == bson.ObjectId(\"\") || !l.ID.Valid() {\n\t\t\tl.ID = bson.NewObjectId()\n\t\t} else {\n\t\t\terr := dbs.C(\"logs\").RemoveID(l.ID)\n\t\t\tif err != nil {\n\t\t\t\tc <- Result{Err: err}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\terr := dbs.C(\"logs\").Insert(l)\n\t\tif err != nil {\n\t\t\tc <- Result{Err: err}\n\t\t\treturn\n\t\t}\n\n\t\tc <- Result{Val: l, Err: nil}\n\t}()\n\n\treturn c\n}", "title": "" }, { "docid": "0a7f2e45ae7b4757e05830e4978d7b19", "score": "0.55186164", "text": "func (self *ExchangeAccountManager) save() error {\n\tlogger.Debug(\"save accounts\")\n\ta := self.ToMarshalable()\n\t// for self.Accounts\n\treturn file.SaveJSON(filepath.Join(acntDir, acntName), a, 0600)\n}", "title": "" }, { "docid": "18565a022eee72b0336d59bd1c737854", "score": "0.55143255", "text": "func save(w http.ResponseWriter, r *http.Request) {\n\tfmt.Printf(\"Received a post request\\n\")\n\tif r.Method != http.MethodPost {\n\t\tw.Header().Set(\"Allow\", http.MethodPost)\n\t\thttp.Error(w, http.StatusText(405), 405)\n\t\treturn\n\t}\n\tbody, err := ioutil.ReadAll(r.Body)\n\tfmt.Printf(\"Post request body: %s\\n\", string(body))\n\tvar data1 map[string]string\n\terr = json.Unmarshal(body, &data1)\n\tif err != nil {\n\t\tfmt.Printf(\"Error while json Unmarshal: %v\\n\", err.Error())\n\t\tfmt.Fprintf(w, \"error in storing data\")\n\t\treturn\n\t}\n\tfmt.Printf(\"Data parsed as: %v\\n\", data1)\n\t// Save the data in Cache\n\tval, err := conn.Store(data1[\"key\"], []byte(data1[\"value\"]))\n\tif err != nil {\n\t\tfmt.Fprintf(w, \"error in storing data\")\n\t\treturn\n\t}\n\tfmt.Fprintf(w, val)\n}", "title": "" }, { "docid": "04a4065375415f0423178bb5469ee869", "score": "0.55087554", "text": "func (s *user) Save() (err error) { return s.PtrScope().Save() }", "title": "" }, { "docid": "77ab5629d77af2def6b3231f3658ac69", "score": "0.55071855", "text": "func (b *bill) save() {\n\tcurrentTime := time.Now()\n\tdata := []byte(b.formatBill())\n\terr := os.WriteFile(\"bills/\"+b.name+\" \"+currentTime.Format(\"01022006150405\")+\".txt\", data, 0644)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"A conta foi salva no arquivo!\")\n}", "title": "" }, { "docid": "cdec7e772446856ac03f7c25770671ff", "score": "0.55067694", "text": "func Save(v interface{}) error {\n\treturn database.DBManager().Save(v).Error\n}", "title": "" }, { "docid": "76b7e771970b015105504c01bd27648d", "score": "0.5487876", "text": "func (store *Store) Save() error {\n\tstore.imutex.RLock()\n\tdefer store.imutex.RUnlock()\n\tif store.dataPath == \"\" {\n\t\treturn nil\n\t}\n\tb, err := json.Marshal(store)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn ioutil.WriteFile(store.dataPath, b, 0600)\n}", "title": "" }, { "docid": "65cca399ef1a2744970ef9c89251df21", "score": "0.5485245", "text": "func (p *Page) save() error {\n\t// Generamos un archivo con el nombre del campo inicializado en el struct.\n\t// luego escribimos el archivo en el sistema. Nombre archivo => filename, contenido, Body, permisos para r y w\n\tfilename := p.Title + \".txt\"\n\treturn ioutil.WriteFile(filename, p.Body, 0600)// el valor octal del ultimo parametro indica permisos r y w\n}", "title": "" }, { "docid": "a29c65386d9d0005f386fc4accedb4da", "score": "0.54829323", "text": "func (p *Page) save() error {\n\tfilename := configuration.WorkDirectory + \"/data/\" + slug.Slug(p.Title) + \".txt\"\n\treturn ioutil.WriteFile(filename, p.Body, 0600)\n}", "title": "" }, { "docid": "1cb6662e682ac4e0f11f56d7dc27188c", "score": "0.5477334", "text": "func (ag *ArticleGroup) SaveArticleHandler(c *gin.Context) {\n\tarticleObj := model.Article{}\n\terr := c.ShouldBind(&articleObj)\n\tif err != nil {\n\t\tag.logger.Println(\"USER_PARAMETER_BIND_ERROR : \", err)\n\t\tc.JSON(http.StatusExpectationFailed, map[string]interface{}{\n\t\t\t\"status\": http.StatusExpectationFailed,\n\t\t\t\"message\": err.Error(),\n\t\t\t\"data\": nil,\n\t\t})\n\t\treturn\n\t}\n\tif ok, err := validator.ValidateInputs(&articleObj); !ok {\n\t\tc.JSON(http.StatusUnprocessableEntity, map[string]interface{}{\n\t\t\t\"status\": http.StatusUnprocessableEntity,\n\t\t\t\"message\": err,\n\t\t\t\"data\": nil,\n\t\t})\n\t\treturn\n\t}\n\tID, err := ag.articleService.SaveArticleService(c.Request.Context(), articleObj)\n\tif err != nil {\n\t\tag.logger.Println(err)\n\t\tc.JSON(http.StatusExpectationFailed, map[string]interface{}{\n\t\t\t\"status\": http.StatusExpectationFailed,\n\t\t\t\"message\": err.Error(),\n\t\t\t\"data\": nil,\n\t\t})\n\t\treturn\n\t}\n\tc.JSON(http.StatusCreated, map[string]interface{}{\n\t\t\"status\": http.StatusCreated,\n\t\t\"message\": \"Success\",\n\t\t\"data\": map[string]interface{}{\n\t\t\t\"id\": ID,\n\t\t},\n\t})\n\treturn\n}", "title": "" }, { "docid": "7b36b6b1bc1c066f36c6941aeac92898", "score": "0.5463354", "text": "func (N *TagController) Save(k *knot.WebContext) {\n\tk.Request.Header.Set(\"Content-Type\", \"application/json\")\n\n\tif core.GetMethod(k) == \"POST\" {\n\t\tpayload := models.NewTagModel()\n\n\t\terr := k.GetPayload(&payload)\n\t\tif err != nil {\n\t\t\tk.WriteJSON(core.ResponseJSONError(err.Error()), http.StatusInternalServerError)\n\t\t}\n\n\t\terr = services.NewTagService().Insert(payload)\n\t\tif err != nil {\n\t\t\tk.WriteJSON(core.ResponseJSONError(err.Error()), http.StatusInternalServerError)\n\t\t}\n\n\t\tk.WriteJSON(core.ResponseJSONOK(nil), http.StatusCreated)\n\t} else {\n\t\tk.WriteJSON(core.ResponseJSONError(\"Unknown Method\"), http.StatusInternalServerError)\n\t}\n}", "title": "" }, { "docid": "d2e3ebcfb1413a2a1da769d410aaca2d", "score": "0.54631454", "text": "func (e *routeEntry) save(route, server int) {\n\te.route = route\n\te.server = server\n\te.count++\n\te.failed = 0\n\te.mu.Unlock()\n}", "title": "" }, { "docid": "e5994f7474e9f69b417201eb755ec46d", "score": "0.5449824", "text": "func (s *Specialist) Save(db XODB) error {\n\tif s.Exists() {\n\t\treturn s.Update(db)\n\t}\n\n\treturn s.Insert(db)\n}", "title": "" }, { "docid": "efa5d83c73995c664d18104e6de20a45", "score": "0.5448321", "text": "func (j *Journal) Save(filename string) {\n\t_ = ioutil.WriteFile(filename, []byte(j.String()), 0644)\n}", "title": "" }, { "docid": "3a62097dbfdfe7cd9682ce7ab03e4901", "score": "0.5441103", "text": "func (onl *OrderNotifyLog) Save(ctx context.Context) error {\n\tif onl.Exists() {\n\t\treturn onl.Update(ctx)\n\t}\n\n\treturn onl.Insert(ctx)\n}", "title": "" }, { "docid": "e40810fd6eeda9c37a83ceb29feb109e", "score": "0.5439342", "text": "func (hnd Handlers) InsertHandler(w http.ResponseWriter, r *http.Request) {\n\tif r.Body == nil {\n\t\thttp.Error(w, \"Missing request body\", 400)\n\t\treturn\n\t}\n\n\tvar data map[string]interface{}\n\n\terr := json.NewDecoder(r.Body).Decode(&data)\n\tif err != nil {\n\t\tlog.Error(\"decode error: %s\", err)\n\t\thttp.Error(w, \"Request body has errors\", 400)\n\t\treturn\n\t}\n\n\t// item, err := NewListItemFromJSON(data)\n\n\t// item, err = item.Save(hnd.db)\n\n\twrapper := hnd.CreateResponseWrapper(\"ok\")\n\t// wrapper[\"item\"] = item\n\n\thnd.writeJSONBlob(w, wrapper)\n}", "title": "" }, { "docid": "bbde0ef661b341727766534d92fce927", "score": "0.54383886", "text": "func (s *Session) Save(r *http.Request, w http.ResponseWriter) error {\n\treturn s.gorillaSession.Save(r, w)\n}", "title": "" }, { "docid": "e59bc3887e0bae39f0310dc335d3ac49", "score": "0.543751", "text": "func (dir *Director) Save(record *Record) error {\n\tif record == nil {\n\t\treturn errors.New(\"Record cannot be nil\")\n\t}\n\n\trecords, err := dir.persister.prepareRelationRecords(record)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trecords = append(records, record)\n\n\tdir.incoming <- records\n\n\treturn nil\n}", "title": "" }, { "docid": "0b109b97f68379762915926d792a7e4e", "score": "0.5437506", "text": "func (s *StoreImpl) Save(dir string) error {\n\tassetMap := make(map[string]Asset)\n\tfor k, v := range s.assets {\n\t\tassetMap[k.String()] = v\n\t}\n\tdata, err := json.MarshalIndent(&assetMap, \"\", \" \")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpath := filepath.Join(dir, stateFileName)\n\tif err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {\n\t\treturn err\n\t}\n\tif err := ioutil.WriteFile(path, data, 0644); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dcbab87bc805f106360d56ccb68f86e7", "score": "0.5436043", "text": "func (ss *SkySync) save() error {\n\treturn persist.SaveJSON(persistMetadata, ss.persistData(), persistFileName)\n}", "title": "" }, { "docid": "e4b8e3ee9c4c14504ce071ff0fe19eac", "score": "0.5432176", "text": "func (lm *LocalMeta) Save(pos mysql.Position, gs GTIDSet, force bool) error {\n\tlm.Lock()\n\tdefer lm.Unlock()\n\n\tlm.BinLogName = pos.Name\n\tlm.BinLogPos = pos.Pos\n\tlm.BinlogGTID = gs.String()\n\n\tif force {\n\t\treturn lm.Flush()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "265c383f388a153aa7a0d4e3ec782b78", "score": "0.54320645", "text": "func (ss *subStore) Save(where string, what []byte) error {\n\treturn ss.data.Save(ss.where+where, what)\n}", "title": "" }, { "docid": "07e4a33f5f3262e8428b530a38df33d1", "score": "0.54238236", "text": "func (post *Post) Save() {\n\tDB.Set(\"Post\", post.ID, post)\n}", "title": "" }, { "docid": "0d2acbf3a9c85a3c9c52f5962b3636c3", "score": "0.54014885", "text": "func (e *Entries) save(ne Entry) error {\n\tdb, err := os.OpenFile(getLifeLogLocation(), os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\tdefer db.Close()\n\n\t*e = append(*e, ne)\n\tb, err := json.MarshalIndent(e, \"\", \"\\t\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = db.Write(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n\n}", "title": "" }, { "docid": "9e0c978da761ffd6efe2f8c5d61622a5", "score": "0.5400433", "text": "func (uc UserCommand) Save() error {\n\treturn database.BotStorage.Save(bucketName, uc.Name, &uc)\n}", "title": "" }, { "docid": "1479e1aa44e79c3ee0ccad68a4411da9", "score": "0.5398441", "text": "func (a *Adapter) SavePolicy(model model.Model) error {\n\treturn errors.New(\"not implemented\")\n}", "title": "" }, { "docid": "e0c77a9f32789a4f51ffebc3814a18a8", "score": "0.53932", "text": "func (dao *RepositoryDAO) Save(repo *model.Repository) {\n\tdao.db.Save(repo)\n}", "title": "" }, { "docid": "8d0d565560c3032ad9cbaa11dbb4a44d", "score": "0.5390471", "text": "func (h *Handler) SaveResponse(w http.ResponseWriter, r *http.Request) {\n\tvar err error\n\tev := hnyEventFromRequest(r)\n\tdefer addFinalErr(&err, ev)\n\n\tpost := &models.Response{}\n\terr = json.NewDecoder(r.Body).Decode(&post)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tev.AddField(\"save.post\", post.ID)\n\n\tqueryStart := time.Now()\n\terr = h.repo.SaveResponse(r.Context(), post)\n\tif err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, \"Server Error\"+err.Error())\n\t}\n\tev.AddField(\"timers.db.response_insert_ms\", time.Since(queryStart)/time.Millisecond)\n\n\trespondWithJSON(w, http.StatusCreated, map[string]string{\"message\": \"Successfully Created\"})\n}", "title": "" }, { "docid": "5a09d7502cffcd6fb8996311e762f983", "score": "0.5385586", "text": "func (sc *StatsController) save() error {\n statsModel := models.StatsModel {\n HashCount: sc.hashCount,\n HashCumulatedResponseTimeUSec: sc.hashCumulatedResponseTimeUSec,\n }\n jsonBytes, err := json.Marshal(statsModel)\n if nil != err {\n log.Fatal(err)\n return err\n }\n \n err = ioutil.WriteFile(sc.configFilePath, jsonBytes, os.ModePerm)\n if nil != err {\n log.Fatal(err)\n return err\n }\n\n return nil\n}", "title": "" }, { "docid": "8064e5ad783061206c3f81b24c352b59", "score": "0.5385253", "text": "func (e *EditArea) Save() {\n\tf, err := os.Create(e.Filename)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer f.Close()\n\t_, err = f.WriteString(e.text.String())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tf.Sync()\n\te.beenSaved = true\n}", "title": "" }, { "docid": "fc912d9d10cb07fbc936b3421d3c6ce7", "score": "0.5382853", "text": "func (d *Detector) save(m *models.Metric, idx *models.Index) error {\n\t// Save index.\n\tif err := d.db.Index.Put(idx); err != nil {\n\t\treturn err\n\t}\n\t// Save metric.\n\tm.LinkTo(idx)\n\tif err := d.db.Metric.Put(m); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9c82ec576d0c0307535abbcf8aab4bfc", "score": "0.53819144", "text": "func (s *store) save() error {\n\t// No need to lock here, has write-lock from s.StoreTweets\n\n\tf, err := os.Create(s.location)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Unable to open store for writing\")\n\t}\n\tdefer f.Close()\n\n\tzf, _ := gzip.NewWriterLevel(f, gzip.BestCompression) // #nosec G104: Ignore error as using a compression constant\n\tdefer func() {\n\t\tzf.Flush()\n\t\tzf.Close()\n\t}()\n\n\treturn errors.Wrap(gob.NewEncoder(zf).Encode(s.s), \"Unable to encode store\")\n}", "title": "" }, { "docid": "6d7d146a32d13f512a81db40c434f73c", "score": "0.5378767", "text": "func (p *Page) save() error { //this is for the save method to save presistent storage\r\n filename := p.Title + \".txt\" //filename will be made into a txt file\r\n return ioutil.WriteFile(filename, p.Body, 0600) // this iwill be saved in the memory location 0600\r\n\r\n }", "title": "" }, { "docid": "46aef99ff9ea824051d9d2d823bf0318", "score": "0.53769785", "text": "func (c DefaultConfig) Save(v Object) error {\n\treturn c.Store.WriteState(v)\n}", "title": "" }, { "docid": "81a96e45ad6599914fd24361430df849", "score": "0.5375145", "text": "func (s ShareStore) Save(l *fm.ShareLink) error {\n\treturn s.DB.Save(l)\n}", "title": "" }, { "docid": "19bc0defa10a9e09e315cc343117925a", "score": "0.53717935", "text": "func (c *Controller) Save() {\n\tdb := getDb()\n\tif db.NewRecord(c) {\n\t\tif err := db.Create(c).Error; err != nil {\n\t\t\tlogger.Printf(\"unable to create controller: %s\\n\", err)\n\t\t}\n\t} else {\n\t\tif err := db.Save(c).Error; err != nil {\n\t\t\tlogger.Printf(\"unable to save controller: %s\\n\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "798d9453c4c0f168cf4133dd711a76a3", "score": "0.5367415", "text": "func (c *TestController) Save(ctx context.Context) error {\n\tif c.SaveCallback != nil {\n\t\treturn c.SaveCallback()\n\t}\n\treturn errors.New(\"Save must not be called (not mocked)\")\n}", "title": "" }, { "docid": "2b910179061940d73dfa0c06a24bba2c", "score": "0.53537804", "text": "func (self *BranchOffice) Save() error {\n\tDb, err := ConnectionDatabase()\n\tif err != nil { return err }\n\ttx := Db.MustBegin()\n\ttx.NamedExec(\"INSERT INTO branch_office (city, province, address, check_in_time, exit_time) VALUES (:city,:province,:address,:check_in_time,:exit_time)\",self)\n\terr = tx.Commit()\n\tdefer Db.Close()\n\tif err != nil { return err }\n\treturn nil\n}", "title": "" }, { "docid": "d627268a6aa15b07c7b07ce7a7b917c0", "score": "0.53483546", "text": "func (s *ServiceRouteDay) Save() error {\n\t_, err := upsert.Upsert(etc.DBConn, s)\n\treturn err\n}", "title": "" }, { "docid": "6198302c9f73d27e122ef08ba232a93d", "score": "0.534727", "text": "func (p *RulesPage) Save() {\n\tif p.saveFunc != nil {\n\t\tp.saveFunc(p.GetRules())\n\t}\n}", "title": "" }, { "docid": "f3b2570700488450909d577d1395ed2e", "score": "0.5335862", "text": "func (c *Client) save() error {\n\tctx := context.Background()\n\n\t// Goinsta state\n\tw := c.bucket.Object(objGoinsta).NewWriter(ctx)\n\tdefer w.Close()\n\tif err := goinsta.Export(c.ig, w); err != nil {\n\t\treturn fmt.Errorf(\"goinsta export failed: %v\", err)\n\t}\n\n\t// downlist\n\t// w = c.bucket.Object(objGoinsta).NewWriter(ctx)\n\t// defer w.Close()\n\t// if err := json.NewEncoder(w).Encode(c.downlist); err != nil {\n\t// \treturn fmt.Errorf(\"downlist export failed: %v\", err)\n\t// }\n\treturn nil\n}", "title": "" }, { "docid": "0f21bf27742f495f1bcee7ad65ca0f8e", "score": "0.5335189", "text": "func (gds *GenericDiffState) Save(db *AgentDB) error {\n\tgds.Debug().Object(\"generic diff\", LogGenericDiff(gds.next)).Msg(\"Save critical generic file\")\n\treturn db.SaveGenericDiff(gds.next)\n}", "title": "" }, { "docid": "772b5a377e6055d9509ae1da256b4227", "score": "0.5330561", "text": "func (s *PollStore) Save(poll *poll.Poll) error {\n\tif err := s.api.KVSet(pollPrefix+poll.ID, poll.EncodeToByte()); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "28c884e276130e562cc9e83b7ae5477b", "score": "0.5325413", "text": "func (a *authStore) Save(w http.ResponseWriter, r *http.Request, info *AuthInfo) error {\n\tses, err := a.store.Get(r, a.sessionName)\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\tses.Values[skAuthInfo] = *info\n\terr = ses.Save(r, w)\n\treturn errors.WithStack(err)\n}", "title": "" }, { "docid": "3c9ad104ce7652072eae4475d5833888", "score": "0.5324418", "text": "func (runner *jsRunner) do_save(body map[string]any, docIDPtr *string, sudo bool) (*string, error) {\n\tif err := db.CheckTimeout(runner.ctx); err != nil {\n\t\treturn nil, err\n\t} else if sudo {\n\t\texitSudo := runner.enterSudo()\n\t\tdefer exitSudo()\n\t} else if err := runner.checkMutationAllowed(\"user.put\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// The optional `docID` parameter takes precedence over a `_id` key in the body.\n\t// If neither is present, make up a new random docID.\n\tvar docID string\n\tif docIDPtr != nil {\n\t\tdocID = *docIDPtr\n\t} else if _id, found := body[\"_id\"].(string); found {\n\t\tdocID = _id\n\t} else {\n\t\tvar err error\n\t\tdocID, err = base.GenerateRandomID()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tdelete(body, \"_id\")\n\tcollection, err := runner.currentDB.GetDefaultDatabaseCollectionWithUser()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif _, found := body[\"_rev\"]; found {\n\t\t// If caller provided `_rev` property, use MVCC as normal:\n\t\t_, _, err := collection.Put(runner.ctx, docID, body)\n\t\tif err == nil {\n\t\t\treturn &docID, err // success\n\t\t} else if status, _ := base.ErrorAsHTTPStatus(err); status == http.StatusConflict {\n\t\t\treturn nil, nil // conflict: no error, but returns null\n\t\t} else {\n\t\t\treturn nil, err\n\t\t}\n\n\t} else {\n\t\t// If caller didn't provide a `_rev` property, fall back to \"last writer wins\":\n\t\t// get the current revision if any, and pass it to Put so that the save always succeeds.\n\t\tfor {\n\t\t\trev, err := collection.GetRev(runner.ctx, docID, \"\", false, []string{})\n\t\t\tif err != nil {\n\t\t\t\tif status, _ := base.ErrorAsHTTPStatus(err); status != http.StatusNotFound {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif rev.RevID == \"\" {\n\t\t\t\tdelete(body, \"_rev\")\n\t\t\t} else {\n\t\t\t\tbody[\"_rev\"] = rev.RevID\n\t\t\t}\n\n\t\t\t_, _, err = collection.Put(runner.ctx, docID, body)\n\t\t\tif err == nil {\n\t\t\t\tbreak // success!\n\t\t\t} else if status, _ := base.ErrorAsHTTPStatus(err); status != http.StatusConflict {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// on conflict (race condition), retry...\n\t\t}\n\t}\n\treturn &docID, nil\n}", "title": "" } ]
6ec2a6ec4bea2199e418293845a79d6e
WithContext adds the context to the delete Api v3 inventories inventory number attachments fingerprint params
[ { "docid": "bd07df5f48fc367ecd2d7b723c3e1b75", "score": "0.70617485", "text": "func (o *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams) WithContext(ctx context.Context) *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" } ]
[ { "docid": "a6588e0cc3e8a43e9de8a4563981edbd", "score": "0.6043584", "text": "func NewDeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParamsWithHTTPClient(client *http.Client) *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams {\n\tvar ()\n\treturn &DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "c3d1694d5f3b5add416c1cf8aa4358e8", "score": "0.5958506", "text": "func (o *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams) WithFingerprint(fingerprint string) *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams {\n\to.SetFingerprint(fingerprint)\n\treturn o\n}", "title": "" }, { "docid": "a1a26bd54a184c38ed4c897c8cb726f8", "score": "0.5788505", "text": "func NewDeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams() *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams {\n\tvar ()\n\treturn &DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "1ca4853983aeb35f835c808235af0847", "score": "0.57375675", "text": "func (o *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams) WithHTTPClient(client *http.Client) *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "1a9e70155bdd55345cecfd9399653a4e", "score": "0.5724338", "text": "func (c *BeaconsAttachmentsDeleteCall) Context(ctx context.Context) *BeaconsAttachmentsDeleteCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "f5ec0e772648ae9e8f9eb40fbbb5bf50", "score": "0.5691829", "text": "func (c *BeaconsAttachmentsBatchDeleteCall) Context(ctx context.Context) *BeaconsAttachmentsBatchDeleteCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "e64874b0d55537aeec74675b2912b43e", "score": "0.5675674", "text": "func (o *DeleteElfImageParams) WithContext(ctx context.Context) *DeleteElfImageParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "258d5155e431014f2ee9ac3295e27f48", "score": "0.55911577", "text": "func NewDeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParamsWithContext(ctx context.Context) *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams {\n\tvar ()\n\treturn &DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "fd821d454e32aa9e8efdd7ea689d7b8e", "score": "0.548663", "text": "func (o *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "e88a3c753d1371eac09e3449e0014459", "score": "0.5466558", "text": "func NewDeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParamsWithTimeout(timeout time.Duration) *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams {\n\tvar ()\n\treturn &DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "c565ae353ca7dde96a4cdc3c0f023be2", "score": "0.5450439", "text": "func (o *DeleteIngredientVersionParams) WithContext(ctx context.Context) *DeleteIngredientVersionParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "ba3b433f8448a12571526dd6284670d6", "score": "0.53723776", "text": "func (r *Radarr) DeleteExclusionsContext(ctx context.Context, ids []int64) error {\n\tvar errs string\n\n\tfor _, id := range ids {\n\t\treq := starr.Request{URI: path.Join(bpExclusions, fmt.Sprint(id))}\n\t\tif err := r.DeleteAny(ctx, req); err != nil {\n\t\t\terrs += fmt.Sprintf(\"api.Post(%s): %v \", &req, err)\n\t\t}\n\t}\n\n\tif errs != \"\" {\n\t\treturn fmt.Errorf(\"%w: %s\", starr.ErrRequestError, errs)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f606de2d5617883f9f23364271f5f7c5", "score": "0.53663754", "text": "func (r *ItemAttachmentRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "f606de2d5617883f9f23364271f5f7c5", "score": "0.53663754", "text": "func (r *ItemAttachmentRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "6c99a95796051e48a6135c5dcba4d372", "score": "0.53234977", "text": "func (client *Client) DeleteInputContext(\n\tctx context.Context, id string,\n) (*ErrorInfo, error) {\n\tif id == \"\" {\n\t\treturn nil, errors.New(\"id is empty\")\n\t}\n\tu, err := client.Endpoints().Input(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn client.callDelete(ctx, u.String(), nil, nil)\n}", "title": "" }, { "docid": "5cc202c03a99ba37160cd5eed75e3e83", "score": "0.5285131", "text": "func (o *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams) WithTimeout(timeout time.Duration) *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "5cbe0e9e22102e2355bac12ce1793faf", "score": "0.5284065", "text": "func (client BaseClient) DeleteAttachmentPreparer(ctx context.Context, drawer int32, ID int32) (*http.Request, error) {\n pathParameters := map[string]interface{} {\n \"drawer\": autorest.Encode(\"path\",drawer),\n \"id\": autorest.Encode(\"path\",ID),\n }\n\n preparer := autorest.CreatePreparer(\n autorest.AsDelete(),\n autorest.WithBaseURL(client.BaseURI),\n autorest.WithPathParameters(\"/v1/content/attachments/{drawer}/{id}\",pathParameters))\n return preparer.Prepare((&http.Request{}).WithContext(ctx))\n }", "title": "" }, { "docid": "67001ec49a877f4739b2d5b87c48a2df", "score": "0.5242891", "text": "func (o *DeleteAPIV3InventoriesInventoryNumberAttachmentsFingerprintParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param fingerprint\n\tif err := r.SetPathParam(\"fingerprint\", o.Fingerprint); err != nil {\n\t\treturn err\n\t}\n\n\t// path param inventory_number\n\tif err := r.SetPathParam(\"inventory_number\", o.InventoryNumber); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d5680a0068d41b9f70dc0e679de7a8f1", "score": "0.5236324", "text": "func (o *DeleteaspecificManagerSecretaryParams) WithContext(ctx context.Context) *DeleteaspecificManagerSecretaryParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "9d48b3a656a3998be749b63352412224", "score": "0.52242154", "text": "func (o *FAXDeliveryReceiptAutomationDeleteParams) WithContext(ctx context.Context) *FAXDeliveryReceiptAutomationDeleteParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "0a92950b9a42c4687bd87f1882f13272", "score": "0.5203603", "text": "func (o *DeleteaspecificVoucherParams) WithContext(ctx context.Context) *DeleteaspecificVoucherParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "ddb1081d85ce0031f94364c7fd2cd8fa", "score": "0.51536524", "text": "func (o *ImageDeleteParams) WithContext(ctx context.Context) *ImageDeleteParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "ebc8b2832306a7260aaa26b685204d3a", "score": "0.5139815", "text": "func (o *DeletePrivateRecipeParams) WithContext(ctx context.Context) *DeletePrivateRecipeParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "1cfb1732adeaa68bc6048489be860b8b", "score": "0.50475484", "text": "func (o *DeleteMealParams) WithContext(ctx context.Context) *DeleteMealParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "b49ef5804fb391a6aefddfba43962c6b", "score": "0.5013216", "text": "func (o *DeletePrivateBlueprintParams) WithContext(ctx context.Context) *DeletePrivateBlueprintParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "8f0343de1380a36797f9d4dcc1dd2fc6", "score": "0.49994728", "text": "func (m *MockEC2) DeleteIpamWithContext(arg0 context.Context, arg1 *ec2.DeleteIpamInput, arg2 ...request.Option) (*ec2.DeleteIpamOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"DeleteIpamWithContext\", varargs...)\n\tret0, _ := ret[0].(*ec2.DeleteIpamOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "2b0640f260a196d17a7e9f699f298864", "score": "0.49934152", "text": "func (mr *MockEC2MockRecorder) DeregisterInstanceEventNotificationAttributesWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeregisterInstanceEventNotificationAttributesWithContext\", reflect.TypeOf((*MockEC2)(nil).DeregisterInstanceEventNotificationAttributesWithContext), varargs...)\n}", "title": "" }, { "docid": "86c9237b1c5bbc9c911232afabbe5c95", "score": "0.4947212", "text": "func (c Client) DeleteWithContext(context context.Context) error {\n\top := client.Operation{\n\t\tMethod: http.MethodDelete,\n\t\tURI: \"/Services/{sid}\",\n\t\tPathParams: map[string]string{\n\t\t\t\"sid\": c.sid,\n\t\t},\n\t}\n\n\tif err := c.client.Send(context, op, nil, nil); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9ec540585848d8a83439472b7f6cc7ab", "score": "0.49450645", "text": "func (mr *MockEC2MockRecorder) DeleteIpamWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeleteIpamWithContext\", reflect.TypeOf((*MockEC2)(nil).DeleteIpamWithContext), varargs...)\n}", "title": "" }, { "docid": "0fe951e3d1544ea08866f281d9991ed7", "score": "0.49363184", "text": "func (m *ItemItemsExternalItemItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemItemsExternalItemItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "e59860759eccc6d4eabc0d7b023d688f", "score": "0.49331376", "text": "func (m *ServiceAnnouncementIssuesServiceHealthIssueItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ServiceAnnouncementIssuesServiceHealthIssueItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "b6d256aa0512fc314ad6e84de4fc1d95", "score": "0.49310791", "text": "func (m *AuthenticationEventListenersAuthenticationEventListenerItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *AuthenticationEventListenersAuthenticationEventListenerItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "359a1f637b21a50e5f0158535838dd40", "score": "0.4921821", "text": "func HTTPApplicationDataInfluenceDataInfluenceIdDelete(c *gin.Context) {\n\tc.JSON(http.StatusOK, gin.H{})\n\t// New HTTP request\n\treq := http_wrapper.NewRequest(c.Request, nil)\n\treq.Params[\"influenceId\"] = c.Params.ByName(\"influenceId\")\n\n\t// Handle request\n\trsp := producer.HandleApplicationDataInfluenceDataInfluenceIdDelete(req)\n\n\tif rsp.Body != nil {\n\t\t// Serialize response body\n\t\tresponseBody, err := openapi.Serialize(rsp.Body, \"application/json\")\n\t\tif err != nil {\n\t\t\tlogger.DataRepoLog.Errorln(err)\n\t\t\tproblemDetails := models.ProblemDetails{\n\t\t\t\tStatus: http.StatusInternalServerError,\n\t\t\t\tCause: \"SYSTEM_FAILURE\",\n\t\t\t\tDetail: err.Error(),\n\t\t\t}\n\t\t\tc.JSON(http.StatusInternalServerError, problemDetails)\n\t\t} else {\n\t\t\tc.Data(rsp.Status, \"application/json\", responseBody)\n\t\t}\n\t} else {\n\t\tc.Data(rsp.Status, \"\", nil)\n\t}\n}", "title": "" }, { "docid": "94a14024bb9b726da49f545b708954ce", "score": "0.49208286", "text": "func (_m *MockDynamoDBAPI) DeleteTableWithContext(_param0 aws.Context, _param1 *dynamodb.DeleteTableInput, _param2 ...request.Option) (*dynamodb.DeleteTableOutput, error) {\n\t_s := []interface{}{_param0, _param1}\n\tfor _, _x := range _param2 {\n\t\t_s = append(_s, _x)\n\t}\n\tret := _m.ctrl.Call(_m, \"DeleteTableWithContext\", _s...)\n\tret0, _ := ret[0].(*dynamodb.DeleteTableOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "1370b935631ecd8a5ac975372b524b25", "score": "0.49148703", "text": "func (m *ItemListItemsListItemItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemListItemsListItemItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "5f5be30310f86e28be3eebe4a9b476cb", "score": "0.49146014", "text": "func (m *ItemOnenoteRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemOnenoteRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "bbbd537cba9c70c4ba00a810a17aa79c", "score": "0.49122208", "text": "func (rb *ByProjectKeyInventoryByIDRequestBuilder) Delete() *ByProjectKeyInventoryByIDRequestMethodDelete {\n\treturn &ByProjectKeyInventoryByIDRequestMethodDelete{\n\t\turl: fmt.Sprintf(\"/%s/inventory/%s\", rb.projectKey, rb.id),\n\t\tclient: rb.client,\n\t}\n}", "title": "" }, { "docid": "7680a334c405bd5569abdbe2a68a333c", "score": "0.49102032", "text": "func (m *ItemOnlineMeetingsItemAttendanceReportsMeetingAttendanceReportItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemOnlineMeetingsItemAttendanceReportsMeetingAttendanceReportItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "00e6e3a13a5b522b39cd74b46608db30", "score": "0.49096805", "text": "func (o *IgroupDeleteParams) WithContext(ctx context.Context) *IgroupDeleteParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "4200c42f95b88c3175648da56f134cbd", "score": "0.48911467", "text": "func (m *UserExperienceAnalyticsBatteryHealthAppImpactUserExperienceAnalyticsBatteryHealthAppImpactItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsBatteryHealthAppImpactUserExperienceAnalyticsBatteryHealthAppImpactItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "75347519d8bac7c06c6dc3e0eedc441b", "score": "0.48905948", "text": "func (m *ItemListsListItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemListsListItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "d6953434b0de50a4fdc4a69618223992", "score": "0.48905063", "text": "func (o *DeleteSimulationDevicesIDParams) WithContext(ctx context.Context) *DeleteSimulationDevicesIDParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "3934e25327f3c585d53345cc0156534f", "score": "0.4880593", "text": "func funderDELETE(ctx context.Context, w http.ResponseWriter, r *http.Request) {\n\t//funderid := c.Param(\"funderid\")\n}", "title": "" }, { "docid": "9a412e6860b6ffaddf77c6228670befb", "score": "0.4876321", "text": "func (m *MockEC2) DeregisterInstanceEventNotificationAttributesWithContext(arg0 context.Context, arg1 *ec2.DeregisterInstanceEventNotificationAttributesInput, arg2 ...request.Option) (*ec2.DeregisterInstanceEventNotificationAttributesOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"DeregisterInstanceEventNotificationAttributesWithContext\", varargs...)\n\tret0, _ := ret[0].(*ec2.DeregisterInstanceEventNotificationAttributesOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "f681f66b77a12ba7ef005ae3d96c071b", "score": "0.48756707", "text": "func (mr *MockEC2MockRecorder) DeleteIpamResourceDiscoveryWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeleteIpamResourceDiscoveryWithContext\", reflect.TypeOf((*MockEC2)(nil).DeleteIpamResourceDiscoveryWithContext), varargs...)\n}", "title": "" }, { "docid": "5d51e426c9f09cd99fa62582cd3f287f", "score": "0.48679876", "text": "func (mr *MockEC2MockRecorder) DeleteTransitGatewayRouteTableAnnouncementWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeleteTransitGatewayRouteTableAnnouncementWithContext\", reflect.TypeOf((*MockEC2)(nil).DeleteTransitGatewayRouteTableAnnouncementWithContext), varargs...)\n}", "title": "" }, { "docid": "21ed762d1f78d449355c22325b5546cf", "score": "0.4865828", "text": "func (o *DeleteAssetManagedDevicesMoidParams) WithContext(ctx context.Context) *DeleteAssetManagedDevicesMoidParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "b47d5d5ae373064ed9e97702314e7a9a", "score": "0.4860737", "text": "func (m *UserExperienceAnalyticsAppHealthApplicationPerformanceUserExperienceAnalyticsAppHealthApplicationPerformanceItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsAppHealthApplicationPerformanceUserExperienceAnalyticsAppHealthApplicationPerformanceItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "060549331fe3024d820ce27c02571ebf", "score": "0.485608", "text": "func (m *ItemOnlineMeetingsOnlineMeetingItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemOnlineMeetingsOnlineMeetingItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "4b71410dc9c3685dda1eff1af6f3cdba", "score": "0.4854778", "text": "func (o *DeleteFileParams) WithContext(ctx context.Context) *DeleteFileParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "46af20408a62fffed22a5da79276e9ff", "score": "0.48435473", "text": "func (c *metadataRESTClient) DeleteContext(ctx context.Context, req *aiplatformpb.DeleteContextRequest, opts ...gax.CallOption) (*DeleteContextOperation, error) {\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v1beta1/%v\", req.GetName())\n\n\tparams := url.Values{}\n\tif req.GetEtag() != \"\" {\n\t\tparams.Add(\"etag\", fmt.Sprintf(\"%v\", req.GetEtag()))\n\t}\n\tif req.GetForce() {\n\t\tparams.Add(\"force\", fmt.Sprintf(\"%v\", req.GetForce()))\n\t}\n\n\tbaseUrl.RawQuery = params.Encode()\n\n\t// Build HTTP headers from client and context metadata.\n\thds := []string{\"x-goog-request-params\", fmt.Sprintf(\"%s=%v\", \"name\", url.QueryEscape(req.GetName()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &longrunningpb.Operation{}\n\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"DELETE\", baseUrl.String(), nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbuf, err := io.ReadAll(httpRsp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}, opts...)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\toverride := fmt.Sprintf(\"/ui/%s\", resp.GetName())\n\treturn &DeleteContextOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, resp),\n\t\tpollPath: override,\n\t}, nil\n}", "title": "" }, { "docid": "792514c003ee4076b53a4a75b8e205fd", "score": "0.48394915", "text": "func (o *DeleteImplementationVersionParams) WithContext(ctx context.Context) *DeleteImplementationVersionParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "5241df1471b6e11ad63606a0a773924b", "score": "0.4831408", "text": "func (o *DeleteUsingDELETE6Params) WithContext(ctx context.Context) *DeleteUsingDELETE6Params {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "5f15f5d38263158c442b59a15723f28b", "score": "0.48297936", "text": "func (m *ThreatIntelligenceVulnerabilitiesItemComponentsVulnerabilityComponentItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ThreatIntelligenceVulnerabilitiesItemComponentsVulnerabilityComponentItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "3cd065f5e80922c91f73d6ff94e81fcc", "score": "0.48235038", "text": "func (m *UserExperienceAnalyticsAppHealthApplicationPerformanceByOSVersionUserExperienceAnalyticsAppHealthAppPerformanceByOSVersionItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsAppHealthApplicationPerformanceByOSVersionUserExperienceAnalyticsAppHealthAppPerformanceByOSVersionItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "56215c6801da850908b6594cd0e1f923", "score": "0.48172066", "text": "func (m *ItemItemsItemWorkbookWorksheetsItemNamesWorkbookNamedItemItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemItemsItemWorkbookWorksheetsItemNamesWorkbookNamedItemItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "0d801b86bfeef8be33b12ac3eb853674", "score": "0.4812039", "text": "func (m *ItemAgentGroupsItemPublishedResourcesItemAgentGroupsItemRefRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemAgentGroupsItemPublishedResourcesItemAgentGroupsItemRefRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n if requestConfiguration.QueryParameters != nil {\n requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters))\n }\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "14106cd38d90602266061a5a00218bcf", "score": "0.48101816", "text": "func Delete() gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\t\ttoken := oauth2.Token(c.Request.Header.Get(\"Authorization\"))\n\t\tbody := new(struct {\n\t\t\tID string `json:\"id\"`\n\t\t})\n\t\tresp := new(struct {\n\t\t\tError string `json:\"error,omitempty\"`\n\t\t})\n\n\t\tif err := json.NewDecoder(c.Request.Body).Decode(body); err != nil {\n\t\t\tresp.Error = err.Error()\n\t\t\tc.JSON(http.StatusBadRequest, resp)\n\t\t\treturn\n\t\t}\n\n\t\tif err := token.Valid(); err != nil {\n\t\t\tresp.Error = err.Error()\n\t\t\tc.JSON(http.StatusUnauthorized, resp)\n\t\t\treturn\n\t\t}\n\n\t\tif role, err := token.Role(); err != nil {\n\t\t\tresp.Error = err.Error()\n\t\t\tc.JSON(http.StatusInternalServerError, resp)\n\t\t\treturn\n\t\t} else if !role.ActivityManagement {\n\t\t\tresp.Error = member.ErrPermissionDenied.Error()\n\t\t\tc.JSON(http.StatusForbidden, resp)\n\t\t\treturn\n\t\t}\n\n\t\tif objectID, err := primitive.ObjectIDFromHex(body.ID); err != nil {\n\t\t\tresp.Error = err.Error()\n\t\t\tc.JSON(http.StatusInternalServerError, resp)\n\t\t} else if err = activity.Delete(objectID); err != nil {\n\t\t\tresp.Error = err.Error()\n\t\t\tc.JSON(http.StatusInternalServerError, resp)\n\t\t} else {\n\t\t\tc.JSON(http.StatusOK, resp)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "73934414fb47dd2f20d086a842421210", "score": "0.48044723", "text": "func (mr *MockEC2MockRecorder) DeleteTransitGatewayPeeringAttachmentWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeleteTransitGatewayPeeringAttachmentWithContext\", reflect.TypeOf((*MockEC2)(nil).DeleteTransitGatewayPeeringAttachmentWithContext), varargs...)\n}", "title": "" }, { "docid": "650c3384262e3234e74a60666b6c3ed5", "score": "0.4802193", "text": "func (o *DeleteInvoiceParams) WithContext(ctx context.Context) *DeleteInvoiceParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "ec87458101a291742f104a97cdc5923c", "score": "0.48006785", "text": "func (s *Cloudinary) DeleteCtx(ctx context.Context, filepath string) error {\n\tsignature, timestamp := s.signature(filepath, true)\n\tform := url.Values{\n\t\t\"api_key\": []string{s.apiKey},\n\t\t\"public_id\": []string{filepath},\n\t\t\"timestamp\": []string{timestamp},\n\t\t\"signature\": []string{signature},\n\t\t\"invalidate\": []string{\"true\"},\n\t}\n\n\tfor _, typ := range fileTypes {\n\t\tendpointURL := fmt.Sprintf(\"%s/destroy\", s.apiBaseURL(typ))\n\t\terr := s.execDelete(endpointURL, strings.NewReader(form.Encode()))\n\t\tif err == os.ErrNotExist {\n\t\t\tcontinue\n\t\t}\n\t\treturn err\n\t}\n\n\treturn os.ErrNotExist\n}", "title": "" }, { "docid": "f3e86b6dc685dba51c560fefe2bd809c", "score": "0.48000386", "text": "func (o *DeleteHistoryEntriesParams) WithContext(ctx context.Context) *DeleteHistoryEntriesParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "608751d1f5d02fbe349a4e8bf6ebf301", "score": "0.4799823", "text": "func DeleteIssueById(c *gin.Context) {\n\n}", "title": "" }, { "docid": "04cdf8c6c4b85e33cba9c1aba390ac9f", "score": "0.47959805", "text": "func (m *UserExperienceAnalyticsBatteryHealthDevicePerformanceUserExperienceAnalyticsBatteryHealthDevicePerformanceItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsBatteryHealthDevicePerformanceUserExperienceAnalyticsBatteryHealthDevicePerformanceItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "9707ad5b249e587f8d7f122fba018aaa", "score": "0.47881615", "text": "func (m *EntitlementManagementResourceRoleScopesItemScopeRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementResourceRoleScopesItemScopeRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "84f77c0eb970c789af6c43cec2213a66", "score": "0.4785763", "text": "func (_obj *Apiaccount) Account_deleteAccountWithContext(tarsCtx context.Context, params *TLaccount_deleteAccount, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"account_deleteAccount\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "877275652e07fd49e85f1f9ba4f3ea4d", "score": "0.478469", "text": "func (o *DeleteGreetingParams) WithContext(ctx context.Context) *DeleteGreetingParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "c5efb3172b4898dcf652d9f082820db5", "score": "0.47824144", "text": "func (c *DrivesDeleteCall) Context(ctx context.Context) *DrivesDeleteCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "6cdb5d42681959ff319f0e0f4dda64a5", "score": "0.47769022", "text": "func (o *RedirectUsingDELETEParams) WithContext(ctx context.Context) *RedirectUsingDELETEParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "ee4ee29acb3480f2ec8336035304873d", "score": "0.47767225", "text": "func (m *AttachmentBaseItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *AttachmentBaseItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.requestAdapter.SendNoContentAsync(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "014524109270f8f5ceb09bb608a46c2d", "score": "0.47726613", "text": "func (m *MobileAppTroubleshootingEventsMobileAppTroubleshootingEventItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *MobileAppTroubleshootingEventsMobileAppTroubleshootingEventItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "4ea1ddd4a827668be46667d60a7d617b", "score": "0.47618172", "text": "func (o *DeleteRoomParams) WithContext(ctx context.Context) *DeleteRoomParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "40b2064a0d1c1c5713f9d730be5b4645", "score": "0.4759178", "text": "func (m *EdiscoveryCasesItemTagsTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EdiscoveryCasesItemTagsTagItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "4045d21f3d677de2f2f734821df893d4", "score": "0.47574627", "text": "func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, extensionID string, farmBeatsResourceName string, resourceGroupName string, options *ExtensionsDeleteOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}\"\n\tif extensionID == \"\" {\n\t\treturn nil, errors.New(\"parameter extensionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{extensionId}\", url.PathEscape(extensionID))\n\tif farmBeatsResourceName == \"\" {\n\t\treturn nil, errors.New(\"parameter farmBeatsResourceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{farmBeatsResourceName}\", url.PathEscape(farmBeatsResourceName))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-05-12-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "title": "" }, { "docid": "8c5046a15b0a5bc69f7c3b890817832e", "score": "0.47572312", "text": "func Delete(req handler.Request, prevModel *Model, currentModel *Model) (handler.ProgressEvent, error) {\n client, err := util.CreateMongoDBClient(*currentModel.ApiKeys.PublicKey, *currentModel.ApiKeys.PrivateKey)\n if err != nil {\n log.Printf(\"Delete - error err:%+v\",err)\n return handler.ProgressEvent{\n OperationStatus: handler.Failed,\n Message: err.Error(),\n HandlerErrorCode: cloudformation.HandlerErrorCodeInvalidRequest}, nil\n }\n\n if _, ok := req.CallbackContext[\"stateName\"]; ok {\n return validateProgress(client, currentModel, \"DELETED\")\n }\n\n projectId := *currentModel.ProjectId\n peerId := *currentModel.Id\n resp, err := client.Peers.Delete(context.Background(), projectId, peerId)\n if err != nil {\n if resp != nil && resp.StatusCode == 404 {\n log.Printf(\"Resource Not Found 404 for DELETE projectId:%s, peerID:%+v, err:%+v\", projectId, peerId, err)\n return handler.ProgressEvent{\n Message: err.Error(),\n OperationStatus: handler.Failed,\n HandlerErrorCode: cloudformation.HandlerErrorCodeNotFound}, nil\n } else {\n log.Printf(\"Error DELETE projectId:%s, err:%+v\", projectId, err)\n return handler.ProgressEvent{\n Message: err.Error(),\n OperationStatus: handler.Failed,\n HandlerErrorCode: cloudformation.HandlerErrorCodeServiceInternalError}, nil\n }\n }\n\n return handler.ProgressEvent{\n OperationStatus: handler.InProgress,\n Message: \"Delete Inprogess\",\n ResourceModel: currentModel,\n CallbackDelaySeconds: 10,\n CallbackContext: map[string]interface{}{\n \"stateName\": \"DELETING\",\n },\n }, nil\n}", "title": "" }, { "docid": "cb0b288120bd340752c2d06c4eb7a8e6", "score": "0.47446367", "text": "func (m *ItemCalendarEventsEventItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemCalendarEventsEventItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "f5cb71a39a47c482bdcc74d20c2fd7da", "score": "0.47409666", "text": "func (m *ItemSitesItemOnenoteNotebooksNotebookItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemSitesItemOnenoteNotebooksNotebookItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "35ea7d8500e40e65172b19262b01ebcb", "score": "0.47392654", "text": "func (m *UsersEducationUserItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UsersEducationUserItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "133728d2c360d9715e7f21c0c337d2dd", "score": "0.47354576", "text": "func (client *FleetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginDeleteOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif fleetName == \"\" {\n\t\treturn nil, errors.New(\"parameter fleetName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{fleetName}\", url.PathEscape(fleetName))\n\treq, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-03-15-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\tif options != nil && options.IfMatch != nil {\n\t\treq.Raw().Header[\"If-Match\"] = []string{*options.IfMatch}\n\t}\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "title": "" }, { "docid": "67edcf04797152f4297640ff3a689036", "score": "0.4734032", "text": "func (r *WindowsInformationProtectionAppLockerFileRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "e308edd62f4a4c20ab0b5c70a34e496a", "score": "0.47337493", "text": "func (m *ItemTermStoreRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTermStoreRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "d78ab0e490413c1ac5ab0d3c69697213", "score": "0.47309613", "text": "func (track *SoundTrack) DeleteInContext(ctx aero.Context) error {\n\tuser := GetUserFromContext(ctx)\n\n\t// Write log entry\n\tlogEntry := NewEditLogEntry(user.ID, \"delete\", \"SoundTrack\", track.ID, \"\", fmt.Sprint(track), \"\")\n\tlogEntry.Save()\n\n\treturn track.Delete()\n}", "title": "" }, { "docid": "a6bade210ea0b7ee2706286a030b807d", "score": "0.4720897", "text": "func (iter *DeletedStorageListResultIterator) NextWithContext(ctx context.Context) (err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/DeletedStorageListResultIterator.NextWithContext\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif iter.Response().Response.Response != nil {\n\t\t\t\tsc = iter.Response().Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\titer.i++\n\tif iter.i < len(iter.page.Values()) {\n\t\treturn nil\n\t}\n\terr = iter.page.NextWithContext(ctx)\n\tif err != nil {\n\t\titer.i--\n\t\treturn err\n\t}\n\titer.i = 0\n\treturn nil\n}", "title": "" }, { "docid": "cef5cd1b64799b3a79e7f7444fcae2e0", "score": "0.47183055", "text": "func (m *AutopilotEventsDeviceManagementAutopilotEventItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *AutopilotEventsDeviceManagementAutopilotEventItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "39d1c126370462d67579ee8cbe4808f9", "score": "0.47149244", "text": "func (m *ItemTermStoreSetsItemChildrenTermItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTermStoreSetsItemChildrenTermItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "4dd6f4df60ba73cdf379e60dd9f8ebc7", "score": "0.47052836", "text": "func (_m *MockDynamoDBAPI) DeleteItemWithContext(_param0 aws.Context, _param1 *dynamodb.DeleteItemInput, _param2 ...request.Option) (*dynamodb.DeleteItemOutput, error) {\n\t_s := []interface{}{_param0, _param1}\n\tfor _, _x := range _param2 {\n\t\t_s = append(_s, _x)\n\t}\n\tret := _m.ctrl.Call(_m, \"DeleteItemWithContext\", _s...)\n\tret0, _ := ret[0].(*dynamodb.DeleteItemOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "8f0abc27eaf9e4b509ed11d71f64e464", "score": "0.4703307", "text": "func (m *MockEC2) DeleteTransitGatewayRouteTableAnnouncementWithContext(arg0 context.Context, arg1 *ec2.DeleteTransitGatewayRouteTableAnnouncementInput, arg2 ...request.Option) (*ec2.DeleteTransitGatewayRouteTableAnnouncementOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"DeleteTransitGatewayRouteTableAnnouncementWithContext\", varargs...)\n\tret0, _ := ret[0].(*ec2.DeleteTransitGatewayRouteTableAnnouncementOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "17439951172cdf49f9edbd3a1707acc4", "score": "0.47010064", "text": "func (m *PrintersItemTaskTriggersPrintTaskTriggerItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *PrintersItemTaskTriggersPrintTaskTriggerItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "69cc3ed05a95dfcdfb15934f372efac3", "score": "0.47004494", "text": "func (m *ItemMobileAppTroubleshootingEventsItemAppLogCollectionRequestsAppLogCollectionRequestItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemMobileAppTroubleshootingEventsItemAppLogCollectionRequestsAppLogCollectionRequestItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "f8c9bc7490b0f548d7b63a484df6c0b2", "score": "0.4693888", "text": "func (m *UsersEducationUserItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UsersEducationUserItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "4cd3898089137f30b657c371ba49c7b9", "score": "0.46886247", "text": "func (m *ItemProfileCertificationsPersonCertificationItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemProfileCertificationsPersonCertificationItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "42d865cae54ca482f469e5d7d17a5870", "score": "0.4686818", "text": "func (m *BookingBusinessesItemAppointmentsBookingAppointmentItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *BookingBusinessesItemAppointmentsBookingAppointmentItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "a03d526f07d7381383359f12f3a2252a", "score": "0.46852052", "text": "func (o *DeleteElfImageParams) WithRequestBody(requestBody *models.ElfImageDeletionParams) *DeleteElfImageParams {\n\to.SetRequestBody(requestBody)\n\treturn o\n}", "title": "" }, { "docid": "9915895540df851adc72bd003ec902bc", "score": "0.4684768", "text": "func (m *PrintServiceEndpointItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *PrintServiceEndpointItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.requestAdapter.SendNoContentAsync(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "fc841d5504885ea80dc79413dc5cc75d", "score": "0.4675971", "text": "func (m *RoleManagementAlertsAlertDefinitionsUnifiedRoleManagementAlertDefinitionItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *RoleManagementAlertsAlertDefinitionsUnifiedRoleManagementAlertDefinitionItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "4e9284fc7cd1ec95cf8b4b66c2a72fcf", "score": "0.4674221", "text": "func (m *UserExperienceAnalyticsDeviceStartupProcessPerformanceUserExperienceAnalyticsDeviceStartupProcessPerformanceItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsDeviceStartupProcessPerformanceUserExperienceAnalyticsDeviceStartupProcessPerformanceItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "2c3a0f4c4b9aa5e3490e9425b08fdbdf", "score": "0.46724612", "text": "func (m *EntitlementManagementAccessPackageResourceRoleScopesAccessPackageResourceRoleScopeItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageResourceRoleScopesAccessPackageResourceRoleScopeItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "c4d2188a42e598cd17bf49ab9745b0ed", "score": "0.46721256", "text": "func (m *ItemMailFoldersItemChildFoldersMailFolderItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemMailFoldersItemChildFoldersMailFolderItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "b2d2878a272d4ba8d3fa5d12605bac24", "score": "0.46715325", "text": "func (m *CompaniesItemPurchaseInvoiceLinesItemItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *CompaniesItemPurchaseInvoiceLinesItemItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "ba7034694b87fda0a778437c3f0b3309", "score": "0.46693423", "text": "func (m *TeamItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *TeamItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" } ]
f31e75a5a4101c6f1a93cadef93ae7e9
AddPlatformHook registers your hook function for all future operations.
[ { "docid": "40365880274bb286ae995a19bdfd2171", "score": "0.7462133", "text": "func AddPlatformHook(hookPoint boil.HookPoint, platformHook PlatformHook) {\n\tswitch hookPoint {\n\tcase boil.BeforeInsertHook:\n\t\tplatformBeforeInsertHooks = append(platformBeforeInsertHooks, platformHook)\n\tcase boil.BeforeUpdateHook:\n\t\tplatformBeforeUpdateHooks = append(platformBeforeUpdateHooks, platformHook)\n\tcase boil.BeforeDeleteHook:\n\t\tplatformBeforeDeleteHooks = append(platformBeforeDeleteHooks, platformHook)\n\tcase boil.BeforeUpsertHook:\n\t\tplatformBeforeUpsertHooks = append(platformBeforeUpsertHooks, platformHook)\n\tcase boil.AfterInsertHook:\n\t\tplatformAfterInsertHooks = append(platformAfterInsertHooks, platformHook)\n\tcase boil.AfterSelectHook:\n\t\tplatformAfterSelectHooks = append(platformAfterSelectHooks, platformHook)\n\tcase boil.AfterUpdateHook:\n\t\tplatformAfterUpdateHooks = append(platformAfterUpdateHooks, platformHook)\n\tcase boil.AfterDeleteHook:\n\t\tplatformAfterDeleteHooks = append(platformAfterDeleteHooks, platformHook)\n\tcase boil.AfterUpsertHook:\n\t\tplatformAfterUpsertHooks = append(platformAfterUpsertHooks, platformHook)\n\t}\n}", "title": "" } ]
[ { "docid": "843e76dc440f47b784a31e0444f0b836", "score": "0.630606", "text": "func AddHook(h Hook) error {\n\treturn std.AddHook(h)\n}", "title": "" }, { "docid": "376d0c82f8f598bf2c303eacb664549b", "score": "0.6114311", "text": "func (c *Base) AddHook(hook Hook) error {\n\tfor _, h := range c.hooks {\n\t\tif h == hook {\n\t\t\treturn errors.New(\"Given hook is already installed in the current controller\")\n\t\t}\n\t}\n\tc.hooks = append(c.hooks, hook)\n\treturn nil\n}", "title": "" }, { "docid": "d83a89392eaf1f4971a0c4f45d55c299", "score": "0.60672414", "text": "func (f *FeatureFlagStoreGetGlobalFeatureFlagsFunc) PushHook(hook func(context.Context) (map[string]bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "5ef46f14642ce1182a5f84f595954d34", "score": "0.6059179", "text": "func (f *FeatureFlagStoreCreateRolloutFunc) PushHook(hook func(context.Context, string, int32) (*featureflag.FeatureFlag, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "3d08eba1881337172c8ad3ab58cfb2e7", "score": "0.60525846", "text": "func AddHook(hook lg.Hook) {\n\tlogf.AddHook(hook)\n}", "title": "" }, { "docid": "c7b5d8d0dda87686b01efbee1cf186ff", "score": "0.6020518", "text": "func (f *FeatureFlagStoreHandleFunc) PushHook(hook func() *basestore.TransactableHandle) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "a6816e430adf96c46e35124a3c06182f", "score": "0.6008882", "text": "func (f *FeatureFlagStoreUpdateOverrideFunc) PushHook(hook func(context.Context, *int32, *int32, string, bool) (*featureflag.Override, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "6d551530e043487724fcc9c90917efd4", "score": "0.5986661", "text": "func (f *ReposStoreTouchFunc) PushHook(hook func(context.Context, int64) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "395fb5d3802adfb35bf21635214b30f6", "score": "0.5971077", "text": "func (f *PermsStoreSetRepoPermsFunc) PushHook(hook func(context.Context, int64, map[int64]db.AccessMode) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "2b9238093a00b2ded34f2d0544a6f666", "score": "0.59669954", "text": "func (f *FeatureFlagStoreGetOrgFeatureFlagFunc) PushHook(hook func(context.Context, int32, string) (bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "f3572510afd6998e98f870e26d0ffd7a", "score": "0.5939741", "text": "func (f *LSIFStoreDefinitionsFunc) PushHook(hook func(context.Context, int, string, int, int, int, int) ([]lsifstore.Location, int, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "52da570971f44a5d7edd025cf7783162", "score": "0.5934706", "text": "func (f *LSIFStoreDiagnosticsFunc) PushHook(hook func(context.Context, int, string, int, int) ([]lsifstore.Diagnostic, int, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "bbf32ba69129d523c1ea16410a02ba11", "score": "0.5919713", "text": "func (f *FeatureFlagStoreTransactFunc) PushHook(hook func(context.Context) (database.FeatureFlagStore, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "52e87f0c12f1fea5a73d439c04505ee1", "score": "0.59110916", "text": "func (f *TwoFactorsStoreIsEnabledFunc) PushHook(hook func(context.Context, int64) bool) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "87abb97b82966b2f97547913e231a9de", "score": "0.58985615", "text": "func (f *TwoFactorsStoreCreateFunc) PushHook(hook func(context.Context, int64, string, string) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "4fa5b3651b9e0f6c28cd7897463fda8a", "score": "0.5896874", "text": "func (f *SoftcopyClientCreateFileFunc) PushHook(hook func(context.Context, *proto.CreateFileRequest, ...grpc.CallOption) (*proto.CreateFileResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "9cbad4de79acaebbeeb5c043df6fa50d", "score": "0.58893955", "text": "func (f *FeatureFlagStoreCreateFeatureFlagFunc) PushHook(hook func(context.Context, *featureflag.FeatureFlag) (*featureflag.FeatureFlag, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "21c89f640e593df5db1337360d877de9", "score": "0.58831924", "text": "func (f *LSIFStoreDocumentationDefinitionsFunc) PushHook(hook func(context.Context, int, string, int, int) ([]lsifstore.Location, int, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "31886b7b52a7b0bf0e616fcd91477b04", "score": "0.5876379", "text": "func (f *FeatureFlagStoreCreateOverrideFunc) PushHook(hook func(context.Context, *featureflag.Override) (*featureflag.Override, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "80988c034b5ecef372b0af7ea04c1c6f", "score": "0.58756405", "text": "func (f *FeatureFlagStoreDeleteOverrideFunc) PushHook(hook func(context.Context, *int32, *int32, string) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "503b87356fe9d9966f397d8ee48fcb84", "score": "0.5863963", "text": "func (f *FeatureFlagStoreGetFeatureFlagsFunc) PushHook(hook func(context.Context) ([]*featureflag.FeatureFlag, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "d9feae51e9ddc2055a6f492cd6401da6", "score": "0.58585024", "text": "func AddHook(name string, hook HookFunc) error {\n\treturn dl.AddHook(name, hook)\n}", "title": "" }, { "docid": "f8ee03a36a0ad307436cf84ca4bfb57d", "score": "0.5857477", "text": "func (f *LSIFStoreMonikersByPositionFunc) PushHook(hook func(context.Context, int, string, int, int) ([][]semantic.MonikerData, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "0a64fd35885c1115782ffa34933e262a", "score": "0.5851119", "text": "func (f *FeatureFlagStoreGetFeatureFlagFunc) PushHook(hook func(context.Context, string) (*featureflag.FeatureFlag, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "79a818224fcaa744578a35823d4fa56a", "score": "0.5847751", "text": "func (f *QueryResolverDiagnosticsFunc) PushHook(hook func(context.Context, int) ([]resolvers.AdjustedDiagnostic, int, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "d413ce6b75bb41ef18ab8e759ccb4a38", "score": "0.5843224", "text": "func (f *SoftcopyClientGetFileMonthsFunc) PushHook(hook func(context.Context, *proto.GetFileMonthsRequest, ...grpc.CallOption) (*proto.GetFileMonthsResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "e64b306460826c5c0e327681b94599be", "score": "0.58356667", "text": "func RegisterHook(name string, hook Hook) {\n\tRegisteredHooks[name] = hook\n}", "title": "" }, { "docid": "43439f725a366ca87fa1ba130c3a7921", "score": "0.58353144", "text": "func (f *AccessTokensStoreTouchFunc) PushHook(hook func(context.Context, int64) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "4c1ab1a129ae7b9b8b62ab33f12f2dc8", "score": "0.5823529", "text": "func (f *LSIFStoreDocumentationPathInfoFunc) PushHook(hook func(context.Context, int, string) (*semantic.DocumentationPathInfoData, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "75d3fbfa76c0612422a8d83f4d2b3a36", "score": "0.5821778", "text": "func (f *FeatureFlagStoreUpdateFeatureFlagFunc) PushHook(hook func(context.Context, *featureflag.FeatureFlag) (*featureflag.FeatureFlag, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "194f76312f2c8790a20a0b72749a6517", "score": "0.5816237", "text": "func (f *LSIFStoreDocumentationPageFunc) PushHook(hook func(context.Context, int, string) (*semantic.DocumentationPageData, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "a67339d603b30befb3a16edcf045bd5f", "score": "0.5810573", "text": "func (f *LSIFStorePackageInformationFunc) PushHook(hook func(context.Context, int, string, string) (semantic.PackageInformationData, bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "d66f88bb22fbcaae6dd5d8b3449f3e17", "score": "0.5810016", "text": "func (f *SoftcopyClientFindTagByNameFunc) PushHook(hook func(context.Context, *proto.FindTagByNameRequest, ...grpc.CallOption) (*proto.FindTagByNameResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "e3303887c8b13614109f0438ead2a38a", "score": "0.5805817", "text": "func (f *QueryResolverDefinitionsFunc) PushHook(hook func(context.Context, int, int) ([]resolvers.AdjustedLocation, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "f14b644e230c6031e2086a984c0d3486", "score": "0.5788101", "text": "func (f *LFSStoreCreateObjectFunc) PushHook(hook func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "ab8a3d6e6f2de725448890c21961a55f", "score": "0.5782832", "text": "func (f *LSIFStoreDocumentationAtPositionFunc) PushHook(hook func(context.Context, int, string, int, int) ([]string, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "62ae65691b7a182c4c6bb5b341d745ea", "score": "0.57821584", "text": "func (f *EnqueuerDBStoreDirtyRepositoriesFunc) PushHook(hook func(context.Context) (map[int]int, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "1378ea500419e9378a5b3a27366a4e99", "score": "0.57764363", "text": "func (f *WorkerSpecFinalizerTickFunc) PushHook(hook func(context.Context) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "56e1e5f481f14d843e669d806a9b5a8a", "score": "0.57598186", "text": "func (f *QueryResolverDocumentationDefinitionsFunc) PushHook(hook func(context.Context, string) ([]resolvers.AdjustedLocation, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "29ae84c36f1a2b3413ccf7b059e73d13", "score": "0.5756761", "text": "func (f *FeatureFlagStoreGetOrgOverrideForFlagFunc) PushHook(hook func(context.Context, int32, string) (*featureflag.Override, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "a6fffad9c37d7ddf0dd7463ceab87a7e", "score": "0.57553005", "text": "func (f *QueryResolverDocumentationPageFunc) PushHook(hook func(context.Context, string) (*semantic.DocumentationPageData, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "2c064607ccabe31880638bdfc581573e", "score": "0.57507706", "text": "func AddInstallHook(h InstallHook) {\n\tinstallHooks = append(installHooks, h)\n}", "title": "" }, { "docid": "81035f14a4c0443a0e348ce6c539a60c", "score": "0.5746598", "text": "func (lt *LocalTransport) RegisterHook(th TransportHook) {\n}", "title": "" }, { "docid": "0cf941f1654e4dc1bf1e3586bb6374fb", "score": "0.5736418", "text": "func (f *PermsStoreAccessModeFunc) PushHook(hook func(context.Context, int64, int64, db.AccessModeOptions) db.AccessMode) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "8d7759446e46c8c6070d60a8695bc2a6", "score": "0.5734984", "text": "func (f *SoftcopyClientUpdateFileTagsFunc) PushHook(hook func(context.Context, *proto.UpdateFileTagsRequest, ...grpc.CallOption) (*proto.UpdateFileTagsResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "c11920bf71ff8f382e88f3de7ede1bcf", "score": "0.573469", "text": "func (f *ReposStoreHasForkedByFunc) PushHook(hook func(context.Context, int64, int64) bool) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "18506e2770a1c10cc95b6271ca0c2799", "score": "0.572817", "text": "func (f *SoftcopyClientGetFileYearsFunc) PushHook(hook func(context.Context, *proto.GetFileYearsRequest, ...grpc.CallOption) (*proto.GetFileYearsResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "05f230f1bbc5073fff74e5fa147b09f0", "score": "0.57212114", "text": "func (f *SoftcopyClientWriteFileFunc) PushHook(hook func(context.Context, *proto.WriteFileRequest, ...grpc.CallOption) (*proto.WriteFileResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "f9f51979e72e94b1c0efb6c2b5408714", "score": "0.57166225", "text": "func (f *SoftcopyClientFindFilesWithDateFunc) PushHook(hook func(context.Context, *proto.FindFilesWithDateRequest, ...grpc.CallOption) (*proto.FindFilesWithDateResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "9c127ec29825cb2be96dd701f3b1a1bc", "score": "0.57162833", "text": "func (f *ReposStoreWatchFunc) PushHook(hook func(context.Context, int64, int64) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "b187a560c3da9dec642d5b4395e92b52", "score": "0.57156825", "text": "func (f *QueryResolverDocumentationPathInfoFunc) PushHook(hook func(context.Context, string) (*semantic.DocumentationPathInfoData, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "d109ac6df98424ec1ed84d1eeb72d09b", "score": "0.57079583", "text": "func AddHook(hook log.Hook) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tLogger.Hooks.Add(hook)\n}", "title": "" }, { "docid": "12f7949f4f55121c24403926c680b553", "score": "0.57025987", "text": "func (f *DBStoreRepoNameFunc) PushHook(hook func(context.Context, int) (string, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "9df685073df616f97452775208721d69", "score": "0.5701989", "text": "func addHooks(appAppName string, path string) error {\n\tfor _, hook := range []string{\"pre-push\", \"post-commit\"} {\n\t\tvar cmd string\n\t\tswitch hook {\n\t\tcase \"pre-push\":\n\t\t\tcmd = fmt.Sprintf(\"%s repo hook $1\", appAppName)\n\t\tcase \"post-commit\":\n\t\t\tcmd = fmt.Sprintf(\"%s repo hook -c\", appAppName)\n\t\t}\n\n\t\t_ = os.Mkdir(filepath.Join(path, \"hooks\"), 0700)\n\t\tprePushFile := filepath.Join(path, \"hooks\", hook)\n\t\tif !util.IsFileOk(prePushFile) {\n\t\t\terr := ioutil.WriteFile(prePushFile, []byte(fmt.Sprintf(\"#!/bin/sh\\n%s\", cmd)), 0644)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif runtime.GOOS == \"windows\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\terr = exec.Command(\"sh\", \"-c\", \"chmod +x \"+prePushFile).Run()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tf, err := os.OpenFile(prePushFile, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0644)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Check if the hook command already exist in the file.\n\t\t// If it does, do not append again.\n\t\tscanner := bufio.NewScanner(f)\n\t\tfor scanner.Scan() {\n\t\t\t// ignore comment lines\n\t\t\tif line := scanner.Text(); line != \"\" && line[:1] == \"#\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif strings.Contains(scanner.Text(), \"repo hook\") {\n\t\t\t\t_ = f.Close()\n\t\t\t\tgoto end\n\t\t\t}\n\t\t}\n\t\tif scanner.Err() != nil {\n\t\t\t_ = f.Close()\n\t\t\treturn err\n\t\t}\n\t\t_, err = f.WriteString(\"\\n\" + cmd)\n\t\tif err != nil {\n\t\t\t_ = f.Close()\n\t\t\treturn err\n\t\t}\n\t\t_ = f.Close()\n\tend:\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "076a0a48ab8ff97da1f31e489e4fed29", "score": "0.5698883", "text": "func (f *SoftcopyClientGetFileWithDateFunc) PushHook(hook func(context.Context, *proto.GetFileWithDateRequest, ...grpc.CallOption) (*proto.GetFileWithDateResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "b47c771f76876920f6317057c3e3fd92", "score": "0.5696802", "text": "func (f *SoftcopyClientUpdateFileDateFunc) PushHook(hook func(context.Context, *proto.UpdateFileDateRequest, ...grpc.CallOption) (*proto.UpdateFileDateResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "d80ab825bed58ace9bea7783410e66e8", "score": "0.5692639", "text": "func (f *FeatureFlagStoreGetOverridesForFlagFunc) PushHook(hook func(context.Context, string) ([]*featureflag.Override, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "4bc7be9b4b2836c641db101a4de0b134", "score": "0.56909686", "text": "func (app *Application) RegisterHooks(k uint32, fns ...func() error) error {\n\thooks, ok := app.hooks[k]\n\tif ok {\n\t\thooks.Push(fns...)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"hook stage not found\")\n}", "title": "" }, { "docid": "b44392b2352649ea21a07226f761763b", "score": "0.5690566", "text": "func (f *LSIFStoreReferencesFunc) PushHook(hook func(context.Context, int, string, int, int, int, int) ([]lsifstore.Location, int, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "ae5cb9e1cc6b30ff40d10a04f1eb2301", "score": "0.56842726", "text": "func (f *EnqueuerGitserverClientHeadFunc) PushHook(hook func(context.Context, int) (string, bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "0ab41f19ad13b322ac6817fc33cf42ae", "score": "0.5677745", "text": "func (f *FeatureFlagStoreGetUserFlagsFunc) PushHook(hook func(context.Context, int32) (map[string]bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "160cd289a2560662c4a82aa1b2b44285", "score": "0.5676693", "text": "func (f *WorkerSpecFinalizerInitFunc) PushHook(hook func(context.Context) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "31203ce92de5dacf7de4831c11a8d90a", "score": "0.56750894", "text": "func (f *LFSStoreGetObjectByOIDFunc) PushHook(hook func(context.Context, int64, lfsutil.OID) (*db.LFSObject, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "344c2efb44cb8f27d944cbc0960bf59e", "score": "0.567195", "text": "func (f *DBStoreCommitGraphMetadataFunc) PushHook(hook func(context.Context, int) (bool, *time.Time, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "e44d239458c16bb39a49a29485ee9d39", "score": "0.56716484", "text": "func (f *SoftcopyClientCreateTagsFunc) PushHook(hook func(context.Context, *proto.CreateTagsRequest, ...grpc.CallOption) (*proto.CreateTagsResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "fbe3440dd334be8af6e91e158ef64ba7", "score": "0.5666228", "text": "func (f *LSIFStoreDocumentationReferencesFunc) PushHook(hook func(context.Context, int, string, int, int) ([]lsifstore.Location, int, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "e2a6cbc8c528aae5867b2db1d9b9e57e", "score": "0.5656699", "text": "func (api *Api) AddHook(wh account.Hook) {\n\tapi.store.UpsertHook(wh)\n}", "title": "" }, { "docid": "f6953c7d57cfd7c38cc68b2ac6a987ba", "score": "0.5654325", "text": "func (f *FeatureFlagStoreDeleteFeatureFlagFunc) PushHook(hook func(context.Context, string) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "240b42eb4e12246ef06922adb6c521f4", "score": "0.56493694", "text": "func (f *SoftcopyClientGetFileFunc) PushHook(hook func(context.Context, *proto.GetFileRequest, ...grpc.CallOption) (*proto.GetFileResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "886bb71ace66a38196d75b559e35a3a6", "score": "0.5640604", "text": "func (f *LFSStoreGetObjectsByOIDsFunc) PushHook(hook func(context.Context, int64, ...lfsutil.OID) ([]*db.LFSObject, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "ba7fe8b89534fb79749416bbee5b63cc", "score": "0.5640333", "text": "func (f *AccessTokensStoreGetBySHA1Func) PushHook(hook func(context.Context, string) (*db.AccessToken, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "6c875cd3447cbada10e345cf4d9ba085", "score": "0.563805", "text": "func AddHook(hook logrus.Hook) {\n\tlogEntry.AddHook(hook)\n}", "title": "" }, { "docid": "90fc345aa25a77bf440824033001bd04", "score": "0.5632101", "text": "func (f *SoftcopyClientReadFileFunc) PushHook(hook func(context.Context, *proto.ReadFileRequest, ...grpc.CallOption) (*proto.ReadFileResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "5bbbdf1cde83616d53889a22b6650b5d", "score": "0.56286216", "text": "func (f *FeatureFlagStoreCreateBoolFunc) PushHook(hook func(context.Context, string, bool) (*featureflag.FeatureFlag, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "93ebf016d1728936358004858e507790", "score": "0.5625904", "text": "func (f *SoftcopyClientFindFilesWithTagsFunc) PushHook(hook func(context.Context, *proto.FindFilesWithTagsRequest, ...grpc.CallOption) (*proto.FindFilesWithTagsResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "ebf10c3bdbc92138e84dfee0afd97656", "score": "0.5625045", "text": "func (f *SoftcopyClientGetFileDaysFunc) PushHook(hook func(context.Context, *proto.GetFileDaysRequest, ...grpc.CallOption) (*proto.GetFileDaysResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "624660c6a7603c549e2b28f72c8e3944", "score": "0.56233037", "text": "func (f *InitializerInitFunc) PushHook(hook func(config.Config) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "cd2b006bc4bbe7795aa8ad62b7bb2975", "score": "0.56103337", "text": "func (f *QueryResolverHoverFunc) PushHook(hook func(context.Context, int, int) (string, lsifstore.Range, bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "48edebe48608d47a7b113b03723d4723", "score": "0.5606598", "text": "func (f *QueryResolverDocumentationReferencesFunc) PushHook(hook func(context.Context, string, int, string) ([]resolvers.AdjustedLocation, string, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "a67917532b535025b9f89ac4751b0a1d", "score": "0.56016594", "text": "func (f *StoreMergeDocumentRanksFunc) PushHook(hook func(context.Context, string, int) (int, int, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "6196ac997990fd959f65783761745535", "score": "0.5589106", "text": "func (f *DBStoreHasRepositoryFunc) PushHook(hook func(context.Context, int) (bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "17e721872d164e85681eb66d96207530", "score": "0.55823225", "text": "func (f *StoreExportRankPayloadForFunc) PushHook(hook func(context.Context, api.RepoName) (time.Time, []byte, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "1105b039cfc065b6a0b7713e3add41db", "score": "0.5581913", "text": "func (f *UsersStoreFollowFunc) PushHook(hook func(context.Context, int64, int64) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "2cba7c74749b81fcadd3f7614ad2a4e4", "score": "0.55808", "text": "func (f *EnqueuerGitserverClientFileExistsFunc) PushHook(hook func(context.Context, int, string, string) (bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "d0ae77e9ab876e5502f63fe0a67d0ab4", "score": "0.5579621", "text": "func (f *UsersStoreUseCustomAvatarFunc) PushHook(hook func(context.Context, int64, []byte) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "3ba8e81dfaa91178d106c4ddc2c2b579", "score": "0.5578773", "text": "func (s *Server) AddPreShutdownHook(name string, hook genericapiserver.PreShutdownHookFunc) {\n\t// you could potentially add duplicate or invalid post start hooks here, but we'll let\n\t// the genericapiserver implementation do its own validation during startup.\n\ts.preShutdownHooks = append(s.preShutdownHooks, preShutdownHookEntry{\n\t\tname: name,\n\t\thook: hook,\n\t})\n}", "title": "" }, { "docid": "3fa393d5f38a443a2c21c0b2701691bc", "score": "0.5573693", "text": "func (f *ReposStoreListWatchesFunc) PushHook(hook func(context.Context, int64) ([]*db.Watch, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "1fc73bc3136332d8e0dee79bcd175fb9", "score": "0.5573658", "text": "func (h *Hook) Register(fn func()) {\n\th.hooks = append(h.hooks, fn)\n}", "title": "" }, { "docid": "65d8df4f15b93da922f22288ad792f92", "score": "0.5570057", "text": "func (f *SoftcopyClientOpenFileFunc) PushHook(hook func(context.Context, *proto.OpenFileRequest, ...grpc.CallOption) (*proto.OpenFileResponse, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "39e1c3100c44c0955dc75e1f7ddae741", "score": "0.5569105", "text": "func (f *AccessTokensStoreCreateFunc) PushHook(hook func(context.Context, int64, string) (*db.AccessToken, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "fa06ceecd5463ef7544028953f1ca62b", "score": "0.55655134", "text": "func (f *LSIFStoreHoverFunc) PushHook(hook func(context.Context, int, string, int, int) (string, lsifstore.Range, bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "43c50d8a286790599c1dca18a0579b7b", "score": "0.556465", "text": "func (f *ReposStoreStarFunc) PushHook(hook func(context.Context, int64, int64) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "7c1cd2725b21304a187f42d1222c6a40", "score": "0.55645055", "text": "func (f *DBStoreUpdateIndexConfigurationByRepositoryIDFunc) PushHook(hook func(context.Context, int, []byte) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "ef404cb3b35bf39de478f1d9234aeaee", "score": "0.5563487", "text": "func (f *QueryResolverReferencesFunc) PushHook(hook func(context.Context, int, int, int, string) ([]resolvers.AdjustedLocation, string, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "69618004a6fadbd038e012183bf91c40", "score": "0.55612385", "text": "func (f *DBStoreHasCommitFunc) PushHook(hook func(context.Context, int, string) (bool, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "6e7a005b19f5e813617e492a7acc7613", "score": "0.555192", "text": "func (f *FeatureFlagStoreWithFunc) PushHook(hook func(basestore.ShareableStore) database.FeatureFlagStore) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "9f90a5f35dda47f9b3c68ceadb947e77", "score": "0.5546441", "text": "func (f *PermsStoreAuthorizeFunc) PushHook(hook func(context.Context, int64, int64, db.AccessMode, db.AccessModeOptions) bool) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "9af9fccf7c84c28b958716b1ee8a5b4f", "score": "0.5539139", "text": "func (o *Platform) doBeforeInsertHooks(exec boil.Executor) (err error) {\n\tfor _, hook := range platformBeforeInsertHooks {\n\t\tif err := hook(exec, o); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "91929d6b04781ba39bf3f8d24e7c2d2f", "score": "0.55381763", "text": "func (f *StoreUpdatedAfterFunc) PushHook(hook func(context.Context, time.Time) ([]api.RepoName, error)) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" }, { "docid": "e147364d17e62b1b1d029bcb634577b3", "score": "0.5537528", "text": "func (f *JobHandleSavepointFunc) PushHook(hook func(context.Context) error) {\n\tf.mutex.Lock()\n\tf.hooks = append(f.hooks, hook)\n\tf.mutex.Unlock()\n}", "title": "" } ]
e918b9f7cd9763a5f9c8605a20ed9768
WithContext returns a zap logger with as much context as possible.
[ { "docid": "b4e3e3ff6c10331b88c649e527a096ad", "score": "0.7142232", "text": "func WithContext(ctx context.Context, instrumentOpts instrument.Options) *zap.Logger {\n\tif ctx == nil {\n\t\treturn instrumentOpts.Logger()\n\t}\n\tif ctxLogger, ok := ctx.Value(loggerKey).(*zap.Logger); ok {\n\t\treturn ctxLogger\n\t}\n\n\treturn instrumentOpts.Logger()\n}", "title": "" } ]
[ { "docid": "9cb16e2cf7f0cae52daf19113fd435aa", "score": "0.7596769", "text": "func WithContext(ctx context.Context) *zap.Logger {\n\tif ctx == nil {\n\t\treturn logger\n\t}\n\tif ctxLogger, ok := ctx.Value(LoggerKey).(*zap.Logger); ok {\n\t\treturn ctxLogger\n\t}\n\treturn logger\n}", "title": "" }, { "docid": "1d62250b220fd2b961be31ca1ef2837b", "score": "0.7402881", "text": "func NewWithContext(cfg *config.Config, ctx Fields) (*Logger, error) {\n\tl, err := New(cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tl.AddContext(ctx)\n\treturn l, nil\n}", "title": "" }, { "docid": "838d3f5668e90975b5e27dec4906b6cf", "score": "0.7342166", "text": "func (l Logger) WithContext(ctx context.Context) context.Context {\n\tzerologger := l.Unwrap()\n\treturn zerologger.WithContext(ctx)\n}", "title": "" }, { "docid": "1ec0c3a47cd5998f1ab35eb82fda9cdb", "score": "0.72176033", "text": "func WithContext(ctx context.Context, log *zap.Logger) context.Context {\n\treturn context.WithValue(ctx, logKey, log)\n}", "title": "" }, { "docid": "f9034f9f8e130ccff6d804d323223e2f", "score": "0.71945876", "text": "func LogWithContext(c context.Context) *zerolog.Logger {\n\tif c == nil {\n\t\treturn &log.Logger\n\t}\n\tif uuid := c.Value(\"uuid\"); uuid != nil {\n\t\tmylogger := log.With().Str(\"UUID\", uuid.(string)).Logger()\n\t\treturn &mylogger\n\t}\n\treturn &log.Logger\n}", "title": "" }, { "docid": "4cf9744bcd57533253433887e95ee4d4", "score": "0.71465176", "text": "func With() zerolog.Context {\n\treturn Logger.With()\n}", "title": "" }, { "docid": "1dd5691589f5a3b95ff765d424500fe1", "score": "0.7069066", "text": "func (l *Logger) With() zerolog.Context {\n\treturn l.logger.With()\n}", "title": "" }, { "docid": "9257b68e933dc62cbb6011c409c1aafb", "score": "0.6973045", "text": "func WithContext(ctx Context) ILogger {\n\treturn std.WithContext(ctx)\n}", "title": "" }, { "docid": "ba583fb51d7d1edd3790eb275e560df5", "score": "0.6885673", "text": "func withLogLevel(ctx context.Context, level zapcore.Level) context.Context {\n\tvar zlogger *zap.Logger\n\tswitch level {\n\tcase zap.DebugLevel:\n\t\tzlogger = debugL()\n\tcase zap.InfoLevel:\n\t\tzlogger = infoL()\n\tcase zap.WarnLevel:\n\t\tzlogger = warnL()\n\tcase zap.ErrorLevel:\n\t\tzlogger = errorL()\n\tcase zap.FatalLevel:\n\t\tzlogger = fatalL()\n\tdefault:\n\t\tzlogger = L()\n\t}\n\treturn context.WithValue(ctx, CtxLogKey, &MLogger{Logger: zlogger})\n}", "title": "" }, { "docid": "d778b663030ba4098e6dcff045878249", "score": "0.68449855", "text": "func NewLoggerWithContext(ctx context.Context) *Logger {\n\treturn &Logger{\n\t\tContext: ctx,\n\t\tC: make(chan LogEntry, 8),\n\t}\n}", "title": "" }, { "docid": "784834747a0cc619fd75145c5b47bb24", "score": "0.6838386", "text": "func (l *Logger) WithContext(ctx context.Context) flamingo.Logger {\n\tspan := trace.FromContext(ctx)\n\tfields := map[flamingo.LogKey]interface{}{\n\t\tflamingo.LogKeyTraceID: span.SpanContext().TraceID.String(),\n\t\tflamingo.LogKeySpanID: span.SpanContext().SpanID.String(),\n\t}\n\n\treq := web.RequestFromContext(ctx)\n\n\tif req != nil {\n\t\trequest := req.Request()\n\t\tfields[flamingo.LogKeyMethod] = request.Method\n\t\tfields[flamingo.LogKeyPath] = request.URL.Path\n\t}\n\n\tif l.logSession {\n\t\tsession := web.SessionFromContext(ctx)\n\t\tif session != nil {\n\t\t\tfields[flamingo.LogKeySession] = session.IDHash()\n\t\t}\n\t}\n\n\treturn l.WithFields(fields)\n}", "title": "" }, { "docid": "79196c32d881a70584332087b54a9726", "score": "0.6763682", "text": "func WithContext(ctx context.Context, prefix string) (context.Context, *Logger) {\n\tvar instance *Logger\n\tif ctxLogger, ok := ctx.Value(loggerContextKey).(*Logger); ok {\n\t\tinstance = new(Logger)\n\t\t*instance = *ctxLogger\n\t\tif prefix != \"\" {\n\t\t\tinstance.prefix = fmt.Sprintf(\"%s>%s\", instance.prefix, prefix)\n\t\t}\n\t} else {\n\t\tinstance = defaultLogger.WithContext(ctx)\n\t\tinstance.prefix = prefix\n\t}\n\tnewCtx := context.WithValue(ctx, loggerContextKey, instance)\n\tinstance.ctx = newCtx\n\treturn newCtx, instance\n}", "title": "" }, { "docid": "47816dade7c40c5cccd777759551955e", "score": "0.6753848", "text": "func WithContext(ctx context.Context) *logrus.Logger {\n\tif ctx == nil {\n\t\treturn &logger\n\t}\n\n\tif ctxLogger, ok := ctx.Value(loggerKey).(*logrus.Logger); ok {\n\t\treturn ctxLogger\n\t}\n\n\treturn &logger\n}", "title": "" }, { "docid": "a0425f6de85c69caa5d67c7c87ae540f", "score": "0.6744126", "text": "func (l Logger) With() Context {\n\tcontext := l.context\n\tl.context = make([]byte, 0, 500)\n\tif context != nil {\n\t\tl.context = append(l.context, context...)\n\t} else {\n\t\t// This is needed for AppendKey to not check len of input\n\t\t// thus making it inlinable\n\t\tl.context = enc.AppendBeginMarker(l.context)\n\t}\n\treturn Context{l}\n}", "title": "" }, { "docid": "9641141bc33cbc40f512db33a80ff5ce", "score": "0.6719454", "text": "func fillLogContext(ctx context.Context, logger *zap.Logger) *zap.Logger {\n\tif span, ok := servicecontext.SpanFromContext(ctx); ok {\n\t\tif len(span.RootParentId) > 0 {\n\t\t\tlogger = logger.With(zap.String(common.KEY_SPAN_ROOT_UUID, span.RootParentId))\n\t\t}\n\t\tif len(span.ParentId) > 0 {\n\t\t\tlogger = logger.With(zap.String(common.KEY_SPAN_PARENT_UUID, span.RootParentId))\n\t\t}\n\t\tlogger = logger.With(zap.String(common.KEY_SPAN_UUID, span.SpanId))\n\t}\n\tif ctxMeta, has := metadata.FromContext(ctx); has {\n\t\tfor _, key := range []string{\n\t\t\tservicecontext.HttpMetaRemoteAddress,\n\t\t\tservicecontext.HttpMetaUserAgent,\n\t\t\tservicecontext.HttpMetaContentType,\n\t\t\tservicecontext.HttpMetaProtocol,\n\t\t} {\n\t\t\tif val, hasKey := ctxMeta[key]; hasKey {\n\t\t\t\tlogger = logger.With(zap.String(key, val))\n\t\t\t}\n\t\t}\n\t}\n\tif claims, ok := ctx.Value(claim.ContextKey).(claim.Claims); ok {\n\t\tuuid, _ := claims.DecodeUserUuid()\n\t\tlogger = logger.With(\n\t\t\tzap.String(common.KEY_USERNAME, claims.Name),\n\t\t\tzap.String(common.KEY_USER_UUID, uuid),\n\t\t\tzap.String(common.KEY_GROUP_PATH, claims.GroupPath),\n\t\t\tzap.String(common.KEY_PROFILE, claims.Profile),\n\t\t\tzap.String(common.KEY_ROLES, claims.Roles),\n\t\t)\n\t}\n\treturn logger\n}", "title": "" }, { "docid": "c66d4fea69d70a8d3f0b31740123f3a9", "score": "0.6678021", "text": "func LogWithContext(c context.Context, l *Log) context.Context {\n\treturn context.WithValue(c, logKey, l)\n}", "title": "" }, { "docid": "4b393c8c3d693476815bbe0874373375", "score": "0.66365564", "text": "func (l *logger) With(ctx context.Context) Logger {\n\n\treqId := middleware.GetReqID(ctx)\n\treturn &logger{l.WithField(\"traceId\", reqId)}\n\n}", "title": "" }, { "docid": "ee5c87e46e322131b4270377834e96dd", "score": "0.6630789", "text": "func WithContext(ctx context.Context, l Logger) context.Context {\n\treturn context.WithValue(ctx, ctxKey{}, l)\n}", "title": "" }, { "docid": "c5db2bea07cb596977c8a6aa61ec60f8", "score": "0.6624784", "text": "func WithLogger(ctx context.Context, logger *zap.Logger) context.Context {\n\treturn context.WithValue(ctx, loggerKey, logger)\n}", "title": "" }, { "docid": "245ea71473b2760ca791b5db7b27144a", "score": "0.66005623", "text": "func withLogger(ctx context.Context, l logimpl.Implementation) context.Context {\n\treturn context.WithValue(ctx, ctxKey, l)\n}", "title": "" }, { "docid": "bf893b48373a83938ca321dc7a1ce15b", "score": "0.65842265", "text": "func FatalWithContext(ctx context.Context, log string, fields ...zapcore.Field) {\n\tFatalWithSpan(opentracing.SpanFromContext(ctx), log, fields...)\n}", "title": "" }, { "docid": "3197882493f2a28a34384483d09d70e5", "score": "0.65832126", "text": "func withFields(ctx context.Context, fields ...zapcore.Field) context.Context {\n\treturn context.WithValue(ctx, loggerKey{}, getLogger(ctx).With(fields...))\n}", "title": "" }, { "docid": "a70f2f3b2e80723f04d4a92c0eea4ffa", "score": "0.6572808", "text": "func (l *Logger) With(fields ...zap.Field) zap.Logger {\n\treturn &Logger{\n\t\tMeta: l.Meta.Clone(),\n\t\tsink: l.sink,\n\t\tcontext: append(l.context, fields...),\n\t}\n}", "title": "" }, { "docid": "19d59c8e90ff7b3d3165ae42c0731949", "score": "0.6461749", "text": "func withLogger(ctx context.Context, logger Logger) context.Context {\n\treturn context.WithValue(ctx, DefaultLoggerCtxKey(), logger)\n}", "title": "" }, { "docid": "570f0d812d309643f6c146347e7871be", "score": "0.6458203", "text": "func With(fields ...zap.Field) *MLogger {\n\treturn &MLogger{\n\t\tLogger: L().With(fields...).WithOptions(zap.AddCallerSkip(-1)),\n\t}\n}", "title": "" }, { "docid": "3558ba08949cbfe22a7b7c4ca45d1ad2", "score": "0.64300716", "text": "func With(args ...interface{}) *zap.SugaredLogger {\n\treturn GetLogger().With(args...)\n}", "title": "" }, { "docid": "2ffe8c77b277fcf725c181a84ef55612", "score": "0.638847", "text": "func (l *taggedLogger) Context(ctx context.Context) context.Context {\n\treturn log.CombineLogger(ctx, l.ctx)\n}", "title": "" }, { "docid": "07605528b541d76b677bf6c570049b64", "score": "0.63824564", "text": "func WithValuesFromContext(ctx context.Context, logger *zap.Logger) *zap.Logger {\n\t// Naive implementation for now, meant to evolve over time.\n\treturn logger\n}", "title": "" }, { "docid": "1158245d8680d8f9b5d32dad25c804f1", "score": "0.6368837", "text": "func With(fields ...Field) *Logger {\n\treturn zap.L().With(fields...)\n}", "title": "" }, { "docid": "c4245bb1625a24f5a8655abee5c05cd0", "score": "0.63430953", "text": "func FromContext(ctx context.Context) Logger {\n\tif logger, ok := ctx.Value(ctxKey).(Logger); ok {\n\t\treturn logger\n\t}\n\ttm := tag.FromContext(ctx)\n\n\tvar fields []zapcore.Field\n\n\tfor _, tk := range tagKeys {\n\t\tv, ok := tm.Value(tk)\n\t\tif ok {\n\t\t\tfields = append(fields, zap.String(tk.Name(), v))\n\t\t}\n\t}\n\tspan := trace.FromContext(ctx)\n\tvar projErr error\n\tif span.IsRecordingEvents() {\n\t\tsc := span.SpanContext()\n\t\ttraceID := sc.TraceID.String()\n\t\tprojectIDonce.Do(func() {\n\t\t\tprojectID, projErr = metadata.ProjectID()\n\t\t})\n\t\tif projectID != \"\" {\n\t\t\ttraceID = fmt.Sprintf(\"projects/%s/traces/%s\", projectID, sc.TraceID.String())\n\t\t}\n\n\t\tfields = append(fields,\n\t\t\tzap.String(\"logging.googleapis.com/trace\", traceID),\n\t\t\tzap.String(\"logging.googleapis.com/spanId\", sc.SpanID.String()))\n\t}\n\tl := logger.With(fields...).Sugar()\n\tif projErr != nil {\n\t\tl.Errorf(\"metadata.ProjectID: %v\", projErr)\n\t}\n\treturn l\n}", "title": "" }, { "docid": "b09f27e2027cf3e93aff19add89472fb", "score": "0.6337665", "text": "func InfoWithContext(ctx context.Context, log string, fields ...zapcore.Field) {\n\tInfoWithSpan(opentracing.SpanFromContext(ctx), log, fields...)\n}", "title": "" }, { "docid": "313aad4a109460a6553b14aef4956132", "score": "0.63074493", "text": "func ContextLogger(field string, original Logger) func(next http.Handler) http.Handler {\n\treturn func(next http.Handler) http.Handler {\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tctx := r.Context()\n\t\t\tif id := trace.FromContext(ctx); len(id) > 0 {\n\t\t\t\tnext.ServeHTTP(w, r.WithContext(logging.NewContext(ctx, original.With(zap.String(field, id)))))\n\t\t\t} else {\n\t\t\t\tnext.ServeHTTP(w, r.WithContext(logging.NewContext(ctx, original)))\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "999bb399d3e679387a6bfe2b57b9818e", "score": "0.63060445", "text": "func (l *Logger) With(fields ...zap.Field) *Logger {\n\tclone := *l\n\tclone.Logger = l.Logger.With(fields...)\n\treturn &clone\n}", "title": "" }, { "docid": "e6272082e9fe6ac119bb4b4f92669509", "score": "0.6283531", "text": "func WithFields(ctx context.Context, fields ...zap.Field) context.Context {\n\tvar zlogger *zap.Logger\n\tif ctxLogger, ok := ctx.Value(CtxLogKey).(*MLogger); ok {\n\t\tzlogger = ctxLogger.Logger\n\t} else {\n\t\tzlogger = ctxL()\n\t}\n\tmLogger := &MLogger{\n\t\tLogger: zlogger.With(fields...),\n\t}\n\treturn context.WithValue(ctx, CtxLogKey, mLogger)\n}", "title": "" }, { "docid": "12c1455d968e123d2c4dc03a142db4db", "score": "0.6278468", "text": "func LogWith(ctx context.Context) Logger {\n\tl, ok := ctx.Value(LoggerKey).(Logger)\n\tif !ok {\n\t\tpanic(\"no logger defined in the given context\")\n\t}\n\treturn l\n}", "title": "" }, { "docid": "034180432f13f0b247e3ababa6170633", "score": "0.62750363", "text": "func (l *logger) With(ctxs ...Context) Logger {\n\t// Estimation assuming that for each ctxs has at least 1 value.\n\tcombined := make(map[string]Valuer, len(l.ctx)+len(ctxs))\n\n\tfor k, v := range l.ctx {\n\t\tcombined[k] = v\n\t}\n\n\tfor _, c := range ctxs {\n\t\titemCtx := c.Context()\n\t\tfor k, v := range itemCtx {\n\t\t\tcombined[k] = v\n\t\t}\n\t}\n\n\treturn &logger{\n\t\twriter: l.writer,\n\t\tctx: combined,\n\t}\n}", "title": "" }, { "docid": "64a123c57414e5c2c98e9ce7648eb4f2", "score": "0.6261606", "text": "func WithLogger(ctx context.Context, logger *zap.SugaredLogger) context.Context {\n\treturn context.WithValue(ctx, loggerKey{}, logger)\n}", "title": "" }, { "docid": "f3cd9d5475f00f8694b7a0d6e3df0420", "score": "0.6236423", "text": "func NewContext(\n\tctx context.Context,\n\tinstrumentOpts instrument.Options,\n\tfields ...zapcore.Field,\n) context.Context {\n\treturn context.WithValue(ctx, loggerKey,\n\t\tWithContext(ctx, instrumentOpts).With(fields...))\n}", "title": "" }, { "docid": "a95676710b0505c9c24b858f72cb8b1c", "score": "0.6233435", "text": "func (l LoggerWithCtx) WithOptions(opts ...zap.Option) LoggerWithCtx {\n\treturn LoggerWithCtx{\n\t\tctx: l.ctx,\n\t\tl: l.l.WithOptions(opts...),\n\t}\n}", "title": "" }, { "docid": "303b84a69904e8a5d725dab5d805d4c8", "score": "0.62202495", "text": "func WarnWithContext(ctx context.Context, log string, fields ...zapcore.Field) {\n\tWarnWithSpan(opentracing.SpanFromContext(ctx), log, fields...)\n}", "title": "" }, { "docid": "73bc45f68cffbf40d62ee3b8692661f4", "score": "0.6202701", "text": "func FromContext(ctx context.Context) *zap.Logger {\n\tlog := ctx.Value(logKey)\n\tif log == nil {\n\t\treturn nil\n\t}\n\treturn log.(*zap.Logger)\n}", "title": "" }, { "docid": "0c8fc56bcb999ca4e91330f3119ad953", "score": "0.61949295", "text": "func WithLogger(ctx context.Context, logger *zap.SugaredLogger) context.Context {\n\treturn context.WithValue(ctx, loggerKey, logger)\n}", "title": "" }, { "docid": "d32c26d07f8161322d18727d9e75cc22", "score": "0.61937815", "text": "func Logger(ctx context.Context) *zap.Logger {\n\tnewLogger := initLogger()\n\tif ctx != nil {\n\t\tif serviceName := servicecontext.GetServiceName(ctx); serviceName != \"\" {\n\t\t\tif serviceColor := servicecontext.GetServiceColor(ctx); serviceColor > 0 && common.LogConfig != common.LogConfigProduction {\n\t\t\t\tnewLogger = newLogger.Named(fmt.Sprintf(\"\\x1b[%dm%s\\x1b[0m\", serviceColor, serviceName))\n\t\t\t} else {\n\t\t\t\tnewLogger = newLogger.Named(serviceName)\n\t\t\t}\n\t\t}\n\t\tif ctxReqID := servicecontext.GetRequestID(ctx); ctxReqID != \"\" {\n\t\t\tnewLogger = newLogger.With(zap.String(\"rqID\", ctxReqID))\n\t\t}\n\t\tif ctxSessionID := servicecontext.GetSessionID(ctx); ctxSessionID != \"\" {\n\t\t\tnewLogger = newLogger.With(zap.String(\"sessionID\", ctxSessionID))\n\t\t}\n\t\tif common.LogConfig == common.LogConfigProduction {\n\t\t\tnewLogger = fillLogContext(ctx, newLogger)\n\t\t}\n\t}\n\treturn newLogger\n}", "title": "" }, { "docid": "48de76681f7d8d0d867ea65ea98b1b34", "score": "0.6192467", "text": "func (l *Logger) With(fields ...Field) *Logger {\n\tnewlogger := *l\n\tnewlogger.zap = newlogger.zap.With(fields...)\n\treturn &newlogger\n}", "title": "" }, { "docid": "56c0edeed5781d3b6081c11c6c0a117d", "score": "0.6185355", "text": "func Wrap(ctx context.Context) Context {\n\treturn logContext{internal: ctx}\n}", "title": "" }, { "docid": "4d4de12bc108112e6f310193749b60c3", "score": "0.61650425", "text": "func NewContext(ctx context.Context, fields ...zap.Field) context.Context {\n\tif logger == nil {\n\t\tinitLogger()\n\t}\n\treturn context.WithValue(ctx, LoggerKey, WithContext(ctx).With(fields...))\n}", "title": "" }, { "docid": "8d2c256bbdb71a8913fe56b681175745", "score": "0.61555344", "text": "func PanicWithContext(ctx context.Context, log string, fields ...zapcore.Field) {\n\tPanicWithSpan(opentracing.SpanFromContext(ctx), log, fields...)\n}", "title": "" }, { "docid": "cbd9f8ae0165164a5b0e05f0a84b40df", "score": "0.61360526", "text": "func NewContextWithLogger(ctx context.Context) context.Context {\n\tnewCtx := withFields(ctx, zap.String(LogCtxIDKey, uuid.New().String()))\n\treturn newCtx\n}", "title": "" }, { "docid": "1e3f6811478cd9594dfe13f9ee0fe865", "score": "0.6133608", "text": "func DebugWithContext(ctx context.Context, log string, fields ...zapcore.Field) {\n\tDebugWithSpan(opentracing.SpanFromContext(ctx), log, fields...)\n}", "title": "" }, { "docid": "654fc558d679b5dcda41eb68fdd57487", "score": "0.6128822", "text": "func With(ctx context.Context, key string, value interface{}) context.Context {\n\tlogger := logging.GetProviderRootLogger(ctx)\n\tif logger == nil {\n\t\t// this essentially should never happen in production\n\t\t// the root logger for provider code should be injected\n\t\t// by whatever SDK the provider developer is using, so\n\t\t// really this is only likely in unit tests, at most\n\t\t// so just making this a no-op is fine\n\t\treturn ctx\n\t}\n\treturn logging.SetProviderRootLogger(ctx, logger.With(key, value))\n}", "title": "" }, { "docid": "2e2b09bc1c9d4b8b480991f4c9e43e16", "score": "0.6064778", "text": "func WithLogger(ctx context.Context, l Logger) context.Context {\n\treturn context.WithValue(ctx, LoggerKey, l)\n}", "title": "" }, { "docid": "9cb49c35d591ce6ae1ad4f8d3db80da6", "score": "0.6049445", "text": "func WithContext(ctx context.Context) logrus.FieldLogger {\n\treturn logrus.WithField(\"pid\", os.Getpid())\n}", "title": "" }, { "docid": "c054eb9ce5186a08c47a815a399d5d54", "score": "0.6014449", "text": "func For(ctx context.Context) Logger {\n\tif span := opentracing.SpanFromContext(ctx); span != nil {\n\t\treturn spanLogger{span: span, logger: zapLogger}\n\t}\n\n\treturn Bg()\n}", "title": "" }, { "docid": "ce8b4c656a59a5e783ad8a873a3aa138", "score": "0.60048926", "text": "func IntoContext(ctx context.Context, log logr.Logger) context.Context {\n\treturn logr.NewContext(ctx, log)\n}", "title": "" }, { "docid": "672796dac21b42b919c04b73d2edbe36", "score": "0.6004642", "text": "func With(kv ...interface{}) *Logger {\n\treturn defaultLogger.With(kv...)\n}", "title": "" }, { "docid": "055a8bbd16b254465643a90ea2cae06c", "score": "0.5993964", "text": "func (l LoggerWithCtx) Context() context.Context {\n\treturn l.ctx\n}", "title": "" }, { "docid": "42ba32ca1411b7049b77a275d1209509", "score": "0.5982799", "text": "func WithLoggerContext(ctx context.Context, logger Logger) context.Context {\n\treturn context.WithValue(ctx, contextKey, logger)\n}", "title": "" }, { "docid": "3bcde36c557ae1193cf13f577b433c1c", "score": "0.59521604", "text": "func WithLogHook(ctx context.Context, t *testing.T, msgFilter string) (newCtx context.Context, hook *LogHook) {\n\tconf := &log.Config{Level: os.Getenv(\"log_level\"), File: log.FileLogConfig{}}\n\t_, r, _ := log.InitLogger(conf)\n\tenc, err := log.NewTextEncoder(&log.Config{Format: \"text\"})\n\trequire.NoError(t, err)\n\thook = &LogHook{r.Core, nil, enc, msgFilter}\n\tlogger := zap.New(hook)\n\tnewCtx = context.WithValue(ctx, logutil.CtxLogKey, logger)\n\treturn\n}", "title": "" }, { "docid": "4ad6c35507c0561272be090e4faa0c54", "score": "0.5941237", "text": "func (log *Logger) With(fields ...zapcore.Field) *Logger {\n\tif len(fields) == 0 {\n\t\treturn log\n\t}\n\tl := log.clone()\n\tl.core = l.core.With(fields)\n\treturn l\n}", "title": "" }, { "docid": "fbadebfa9bd98e599e70b7d4ba9a5a7e", "score": "0.5940662", "text": "func From(ctx context.Context) Logger {\n\tif ctx == nil {\n\t\treturn NopLogger()\n\t}\n\tv := ctx.Value(contextKey)\n\tl, ok := v.(Logger)\n\tif !ok || l == nil {\n\t\treturn NopLogger()\n\t}\n\treturn l\n}", "title": "" }, { "docid": "1e06941eeacbd4f3fddf7045acad1690", "score": "0.5922314", "text": "func FromContext(ctx context.Context) log15.Logger {\n\tif logger, ok := ctx.Value(loggerKey).(log15.Logger); ok {\n\t\treturn logger\n\t}\n\n\treturn log15.Root()\n}", "title": "" }, { "docid": "6b7f37ae91aae5ada94fc90f392e828f", "score": "0.5919496", "text": "func WithLogger(ctx context.Context, logger LoggerIface) context.Context {\n\treturn context.WithValue(ctx, loggerKey{}, logger)\n}", "title": "" }, { "docid": "86557e795c9c16dd9af487e7b39364de", "score": "0.591934", "text": "func Logger(ctx context.Context) *zap.Logger {\n\tif ctx == nil {\n\t\treturn logger\n\t}\n\n\tnewLogger := logger\n\tif ctxRequestID, ok := ctx.Value(requestIDKey).(string); ok {\n\t\tnewLogger = newLogger.With(zap.String(\"requestID\", ctxRequestID))\n\t}\n\treturn newLogger\n}", "title": "" }, { "docid": "4344132c9c337081cab202d98ced91c1", "score": "0.5913589", "text": "func DPanicWithContext(ctx context.Context, log string, fields ...zapcore.Field) {\n\tDPanicWithSpan(opentracing.SpanFromContext(ctx), log, fields...)\n}", "title": "" }, { "docid": "510d297b42006bafe57a948a8bc15d92", "score": "0.5913401", "text": "func FromContext(ctx context.Context) insolar.Logger {\n\treturn getLogger(ctx)\n}", "title": "" }, { "docid": "0b8b884b2e4e1eba2a947a3b43d865f4", "score": "0.5910249", "text": "func With(ctx context.Context, keysAndValues ...interface{}) context.Context {\n\tl := FromContext(ctx)\n\tl = l.With(keysAndValues...)\n\treturn context.WithValue(ctx, logKey, l)\n}", "title": "" }, { "docid": "dc26237e32f674a301339960b9d26498", "score": "0.59074277", "text": "func With(args ...interface{}) Logger {\n\treturn DefaultLogger.With(args...)\n}", "title": "" }, { "docid": "91924496c1cc5a0c7494995fe7d93058", "score": "0.5903061", "text": "func FromContext(ctx context.Context) Logger {\n\tif v := ctx.Value(logKey); v != nil {\n\t\treturn v.(Logger)\n\t}\n\treturn L()\n}", "title": "" }, { "docid": "b3553ef594a67d9c9d2f3caaa46a0214", "score": "0.58844185", "text": "func With(logger Logger, keyvals ...interface{}) Logger {\n\treturn Logger{\n\t\tkitlog.With(logger.KitLogger, keyvals...),\n\t}\n}", "title": "" }, { "docid": "09233367e6d12e728991bb738872fffc", "score": "0.58812684", "text": "func WithLogger(ctx context.Context, logger Logger) context.Context {\n\treturn context.WithValue(ctx, logKey, logger)\n}", "title": "" }, { "docid": "767a137b4b21cfbbf0b10b7723c33bb8", "score": "0.58435947", "text": "func FromContext(ctx context.Context, keysAndValues ...interface{}) (logr.Logger, error) {\n\tlogger, err := logr.FromContext(ctx)\n\tif err != nil {\n\t\treturn logger, err\n\t}\n\treturn logger.WithValues(keysAndValues...), nil\n}", "title": "" }, { "docid": "90a8acb133393a028853ca7ea1704d81", "score": "0.58332664", "text": "func FromContext(ctx context.Context) *zap.SugaredLogger {\n\tif logger, ok := ctx.Value(loggerKey).(*zap.SugaredLogger); ok {\n\t\treturn logger\n\t}\n\treturn DefaultLogger()\n}", "title": "" }, { "docid": "cf477c854b2299acfdc2c633e2cddfc6", "score": "0.58279085", "text": "func FromContext(ctx context.Context) Logger {\n\trv, ok := ctx.Value(logKey).(Logger)\n\tif ok {\n\t\treturn rv\n\t}\n\treturn L()\n}", "title": "" }, { "docid": "81bd0251678e0093c526499bd929b73a", "score": "0.5826345", "text": "func ContextWithLog(ctx context.Context, logF func(...interface{}) error) context.Context {\n\treturn context.WithValue(ctx, logCtxKey, logF)\n}", "title": "" }, { "docid": "b8b2189ff39b0d117bcc69501f66a5ee", "score": "0.58262354", "text": "func L() *zap.Logger {\n\treturn logger\n}", "title": "" }, { "docid": "0bd9a1fb6879ce35844aa4749ea58577", "score": "0.5798064", "text": "func WithLogger(parent context.Context, logger log.Logger) context.Context {\n\treturn context.WithValue(parent, loggerKey, logger)\n}", "title": "" }, { "docid": "12285eca5757cc845f106ff2e870fddb", "score": "0.578797", "text": "func Logger(ctx context.Context) *zap.Logger {\n\tif ctx != nil {\n\t\tif ctxRqId, ok := ctx.Value(CtxRequestIDKey).(string); ok {\n\t\t\treturn logger.With(zap.String(\"rid\", ctxRqId))\n\t\t}\n\t}\n\treturn logger\n}", "title": "" }, { "docid": "8190c449c3bf2b4b8116146290e25c35", "score": "0.57768095", "text": "func InjectLogger(logger *zap.Logger) func(http.Handler) http.Handler {\n\treturn func(handler http.Handler) http.Handler {\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n\t\t\treq = req.WithContext(NewContext(req.Context(), logger))\n\t\t\thandler.ServeHTTP(w, req)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "12bb965beb6bad45b3600fa502e74649", "score": "0.5775556", "text": "func (l LoggerWithCtx) ZapLogger() *zap.Logger {\n\treturn l.l.Logger\n}", "title": "" }, { "docid": "af4833a74c064c8bef07b21184e8e5f4", "score": "0.57708937", "text": "func LoggerFromContext(ctx context.Context) Logger {\n\tacquireLoggerFuncMu.Lock()\n\tdefer acquireLoggerFuncMu.Unlock()\n\n\treturn acquireLoggerFunc(ctx)\n}", "title": "" }, { "docid": "856708b08bbbcc569b0a546f1cd6331e", "score": "0.57644373", "text": "func (l Logger) With(keyvals ...interface{}) Logger {\n\treturn Logger{\n\t\tWriter: l.Writer,\n\t\tFormatter: l.Formatter,\n\t\tcontext: append(l.context, keyvals...),\n\t}\n}", "title": "" }, { "docid": "0894664cb1ec3a44229d1c48b4e685c3", "score": "0.5724829", "text": "func NewContextLogger(ctx context.Context, logger *zap.Logger) context.Context {\n\treturn context.WithValue(ctx, ctxKeyLogger, logger)\n}", "title": "" }, { "docid": "4956cfba0cac4b7c22106ba48765a98b", "score": "0.57149684", "text": "func (b *LocalBackup) WithLogContext(c map[string]interface{}) {\n\tb.logContext = c\n}", "title": "" }, { "docid": "193dd46300f18a9d341905f18be764de", "score": "0.57035524", "text": "func GetNewContextWithLogger() (context.Context, *zap.SugaredLogger) {\n\tnewCtx := NewContextWithLogger(context.Background())\n\treturn newCtx, GetLogger(newCtx)\n}", "title": "" }, { "docid": "fcb5ec813178756942fc57f6e7948d37", "score": "0.57032156", "text": "func (ctx *Context) WithLogger(logger logrus.FieldLogger) *Context {\n\tret := *ctx\n\tret.Logger = logger\n\treturn &ret\n}", "title": "" }, { "docid": "501927426d6df45a664895ff1116cf8d", "score": "0.5699244", "text": "func (l *Context) With(keyvals ...interface{}) *Context {\n\tif len(keyvals)%2 != 0 {\n\t\tpanic(\"Programmer error. Please call log.Context.With() only with an even number of arguments.\")\n\t}\n\tif len(keyvals) == 0 || l == nil {\n\t\treturn l\n\t}\n\treturn &Context{\n\t\tLogger: l.Logger,\n\t\tKeyVals: addArrays(l.KeyVals, keyvals),\n\t}\n}", "title": "" }, { "docid": "156909be1f4ffabc256858a1f121d099", "score": "0.5683197", "text": "func (l *Logger) UpdateContext(update func(c Context) Context) {\n\tif l == disabledLogger {\n\t\treturn\n\t}\n\tif cap(l.context) == 0 {\n\t\tl.context = make([]byte, 0, 500)\n\t}\n\tif len(l.context) == 0 {\n\t\tl.context = enc.AppendBeginMarker(l.context)\n\t}\n\tc := update(Context{*l})\n\tl.context = c.l.context\n}", "title": "" }, { "docid": "2eaff5ab7f80aa870994d62c266e63be", "score": "0.56815714", "text": "func NewContext(ctx context.Context, l log15.Logger) context.Context {\n\treturn context.WithValue(ctx, loggerKey, l)\n}", "title": "" }, { "docid": "7e997196948f4734d2aeb020880db52b", "score": "0.5665533", "text": "func WithLogger(ctx context.Context, l LoggerFactory) context.Context {\n\tif l == nil {\n\t\tl = getNullLogger\n\t}\n\n\treturn context.WithValue(ctx, loggerCacheKey, &loggerCache{\n\t\tcreateLoggerForModule: l,\n\t})\n}", "title": "" }, { "docid": "218c5f882fffa9ca236dfdab400ab586", "score": "0.5658848", "text": "func Ctx(ctx context.Context) *zerolog.Logger {\n\treturn zerolog.Ctx(ctx)\n}", "title": "" }, { "docid": "218c5f882fffa9ca236dfdab400ab586", "score": "0.5658848", "text": "func Ctx(ctx context.Context) *zerolog.Logger {\n\treturn zerolog.Ctx(ctx)\n}", "title": "" }, { "docid": "94ec7a465a461380a71132c01cbf0a6f", "score": "0.5653285", "text": "func (l *LoggerType) With(fields ...zapcore.Field) LoggerItf {\n\treturn &LoggerType{\n\t\tLogger: l.Logger.With(fields...),\n\t\tlevel: l.level,\n\t}\n}", "title": "" }, { "docid": "857560e87ebcde8a1111939b01e499aa", "score": "0.564134", "text": "func Extract(ctx context.Context) *logrus.Entry {\n\tl, ok := ctx.Value(ctxLoggerKey).(*ctxLogger)\n\tif !ok || l == nil {\n\t\treturn logrus.NewEntry(nullLogger)\n\t}\n\n\tfields := logrus.Fields{}\n\n\t// Add grpc_ctxtags tags metadata until now.\n\ttags := grpc_ctxtags.Extract(ctx)\n\tfor k, v := range tags.Values() {\n\t\tfields[k] = v\n\t}\n\n\t// Add logrus fields added until now.\n\tfor k, v := range l.fields {\n\t\tfields[k] = v\n\t}\n\n\treturn l.logger.WithFields(fields)\n}", "title": "" }, { "docid": "57fb4e93687e86216cfe5ca5329a93d1", "score": "0.56348944", "text": "func ContextWithValue(ctx context.Context, fields ...zapcore.Field) context.Context {\n\tif ctxFields, ok := ctx.Value(LogKey).([]zapcore.Field); ok {\n\t\tfields = append(fields, ctxFields...)\n\t}\n\n\treturn context.WithValue(ctx, LogKey, fields)\n}", "title": "" }, { "docid": "cbaa103c20fd41bc648cfc8175d2f799", "score": "0.5629283", "text": "func WithLog(ctx context.Context, keyvals ...interface{}) context.Context {\n\treturn context.WithValue(ctx, logContextKey, append(LogContext(ctx), keyvals...))\n}", "title": "" }, { "docid": "fe7d26992f9f163dd5608602c55d7c22", "score": "0.5603613", "text": "func ContextWithLogger(ctx context.Context, logger *logrus.Entry) context.Context {\n\treturn context.WithValue(ctx, reqLoggerKey, logger)\n}", "title": "" }, { "docid": "a772e46ab146b201057adbd5d2ce906f", "score": "0.56031406", "text": "func Auditer(ctx context.Context) *zap.Logger {\n\tif AuditLogger == nil {\n\t\treturn zap.New(nil)\n\t}\n\tnewLogger := AuditLogger //initAuditLogger()\n\tif ctx != nil {\n\t\tnewLogger = newLogger.With(zap.String(\"LogType\", \"audit\"))\n\t\tif serviceName := servicecontext.GetServiceName(ctx); serviceName != \"\" {\n\t\t\tnewLogger = newLogger.Named(serviceName)\n\t\t}\n\t\t// Add context info to the logger\n\t\tnewLogger = fillLogContext(ctx, newLogger)\n\t}\n\treturn newLogger\n}", "title": "" }, { "docid": "2029878d6a31d56844d8f165738826be", "score": "0.55993044", "text": "func WithLog(ctx context.Context, log ...Logger) context.Context {\n\treturn context.WithValue(ctx, logKey, Combine(log...))\n}", "title": "" }, { "docid": "b37e63a97bea294481599fe78e1d3e4d", "score": "0.55962217", "text": "func Extract(ctx context.Context) *logrus.Entry {\n\tl, ok := ctx.Value(ctxLoggerKey).(*ctxLogger)\n\tif !ok || l == nil {\n\t\treturn logrus.NewEntry(nullLogger)\n\t}\n\n\tfields := logrus.Fields{}\n\tfor k, v := range l.fields {\n\t\tfields[k] = v\n\t}\n\n\tfor k, v := range grpc_ctxtags.Extract(ctx).Values() {\n\t\tfields[k] = v\n\t}\n\n\treturn l.logger.WithFields(fields)\n}", "title": "" }, { "docid": "7a6e16c72ca0617c3658917d2b5b0684", "score": "0.55919397", "text": "func WithFields(ctx context.Context, fields map[string]interface{}) (context.Context, insolar.Logger) {\n\tl := getLogger(ctx).WithFields(fields)\n\treturn SetLogger(ctx, l), l\n}", "title": "" } ]
4d3dec55c51960091e2799e119be3e1f
/ make sure only be called in one thread.
[ { "docid": "cf6ffc2c17a9bea355f377e6df8b3638", "score": "0.0", "text": "func (this *ChannelGraph) ShortestPath(source, target common.Address, amount *big.Int, feeCharger fee.FeeCharger) (totalWeight int64, err error) {\n\tthis.Lock.Lock()\n\tdefer this.Lock.Unlock()\n\tsourceIndex, ok := this.address2index[source]\n\tif !ok {\n\t\terr = errAddressNotFoundInGraph\n\t\treturn\n\t}\n\ttargetIndex, ok := this.address2index[target]\n\tif !ok {\n\t\terr = errAddressNotFoundInGraph\n\t\treturn\n\t}\n\tif sourceIndex == targetIndex {\n\t\treturn 0, nil\n\t}\n\tvar g2 *dijkstra.Graph\n\tif false { //make sure only be called in one thread.\n\t\tg2 = this.g.CloneGraph()\n\t} else {\n\t\tg2 = this.g\n\t}\n\tfor _, v := range g2.Verticies {\n\t\tw := feeCharger.GetNodeChargeFee(this.index2address[v.ID], this.TokenAddress, amount).Int64()\n\t\tif w > 0 { //for no fee policy, all nodes charge 0 ,so use the shortest path first.\n\t\t\tv.SetWeight(w) // from v's fee is w.\n\t\t}\n\t}\n\tpath, err := g2.Shortest(sourceIndex, targetIndex)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn path.Distance, nil\n}", "title": "" } ]
[ { "docid": "11cbbb93905903cf07c890074ee75329", "score": "0.62493676", "text": "func init() {\n\truntime.LockOSThread()\n}", "title": "" }, { "docid": "11cbbb93905903cf07c890074ee75329", "score": "0.62493676", "text": "func init() {\n\truntime.LockOSThread()\n}", "title": "" }, { "docid": "225eb0d91de2e719b379bd16680d2138", "score": "0.61542267", "text": "func performSync() {\n for {\n \n }\n}", "title": "" }, { "docid": "28380f9a3e9e7c54303897fe0693f520", "score": "0.55515265", "text": "func singleDispatcher(wg *sync.WaitGroup, entry Data) {\n\tdefer wg.Done()\n\ttime.Sleep(time.Duration(entry.StartTime) * time.Second)\n\tlog.Printf(\"dispatch job job-dispatcher-test-%s-%d [%d pods * %d GPU] at %d\\n\",\n\t\tentry.PartitionName, entry.Index, entry.PodCnt, entry.GpuCnt, entry.StartTime)\n\tout, err := dispatchJob(entry)\n\tif err != nil {\n\t\tlog.Printf(\"dispatch job %d failed: %s; %s\\n\", entry.Index, err, out)\n\t} else {\n\t\tlog.Printf(\"dispatch job %d success: %s\", entry.Index, out)\n\t}\n}", "title": "" }, { "docid": "4708252e9be73dda687cf8a5b8b77e35", "score": "0.5534359", "text": "func syncSelect() {\n for {\n \n }\n}", "title": "" }, { "docid": "ecd657f55341c3c844084172687756a1", "score": "0.55248517", "text": "func saveThread()", "title": "" }, { "docid": "393fde86367dfc55af31073d185310cf", "score": "0.5518519", "text": "func restoreThread()", "title": "" }, { "docid": "e04391deeca1802d7c1ad0fd366d3bc6", "score": "0.5468234", "text": "func init() {\n\t// Ensure that the ui's main thread is locked to the main thread.\n\truntime.LockOSThread()\n}", "title": "" }, { "docid": "e8cae0138121fc1bd20ebe5adfd4eacc", "score": "0.54517215", "text": "func (clt *ClientAgent) mainThread() {\n\tfor clt.isActive {\n\t\tclt.qmut.RLock()\n\t\tisEmpty := len(clt.reqQueue) == 0\n\t\tclt.qmut.RUnlock()\n\t\tif isEmpty {\n\t\t\t// No pending requests. Take a break, have a KitKat\n\t\t\ttime.Sleep(sleepDuration)\n\t\t} else {\n\t\t\t// Process first message in queue\n\t\t\tclt.qmut.RLock()\n\t\t\tr := clt.reqQueue[0] // Outstanding request\n\t\t\tclt.qmut.RUnlock()\n\n\t\t\t// Broadcast request \"<clientID> <reqNum> <m>\" to replicas\n\t\t\tclt.debugPrintf(\"ISSUE request %d : '%s'\\n\", r.reqNum, r.m)\n\t\t\tfor rep := range clt.replicas {\n\t\t\t\tclt.send(rep, fmt.Sprintf(\"%d %d %s\", clt.myID, r.reqNum, r.m))\n\t\t\t}\n\n\t\t\t// Wait for request to be committed\n\t\t\tr.ticker = time.NewTicker(timeoutDuration)\n\t\t\tcommitted := false\n\t\t\tfor !committed {\n\t\t\t\tselect {\n\t\t\t\tcase <-r.done:\n\t\t\t\t\t// Request committed\n\t\t\t\t\tcommitted = true\n\t\t\t\t\tclt.debugPrintf(\"COMMIT request %d : '%s'\\n\",\n\t\t\t\t\t\tr.reqNum, r.m)\n\t\t\t\tcase <-r.ticker.C:\n\t\t\t\t\t// Timer expired, resend request\n\t\t\t\t\t// increment timer duration\n\t\t\t\t\tr.timeoutMultiple++\n\t\t\t\t\tduration := timeoutDuration\n\t\t\t\t\tfor i := 0; i < r.timeoutMultiple; i++ {\n\t\t\t\t\t\tduration = duration * 2\n\t\t\t\t\t}\n\t\t\t\t\tr.ticker = time.NewTicker(duration)\n\t\t\t\t\tclt.debugPrintf(\"Timeout for (%d, %d)\\n\", clt.myID, r.reqNum)\n\t\t\t\t\tfor rep := range clt.replicas {\n\t\t\t\t\t\tclt.send(rep, fmt.Sprintf(\"%d %d %s\", clt.myID, r.reqNum, r.m))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d163191f1fb0c6f9253739878d664d0a", "score": "0.54324955", "text": "func (c *credentialMap) runlock() {\n\tc.mutex.RUnlock()\n}", "title": "" }, { "docid": "23642b4bbdfed9ffb904ef9b9ef303f8", "score": "0.5412025", "text": "func (s *Syncer) run() {\n\tfor s.processNextWorkItem() {\n\t}\n}", "title": "" }, { "docid": "d8ec00c476112be2821dc205fa5c2526", "score": "0.5411311", "text": "func (t *RedisEngine) doOneLoop() {\n\tlogger.Info(\"do in oneloop taskNum\", t.taskNum)\n\tc := make(chan int, t.taskNum)\n\tfor i := 0; i < t.taskNum; i++ {\n\t\tgo t.croutinePopJobData(c, i)\n\t}\n\n\tfor i := 0; i < t.taskNum; i++ {\n\t\t<-c\n\t}\n}", "title": "" }, { "docid": "dbdff68766ee866fd19556c935810da6", "score": "0.54094726", "text": "func (kv *KVPaxos) ExecutionThread() {\r\n\tfor (!kv.dead){\r\n\t\ttime.Sleep(100*time.Millisecond)\r\n num :=kv.maxExecutedOpNum\r\n probe := kv.px.Max()\r\n\t\tif (probe>num){\r\n\t\t\tkv.mu.Lock() \r\n\t\t _,exist:=kv.opLogs[probe]\r\n\t\t\tif (!exist){\r\n\t\t\t kv.InsertNop(probe)\r\n\t\t\t\t//px.DriveRevoking(i, Operation{OpName:\"nop\", OperationId:-1, ClientId :0}) \r\n\t\t } \r\n\t\t\tkv.ExecuteUntil(probe)\r\n\t\t\tkv.mu.Unlock()\r\n }\r\n }\r\n}", "title": "" }, { "docid": "20a50d441fd0f91530d422425544bcea", "score": "0.53344303", "text": "func (mpx *MultiPaxos) refresh(){\n\n //initial backoff time between status checks\n to := 50*time.Millisecond\n //while the server is still alive\n dead := false\n for dead== false{\n mpx.mu.Lock()\n dead = mpx.dead\n executionPointer := mpx.executionPointer\n mpx.mu.Unlock()\n mpx.Log(-14,\"refresh: checking \"+strconv.Itoa(executionPointer))\n //check the status for the next Paxos instance in the Paxos log\n done,val := mpx.px.Status(executionPointer)\n mpx.Log(1,\"refresh: after checking \"+strconv.Itoa(executionPointer))\n //if agreement occurred\n if done{\n mpx.Log(1,\"refresh: before commitAndLog \"+strconv.Itoa(executionPointer))\n //commit and log the result of the instance (apply it and saved the result so the client\n //that made the request can get the result)\n mpx.commitAndLogInstance(executionPointer,val)\n to = 10*time.Millisecond\n }else{\n if to < 100*time.Millisecond{\n to*=2\n }\n }\n mpx.cleanup()\n time.Sleep(to)\n }\n}", "title": "" }, { "docid": "10c7e0b80cee4e9274b1dd9e4fd6cca4", "score": "0.52730906", "text": "func (kv *ShardKV) DaemonThread() {\n\tfor !kv.killed() {\n\t\tapplyMsg := <- kv.applyCh\n\t\tif !applyMsg.CommandValid {\n\t\t\tsnapshotInBytes := applyMsg.CommandSnapshot\n\t\t\tkv.mu.Lock()\n\t\t\tr := bytes.NewBuffer(snapshotInBytes)\n\t\t\td := labgob.NewDecoder(r)\n\t\t\tif d.Decode(&kv.serverMap) != nil || d.Decode(&kv.lastApplyIdMap) != nil {\n\t\t\t\tkv.mu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tkv.mu.Unlock()\n\t\t}else{\n\t\t\tgetOp := applyMsg.Command.(Op)\n\t\t\tgetIndex := applyMsg.CommandIndex\n\n\t\t\tclerkId := getOp.OpClerkId\n\t\t\tuuid := getOp.OpUuid\n\t\t\trequestUuid := strconv.FormatInt(clerkId,10) + strconv.FormatInt(uuid,10)\n\n\t\t\t// 如果该次applyMsg所对应的request已经apply 过一次,则不会再apply了\n\t\t\tkv.mu.Lock()\n\t\t\tif getIndex > kv.lastLogIndex {\n\t\t\t\tkv.lastLogIndex = getIndex\n\t\t\t}\n\n\t\t\tif !kv.isDuplicate(clerkId, uuid) {\n\t\t\t\tkv.lastApplyIdMap[clerkId] = uuid\n\n\t\t\t\tif kv.checkRightShardGroup(key2shard(getOp.Key)) {\n\t\t\t\t\tif getOp.OpType == \"Put\" {\n\t\t\t\t\t\tkv.serverMap[getOp.Key] = getOp.Value\n\t\t\t\t\t}else if getOp.OpType == \"Append\" {\n\t\t\t\t\t\tlastValue, ok := kv.serverMap[getOp.Key]\n\t\t\t\t\t\tif ok {\n\t\t\t\t\t\t\tkv.serverMap[getOp.Key] = lastValue + getOp.Value\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tkv.serverMap[getOp.Key] = getOp.Value\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// check if need to install snapshot\n\t\t\t\tif kv.isNeedToSnapshot() {\n\t\t\t\t\tkv.callRaftStartSnapshot()\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t// check if need to install snapshot\n\t\t\t\tif kv.isNeedToSnapshot() {\n\t\t\t\t\tkv.callRaftStartSnapshot()\n\t\t\t\t}\n\t\t\t\tkv.mu.Unlock()\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tclerkChan, ok := kv.clerkChannelMap[requestUuid]\n\t\t\tif ok {\n\t\t\t\tclerkChan <- getOp\n\t\t\t}\n\t\t\tkv.mu.Unlock()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4cc3ea1301a218a3a454c2236ae63ad1", "score": "0.5247909", "text": "func (s *SSEMaster) manage() {\n\t{\n\tmloop:\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-time.After(5 * time.Second):\n\t\t\t\tcontinue\n\n\t\t\tcase <-s.closer:\n\t\t\t\tbreak mloop\n\n\t\t\tcase c, ok := <-s.closeClient:\n\t\t\t\tif !ok {\n\t\t\t\t\tbreak mloop\n\t\t\t\t}\n\n\t\t\t\tdelete(s.channels, c)\n\t\t\t\tcontinue\n\n\t\t\tcase c, ok := <-s.newClient:\n\t\t\t\tif !ok {\n\t\t\t\t\tbreak mloop\n\t\t\t\t}\n\n\t\t\t\ts.channels[c] = true\n\t\t\t\tcontinue\n\n\t\t\tcase data, ok := <-s.data:\n\t\t\t\tif !ok {\n\t\t\t\t\tbreak mloop\n\t\t\t\t}\n\n\t\t\t\tfor client := range s.channels {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase client <- data:\n\t\t\t\t\t\t// Data sent to client\n\t\t\t\t\tcase <-time.After(3 * time.Second):\n\t\t\t\t\t\t// Data not consumed by client\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d59c149546ad385dda68025ee1447690", "score": "0.5241", "text": "func (vm *Vm) once() {}", "title": "" }, { "docid": "936e54b9b534b7cdc5e1c42ae77f1ba1", "score": "0.5232236", "text": "func (m *Master) checkWorker(reply Reply) {\n\ttime.Sleep(time.Second * 10)\n\t// fmt.Printf(\"checking task: %v\\n\", reply.FileName)\n\tm.Lock.Lock()\n\tdefer m.Lock.Unlock()\n\tvar isDone bool\n\tif reply.TT == mapTask {\n\t\tisDone = m.CountedDoneFiles[reply.FileName]\n\t\tif !isDone {\n\t\t\tm.MapBacklog = append(m.MapBacklog, reply)\n\t\t}\n\t}\n\tif reply.TT == reduceTask {\n\t\tisDone = m.CountedDoneFiles[strconv.Itoa(reply.FileIdx)]\n\t\tif !isDone {\n\t\t\tm.ReducerBacklog = append(m.ReducerBacklog, reply)\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "c9830db8e2202448482d1dfad3c3bd17", "score": "0.522018", "text": "func (r *DNS) runSingle(f func(string) []string, arg string) []string {\n\tacquired := r.antiLoop.Acquire(arg)\n\tdefer r.antiLoop.Release(arg)\n\tif acquired {\n\t\treturn f(arg)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d1346e34b21f8f7f312bc248855c6b4c", "score": "0.5209145", "text": "func (vs *ViewServer) tick() {\n\n\t// Your code here.\n\tdeadInterval := PingInterval * DeadPings\n vs.mu.Lock()\n now := time.Now()\n if vs.currentView.Viewnum > 0 && vs.primaryResponse == true {\n //log.Printf(\"checking next view...\\n\")\n nextView := View{}\n nextView.Viewnum = vs.currentView.Viewnum + 1\n nextView.Primary = vs.currentView.Primary\n nextView.Backup = vs.currentView.Backup\n promoted := false\n changed := false\n if (vs.currentView.Primary == \"\") || (now.Sub(vs.pingHistory[vs.currentView.Primary]) > deadInterval) {\n // needs a new primary server\n //log.Printf(\"needs a new primary server\\n\")\n nextView.Primary = \"\"\n changed = vs.currentView.Primary == \"\"\n if vs.currentView.Backup != \"\" && vs.backupResponse {\n // promote current backup server\n //log.Printf(\"promotes current backup server: %v\\n\", vs.currentView.Backup)\n nextView.Primary = vs.currentView.Backup\n nextView.Backup = \"\"\n promoted = true\n }\n }\n if promoted == true || vs.currentView.Backup == \"\" || (now.Sub(vs.pingHistory[vs.currentView.Backup]) > deadInterval) {\n // needs a new backup server\n //log.Printf(\"needs a new backup server\\n\")\n nextView.Backup = vs.getNewBackup()\n changed = nextView.Backup != vs.currentView.Backup\n }\n \n if changed == true {\n //log.Printf(\"changes view to %v\\n\", nextView.Viewnum)\n vs.currentView = nextView\n vs.primaryResponse = vs.currentView.Primary == \"\"\n vs.backupResponse = false\n }\t \n }\n //log.Printf(\"%v view %v:\\n\", vs.me, vs.currentView.Viewnum)\n //log.Printf(\"primary %v %v %v\\n\", vs.currentView.Primary, vs.primaryResponse, now.Sub(vs.pingHistory[vs.currentView.Primary]))\n //log.Printf(\"backup %v %v %v\\n\", vs.currentView.Backup, vs.backupResponse, now.Sub(vs.pingHistory[vs.currentView.Backup]))\n //log.Printf(\"dead interval %v\\n\", deadInterval)\n //log.Printf(\"idle servers: %v\\n\", len(vs.idleServers))\n vs.mu.Unlock()\n}", "title": "" }, { "docid": "95550e57da02000793a9f36aea4af244", "score": "0.5187662", "text": "func (s *Speaker) run() {\n\tfor {\n\t\tkey, quit := s.queue.Get()\n\t\tif quit {\n\t\t\treturn\n\t\t}\n\t\tst := s.do(key)\n\t\tswitch st {\n\t\tcase types.SyncStateError:\n\t\t\ts.queue.Add(key)\n\t\tcase types.SyncStateSuccess, types.SyncStateReprocessAll:\n\t\t\t// SyncStateReprocessAll is returned in MetalLB when the\n\t\t\t// configuration changes. However, we are not watching for\n\t\t\t// configuration changes because our configuration is static and\n\t\t\t// loaded once at Cilium start time.\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0d5a5ca97afc056e0e4697acebe89ab5", "score": "0.51852846", "text": "func (r *Reloader) run() {\n\tfor {\n\t\tselect {\n\t\tcase <-r.ticker.C:\n\t\t\tops := r.ops.flush()\n\t\t\tv := r.atom.Load().(Value)\n\t\t\t// what if copy times out?\n\t\t\tv2 := v.Copy()\n\n\t\t\tif err := v2.Apply(ops); err != nil {\n\t\t\t\tr.errChan <- err\n\t\t\t}\n\n\t\t\tr.atom.Store(v2)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0c9e66d0bd22be99aab40ab742741090", "score": "0.51785964", "text": "func init() {\n runtime.GOMAXPROCS(1)\n}", "title": "" }, { "docid": "60217fc71b81f874c05be46320ef35e6", "score": "0.5173489", "text": "func manageSynchro(res Resolver) {\n\tfor i := 0; i < res.capacity; i++ {\n\t\tif status := <-res.Done; !status {\n\t\t\terrorLog(res.component)\n\t\t}\n\t}\n\tif logger {\n\t\tdoneLog(res.component)\n\t}\n\tsynchronizer.Done()\n}", "title": "" }, { "docid": "97aeeb666fb842d5c84e55394b2b5ad6", "score": "0.51647073", "text": "func worker() {\n\tfor {\n\t\treq := popQueue()\n\t\tif req == nil {\n\t\t\treturn\n\t\t}\n\t\terrWrapper(req, handleRequest(req))\n\t}\n}", "title": "" }, { "docid": "15be6ef9189eae549a61c23ebcf9a20b", "score": "0.5161877", "text": "func (ctrl *csiSnapshotCommonController) snapshotWorker() {\n\tkeyObj, quit := ctrl.snapshotQueue.Get()\n\tif quit {\n\t\treturn\n\t}\n\tdefer ctrl.snapshotQueue.Done(keyObj)\n\n\tif err := ctrl.syncSnapshotByKey(keyObj.(string)); err != nil {\n\t\t// Rather than wait for a full resync, re-add the key to the\n\t\t// queue to be processed.\n\t\tctrl.snapshotQueue.AddRateLimited(keyObj)\n\t\tklog.V(4).Infof(\"Failed to sync snapshot %q, will retry again: %v\", keyObj.(string), err)\n\t} else {\n\t\t// Finally, if no error occurs we Forget this item so it does not\n\t\t// get queued again until another change happens.\n\t\tctrl.snapshotQueue.Forget(keyObj)\n\t}\n}", "title": "" }, { "docid": "cb7052ba6f17850c1124ad85045f5131", "score": "0.5144386", "text": "func main() {\n\tch := make(chan bool)\n\tgo get(ch, 14000000000)\n\tgo get(ch, 15000000000)\n\tgo get(ch, 18000000000)\n\t<-ch\n\t<-ch\n\t<-ch\n}", "title": "" }, { "docid": "98566717ae7a456b5a0ca12da4e9a872", "score": "0.5140538", "text": "func localSingleSend(node *Node) {\n\tfor {\n\t\tselect {\n\t\tcase raw := <-node.singleSend:\n\t\t\tnow := time.Now().UnixNano()\n\t\t\tr := Request{\n\t\t\t\tID: now,\n\t\t\t\tCommand: SendRequest,\n\t\t\t\tData: raw.Data,\n\t\t\t\tFrom: node.listenAddr,\n\t\t\t}\n\n\t\t\tlock.Lock()\n\t\t\tsendPackets[r.ID] = make([]*Packet, 0)\n\t\t\tsendDatas[r.ID] = r\n\t\t\tlock.Unlock()\n\t\t\tn := 0\n\t\t\tif raw.FromAddr != \"\" {\n\t\t\t\t// send to the addr\n\t\t\t\tconn := node.getConnByAddr(raw.FromAddr)\n\t\t\t\tif conn == nil{\n\t\t\t\t\tlogx.Warn(\"localSingleSend getConnBtAddr is nil\", raw.FromAddr)\n\t\t\t\t}else{\n\t\t\t\t\tWriteConnRequest(conn, r)\n\t\t\t\t\tlock.Lock()\n\t\t\t\t\tsendPackets[r.ID] = append(sendPackets[r.ID], &Packet{\n\t\t\t\t\t\tAddr: raw.FromAddr,\n\t\t\t\t\t})\n\t\t\t\t\tlock.Unlock()\n\t\t\t\t\tn++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// nothing happend, do some sweeping work.\n\t\t\tif n == 0 {\n\t\t\t\tlock.Lock()\n\t\t\t\tdelete(sendPackets, r.ID)\n\t\t\t\tdelete(sendDatas, r.ID)\n\t\t\t\tlock.Unlock()\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "44c0cdc5c0998e8ea33810119ce82b35", "score": "0.5128954", "text": "func (t *Rock) Sync() {\n}", "title": "" }, { "docid": "602791c1b0c5a7c7859ad9e8d997f8b6", "score": "0.5127184", "text": "func lock(l *mutex)", "title": "" }, { "docid": "ff2f8639c024c2d10099afd092dc455a", "score": "0.5123865", "text": "func (w *Worker) start() {\n\tif atomic.LoadInt32(&w.runing) >= w.thread {\n\t\treturn\n\t}\n\tgo func() {\n\t\tdefer func() {\n\t\t\tatomic.AddInt32(&w.runing, -1)\n\t\t}()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase t := <-w.receive:\n\t\t\t\tt.before()\n\t\t\t\t// 忽略重复任务,根据name(url地址)字段判断\n\t\t\t\tw.r.Lock()\n\t\t\t\tif _, ok := w.statusMap[t.Name]; !ok {\n\t\t\t\t\tw.statusMap[t.Name] = t\n\t\t\t\t\tw.r.Unlock()\n\t\t\t\t\tif err := t.after(t.start()); err != nil {\n\t\t\t\t\t\tutil.Log.Print(err)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tw.r.Unlock()\n\t\t\t\t}\n\t\t\tcase <-time.After(time.Minute):\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\tatomic.AddInt32(&w.runing, 1)\n}", "title": "" }, { "docid": "a9df79deedfb38f00c7c7af0ecad840e", "score": "0.51071036", "text": "func thread(ctx context.Context, num int, pool *models.PlayerPool, minValue float64) {\n\tprintGap := 1000\n\tlog.Printf(\"Searching for lineups with a min value of %f\\n\", minValue)\n\ti := 0\n\tfor {\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tlog.Println(\"Done \", num, \"working\")\n\t\t\treturn\n\t\tdefault:\n\t\t\tcur := pool.RandomLineup(minValue, config.Formation)\n\n\t\t\tif cur.Wage <= config.MaxWage && cur.Projection > best.Projection && cur.NumTeams >= config.MinNumTeams && cur.Team.IsBalanced() {\n\t\t\t\tlog.Printf(\"\\n\\n***** New high score: %f Wage: $%f MinValue: %f Teams: %d Iter: %d\\n\", cur.Projection, cur.Wage, minValue, cur.NumTeams, iter)\n\t\t\t\tbest.Wage = cur.Wage\n\t\t\t\tbest.Projection = cur.Projection\n\t\t\t\tbest.Team = cur.Team\n\t\t\t\tbest.Team.Print()\n\t\t\t}\n\n\t\t\tif i%printGap == 0 {\n\t\t\t\titer += printGap\n\t\t\t\tif iter%(printGap*int(config.Threads)) == 0 {\n\n\t\t\t\t\tspeed := float64(iter) / float64(time.Now().Sub(start).Seconds())\n\t\t\t\t\tlog.Printf(\"Thread: %d Iter: %d Speed: %f per second\\n\", num, iter, speed)\n\t\t\t\t}\n\n\t\t\t}\n\t\t\ti++\n\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "6169d4681996efcc29d44a67808d25c9", "score": "0.5105887", "text": "func (i *imageLoader) worker() {\n\tfor i.processNextWorkItem() {\n\t}\n}", "title": "" }, { "docid": "852ed96311728a6e4927b47079c0780f", "score": "0.50873226", "text": "func (cfg readLimitTestConfig) runSingleSend(t *testing.T, conn *TimeoutConnection, idx int) error {\n\tif err := checkedSendReceive(t, conn, cfg.sendSize); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c5f5776868224cf4cb93f6c9619dfc3b", "score": "0.50817", "text": "func (w *Worker) doSingle(cLog def.Logger, tableName string, rollType int32) {\n\tdefer func() {\n\t\tif err := recover(); err != nil {\n\t\t\tlog.Println(tableName, \":\")\n\t\t\tlog.Println(err)\n\t\t}\n\t}()\n\ttableFullName := utils.GetTableFullNameByTableName(tableName, rollType)\n\tif w.CurrentTable == \"\" || w.CurrentTable != tableFullName {\n\t\terr := w.checkCreate(cLog, tableName, tableFullName, rollType)\n\t\tif err != nil {\n\t\t\tlog.Println(\"Create table \" + tableFullName + \" error!\")\n\t\t\tlog.Println(err)\n\t\t\treturn\n\t\t}\n\t\tinsertStmt := utils.GetInsertSql(cLog) // do insert\n\t\tw.SingleInsertStatement = insertStmt\n\t}\n\terr := w.doSingleInsert(cLog, tableFullName, w.SingleInsertStatement)\n\tif err != nil {\n\t\tlog.Println(\"Insert log \" + tableFullName + \" error!\")\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tatomic.AddUint64(&w.LogCounter.Count, 1)\n\tatomic.AddUint64(&w.LogCounter.TotalCount, 1)\n}", "title": "" }, { "docid": "d649b36e19952da4162120d0866373c1", "score": "0.5079975", "text": "func (rf *Raft) run() {\n\tfor {\n\t\trf.mu.Lock()\n\t\tswitch rf.state {\n\t\tcase FOLLOWER:\n\t\t\trf.mu.Unlock()\n\t\t\tticker := time.After(time.Duration(rand.Int63n(100))*time.Millisecond + ELECTIME)\n\t\t\tselect {\n\t\t\tcase <-ticker:\n\t\t\t\trf.mu.Lock()\n\t\t\t\trf.state = CANDIDATE\n\t\t\t\trf.mu.Unlock()\n\t\t\tcase <-rf.grantVoteCh:\n\t\t\tcase <-rf.appendEntryCh:\n\t\t\t}\n\t\tcase CANDIDATE:\n\t\t\trf.currentTerm++\n\t\t\trf.votedFor = rf.me\n\t\t\trf.voteCount = 1\n\t\t\tticker := time.After(time.Duration(rand.Int63n(100))*time.Millisecond + ELECTIME)\n\t\t\t//sends out Request Vote to all rafts\n\t\t\targs := &RequestVoteArgs{\n\t\t\t\tTerm: rf.currentTerm,\n\t\t\t\tCandidateId: rf.me,\n\t\t\t\tLastLogTerm: rf.getLastTerm(),\n\t\t\t\tLastLogIndex: rf.getLastIndex(),\n\t\t\t}\n\t\t\trf.mu.Unlock()\n\t\t\tfor server := range rf.peers {\n\t\t\t\tif server != rf.me {\n\t\t\t\t\tvar reply RequestVoteReply\n\t\t\t\t\tgo rf.sendRequestVote(server, args, &reply)\n\t\t\t\t}\n\t\t\t}\n\t\t\tselect {\n\t\t\tcase <-ticker:\n\t\t\tcase <-rf.appendEntryCh: \n\t\t\t\trf.mu.Lock()\n\t\t\t\trf.state = FOLLOWER\n\t\t\t\trf.votedFor = -1\n\t\t\t\trf.mu.Unlock()\n\t\t\tcase <-rf.majorityVoteCh:\n\t\t\t\trf.mu.Lock()\n\t\t\t\trf.state = LEADER\n\t\t\t\tfor i := range rf.peers {\n\t\t\t\t\trf.nextIndex[i] = rf.getLastIndex() + 1\n\t\t\t\t\trf.matchIndex[i] = 0\n\t\t\t\t}\n\t\t\t\trf.mu.Unlock()\n\t\t\t}\n\t\tcase LEADER:\n\t\t\tfor i := rf.commitIndex + 1; i <= rf.getLastIndex(); i++ {\n\t\t\t\tmajority := len(rf.peers) / 2\n\t\t\t\tfor j := range rf.peers {\n\t\t\t\t\tif rf.matchIndex[j] >= i && rf.log[i].Term == rf.currentTerm {\n\t\t\t\t\t\tmajority--\n\t\t\t\t\t\tif majority <= 0 {\n\t\t\t\t\t\t\trf.commitIndex = i\n\t\t\t\t\t\t\trf.commitCh <- true\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor server := range rf.peers {\n\t\t\t\tif server != rf.me {\n\t\t\t\t\targs := &AppendEntriesArgs{\n\t\t\t\t\t\tTerm: rf.currentTerm,\n\t\t\t\t\t\tLeaderId: rf.me,\n\t\t\t\t\t\tLeaderCommit: rf.commitIndex,\n\t\t\t\t\t\tPrevLogIndex: rf.nextIndex[server] - 1,\n\t\t\t\t\t}\n\t\t\t\t\tif args.PrevLogIndex >= 0 && args.PrevLogIndex < len(rf.log) {\n\t\t\t\t\t\targs.PrevLogTerm = rf.log[args.PrevLogIndex].Term\n\t\t\t\t\t\targs.Entries = make([]LogEntry, len(rf.log[args.PrevLogIndex + 1:]))\n\t\t\t\t\t\tcopy(args.Entries, rf.log[args.PrevLogIndex + 1:])\n\t\t\t\t\t}\n\t\t\t\t\t//fmt.Println(args.PrevLogIndex)\n\t\t\t\t\t//fmt.Println(rf.log[args.PrevLogIndex].Command)\n\t\t\t\t\tvar reply AppendEntriesReply\n\t\t\t\t\tgo rf.sendAppendEntries(server, args, &reply)\n\t\t\t\t}\n\t\t\t}\n\t\t\trf.mu.Unlock()\n\t\t\ttime.Sleep(HeartBeatTIME)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b899b9b6cd56bdebec5fb4b4a78ac9c2", "score": "0.5078964", "text": "func dispatch(subs []*gtpv2.Subscriber) {\n\tfor _, sub := range subs {\n\t\t// wait for 0-255ms before sending request (just for a little bit of reality)\n\t\t/*\n\t\t\tu8buf := make([]byte, 1)\n\t\t\trand.Read(u8buf)\n\t\t\ttime.Sleep(time.Duration(u8buf[0]) * time.Millisecond)\n\t\t*/\n\t\ttime.Sleep(100 * time.Millisecond)\n\n\t\tattachCh <- sub\n\t}\n}", "title": "" }, { "docid": "53a853eecddaad2adc3cddb1ddc981b0", "score": "0.5073941", "text": "func (qjm *ComboSetController) worker() {\n\tfor qjm.processNextWorkItem() {\n\t}\n}", "title": "" }, { "docid": "52bb1841ddf0b1fa278bed7fe801c4a8", "score": "0.50652826", "text": "func (c *credentialMap) lock() {\n\tc.mutex.Lock()\n}", "title": "" }, { "docid": "cbe374d4e39e625ba7563a68331d05f5", "score": "0.5058798", "text": "func (*NoCopy) Lock() {}", "title": "" }, { "docid": "cbe374d4e39e625ba7563a68331d05f5", "score": "0.5058798", "text": "func (*NoCopy) Lock() {}", "title": "" }, { "docid": "83b121601dfa7df8765d27ef9b376d04", "score": "0.50503254", "text": "func resumeThreadFast()", "title": "" }, { "docid": "5278494995aaa3de117bc01b87500a37", "score": "0.5045317", "text": "func GolintRepetitive() {}", "title": "" }, { "docid": "1f5783d5a544554f1dc97092377430dc", "score": "0.5044985", "text": "func (pb *PBServer) tick() {\n\tpb.mu.Lock()\n\n\tview, err := pb.vs.Ping(pb.viewNum)\n\n\tswitch {\n\tcase err != nil:\n\t\tpb.partitioned = true\n\t\tpb.mu.Unlock()\n\t\treturn\n\tcase (view.Backup != pb.view.Backup || pb.migrate) && pb.isPrimary():\n\t\tres := pb.Migrate(view.Backup)\n\t\t// If migration failed due to unreliable connection, retry migrate on next tick.\n\t\tif !res {\n\t\t\tpb.migrate = true\n\t\t} else {\n\t\t\tpb.migrate = false\n\t\t}\n\tcase (pb.isPrimary() && view.Primary != pb.me) || (pb.isBackup() && view.Backup != pb.me):\n\t\t// Changed from primary to backup. Have to invalidate cache, otherwise will respond to client requests\n\t\tfmt.Println(\"INVALIDATING CACHE\")\n\t\tpb.uniqueIds = make(map[int64]*PutAppendReply)\n\t}\n\tpb.viewNum = view.Viewnum\n\tpb.view = view\n\tpb.partitioned = false\n\tpb.mu.Unlock()\n\n}", "title": "" }, { "docid": "a5b14f03492e42d0572f024d82f9f36a", "score": "0.5043695", "text": "func (l *playerList) lock() {\n\t<-l.mutex\n}", "title": "" }, { "docid": "7cb9bc0d261e49039bc141e148e92fc0", "score": "0.50337017", "text": "func (c *threadParams) threadRun() {\n\tctx := context.Background()\n\tconn, err := mysql.Connect(ctx, &vtParams)\n\tif err != nil {\n\t\tlog.Errorf(\"error connecting to mysql with params %v: %v\", vtParams, err)\n\t}\n\tdefer conn.Close()\n\tfor !c.quit {\n\t\terr = c.executeFunction(c, conn)\n\t\tif err != nil {\n\t\t\tc.errors++\n\t\t\tlog.Errorf(\"error executing function %v: %v\", c.executeFunction, err)\n\t\t}\n\t\tc.rpcs++\n\t\t// If notifications are requested, check if we already executed the\n\t\t// required number of successful RPCs.\n\t\t// Use >= instead of == because we can miss the exact point due to\n\t\t// slow thread scheduling.\n\t\tc.notifyLock.Lock()\n\t\tif c.notifyAfterNSuccessfulRpcs != 0 && c.rpcs >= (c.notifyAfterNSuccessfulRpcs+c.rpcsSoFar) {\n\t\t\tc.waitForNotification <- true\n\t\t\tc.notifyAfterNSuccessfulRpcs = 0\n\t\t}\n\t\tc.notifyLock.Unlock()\n\t\t// Wait 10ms seconds between two attempts.\n\t\ttime.Sleep(10 * time.Millisecond)\n\t}\n\twg.Done()\n}", "title": "" }, { "docid": "588cd5e6d43f1535f157b44dd2ec1d15", "score": "0.503208", "text": "func HandleFileReplication() {\n for{\n time.Sleep(time.Duration(replicatePeriod) * time.Second)\n\n if myIP == masterIP {\n // Run the code\n\n for fileName, _ := range(fileMap){\n filenodes := fileMap[fileName].nodeIds\n currTime := time.Now().Unix()\n if (fileMap[fileName].timestamp + int64(replicatePeriod)) < currTime{\n continue\n }\n if len(filenodes) < 4 { \n if len(filenodes) == 0 {\n continue\n }\n fmt.Printf(\"+++++++++++++++++++++++++++++++++++++++++++\")\n fmt.Printf(\"[ME %d] Handling file Replication for %s\\n\",myVid,fileName)\n fmt.Printf(\"+++++++++++++++++++++++++++++++++++++++++++\")\n newnodes := getRandomNodes(filenodes, 4 - len(filenodes))\n fmt.Printf(\"Init vector %v , Added nodes %v\\n\",filenodes, newnodes)\n for _, newnode := range(newnodes) {\n\n acquireParallel()\n go func (fileName string, srcNode int , destNode int) {\n initiateReplica(fileName, srcNode, destNode)\n releaseParallel()\n }(fileName, filenodes[0], newnode)\n // go initiateReplica(fileName, filenodes[0], newnode)\n }\n }\n }\n\n }\n }\n}", "title": "" }, { "docid": "557591bea977c15d741e84da7ddd284e", "score": "0.5026968", "text": "func runOnce(r Runner, file string, a action) (stdout string, stderr string, err error) {\n\tvar o *Observe\n\to, err = New(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar (\n\t\tprinters = make(chan string, 1)\n\t\terrors = make(chan string, 1)\n\t\tfinished = make(chan bool, 1)\n\t\tfilechanged = make(chan string, 30)\n\t)\n\n\twg := sync.WaitGroup{}\n\twg.Add(1)\n\n\tif a == sendfile {\n\t\twg.Add(2) // for finished\n\t}\n\n\tvar outbf bytes.Buffer\n\tvar errbf bytes.Buffer\n\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase m := <-printers:\n\t\t\t\t// println(\"writing from printers: \" + m)\n\t\t\t\toutbf.WriteString(m)\n\t\t\t\twg.Done()\n\t\t\tcase m := <-errors:\n\t\t\t\t// println(\"writing from errors: \" + m)\n\t\t\t\terrbf.WriteString(m)\n\t\t\t\twg.Done()\n\t\t\t// case <-finished:\n\t\t\t// println(\"finished\")\n\t\t\t// wg.Done()\n\t\t\tdefault:\n\t\t\t\truntime.Gosched()\n\t\t\t}\n\t\t}\n\t}()\n\trunfinished, stopCh, killCh := o.Start(printers, errors, finished, filechanged)\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-runfinished:\n\t\t\t\tprintln(\"received runfinished\")\n\t\t\t\twg.Done()\n\t\t\tcase <-finished:\n\t\t\t\tprintln(\"received finished\")\n\t\t\t\twg.Done()\n\t\t\t\treturn\n\t\t\tdefault:\n\t\t\t\truntime.Gosched()\n\t\t\t}\n\t\t}\n\t}()\n\tfilechanged <- file\n\t// go func() {\n\tswitch a {\n\tcase terminate:\n\t\t// wg.Done()\n\t\t// wg.Done()\n\t\ttime.Sleep(time.Duration(10))\n\t\tprintln(\"start termination\")\n\t\tstopCh <- time.Duration(1)\n\tcase kill:\n\t\ttime.Sleep(time.Duration(10))\n\t\tprintln(\"start killing\")\n\t\tkillCh <- true\n\t}\n\t// println(\"before wait\")\n\t// }()\n\twg.Wait()\n\t// println(\"after wait\")\n\t/*\n\t\tif a != sendfile {\n\t\t\t<-finished\n\t\t}\n\t*/\n\tstdout = outbf.String()\n\tstderr = errbf.String()\n\treturn\n}", "title": "" }, { "docid": "196fdba8d13b6c8b2915c9225368ffa8", "score": "0.502606", "text": "func (vs *ViewServer) tick() {\n\n // Your code here.\n vs.mu.Lock()\n defer vs.mu.Unlock()\n //isPrimaryNotSet := vs.currentview.Primary == \"\" && vs.newview.Primary == \"\"\n isBackupNotSet := vs.currentview.Backup == \"\" && vs.newview.Backup == \"\"\n\n if vs.currentview.Primary != \"\" {\n //check if primary is alive\n if isAlive(vs.servers[vs.currentview.Primary].lastpingedtime) == false {\n if vs.lastackedview == vs.currentview.Viewnum && \n\t\tvs.backupAcked == true {\n\tdelete(vs.servers, vs.currentview.Primary)\n\tvs.serverscount -= 1\n\tvs.currentview.Primary = vs.currentview.Backup\n\tvs.currentview.Viewnum += 1\n\t//isPrimaryNotSet = vs.currentview.Backup == \"\"\n\tvs.currentview.Backup = \"\"\n\tvs.primarychanged = true\n\tvs.backupAcked = false\n }\n }\n }\n if vs.currentview.Backup != \"\" {\n //check if backup is alive\n if isAlive(vs.servers[vs.currentview.Backup].lastpingedtime) == false {\n\t if vs.lastackedview == vs.currentview.Viewnum {\n\t delete(vs.servers, vs.currentview.Backup)\n\t vs.serverscount -= 1\n\t vs.currentview.Backup = \"\"\n\t isBackupNotSet = true\n\t}\n }\n }\n\n // check if servers are alive\n for server, info := range vs.servers {\n\tif server == vs.currentview.Primary ||\n\t\tserver == vs.currentview.Backup {\n\t\tcontinue\n\t}\n\tif isAlive(info.lastpingedtime) == false {\n\t delete(vs.servers, server)\n } else {\n\t\tif isBackupNotSet == true {\n\t\t if vs.lastackedview == vs.currentview.Viewnum {\n\t\t vs.newview.Primary = vs.currentview.Primary\n\t\t vs.newview.Backup = server\n\t\t vs.newview.Viewnum = vs.currentview.Viewnum + 1\n\t\t isBackupNotSet = false\n\t\t }\n\t\t}\n\t}\n }\n}", "title": "" }, { "docid": "917c52b8a8395cfe7a8ccb092ce3713b", "score": "0.50220275", "text": "func (pb *PBServer) tick() {\n\n\t// Your code here.\n\tpb.mu.Lock()\n\tdefer pb.mu.Unlock()\n\n\tview, err := pb.vs.Ping(pb.view.Viewnum)\n\n\tif err != nil {\n\t\tfmt.Print(\"ERROR for ping view\")\n\t}\n\n\tneedTransfer := view.Viewnum != pb.view.Viewnum && view.Primary == pb.me\n\tpb.view = view\n\n\tif needTransfer {\n\t\tpb.Transfer(pb.storage)\n\t}\n}", "title": "" }, { "docid": "2eb68edbf231221625c3d1a513f96c72", "score": "0.502108", "text": "func SingleThread() int {\n\tvar sum int\n\tfor _, v := range data {\n\t\tsum += v\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "b2cfbce0d2d6754e822a06f0fdafd248", "score": "0.5013631", "text": "func (m *manager) sync() {\n\ttimer := time.NewTicker(m.Cfg.AccountReload)\n\tfor {\n\t\tselect {\n\t\tcase <-m.done:\n\t\t\ttimer.Stop()\n\t\t\treturn\n\t\tcase <-timer.C:\n\t\t}\n\t\tg.Log.Infof(\"start reload account...\")\n\t\tmeta, err := api.ListOrgInfos(m.Org)\n\t\tif err != nil {\n\t\t\tg.Log.Errorf(\"list org cluster error: %s\", err)\n\t\t\tcontinue\n\t\t}\n\t\tsame := reflect.DeepEqual(meta, m.metaOrgClusters)\n\t\tif !same {\n\t\t\tm.Close()\n\t\t\tif err := m.setWriter(); err != nil {\n\t\t\t\tg.Log.Errorf(\"set writer failed. err: %s\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := m.initScheduler(); err != nil {\n\t\t\t\tg.Log.Errorf(\"init failed, err %s\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tm.start()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fe9d61cd56a16ae536c356c26e3110c5", "score": "0.5007534", "text": "func (m *metadata) lock() {\n\tm.startTime = time.Now()\n\n\tm.msgPerSec.start()\n\tm.msgPerMin.start()\n\tm.msgPerHr.start()\n\tm.msgPerDay.start()\n}", "title": "" }, { "docid": "fa11d1427b8b1e42ce3d7784ffcfb60b", "score": "0.5003964", "text": "func subscriber_thread() {\n\tsubscriber, _ := zmq.NewSocket(zmq.SUB)\n\tsubscriber.Connect(\"tcp://localhost:6001\")\n\tsubscriber.SetSubscribe(\"A\")\n\tsubscriber.SetSubscribe(\"B\")\n\tdefer subscriber.Close()\n\n\tfor count := 0; count < 5; count++ {\n\t\t_, err := subscriber.RecvMessage(0)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"subscriber error\")\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2e8831afa7c55a4193e608d60ea242fc", "score": "0.5000898", "text": "func (pb *PBServer) tick() {\n\n\t// Your code here.\n\tpb.mu.Lock()\n\tdefer pb.mu.Unlock()\n\n\tview, err := pb.vs.Ping(pb.view.Viewnum)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\toldView := pb.view\n\tif view.Viewnum != oldView.Viewnum {\n\t\tpb.view = view\n\t\tif pb.isPrimary() && oldView.Backup != view.Backup && view.Backup != \"\" {\n\t\t\tgo pb.TransferToBackup()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3557273ddfdb5658676aaae871e5f545", "score": "0.500056", "text": "func (v *VCHub) sync() bool {\n\tv.Log.Infof(\"VCHub sync called\")\n\n\tv.syncLock.Lock()\n\tv.syncDone = false\n\tdefer func() {\n\t\tv.syncLock.Unlock()\n\t}()\n\n\tv.Log.Infof(\"VCHub syncing........\")\n\n\t// Check that probe session is connected\n\tcount := 3\n\tfor !v.probe.IsSessionReady() && count > 0 {\n\t\tselect {\n\t\tcase <-v.Ctx.Done():\n\t\t\treturn false\n\t\tcase <-time.After(1 * time.Second):\n\t\t\tcount--\n\t\t}\n\t}\n\tif count == 0 {\n\t\tv.Log.Infof(\"Probe session isn't connected, exiting sync...\")\n\t\treturn false\n\t}\n\t// Once syncLock is given up, network events should be acted upon\n\tv.processVeniceEventsLock.Lock()\n\tv.processVeniceEvents = true\n\tv.processVeniceEventsLock.Unlock()\n\n\topts := api.ListWatchOptions{}\n\t// By the time this is called, the statemanager would have setup watchers to the API server\n\t// and synched the local cache with the API server\n\tnw, err := v.StateMgr.Controller().Network().List(v.Ctx, &opts)\n\tif err != nil {\n\t\tv.Log.Errorf(\"Failed to get network list. Err : %v\", err)\n\t}\n\n\thosts := v.cache.ListHosts(v.Ctx, false)\n\n\tworkloads, err := v.StateMgr.Controller().Workload().List(v.Ctx, &opts)\n\tif err != nil {\n\t\tv.Log.Errorf(\"Failed to get workload list. Err : %v\", err)\n\t}\n\n\t// TODO remove the prints below. Added to calm down go fmt\n\tv.Log.Infof(\"Got Networks : %v\", nw)\n\tv.Log.Infof(\"Got Workloads : %v\", workloads)\n\tv.Log.Infof(\"Got Hosts : %v\", hosts)\n\n\t/**\n\t\t1. List DCs\n\t\t2. Per DC, list DVS, list VMS, list Hosts\n\t\t3. Per DVS,\n\t\t\t\t- list PGs\n\t\t\t\t- Build Useg Mgr\n\t\t\t\t- assign PG Vlans and workload vlans\n\t\t4, Delete stale venice objects push oper to store\n\t\t5. Push existing objects and creates.\n\t**/\n\tvmkMap := map[string]bool{}\n\n\tdcs, err := v.probe.ListDC()\n\tif err != nil {\n\t\tv.Log.Errorf(\"Failed to list DCs, %s\", err)\n\t\treturn false\n\t}\n\tprocessedDCs := map[string]bool{}\n\tfor _, dc := range dcs {\n\t\tif !v.syncDCHelper(dc, nw, workloads, hosts, vmkMap) {\n\t\t\tv.Log.Errorf(\"sync failed for dc %s\", dc.Name)\n\t\t\treturn false\n\t\t}\n\t\tprocessedDCs[dc.Name] = true\n\t}\n\n\t// Remove any hosts or workloads that are in a DC that isn't managed anymore\n\t// or does not exist anymore\n\tfor _, workload := range workloads {\n\t\tif utils.IsObjForOrch(workload.Labels, v.VcID, \"\") {\n\t\t\tdc, ok := utils.GetOrchNamespaceFromObj(workload.Labels)\n\t\t\tif ok {\n\t\t\t\tif _, ok := processedDCs[dc]; !ok {\n\t\t\t\t\tkey := utils.ParseGlobalKey(v.VcID, \"\", workload.Name)\n\t\t\t\t\twlObj := convertWorkloadToVCHubWorkload(&workload.Workload, key)\n\t\t\t\t\tv.Log.Infof(\"Deleting stale workload %s\", workload.Name)\n\t\t\t\t\tv.deleteWorkload(wlObj)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor _, host := range hosts {\n\t\tif utils.IsObjForOrch(host.Labels, v.VcID, \"\") {\n\t\t\tdc, ok := utils.GetOrchNamespaceFromObj(host.Labels)\n\t\t\tif ok {\n\t\t\t\tif _, ok := processedDCs[dc]; !ok {\n\t\t\t\t\tv.Log.Infof(\"Deleting stale host %s\", host.Name)\n\t\t\t\t\tv.deleteHostState(host, true)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Process any API events we have missed (migration.status.done/timeout)\n\tfor _, workload := range workloads {\n\t\tif workload.Status.MigrationStatus != nil {\n\t\t\tv.handleWorkloadEvent(kvstore.Updated, workload.Workload.GetObjectMeta())\n\t\t}\n\t}\n\n\tv.Log.Infof(\"Sync done for VCHub. %v\", v)\n\tv.syncDone = true\n\treturn true\n}", "title": "" }, { "docid": "7e8823af0813eef18eac41b45f710961", "score": "0.49927843", "text": "func synchronizeQueryExecution() {\n\ttime.Sleep(time.Millisecond * 200) // TODO: Find out how to synchronize db.Query execution\n}", "title": "" }, { "docid": "e457682ef2ba3ac238de83d638ef64da", "score": "0.49918765", "text": "func (miner *Miner) update() {\n\t//defer self.electionSub.Unsubscribe()\n\tevents := miner.mux.Subscribe(downloader.StartEvent{}, downloader.DoneEvent{}, downloader.FailedEvent{}, types.ElectionEvent{})\nout:\n\tfor ev := range events.Chan() {\n\t\tswitch ev.Data.(type) {\n\t\tcase downloader.StartEvent:\n\t\t\tlog.Info(\"-----------------get download info startEvent\")\n\t\t\tatomic.StoreInt32(&miner.canStart, 0)\n\t\t\tif miner.Mining() {\n\t\t\t\tminer.Stop()\n\t\t\t\tatomic.StoreInt32(&miner.shouldStart, 1)\n\t\t\t\tlog.Info(\"Mining aborted due to sync\")\n\t\t\t}\n\t\tcase downloader.DoneEvent, downloader.FailedEvent:\n\t\t\tlog.Info(\"-----------------get download info DoneEvent,FailedEvent\")\n\t\t\tshouldStart := atomic.LoadInt32(&miner.shouldStart) == 1\n\n\t\t\tatomic.StoreInt32(&miner.canStart, 1)\n\t\t\tif shouldStart && atomic.LoadInt32(&miner.commitFlag) == 1 {\n\t\t\t\tatomic.StoreInt32(&miner.shouldStart, 0)\n\t\t\t}\n\t\t\tif shouldStart {\n\t\t\t\tminer.Start(miner.coinbase)\n\t\t\t}\n\t\t\t// unsubscribe. we're only interested in this event once\n\t\t\tevents.Unsubscribe()\n\t\t\t// stop immediately and ignore all further pending events\n\t\t\tbreak out\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a3db362d716ad82f8211ae458e59deda", "score": "0.49866912", "text": "func (c *ContainershipController) runWorker() {\n\tfor c.processNextWorkItem() {\n\t}\n}", "title": "" }, { "docid": "cf061702bac0478777476105136d1e62", "score": "0.49860016", "text": "func (g *Group) do(f func()) {\n\tg.mutex.Lock()\n\tdefer g.mutex.Unlock()\n\tf()\n}", "title": "" }, { "docid": "caacc4ccf2f17a7a6ff37fcf2ef6bf81", "score": "0.4976928", "text": "func (h *hub) run() {\n\tfor {\n\t\tselect {\n\t\t// Add to TCP client Map\n\t\tcase c := <-h.tregister:\n\t\t\th.tcpclients[c] = true\n\t\t\tbreak\n\t\t// Add to UDP client map\n\t\tcase c := <-h.uregister:\n\t\t\th.udpclients[c] = true\n\t\t\tbreak\n\t\t// Broadcast message to all clients\n\t\tcase m := <-h.broadcast:\n\t\t\th.bMessage(m)\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "99b92baa3c2d4a336adee50c254ca6d4", "score": "0.49760732", "text": "func (*noCopy) Lock() {}", "title": "" }, { "docid": "3e944a386acb98e9feeac18a955b1b11", "score": "0.497556", "text": "func (racer *Wikiracer) Race(resultCh chan []string) {\n startPage := NewPage(racer.startTitle, nil, 0)\n req := racer.createRequest(racer.startTitle, \"\", \"\")\n racer.IssueMediaWikiRequest(req, startPage, \"\", \"\", resultCh)\n}", "title": "" }, { "docid": "6dd28474480f217fa219486b3d944dad", "score": "0.49703026", "text": "func (np *NodeProc) senderProtocol() {\r\n for {\r\n //O nodo aguarda algum tempo entre 1 e 3 segundos e então\r\n //envia uma mensagem aleatória.\r\n waitTime := (rand.Int() % 3) + 1\r\n time.Sleep(time.Duration(waitTime) * time.Second)\r\n \r\n msg := Message{np.id, rand.Int() % 1000}\r\n np.mutexArq.Wait(0)\r\n if !contains(&msg, np.arq) {\r\n np.arq = append(np.arq, msg)\r\n np.mutexArq.Signal(0)\r\n fmt.Printf(\"O nodo %d inicia o envio da mensagem %d\\n\", np.id, msg.messageID)\r\n np.floodAll(msg)\r\n } else {\r\n np.mutexArq.Signal(0)\r\n }\r\n \r\n }\r\n}", "title": "" }, { "docid": "80d72d319ebc6f08f3a497af8f2124fa", "score": "0.49688047", "text": "func (*noCopy) Lock() {}", "title": "" }, { "docid": "a9b2201a678502d31e6d97a060a521ec", "score": "0.49674436", "text": "func (pcs *persistentContiguousStorage) loop() {\n\tfor {\n\t\tselect {\n\t\tcase <-pcs.stopChan:\n\t\t\treturn\n\t\tcase <-pcs.putChan:\n\t\t\treq, found := pcs.getNextItem(context.Background())\n\t\t\tif found {\n\t\t\t\tpcs.reqChan <- req\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1a8193ddffff2acc746bfcfd1acdc45d", "score": "0.49595404", "text": "func (vs *ViewServer) tick() {\n\t// Your code here.\n\tvs.mu.Lock()\n\tdefer vs.mu.Unlock()\n\n\tvs.dumpState(\"Tick\")\n\tif len(vs.views) == 0 {\n\t\treturn\n\t}\n\tcurrent := time.Now().UnixNano()/1000000\n\tview := vs.views[len(vs.views) - 1]\n\tprimaryPing, primaryOk := vs.pings[view.Primary]\n\tbackupPing, backupOk := vs.pings[view.Backup]\n\tif !primaryOk && !backupOk {\n\t\treturn\n\t}\n\tif current - primaryPing > DeadPings * (PingInterval.Nanoseconds() / 1000000) && vs.confirmed == true {\n\t\tvs.confirmed = false\n\t\tnewView := &View{\n\t\t\tViewnum: view.Viewnum + 1,\n\t\t\tPrimary: view.Backup,\n\t\t\tBackup: vs.getNewBackup(view.Backup, \"\"),\n\t\t}\n\t\tvs.views = append(vs.views, newView)\n\t\treturn\n\t}\n\tif current - backupPing > DeadPings * (PingInterval.Nanoseconds() / 1000000) {\n\t\tview.Backup = vs.getNewBackup(view.Primary, \"\")\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "f1befdd3c285795e67cb2e81446b872a", "score": "0.49556115", "text": "func (c *Controller) worker() {\n\tfor c.processNextWorkItem() {\n\t}\n}", "title": "" }, { "docid": "bbbd4d608c29be3b5d0b5f9c17358b75", "score": "0.49549866", "text": "func (nc *NodeChecker) runWorker() {\n\tfor nc.processNextWorkItem() {\n\t}\n}", "title": "" }, { "docid": "5a347993cf52574c8d19b76cc2661e8d", "score": "0.4954322", "text": "func (w *Worker) callMaster(rpcname string, args interface{}, reply interface{}) bool {\n\terr := w.client.Call(rpcname, args, reply)\n\tif err == nil {\n\t\treturn true\n\t}\n\n\tErrorln(err)\n\treturn false\n}", "title": "" }, { "docid": "c782b825dce25112648cfd3d91e55eff", "score": "0.49517214", "text": "func LeaderHandleFileReplication() {\n if myIP == masterIP {\n // Run the code\n for fileName, _ := range(fileMap){\n filenodes := fileMap[fileName].nodeIds\n if len(filenodes) < 4 { \n fmt.Printf(\"[ME %d] Handling file Replication for %s\\n\",myVid,fileName)\n newnodes := getRandomNodes(filenodes, 4 - len(filenodes))\n fmt.Printf(\"Init vector %v , Added nodes %v\\n\",filenodes, newnodes)\n for _, newnode := range(newnodes) {\n acquireParallel()\n go func (fileName string, srcNode int , destNode int) {\n initiateReplica(fileName, srcNode, destNode)\n releaseParallel()\n }(fileName, filenodes[0], newnode)\n\n // go initiateReplica(fileName, filenodes[0], newnode)\n }\n }\n }\n } \n}", "title": "" }, { "docid": "41a8478cd9d6e2d6a2cd6cba54e1c8f5", "score": "0.49462345", "text": "func runOnGoSide() {\n\tfor {\n\t\tselect {\n\t\tcase fn := <-rogsChan:\n\t\t\tfn()\n\t\tdefault: // non-blocking\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6a63e098e7d5fddfd4bee98eab0050b2", "score": "0.49423826", "text": "func (aq *accountQueue) run() {\n\t// log the action\n\taq.log.Notice(\"starting account queue dispatcher\")\n\n\t// start scanner\n\taq.wg.Add(1)\n\tgo aq.monitorAccounts()\n}", "title": "" }, { "docid": "d01ef4be2edc6e76b5c4357377fdb110", "score": "0.49403945", "text": "func (pb *PBServer) tick() {\n\n\t// Your code here.\n\t// args := &viewservice.PingArgs{}\n\t// args.Me = pb.me\n\t// args.Viewnum = pb.curView.Viewnum\n\t// var reply viewservice.PingReply\n\tpb.mu.Lock()\n\tdefer pb.mu.Unlock()\n\t// ok := false\n\t// var v viewservice.View\n\t// for !ok {\n\t// \tv, ok = pb.vs.Get()\n\t// }\n\n\tv, _ := pb.vs.Ping(pb.curView.Viewnum)\n\tpb.debugPrintf(\"pb tick after ping:\\t%v\\tcurviewno:\\t%d\\trealviewno:%d\\n\", pb.vs.Getme(), pb.curView.Viewnum, v.Viewnum)\n\t// if v.Viewnum != pb.curView.Viewnum {\n\t// \tpb.debugPrintf(\"pb tick after ping again:\\t%v\\tcurviewno:\\t%d\\trealviewno:%d\\n\", pb.vs.Getme(), pb.curView.Viewnum, v.Viewnum)\n\t// \tv, _ = pb.vs.Ping(v.Viewnum)\n\t// }\n\n\tif v.Viewnum != pb.curView.Viewnum {\n\t\t// if view changed:\n\t\t// transition to new view.\n\t\t// manage transfer of state from primary to new backup.\n\t\t//for v.Viewnum != pb.curView.Viewnum {\n\t\tpb.curView = v\n\t\t// \tv, _ = pb.vs.Ping(pb.curView.Viewnum)\n\t\t// }\n\n\t\t//fmt.Println(\"change view in tick\")\n\t\tif pb.isPrimary() && pb.curView.Backup != \"\" {\n\t\t\t//fmt.Printf(\"forward whole db to backup:%d\\n\", len(pb.kv))\n\n\t\t\targs := &UpdateAppendArgs{}\n\t\t\targs.Kv = pb.kv\n\t\t\targs.Uid = pb.uid\n\t\t\tvar reply UpdateAppendReply\n\t\t\t// for k, v := range pb.kv {\n\t\t\t// \targs.Key = k\n\t\t\t// \targs.Value = v\n\t\t\t//fmt.Printf(\"foward ing\\t%s:%s\\n\", k, v)\n\t\t\tokUpdate := false\n\t\t\tpb.print()\n\t\t\tpb.debugPrintf(\"backup in tick:%v\\n\", pb.curView.Backup)\n\t\t\tfor !okUpdate && pb.curView.Backup != \"\" {\n\t\t\t\tokUpdate = call(pb.curView.Backup, \"PBServer.UpdateAll\", args, &reply)\n\t\t\t}\n\n\t\t\t//}\n\t\t\t// for k, v := range pb.uid {\n\t\t\t// \targs.Key = strconv.FormatInt(k, 10)\n\t\t\t// \targs.Value = v\n\t\t\t// \t//fmt.Printf(\"foward ing\\t%s:%s\\n\", k, v)\n\t\t\t// \tokUid := false\n\t\t\t// \tfor !okUid && pb.curView.Backup != \"\" {\n\t\t\t// \t\tokUid = call(pb.curView.Backup, \"PBServer.Updateuid\", args, &reply)\n\t\t\t// \t}\n\t\t\t// }\n\n\t\t}\n\t}\n\n\t//ok := call(pb.vs, \"ViewServer.Ping\", args, &reply)\n\t// if ok == false {\n\t// \t//pb.curView = View{}\n\t// } else {\n\t// \tpb.curView = v\n\t// }\n}", "title": "" }, { "docid": "9d08d3f4afa088d84270f9377b8d1925", "score": "0.49166295", "text": "func SingleUse(once *sync.Once) (err error) {\n\terr = ErrSingleUseReused\n\tonce.Do(func() {\n\t\terr = nil\n\t})\n\treturn\n}", "title": "" }, { "docid": "5c373b1f298d2e7f330f25c0d8a90442", "score": "0.4914219", "text": "func (s *state) sync() (inSync bool) {\n\ts.LockAll()\n\tdefer s.UnlockAll()\n\n\ts.msg.Allocate(s.where.RoomId, s.rLocks)\n\tl := s.TotalLocks()\n\n\tdispatchHandler(s)\n\n\tif l-s.TotalLocks() == 0 {\n\t\tinSync = true\n\t\ts.messenger()\n\t}\n\treturn\n}", "title": "" }, { "docid": "207fd7b6d495f9849e18e3fc0fde0326", "score": "0.49108088", "text": "func sayHello() {\n\t//m.RLock() // locks for reading.\n\tfmt.Printf(\"Hello #%v\\n\", counter)\n\tm.RUnlock()\n\twg.Done()\n}", "title": "" }, { "docid": "4eb4fb855ed9468b264c9c89369b9b20", "score": "0.49053028", "text": "func Lock() {\n\tmutex.Lock()\n}", "title": "" }, { "docid": "61ba85b6ad0918fed95ff0dfcbdebbc6", "score": "0.49045447", "text": "func (z *Zone) Lock() { z.mutex.Lock() }", "title": "" }, { "docid": "8e7563feb8277b68b1190ff2cbc782f5", "score": "0.49038875", "text": "func (c *controller) run(stopCh <-chan struct{}, clientset kubernetes.Interface, edgenetClientset versioned.Interface) {\n\t// A Go panic which includes logging and terminating\n\tdefer utilruntime.HandleCrash()\n\t// Shutdown after all goroutines have done\n\tdefer c.queue.ShutDown()\n\tc.logger.Info(\"run: initiating\")\n\tc.handler.Init(clientset, edgenetClientset)\n\t// Run the informer to list and watch resources\n\tgo c.informer.Run(stopCh)\n\tgo c.nodeInformer.Run(stopCh)\n\n\t// Synchronization to settle resources one\n\tif !cache.WaitForCacheSync(stopCh, c.informer.HasSynced, c.nodeInformer.HasSynced) {\n\t\tutilruntime.HandleError(fmt.Errorf(\"Error syncing cache\"))\n\t\treturn\n\t}\n\tc.logger.Info(\"run: cache sync complete\")\n\t// Operate the runWorker\n\tgo wait.Until(c.runWorker, time.Second, stopCh)\n\n\t<-stopCh\n}", "title": "" }, { "docid": "9690b29fcbdb18493f4bafda2c5ed1a9", "score": "0.49007124", "text": "func Sync() {\n\tstd.logger.Sync()\n}", "title": "" }, { "docid": "b0f29bf1a276024613243da03e249e3a", "score": "0.4895198", "text": "func OneShot(m *Server) error {\n\tm.oneShot = true\n\treturn nil\n}", "title": "" }, { "docid": "7b5e678cf3de498a6eece6167e53793a", "score": "0.489142", "text": "func (tm *TorrentQueue) Lock() {\n\ttm.mutex.Lock()\n}", "title": "" }, { "docid": "b5a39ba293551e29bd6cde5b64b6fac1", "score": "0.48893183", "text": "func TestConcurrent(t *testing.T) {\n\tm := memo.New(httpGetBody)\n\tdefer m.Close()\n\tmemotest.Concurrent(t, m)\n}", "title": "" }, { "docid": "213417a55d36cc4f8166e289912f0834", "score": "0.488313", "text": "func (pc *parentController) worker() {\n\tfor pc.processNextWorkItem() {\n\t}\n}", "title": "" }, { "docid": "6f4cfe34f8189889e8382de2e30b631f", "score": "0.48820812", "text": "func (m *Controller) run() {\n\tt := time.NewTicker(50 * time.Millisecond)\n\tfor {\n\t\tselect {\n\t\tcase req := <-m.i2cReq:\n\t\t\theap.Push(&m.reqQ, &req)\n\n\t\tcase <-m.quit:\n\t\t\treturn\n\n\t\tcase <-t.C:\n\t\t\tif m.reqQ.Len() > 0 {\n\t\t\t\treq := heap.Pop(&m.reqQ).(*req)\n\t\t\t\tif err := m.send(req.reqData.deviceID, req.reqData.pkt); err != nil {\n\t\t\t\t\treq.retChan <- ret{\n\t\t\t\t\t\terr: err,\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tpkt, err := m.recv(req.reqData.deviceID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treq.retChan <- ret{\n\t\t\t\t\t\terr: err,\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treq.retChan <- ret{\n\t\t\t\t\tretData: data{\n\t\t\t\t\t\tdeviceID: req.reqData.deviceID,\n\t\t\t\t\t\tpkt: pkt,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8f7f54cb5e2bbc419632886998ead190", "score": "0.48787972", "text": "func (n *Node) startNextRequest() {\n\t// fmt.Println(\"<<<<<<<<< Length of REQ LIST\", len(n.CMStore.ReqList))\n\n\tif len(n.CMStore.ReqList) > 0 {\n\t\tnextReq := n.CMStore.ReqList[0]\n\t\tn.Pals[nextReq.Sender].Lock = true\n\t\townerID := n.CMStore.AllPages[nextReq.Req.Page].OwnerID\n\n\t\tif nextReq.Type == ReadQuery {\n\t\t\t// if ReadQuery request\n\t\t\t// fmt.Println(\"CM\", n.ID, \"\\nStarting ReadQuery by Node\", nextReq.Sender)\n\t\t\tn.CMStore.AllPages[nextReq.Req.Page].CopySet = append(n.CMStore.AllPages[nextReq.Req.Page].CopySet, nextReq.Sender)\n\t\t\tn.CMStore.AllPages[nextReq.Req.Page].Lock = true\n\t\t\tforwardMsg := Message{\n\t\t\t\tReq: nextReq.Req,\n\t\t\t\tSender: n.ID,\n\t\t\t\tType: ReadForward,\n\t\t\t}\n\t\t\tn.send(forwardMsg, n.Pals[ownerID])\n\n\t\t} else if nextReq.Type == WriteQuery {\n\t\t\t// if WriteQuery request\n\t\t\t// fmt.Println(\"CM\", n.ID, \"\\nStarting WriteQuery by Node\", nextReq.Sender)\n\t\t\tn.CMStore.AllPages[nextReq.Req.Page].Lock = true\n\t\t\tinvMsg := Message{\n\t\t\t\tReq: nextReq.Req,\n\t\t\t\tSender: n.ID,\n\t\t\t\tType: Invalidate,\n\t\t\t}\n\t\t\tfor _, copyID := range n.CMStore.AllPages[nextReq.Req.Page].CopySet {\n\t\t\t\tn.send(invMsg, n.Pals[copyID])\n\t\t\t}\n\n\t\t\t// wait for invalidation confirmation\n\t\t\tif len(n.CMStore.AllPages[nextReq.Req.Page].CopySet) != 0 {\n\t\t\t\tvar replies int\n\t\t\t\tn.CMStore.AllPages[nextReq.Req.Page].Lock = false\n\t\t\t\tfor replies < len(n.CMStore.AllPages[nextReq.Req.Page].CopySet) {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase invConfirm := <-n.Channel:\n\t\t\t\t\t\tif invConfirm.Type == InvalidConfirm {\n\t\t\t\t\t\t\tfmt.Println(\"Node\", n.ID, \"received\", invConfirm.Type, \"from Node\", invConfirm.Sender)\n\t\t\t\t\t\t\treplies++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No one in copyset just WRITE\")\n\t\t\t}\n\n\t\t\t// clear current CopySet\n\t\t\tn.CMStore.AllPages[nextReq.Req.Page].Lock = true\n\t\t\tn.CMStore.AllPages[nextReq.Req.Page].CopySet = []int{}\n\n\t\t\tforwardMsg := Message{\n\t\t\t\tReq: nextReq.Req,\n\t\t\t\tSender: n.ID,\n\t\t\t\tType: WriteForward,\n\t\t\t}\n\t\t\tn.send(forwardMsg, n.Pals[ownerID])\n\t\t}\n\n\t} else {\n\t\tfmt.Println(\"All requests completed.\")\n\t}\n}", "title": "" }, { "docid": "1c0c56b0e2ff4383c04dd317aeff7462", "score": "0.4874545", "text": "func main() {\n\tgo goPost()\n\tgo goGet()\n\ttime.Sleep(5 * time.Second)\n}", "title": "" }, { "docid": "fd3ce9830d23596cb1c984f61646f56c", "score": "0.4870717", "text": "func (vs *ViewServer) tick() {\n vs.mu.Lock()\n defer vs.mu.Unlock()\n time := time.Now()\n for _, state:= range vs.clientStates{\n // fmt.Println(\"state:\", state)\n // fmt.Println(\"tick name:\", name)\n // fmt.Println(\"view for this tick:\\t\\t\", vs.view)\n cutoffTime := state.TimeSeen.Add(PingInterval * DeadPings)\n if time.After(cutoffTime) {\n // fmt.Println(\"tick:\\t\\tafter cutoff:\", name)\n // fmt.Println(\"tick:\\t\\ttest primary:\", vs.view.Primary, \"equals name:\", state.Name)\n if vs.view.Primary == state.Name && !vs.primaryUnacked{\n // fmt.Println(\"tick:\\t\\tpromoting backup to primary:\", vs.view.Backup, \"hotSpareClient:\", vs.hotSpareClient)\n // *vs.clientStates[state.Name].Status = Idle\n // *vs.clientStates[vs.view.Backup].Status = Primary\n // if vs.hotSpareClient != \"\"{\n // *vs.clientStates[vs.hotSpareClient].Status = Backup\n // }\n // fmt.Println(\"TICK updating view before primary acks\")\n vs.primaryUnacked = true\n // fmt.Println(\"tick promote\")\n vs.view.PromoteBackup(vs.hotSpareClient)\n vs.hotSpareClient = \"\"\n }\n if vs.view.Backup == state.Name && !vs.primaryUnacked{\n // fmt.Println(\"tick:\\t\\tpromoting spare to backup:\", vs.view.Backup, \"hotSpareClient:\", vs.hotSpareClient)\n vs.view.PromoteSpare(vs.hotSpareClient)\n vs.hotSpareClient = \"\"\n }\n }\n }\n // Your code here.\n\n\n}", "title": "" }, { "docid": "f7b9a8cf8f10828494179113efd644c7", "score": "0.48697662", "text": "func (c *controller) runWorker() {\n\tlog.Info(\"runWorker: starting\")\n\t// Run processNextItem for all the changes\n\tfor c.processNextItem() {\n\t\tlog.Info(\"runWorker: processing next item\")\n\t}\n\n\tlog.Info(\"runWorker: completed\")\n}", "title": "" }, { "docid": "ec178e7e2819c33b620f74334dcf42a6", "score": "0.4867406", "text": "func worker(feed api.Feed, crypto api.Crypto, tasks <-chan int, username string, password string, proxyURL string, f *os.File) {\n\tred := redis.NewClient(&redis.Options{\n\t\tAddr: \"localhost:6379\",\n\t\tPassword: \"\", // no password set\n\t\tDB: 0, // use default DB\n\t})\n\n\tctx := context.Background()\n\n\t// Initialize a new authentication provider to retrieve an access token\n\tprovider, err := auth.NewProvider(\"ptc\", username, password)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\t// this worker will use the first proxy that appeared per account for that account\n\tsession := api.NewSession(provider, &api.Location{}, feed, crypto, false)\n\n\t//rpc, err := api.ProxyRPC(proxyURL)\n\t//session.SetRPC(rpc)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tisSessionInit := false\n\n\tfor {\n\t\ttask, ok := <-tasks\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\n\t\tpoints, err := queryplan.GetQueryPoint(float64(7.5), red, username)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\n\t\tp := points[0]\n\n\t\tlocation := &api.Location{\n\t\t\tLon: p.Lng,\n\t\t\tLat: p.Lat,\n\t\t\tAlt: 1.0,\n\t\t}\n\n\t\tif !isSessionInit {\n\t\t\tsession.MoveTo(location)\n\t\t\tfmt.Printf(\"Logging in: %s at %s\\n\", username, proxyURL)\n\t\t\terr = session.Init(ctx)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(err)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tisSessionInit = true\n\t\t\t}\n\t\t} else {\n\t\t\tsession.MoveTo(location)\n\t\t}\n\n\t\tobjects, err := session.GetPlayerMap(ctx)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tcontinue\n\t\t}\n\n\t\toutObjects, err := json.Marshal(objects)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tcells := objects.GetMapCells()\n\t\tfor _, cell := range cells {\n\t\t\tif len(cell.GetForts()) > 0 {\n\t\t\t\t// record proxy urls successfully queried to file\n\t\t\t\tif _, err = f.WriteString(proxyURL + \"\\n\"); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(string(outObjects))\n\n\t\tqueryplan.StoreQueryPointWithTime(red, username, p)\n\n\t\t//time.Sleep(time.Duration(task) * time.Millisecond)\n\t\t//fmt.Println(points)\n\t\tfmt.Println(task)\n\t\tfmt.Println(username)\n\t}\n}", "title": "" }, { "docid": "abb769feb3fe12f4e4b69dd696429437", "score": "0.48658076", "text": "func (df *Deferrer) worker() {\n for {\n select {\n case tk := <-df.workQueue:\n tk.cb.Invoke()\n case <-df.quit:\n return\n }\n }\n}", "title": "" }, { "docid": "554171420732fcd78b4d8f492af2771d", "score": "0.48590177", "text": "func (w *Worker) start() {\nloop:\n\tfor {\n\t\tselect {\n\t\tcase job := <-w.jobchan:\n\t\t\tw.njob++\n\t\t\tw.handler(job.key, job.data)\n\t\t\tw.ndone++\n\t\tcase <-w.quit:\n\t\t\tbreak loop\n\t\tcase <-time.After(TIMEOUT):\n\t\t\tw.mgr.Lock()\n\t\t\tif len(w.jobchan) == 0 {\n\t\t\t\tw.mgr.removeWorker(w.id)\n\t\t\t\tw.mgr.Unlock()\n\t\t\t\tbreak loop\n\t\t\t}\n\t\t\tw.mgr.Unlock()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "febe3daae51c82eae405b081287bb13d", "score": "0.48583618", "text": "func (h *Hub) run() {\n\tfor {\n\t\tselect {\n\t\tcase client := <-h.register:\n\t\t\th.peerset[client] = true\n\t\t\th.Register(client)\n\t\t\ttime.Sleep(time.Second)\n\t\t\th.Broadcast(h.peerlist())\n\t\tcase client := <-h.unregister:\n\t\t\tif _, ok := h.peerset[client]; ok {\n\t\t\t\tdelete(h.peerset, client)\n\t\t\t}\n\t\t\th.Unregister(client)\n\t\t\ttime.Sleep(time.Second)\n\t\t\th.Broadcast(h.peerlist())\n\t\tcase message := <-h.broadcast:\n\t\t\th.Broadcast(message)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bc047be2da94deaabfb29b81fcabcd86", "score": "0.48574024", "text": "func mutex() {\n\tc := SafeCounter{v: make(map[string]int)}\n\tfor i := 0; i < 1000; i++ {\n\t\tgo c.Inc(\"somekey\")\n\t}\n\ttime.Sleep(time.Nanosecond * 100)\n\tfmt.Println(c.Value(\"somekey\"))\n}", "title": "" }, { "docid": "0063bfb38b361d6cad0ba65d17810d6e", "score": "0.48540047", "text": "func (df *Deferrer) dispatcher() {\n // priority queue of callback tasks. Since this data structure is used only\n // inside this Goroutine in a single threaded way, we don't need any locks\n // to guard it.\n callbacks := taskQueue{}\n\n heap.Init(&callbacks)\n\n // proxy for infinite duration (an year in this case :))\n veryLongDuration := 365 * 24 * time.Hour\n\n // wakeUpAt refers to an event which will be fired at the earliest callback\n // task in the queue.\n wakeUpAt := time.NewTimer(veryLongDuration)\n\n // following inifite loop wakes up in following condition\n // * When new callback is inserted\n // * or when next callback needs to be executed\n // * or quit signal was sent.\n for {\n select {\n case task := <-df.taskInChan:\n callbacks.Push(task)\n case <-wakeUpAt.C:\n // time for next task execution\n case <-df.quit:\n return\n }\n // we are here means new task pushed or next task to be executed\n for _, tk := range callbacks.popRunnableTasks() {\n df.workQueue <- tk\n }\n // adjust the wakeUpAt accordingly\n if callbacks.Len() > 0 {\n earliestTaskAt := callbacks[0].runAt\n wakeUpAt.Reset(earliestTaskAt.Sub(time.Now()))\n } else {\n wakeUpAt.Reset(veryLongDuration)\n }\n }\n}", "title": "" }, { "docid": "4a59f98619a9c61e19ba50793891f709", "score": "0.48511502", "text": "func (m *ImageManager) runWorker() {\n\tfor m.processNextWorkItem() {\n\t}\n}", "title": "" }, { "docid": "f206fece56137ad9b938cfeba0d08b1d", "score": "0.48502174", "text": "func resumeThread()", "title": "" }, { "docid": "bc3f0ff1de5c25188645902941beeb0d", "score": "0.4847141", "text": "func processSingleQueue(queue *EventPool) {\n\tduration := time.Millisecond * 100\n\tfor {\n\t\tif queue.len() > GlobalConfig.SEND_MAX {\n\t\t\tduration = time.Microsecond * time.Duration(queue.len())\n\t\t\tif duration.Seconds() > float64(GlobalConfig.MAX_INTERVAL_WAIT_TIME) {\n\t\t\t\tduration = time.Second * time.Duration(GlobalConfig.MAX_INTERVAL_WAIT_TIME)\n\t\t\t}\n\t\t}\n\t\tif !queue.mute {\n\t\t\tevent := queue.getQueueEvent()\n\t\t\tif queue.mute {\n\t\t\t\tqueue.putQueueEvent(event)\n\t\t\t} else {\n\t\t\t\tgo processSingleEvent(event)\n\t\t\t}\n\t\t}\n\t\ttime.Sleep(duration)\n\t}\n}", "title": "" }, { "docid": "2705b5bc9d149d4ee81d0928298a7996", "score": "0.48454612", "text": "func publicationBarrier()", "title": "" }, { "docid": "556dcf1a02f4cc9145f98f9f0c0321ac", "score": "0.48449036", "text": "func (px *Paxos) handleTeach(serverName string, maxDone int, log map[int]interface{}){\n px.mu.Lock()\n defer px.mu.Unlock()\n //update log\n for key,val := range log{\n px.log[key] = val\n }\n px.peersMap[serverName] = maxDone\n\n //update minSeq and clean up\n px.setMin()\n px.cleanUp()\n\n}", "title": "" } ]
444b25ef29870fee0f828345d6321942
GetTotalHits returns the TotalHits field value
[ { "docid": "9ac66559bd3154dfb7c751b48b257cfa", "score": "0.7767183", "text": "func (o *MessageSearchResult) GetTotalHits() int64 {\n\tif o == nil {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\n\treturn o.TotalHits\n}", "title": "" } ]
[ { "docid": "5d900518b189a359eadddd540818b8bb", "score": "0.7483566", "text": "func (s *Stats) TotalHits() int {\n\treturn len(s.Hits)\n}", "title": "" }, { "docid": "40eedfb20045629383f583b979e7e1ac", "score": "0.6920994", "text": "func (s *Stats) TotalBytesHits() units.Size {\n\tout := units.Size(0)\n\tfor _, i := range s.Hits {\n\t\tout += i\n\t}\n\treturn out\n}", "title": "" }, { "docid": "8367e6402abb180b22a59c22d4d5e1b9", "score": "0.68003434", "text": "func (o *MessageSearchResult) GetTotalHitsOk() (*int64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.TotalHits, true\n}", "title": "" }, { "docid": "1f6a98c48aa8c2ccd81fdce965a6b1e6", "score": "0.66195637", "text": "func (s *HTTPSearcher) GetTotal() int64 {\n\ts.RLock()\n\tdefer s.RUnlock()\n\treturn s.total\n}", "title": "" }, { "docid": "1ae3e706163a97b7afe5d13eb5bb5538", "score": "0.64732885", "text": "func (o *MessageSearchResult) SetTotalHits(v int64) {\n\to.TotalHits = v\n}", "title": "" }, { "docid": "eba60a3c539b8c2bd326e1e23bca8a37", "score": "0.6467331", "text": "func (o *ActressOptions) GetHits() int {\n\treturn o.Hits\n}", "title": "" }, { "docid": "6997807af48e349981e6b418c1bd6e91", "score": "0.645945", "text": "func NumHits(cache Cache) int64 {\n\treturn cache.NumHits()\n}", "title": "" }, { "docid": "7364e96e696551a8d3f663a8ed8496ca", "score": "0.64188784", "text": "func (s *CacheStats) getHits() uint64 {\n\treturn s.Hits.Load()\n}", "title": "" }, { "docid": "35acc180a44233d127070176c40fbd93", "score": "0.6335328", "text": "func (this *HitCounter) GetHits(timestamp int) int {\n\ts := 0\n\tfor i, _ := range this.hit_count {\n\t\tif this.hit_time[i] > timestamp-300 {\n\t\t\ts += this.hit_count[i]\n\t\t}\n\t}\n\treturn s\n}", "title": "" }, { "docid": "6cdafb87fa1241d6c373eea0662d9df8", "score": "0.6239309", "text": "func (s *SearchSource) TrackTotalHits(trackTotalHits interface{}) *SearchSource {\n\ts.trackTotalHits = trackTotalHits\n\treturn s\n}", "title": "" }, { "docid": "48fce8d4a6097028464f3527a140ae0b", "score": "0.60215163", "text": "func (o *FloorOptions) GetHits() int {\n\treturn 0\n}", "title": "" }, { "docid": "0a575d50296daa68a0c91cf7e323393d", "score": "0.5977001", "text": "func (o *MessageSearchResult) GetHits() []Message {\n\tif o == nil {\n\t\tvar ret []Message\n\t\treturn ret\n\t}\n\n\treturn o.Hits\n}", "title": "" }, { "docid": "2fd315f1dbe58ebb0739f7cfb4f4be81", "score": "0.59317", "text": "func (sm *StreamMap) GetTotal(key string) int {\n return sm.sMap[key].total\n}", "title": "" }, { "docid": "0ddbb934e6f800bbc049dc9cbae0bb51", "score": "0.59004664", "text": "func (r *redisManager) StatsTotal() int {\n\tkey := fmt.Sprintf(\"%s:stats_total\", keyPrefix)\n\tval, err := r.get(key)\n\tif err != nil {\n\t\treturn 0\n\t}\n\tvalInt, err := strconv.Atoi(val)\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn valInt\n}", "title": "" }, { "docid": "4b6ace4fbc0c7b021fe33ff2bd3ff68d", "score": "0.5885752", "text": "func (o *SearchRecipes200Response) GetTotalResults() int32 {\n\tif o == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\n\treturn o.TotalResults\n}", "title": "" }, { "docid": "9e9ab7846b99c00c3359355aa673a757", "score": "0.5873504", "text": "func (o *MonitorSearchResponseMetadata) GetTotalCount() int64 {\n\tif o == nil || o.TotalCount == nil {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\treturn *o.TotalCount\n}", "title": "" }, { "docid": "207a322c7cb6aa2fb01cb2389c9966b2", "score": "0.5867445", "text": "func (s Stats) Total() int {\n\treturn s.Strength +\n\t\ts.Dexterity +\n\t\ts.Constitution +\n\t\ts.Wisdom +\n\t\ts.Intelligence +\n\t\ts.Charisma\n}", "title": "" }, { "docid": "331854d26f236c9e5a47375188df91e4", "score": "0.58321035", "text": "func (report *Report) TotalCount() int64 {\n\treturn report.Stats.KilledCount + report.Stats.EscapedCount + report.Stats.ErrorCount + report.Stats.SkippedCount\n}", "title": "" }, { "docid": "3e3b06fb0335585011d74de00a7f575e", "score": "0.57998574", "text": "func (o *GetWineRecommendation200Response) GetTotalFound() int32 {\n\tif o == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\n\treturn o.TotalFound\n}", "title": "" }, { "docid": "2efecaa5573b2d17b4d70591b9688814", "score": "0.578657", "text": "func (o *ResultListPage) GetTotal() float32 {\n\tif o == nil {\n\t\tvar ret float32\n\t\treturn ret\n\t}\n\n\treturn o.Total\n}", "title": "" }, { "docid": "a3879dc0ce7881383ffb3e3f80bb3258", "score": "0.575681", "text": "func (s *State) hits(n int) int {\n\tif n <= 0 || n > 20 { // out of range\n\t\treturn 0\n\t}\n\n\tif s.wieldingLance() {\n\t\treturn 10000\n\t}\n\n\tc := s.C.Stats\n\tdmg := n * ((c.Wc >> 1) + int(c.Str) + c.StrExtra - s.difficulty - 12 + c.MoreDmg)\n\tif dmg >= 1 {\n\t\treturn dmg\n\t}\n\n\treturn n\n}", "title": "" }, { "docid": "ed7551889857254e79ed3517ec1cdf92", "score": "0.565259", "text": "func (o *Orchestrator) GetHits() map[string]map[string]int {\n\tvar result = make(map[string]map[string]int)\n\tfor _, p := range o.Processed {\n\t\tresult[p.URL.String()] = p.Children\n\t}\n\treturn result\n}", "title": "" }, { "docid": "59749b8458c10381d366f19389c84dad", "score": "0.5626762", "text": "func (c *noopCache) GetCacheHits() uint64 {\n\treturn 0\n}", "title": "" }, { "docid": "fadcd179c305a31cbe9d57e7045c4daa", "score": "0.5616925", "text": "func (i *Indexer) Total() int {\n\treturn i.wcount\n}", "title": "" }, { "docid": "107e171941030d3a4e84439b74670765", "score": "0.5568944", "text": "func (c *MapCacheProvider) Total(namespace string) (res int, err error) {\n\treturn len(c.getNamespace(namespace).data), nil\n}", "title": "" }, { "docid": "840823feaa76ba3fff39054a75b657c9", "score": "0.5538361", "text": "func (d dynamo) Count() (v uint64, err error) {\n\tresult, err := d.client.UpdateItem(context.Background(), updateCounterInput())\n\tif err != nil {\n\t\treturn v, err\n\t}\n\toutput, ok := result.Attributes[\"hit\"].(*types.AttributeValueMemberN)\n\tif !ok {\n\t\treturn v, errors.New(\"typecasting failed for hit\")\n\t}\n\treturn strconv.ParseUint(output.Value, 10, 64)\n}", "title": "" }, { "docid": "36c17e688dcc4ab767b4c1406913c57f", "score": "0.5525842", "text": "func (o *BitlinkOverrideHistory) GetTotalCount() int32 {\n\tif o == nil || o.TotalCount == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\treturn *o.TotalCount\n}", "title": "" }, { "docid": "8a084b4fb05f9b067c77cb768125b9ff", "score": "0.55041224", "text": "func (pncounter PNCounter) GetTotal() int {\n\t// Return the total count\n\treturn pncounter.Add.GetTotal() - pncounter.Delete.GetTotal()\n}", "title": "" }, { "docid": "f61c8596e1e69ae1ca8993ff6a7efce4", "score": "0.54843384", "text": "func (o TestSuiteOverviewResponseOutput) TotalCount() pulumi.IntOutput {\n\treturn o.ApplyT(func(v TestSuiteOverviewResponse) int { return v.TotalCount }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "c48a90ba1d6ee340d4dfae12ac28a6cf", "score": "0.54829913", "text": "func getMyHits() (hits uint32) {\n\tPanicIfCallerNotPlaying()\n\tcallerAddress := address.GetCallerAddress()\n\tgames := make(games)\n\tgames.getGamesFromState()\n\trelevantGame := games[state.ReadUint64ByAddress(callerAddress)]\n\tif bytes.Equal(callerAddress, relevantGame.Player1) {\n\t\treturn uint32(relevantGame.Player1Hits)\n\t}\n\tif bytes.Equal(callerAddress, relevantGame.Player2) {\n\t\treturn uint32(relevantGame.Player2Hits)\n\t}\n\tpanic(\"you are not registered for this game\")\n\n}", "title": "" }, { "docid": "8af6afe9fc4169140d89e1945f7983a3", "score": "0.54661846", "text": "func (a *User) GetUserTotal(maps interface{}) (int64, error) {\n\tvar count int64\n\terr := a.Session.db.Model(&User{}).Where(maps).Count(&count).Error\n\treturn count, err\n}", "title": "" }, { "docid": "c2e9fcd8a7af51c2bca6c889fef6fff6", "score": "0.5446554", "text": "func GetTotalRequestCount() {\n\tfor key := range totalRequests.m {\n\t\tlog.Printf(\"total request count of use case %v %v\", key, totalRequests.Get(key))\n\t}\n}", "title": "" }, { "docid": "33b699a8d3d74c9c7ee83fa912501756", "score": "0.5444309", "text": "func (o *MultipleDeviceMonitoring) GetTotal() int64 {\n\tif o == nil {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\n\treturn o.Total\n}", "title": "" }, { "docid": "227dd72571f1f548c9bb01144ffb47eb", "score": "0.5424065", "text": "func (ah *ArchiveHealer) TotalHealed() int64 {\n\treturn ah.totalHealed\n}", "title": "" }, { "docid": "42465d5fbdc15dc84221e2b23aba42cf", "score": "0.540822", "text": "func (o *PkgListResponse) GetTotal() float32 {\n\tif o == nil || o.Total == nil {\n\t\tvar ret float32\n\t\treturn ret\n\t}\n\treturn *o.Total\n}", "title": "" }, { "docid": "5aa0eda515adc5321152702b5a383ffa", "score": "0.53972614", "text": "func (a *DataAuditResult) GetHit() uint32 {\n\tif a != nil {\n\t\treturn a.hit\n\t}\n\n\treturn 0\n}", "title": "" }, { "docid": "1edc571c3e335fb21620dae303b9320d", "score": "0.53966475", "text": "func (o *MessageSearchResult) GetHitsOk() ([]Message, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Hits, true\n}", "title": "" }, { "docid": "7cfe1fdb3f2ddd338855098de04725f1", "score": "0.53883606", "text": "func (o *EntitiesList) GetTotalCount() int64 {\n\tif o == nil {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\n\treturn o.TotalCount\n}", "title": "" }, { "docid": "3d3a8596fc96a4c3f72cc0e33b6875b8", "score": "0.53863794", "text": "func (s *MemStat) Total() float64 {\n\to := s.Metrics\n\treturn o.MemTotal.Get()\n}", "title": "" }, { "docid": "65f4a807735919291cb4f82c0104ad86", "score": "0.53686386", "text": "func countTotal(ctx context.Context, db *gorm.DB) {\n\tif dest, ok := ctx.Value(totalKey).(*uint64); ok {\n\t\tdb.Count(dest)\n\t}\n}", "title": "" }, { "docid": "85de5f44b303584a5657ea02a326844e", "score": "0.53592503", "text": "func (c *BigCache) Stats() Stats {\n\tvar s Stats\n\tfor _, shard := range c.shards {\n\t\ttmp := shard.getStats()\n\t\ts.Hits += tmp.Hits\n\t\ts.Misses += tmp.Misses\n\t\ts.DelHits += tmp.DelHits\n\t\ts.DelMisses += tmp.DelMisses\n\t\ts.Collisions += tmp.Collisions\n\t\ts.EvictedExpired += tmp.EvictedExpired\n\t\ts.EvictedNoSpace += tmp.EvictedNoSpace\n\t}\n\treturn s\n}", "title": "" }, { "docid": "8146fa308ff06629083039d7e6edf68c", "score": "0.53397536", "text": "func TestGetTotal(t *testing.T) {\n\tgcounter.Count = gcounter.SetCount(\"testNode1\", 1)\n\tgcounter.Count = gcounter.SetCount(\"testNode2\", 3)\n\tgcounter.Count = gcounter.SetCount(\"testNode3\", 5)\n\n\texpectedCount := 9\n\tactualCount := gcounter.GetTotal()\n\n\tassert.Equal(t, expectedCount, actualCount)\n\n\tgcounter.Count = gcounter.Clear(testNode)\n}", "title": "" }, { "docid": "266a443b56d40dc24befa72be2243637", "score": "0.532881", "text": "func getMaxHits(collection *mongo.Collection) {\n\t// Filter for our data\n\tfindResults, err := collection.Find(\n\t\t// The filter parameter\n\t\t&item{\n\t\t\tDefinition: \"some-definition\",\n\t\t},\n\t\t// Sorting the result.\n\t\t// 1 = Ascending Order (default)\n\t\t// -1 = Descending Order\n\t\tfindopt.Sort(\n\t\t\tmap[string]interface{}{\n\t\t\t\t\"hits\": -1,\n\t\t\t},\n\t\t),\n\t\t// We only want the maximum value\n\t\tfindopt.Limit(1),\n\t)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tlog.Println(\"Find Results (max value of \\\"Hits\\\"):\")\n\tfor _, r := range findResults {\n\t\tdbItem := r.(*item)\n\t\t// Can do dbItem.Hits to just display \"Hits\"\n\t\tlog.Printf(\"%+v\\n\", dbItem)\n\t}\n}", "title": "" }, { "docid": "3a62edbef8ba1433987c4a84eb35c8ff", "score": "0.5324276", "text": "func (c *RoomsStatusCount) Total() int {\n\treturn c.Creating + c.Occupied + c.Ready + c.Terminating\n}", "title": "" }, { "docid": "48132ebe86674e19c2ef36ebf3f329f7", "score": "0.5313142", "text": "func (o *SourceGcs) GetObjectCountTotal() int64 {\n\tif o == nil || IsNil(o.ObjectCountTotal) {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\treturn *o.ObjectCountTotal\n}", "title": "" }, { "docid": "c383135bb06cb6f0bd26a6ffa2f8d2bb", "score": "0.5301531", "text": "func (c *CPUTimesStat) Total() float64 {\n\ttotal := c.User + c.System + c.Nice + c.Iowait + c.Irq + c.Softirq + c.Steal + c.Guest + c.GuestNice + c.Idle + c.Stolen\n\treturn total\n}", "title": "" }, { "docid": "e52ed483bc6db8b186b6a7fc18567b73", "score": "0.5297233", "text": "func (o TestSuiteOverviewOutput) TotalCount() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v TestSuiteOverview) *int { return v.TotalCount }).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "42aff65c767da1377f9908ce53e69c42", "score": "0.5282712", "text": "func (c *Counter) getCount(ctx context.Context, docRef *firestore.DocumentRef) (int64, error) {\n\tvar total int64\n\tshards := docRef.Collection(\"shards\").Documents(ctx)\n\tfor {\n\t\tdoc, err := shards.Next()\n\t\tif err == iterator.Done {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn 0, fmt.Errorf(\"Next: %w\", err)\n\t\t}\n\n\t\tvTotal := doc.Data()[\"Count\"]\n\t\tshardCount, ok := vTotal.(int64)\n\t\tif !ok {\n\t\t\treturn 0, fmt.Errorf(\"firestore: invalid dataType %T, want int64\", vTotal)\n\t\t}\n\t\ttotal += shardCount\n\t}\n\treturn total, nil\n}", "title": "" }, { "docid": "792ac2913480e63e46df568409a3d505", "score": "0.52643174", "text": "func Total() int {\n\treturn len(data)\n}", "title": "" }, { "docid": "fe30fc0a758d87ce65569a91e5c74894", "score": "0.5230172", "text": "func (a ActorActivity) Total() int {\n\treturn a.PushedCommits + a.CreatedPullRequests\n}", "title": "" }, { "docid": "0f6bc9b5d481744a955fe6558c39d5d5", "score": "0.5224277", "text": "func (t *Tag) Total() int64 {\n\treturn atomic.LoadInt64(&t.total)\n}", "title": "" }, { "docid": "23276c29738b8e6155b7f054bd6f50b7", "score": "0.5221984", "text": "func (b *bleveIterator) TotalCount() uint64 {\n\tif b.rs == nil {\n\t\treturn 0\n\t}\n\treturn b.rs.Total\n}", "title": "" }, { "docid": "a37e937a03269362d808b7fc32ccb728", "score": "0.522086", "text": "func (td *TDsize) Total() int {\n\treturn td.X * td.Y * td.Z\n}", "title": "" }, { "docid": "e9e073e474dd2f8a435a93d15869c445", "score": "0.5216363", "text": "func (t *Trie) Total() (total int) {\n\ttotal = t.count\n\tfor _, child := range t.children {\n\t\ttotal += child.Total()\n\t}\n\treturn total\n}", "title": "" }, { "docid": "93eb0e4a8220614b3631739964706317", "score": "0.51888907", "text": "func (h *handler) ScrollTotal() mgl32.Vec2 {\n\treturn h.scroll\n}", "title": "" }, { "docid": "acf1dbd848dcd5503d312da9a9f01440", "score": "0.5186564", "text": "func (p *proxy) TotalStaked() (*hexutil.Big, error) {\n\t// try cache first\n\tvalue := p.cache.PullTotalStaked()\n\tif value != nil {\n\t\tp.log.Debugf(\"total staked amount loaded from memory cache\")\n\t\treturn value, nil\n\t}\n\n\t// get the actual live value\n\ttotal, err := p.rpc.TotalStaked()\n\tif err != nil {\n\t\tp.log.Errorf(\"can not get the total staked amount; %s\", err.Error())\n\t\treturn nil, err\n\t}\n\n\t// store in cache\n\tif err := p.cache.PushTotalStaked((*hexutil.Big)(total)); err != nil {\n\t\t// log issue\n\t\tp.log.Errorf(\"can not store total staked amount in memory; %s\", err.Error())\n\t}\n\n\t// return the value\n\treturn (*hexutil.Big)(total), nil\n}", "title": "" }, { "docid": "7cc297118739e9031d8add361f07bb89", "score": "0.5185367", "text": "func (r WorkItemsSummaryResolver) TotalCount() int32 {\n\treturn r.totalCount\n}", "title": "" }, { "docid": "8628f6314afa1b52ed9a53602c7adba0", "score": "0.51646847", "text": "func (u *Unigrams) Total() uint64 {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn u.total\n}", "title": "" }, { "docid": "31d54a067c788bdb43d8087d24bdd672", "score": "0.51454663", "text": "func (_WTContracts *WTContractsCaller) Total(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _WTContracts.contract.Call(opts, out, \"total\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "b9cfb6c31cdd4660a6b532b0369a61e9", "score": "0.5133974", "text": "func (t *Trigrams) Total() uint64 {\n\tif t == nil {\n\t\treturn 0\n\t}\n\treturn t.total\n}", "title": "" }, { "docid": "a9a85b28b9162a5cc17edfa245d62dbd", "score": "0.5129837", "text": "func (o *StatsAppliancesListAllOfDiskInfo) GetTotal() float32 {\n\tif o == nil || o.Total == nil {\n\t\tvar ret float32\n\t\treturn ret\n\t}\n\treturn *o.Total\n}", "title": "" }, { "docid": "1bc49a698c409bb44532ecb3398a08c0", "score": "0.51212627", "text": "func (_WTContracts *WTContractsSession) Total() (*big.Int, error) {\n\treturn _WTContracts.Contract.Total(&_WTContracts.CallOpts)\n}", "title": "" }, { "docid": "e8e8e270386beafada4d5ed236a0bfa7", "score": "0.5106973", "text": "func (b *Bigrams) Total() uint64 {\n\tif b == nil {\n\t\treturn 0\n\t}\n\treturn b.total\n}", "title": "" }, { "docid": "de5fd6a031f3ff93f90a34c3b3751ada", "score": "0.51050854", "text": "func (s *store) total(ingestPath string) int64 {\n\ttotalS, err := readFileString(filepath.Join(ingestPath, \"total\"))\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\ttotal, err := strconv.ParseInt(totalS, 10, 64)\n\tif err != nil {\n\t\t// represents a corrupted file, should probably remove.\n\t\treturn 0\n\t}\n\n\treturn total\n}", "title": "" }, { "docid": "eca935c39b2a65f14600d2539ad32cf4", "score": "0.51036656", "text": "func (_WTContracts *WTContractsCallerSession) Total() (*big.Int, error) {\n\treturn _WTContracts.Contract.Total(&_WTContracts.CallOpts)\n}", "title": "" }, { "docid": "f3f0bc135d86337e13d0115f73e87384", "score": "0.50959176", "text": "func (p *Page) Total() int {\n\tif p.PerPage == 0 {\n\t\treturn 0\n\t}\n\tcount, zero := len(p.d.Cards)/p.PerPage, len(p.d.Cards)%p.PerPage\n\tif zero != 0 {\n\t\tcount++\n\t}\n\n\treturn count\n}", "title": "" }, { "docid": "a0551e516bf2faf5c938d88c9e3d998d", "score": "0.50868624", "text": "func (self *SimEngine) GetTotalPayouts() int32 {\n return self.totalPayouts\n}", "title": "" }, { "docid": "1a85f0696f553478d0c2f39119b26069", "score": "0.5083099", "text": "func GetTotalTag() (int64, error) {\n\tcollection := mdb.FiberDB.Collection(TableTag)\n\tfilter := bson.D{}\n\t// specify the MaxTime option to limit the amount of time the operation can run on the server\n\topts := options.Count().SetMaxTime(10 * time.Second)\n\tcount, err := collection.CountDocuments(context.Background(), filter, opts)\n\treturn count, err\n}", "title": "" }, { "docid": "df0f1772e5a79190a38e0a4ec98e2544", "score": "0.50820196", "text": "func (o *DavisSecurityAdviceList) GetTotalCount() int64 {\n\tif o == nil {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\n\treturn o.TotalCount\n}", "title": "" }, { "docid": "d5be034fe75a8dcf6c52b08c53d42bee", "score": "0.5078528", "text": "func (we *wrappedEvent) GetTotalNumShards() int {\n\treturn we.event.GetTotalNumShards()\n}", "title": "" }, { "docid": "71074b45960dba930cbdc8a8413e202b", "score": "0.50644284", "text": "func (c CPUMap) Total() int {\n\tvar count int\n\tfor _, value := range c {\n\t\tcount += value\n\t}\n\treturn count\n}", "title": "" }, { "docid": "386f287efd26fd749ea85510b7963172", "score": "0.5064179", "text": "func (o *SearchRecipes200Response) GetTotalResultsOk() (*int32, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.TotalResults, true\n}", "title": "" }, { "docid": "94855e773fd8ad3db54a88d656329146", "score": "0.5054464", "text": "func Count(w http.ResponseWriter, r *http.Request) {\n\t// Sync the GCounters if multiple nodes\n\t// are present in a cluster\n\tif len(GetPeerList()) != 0 {\n\t\tGCounter, _ = Sync(GCounter)\n\t}\n\n\t// Get the total count in the GCounter\n\tcount := GCounter.GetTotal()\n\n\t// DEBUG log in the case of success\n\t// indicating the total count\n\tlog.WithFields(log.Fields{\n\t\t\"count\": count,\n\t}).Debug(\"successful gcounter total\")\n\n\t// json encode response count\n\tjson.NewEncoder(w).Encode(count)\n}", "title": "" }, { "docid": "d9d1a0298c75966b43eff77798130281", "score": "0.50543153", "text": "func (n *Policy) HitCount(base, vsys string, rules []string) ([]util.HitCount, error) {\n\tif !n.Client.Versioning().Gte(version.Number{8, 1, 0, \"\"}) {\n\t\treturn nil, fmt.Errorf(\"rule hit count requires PAN-OS 8.1+\")\n\t}\n\n\treq := util.NewHitCountRequest(base, vsys, rules)\n\tvar resp util.HitCountResponse\n\tif _, err := n.Client.Op(req, \"\", nil, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp.Results, nil\n}", "title": "" }, { "docid": "6d25dc73ff5392f155146c740413ae9b", "score": "0.50441295", "text": "func (sm *StreamMap) AddTotal(key string, x int) int {\n return sm.sMap[key].AddTotal(x)\n}", "title": "" }, { "docid": "f86b689653377fd71902beea8a12a53f", "score": "0.5042747", "text": "func (o *MessageSearchResult) SetHits(v []Message) {\n\to.Hits = v\n}", "title": "" }, { "docid": "5d7ad4444de513d735f17ea72679b8f5", "score": "0.504", "text": "func (_ArenaMatchGold *ArenaMatchGoldCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ArenaMatchGold.contract.Call(opts, out, \"totalSupply\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "9b3c1ae710827e133b5fceab2f204919", "score": "0.5035082", "text": "func (m *TransactionSummary) GetTotalCount()(*int32) {\n val, err := m.GetBackingStore().Get(\"totalCount\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*int32)\n }\n return nil\n}", "title": "" }, { "docid": "6e41ebfb4badf4cd91b0b878b9e4386e", "score": "0.50327665", "text": "func (o *MonitorSearchResponseMetadata) GetTotalCountOk() (*int64, bool) {\n\tif o == nil || o.TotalCount == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TotalCount, true\n}", "title": "" }, { "docid": "8fee33cf2fa2b3d785c523d24c1d6441", "score": "0.5017713", "text": "func (t Trace) TotalCalls() (s uint64) {\n\ts = 0\n\n\tfor _, c := range t {\n\t\ts += c.Calls\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "ef6b3321b865e32537ba0755b6923ac6", "score": "0.5005662", "text": "func (o *ResultListPage) GetTotalOk() (*float32, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Total, true\n}", "title": "" }, { "docid": "ad1df4156b7df19c3b3c616f91407961", "score": "0.5002555", "text": "func (c *Client) Hit(key string, ttlsec int32) (count uint64, remttl int32, err error) {\n\trem, err := c.rc.TTL(key)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tif rem <= 0 {\n\t\treturn 1, ttlsec, c.rc.SetEx(key, int(ttlsec), \"1\")\n\t}\n\tn, err := c.rc.Incr(key)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\treturn uint64(n), int32(rem), nil\n}", "title": "" }, { "docid": "6e0102d5e3a855315154cf08d76fe30d", "score": "0.49987373", "text": "func (s *Service) Total(ctx context.Context, domain string) (int64, error) {\n\tctx, _ = context.WithTimeout(ctx, session.Timeout)\n\treturn total(ctx, domain)\n}", "title": "" }, { "docid": "eaa5421215f97379230b103c02141550", "score": "0.49943736", "text": "func (a *HostsApi) GetHostTotals(ctx _context.Context, o ...GetHostTotalsOptionalParameters) (HostTotals, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarReturnValue HostTotals\n\t\toptionalParams GetHostTotalsOptionalParameters\n\t)\n\n\tif len(o) > 1 {\n\t\treturn localVarReturnValue, nil, datadog.ReportError(\"only one argument of type GetHostTotalsOptionalParameters is allowed\")\n\t}\n\tif len(o) == 1 {\n\t\toptionalParams = o[0]\n\t}\n\n\tlocalBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, \"v1.HostsApi.GetHostTotals\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/api/v1/hosts/totals\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\tif optionalParams.From != nil {\n\t\tlocalVarQueryParams.Add(\"from\", datadog.ParameterToString(*optionalParams.From, \"\"))\n\t}\n\tlocalVarHeaderParams[\"Accept\"] = \"application/json\"\n\n\tdatadog.SetAuthKeys(\n\t\tctx,\n\t\t&localVarHeaderParams,\n\t\t[2]string{\"apiKeyAuth\", \"DD-API-KEY\"},\n\t\t[2]string{\"appKeyAuth\", \"DD-APPLICATION-KEY\"},\n\t)\n\treq, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.Client.CallAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := datadog.ReadBody(localVarHTTPResponse)\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := datadog.GenericOpenAPIError{\n\t\t\tErrorBody: localVarBody,\n\t\t\tErrorMessage: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 {\n\t\t\tvar v APIErrorResponse\n\t\t\terr = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.ErrorModel = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := datadog.GenericOpenAPIError{\n\t\t\tErrorBody: localVarBody,\n\t\t\tErrorMessage: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "4d6c363298171c44e383546be913ed04", "score": "0.4992113", "text": "func (cl *ContractList) TotalCount() hexutil.Big {\n\tval := (*hexutil.Big)(new(big.Int).SetUint64(cl.Total))\n\treturn *val\n}", "title": "" }, { "docid": "5e75ef459866958c3af69495f84c273c", "score": "0.49872705", "text": "func (o *GenresAllOfData) GetCount() int32 {\n\tif o == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\n\treturn o.Count\n}", "title": "" }, { "docid": "85a68a4d4fca073379adc34a43c56208", "score": "0.4986249", "text": "func (s *Stats) Get(name string) uint64 {\n\treturn s.counts.Get(s.lookup(name))\n}", "title": "" }, { "docid": "bf7332ddd1625eab9ea23d99b1fdc5aa", "score": "0.49844947", "text": "func (_Cake *CakeSession) TotalSupply() (*big.Int, error) {\n\treturn _Cake.Contract.TotalSupply(&_Cake.CallOpts)\n}", "title": "" }, { "docid": "c9af647fd7107f3c1d24853dcd885209", "score": "0.4982352", "text": "func (s *CacheStats) incHit() {\n\ts.Hits.Add(uint64(1))\n}", "title": "" }, { "docid": "5b87a6cc0c52ea14457fe093ab14bad4", "score": "0.4980413", "text": "func (t *TokenProxy) TotalSupply() (*big.Int, error) {\n\treturn t.Token.TotalSupply(t.bcs.getQueryOpts())\n}", "title": "" }, { "docid": "82394a0c45a34f9264528688513671cc", "score": "0.49724206", "text": "func (c *ElasticsearchClient) Count(m *Metric, suffix string) (*ElasticsearchCounter, error) {\n\tcounter := &ElasticsearchCounter{}\n\tif m.Function != \"_count\" || m.Operation != \"GET\" {\n\t\treturn nil, fmt.Errorf(\"metric %v does not support Count()\", *m)\n\t}\n\tindex := fmt.Sprintf(\"%s%s\", m.BaseIndex, suffix)\n\tqbuf := []byte(*m.Query)\n\tbuf := bytes.NewBuffer(qbuf)\n\tres, err := c.driver.Count(\n\t\tc.driver.Count.WithContext(context.Background()),\n\t\tc.driver.Count.WithIndex(index),\n\t\tc.driver.Count.WithBody(buf),\n\t\tc.driver.Count.WithPretty(),\n\t)\n\t/*\n\t\tThis is search\n\t\tres, err := c.driver.Search(\n\t\t\tc.driver.Search.WithContext(context.Background()),\n\t\t\tc.driver.Search.WithIndex(index),\n\t\t\tc.driver.Search.WithBody(buf),\n\t\t\tc.driver.Search.WithTrackTotalHits(true),\n\t\t\tc.driver.Search.WithPretty(),\n\t\t)\n\t*/\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"elasticsearch connection error: %s, metric: %v\", err, *m)\n\t}\n\tif res.IsError() {\n\t\treturn nil, fmt.Errorf(\"elasticsearch query error: %s, metric: %v\", res.String(), *m)\n\t}\n\n\tlog.Debugf(\"elasticsearch responded with: %s\", res.String())\n\n\tvar r map[string]interface{}\n\tif err := json.NewDecoder(res.Body).Decode(&r); err != nil {\n\t\treturn nil, fmt.Errorf(\"Error parsing elasticsearch response body: %s, metric: %v\", err, *m)\n\t}\n\n\tif _, ok := r[\"count\"]; !ok {\n\t\treturn nil, fmt.Errorf(\"No total in elasticsearch response body: %v, metric: %v\", r, *m)\n\t}\n\tcount := r[\"count\"].(float64)\n\tcounter.Total = uint64(count)\n\treturn counter, nil\n}", "title": "" }, { "docid": "648ce6259d9f7cd8d55f544a8328c0ea", "score": "0.49723345", "text": "func (o *ResourceValue) GetTotal() float32 {\n\tif o == nil || o.Total == nil {\n\t\tvar ret float32\n\t\treturn ret\n\t}\n\treturn *o.Total\n}", "title": "" }, { "docid": "047e222dad96e0074a5db40dd11955e6", "score": "0.49696335", "text": "func (o *MonitorSearchResponseMetadata) HasTotalCount() bool {\n\tif o != nil && o.TotalCount != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ed641fd9811be1a98241cd221ede609a", "score": "0.49681297", "text": "func (p *Test_NumRowsForExtraSrv) GetCount() int64 { return p.Count }", "title": "" }, { "docid": "e03894d8f567596b03ff863a37415705", "score": "0.4964089", "text": "func (m *RunSummary) GetTotalUsers()(*int32) {\n val, err := m.GetBackingStore().Get(\"totalUsers\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*int32)\n }\n return nil\n}", "title": "" }, { "docid": "7bd9605f4b21df744eaef1eac1819278", "score": "0.4962581", "text": "func (m ExecutionReport) GetTotalTakedown() (v decimal.Decimal, err quickfix.MessageRejectError) {\n\tvar f field.TotalTakedownField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "38d38d4f06224a278fe12876cc7567fe", "score": "0.4943787", "text": "func GetTotalChunks(client *mongo.Client) float64 {\n\tchunkCount, err := client.Database(\"config\").Collection(\"chunks\").CountDocuments(context.TODO(), bson.M{})\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to execute find query on 'config.chunks': %s.\", err)\n\t}\n\treturn float64(chunkCount)\n}", "title": "" }, { "docid": "35fdfd317560a810961e92ded4e12dec", "score": "0.49425578", "text": "func (o *Pagination) GetTotal() int32 {\n\tif o == nil || o.Total == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\treturn *o.Total\n}", "title": "" }, { "docid": "fdad9525c6b26ccf54442c2043386940", "score": "0.4941562", "text": "func (w *Wrapper) Total() int {\n\tif s, ok := w.wrapped.(state); ok {\n\t\treturn s.Total()\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "6a8d9b160936168b9d387588788b9f17", "score": "0.49401018", "text": "func (_class HostMetricsClass) GetMemoryTotal(sessionID SessionRef, self HostMetricsRef) (_retval int, _err error) {\n\tif IsMock {\n\t\treturn _class.GetMemoryTotalMock(sessionID, self)\n\t}\t\n\t_method := \"host_metrics.get_memory_total\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_selfArg, _err := convertHostMetricsRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"self\"), self)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_retval, _err = convertIntToGo(_method + \" -> \", _result.Value)\n\treturn\n}", "title": "" } ]
556ebfbdb748f4e2d581d70b25d521e6
ServiceBrowserNew creates a new browser for mDNS records
[ { "docid": "9eab6da47a77bb4bceb09ea12a67073f", "score": "0.72806466", "text": "func ServiceBrowserNew(conn *dbus.Conn, path dbus.ObjectPath) (*ServiceBrowser, error) {\n\tc := new(ServiceBrowser)\n\n\tc.object = conn.Object(\"org.freedesktop.Avahi\", path)\n\tc.AddChannel = make(chan Service)\n\tc.RemoveChannel = make(chan Service)\n\tc.closeCh = make(chan struct{})\n\n\treturn c, nil\n}", "title": "" } ]
[ { "docid": "84e7421f6bc860e96b1247b938eed591", "score": "0.52092916", "text": "func New(strs ...interface{}) (*Browser, error) {\n\tvar err error\n\tb := &Browser{}\n\tfor _, str := range strs {\n\t\tif errr := rpc.Register(str); errr != nil {\n\t\t\treturn nil, errr\n\t\t}\n\t}\n\tport := js.Global.Get(\"window\").Get(\"location\").Get(\"port\").String()\n\tb.s, err = websocket.Dial(\"ws://localhost:\" + port + \"/ws-client\") // Blocks until connection is established\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlog.Println(\"connected to ws-client\")\n\tgo jsonrpc.ServeConn(b.s)\n\n\tb.c, err = websocket.Dial(\"ws://localhost:\" + port + \"/ws-server\") // Blocks until connection is established\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlog.Println(\"connected to ws-server\")\n\tb.Client = jsonrpc.NewClient(b.c)\n\treturn b, nil\n}", "title": "" }, { "docid": "48a63cb33cb89bf8162fe187fd5073fc", "score": "0.5160371", "text": "func newUssdApp(hostName string, services ServiceManager, sessionStore phada.SessionStore) *UssdApp {\n\treturn &UssdApp{\n\t\thost: hostName,\n\t\tsessionStore: sessionStore,\n\t\tservicectl: services,\n\t}\n}", "title": "" }, { "docid": "854d89c009551ffde9f757b3d2caada6", "score": "0.51174945", "text": "func newService(namespace, name string) *v1.Service {\n\treturn &v1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: labelMap(),\n\t\t},\n\t\tSpec: v1.ServiceSpec{\n\t\t\tSelector: labelMap(),\n\t\t\tPorts: []v1.ServicePort{\n\t\t\t\t{Name: \"port-1338\", Port: 1338, Protocol: \"TCP\", TargetPort: intstr.FromInt(1338)},\n\t\t\t\t{Name: \"port-1337\", Port: 1337, Protocol: \"TCP\", TargetPort: intstr.FromInt(1337)},\n\t\t\t},\n\t\t},\n\t}\n\n}", "title": "" }, { "docid": "c20a46740bbd31a6d2ee9e4afaaacbc8", "score": "0.5115867", "text": "func NewBrowserSiteList()(*BrowserSiteList) {\n m := &BrowserSiteList{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "ade4a29cdce2f92ba8b0818247904ba0", "score": "0.50623626", "text": "func (r *Relwarc) NewBrowser() *Browser {\n\tctx, cancel := chromedp.NewContext(r.ctx)\n\n\t// make sure a browser and its first tab are created.\n\tif err := chromedp.Run(ctx); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// enable network by default.\n\tif err := chromedp.Run(ctx, network.Enable()); err != nil {\n\t\tpanic(err)\n\t}\n\n\ttgt := chromedp.FromContext(ctx).Target\n\n\ttab := Tab{\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t\ttarget: tgt,\n\t\trequestMap: map[network.RequestID]*Request{},\n\t}\n\n\tchromedp.ListenTarget(ctx, tab.onTargetEvent)\n\n\tbrowser := Browser{\n\t\tctx: ctx,\n\t\tfirst: &tab,\n\t\ttabs: map[target.ID]*Tab{},\n\t}\n\n\treturn &browser\n}", "title": "" }, { "docid": "148423414feca529a0dfd50c8f07a05a", "score": "0.4980047", "text": "func (c PGClient) NewService(name string, binsIB int64, host string, port int, typeService string, runSTR string, projects []string, owner string) (err error) {\n\t_, err = c.DB.Query(\"select new_service_function($1,$2,$3,$4,$5,$6,$7,$8)\", name, binsIB, host, port, typeService, runSTR, pg.Array(projects), owner)\n\treturn err\n}", "title": "" }, { "docid": "50e93631251bbb98463113889b247d5b", "score": "0.49371967", "text": "func (c *Client) RequestNewService() error {\n\tcmd := exec.Command(os.Args[0], \"serve\")\n\terr := cmd.Start()\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to spin up binary!\\n\")\n\t\treturn err\n\t}\n\n\tc.conn.WaitForStateChange(context.Background(), c.conn.GetState())\n\n\treturn nil\n}", "title": "" }, { "docid": "9c703c69dc1e72525457c575e4e85a16", "score": "0.485222", "text": "func NewService() http.Handler {\n\th := http.NewServeMux()\n\th.HandleFunc(\"/ip\", IP)\n\th.HandleFunc(\"/headers\", Headers)\n\treturn h\n}", "title": "" }, { "docid": "a25ebb045ca535051f40a4f4cb0f08ac", "score": "0.48248637", "text": "func ServeNew(w http.ResponseWriter, r *http.Request) {\n\tvar data newReq\n\n\tID, err := ulid.New(ulid.Now(), entropy)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\terr = json.NewDecoder(r.Body).Decode(&data)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tnewH := NewHMST(data.Resolution, data.MaxTime, data.Keys)\n\tregistry[ID.String()] = newH\n\tlog.Println(\"/new\", ID.String(), data, len(newH.Registers))\n\tfmt.Fprintf(w, \"%v\", ID)\n}", "title": "" }, { "docid": "9ad5ee49e4b5c6a54d9b87bcd684d416", "score": "0.48106068", "text": "func (r *ReconcileNameService) newService(nameService *rocketmqv1beta1.NameService) *corev1.Service {\n\treturn &corev1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: nameService.Name,\n\t\t\tNamespace: nameService.Namespace,\n\t\t\tOwnerReferences: []metav1.OwnerReference{\n\t\t\t\t{\n\t\t\t\t\tName: nameService.GetName(),\n\t\t\t\t\tKind: nameService.Kind,\n\t\t\t\t\tAPIVersion: nameService.APIVersion,\n\t\t\t\t\tUID: nameService.GetUID(),\n\t\t\t\t\tController: &(share.BoolTrue),\n\t\t\t\t\tBlockOwnerDeletion: &(share.BoolTrue),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tSpec: corev1.ServiceSpec{\n\t\t\tClusterIP: \"None\",\n\t\t\tPorts: []corev1.ServicePort{\n\t\t\t\t{\n\t\t\t\t\tName: \"cluster\",\n\t\t\t\t\tPort: cons.NameServiceMainContainerPort,\n\t\t\t\t\tTargetPort: intstr.FromInt(cons.NameServiceMainContainerPort),\n\t\t\t\t\tProtocol: corev1.ProtocolTCP,\n\t\t\t\t},\n\t\t\t},\n\t\t\tSelector: map[string]string{\n\t\t\t\t\"app\": nameService.Name,\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "da37a686af19d0068661f2634237a935", "score": "0.48078495", "text": "func (c *Client) RequestNewService() error {\n\tfmt.Printf(\"Starting...\\n\")\n\tcmd := exec.Command(os.Args[0], \"serve\")\n\terr := cmd.Start()\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to spin up binary!\\n\")\n\t\treturn err\n\t}\n\n\tfmt.Printf(\"Waiting for state to change away from %s.\\n\", c.conn.GetState().String())\n\tc.conn.WaitForStateChange(context.Background(), c.conn.GetState())\n\tfmt.Printf(\"Started.\\n\")\n\n\treturn nil\n}", "title": "" }, { "docid": "32c7f6dcc0c718bbf38c54db1c264c2c", "score": "0.475578", "text": "func NewCSdr(host, appl string, https unsafe.Pointer) *CSdRegistry {\n\th := C.CString(host)\n\tdefer C.free(unsafe.Pointer(h))\n\ta := C.CString(appl)\n\tdefer C.free(unsafe.Pointer(a))\n\tsdr := C.sd_registry_create(h, a, (*C.struct_https_state)(https))\n\tif sdr == nil {\n\t\treturn nil\n\t}\n\treturn &CSdRegistry{sdr}\n}", "title": "" }, { "docid": "b65dadb5080ef305d9be5866633b11a8", "score": "0.47250924", "text": "func newService(cr *argoprojv1a1.ArgoCD) *corev1.Service {\n\treturn &corev1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cr.Name,\n\t\t\tNamespace: cr.Namespace,\n\t\t\tLabels: argoutil.LabelsForCluster(cr),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "76bd60d2d6dcd9258386f31cc9837bbb", "score": "0.47087297", "text": "func NewHTTPFactory(serviceName string, slaveAddr string, slavePort int, cert *HTTPCert, master arch.Linkage) *HTTPService {\n\tvar scheme string\n\n\tif cert != nil {\n\t\tscheme = \"http://\"\n\t} else {\n\t\tscheme = \"https://\"\n\t}\n\n\tdesc := arch.NewDescriptor(\"http\", serviceName, slaveAddr, slavePort, \"0\", scheme)\n\tvar sm = &HTTPService{arch.NewService(desc, master), cert}\n\n\treg, err := sm.Select(\"register\")\n\n\tif err == nil {\n\t\treg.Terminal().Only(grids.ByPackets(func(g *grids.GridPacket) {\n\t\t\tWhenServiceJSON(g, func(li *arch.LinkDescriptor, _ *grids.GridPacket) {\n\t\t\t\tsm.Register(li.Service, li)\n\t\t\t\tExtractReqRes(g, func(res http.ResponseWriter, req *http.Request) {\n\t\t\t\t\tif sm.HasRegistered(li.Service) {\n\t\t\t\t\t\tres.WriteHeader(200)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tres.WriteHeader(404)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t}))\n\t}\n\n\tdisc, err := sm.Select(\"discover\")\n\n\tif err == nil {\n\t\tdisc.Terminal().Any(grids.ByPackets(func(g *grids.GridPacket) {\n\t\t\tpath, _ := g.Get(\"Pathways\").([]string)\n\t\t\tservice := path[0]\n\n\t\t\tExtractReqRes(g, func(res http.ResponseWriter, req *http.Request) {\n\t\t\t\tli, err := sm.GetServiceProvider(service)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatal(\"Unable to find service\", service)\n\t\t\t\t\tres.WriteHeader(404)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tbin, err := json.Marshal(li)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatal(\"Unable to jsonify service linkdescriptor: \", err, li)\n\t\t\t\t\tres.WriteHeader(404)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tres.Header().Set(\"Content-Type\", \"charset=utf-8;application/json\")\n\t\t\t\tres.WriteHeader(200)\n\t\t\t\tres.Write(bin)\n\n\t\t\t})\n\n\t\t}))\n\t}\n\n\tunreg, err := sm.Select(\"unregister\")\n\n\tif err == nil {\n\t\tunreg.Terminal().Only(grids.ByPackets(func(g *grids.GridPacket) {\n\t\t\tWhenServiceJSON(g, func(li *arch.LinkDescriptor, _ *grids.GridPacket) {\n\t\t\t\tsm.Unregister(li.Service, li)\n\t\t\t\tExtractReqRes(g, func(res http.ResponseWriter, req *http.Request) {\n\t\t\t\t\tif !sm.HasRegistered(li.Service) {\n\t\t\t\t\t\tres.WriteHeader(200)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tres.WriteHeader(404)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t}))\n\t}\n\n\treturn sm\n}", "title": "" }, { "docid": "246ff07ad7a4ccfcf421352177030cc4", "score": "0.46903303", "text": "func newDirectMessageService(sling *sling.Sling) *DirectMessageService {\n\treturn &DirectMessageService{\n\t\tbaseSling: sling.New(),\n\t\tsling: sling.Path(\"direct_messages/\"),\n\t}\n}", "title": "" }, { "docid": "f753aaaaf0381111a6f965dcd034d410", "score": "0.4678583", "text": "func (c *Client) newServicegroup(servicegroup *Servicegroup) ([]byte, error) {\n\tnagiosURL, err := c.buildURL(\"servicegroup\", \"POST\", \"\", \"\", \"\", \"\")\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdata := setURLParams(servicegroup)\n\n\tbody, err := c.post(data, nagiosURL)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn body, nil\n}", "title": "" }, { "docid": "dc59797724f6bd804e2ec8cf392b60f9", "score": "0.46765533", "text": "func New()ManagementClient {\n return NewWithBaseURI(DefaultBaseURI, )\n}", "title": "" }, { "docid": "6bd905ed165f89ef585b904765444210", "score": "0.46658447", "text": "func newPageService(sling *sling.Sling) *PageService {\n\treturn &PageService{\n\t\tsling: sling.Path(\"pages/\"),\n\t}\n}", "title": "" }, { "docid": "1303655dadc119259277f5044ddb8e4e", "score": "0.46657652", "text": "func (h *Handler) serveCreateDBUser(w http.ResponseWriter, r *http.Request) {}", "title": "" }, { "docid": "086d6bdf5c9bdb562c77c5049c2ce385", "score": "0.4656729", "text": "func New()(*Window,error){\n\n\n/*8:*/\n\n\n//line goacme.w:147\n\n{\nvar err error\nonce.Do(func(){fsys,err= client.MountService(\"acme\")})\nif err!=nil{\nreturn nil,err\n}\n}\n\n\n\n/*:8*/\n\n\n//line goacme.w:160\n\nf,err:=fsys.Open(\"new/ctl\",plan9.OREAD)\nif err!=nil{\nreturn nil,err\n}\ndefer f.Close()\nvar id int\nif _,err:=fmt.Fscan(f,&id);err!=nil{\nreturn nil,err\n}\nreturn Open(id)\n}", "title": "" }, { "docid": "3f527538caefb59dc2afc71790b0f9ea", "score": "0.46415293", "text": "func newVdpaDpdkServer() *vdpaDpdkServer {\n\ts := &vdpaDpdkServer{\n\t\tgrpcServer: grpc.NewServer(),\n\t}\n\ts.loadInterfaces(*socketlist)\n\treturn s\n}", "title": "" }, { "docid": "2297123d5f806037410eaa99c78c3e23", "score": "0.46370372", "text": "func newService(name, project, image string, envs map[string]string, options options) *runapi.Service {\n\tvar envVars []*runapi.EnvVar\n\tfor k, v := range envs {\n\t\tenvVars = append(envVars, &runapi.EnvVar{Name: k, Value: v})\n\t}\n\n\tsvc := &runapi.Service{\n\t\tApiVersion: \"serving.knative.dev/v1\",\n\t\tKind: \"Service\",\n\t\tMetadata: &runapi.ObjectMeta{\n\t\t\tAnnotations: make(map[string]string),\n\t\t\tName: name,\n\t\t\tNamespace: project,\n\t\t},\n\t\tSpec: &runapi.ServiceSpec{\n\t\t\tTemplate: &runapi.RevisionTemplate{\n\t\t\t\tMetadata: &runapi.ObjectMeta{\n\t\t\t\t\tName: generateRevisionName(name, 0),\n\t\t\t\t\tAnnotations: make(map[string]string),\n\t\t\t\t},\n\t\t\t\tSpec: &runapi.RevisionSpec{\n\t\t\t\t\tContainerConcurrency: int64(options.Concurrency),\n\t\t\t\t\tContainers: []*runapi.Container{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tImage: image,\n\t\t\t\t\t\t\tEnv: envVars,\n\t\t\t\t\t\t\tResources: optionsToResourceRequirements(options),\n\t\t\t\t\t\t\tPorts: []*runapi.ContainerPort{optionsToContainerSpec(options)},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tForceSendFields: nil,\n\t\t\t\tNullFields: nil,\n\t\t\t},\n\t\t},\n\t}\n\n\tapplyMeta(svc.Metadata, image)\n\tapplyMeta(svc.Spec.Template.Metadata, image)\n\tapplyScaleMeta(svc.Spec.Template.Metadata, \"maxScale\", options.MaxInstances)\n\n\treturn svc\n}", "title": "" }, { "docid": "8ff77acdd325ce4429f6aa9f73bc5faa", "score": "0.4629105", "text": "func NewService(host, port, book, samhost, samport string, subs []string, useh bool) {\n\ts, err := NewServerFromOptions(\n\t\tSetServerHost(host),\n\t\tSetServerPort(port),\n\t\tSetServerAddressBookPath(book),\n\t\tSetServerUseHelper(useh),\n\t\tSetServerJumpHelperHost(samhost),\n\t\tSetServerJumpHelperPort(samport),\n\t\tSetServerSubscription(subs),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err, \"Error starting server\")\n\t}\n\tgo s.Serve()\n}", "title": "" }, { "docid": "80b8f02b2e8b346ede1b8a1ac9893a6e", "score": "0.46206218", "text": "func CreateNewDnsCommonServiceItem(zoneName string) *CommonServiceDnsItem {\n\treturn &CommonServiceDnsItem{\n\t\tResource: &Resource{ID: \"\"},\n\t\tName: zoneName,\n\t\tStatus: CommonServiceDnsStatus{\n\t\t\tZone: zoneName,\n\t\t},\n\t\tProvider: CommonServiceDnsProvider{\n\t\t\tClass: \"dns\",\n\t\t},\n\t\tSettings: CommonServiceDnsSettings{\n\t\t\tDNS: DnsRecordSets{},\n\t\t},\n\t}\n\n}", "title": "" }, { "docid": "af8878b8cf8141f601fc0d0cdf7878dc", "score": "0.46028942", "text": "func newSgwCtrl(addr net.UDPAddr, dataPort int, recovery byte) (*SgwCtrl, error) {\n\tmyLog := log.WithFields(logrus.Fields{\n\t\t\"addr\": addr,\n\t\t\"recovery\": recovery,\n\t})\n\tmyLog.Info(\"A new SGW Ctrl has created\")\n\n\tabsSPgw, err := newAbsSPgw(addr, recovery, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgtpSessionRepo := newGtpSessionRepo()\n\tsgwCtrl := &SgwCtrl{absSPgw, gtpSessionRepo}\n\n\tsgwDataUDPAddr := net.UDPAddr{IP: addr.IP, Port: dataPort}\n\tsgwCtrl.pair, err = newSgwData(sgwDataUDPAddr, recovery, sgwCtrl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgo sgwCtrl.sgwCtrlReceiverRoutine()\n\tgo sgwCtrl.echoReceiver()\n\n\treturn sgwCtrl, nil\n}", "title": "" }, { "docid": "0383847c6fc5f724a56a5191a43059fb", "score": "0.45997265", "text": "func New(svc *service.Service) *Server {\n\tvar rc struct {\n\t\tServer *warden.ServerConfig\n\t}\n\tif err := paladin.Get(\"application.toml\").UnmarshalTOML(&rc); err != nil {\n\t\tif err != paladin.ErrNotExist {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tws := warden.NewServer(rc.Server)\n\tapi.RegisterDebugServiceServer(ws.Server(), svc)\n\tws, err := ws.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tappid := env.AppID\n\tzone := env.Zone\n\thostname := fmt.Sprintf(\"grpc-%s-%s-%d-%d\", appid, env.Hostname, time.Now().Unix(), os.Getpid())\n\taddrs := utility.GetArrary(\"GRPC_ADDR\", \"grpc://192.168.110.31:9107\", \"grpc.addr\", \"etcd grpc addr\", \",\")\n\n\tbuilder, err := etcd.New(nil)\n\tif err == nil {\n\t\t//注册服务发现\n\t\tbuilder.Build(appid)\n\t\t_, err := builder.Register(context.Background(), &naming.Instance{\n\t\t\tAppID: appid,\n\t\t\tHostname: hostname,\n\t\t\tZone: zone,\n\t\t\tAddrs: addrs,\n\t\t})\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tlog.Error(fmt.Sprintf(\"DebugService init grpc etcd server(appid:%s,hostname:%s).\", appid, hostname))\n\n\treturn &Server{\n\t\tws: ws,\n\t\tbuilder: builder,\n\t}\n}", "title": "" }, { "docid": "e3164839b21d2a77aa9126e056b8e9e4", "score": "0.4590923", "text": "func newService(serviceName string) *Service {\n\treturn &Service{\n\t\tpluginDir: serverless.PluginDir,\n\t\tname: serviceName,\n\t\tinterf: nil,\n\t}\n}", "title": "" }, { "docid": "1f94e6178439c78527957602fc624afb", "score": "0.4590508", "text": "func NewService() *Service {\n\tnewDB := map[string]string{\n\t\t\"1\": \"one\",\n\t\t\"2\": \"two\",\n\t\t\"3\": \"three\",\n\t\t\"4\": \"four\",\n\t\t\"5\": \"five\",\n\t\t\"6\": \"six\",\n\t}\n\tservice := Service{\n\t\tdb: newDB,\n\t}\n\treturn &service\n}", "title": "" }, { "docid": "8c0848ab33dd8ffafc7fb6c83917898c", "score": "0.45885894", "text": "func New(addr string) *Server {\n if addr == \"\" {\n addr = DefaultAddr\n }\n return &Server{\n addr: DefaultAddr,\n ds: newDataStore(),\n done: make(chan struct{}),\n }\n}", "title": "" }, { "docid": "27c5e6c91edc108677e5880c97844c53", "score": "0.4579701", "text": "func makeService(host string, port int) *NamedWebSocket_Service {\n\treturn NewNamedWebSocketService(host, port)\n}", "title": "" }, { "docid": "a2c7f807bf80b0f8d35ba8a8c132ca54", "score": "0.45756727", "text": "func newLocalService(config fab.EndpointConfig, mspID string, opts ...coptions.Opt) *LocalService {\n\tlogger.Debug(\"Creating new local discovery service\")\n\n\ts := &LocalService{mspID: mspID}\n\ts.service = newService(config, s.queryPeers, opts...)\n\treturn s\n}", "title": "" }, { "docid": "723f9b90c86d6d9e5f6ba18352ea2635", "score": "0.4573313", "text": "func newServiceForCR(cr *operatorv1alpha1.Minecraft) *corev1.Service {\n labels := map[string]string{\n \"app\": cr.Name,\n \"version\": cr.Spec.Version,\n \"uela\": cr.Spec.Uela,\n }\n return &corev1.Service{\n\t\t// https://godoc.org/k8s.io/api/core/v1#Service\n ObjectMeta: metav1.ObjectMeta{\n Name: cr.Name + \"-service\",\n Namespace: cr.Namespace,\n Labels: labels,\n },\n\t\tSpec: corev1.ServiceSpec{\n\t\t\t// https://godoc.org/k8s.io/api/core/v1#ServiceSpec\n\t\t\tPorts: []corev1.ServicePort{\n\t\t\t\t{\n\t\t\t\t\tName: \"minecraft\",\n\t\t\t\t\tPort: 25565,\n\t\t\t\t\tTargetPort: intstr.FromString(\"minecraft\"),\n\t\t\t\t\tProtocol: \"TCP\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tType: corev1.ServiceTypeNodePort,\n\t\t\tSelector: labels,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "7b3fbce20ca1c99fe9afd804beb85ae2", "score": "0.45698544", "text": "func newService(m *influxdatav1alpha1.Influxdb) *corev1.Service {\n\tls := labelsForInfluxdb(m.Name)\n\n\treturn &corev1.Service{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: \"v1\",\n\t\t\tKind: \"Service\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: m.Name + \"-svc\",\n\t\t\tNamespace: m.Namespace,\n\t\t\tLabels: ls,\n\t\t},\n\t\tSpec: corev1.ServiceSpec{\n\t\t\tSelector: ls,\n\t\t\tType: \"ClusterIP\",\n\t\t\tPorts: newServicePorts(m),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "9818fcf8e401fcc708eec7538a1e2fd6", "score": "0.45687917", "text": "func newBackingServices(c *Client, namespace string) *backingservices {\n\treturn &backingservices{\n\t\tr: c,\n\t\tns: namespace,\n\t}\n}", "title": "" }, { "docid": "a30eef1adf44bcd245dcdf669052385c", "score": "0.4548042", "text": "func NewService(cfg *config.Ds, cmapAPI cmap.SlaveAPI, store Repository) Service {\n\tlogger = mlog.GetPackageLogger(\"app/ds/usecase/gencoding\")\n\n\ts := &service{\n\t\tcfg: cfg,\n\t\tcmapAPI: cmapAPI,\n\t\tstore: store,\n\t}\n\tgo s.run()\n\n\treturn s\n}", "title": "" }, { "docid": "116ad9d4f50b5b0409ad1afd1ccf3e8e", "score": "0.4533387", "text": "func newServiceForCR(cr *interviewv1alpha1.Minecraft) *corev1.Service {\n\tlabels := map[string]string{\n\t\t\"app\": cr.Name,\n\t}\n\n\treturn &corev1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cr.Name + \"-lb-service\",\n\t\t\tNamespace: cr.Namespace,\n\t\t\tLabels: labels,\n\t\t},\n\t\tSpec: corev1.ServiceSpec{\n\t\t\tPorts: []corev1.ServicePort{\n\t\t\t\t{\n\t\t\t\t\tPort: 25565,\n\t\t\t\t},\n\t\t\t},\n\t\t\tType: corev1.ServiceTypeLoadBalancer,\n\t\t\tSelector: labels,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "641652d7a67969ddd196c83d7540a3d0", "score": "0.45277038", "text": "func newServer(notifier *notifier, key string) *server {\n\treturn &server{\n\t\tnotifier: notifier,\n\t\tkey: key,\n\t}\n}", "title": "" }, { "docid": "ed4303c10a7d99168ab137e6608b92fc", "score": "0.45202494", "text": "func newSvcForCR(cr *sdewanv1alpha1.Sdewan) *corev1.Service {\n\treturn &corev1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cr.Name,\n\t\t\tNamespace: cr.Namespace,\n\t\t},\n\t\tSpec: corev1.ServiceSpec{\n\t\t\tPorts: []corev1.ServicePort {\n\t\t\t\t{\n\t\t\t\t\tName: \"api\",\n\t\t\t\t\tPort: 80,\n\t\t\t\t},\n\t\t\t},\n\t\t\tSelector: map[string]string{\n\t\t\t\t\"app\": cr.Name,\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "ccc1501ed8b85184c5742b669d812ab5", "score": "0.45039088", "text": "func newDNSTestServer(server *dns.Server) *dnsTestServer {\n\treturn &dnsTestServer{Server: server, DNSDatabase: make(dnsDatabase), DNSDatabaseRetry: make(dnsDatabase)}\n}", "title": "" }, { "docid": "c7300716f1d2c00ef339411fe9b4d538", "score": "0.44962615", "text": "func (t *OpenconfigSystem_System_Messages_DebugEntries) NewDebugService(Service E_OpenconfigMessages_DEBUG_SERVICE) (*OpenconfigSystem_System_Messages_DebugEntries_DebugService, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.DebugService == nil {\n\t\tt.DebugService = make(map[E_OpenconfigMessages_DEBUG_SERVICE]*OpenconfigSystem_System_Messages_DebugEntries_DebugService)\n\t}\n\n\tkey := Service\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.DebugService[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list DebugService\", key)\n\t}\n\n\tt.DebugService[key] = &OpenconfigSystem_System_Messages_DebugEntries_DebugService{\n\t\tService: Service,\n\t}\n\n\treturn t.DebugService[key], nil\n}", "title": "" }, { "docid": "8ea9610e02b05b531677d0add157e224", "score": "0.44950202", "text": "func NewDeviceManagementSettings()(*DeviceManagementSettings) {\n m := &DeviceManagementSettings{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "title": "" }, { "docid": "57e0a05b6a08a0f79ccf9c4007c99665", "score": "0.4492676", "text": "func (d *DeviceInfo) CreateService(name string) ServiceInfo {\n\ts := ServiceInfo{\n\t\tServiceName: name,\n\t\tMachineID: d.MachineID,\n\t\tHostName: d.HostName,\n\t}\n\tif len(d.IPAddress) != 0 {\n\t\ts.IPAddress = d.IPAddress[0]\n\t}\n\treturn s\n}", "title": "" }, { "docid": "3c5d6967ca3116c17d6bbe22a2a7d1ed", "score": "0.44923258", "text": "func newService(c *onet.Context) (onet.Service, error) {\n\ts := &ServiceState{\n\t\tServiceProcessor: onet.NewServiceProcessor(c),\n\t}\n\thelloMsg := network.RegisterMessage(HelloMsg{})\n\tstopMsg := network.RegisterMessage(StopProtocol{})\n\tconnMsg := network.RegisterMessage(ConnectionRequest{})\n\tdisconnectMsg := network.RegisterMessage(DisconnectionRequest{})\n\n\tc.RegisterProcessorFunc(helloMsg, s.HandleHelloMsg)\n\tc.RegisterProcessorFunc(stopMsg, s.HandleStop)\n\tc.RegisterProcessorFunc(connMsg, s.HandleConnection)\n\tc.RegisterProcessorFunc(disconnectMsg, s.HandleDisconnection)\n\n\tif err := s.tryLoad(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn s, nil\n}", "title": "" }, { "docid": "e1ed12a8cfa0605857e1fe6081f7b3fe", "score": "0.44907805", "text": "func newServiceWithSuffix(suffix string, component string, cr *argoprojv1a1.ArgoCD) *corev1.Service {\n\treturn newServiceWithName(fmt.Sprintf(\"%s-%s\", cr.Name, suffix), component, cr)\n}", "title": "" }, { "docid": "df4a801e13531e15c7ad0276e826940a", "score": "0.44882333", "text": "func NewDomainDnsSrvRecord()(*DomainDnsSrvRecord) {\n m := &DomainDnsSrvRecord{\n DomainDnsRecord: *NewDomainDnsRecord(),\n }\n return m\n}", "title": "" }, { "docid": "3ad944508df6a9d415487500e2f60f0f", "score": "0.44855455", "text": "func NewService(m map[string]interface{}) Service {\n\treturn m\n}", "title": "" }, { "docid": "c2e21ca7e6bac3e4f8c0399c4e3f7e81", "score": "0.4471424", "text": "func NewPage(ID string, h *live.Handler, s *live.Socket, title string) (*page.Component, error) {\n\treturn page.NewComponent(ID, h, s,\n\t\tpage.WithRegister(pageRegister),\n\t\tpage.WithMount(pageMount(title)),\n\t\tpage.WithRender(pageRender),\n\t)\n}", "title": "" }, { "docid": "222961dd3ab0e4091ce8efa36769e013", "score": "0.44640103", "text": "func newPeerService(sling *sling.Sling) *PeerService {\n\treturn &PeerService{\n\t\tsling: sling.Path(\"groups/\"),\n\t}\n}", "title": "" }, { "docid": "c4d592cbe56300d1c72db344b55f84ea", "score": "0.4459098", "text": "func NewService(fileName string) (*Service, error) {\n\tif klog.V(5) {\n\t\tklog.Info(\"Initializing message service...\")\n\t\tdefer klog.Info(\"Done initializing message service\")\n\t}\n\n\ted, err := readEventDefinition(fileName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ts := &Service{\n\t\ted,\n\t\tmake(map[string]Provider),\n\t}\n\n\t// Create the messaging providers\n\tfor _, provider := range ed.Providers {\n\t\tif klog.V(6) {\n\t\t\tklog.Infof(\"Creating %s provider '%s'\", provider.ProviderType, provider.Name)\n\t\t}\n\n\t\tvar newProvider Provider\n\t\tswitch provider.ProviderType {\n\t\tcase \"nats\":\n\t\t\tnewProvider, err = newNATSProvider(provider)\n\t\tcase \"rest\":\n\t\t\tnewProvider, err = newRESTProvider(provider)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"provider '%s' for '%s' is not recognized\", provider.ProviderType, provider.Name)\n\t\t}\n\n\t\t/* Error from trying to create new provider */\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to create %s provider '%s': %v\", provider.ProviderType, provider.Name, err)\n\t\t}\n\n\t\terr = s.Register(provider.Name, newProvider)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to register %s provider '%s': %v\", provider.ProviderType, provider.Name, err)\n\t\t}\n\t}\n\n\treturn s, nil\n}", "title": "" }, { "docid": "be5ca927826727fc4cde989b897e1e48", "score": "0.44540796", "text": "func newDHT(r *Router) *dht {\n\td := &dht{\n\t\tr: r,\n\t\tfinger: make(map[types.PublicKey]dhtEntry),\n\t}\n\treturn d\n}", "title": "" }, { "docid": "437973b8cd88dc088a922f29adc077cb", "score": "0.44433236", "text": "func New() Presenter {\n\treturn &service{}\n}", "title": "" }, { "docid": "2a90f22f4b6fb57d4278064442545ccb", "score": "0.44219723", "text": "func newServiceNode(port int, httpport int, wsport int, modules ...string) (*node.Node, error) {\n\tcfg := &node.DefaultConfig\n\tcfg.P2P.ListenAddr = fmt.Sprintf(\":%d\", port)\n\tcfg.P2P.EnableMsgEvents = true\n\tcfg.P2P.NoDiscovery = true\n\tcfg.IPCPath = ipcpath\n\tcfg.DataDir = fmt.Sprintf(\"%s%d\", datadirPrefix, port)\n\tif httpport > 0 {\n\t\tcfg.HTTPHost = node.DefaultHTTPHost\n\t\tcfg.HTTPPort = httpport\n\t}\n\tif wsport > 0 {\n\t\tcfg.WSHost = node.DefaultWSHost\n\t\tcfg.WSPort = wsport\n\t\tcfg.WSOrigins = []string{\"*\"}\n\t\tfor i := 0; i < len(modules); i++ {\n\t\t\tcfg.WSModules = append(cfg.WSModules, modules[i])\n\t\t}\n\t}\n\tstack, err := node.New(cfg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ServiceNode create fail: %v\", err)\n\t}\n\treturn stack, nil\n}", "title": "" }, { "docid": "b2a033805ec974323d5579c1eed8b8c1", "score": "0.44203612", "text": "func (t *OpenconfigMessages_Messages_DebugEntries) NewDebugService(Service E_OpenconfigMessages_DEBUG_SERVICE) (*OpenconfigMessages_Messages_DebugEntries_DebugService, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.DebugService == nil {\n\t\tt.DebugService = make(map[E_OpenconfigMessages_DEBUG_SERVICE]*OpenconfigMessages_Messages_DebugEntries_DebugService)\n\t}\n\n\tkey := Service\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.DebugService[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list DebugService\", key)\n\t}\n\n\tt.DebugService[key] = &OpenconfigMessages_Messages_DebugEntries_DebugService{\n\t\tService: Service,\n\t}\n\n\treturn t.DebugService[key], nil\n}", "title": "" }, { "docid": "f3404f4ae472f8d6ce04ea0296375501", "score": "0.44118443", "text": "func NewService(config Config) (*common.HTTPHandler, error) {\n\tnewServer := rpc.NewServer()\n\tcodec := json.NewCodec()\n\tnewServer.RegisterCodec(codec, \"application/json\")\n\tnewServer.RegisterCodec(codec, \"application/json;charset=UTF-8\")\n\tif err := newServer.RegisterService(&Admin{\n\t\tConfig: config,\n\t\tprofiler: profiler.New(config.ProfileDir),\n\t}, \"admin\"); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &common.HTTPHandler{Handler: newServer}, nil\n}", "title": "" }, { "docid": "acd115afd1d1ad2e4cb0b423b4957e04", "score": "0.44084835", "text": "func (f *testIDService) New() (string, error) {\n\treturn \"new-ID\", nil\n}", "title": "" }, { "docid": "9085a56f9db7f2d8e7e44c241896f7c6", "score": "0.4399498", "text": "func NewDHT(store Store, options *Options) (*DHT, error) {\n\t// validate the options, if it's invalid, set them to default value\n\tif options.IP == \"\" {\n\t\toptions.IP = defaultNetworkAddr\n\t}\n\tif options.Port <= 0 {\n\t\toptions.Port = defaultNetworkPort\n\t}\n\n\ts := &DHT{\n\t\tstore: store,\n\t\toptions: options,\n\t\tdone: make(chan struct{}),\n\t}\n\t// new a hashtable with options\n\tht, err := NewHashTable(options)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"new hashtable: %v\", err)\n\t}\n\ts.ht = ht\n\n\t// new network service for dht\n\tnetwork, err := NewNetwork(s, ht.self)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"new network: %v\", err)\n\t}\n\ts.network = network\n\n\treturn s, nil\n}", "title": "" }, { "docid": "fb5ab20f880046c07c35acfb9f0cd166", "score": "0.43927377", "text": "func createHttpService(port int) {\n\thttpMux := http.NewServeMux()\n\thttpMux.HandleFunc(\"/debug/pprof/\", pprof.Index)\n\thttpMux.HandleFunc(\"/debug/pprof/cmdline\", pprof.Cmdline)\n\thttpMux.HandleFunc(\"/debug/pprof/profile\", pprof.Profile)\n\thttpMux.HandleFunc(\"/debug/pprof/symbol\", pprof.Symbol)\n\thttpMux.HandleFunc(\"/debug/pprof/trace\", pprof.Trace)\n\thttpMux.HandleFunc(\"/check\", check)\n\n\thttpMux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte(`hello`))\n\t})\n\n\t// test stat prometheus\n\thttpMux.HandleFunc(\"/test\", testStat)\n\n\t// add prometheus metrics handler\n\thttpMux.Handle(\"/metrics\", promhttp.Handler())\n\n\t// http server\n\tgo func() {\n\t\tdefer func() {\n\t\t\tif err := recover(); err != nil {\n\t\t\t\tlog.Println(\"PProf exec recover: \", err)\n\t\t\t}\n\t\t}()\n\n\t\tlog.Println(\"server PProf run on: \", port)\n\n\t\tif err := http.ListenAndServe(fmt.Sprintf(\"0.0.0.0:%d\", port), httpMux); err != nil {\n\t\t\tlog.Println(\"PProf listen error: \", err)\n\t\t}\n\n\t}()\n}", "title": "" }, { "docid": "5e5a440ba347cc2eece5d12c562134d1", "score": "0.43875006", "text": "func NewMDNS() *mDNS {\n\tm := mDNS{}\n\tm.conn4 = nil\n\tm.conn6 = nil\n\treturn &m\n}", "title": "" }, { "docid": "6cc7ff021f8e10849491101321f98a6d", "score": "0.43873152", "text": "func NewServiceAnnouncement()(*ServiceAnnouncement) {\n m := &ServiceAnnouncement{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "cb3239674bc68a113c199712b82654d1", "score": "0.43850392", "text": "func newServiceWithName(name string, component string, cr *argoprojv1a1.ArgoCD) *corev1.Service {\n\tsvc := newService(cr)\n\tsvc.ObjectMeta.Name = name\n\n\tlbls := svc.ObjectMeta.Labels\n\tlbls[common.ArgoCDKeyName] = name\n\tlbls[common.ArgoCDKeyComponent] = component\n\tsvc.ObjectMeta.Labels = lbls\n\n\treturn svc\n}", "title": "" }, { "docid": "d0491a4acb80dc71a60050426981b9f1", "score": "0.43836993", "text": "func newDM(namespace, name string, conf fixture.DMConfig) *DM {\n\tdmMasterName := fmt.Sprintf(\"tipocket-dm-master-%s\", name)\n\tdmMasterLabels := map[string]string{\n\t\t\"app\": \"tipocket-dm\",\n\t\t\"instance\": dmMasterName,\n\t}\n\n\tdmWorkerName := fmt.Sprintf(\"tipocket-dm-worker-%s\", name)\n\tdmWorkerLabels := map[string]string{\n\t\t\"app\": \"tipocket-dm\",\n\t\t\"instance\": dmWorkerName,\n\t}\n\n\timage := fmt.Sprintf(\"pingcap/dm:%s\", conf.DMVersion)\n\n\tdmMasterInitCluster := \"--initial-cluster=\"\n\tfor i := 0; i < conf.MasterReplica; i++ {\n\t\tdmMasterInitCluster += fmt.Sprintf(\"%[1]s-%[3]d=http://%[1]s-%[3]d.%[1]s.%[2]s:8291\", dmMasterName, namespace, i)\n\t\tif i+1 != conf.MasterReplica {\n\t\t\tdmMasterInitCluster += \",\"\n\t\t}\n\t}\n\n\tdm := &DM{\n\t\tSvcMaster: &corev1.Service{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: dmMasterName,\n\t\t\t\tNamespace: namespace,\n\t\t\t\tLabels: dmMasterLabels,\n\t\t\t},\n\t\t\tSpec: corev1.ServiceSpec{\n\t\t\t\tType: corev1.ServiceTypeNodePort,\n\t\t\t\tPorts: []corev1.ServicePort{{\n\t\t\t\t\tName: \"dm-master\",\n\t\t\t\t\tPort: 8261,\n\t\t\t\t\tTargetPort: intstr.FromInt(8261),\n\t\t\t\t\tProtocol: corev1.ProtocolTCP,\n\t\t\t\t}, {\n\t\t\t\t\tName: \"dm-master-peer\",\n\t\t\t\t\tPort: 8291,\n\t\t\t\t\tTargetPort: intstr.FromInt(8291),\n\t\t\t\t\tProtocol: corev1.ProtocolTCP,\n\t\t\t\t}},\n\t\t\t\tSelector: dmMasterLabels,\n\t\t\t},\n\t\t},\n\t\tSvcWorker: &corev1.Service{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: dmWorkerName,\n\t\t\t\tNamespace: namespace,\n\t\t\t\tLabels: dmWorkerLabels,\n\t\t\t},\n\t\t\tSpec: corev1.ServiceSpec{\n\t\t\t\tType: corev1.ServiceTypeClusterIP,\n\t\t\t\tClusterIP: corev1.ClusterIPNone,\n\t\t\t\tPorts: []corev1.ServicePort{{\n\t\t\t\t\tName: \"dm-worker\",\n\t\t\t\t\tPort: 8262,\n\t\t\t\t\tTargetPort: intstr.FromInt(8262),\n\t\t\t\t\tProtocol: corev1.ProtocolTCP,\n\t\t\t\t}},\n\t\t\t\tSelector: dmWorkerLabels,\n\t\t\t},\n\t\t},\n\t\tStsMaster: &appsv1.StatefulSet{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: dmMasterName,\n\t\t\t\tNamespace: namespace,\n\t\t\t\tLabels: dmMasterLabels,\n\t\t\t},\n\t\t\tSpec: appsv1.StatefulSetSpec{\n\t\t\t\tServiceName: dmMasterName,\n\t\t\t\tPodManagementPolicy: appsv1.ParallelPodManagement,\n\t\t\t\tReplicas: pointer.Int32Ptr(int32(conf.MasterReplica)),\n\t\t\t\tSelector: &metav1.LabelSelector{MatchLabels: dmMasterLabels},\n\t\t\t\tTemplate: corev1.PodTemplateSpec{\n\t\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\t\tLabels: dmMasterLabels,\n\t\t\t\t\t\tAnnotations: map[string]string{\n\t\t\t\t\t\t\t\"prometheus.io/path\": \"/metrics\",\n\t\t\t\t\t\t\t\"prometheus.io/port\": \"8261\",\n\t\t\t\t\t\t\t\"prometheus.io/scrape\": \"true\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tSpec: corev1.PodSpec{\n\t\t\t\t\t\tContainers: []corev1.Container{{\n\t\t\t\t\t\t\tName: \"dm\",\n\t\t\t\t\t\t\tImage: image,\n\t\t\t\t\t\t\tImagePullPolicy: corev1.PullIfNotPresent,\n\t\t\t\t\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: name,\n\t\t\t\t\t\t\t\t\tMountPath: \"/data\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tPorts: []corev1.ContainerPort{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"dm-master\",\n\t\t\t\t\t\t\t\t\tContainerPort: 8261,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"dm-master-peer\",\n\t\t\t\t\t\t\t\t\tContainerPort: 8291,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tCommand: []string{\n\t\t\t\t\t\t\t\t\"/dm-master\",\n\t\t\t\t\t\t\t\t\"--data-dir=/data\",\n\t\t\t\t\t\t\t\t\"--name=$(MY_POD_NAME)\",\n\t\t\t\t\t\t\t\t\"--master-addr=:8261\",\n\t\t\t\t\t\t\t\tfmt.Sprintf(\"--advertise-addr=$(MY_POD_NAME).%s.%s:8261\", dmMasterName, namespace),\n\t\t\t\t\t\t\t\t\"--peer-urls=:8291\",\n\t\t\t\t\t\t\t\tfmt.Sprintf(\"--advertise-peer-urls=http://$(MY_POD_NAME).%s.%s:8291\", dmMasterName, namespace),\n\t\t\t\t\t\t\t\tdmMasterInitCluster,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"MY_POD_NAME\",\n\t\t\t\t\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\t\t\t\t\tFieldRef: &corev1.ObjectFieldSelector{\n\t\t\t\t\t\t\t\t\t\t\tAPIVersion: \"v1\",\n\t\t\t\t\t\t\t\t\t\t\tFieldPath: \"metadata.name\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tVolumeClaimTemplates: []corev1.PersistentVolumeClaim{{\n\t\t\t\t\tObjectMeta: metav1.ObjectMeta{Name: name},\n\t\t\t\t\tSpec: corev1.PersistentVolumeClaimSpec{\n\t\t\t\t\t\tAccessModes: []corev1.PersistentVolumeAccessMode{\n\t\t\t\t\t\t\tcorev1.ReadWriteOnce,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tStorageClassName: &fixture.Context.LocalVolumeStorageClass,\n\t\t\t\t\t\tResources: fixture.WithStorage(fixture.Small, \"1Gi\"),\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\t},\n\t\t},\n\t\tStsWorker: &appsv1.StatefulSet{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName: dmWorkerName,\n\t\t\t\tNamespace: namespace,\n\t\t\t\tLabels: dmWorkerLabels,\n\t\t\t},\n\t\t\tSpec: appsv1.StatefulSetSpec{\n\t\t\t\tServiceName: dmWorkerName,\n\t\t\t\tPodManagementPolicy: appsv1.ParallelPodManagement,\n\t\t\t\tReplicas: pointer.Int32Ptr(int32(conf.WorkerReplica)),\n\t\t\t\tSelector: &metav1.LabelSelector{MatchLabels: dmWorkerLabels},\n\t\t\t\tTemplate: corev1.PodTemplateSpec{\n\t\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\t\tLabels: dmWorkerLabels,\n\t\t\t\t\t\tAnnotations: map[string]string{\n\t\t\t\t\t\t\t\"prometheus.io/path\": \"/metrics\",\n\t\t\t\t\t\t\t\"prometheus.io/port\": \"8262\",\n\t\t\t\t\t\t\t\"prometheus.io/scrape\": \"true\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tSpec: corev1.PodSpec{\n\t\t\t\t\t\tContainers: []corev1.Container{{\n\t\t\t\t\t\t\tName: \"dm\",\n\t\t\t\t\t\t\tImage: image,\n\t\t\t\t\t\t\tImagePullPolicy: corev1.PullIfNotPresent,\n\t\t\t\t\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: name,\n\t\t\t\t\t\t\t\t\tMountPath: \"/data\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tPorts: []corev1.ContainerPort{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"client\",\n\t\t\t\t\t\t\t\t\tContainerPort: 8262,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tCommand: []string{\n\t\t\t\t\t\t\t\t\"/dm-worker\",\n\t\t\t\t\t\t\t\t\"--name=$(MY_POD_NAME)\",\n\t\t\t\t\t\t\t\t\"--worker-addr=:8262\",\n\t\t\t\t\t\t\t\tfmt.Sprintf(\"--advertise-addr=$(MY_POD_NAME).%s.%s:8262\", dmWorkerName, namespace),\n\t\t\t\t\t\t\t\tfmt.Sprintf(\"--join=%s.%s:8261\", dmMasterName, namespace),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"MY_POD_NAME\",\n\t\t\t\t\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\t\t\t\t\tFieldRef: &corev1.ObjectFieldSelector{\n\t\t\t\t\t\t\t\t\t\t\tAPIVersion: \"v1\",\n\t\t\t\t\t\t\t\t\t\t\tFieldPath: \"metadata.name\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tReadinessProbe: &corev1.Probe{\n\t\t\t\t\t\t\t\t// NOTE: no `ReadinessProbe` for DM-master now, because\n\t\t\t\t\t\t\t\t// - DM-master relies on endpoint to communicate with other members when starting\n\t\t\t\t\t\t\t\t// - but endpoint may no available if DM-master not started\n\t\t\t\t\t\t\t\t// then DM-master may never become ready.\n\t\t\t\t\t\t\t\t// so we only check the readiness for DM-worker.\n\t\t\t\t\t\t\t\tHandler: corev1.Handler{\n\t\t\t\t\t\t\t\t\tHTTPGet: &corev1.HTTPGetAction{\n\t\t\t\t\t\t\t\t\t\tPath: \"/status\",\n\t\t\t\t\t\t\t\t\t\tPort: intstr.FromInt(8262),\n\t\t\t\t\t\t\t\t\t\tScheme: \"HTTP\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tInitialDelaySeconds: 5,\n\t\t\t\t\t\t\t\tPeriodSeconds: 5,\n\t\t\t\t\t\t\t\tFailureThreshold: 5,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tVolumeClaimTemplates: []corev1.PersistentVolumeClaim{{\n\t\t\t\t\tObjectMeta: metav1.ObjectMeta{Name: name},\n\t\t\t\t\tSpec: corev1.PersistentVolumeClaimSpec{\n\t\t\t\t\t\tAccessModes: []corev1.PersistentVolumeAccessMode{\n\t\t\t\t\t\t\tcorev1.ReadWriteOnce,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tStorageClassName: &fixture.Context.LocalVolumeStorageClass,\n\t\t\t\t\t\tResources: fixture.WithStorage(fixture.Small, \"1Gi\"),\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\t},\n\t\t},\n\t}\n\n\treturn dm\n}", "title": "" }, { "docid": "068e9b65cc9847352bce7c5da3654636", "score": "0.43807015", "text": "func NewService(vendor string, product string, version string, url string) (*Service, error) {\n\ts := Service{\n\t\tvendor: vendor,\n\t\tproduct: product,\n\t\tversion: version,\n\t\turl: url,\n\t\tinterfaces: make(map[string]dispatcher),\n\t\tdescriptions: make(map[string]string),\n\t}\n\terr := s.RegisterInterface(orgvarlinkserviceNew())\n\n\treturn &s, err\n}", "title": "" }, { "docid": "d76d091664fbba9882e70d7d2b7e1eaa", "score": "0.43744183", "text": "func newService(c *onet.Context) (onet.Service, error) {\n\ts := &Service{\n\t\tServiceProcessor: onet.NewServiceProcessor(c),\n\t}\n\ts.RegisterProcessorFunc(cosiSendRawID, s.HandleRaw)\n\t_, err := c.ProtocolRegister(protoName, s.NewDefaultProtocol)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := s.RegisterHandlers(s.GenesisTx, s.Setup, s.TreesBLSCoSi, s.MemoryAllocated); err != nil {\n\t\treturn nil, errors.New(\"Couldn't register messages\")\n\t}\n\n\ts.propagateF, s.mypi, err = propagate.NewPropagationFunc(c, \"Propagate\", s.propagateHandler, -1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts.trees = make(map[onet.TreeID]*onet.Tree)\n\ts.coinToAtomic = make(map[string]int)\n\ts.atomicCoinReserved = make([]int32, 0)\n\n\tdb, bucketNameTx := s.GetAdditionalBucket([]byte(\"Tx\"))\n\t_, bucketNameLastTx := s.GetAdditionalBucket([]byte(\"LastTx\"))\n\ts.bucketNameTx = bucketNameTx\n\ts.bucketNameLastTx = bucketNameLastTx\n\ts.db = db\n\treturn s, nil\n}", "title": "" }, { "docid": "fe00306a7745925892c108fd0e14210e", "score": "0.43734574", "text": "func New(smName, namespace string, labels map[string]string) *Builder {\n\treturn &Builder{sm: newServiceMonitor(smName, namespace, labels)}\n}", "title": "" }, { "docid": "272e2f7349c5aed775ecc181ae7fafb6", "score": "0.43729118", "text": "func NewMDNS() MDNS {\n\tm := mDNS{}\n\tm.conn4 = nil\n\tm.conn6 = nil\n\treturn &m\n}", "title": "" }, { "docid": "3e39514b6b7ba1a76a8d0a705cd81792", "score": "0.436924", "text": "func newPacketframe(m map[string]string, metadata json.RawMessage) (providers.DNSServiceProvider, error) {\n\tif m[\"token\"] == \"\" {\n\t\treturn nil, fmt.Errorf(\"missing Packetframe token\")\n\t}\n\n\tbaseURL, err := url.Parse(defaultBaseURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid base URL for Packetframe\")\n\t}\n\tclient := http.Client{}\n\n\tapi := &packetframeProvider{client: &client, baseURL: baseURL, token: m[\"token\"]}\n\n\treturn api, nil\n}", "title": "" }, { "docid": "60ad01e61f1a3efaf88050da696f91f1", "score": "0.43684623", "text": "func CreatePage(browserName ...string) core.Page {\n\tcapabilities := core.Use()\n\tif len(browserName) > 0 {\n\t\tcapabilities.Browser(browserName[0])\n\t}\n\tnewPage, err := driver.Page(capabilities)\n\tcheckFailure(err)\n\treturn newPage\n}", "title": "" }, { "docid": "6743879cea36328ff206db58830f77a9", "score": "0.4367539", "text": "func New(name string, c *config.Config) (*Service, error) {\n\tdb, err := dnsdb.New(c.DBFile)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not open database\")\n\t}\n\n\tcert, err := c.Certificate.NewCert()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"invalid certificate configuration\")\n\t}\n\n\tsrv := dnsserver.NewWithDB(c.Domain, db)\n\tgrpcS := proto.Boot(srv)\n\tl, err := transport.Listen(cert, \"tcp\", c.GRPCListen)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"while configuring grpc listener\")\n\t}\n\n\treturn &Service{\n\t\tl: l,\n\t\tgrpcS: grpcS,\n\t\thandler: srv,\n\t\tappName: name,\n\t\tconfig: c,\n\t}, nil\n}", "title": "" }, { "docid": "71cf33c0b585353e8b8ce7694385a9d4", "score": "0.43653047", "text": "func NewService(resource *MonitoredResource, views []*view.View) (*Service, error) {\n\terr := view.Register(views...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !metadata.OnGCE() {\n\t\tview.SetReportingPeriod(5 * time.Second)\n\t\tpe, err := prometheus.NewExporter(prometheus.Options{})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"prometheus.NewExporter: %w\", err)\n\t\t}\n\t\tview.RegisterExporter(pe)\n\t\treturn &Service{pExporter: pe}, nil\n\t}\n\n\tprojID, err := metadata.ProjectID()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resource == nil {\n\t\treturn nil, errors.New(\"resource is required, got nil\")\n\t}\n\tsde, err := stackdriver.NewExporter(stackdriver.Options{\n\t\tProjectID: projID,\n\t\tMonitoredResource: resource,\n\t\tReportingInterval: time.Minute, // Minimum interval for Stackdriver is 1 minute.\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Minimum interval for Stackdriver is 1 minute.\n\tview.SetReportingPeriod(time.Minute)\n\t// Start the metrics exporter.\n\tif err := sde.StartMetricsExporter(); err != nil {\n\t\tsde.Close()\n\t\treturn nil, err\n\t}\n\n\treturn &Service{sdExporter: sde}, nil\n}", "title": "" }, { "docid": "8968a43bd9d271c16f1ede0c95351bf0", "score": "0.4364242", "text": "func (scalingManager *ScalingRequestManager) CreateNewDominControllerForDomain(domain *models.RealWorldDomain) *models.DomainController {\n\tdomainController, scalingError := scalingManager.requestNewDomainControllerForDomain(domain)\n\tif scalingError != nil {\n\t\tfmt.Println(scalingError)\n\t\treturn nil\n\t}\n\treturn domainController\n}", "title": "" }, { "docid": "dd1ac89d50f134b22506c0a7d894df02", "score": "0.4363929", "text": "func newdnsController(kubeClient kubernetes.Interface, namespace, zone string, rulesCallback func([]rewrite.Rule)) *dnsControl {\n\tdns := &dnsControl{\n\t\tstopCh: make(chan struct{}),\n\t\tready: make(chan struct{}),\n\t}\n\n\tstore := cache.NewUndeltaStore(func(is []interface{}) {\n\t\tdns.readyOnce.Do(func() {\n\t\t\tclose(dns.ready)\n\t\t})\n\n\t\trules := make([]rewrite.Rule, 0, len(is))\n\n\t\tfor _, i := range is {\n\t\t\tsvc := i.(*api.Service)\n\t\t\tif svc == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfrom, ok := svc.Annotations[\"egress.monzo.com/dns-name\"]\n\t\t\tif !ok {\n\t\t\t\tlog.Warningf(\"%s is missing dns-name annotation\", svc.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tto := fmt.Sprintf(\"%s.%s.svc.%s\", svc.Name, svc.Namespace, zone)\n\n\t\t\trewriteQuestionFrom := plugin.Name(from).Normalize()\n\t\t\trewriteQuestionTo := plugin.Name(to).Normalize()\n\n\t\t\trewriteAnswerFromPattern, err := regexp.Compile(rewriteQuestionTo)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\trules = append(rules, &exactNameRule{\n\t\t\t\tNextAction: \"stop\",\n\t\t\t\tFrom: rewriteQuestionFrom,\n\t\t\t\tTo: rewriteQuestionTo,\n\t\t\t\tResponseRule: rewrite.ResponseRule{\n\t\t\t\t\tActive: true,\n\t\t\t\t\tType: \"name\",\n\t\t\t\t\tPattern: rewriteAnswerFromPattern,\n\t\t\t\t\tReplacement: rewriteQuestionFrom,\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\n\t\trulesCallback(rules)\n\t}, cache.MetaNamespaceKeyFunc)\n\n\ts := labels.SelectorFromSet(map[string]string{\n\t\t\"app\": \"egress-gateway\",\n\t\t\"egress.monzo.com/hijack-dns\": \"true\",\n\t})\n\n\tdns.reflector = cache.NewReflector(&cache.ListWatch{\n\t\tListFunc: serviceListFunc(kubeClient, namespace, s),\n\t\tWatchFunc: serviceWatchFunc(kubeClient, namespace, s),\n\t}, &api.Service{}, store, 0)\n\n\treturn dns\n}", "title": "" }, { "docid": "0d25820ae9643b8f59d75f14df761f75", "score": "0.43626815", "text": "func NewService(args []string, p person.Service, ns serializer.Serializer) error {\n\tcli := service{args, p, ns}\n\tif err := cli.checkArgs(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := cli.runArgs(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7661692628c7c6a2b255cb8b500a1fb6", "score": "0.43588746", "text": "func NewService(name, version string, store store.KeyValueStore) (*Service, error) {\n\tlog.Debugf(\"[Azure CNS] Going to create a service object with name: %v. version: %v.\", name, version)\n\n\tsvc := &Service{\n\t\tName: name,\n\t\tVersion: version,\n\t\tOptions: make(map[string]interface{}),\n\t\tStore: store,\n\t}\n\n\tlog.Debugf(\"[Azure CNS] Finished creating service object with name: %v. version: %v.\", name, version)\n\treturn svc, nil\n}", "title": "" }, { "docid": "be764eda9e7711cf538b88004ab383a5", "score": "0.43506017", "text": "func (r *ReconcileMongoDB) newService(m *dbaasv1alpha1.MongoDB, serviceName string) *corev1.Service {\n\tvar selector = make(map[string]string)\n\tselector[\"role\"] = \"mongodb\"\n\n\tservice := &corev1.Service{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: \"v1\",\n\t\t\tKind: \"Service\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: serviceName,\n\t\t\tNamespace: m.Namespace,\n\t\t\tLabels: map[string]string{\"name\": serviceName},\n\t\t},\n\t\tSpec: corev1.ServiceSpec{\n\t\t\tPorts: []corev1.ServicePort{\n\t\t\t\t{\n\t\t\t\t\tName: \"mongodb\",\n\t\t\t\t\tPort: 27017,\n\t\t\t\t\tTargetPort: intstr.FromInt(27107),\n\t\t\t\t},\n\t\t\t},\n\t\t\tClusterIP: \"None\",\n\t\t\tSelector: selector,\n\t\t},\n\t}\n\t// Set MongoDB instance as the owner and controller\n\tcontrollerutil.SetControllerReference(m, service, r.scheme)\n\treturn service\n}", "title": "" }, { "docid": "a48761ad57ecab01492a19e6e2539f97", "score": "0.43448874", "text": "func NewService(addr string) *Service {\n\treturn &Service{\n\t\taddr: addr,\n\t}\n}", "title": "" }, { "docid": "1a80c2708c1b873c9c46d00ac029aea2", "score": "0.43301332", "text": "func newServiceForCR(cr *storagev1.CSIPowerMaxRevProxy) *v1.Service {\n\tlabels := map[string]string{\n\t\t\"name\": ReverseProxyName,\n\t}\n\tport := cr.Spec.RevProxy.Port\n\tif port == 0 {\n\t\tport = DefaultPort\n\t}\n\treturn &v1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: ReverseProxyName,\n\t\t\tNamespace: cr.Namespace,\n\t\t\tLabels: labels,\n\t\t\tOwnerReferences: getOwnerReferences(cr),\n\t\t},\n\t\tSpec: v1.ServiceSpec{\n\t\t\tPorts: []v1.ServicePort{\n\t\t\t\t{\n\t\t\t\t\tPort: port,\n\t\t\t\t\tProtocol: v1.ProtocolTCP,\n\t\t\t\t\tTargetPort: intstr.IntOrString{\n\t\t\t\t\t\tType: intstr.Int,\n\t\t\t\t\t\tIntVal: DefaultPort,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tType: v1.ServiceTypeClusterIP,\n\t\t\tSelector: labels,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "3f2f674d4902872d70adaebee80d2364", "score": "0.43279046", "text": "func NewBrowserClient(url string) (*browserClient, error) {\n\tbc, err := newBaseClient(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &browserClient{bc}, nil\n}", "title": "" }, { "docid": "8420918246836fecf8fd41433a4e565a", "score": "0.43179414", "text": "func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {\n\tscopesOption := option.WithScopes(\n\t\t\"https://www.googleapis.com/auth/display-video\",\n\t\t\"https://www.googleapis.com/auth/doubleclickbidmanager\",\n\t)\n\t// NOTE: prepend, so we don't override user-specified scopes.\n\topts = append([]option.ClientOption{scopesOption}, opts...)\n\topts = append(opts, internaloption.WithDefaultEndpoint(basePath))\n\tclient, endpoint, err := htransport.NewClient(ctx, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts, err := New(client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif endpoint != \"\" {\n\t\ts.BasePath = endpoint\n\t}\n\treturn s, nil\n}", "title": "" }, { "docid": "6cf00f6d38ec15e1020bbe8097c49ace", "score": "0.43148997", "text": "func NewService(driver neo4j.Driver) *Service {\n\treturn &Service{\n\t\tdriver: driver,\n\t}\n}", "title": "" }, { "docid": "cbc807e437b7477b2bcdb71b8357b813", "score": "0.43106553", "text": "func createService(cluster *client.VanClient, name string, annotations map[string]string) (*corev1.Service, error) {\n\n\tsvc := &corev1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tLabels: map[string]string{\n\t\t\t\t\"app\": \"nginx\",\n\t\t\t},\n\t\t\tAnnotations: annotations,\n\t\t},\n\t\tSpec: corev1.ServiceSpec{\n\t\t\tPorts: []corev1.ServicePort{\n\t\t\t\t{Name: \"web\", Port: 8080},\n\t\t\t},\n\t\t\tSelector: map[string]string{\n\t\t\t\t\"app\": \"nginx\",\n\t\t\t},\n\t\t\tType: corev1.ServiceTypeLoadBalancer,\n\t\t},\n\t}\n\n\t// Creating the new service\n\tsvc, err := cluster.KubeClient.CoreV1().Services(cluster.Namespace).Create(context.TODO(), svc, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Populate services map by namespace\n\tservices := []string{svc.Name}\n\tvar ok bool\n\tif services, ok = servicesMap[cluster.Namespace]; ok {\n\t\tservices = append(services, svc.Name)\n\t}\n\tservicesMap[cluster.Namespace] = services\n\n\treturn svc, nil\n}", "title": "" }, { "docid": "b35bb2e8f321ca5da52bd3c3b3d616f6", "score": "0.43070048", "text": "func (s Obj_value) NewService() (ServiceInfo, error) {\n\ts.Struct.SetUint16(4, 7)\n\tss, err := NewServiceInfo(s.Struct.Segment())\n\tif err != nil {\n\t\treturn ServiceInfo{}, err\n\t}\n\terr = s.Struct.SetPtr(0, ss.Struct.ToPtr())\n\treturn ss, err\n}", "title": "" }, { "docid": "49c8bddd6c7de6a4aabe5969542a38ae", "score": "0.42980075", "text": "func NewChromium(profile, key, name, storage string) (Browser, error) {\n\treturn &Chromium{profilePath: profile, keyPath: key, name: name, storage: storage}, nil\n}", "title": "" }, { "docid": "58310d2c518d9cb46e72e685042d4a99", "score": "0.42977202", "text": "func newService(rcvr interface{}, guard Guard) *service {\n\ts := new(service)\n\ts.typ = reflect.TypeOf(rcvr)\n\ts.rcvr = reflect.ValueOf(rcvr)\n\ts.name = reflect.Indirect(s.rcvr).Type().Name()\n\ts.guard = guard\n\n\t// install the methods\n\ts.method = suitableMethods(s.typ, true)\n\n\treturn s\n}", "title": "" }, { "docid": "87c816d45bcdaaaba7e11cc5e3c67a97", "score": "0.42954195", "text": "func NewService(name, url string) Service {\n\treturn Service{\n\t\tName: name,\n\t\tURL: url,\n\t}\n}", "title": "" }, { "docid": "84596634ef8a8c271a6516692df64e44", "score": "0.42903322", "text": "func NewDNSServerDefault() (srv *dns.Server) {\n\tsrv = &dns.Server{Addr: \":\" + strconv.Itoa(53), Net: \"udp\"}\n\tconfig, _ := dns.ClientConfigFromFile(resolvFile)\n\n\tsrv.Handler = &server{config}\n\n\tlog.Info().Msgf(\"Successful load local \" + resolvFile)\n\tfor _, server := range config.Servers {\n\t\tlog.Info().Msgf(\"Success load nameserver %s\\n\", server)\n\t}\n\tfor _, domain := range config.Search {\n\t\tlog.Info().Msgf(\"Success load search %s\\n\", domain)\n\t}\n\treturn\n}", "title": "" }, { "docid": "53b48eaf5355b27bc17bebbbb2759bcb", "score": "0.42896143", "text": "func New(host string) *service {\n\treturn &service{\n\t\thost: host,\n\t\tmux: http.NewServeMux(),\n\t}\n}", "title": "" }, { "docid": "db12062fcae8e4e63f38a1ddda06cfab", "score": "0.4288409", "text": "func GetCommandToStartHttpServer() string {\n\treturn \"Add-WindowsFeature Web-Server; Invoke-WebRequest \" +\n\t\t\"-Uri 'https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.6/ServiceMonitor.exe'\" +\n\t\t\" -OutFile 'C:\\\\ServiceMonitor.exe'; \" +\n\t\t\"echo 'ok' > C:\\\\inetpub\\\\wwwroot\\\\default.html; \" + \"C:\\\\ServiceMonitor.exe 'w3svc'; \"\n}", "title": "" }, { "docid": "85965a6f1202b26ab778d0dee6f53140", "score": "0.42819667", "text": "func NewService() (northbound.Service, error) {\n\tdeviceStore, err := NewAtomixStore()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Service{\n\t\tstore: deviceStore,\n\t}, nil\n}", "title": "" }, { "docid": "6ed22f508ebaf9e0c7876a67c0121f28", "score": "0.42812386", "text": "func (f *FactoryFake) New(address string) (client.Interface, error) {\n\tc, _ := f.Clients[address]\n\treturn c, nil\n}", "title": "" }, { "docid": "21d7d7eaed734e6074a908e4b183e715", "score": "0.427368", "text": "func New(c *warden.ServerConfig, svr *service.Service) *warden.Server {\n\tws := warden.NewServer(c)\n\tpb.RegisterThumbupServer(ws.Server(), &server{s: svr})\n\tws, err := ws.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ws\n}", "title": "" }, { "docid": "4bd252c304ed3a624dba0d2888ae3927", "score": "0.42719898", "text": "func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {\n\tscopesOption := internaloption.WithDefaultScopes(\n\t\t\"https://www.googleapis.com/auth/webmasters\",\n\t\t\"https://www.googleapis.com/auth/webmasters.readonly\",\n\t)\n\t// NOTE: prepend, so we don't override user-specified scopes.\n\topts = append([]option.ClientOption{scopesOption}, opts...)\n\topts = append(opts, internaloption.WithDefaultEndpoint(basePath))\n\topts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))\n\tclient, endpoint, err := htransport.NewClient(ctx, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts, err := New(client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif endpoint != \"\" {\n\t\ts.BasePath = endpoint\n\t}\n\treturn s, nil\n}", "title": "" }, { "docid": "e9784f269ef31c088f933b3980fbc302", "score": "0.4271957", "text": "func CreateService(addresses []config.Connection, protocols []framework.ProtocolInstance, engine *Engine) (*Service, error) {\r\n\tsrv := &Service{\r\n\t\tProtocols: protocols,\r\n\t\tListeners: make([]*Listener, len(addresses)),\r\n\t\tEngine: engine,\r\n\t\tRemotes: []*RemoteConnection{},\r\n\t}\r\n\tfor i, addr := range addresses {\r\n\t\tl, err := CreateListener(addr, srv, engine)\r\n\t\tif err != nil {\r\n\t\t\treturn nil, err\r\n\t\t}\r\n\t\tsrv.Listeners[i] = l\r\n\t}\r\n\treturn srv, nil\r\n}", "title": "" }, { "docid": "0a973b9d13afce1e489f861413b82798", "score": "0.42712998", "text": "func (m *UserSimulationEventInfo) SetBrowser(value *string)() {\n m.browser = value\n}", "title": "" }, { "docid": "fb3af786f0525eb8eb92f94acfa29f02", "score": "0.42695808", "text": "func newMailer(id int, service *Service) {\n\tmailer := &Mailer{id: id, service: service}\n\tmailer.run()\n}", "title": "" }, { "docid": "6601722e7e820958bca6f404ac61e4fc", "score": "0.42678353", "text": "func (h *MovieHandler) new(w http.ResponseWriter, r *http.Request) {\n\t// Render a HTML response and set status code.\n\trender.HTML(w, http.StatusOK, \"movie/new.html\", nil)\n}", "title": "" }, { "docid": "974e9d7104124199cf2e941d80d8b6df", "score": "0.42632833", "text": "func New(config ServiceConfig) *Service {\n\n\ts := &Service{\n\t\tPeerAdded: make(chan string),\n\t\tPeerRemoved: make(chan string),\n\t\tstopChan: make(chan interface{}),\n\t\tpeers: make(peerMap),\n\t\tconfig: config,\n\t}\n\n\t// Spawn a new goroutine for managing peers.\n\tgo s.run()\n\n\treturn s\n}", "title": "" }, { "docid": "69fe6ba3fd17e28f8b25912d2d10c326", "score": "0.4250751", "text": "func createImpl(nodes []string, spi discoverySpi, standalone bool) *discoService {\n\tdisco := &discoService{\n\t\tlatch: &sync.Mutex{},\n\t\tnodes: nodes,\n\t\tspi: spi,\n\t\tstandalone: standalone,\n\t\tstopChan: make(chan chan bool, 1),\n\t\twatcherChan: make(chan chan bool),\n\t\tchangeChan: make(chan []string, 1),\n\t}\n\tgo disco.discoveryLoop()\n\treturn disco\n}", "title": "" }, { "docid": "8b7a78cb38e3ae2b86b3d8a777f45b59", "score": "0.4249604", "text": "func NewService(address string, port int, backend Expander) *Service {\n\n\trestful.EnableTracing(true)\n\twebService := new(restful.WebService)\n\twebService.Consumes(restful.MIME_JSON)\n\twebService.Produces(restful.MIME_JSON)\n\thandler := func(req *restful.Request, resp *restful.Response) {\n\t\tutil.LogHandlerEntry(\"expansion service\", req.Request)\n\t\trequest := &ServiceRequest{}\n\t\tif err := req.ReadEntity(&request); err != nil {\n\t\t\tbadRequest(resp, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\treqMsg := fmt.Sprintf(\"\\nhandling request:\\n%s\\n\", util.ToYAMLOrError(request))\n\t\tutil.LogHandlerText(\"expansion service\", reqMsg)\n\t\tresponse, err := backend.ExpandChart(request)\n\t\tif err != nil {\n\t\t\tbadRequest(resp, fmt.Sprintf(\"error expanding chart: %s\", err))\n\t\t\treturn\n\t\t}\n\n\t\tutil.LogHandlerExit(\"expansion service\", http.StatusOK, \"OK\", resp.ResponseWriter)\n\t\trespMsg := fmt.Sprintf(\"\\nreturning response:\\n%s\\n\", util.ToYAMLOrError(response.Resources))\n\t\tutil.LogHandlerText(\"expansion service\", respMsg)\n\t\tresp.WriteEntity(response)\n\t}\n\twebService.Route(\n\t\twebService.POST(\"/expand\").\n\t\t\tTo(handler).\n\t\t\tDoc(\"Expand a chart.\").\n\t\t\tReads(&ServiceRequest{}).\n\t\t\tWrites(&ServiceResponse{}))\n\n\tcontainer := restful.DefaultContainer\n\tcontainer.Add(webService)\n\tserver := &http.Server{\n\t\tAddr: fmt.Sprintf(\"%s:%d\", address, port),\n\t\tHandler: container,\n\t}\n\n\treturn &Service{\n\t\twebService: webService,\n\t\tserver: server,\n\t\tcontainer: container,\n\t}\n}", "title": "" }, { "docid": "25ae8d16715f76c28b5daeeaff0b81c5", "score": "0.42494178", "text": "func newAwsServiceDiscoveryServices(c *TrussleV1Client, namespace string) *awsServiceDiscoveryServices {\n\treturn &awsServiceDiscoveryServices{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}", "title": "" }, { "docid": "996a66f5f0d810cc5c58e4f6f17d8349", "score": "0.42476875", "text": "func NewService() *Service {\n\tservice := &Service{\n\t\tCodec: serviceCodec{},\n\t\tMaxRequestLength: 0x7FFFFFFF,\n\t\tOptions: NewSafeDict(),\n\t\thandlers: make(map[string]Handler),\n\t}\n\thandlerFactories.Range(func(key, value interface{}) bool {\n\t\thandler := value.(HandlerFactory).New(service)\n\t\tservice.handlers[key.(string)] = handler\n\t\treturn true\n\t})\n\tservice.ioManager = NewIOManager(service.Process)\n\tservice.invokeManager = NewInvokeManager(service.Execute)\n\tservice.AddFunction(service.methodManager.Names, \"~\")\n\treturn service\n}", "title": "" } ]
5baab5cc85dfc7af2fb6acb4d8855968
PayloadFromBytes creates a payload from an encoded byte slice.
[ { "docid": "ec1d158a58566470dd3536e8ef72227e", "score": "0.7822238", "text": "func PayloadFromBytes(b []byte) Payload {\n\treturn jsonPayload(b)\n}", "title": "" } ]
[ { "docid": "157294952321bdfd69331973c531d23a", "score": "0.66617817", "text": "func NewBytesPayload(v []byte) CoAPMessagePayload {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\treturn &BytesPayload{\n\t\tcontent: v,\n\t}\n}", "title": "" }, { "docid": "5dfce974d9e5784f3bec314fe04a0c9f", "score": "0.64837456", "text": "func FromBytes(rawBytes []byte, p Packet) error {\n\t// interface smuggling\n\tif pp, ok := p.(encoding.BinaryUnmarshaler); ok {\n\t\treturn pp.UnmarshalBinary(rawBytes)\n\t}\n\treader := bytes.NewReader(rawBytes)\n\treturn binary.Read(reader, binary.BigEndian, p)\n}", "title": "" }, { "docid": "3b14bd9e7f360364d7e5ce6437dba5bd", "score": "0.61202466", "text": "func FromBytes(b []byte) Source {\n\treturn FromReader(bytes.NewReader(b))\n}", "title": "" }, { "docid": "fc8f1e795ec634e3b127318de5d08e91", "score": "0.60612375", "text": "func FromBytes(bytes []byte) (Manifest, error) {\n\tmanifest := &manifest{}\n\n\t// Preserve the raw manifest so that manifest.Bytes() returns bytes in\n\t// the same order that they were passed to this function\n\tmanifest.raw = make([]byte, len(bytes))\n\tcopy(manifest.raw, bytes)\n\n\tsigned, _ := clearsign.Decode(bytes)\n\tif signed != nil {\n\t\tsignature, err := ioutil.ReadAll(signed.ArmoredSignature.Body)\n\t\tif err != nil {\n\t\t\treturn nil, util.Errorf(\"Could not read signature from pod manifest: %s\", err)\n\t\t}\n\t\tmanifest.signature = signature\n\n\t\t// the original plaintext is in signed.Plaintext, but the signature\n\t\t// corresponds to signed.Bytes, so that's what we need to save\n\t\tmanifest.plaintext = signed.Bytes\n\n\t\t// parse YAML from the message's plaintext instead\n\t\tbytes = signed.Plaintext\n\t}\n\n\tif err := yaml.Unmarshal(bytes, manifest); err != nil {\n\t\treturn nil, util.Errorf(\"Could not read pod manifest: %s\", err)\n\t}\n\tif err := ValidManifest(manifest); err != nil {\n\t\treturn nil, util.Errorf(\"invalid manifest: %s\", err)\n\t}\n\treturn manifest, nil\n}", "title": "" }, { "docid": "eef5e1809ea4613fdc28386331c81394", "score": "0.60198176", "text": "func FromBytes(values []byte) Source {\n\tvar sink Source\n\tvar isPumping bool\n\tvar done bool\n\n\tpump := func() {\n\t\tfor _, value := range values {\n\t\t\tsink(NewData(value))\n\t\t}\n\t\tdone = true\n\t\tsink(NewTerminate(nil))\n\t}\n\n\treturn func(p Payload) {\n\t\tswitch v := p.(type) {\n\t\tcase Greets:\n\t\t\tsink = v.Source()\n\n\t\t\tsink(NewGreets(func(p Payload) {\n\t\t\t\tswitch p.(type) {\n\t\t\t\tcase Data:\n\t\t\t\t\tif !isPumping && !done {\n\t\t\t\t\t\tisPumping = true\n\t\t\t\t\t\tpump()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}))\n\n\t\tdefault:\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "780b76b6b52fcd2ec70c263f721857dd", "score": "0.60117334", "text": "func (signature *Signature) FromBytes(bytes []byte) (consumedBytes int, err error) {\n\tif len(bytes) < SignatureSize {\n\t\treturn 0, ErrNotEnoughBytes\n\t}\n\n\tcopy(signature[:SignatureSize], bytes)\n\n\treturn SignatureSize, nil\n}", "title": "" }, { "docid": "f7fb8c59027ba1149eea77be0e321965", "score": "0.5990382", "text": "func (ba *FilterBitArray) FromBytes(bytes []byte) {\n\t*ba = bytes\n}", "title": "" }, { "docid": "a5df191e6cb26eb1b760ab3f9267043c", "score": "0.5875827", "text": "func (d *RegistrationResultPayload) DecodeFromBytes(b []byte) error {\n\tlog.Println(\"DEPRECATED: use UnmarshalBinary instead\")\n\treturn d.UnmarshalBinary(b)\n}", "title": "" }, { "docid": "353ed043064bce1654d721312c829f77", "score": "0.58513796", "text": "func Bytes(data []byte) *Payload {\n\treturn &Payload{false, nil, data}\n}", "title": "" }, { "docid": "454f8d4e443106da93648bb1eefba1d9", "score": "0.57562774", "text": "func FromBytes(bytes []byte) (UUID, error) {\n\tvar uuid UUID\n\tif len(bytes) != 16 {\n\t\treturn uuid, fmt.Errorf(\"slice is not 16 bytes\")\n\t}\n\tcopy(uuid[0:], bytes)\n\treturn uuid, nil\n}", "title": "" }, { "docid": "7421efb3ddf2a759e766f699f7b7f542", "score": "0.5752273", "text": "func (p *PCOPayload) DecodeFromBytes(b []byte) error {\r\n\tp.ConfigurationProtocol = b[0] & 0x07\r\n\r\n\toffset := 1\r\n\tfor {\r\n\t\tif offset >= len(b) {\r\n\t\t\treturn nil\r\n\t\t}\r\n\t\topt, err := DecodeConfigurationProtocolOption(b[offset:])\r\n\t\tif err != nil {\r\n\t\t\treturn err\r\n\t\t}\r\n\t\tp.ConfigurationProtocolOptions = append(p.ConfigurationProtocolOptions, opt)\r\n\t}\r\n}", "title": "" }, { "docid": "17a11aa76562c9ff5305e83783097e8d", "score": "0.56443197", "text": "func FromBytes(byteData []byte) (Data, error) {\n\tvar data Data\n\tif err := yaml.Unmarshal(byteData, &data); err != nil {\n\t\treturn data, fmt.Errorf(\"could not unmarshal config data: %w\", err)\n\t}\n\treturn data, nil\n}", "title": "" }, { "docid": "f59a60cad361e6c04e186a5a664056bc", "score": "0.5632562", "text": "func (g *Generator) FromBytes(b []byte) (ID, error) {\n\tif len(b) != rawLen {\n\t\treturn nilID, ErrInvalidID\n\t}\n\tvar id ID\n\tcopy(id[:], b)\n\treturn id, nil\n}", "title": "" }, { "docid": "69456fd9e45a3072bf92f433dc36a039", "score": "0.5617881", "text": "func PayloadFromString(s string) Payload {\n\treturn jsonPayload(s)\n}", "title": "" }, { "docid": "e6aa3edce33e773010f8fe4eedb491e0", "score": "0.5608943", "text": "func (m *MessageType) FromBytes(data []byte) error {\n\tbuf := uio.NewBigEndianBuffer(data)\n\t*m = MessageType(buf.Read8())\n\treturn buf.FinError()\n}", "title": "" }, { "docid": "182f6291fe4045434bfd7647a09ee1ce", "score": "0.55942315", "text": "func NewStunReaderFromBytes(b []byte) *StunReader {\n\treturn NewStunReader(bytes.NewReader(b), 0, int64(len(b)))\n}", "title": "" }, { "docid": "85f73d583a5994912ed9194994921fa7", "score": "0.5543831", "text": "func (id *PeerID) CreateFromBytes(slice []byte) (ID, error) {\n\tif slice == nil {\n\t\treturn &PeerID{}, fmt.Errorf(\"Byte slice is nil. Cannot create ID\")\n\t}\n\n\tlogrus.Debugln(\"Creating id from the bytes:\", slice)\n\n\treturn &PeerID{slice, len(slice)}, nil\n}", "title": "" }, { "docid": "2937764eb74a0ce3cecb20763803e1b6", "score": "0.55396354", "text": "func (s *stanzaElement) FromBytes(buf *bytes.Buffer) error {\n\tif err := s.Element.FromBytes(buf); err != nil {\n\t\treturn err\n\t}\n\n\t// set from and to JIDs.\n\tfromJID, err := jid.NewWithString(s.From(), false)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttoJID, err := jid.NewWithString(s.To(), false)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.SetFromJID(fromJID)\n\ts.SetToJID(toJID)\n\treturn nil\n}", "title": "" }, { "docid": "63f1b520490510a6fc8b7b51500b3010", "score": "0.5529802", "text": "func (s *String) DecodeFromBytes(b []byte) error {\n\tif len(b) < 4 {\n\t\treturn errors.NewErrTooShortToDecode(s, \"should be longer than 4 bytes\")\n\t}\n\n\ts.Length = int32(binary.LittleEndian.Uint32(b[:4]))\n\tif s.Length <= 0 {\n\t\treturn nil\n\t}\n\ts.Value = b[4 : 4+s.Length]\n\treturn nil\n}", "title": "" }, { "docid": "2f8b0961a175328aaa93cfca3b53cf3e", "score": "0.55243623", "text": "func NewSeedFromBytes(b []byte) Seed {\n\treturn b\n}", "title": "" }, { "docid": "f194f88121a1488b1bfc0ff174b25787", "score": "0.55239433", "text": "func NewFromBytes(bts []byte) *BytesObj {\n\treturn &BytesObj{\n\t\ttp: isBts,\n\t\tdata: bts,\n\t}\n}", "title": "" }, { "docid": "c7cf60e628bc8834f9fb4a43aa583b9b", "score": "0.5522207", "text": "func SignatureFromBytes(bytes []byte) (result Signature, consumedBytes int, err error) {\n\tconsumedBytes, err = (&result).FromBytes(bytes)\n\treturn\n}", "title": "" }, { "docid": "82735ab6e5e01c231fd9c39c31a59d11", "score": "0.55207044", "text": "func (p *Packet) AddBytes(b []byte) *Packet {\n\tp.Payload = append(p.Payload, b...)\n\treturn p\n}", "title": "" }, { "docid": "bb00b4fdbeb3ba683c9e6d90019a9385", "score": "0.5510928", "text": "func (b *BaseImpl) NewFromBytes(bytes []byte) Base {\n\treturn NewBaseImpl(bytes)\n}", "title": "" }, { "docid": "dae6115251e398c44bb3580b55dc31a8", "score": "0.54813963", "text": "func LoadFromBytes(entryBytes []byte) (*Entry, error) {\n\tif !ValidateEntry(entryBytes) {\n\t\treturn nil, fmt.Errorf(\"Invalid entry bytes: %v\", entryBytes)\n\t}\n\n\tkeySize := binary.BigEndian.Uint32(entryBytes[96:128])\n\tvalueSize := binary.BigEndian.Uint32(entryBytes[128:160])\n\treturn &Entry{\n\t\tChecksum: binary.BigEndian.Uint32(entryBytes[:32]),\n\t\tTimestamp: binary.BigEndian.Uint64(entryBytes[32:96]),\n\t\tKeySize: keySize,\n\t\tValueSize: valueSize,\n\t\tKey: entryBytes[160 : 160+keySize],\n\t\tValue: entryBytes[160+keySize:],\n\t}, nil\n}", "title": "" }, { "docid": "a5331d5b43d908a6f4871d25c7464a6b", "score": "0.5475628", "text": "func unPackBytes(b []byte) (*Event, error) {\n\tvar e Event\n\tdec := codec.NewDecoderBytes(b, &mh)\n\terr := dec.Decode(&e)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &e, nil\n}", "title": "" }, { "docid": "b9a2f1d78b21030efc66c6266aaaf2f4", "score": "0.5471031", "text": "func createPayloadFromPacket(packetReader io.Reader) (*payload, error) {\n\t//read packet length\n\tvar packetLength int32\n\terr := binary.Read(packetReader, binary.LittleEndian, &packetLength)\n\tif err != nil {\n\t\treturn nil, errors.New(\"Unable to read packet length\")\n\t}\n\tbuf := make([]byte, packetLength)\n\terr = binary.Read(packetReader, binary.LittleEndian, &buf)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"read packet body fail: %v\", err)\n\t\treturn nil, err\n\t}\n\t// check length\n\tif packetLength < 4+4+2 {\n\t\terr = errors.New(\"packet too short\")\n\t\treturn nil, err\n\t}\n\tresult := new(payload)\n\tresult.packetID = int32(binary.LittleEndian.Uint32(buf[:4]))\n\tresult.packetType = int32(binary.LittleEndian.Uint32(buf[4:8]))\n\tresult.packetBody = buf[8 : packetLength-2]\n\n\treturn result, nil\n}", "title": "" }, { "docid": "da18766cbd93dd9a9b6b74c370a2a0c0", "score": "0.5457162", "text": "func TagFromBytes(data []byte) (tag Tag, err error) {\n\tr := bytes.NewReader(data)\n\t_, tag, err = TagFromReader(r)\n\treturn\n}", "title": "" }, { "docid": "376526f1b52b9ad7a519c38e35d85703", "score": "0.54448307", "text": "func NewPolicyFromBytes(data []byte) (*Policy, error) {\n\tp := Policy{}\n\tif err := json.Unmarshal(data, &p); err != nil {\n\t\treturn nil, InvalidPolicyFormatError(err.Error())\n\t}\n\treturn &p, nil\n}", "title": "" }, { "docid": "baf44a15c315b3b9b1dce01d695e7e1b", "score": "0.54426765", "text": "func NewFromByteSlice(bytes []byte) *Stringish {\n\treturn &Stringish{string(bytes)}\n}", "title": "" }, { "docid": "676c27b730c358d27d7978acd430ea33", "score": "0.5435882", "text": "func FromBytes(b []byte) (*raft.Log, error) {\n\tvar l raft.Log\n\tif len(b) == 0 {\n\t\treturn nil, fmt.Errorf(\"invalid raft.Log message: 0 bytes\")\n\t}\n\tif b[0] == 'p' {\n\t\tvar p pb.RaftLog\n\t\tif err := proto.Unmarshal(b[1:], &p); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tl.Index = p.Index\n\t\tl.Term = p.Term\n\t\tl.Type = raft.LogType(p.Type)\n\t\tl.Data = p.Data\n\t\tl.Extensions = p.Extensions\n\t} else {\n\t\t// XXX(1.0): delete this branch, proto is used everywhere\n\t\tif err := json.Unmarshal(b, &l); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &l, nil\n}", "title": "" }, { "docid": "32c5c21b309c6dd699a4eaaa41d514f6", "score": "0.5423377", "text": "func FromBytes(byts []byte) ([]*JSON, error) {\n\tr := readFromBytes(byts)\n\treturn parseAll(r)\n}", "title": "" }, { "docid": "025637603f68b5cd60fe6fa47781f08f", "score": "0.5421316", "text": "func FromBytes(id []byte) (ID, error) {\n\treturn dgen.FromBytes(id)\n}", "title": "" }, { "docid": "ea3e15ed7f1872e5ca31c8e9983448b0", "score": "0.5412281", "text": "func (s *Store) eventsFromBytes(data []byte) ([]core.Event, error) {\n\treturn s.eventcodec.EventsFromBytes(data)\n}", "title": "" }, { "docid": "ebba469195ee8e7b3b85f17b4b8f25ee", "score": "0.5409707", "text": "func ParseBytes(b []byte) ([]byte, error) {\n\treturn ParseString(string(b))\n}", "title": "" }, { "docid": "93e1e0952bbba053bce97293fda82c5d", "score": "0.5390881", "text": "func (w *Workspace) FromBytes(b []byte) error {\n\n\t// Convert XML to Structure\n\txml.Unmarshal(b, &w)\n\n\t// Return Cleanly\n\treturn nil\n}", "title": "" }, { "docid": "355dcaece8184c1534853280a26faa7f", "score": "0.53869677", "text": "func NewStateFromBytes(serialized []byte, serializer StateSerializer) (*State, error) {\n\t// Use the given serializer to decode the signal message.\n\tstateStructure, err := serializer.Deserialize(serialized)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn NewStateFromStructure(stateStructure, serializer)\n}", "title": "" }, { "docid": "bcd0fdbe4ebc5fdcdeea7c4c1be8ac8e", "score": "0.5358386", "text": "func NewMessageFromBytes(b []byte) ifc.Message {\n\th := sha256.New()\n\th.Write(b)\n\treturn ifc.Message{\n\t\tId: uuid.New(),\n\t\tCreationTime: time.Now(),\n\t\tLength: int64(len(b)),\n\t\tSha256: h.Sum(nil),\n\t}\n}", "title": "" }, { "docid": "18b89cf4b3d0d06d7e2571c9a1f59a85", "score": "0.53461593", "text": "func (c *CreateSubscriptionRequest) DecodeFromBytes(b []byte) error {\n\toffset := 0\n\n\t// type id\n\tc.TypeID = &datatypes.ExpandedNodeID{}\n\tif err := c.TypeID.DecodeFromBytes(b[offset:]); err != nil {\n\t\treturn err\n\t}\n\toffset += c.TypeID.Len()\n\n\t// request header\n\tc.RequestHeader = &RequestHeader{}\n\tif err := c.RequestHeader.DecodeFromBytes(b[offset:]); err != nil {\n\t\treturn err\n\t}\n\toffset += c.RequestHeader.Len() - len(c.RequestHeader.Payload)\n\n\t// requested publishing interval\n\trpi := binary.LittleEndian.Uint64(b[offset : offset+8])\n\tc.RequestedPublishingInterval = math.Float64frombits(rpi)\n\toffset += 8\n\n\t// requested lifetime count\n\tc.RequestedLifetimeCount = binary.LittleEndian.Uint32(b[offset : offset+4])\n\toffset += 4\n\n\t// requested max keep alive count\n\tc.RequestedMaxKeepAliveCount = binary.LittleEndian.Uint32(b[offset : offset+4])\n\toffset += 4\n\n\t// max notifications per publish\n\tc.MaxNotificationsPerPublish = binary.LittleEndian.Uint32(b[offset : offset+4])\n\toffset += 4\n\n\t// publishing enabled\n\tc.PublishingEnabled = &datatypes.Boolean{}\n\tif err := c.PublishingEnabled.DecodeFromBytes(b[offset:]); err != nil {\n\t\treturn err\n\t}\n\toffset += c.PublishingEnabled.Len()\n\n\t// priority\n\tc.Priority = b[offset]\n\n\treturn nil\n}", "title": "" }, { "docid": "e424a0d7f1810e4c0ba56b2e66146071", "score": "0.5316618", "text": "func (g *Generic) DecodeFromBytes(b []byte) error {\n\tlog.Println(\"DEPRECATED: use UnmarshalBinary instead\")\n\treturn g.UnmarshalBinary(b)\n}", "title": "" }, { "docid": "7530b71caa77e55c4b76dbbc4a3ec394", "score": "0.53158545", "text": "func (b *BootImageID) FromBytes(data []byte) error {\n\treturn uio.FromBigEndian(b, data)\n}", "title": "" }, { "docid": "78c9857bc44a4a4697be59801af55fa7", "score": "0.5306402", "text": "func PayloadBytesWithHeader(payload []byte, header http.Header) []byte {\n\tif len(header) == 0 {\n\t\treturn payload\n\t}\n\n\thd, _ := json.Marshal(header) // String map never fails marshaling.\n\n\tres := make([]byte, 0, len(jsonHeaderSignature)+len(hd)+1+len(payload))\n\tres = append(res, []byte(jsonHeaderSignature)...)\n\tres = append(res, hd...)\n\tres = append(res, '\\n')\n\tres = append(res, payload...)\n\n\treturn res\n}", "title": "" }, { "docid": "a9beaa0c3b102e8130aeef40ba125ced", "score": "0.52980834", "text": "func NewInputFromBytes(bytes []byte) (*Input, int, error) {\r\n\tif len(bytes) < 36 {\r\n\t\treturn nil, 0, fmt.Errorf(\"input length too short < 36\")\r\n\t}\r\n\r\n\toffset := 36\r\n\tl, size := DecodeVarInt(bytes[offset:])\r\n\toffset += size\r\n\r\n\ttotalLength := offset + int(l) + 4 // 4 bytes for nSeq\r\n\r\n\tif len(bytes) < totalLength {\r\n\t\treturn nil, 0, fmt.Errorf(\"input length too short < 36 + script + 4\")\r\n\t}\r\n\r\n\treturn &Input{\r\n\t\tpreviousTxID: ReverseBytes(bytes[0:32]),\r\n\t\tPreviousTxOutIndex: binary.LittleEndian.Uint32(bytes[32:36]),\r\n\t\tSequenceNumber: binary.LittleEndian.Uint32(bytes[offset+int(l):]),\r\n\t\tUnlockingScript: bscript.NewFromBytes(bytes[offset : offset+int(l)]),\r\n\t}, totalLength, nil\r\n}", "title": "" }, { "docid": "8894372007cc29ac607f4acb5e7818cc", "score": "0.52828115", "text": "func FromBytes(bytes [20]byte) Fingerprint {\n\treturn Fingerprint{\n\t\tfingerprintBytes: bytes,\n\t\tisSet: true,\n\t}\n}", "title": "" }, { "docid": "223bf99f2fa728084929602c37d9819b", "score": "0.5266942", "text": "func MessageFromBytes(bytes []byte) (result *Message, consumedBytes int, err error) {\n\tmarshalUtil := marshalutil.New(bytes)\n\tresult, err = MessageFromMarshalUtil(marshalUtil)\n\tif err != nil {\n\t\treturn\n\t}\n\tconsumedBytes = marshalUtil.ReadOffset()\n\n\tif len(bytes) != consumedBytes {\n\t\terr = xerrors.Errorf(\"consumed bytes %d not equal total bytes %d: %w\", consumedBytes, len(bytes), cerrors.ErrParseBytesFailed)\n\t}\n\treturn\n}", "title": "" }, { "docid": "09fc90bf6b113cfda396f5dc073a473f", "score": "0.5266436", "text": "func MakeFromBytes(bytes []byte) Value {\n\treturn constant.MakeFromBytes(bytes)\n}", "title": "" }, { "docid": "662845ee301b4513c9defa9e81c8e10b", "score": "0.52647257", "text": "func DecodeBytes(na ipld.NodeAssembler, src []byte) error {\n\tvar txTrace TxTrace\n\tif err := rlp.DecodeBytes(src, &txTrace); err != nil {\n\t\treturn err\n\t}\n\treturn DecodeTx(na, txTrace)\n}", "title": "" }, { "docid": "ca5f6599ce1e30536aff9e91485e91ac", "score": "0.5261388", "text": "func UnmarshalBytes(src []byte) ([]byte, []byte, error) {\n\ttail, n, err := UnmarshalVarUint64(src)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"cannot unmarshal string size: %w\", err)\n\t}\n\tsrc = tail\n\tif uint64(len(src)) < n {\n\t\treturn nil, nil, fmt.Errorf(\"src is too short for reading string with size %d; len(src)=%d\", n, len(src))\n\t}\n\treturn src[n:], src[:n], nil\n}", "title": "" }, { "docid": "e64d58ef111e7143351a2072a9873353", "score": "0.525807", "text": "func DecodePayload(data []byte) Payload {\n\te := Payload{}\n\te.Length = binary.LittleEndian.Uint32(data[0:4])\n\te.Op = data[4]\n\te.Channel = binary.LittleEndian.Uint32(data[5:9])\n\te.Data = make([]byte, len(data[9:]))\n\tcopy(e.Data, data[9:])\n\treturn e\n}", "title": "" }, { "docid": "f571889aec44eab5ac4ae722860ed125", "score": "0.5255169", "text": "func NewTransactionFromBytes(b []byte) (*Transaction, error) {\n\ttx := &Transaction{}\n\tr := io.NewBinReaderFromBuf(b)\n\ttx.decodeBinaryNoSize(r, b)\n\tif r.Err != nil {\n\t\treturn nil, r.Err\n\t}\n\tif r.Len() != 0 {\n\t\treturn nil, errors.New(\"additional data after the transaction\")\n\t}\n\ttx.size = len(b)\n\treturn tx, nil\n}", "title": "" }, { "docid": "c835d9e75add655372fec12fc763b9b4", "score": "0.52532804", "text": "func TestDecodePayloadSliceHappyPath(t *testing.T) {\n\tassert := assert.New(t)\n\tbody := `[{\"foo\": \"bar\", \"baz\": 1}]`\n\tpayload := bytes.NewBufferString(body)\n\n\tdecoded, err := decodePayloadSlice(payload.Bytes())\n\n\tassert.Equal([]Payload{Payload{\"foo\": \"bar\", \"baz\": float64(1)}}, decoded)\n\tassert.Nil(err)\n}", "title": "" }, { "docid": "e120325e222a99f5f12c6820d4041de0", "score": "0.52445686", "text": "func NewEventFromBytes(ctx context.Context, acker Acknowledger, data []byte) *Event {\n\treturn &Event{\n\t\tctx: ctx,\n\t\tacker: acker,\n\t\tencoded: data,\n\t}\n}", "title": "" }, { "docid": "cf4a2a9412e1ccc5dc2ed47846e90cc5", "score": "0.5243919", "text": "func (d *DUIDLLT) FromBytes(p []byte) error {\n\tbuf := uio.NewBigEndianBuffer(p)\n\td.HWType = iana.HWType(buf.Read16())\n\td.Time = buf.Read32()\n\td.LinkLayerAddr = buf.ReadAll()\n\treturn buf.FinError()\n}", "title": "" }, { "docid": "1ff215bd6b3c2ed69a40928ea305038b", "score": "0.5241173", "text": "func decodeByteSlice(s *Stream, val reflect.Value) error {\n\t// b = byte slice contained string content\n\tb, err := s.Bytes()\n\tif err != nil {\n\t\treturn wrapStreamError(err, val.Type())\n\t}\n\tval.SetBytes(b)\n\treturn nil\n}", "title": "" }, { "docid": "85c53fc3951729aa3079f24b2e84666d", "score": "0.5237972", "text": "func (app *adapter) FromBytes(bytes []byte) (PrivateKey, error) {\n\tpk, err := x509.ParsePKCS1PrivateKey(bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn app.builder.WithPK(*pk).Now()\n}", "title": "" }, { "docid": "e7dc66810852904fc9ae00c66b99094a", "score": "0.5237781", "text": "func FromBytes(verbatim []byte) UUID {\n\tvar id UUID\n\tcopy(id[:], verbatim[:16]) // intentionally 16 to cause panic for too-small arguments\n\treturn id\n}", "title": "" }, { "docid": "ca4f14284d2af0d86ebc4b6ff156b5af", "score": "0.5237669", "text": "func (u *Uint256) FromBytes(b []byte) error {\n\tif len(b) != UINT256_SIZE {\n\t\treturn ErrBytesSize\n\t}\n\tcopy(u[:], b[:])\n\treturn nil\n}", "title": "" }, { "docid": "3a099a54474222c28e54a3ab471486fa", "score": "0.52332866", "text": "func decodeByteArray(s *Stream, val reflect.Value) error {\n\t// getting detailed information on encoded data\n\tkind, size, err := s.Kind()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// getting the length of declared ByteArray\n\tvlen := val.Len()\n\n\tswitch kind {\n\t// put a byte in a byte array\n\tcase Byte:\n\t\tif vlen == 0 {\n\t\t\treturn &decodeError{msg: \"input string too long\", typ: val.Type()}\n\t\t}\n\t\tif vlen > 1 {\n\t\t\treturn &decodeError{msg: \"input string too short\", typ: val.Type()}\n\t\t}\n\n\t\t// get the content and stores in the index 0\n\t\tbv, _ := s.Uint()\n\t\tval.Index(0).SetUint(bv)\n\n\t// put string in a byte array\n\tcase String:\n\t\tif uint64(vlen) < size {\n\t\t\treturn &decodeError{msg: \"input string too long\", typ: val.Type()}\n\t\t}\n\t\tif uint64(vlen) > size {\n\t\t\treturn &decodeError{msg: \"input string too short\", typ: val.Type()}\n\t\t}\n\n\t\t// transfer the byte array to byte slice and place string content inside\n\t\tslice := val.Slice(0, vlen).Interface().([]byte)\n\t\tif err := s.readFull(slice); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// reject cases where single byte encoding should have been used\n\t\tif size == 1 && slice[0] < 128 {\n\t\t\treturn wrapStreamError(ErrCanonSize, val.Type())\n\t\t}\n\t// byte array should not contain any list\n\tcase List:\n\t\treturn wrapStreamError(ErrExpectedString, val.Type())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8f58d945a65ace062938d79618af955a", "score": "0.52324635", "text": "func (b *Block) FromBytes(bits []byte) error {\n\tvar rb RawBlock\n\terr := proto.Unmarshal(bits, &rb)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttxs := make([]*Tx, len(rb.Transactions))\n\tvar eg errgroup.Group\n\tfor i := range rb.Transactions {\n\t\ti := i\n\t\teg.Go(func() error {\n\t\t\ttx, err := NewTx(rb.Transactions[i].Program, rb.Transactions[i].Version, rb.Transactions[i].Runlimit)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif !tx.Finalized {\n\t\t\t\treturn txvm.ErrUnfinalized\n\t\t\t}\n\t\t\ttxs[i] = tx\n\t\t\treturn nil\n\t\t})\n\t}\n\terr = eg.Wait()\n\tif err != nil {\n\t\treturn err\n\t}\n\tb.UnsignedBlock = &UnsignedBlock{\n\t\tBlockHeader: rb.Header,\n\t\tTransactions: txs,\n\t}\n\tfor _, arg := range rb.Arguments {\n\t\tswitch arg.Type {\n\t\tcase DataType_BYTES:\n\t\t\tb.Arguments = append(b.Arguments, arg.Bytes)\n\t\tcase DataType_INT:\n\t\t\tb.Arguments = append(b.Arguments, arg.Int)\n\t\tcase DataType_TUPLE:\n\t\t\tb.Arguments = append(b.Arguments, arg.Tuple)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4836f29ff63e2a38c44c1498fc632a09", "score": "0.52311504", "text": "func ScalarFromBytes(b [32]byte) (*r255.Scalar, error) {\n\ts := r255.NewScalar()\n\terr := s.Decode(b[:])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s, nil\n}", "title": "" }, { "docid": "fd9d87833c3efdd70011ebaa9fb8cc21", "score": "0.5210887", "text": "func FromJSONBytes(i interface{}, bytes []byte) error {\n\terr := json.Unmarshal(bytes, i)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn Validate(i)\n}", "title": "" }, { "docid": "c153d1d0ec68706a5f8bd2dc76e6800e", "score": "0.5205825", "text": "func FromBytes(b []byte) Hash {\n\tif len(b) != HashSize {\n\t\tpanic(fmt.Sprintf(\"hash len != %v\", HashSize))\n\t}\n\tvar h Hash\n\tcopy(h[:], b)\n\treturn h\n}", "title": "" }, { "docid": "f5a27637c5591eec3b78222be134a2ec", "score": "0.5202879", "text": "func FromBytes(bytes []byte) (*Reader, error) {\n\treader, err := maxminddb.FromBytes(bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdbType, err := getDBType(reader)\n\treturn &Reader{reader, dbType}, err\n}", "title": "" }, { "docid": "bb7434222bb57a7bdc3c2db4936b942d", "score": "0.5198208", "text": "func TransactionReceiptFromBytes(data []byte) (TransactionReceipt, error) {\n\tif data == nil {\n\t\treturn TransactionReceipt{}, errByteArrayNull\n\t}\n\tpb := services.TransactionGetReceiptResponse{}\n\terr := protobuf.Unmarshal(data, &pb)\n\tif err != nil {\n\t\treturn TransactionReceipt{}, err\n\t}\n\n\treturn _TransactionReceiptFromProtobuf(&pb, nil), nil\n}", "title": "" }, { "docid": "bcfe5fa3b378555e772ac278e7d5afb8", "score": "0.5195102", "text": "func DecodeBytes(na ipld.NodeAssembler, src []byte) error {\n\tlog := new(types.Log)\n\tif err := rlp.DecodeBytes(src, log); err != nil {\n\t\treturn err\n\t}\n\treturn DecodeLog(na, *log)\n}", "title": "" }, { "docid": "7a799c8eeaeefe8b4e564c7bd344d5ca", "score": "0.51905435", "text": "func newFromBytes(bytes []byte) BitStream {\n\tresult := New()\n\tfor _, b := range bytes {\n\t\tnewBS := NewFromFullByte(b)\n\t\tresult.Append(newBS)\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "ebda00dbc19b2aafb532afe136062891", "score": "0.5185842", "text": "func FromBytes(b []byte) Subspace {\n\ts := make([]byte, len(b))\n\tcopy(s, b)\n\treturn subspace{s}\n}", "title": "" }, { "docid": "2ec1e8aca2e08b57fc3dae092dd05e9b", "score": "0.5183066", "text": "func DecodeBytes(na ipld.NodeAssembler, src []byte) error {\n\tvar tx types.Transaction\n\tif err := tx.UnmarshalBinary(src); err != nil {\n\t\treturn err\n\t}\n\treturn DecodeTx(na, tx)\n}", "title": "" }, { "docid": "fe3cd907acc8a5e228b8ce250ba210a2", "score": "0.51780957", "text": "func (h *Handler) CreateFromBytes(data []byte) (*networkingv1.IngressClass, error) {\n\tingcJson, err := yaml.ToJSON(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tingc := &networkingv1.IngressClass{}\n\tif err = json.Unmarshal(ingcJson, ingc); err != nil {\n\t\treturn nil, err\n\t}\n\treturn h.createIngressclass(ingc)\n}", "title": "" }, { "docid": "520c0d081d38ec244562e04320afe03d", "score": "0.5163313", "text": "func (p *TOMLParser) FromBytes(byteData []byte) (interface{}, error) {\n\tvar data interface{}\n\tif err := toml.Unmarshal(byteData, &data); err != nil {\n\t\treturn data, fmt.Errorf(\"could not unmarshal data: %w\", err)\n\t}\n\treturn &BasicSingleDocument{\n\t\tValue: data,\n\t}, nil\n}", "title": "" }, { "docid": "90cb29b783c6a5d5dcf29542a534c46c", "score": "0.5160989", "text": "func (d *DUIDOpaque) FromBytes(p []byte) error {\n\td.Data = append([]byte(nil), p...)\n\treturn nil\n}", "title": "" }, { "docid": "36b4fc5526466613c32a081356e8b105", "score": "0.5156266", "text": "func DecodeBytes(in []byte, objs ...interface{}) (err error) {\n\tbuf := bytes.NewBuffer(in)\n\terr = Decode(buf, objs...)\n\treturn\n}", "title": "" }, { "docid": "8e8487f064d0caf9aaaaf9daa7d9d2e1", "score": "0.5150984", "text": "func ParseUUIDBytes(b []byte) (u UUID, err error) {\n\tif len(b) != UUIDLen {\n\t\terr = errors.New(\"Given slice is not valid UUID sequence\")\n\t\treturn\n\t}\n\tcopy(u[:], b)\n\treturn\n}", "title": "" }, { "docid": "81396ff1435e1d6420f46081a61fc0b5", "score": "0.5136739", "text": "func (priv *PrivateKey) FromBytes(b []byte) (err error) {\n\tif len(b) != 32 {\n\t\treturn fmt.Errorf(\"Invalid private key bytes length %d, expected 32.\", len(b))\n\t}\n\n\tpriv.D = new(big.Int).SetBytes(b)\n\n\t/* Derive public key from private key */\n\tpriv.derive()\n\n\treturn nil\n}", "title": "" }, { "docid": "1e55c3b0f232088e7a2890e3fa029b0b", "score": "0.5116671", "text": "func (e *Element) FromBytes(buf *bytes.Buffer) error {\n\tdec := gob.NewDecoder(buf)\n\tif err := dec.Decode(&e.name); err != nil {\n\t\treturn err\n\t}\n\tif err := dec.Decode(&e.text); err != nil {\n\t\treturn err\n\t}\n\tif err := e.attrs.FromBytes(buf); err != nil {\n\t\treturn err\n\t}\n\treturn e.elements.FromBytes(buf)\n}", "title": "" }, { "docid": "974a24e3bfccecc3f8dbc750e9535ebf", "score": "0.51136726", "text": "func FromJSONBytes(b []byte, v interface{}) {\n\terr := json.Unmarshal(b, v)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "bba02e0a39a13d897afd604e8ab4bffa", "score": "0.5113047", "text": "func PubKeyFromBytes(pubKeyBytes []byte) (pubKey crypto.PubKey, err error) {\n\terr = cdc.UnmarshalBinaryBare(pubKeyBytes, &pubKey)\n\treturn\n}", "title": "" }, { "docid": "0e77459df64babf66156088851102717", "score": "0.5111898", "text": "func (im *IPMask) FromBytes(data []byte) error {\n\tbuf := uio.NewBigEndianBuffer(data)\n\t*im = IPMask(buf.CopyN(net.IPv4len))\n\treturn buf.FinError()\n}", "title": "" }, { "docid": "01b345e33d5645df629ec82d847f1f69", "score": "0.5108064", "text": "func NewFromByteSlice(items []byte) *SliceOfByte {\n\tslicy := &SliceOfByte{items}\n\treturn slicy\n}", "title": "" }, { "docid": "933c3885391c8771dc14fad49415e638", "score": "0.50998867", "text": "func NewScriptFromBytes(scriptBytes []byte) *Script {\n\tscript := Script(scriptBytes)\n\treturn &script\n}", "title": "" }, { "docid": "9d39ecf23473f83bd04bcf0f3ec91921", "score": "0.5095987", "text": "func MessageFromBytes(b []byte) (*Message, error) {\n\tbuffer := new(Message) // Init message buffer\n\n\tif err := json.Unmarshal(b, buffer); err != nil { // Check for errors\n\t\treturn &Message{}, err // Return found error\n\t}\n\n\treturn buffer, nil // Return decoded message\n}", "title": "" }, { "docid": "4250204842107f66149cd38465057b92", "score": "0.5085373", "text": "func (s *smsDeliver) FromBytes(octets []byte) (n int, err error) { //nolint:funlen\n\tbuf := bytes.NewReader(octets)\n\t*s = smsDeliver{}\n\theader, err := buf.ReadByte()\n\tn++\n\tif err != nil {\n\t\treturn\n\t}\n\ts.MessageTypeIndicator = header & 0x03\n\tif header>>2&0x01 == 0x00 {\n\t\ts.MoreMessagesToSend = true\n\t}\n\tif header>>3&0x01 == 0x01 {\n\t\ts.LoopPrevention = true\n\t}\n\tif header>>4&0x01 == 0x01 {\n\t\ts.StatusReportIndication = true\n\t}\n\n\ts.UserDataHeaderIndicator = header&(0x01<<6) != 0\n\ts.ReplyPath = header&(0x01<<7) != 0\n\n\toaLen, err := buf.ReadByte()\n\tn++\n\tif err != nil {\n\t\treturn\n\t}\n\tbuf.UnreadByte() // will read length again\n\tn--\n\ts.OriginatingAddress = make([]byte, blocks(int(oaLen), 2)+2)\n\toff, err := io.ReadFull(buf, s.OriginatingAddress)\n\tn += off\n\tif err != nil {\n\t\treturn\n\t}\n\ts.ProtocolIdentifier, err = buf.ReadByte()\n\tn++\n\tif err != nil {\n\t\treturn\n\t}\n\ts.DataCodingScheme, err = buf.ReadByte()\n\tn++\n\tif err != nil {\n\t\treturn\n\t}\n\ts.ServiceCentreTimestamp = make([]byte, 7)\n\toff, err = io.ReadFull(buf, s.ServiceCentreTimestamp)\n\tn += off\n\tif err != nil {\n\t\treturn\n\t}\n\ts.UserDataLength, err = buf.ReadByte()\n\tn++\n\tif err != nil {\n\t\treturn\n\t}\n\ts.UserData = make([]byte, int(s.UserDataLength))\n\toff, _ = io.ReadFull(buf, s.UserData)\n\ts.UserData = s.UserData[:off]\n\tn += off\n\treturn n, nil\n}", "title": "" }, { "docid": "8d8b34492a2f2a11c0ed3745d79df249", "score": "0.5082551", "text": "func DecodeBytes(na ipld.NodeAssembler, src []byte) error {\n\tvar header types.Header\n\tif err := rlp.DecodeBytes(src, &header); err != nil {\n\t\treturn err\n\t}\n\treturn DecodeHeader(na, header)\n}", "title": "" }, { "docid": "aa3fe7355d3a2ef628c46a51c0f2fff1", "score": "0.50759757", "text": "func FromBytes(content []byte, pkg string, w io.Writer) error {\n\tbundle := i18n.NewBundle(language.English)\n\tbundle.RegisterUnmarshalFunc(\"json\", json.Unmarshal)\n\n\t// Load source language\n\tmessageFile, err := bundle.ParseMessageFileBytes(content, \"en.json\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn generate(messageFile, pkg, w)\n}", "title": "" }, { "docid": "4487eaaee2fec383ac17cda5d39619f1", "score": "0.50752014", "text": "func (c *CloudConfig) LoadFromBytes(content []byte) *CloudConfig {\n\terr := yaml.Unmarshal(content, c)\n\tif err != nil {\n\t\tlog.Fatalf(\"%s\", err)\n\t}\n\treturn c\n}", "title": "" }, { "docid": "32ccc5675ca56bd5a5e6bb23727ad4dc", "score": "0.5074855", "text": "func NewFilterBitArrayFromBytes(bytes []byte) FilterBitArray {\n\tbitArray := FilterBitArray{}\n\tbitArray.FromBytes(bytes)\n\treturn bitArray\n}", "title": "" }, { "docid": "557c3b8152a7da7510b42c7f4e7b251f", "score": "0.50740755", "text": "func FromBytes(data []byte, widestSchema sif.Schema, currentSchema sif.Schema) (itypes.ReduceablePartition, error) {\n\tm := &pb.DPartition{}\n\terr := proto.Unmarshal(data, m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpart := &partitionImpl{\n\t\tid: m.Id,\n\t\tmaxRows: int(m.MaxRows),\n\t\tnumRows: int(m.NumRows),\n\t\trows: m.RowData,\n\t\tvarRowData: make([]map[string]interface{}, int(m.MaxRows)*widestSchema.Size()),\n\t\tserializedVarRowData: make([]map[string][]byte, int(m.MaxRows)*widestSchema.Size()),\n\t\trowMeta: m.RowMeta,\n\t\twidestSchema: widestSchema,\n\t\tcurrentSchema: currentSchema,\n\t\tkeys: nil,\n\t\tisKeyed: m.IsKeyed,\n\t}\n\tfor i, row := range m.SerializedVarRowData {\n\t\tpart.serializedVarRowData[i] = row.RowData\n\t}\n\tif m.IsKeyed {\n\t\tpart.keys = m.Keys\n\t}\n\treturn part, nil\n}", "title": "" }, { "docid": "82c25256fe3dabeb7720cceb261ee81d", "score": "0.50700516", "text": "func ValidateBytes(data []byte) ([]byte, error) {\n\tvar i json.RawMessage\n\n\terr := json.Unmarshal(data, &i)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn i, nil\n}", "title": "" }, { "docid": "d37b34f2cfada6edff710d8c71594a38", "score": "0.50694704", "text": "func (d *DUIDLL) FromBytes(p []byte) error {\n\tbuf := uio.NewBigEndianBuffer(p)\n\td.HWType = iana.HWType(buf.Read16())\n\td.LinkLayerAddr = buf.ReadAll()\n\treturn buf.FinError()\n}", "title": "" }, { "docid": "22ad51c9a6af05aac39b80bc88220a7a", "score": "0.5062393", "text": "func FromBytes(bs []byte) (*Event, error) {\n\t// TODO:\n\t// - consider 64 bit operating systems with 24 byte slices.\n\t// - is this the most efficient way to do this? Maybe just decode directly into a struct\n\t// - maybe check for input system requirements (ie, check that it is running on linux)\n\tif len(bs) != 16 {\n\t\treturn nil, ErrDecode{fmt.Sprintf(\"invalid event: should be %d bytes is %d bytes\", 16, len(bs))}\n\t}\n\n\tev := EVCode(binary.LittleEndian.Uint16(bs[8:10]))\n\tif ev >= EV_CNT {\n\t\treturn nil, ErrDecode{fmt.Sprintf(\"invalid event: %v\", ev)}\n\t}\n\n\tsec := binary.LittleEndian.Uint32(bs[0:4])\n\tusec := binary.LittleEndian.Uint32(bs[4:8])\n\n\tc := binary.LittleEndian.Uint16(bs[10:12])\n\n\treturn &Event{\n\t\tTime: time.Unix(int64(sec), int64(usec)),\n\t\tType: ev,\n\t\tCode: evCode(ev, c),\n\t\tValue: int32(binary.LittleEndian.Uint32(bs[12:16])),\n\t}, nil\n}", "title": "" }, { "docid": "b12df41e87894a7095e7ce554e466cf2", "score": "0.5062221", "text": "func (h *Handler) UpdateFromBytes(data []byte) (*appsv1.StatefulSet, error) {\n\tstsJson, err := yaml.ToJSON(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsts := &appsv1.StatefulSet{}\n\tif err = json.Unmarshal(stsJson, sts); err != nil {\n\t\treturn nil, err\n\t}\n\treturn h.updateStatefulset(sts)\n}", "title": "" }, { "docid": "79bee4d4b5c996aa27bdf3a84d949111", "score": "0.5058026", "text": "func UUIDFromBytes(b []byte) UUID {\n\treturn UUID(b)\n}", "title": "" }, { "docid": "9aeeb0003a284ea2b55946d2aa4b1a73", "score": "0.50531477", "text": "func DecodeBytes(b []byte, val interface{}) error {\n\t// initialize byte reader\n\tr := bytes.NewReader(b)\n\tif err := NewStream(r, uint64(len(b))).Decode(val); err != nil {\n\t\treturn err\n\t}\n\tif r.Len() > 0 {\n\t\treturn ErrMoreThanOneValue\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bf48f4c23bef3e6e8c3a0404761183c4", "score": "0.50417125", "text": "func IDFromBytes(b []byte) (core.ID, error) {\n\treturn core.IDFromBytes(b)\n}", "title": "" }, { "docid": "e1bc113313baf574c9e6023ac6fd1fce", "score": "0.5029813", "text": "func bytesDecode(raw []byte) (*encryptedData, error) {\n\tmacLen := 32\n\tivLen := 16\n\tif len(raw) == 0 {\n\t\treturn nil, errors.Errorf(\"raw must not be empty\")\n\t}\n\n\tif len(raw) < macLen+ivLen+pubKeyBytesLenCompressed+1 {\n\t\treturn nil, errors.Errorf(\"raw data does not have enough bytes to be encoded\")\n\t}\n\n\tif raw[0] != cipher.AES256CBC {\n\t\treturn nil, errors.Errorf(\"invalid prefix\")\n\t}\n\traw = raw[1:]\n\tdecompressedKey := decompress(raw[ivLen : ivLen+pubKeyBytesLenCompressed])\n\t// iv and mac must be created this way to ensure the cap of the array is not different\n\tiv := make([]byte, ivLen)\n\tcopy(iv, raw[:ivLen])\n\tmac := make([]byte, macLen)\n\tcopy(mac, raw[ivLen+pubKeyBytesLenCompressed:ivLen+pubKeyBytesLenCompressed+macLen])\n\n\tret := &encryptedData{\n\t\tInitializationVector: iv,\n\t\tEphemeralPublicKey: decompressedKey,\n\t\tMessageAuthenticationCode: mac,\n\t\tCiphertext: raw[ivLen+pubKeyBytesLenCompressed+macLen:],\n\t}\n\tif err := ret.verify(); err != nil {\n\t\treturn nil, errors.WithMessage(err, \"encrypted data is invalid\")\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "9290ca00f8ac66bfefde1ac29d78f701", "score": "0.5026907", "text": "func FromJSONByteSlice(data []byte, message MessageInterface) error {\n\terr := json.Unmarshal(data, message)\n\treturn err\n}", "title": "" }, { "docid": "f1630ee7fe8480d1cc107b6e633c9aa7", "score": "0.5025051", "text": "func (h *Handler) DeleteFromBytes(data []byte) error {\n\trcJson, err := yaml.ToJSON(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trc := &corev1.ReplicationController{}\n\tif err = json.Unmarshal(rcJson, rc); err != nil {\n\t\treturn err\n\t}\n\treturn h.deleteRC(rc)\n}", "title": "" }, { "docid": "b544c05c2ea1192ca43f8a8628c44c4b", "score": "0.5017448", "text": "func ParseUpgradeFileFromBytes(upgradeNotes []byte) (*UpgradeFile, error) {\n\t// parse bytes into object\n\tres := &UpgradeFile{}\n\n\terr := yaml.Unmarshal(upgradeNotes, res)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, err\n}", "title": "" }, { "docid": "2e398246a8e851d9546a9902048fc664", "score": "0.501649", "text": "func MessageIDFromBytes(bytes []byte) (result MessageID, consumedBytes int, err error) {\n\t// check arguments\n\tif len(bytes) < MessageIDLength {\n\t\terr = fmt.Errorf(\"bytes not long enough to encode a valid message id\")\n\t\treturn\n\t}\n\n\t// calculate result\n\tcopy(result[:], bytes)\n\n\t// return the number of bytes we processed\n\tconsumedBytes = MessageIDLength\n\n\treturn\n}", "title": "" }, { "docid": "c5181407cdf9b0e0a9c0ed0125697a62", "score": "0.5011839", "text": "func (p *Puzzle) DecodeFromBytes(b []byte) error {\r\n\tl := len(b)\r\n\tif l < 9 {\r\n\t\treturn ErrTooShortToDecode\r\n\t}\r\n\r\n\tvar err error\r\n\tp.Header, err = DecodeHeader(b)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tp.NoOfK = p.Header.Contents[0]\r\n\tp.Lifetime = p.Header.Contents[1]\r\n\tp.Opaque = binary.BigEndian.Uint16(p.Header.Contents[2:4])\r\n\tp.Random = p.Header.Contents[4:]\r\n\r\n\treturn nil\r\n}", "title": "" } ]
9aa7913b10749d76f0b8a7d133a9e142
If noFlag is set we just log and no file system modifications.
[ { "docid": "a506b98a6fa12e1fe8d693084644f1e2", "score": "0.0", "text": "func renameFiles(srcDir string, dstDir string, noFlag bool) {\n\n\tlog.Functionf(\"renameFiles(%s, %s, %t)\", srcDir, dstDir, noFlag)\n\tif _, err := os.Stat(dstDir); err != nil {\n\t\tif err := os.MkdirAll(dstDir, 0700); err != nil {\n\t\t\tlog.Error(err)\n\t\t\treturn\n\t\t}\n\t}\n\tlocations, err := os.ReadDir(srcDir)\n\tif err != nil {\n\t\t// Some old directories might not exist\n\t\tif !os.IsNotExist(err) {\n\t\t\tlog.Errorf(\"renameFiles read: directory '%s' failed: %v\",\n\t\t\t\tsrcDir, err)\n\t\t}\n\t\treturn\n\t}\n\tfor _, location := range locations {\n\t\tsha := strings.ToLower(location.Name())\n\t\tdstFile := dstDir + \"/\" + sha\n\t\t// Find single file in srcDir\n\t\tinnerDir := srcDir + \"/\" + location.Name()\n\t\tfiles, err := os.ReadDir(innerDir)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"renameFiles: read directory '%s' failed: %v\",\n\t\t\t\tinnerDir, err)\n\t\t\tcontinue\n\t\t}\n\t\tif len(files) == 0 {\n\t\t\tlog.Errorf(\"renameFiles: read directory '%s' no file\",\n\t\t\t\tinnerDir)\n\t\t\tcontinue\n\t\t}\n\t\tif len(files) > 1 {\n\t\t\tlog.Errorf(\"renameFiles: read directory '%s' more than one file: %d\",\n\t\t\t\tinnerDir, len(files))\n\t\t\tcontinue\n\t\t}\n\t\tsrcFile := innerDir + \"/\" + files[0].Name()\n\t\tif _, err := os.Stat(srcFile); err != nil {\n\t\t\tlog.Errorf(\"renameFiles: srcFile %s disappeared?: %s\",\n\t\t\t\tsrcFile, err)\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := os.Stat(dstFile); err == nil {\n\t\t\tlog.Warnf(\"renameFiles: dst %s already exists hence skipped\",\n\t\t\t\tdstFile)\n\t\t\tcontinue\n\t\t}\n\t\tif noFlag {\n\t\t\tlog.Functionf(\"renameFiles: dryrun from %s to %s\",\n\t\t\t\tsrcFile, dstFile)\n\t\t} else {\n\t\t\t// Must copy due to fscrypt\n\t\t\t// Use atomic rename\n\t\t\tcopyRenameDelete(srcFile, dstFile)\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "2bd38f4761420a79ba14b164aa764ea5", "score": "0.5703671", "text": "func init() {\n\tlog.SetFlags(0)\n}", "title": "" }, { "docid": "2bd38f4761420a79ba14b164aa764ea5", "score": "0.5703671", "text": "func init() {\n\tlog.SetFlags(0)\n}", "title": "" }, { "docid": "f38c40ec2983bb10bf23496fd74f55da", "score": "0.5678288", "text": "func LogVerboseToNowhere() {\n\tVerbosef = func(string, ...interface{}) {}\n}", "title": "" }, { "docid": "ac9ff7d2e06471e45b9504277258a780", "score": "0.56619304", "text": "func DiscardLogf(format string, args ...any) {}", "title": "" }, { "docid": "76638419719674614a50ee9e94bdb3d0", "score": "0.55834484", "text": "func NoStat(g *types.Cmd) {\n\tg.AddOptions(\"--no-stat\")\n}", "title": "" }, { "docid": "46384db4df8f3439e886a3950abc1f05", "score": "0.55608493", "text": "func DontLog(req *http.Request) {\n\tdontLog, _ := req.Context().Value(ctxDontLog).(*bool)\n\tif dontLog != nil {\n\t\t*dontLog = true\n\t}\n}", "title": "" }, { "docid": "5a8ad6cb8c12331a317a74fe2f9c6310", "score": "0.5421511", "text": "func resetLog() error {\n\tfor logPath, f := range mPathFile {\n\t\t// delete empty error log\n\t\tfi, err := f.Stat()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif fi.Size() == 0 {\n\t\t\tif err := os.Remove(logPath); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// close\n\t\tf.Close()\n\t}\n\tmPathFile = make(map[string]*os.File)\n\tlog.SetOutput(os.Stdout)\n\tlog2F = false\n\treturn nil\n}", "title": "" }, { "docid": "3686fa1f2d7b347c5df2c96624179fa9", "score": "0.5402714", "text": "func DisableLog() { log = uclog.Disabled }", "title": "" }, { "docid": "18d63508b810c931f3900c24d9122567", "score": "0.5379201", "text": "func OptNone() Option {\n\treturn func(l *Logger) error { l.Flags.SetNone(); return nil }\n}", "title": "" }, { "docid": "28cabf03723237d4aed2a8e9377f8808", "score": "0.53746414", "text": "func newNoOpLog() *Log {\n\treturn &Log{\n\t\tentry: &pb.AppendEntriesReq_LogEntry{\n\t\t\tCmd: CmdNoOp,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "5eaf0be251baa5c81bdc34080d238667", "score": "0.5368912", "text": "func logModTimeUpload(dst fs.Object) {\n\tmodTimeUploadOnce.Do(func() {\n\t\tfs.Logf(dst.Fs(), \"Forced to upload files to set modification times on this backend.\")\n\t})\n}", "title": "" }, { "docid": "b6713ecd37a81e7c9b0ca20f2b24d296", "score": "0.5326062", "text": "func Noop(f File) Rotator { return &noop{f} }", "title": "" }, { "docid": "d25c34107c3f2b64414eec37dd0f6d9d", "score": "0.532541", "text": "func DisableLogging() {\n\tlogrus.SetOutput(ioutil.Discard)\n}", "title": "" }, { "docid": "37fc7bcd73bd88a927adaa1f85f5d258", "score": "0.52147985", "text": "func (log *Logger) SetNoLock() {\n\tlog.mu.Disable()\n}", "title": "" }, { "docid": "3997154fd9ce744af128be291c6635e1", "score": "0.52091134", "text": "func (op *Operation) noMatches() {\n\tmsg := \"Failed to match any files\"\n\tif op.revert {\n\t\tmsg = \"No operations to undo\"\n\t}\n\n\tpterm.Info.Println(msg)\n}", "title": "" }, { "docid": "8b1c4152aceea0cf3c8791bfe5198dec", "score": "0.5163054", "text": "func init() {\n\tlog.SetFlags(log.LstdFlags | log.Lshortfile)\n}", "title": "" }, { "docid": "2178ea989477f4562fb4bc0ea2f4f98c", "score": "0.5120185", "text": "func NeverIgnore(_ string, _ os.FileInfo) bool {\n\treturn false\n}", "title": "" }, { "docid": "c2707782a445c9accf15fe009da0cf81", "score": "0.5096979", "text": "func (fs *FileStat) Ignore() {\n\tfs.Return = make(chan int64, 1)\n}", "title": "" }, { "docid": "ea7e044dac48ad724e1d0c38d83853ef", "score": "0.50949204", "text": "func noSyncEnd() fileOp {\n\treturn fileOp{func(c *ctx) error {\n\t\tc.noSyncEnd = true\n\t\treturn nil\n\t}, IsInit, \"noSyncEnd()\"}\n}", "title": "" }, { "docid": "57371695b4aa4dfb563af110e1f12424", "score": "0.50659925", "text": "func checkNoChanges(t *testing.T, ctx context.Context, cloud fi.Cloud, allTasks map[string]fi.CloudupTask) {\n\ttarget := doDryRun(t, ctx, cloud, allTasks)\n\n\tif target.HasChanges() {\n\t\tvar b bytes.Buffer\n\t\tif err := target.PrintReport(allTasks, &b); err != nil {\n\t\t\tt.Fatalf(\"error building report: %v\", err)\n\t\t}\n\t\tt.Fatalf(\"Target had changes after executing: %v\", b.String())\n\t}\n}", "title": "" }, { "docid": "d761745f31176e4c59f7aeae8145ea88", "score": "0.50504434", "text": "func init() {\n\tlogrus.SetOutput(ioutil.Discard)\n}", "title": "" }, { "docid": "511ce964dd50433f0bac2455de23da6d", "score": "0.50467575", "text": "func NotCompressed(fs *FS, b bool) { fs.nocompress = b }", "title": "" }, { "docid": "75fed39b0538eb85a62a8cfa96ceaac1", "score": "0.5043882", "text": "func discardLogf(format string, v ...interface{}) {\n}", "title": "" }, { "docid": "ff959e1e6e3b310d257b0d9aa6ec9bcf", "score": "0.5041981", "text": "func init() {\n\tlog.SetFlags(log.Lshortfile)\n}", "title": "" }, { "docid": "8a45b9a661e61daba68cdfe1c556c29a", "score": "0.5040935", "text": "func NotCreateFile(op int32) bool {\n\treturn op&OptionNotCreateFile == OptionNotCreateFile\n}", "title": "" }, { "docid": "e8f3400c8936a67d488e032b0ff97740", "score": "0.50401336", "text": "func (i IgnoreLog) Printf(format string, args ...interface{}) {\n\treturn\n}", "title": "" }, { "docid": "d4bbce2849315131c7e39c8b1122abbc", "score": "0.50255936", "text": "func Sync() {\n\tif defaultLogger.LogFile != nil {\n\t\tdefaultLogger.LogFile.fd.Sync()\n\t}\n}", "title": "" }, { "docid": "5e7226e86b538ddee7c2664a151b7fd8", "score": "0.50156146", "text": "func (l logger) logIt(msg string) {\n\tl.checkForFullFile()\n\tfileName := l.FILE_PREFIX + \"_\" + strconv.Itoa(fileCount) + \".txt\"\n\tfile, err := os.OpenFile(fileName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t}\n\tdefer file.Close()\n\n\tfi, _ := file.Stat()\n\tif lineCount == 0 && fi.Size() > 0 { // overwrite file contents if we're starting a new file and the file already has contents.\n\t\tfile.Truncate(0)\n\t\tfile.Seek(0, 0)\n\t}\n\n\tlog_msg := \"[\" + time.Time.String(time.Now()) + \"] \" + msg + \"\\n\"\n\tfile.WriteString(log_msg)\n\tlineCount += 1\n}", "title": "" }, { "docid": "6dde27e2b0d92c2c957b00b97651df30", "score": "0.50105935", "text": "func DisableLog() {\n\tklog.SetHandler(log.DiscardHandler())\n}", "title": "" }, { "docid": "355ff81148b2b65d9bcc6e71d9a666db", "score": "0.500772", "text": "func IgnoredFlag(f *flag.FlagSet, name, message string) {\n\tf.Var(ignoredFlag{name}, name, message)\n}", "title": "" }, { "docid": "b1cf53e420c2b9aea29ed36bd6d349fd", "score": "0.49934164", "text": "func (s *state) Flag(c int) bool {\n\treturn false // 控制是否输出详细路径. 如果为false则输出相对路径, 如果是true输出绝对路径\n}", "title": "" }, { "docid": "92a75adcdf732054b0bf6a8bdfc3918a", "score": "0.49918362", "text": "func (f *ReadWriteFile) Flag() int {\n\tif (!f.flag.overridden) && f.flag.flag == 0 {\n\t\tf.flag.flag = DefaultRWFileFlag\n\t}\n\treturn f.flag.flag\n}", "title": "" }, { "docid": "6c5959e06c9a7386fc5cd317dc7fc22a", "score": "0.49710807", "text": "func DisableBufferedLogs() {\n\tsingleton.storeEntries = false\n\tsingleton.entries = nil\n}", "title": "" }, { "docid": "ed2c7f34f61b7f54114c3e803fb1261c", "score": "0.49601763", "text": "func SetNoDump(fd *os.File) error {\n\treturn SetAttr(fd, FsNoDumpFlag)\n}", "title": "" }, { "docid": "0d82aad578d86b2b77cd37798b0f96b9", "score": "0.49406615", "text": "func Disable() {\n\tos.Setenv(\"DEBUG\", \"\")\n\tlogrus.SetLevel(logrus.InfoLevel)\n\tlogrus.SetFormatter(&nullFormat{})\n}", "title": "" }, { "docid": "96e6c185bc74ab1ee26521970e700dcd", "score": "0.4939396", "text": "func rewriteLogFile() error {\n\tflag := pflag.Lookup(\"log_file\")\n\tif flag != nil {\n\t\t// don't show the default value\n\t\terr := pflag.Set(\"log_file\", \"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "216b766ac9e9950191e36821e6dd5b08", "score": "0.4937552", "text": "func TestFileSystemWatcherAddFileNonExisting(t *testing.T) {\n\tfw, _ := NewFileSystemWatcher()\n\tdefer fw.Close()\n\tfilename := \"testfile.txt\"\n\terr := fw.AddFile(filename, AllOps)\n\tif err == nil {\n\t\tt.Fatal(\"AddFile should not allow adding of non-existing files\")\n\t}\n}", "title": "" }, { "docid": "2c62c4fb30bf724d1d3dd0ecff35ab62", "score": "0.4930706", "text": "func (e *Engine) persistNoOp() {\n\tif err := e.Persist(newNoOpLog()); err != nil {\n\t\te.logger.Error(\"Persist no-op log failed | states=%v | err=[%v]\", e, err)\n\t} else {\n\t\te.logger.Info(\"No-op log persisted | states=%v\", e)\n\t}\n}", "title": "" }, { "docid": "e9a4de5e25584317b23d21910164b11b", "score": "0.49265644", "text": "func (s *Session) nonunlockingLog(tokens ...interface{}) {\n\tif s.OnLog != nil {\n\t\ts.OnLog(tokens...)\n\t}\n}", "title": "" }, { "docid": "05c76d28c317914f4c75fb68848fdf77", "score": "0.49231327", "text": "func NoFileExistsf(path string, msg string, args ...interface{}) {\n\tdebuggoGen_NoFileExistsf(path, msg, args)\n}", "title": "" }, { "docid": "94665b01a05fdb1111f380adac621709", "score": "0.4914063", "text": "func (i *slogInstance) LogNoFormat(str interface{}, v ...interface{}) Instance {\n\tif enabledLevels[INFO] {\n\t\ti.stackOffset -= 2\n\t\ttxt := stripColors(i.buildText(asString(str), INFO, v...))\n\t\t_, _ = i.Write([]byte(txt))\n\t\ti.stackOffset += 2\n\t}\n\treturn i\n}", "title": "" }, { "docid": "b829ebdb5a2ea5385b6e4324f966cf2d", "score": "0.48975378", "text": "func TestWritingToLog_DefaultPath(t *testing.T) {\n\texpectedMsg := \"This is expected output\"\n\n\tlogger := logrus.New()\n\tlogger.Level = logrus.DebugLevel\n\n\ttmpFile, err := ioutil.TempFile(\"\", \"test.txt\")\n\tfileName := tmpFile.Name()\n\n\tdefer func() {\n\t\ttmpFile.Close()\n\t\tos.Remove(fileName)\n\t}()\n\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create tmp file. Err: %v\", err)\n\t}\n\n\thook, err := fsrus.NewFilesystemHook(nil, fileName, nil, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create file system hook: %v\", err)\n\t}\n\n\tlogger.AddHook(hook)\n\n\t// Log an expected message and a message which should be filtered out.\n\tlogger.Info(expectedMsg)\n\tlogger.Debug(expectedMsg)\n\tlogger.Warning(expectedMsg)\n\tlogger.Error(expectedMsg)\n\n\tscanner := bufio.NewScanner(tmpFile)\n\tscanner.Split(bufio.ScanLines)\n\n\tnumReceivedMsgs := 0\n\tfor scanner.Scan() {\n\t\tcurr := scanner.Text()\n\t\tif strings.Contains(curr, expectedMsg) {\n\t\t\tnumReceivedMsgs++\n\t\t} else {\n\t\t\tt.Errorf(\"Unexpected message: %s\", curr)\n\t\t}\n\t}\n\n\tif numReceivedMsgs != 4 {\n\t\tt.Errorf(\"Didn't receive all of the expected messages. Received: %d\", numReceivedMsgs)\n\t}\n}", "title": "" }, { "docid": "db1ea6e14cd7061ec5b21e7d85253867", "score": "0.4895902", "text": "func writeForceCheck(path string, force bool) {\n\tif _, err := os.Stat(path); !os.IsNotExist(err) && !force {\n\t\tfmt.Printf(\"Error: file exists [%s], use -force to override\\n\", path)\n\t\tos.Exit(1)\n\t}\n}", "title": "" }, { "docid": "8918aea45e5cf743ff44f8e9b556e95b", "score": "0.4881656", "text": "func DisableLog() {\n\tLogger = seelog.Disabled\n}", "title": "" }, { "docid": "1505b257849d94cbdb2e5454ef9c6866", "score": "0.4879048", "text": "func SuppressOutput(suppress bool) {\n\tif suppress {\n\t\tatomic.StoreUint32(&forbidDebug, 1)\n\t\tDebugLogger.SetOutput(ioutil.Discard)\n\t\tInfoLogger.SetOutput(ioutil.Discard)\n\t\tErrorLogger.SetOutput(ioutil.Discard)\n\t} else {\n\t\tatomic.StoreUint32(&forbidDebug, 0)\n\t\tDebugLogger.SetOutput(os.Stderr)\n\t\tInfoLogger.SetOutput(os.Stderr)\n\t\tErrorLogger.SetOutput(os.Stderr)\n\t}\n}", "title": "" }, { "docid": "520f0f0f90172ecc37c301f72d009c8c", "score": "0.48767608", "text": "func DisableLog() {\n\tjww.DiscardLogging()\n}", "title": "" }, { "docid": "ea2c467421451211a8c8e0dc020db768", "score": "0.48718312", "text": "func (v Verbose) Infoln(args ...interface{}) {\n\tif v {\n\t\tklog.Infoln(args...)\n\t}\n}", "title": "" }, { "docid": "47811bb749eda8dfbc7e311c59acb225", "score": "0.487051", "text": "func LogIgnore() {\n\tlogger = log.New(ioutil.Discard, \"\", log.Lmicroseconds)\n}", "title": "" }, { "docid": "040be851d81aa5c33d48c7defd04dc8e", "score": "0.48659828", "text": "func testOpFilter(t *testing.T, op Op) {\n\n\tdir := makeTestDir(t)\n\tdefer os.RemoveAll(dir)\n\n\tfw, _ := NewFileSystemWatcher()\n\tdefer fw.Close()\n\n\terr := fw.AddDir(dir, \"\", op, false)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tfw.NotifyEvent(func(event *Event, err error) {\n\n\t\tif event == nil {\n\t\t\tt.Fatal(\"event should not be nil\")\n\t\t}\n\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\n\t\tif event.Op != op {\n\t\t\tt.Fatal(\"Notified of wrong event:\", event.String())\n\t\t}\n\n\t})\n\n\tdoFileOps(t, dir)\n\n\ttime.Sleep(100 * time.Millisecond)\n\n}", "title": "" }, { "docid": "745860ddce667b9f50eb1c6fefc5a4a1", "score": "0.48658508", "text": "func setFlags() {\n\t/*\n\t Ldate\t\t // the date: 2009/01/23\n\t Ltime // the time: 01:23:23\n\t Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime.\n\t Llongfile // full file name and line number: /a/b/c/d.go:23\n\t Lshortfile // final file name element and line number: d.go:23. overrides Llongfile\n\t LstdFlags // Ldate | Ltime // initial values for the standard logger\n\t*/\n\tlog.SetFlags(log.LstdFlags | log.Lshortfile)\n}", "title": "" }, { "docid": "89b8d0b956aefdffacb6c37959042eee", "score": "0.4865619", "text": "func CacheNothing(ctx context.Context, fileInfo FileInfo) string {\n\treturn \"no-store, no-cache, must-revalidate, post-check=0, pre-check=0\"\n}", "title": "" }, { "docid": "de96b85ce58a6874bbae37288193077f", "score": "0.486388", "text": "func (l logger) checkForFullFile() {\n\tif lineCount == l.MAX_LINES_PER_FILE {\n\t\tlineCount = 0\n\t\tfileCount += 1\n\t}\n}", "title": "" }, { "docid": "8651db8572d0df3cd4e2efa9774e144c", "score": "0.4850791", "text": "func OptNoneWritable() Option {\n\treturn func(l *Logger) error { l.Writable.SetNone(); return nil }\n}", "title": "" }, { "docid": "3f3723d992b52e4b754e2027151d5a74", "score": "0.48487273", "text": "func NewNoOp() *Logger {\n\t// Does not matter what level as this is NoOp.\n\tatomicLevel := zap.NewAtomicLevelAt(zapcore.InfoLevel)\n\tlogger := zap.New(nil)\n\treturn &Logger{\n\t\tlogger: logger.Sugar(),\n\t\tlevel: &atomicLevel,\n\t}\n}", "title": "" }, { "docid": "98ecf8b8c395f53790265d72bfd78fd2", "score": "0.48409125", "text": "func (*superOperations) Keep(*fs.Dirent) bool {\n\treturn false\n}", "title": "" }, { "docid": "b54290326b09ad9a8812a6660d2448b2", "score": "0.48393765", "text": "func (l *Nolog) Infof(ctx context.Context, s string, args ...interface{}) {\n\treturn\n}", "title": "" }, { "docid": "df4c5a5768e9e4422cab530869eccd15", "score": "0.48288563", "text": "func f_log (msg string) {\n\n /* if the file is too big, rotate it now */\n\n sbuf, err := os.Stat (cfg_logFile) ;\n if (err == nil) && (sbuf.Size() > cfg_logMaxSize) {\n err = os.Rename (cfg_logFile, cfg_logFile + \".old\") ;\n if (err != nil) {\n fmt.Printf (\"WARNING: Cannot rotate %s - %s.\\n\", cfg_logFile, err) ;\n }\n }\n\n /* open/create file for appending */\n\n fd, err := os.OpenFile (cfg_logFile,\n os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) ;\n if (err != nil) {\n fmt.Printf (\"WARNING: Cannot open %s - %s\\n\", cfg_logFile, err) ;\n return ;\n }\n defer fd.Close () ;\n\n /* figure out timestamp and calling function */\n\n now := time.Now().Format(time.RFC3339) ;\n pc, _, line, _ := runtime.Caller (1) ;\n fn := runtime.FuncForPC (pc) ;\n\n s := fmt.Sprintf (\"%s %s:%d %s\\n\", now, fn.Name(), line, msg) ;\n _, err = fd.WriteString (s) ;\n if (err != nil) {\n fmt.Printf (\"WARNING: Cannot write to %s - %s\\n\", cfg_logFile, err) ;\n }\n}", "title": "" }, { "docid": "b64bffa75087e991b3d1cd602e752818", "score": "0.48265746", "text": "func init() {\n\t// log with date, time, file name, and line number\n\tlog.SetFlags(log.Lshortfile)\n}", "title": "" }, { "docid": "d0288791eb529a5722283380f197e3e2", "score": "0.48149988", "text": "func init() {\n\tlog.SetFlags(log.LstdFlags | log.Lmicroseconds | log.Lshortfile)\n}", "title": "" }, { "docid": "f1eb03ed025f06e21b525b9fc184dc46", "score": "0.48101005", "text": "func ClearLog() {\nf,err:=os.Create(\"log.txt\")\n\tif err!=nil {\n\t\tpanic(err)\n\t} else {\n\t\tf.Close()\n\t}\n}", "title": "" }, { "docid": "012bc93a30a7ad9154043b367eb60e85", "score": "0.48050892", "text": "func init() {\n\tlog.SetOutput(ioutil.Discard)\n}", "title": "" }, { "docid": "012bc93a30a7ad9154043b367eb60e85", "score": "0.48050892", "text": "func init() {\n\tlog.SetOutput(ioutil.Discard)\n}", "title": "" }, { "docid": "012bc93a30a7ad9154043b367eb60e85", "score": "0.48050892", "text": "func init() {\n\tlog.SetOutput(ioutil.Discard)\n}", "title": "" }, { "docid": "448c3fa1d75b6ac5db7f5b9a23d6cc51", "score": "0.47972795", "text": "func Silence() {\n\tlogger.Out = io.Discard\n}", "title": "" }, { "docid": "c476fc77d35d7f2056215b52cf27c674", "score": "0.47965708", "text": "func NoFirstRun(m map[string]interface{}) error {\n\treturn Flag(\"no-first-run\", true)(m)\n}", "title": "" }, { "docid": "618368b7f73c0113a0fb1153d2de694f", "score": "0.4779301", "text": "func NoLogger() func(*Reader) {\n\treturn func(r *Reader) {\n\t\tr.logger = nil\n\t}\n}", "title": "" }, { "docid": "15a5f2e3e9d4595af074f15f400d5e71", "score": "0.47700578", "text": "func (lo Logger) SetNoColor(nc bool) {\n\tSetNoColor(lo, nc)\n}", "title": "" }, { "docid": "9c75b20594df68a6db73ead7a25db708", "score": "0.47700176", "text": "func (f *File) Dirty() bool {\n\treturn f.seq != f.putseq\n}", "title": "" }, { "docid": "0e9ec00e49830e5c945b08fde04d718f", "score": "0.47689947", "text": "func (log *nillog) Infof(format string, args ...interface{}) {\n}", "title": "" }, { "docid": "70e0d21a658fc675416880600cd4ee56", "score": "0.47678757", "text": "func InitNoAuth(workDir string) error {\n\ta := authOpt{NoAuth: true}\n\tif err := a.writeToDisk(workDir); err != nil {\n\t\treturn skerr.Wrapf(err, \"writing to work dir: %s\", workDir)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8e5fbc5f968f37c53c3537ed725d0a53", "score": "0.4760384", "text": "func (f *Flag) Reset() {\n\t*f = 0\n}", "title": "" }, { "docid": "5e07571f2260ae1d768e3c94ec1580cf", "score": "0.47439164", "text": "func initLog(fileName string) error {\n\tif fileName == \"\" {\n\t\tfileName = defaultLogFile\n\t}\n\tf, err := os.OpenFile(fileName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.SetOutput(f)\n\tlog.SetLevel(log.DebugLevel)\n\treturn nil\n}", "title": "" }, { "docid": "65b228898d759b4821b2a52a2530fd2c", "score": "0.47413975", "text": "func WriteLogClear() {\n\tRemoveFile(LOGFILE)\n}", "title": "" }, { "docid": "eff3bb8938e7af42e4dac7cf8bcad0a7", "score": "0.4735939", "text": "func (r *Router) RequestNoLogging(h httprouter.Handle) httprouter.Handle {\n\treturn parameters.MakeHTTPRouterParsedReq(func(w http.ResponseWriter, req *http.Request, ps httprouter.Params) {\n\n\t\t// Start the custom response writer\n\t\tguid, _ := uuid.NewV4()\n\t\twriter := &APIResponseWriter{\n\t\t\tIPAddress: GetClientIPAddress(req),\n\t\t\tMethod: req.Method,\n\t\t\tRequestID: guid.String(),\n\t\t\tResponseWriter: w,\n\t\t\tStatus: 0, // future use with E-tags\n\t\t\tURL: req.URL.String(),\n\t\t\tUserAgent: req.UserAgent(),\n\t\t}\n\n\t\t// Store key information into the request that can be used by other methods\n\t\treq = SetOnRequest(req, ipAddressKey, writer.IPAddress)\n\t\treq = SetOnRequest(req, requestIDKey, writer.RequestID)\n\n\t\t// Set cross-origin on each request that goes through logging\n\t\tr.SetCrossOriginHeaders(writer, req, ps)\n\n\t\t// Set access control headers\n\t\tif len(r.AccessControlExposeHeaders) > 0 {\n\t\t\tw.Header().Set(exposeHeader, r.AccessControlExposeHeaders)\n\t\t}\n\n\t\t// Fire the request\n\t\th(writer, req, ps)\n\t})\n}", "title": "" }, { "docid": "4762bdac39c092fba394d5f015c65d7a", "score": "0.47339228", "text": "func DisableDebugLog() {\n\tdebug.Store(false)\n}", "title": "" }, { "docid": "f2e0c2c0d5c0aecd309cc11bd4aefcf8", "score": "0.4729746", "text": "func NoOpFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tchain.ProcessFilter(req, resp)\n}", "title": "" }, { "docid": "b6ae03c1f8c7995ac3317472af402a57", "score": "0.47185564", "text": "func init() {\n log.SetFlags(FLogFlags)\n}", "title": "" }, { "docid": "9834003b2f7a38949a32b66a51456138", "score": "0.47105613", "text": "func TestChownNoChange(t *testing.T) {\n\tf := func(fs FSImplem, t *T) {\n\n\t\tname := fs.Root()\n\t\t// Create a file\n\t\tname = name + \"/file\"\n\t\tt.WriteFile(name, []byte(\"some data\"), os.ModeAppend)\n\n\t\tuid := os.Getuid()\n\t\tgid := os.Getgid()\n\n\t\terr := os.Chown(name, uid, gid)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\n\t\t\t\t\"[%v] Chown(%s): expected no error when not changing anything\\n\",\n\t\t\t\tfs, name)\n\t\t}\n\t}\n\tTestAllImplem(t, f)\n}", "title": "" }, { "docid": "b8e3d33bd27c73e093c1a462b7baec62", "score": "0.47092018", "text": "func (fsys *Filesys) log(a string, args ...interface{}) {\n\tLogMsg(\"dxfuse\", a, args...)\n}", "title": "" }, { "docid": "64550944bffbfcb6ddaebe277ebef7e7", "score": "0.4704077", "text": "func (r *Runner) makeNoFSWatchWalkFn() WalkFunc {\n\tc := r.c\n\tfn := func(path string, resolvedPath string, f *os.FileInfo, errx os.Error) os.Error {\n\t\tif errx != nil { return errx }\n\t\tnoFilesToSync := len(c.FilesToSync) == 0\n\t\tif noFilesToSync && r.rebuildApp && r.restartApp { return noFSWatchExitEarly }\n\t\tif f.IsDirectory() {\n\t\t\tif c.watchDirNamesToSkipRE.MatchString(f.Name) { return WalkSkipDir }\n\t\t\treturn nil \n\t\t} else if f.IsRegular() {\n\t\t\t//r.vout(\"noFSWatchWalkFn: Path: %v\", path)\n\t\t\tfnx := func(newPath string, newFileInfo *os.FileInfo) {\n\t\t\t\tif r.manageGoAppLastRunStartNs > 0 {\n\t\t\t\t\tif newFileInfo.Mtime_ns < r.manageGoAppLastRunStartNs { return }\n\t\t\t\t\tr.vout(\"noFSWatchWalkFn: File changed: Path: %v, Mtime_ns: %v, manageGoLastRun: %v\", \n\t\t\t\t\t\tnewPath, newFileInfo.Mtime_ns, r.manageGoAppLastRunStartNs)\n\t\t\t\t}\n\t\t\t\tr.restartApp = true\n\t\t\t\tif r.isAppGoFile(newPath) { r.rebuildApp = true } \n\t\t\t}\n\t\t\t//check if any file changed\n\t\t\tfnx(path, f)\n\t\t\t//check if path matches one of the filesToSync\n\t\t\tif fdest, ok := c.FilesToSync[path]; ok { \n\t\t\t\tfdstat, errd := os.Stat(fdest)\n\t\t\t\tif errd != nil || f.Mtime_ns > fdstat.Mtime_ns {\n\t\t\t\t\tr.cp(path, fdest)\n\t\t\t\t\tfdstat, errd = os.Stat(fdest)\n\t\t\t\t}\n\t\t\t\tfnx(fdest, fdstat)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\treturn fn\n}", "title": "" }, { "docid": "c874f25a795a366da3bc22cb88ecd99c", "score": "0.47007617", "text": "func SetFlags(f int) {\n\tlog.SetFlags(f)\n}", "title": "" }, { "docid": "ec023a063605752d15fa2752ad2477c0", "score": "0.46993002", "text": "func (c *Config) DisableLogging() {\n\tlogrus.SetOutput(ioutil.Discard)\n}", "title": "" }, { "docid": "d6ddadf2201cfa798b7745ef27c11585", "score": "0.46980703", "text": "func initLog(logpath string) (*os.File, error) {\n\tos.Remove(logpath)\n\tf, err := os.OpenFile(logpath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog.SetOutput(io.Writer(f))\n\tlog.Println(\"***START OF LOG FILE***\")\n\n\treturn f, nil\n}", "title": "" }, { "docid": "026801b2b6e2f300a6c252a46bf1afe1", "score": "0.46968448", "text": "func init() {\n\tSetLogger(log.New(os.Stdout, \"\", log.LstdFlags), false)\n}", "title": "" }, { "docid": "0b62f5544e95287526f44746e81070b7", "score": "0.46928167", "text": "func check(err error, fLog *os.File) {\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tlog.SetOutput(io.MultiWriter(fLog, os.Stdout))\n}", "title": "" }, { "docid": "abc3e7c6e1af7bdfef25b2300aa70edc", "score": "0.46883127", "text": "func (l *loggingT) flushAll() {\n\t// Flush from fatal down, in case there's trouble flushing.\n\tif l.file != nil {\n\t\tl.file.Flush() // ignore error\n\t\tl.file.Sync() // ignore error\n\t}\n}", "title": "" }, { "docid": "020774968bdce2c74a6beab0ace2da2b", "score": "0.46849552", "text": "func SetFlags(f int) {\n\tloggerGlobal.SetFlags(f)\n}", "title": "" }, { "docid": "85ddc29eb7a4112635c8f62553083398", "score": "0.4680821", "text": "func (e *EmptyLogger) Enabled() bool {\n\treturn false\n}", "title": "" }, { "docid": "1fe7e4c13337e5ef17178ec9698fa829", "score": "0.4679918", "text": "func ChmodNoAccess(name string) {\n\tchmodMask(name, os.ModePerm, 0)\n}", "title": "" }, { "docid": "ca64e02b6f43542e4e6d7e7ea41ed979", "score": "0.46747124", "text": "func loggy(fname string, msg string) {\n fh, err := os.OpenFile(fname, os.O_CREATE | os.O_RDWR | os.O_APPEND, 0666)\n if err == nil {\n now := time.Now()\n tstr := now.Format(\"20060102-150405.\") + strconv.FormatInt(int64(now.Nanosecond()/1000),10)\n fh.WriteString(tstr + \" start@\"+srcFileNameLine(-1)+\" \"+srcFileNameLine(2) + \":\"+ msg +\"\\n\")\n fh.Close()\n }\n}", "title": "" }, { "docid": "30e4bc6aa45cff9f79303c5dd024d4eb", "score": "0.4672862", "text": "func forceWriteLogs(entries []types.LogEntry) error {\n\tDataBase.Delete(\"logs\", \"default\") // error is thrown when file doesnt exist - ignore error\n\tif err := DataBase.Write(\"logs\", \"default\", entries); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4e856eb058de467f5c456f29ae37ca5d", "score": "0.4667921", "text": "func (l *Logger) Disable() {\n\tl.m.Lock()\n\tl.currentLevel = zapcore.FatalLevel\n\tl.m.Unlock()\n\tl.atom.SetLevel(zap.FatalLevel)\n}", "title": "" }, { "docid": "f46654b3a6192713a7d278959de3b383", "score": "0.46678358", "text": "func (v Verbose) Infoln(args ...interface{}) {\n\tif v {\n\t\tklogv2.InfoDepth(1, fmt.Sprintln(args...))\n\t}\n}", "title": "" }, { "docid": "eb49007ec0368060fc5d3b7efa3a0ec7", "score": "0.46630013", "text": "func NoFf(g *types.Cmd) {\n\tg.AddOptions(\"--no-ff\")\n}", "title": "" }, { "docid": "f44a421f7131dce31abc81a167360956", "score": "0.46622053", "text": "func Security_noFiles(user *Admin) (response map[string]interface{}, err error) {\n\tresponse, err = SendCmd(user, \"Security_noFiles\", nil)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "3495b6419875f819317d0548f3009183", "score": "0.4662081", "text": "func setLogAttribute() {\n\tdriver := filepath.Base(os.Args[0])\n\tlogFile := LOGFILE_PREFIX + driver + \".log\"\n\tf, err := os.OpenFile(logFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)\n\tif err != nil {\n\t\tutils.Finish(utils.Fail(\"Log File open error\"))\n\t}\n\n\t// rotate the log file if too large\n\tif fi, err := f.Stat(); err == nil && fi.Size() > 2*MB_SIZE {\n\t\tf.Close()\n\t\ttimeStr := time.Now().Format(\"-2006-01-02-15:04:05\")\n\t\ttimedLogfile := LOGFILE_PREFIX + driver + timeStr + \".log\"\n\t\tos.Rename(logFile, timedLogfile)\n\t\tf, err = os.OpenFile(logFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)\n\t\tif err != nil {\n\t\t\tutils.Finish(utils.Fail(\"Log File open error2\"))\n\t\t}\n\t}\n\tlog.SetOutput(f)\n}", "title": "" }, { "docid": "e8aa2db6734526c55d88b154cf73c450", "score": "0.4655939", "text": "func NoOpFlagFunctionWorker() FlagFunctionWorker {\n\treturn func() {}\n}", "title": "" }, { "docid": "558010083ef0f8581ea95dcda45dd285", "score": "0.4651201", "text": "func (l *Log) Disable() {\r\n\tl.disabled = true\r\n}", "title": "" }, { "docid": "489b228a31467c81dedd2d9e0a20bc5e", "score": "0.46487504", "text": "func (log *nillog) Warnf(format string, args ...interface{}) {\n}", "title": "" }, { "docid": "c5a5a9c55ef380672d3b08c28c3144ae", "score": "0.4644681", "text": "func (e EmptyLogger) Printf(format string, v ...interface{}) {}", "title": "" }, { "docid": "85011d202266614b8ee46de70d717e8e", "score": "0.46436882", "text": "func (m ModuleLogger) Disable() {\n\tm.Entry.Logger.SetLevel(logrus.PanicLevel)\n\tm.Entry.Logger.SetOutput(ioutil.Discard)\n}", "title": "" } ]
eccb54172aa9221affbf28b95b1c5080
NewPipeline registers a new resource with the given unique name, arguments, and options.
[ { "docid": "0d659104da32efaebb1620ae7cc06ca7", "score": "0.6331665", "text": "func NewPipeline(ctx *pulumi.Context,\n\tname string, args *PipelineArgs, opts ...pulumi.ResourceOption) (*Pipeline, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.ArtifactStores == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ArtifactStores'\")\n\t}\n\tif args.RoleArn == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'RoleArn'\")\n\t}\n\tif args.Stages == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Stages'\")\n\t}\n\tvar resource Pipeline\n\terr := ctx.RegisterResource(\"aws:codepipeline/pipeline:Pipeline\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" } ]
[ { "docid": "24d39bc0e371e3d41f9885f9521a8f3b", "score": "0.6608196", "text": "func NewPipeline(ctx *pulumi.Context,\n\tname string, args *PipelineArgs, opts ...pulumi.ResourceOption) (*Pipeline, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.DataFactoryId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'DataFactoryId'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Pipeline\n\terr := ctx.RegisterResource(\"azure:datafactory/pipeline:Pipeline\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "8219b20cc9386504c52313fff185e936", "score": "0.64923495", "text": "func NewPipeline(ctx *pulumi.Context,\n\tname string, args *PipelineArgs, opts ...pulumi.ResourceOption) (*Pipeline, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.PipelineActivities == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'PipelineActivities'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Pipeline\n\terr := ctx.RegisterResource(\"aws-native:iotanalytics:Pipeline\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "d5fee6c7965309433a22345460ac4982", "score": "0.6456052", "text": "func definePipelineResource(name, namespace string, params []v1alpha1.Param, resourceType v1alpha1.PipelineResourceType) *v1alpha1.PipelineResource {\n\tpipelineResource := v1alpha1.PipelineResource{\n\t\tObjectMeta: metav1.ObjectMeta{Name: name, Namespace: namespace},\n\t\tSpec: v1alpha1.PipelineResourceSpec{\n\t\t\tType: resourceType,\n\t\t\tParams: params,\n\t\t},\n\t}\n\tresourcePointer := &pipelineResource\n\treturn resourcePointer\n}", "title": "" }, { "docid": "d5fee6c7965309433a22345460ac4982", "score": "0.6456052", "text": "func definePipelineResource(name, namespace string, params []v1alpha1.Param, resourceType v1alpha1.PipelineResourceType) *v1alpha1.PipelineResource {\n\tpipelineResource := v1alpha1.PipelineResource{\n\t\tObjectMeta: metav1.ObjectMeta{Name: name, Namespace: namespace},\n\t\tSpec: v1alpha1.PipelineResourceSpec{\n\t\t\tType: resourceType,\n\t\t\tParams: params,\n\t\t},\n\t}\n\tresourcePointer := &pipelineResource\n\treturn resourcePointer\n}", "title": "" }, { "docid": "2c57853eb4469df73b2cd8a93c499a1a", "score": "0.5838183", "text": "func (c APIClient) CreatePipeline(\n\tname string,\n\timage string,\n\tcmd []string,\n\tstdin []string,\n\tparallelismSpec *pps.ParallelismSpec,\n\tinputs []*pps.PipelineInput,\n\tupdate bool,\n) error {\n\t_, err := c.PpsAPIClient.CreatePipeline(\n\t\tc.ctx(),\n\t\t&pps.CreatePipelineRequest{\n\t\t\tPipeline: NewPipeline(name),\n\t\t\tTransform: &pps.Transform{\n\t\t\t\tImage: image,\n\t\t\t\tCmd: cmd,\n\t\t\t\tStdin: stdin,\n\t\t\t},\n\t\t\tParallelismSpec: parallelismSpec,\n\t\t\tInputs: inputs,\n\t\t\tUpdate: update,\n\t\t},\n\t)\n\treturn sanitizeErr(err)\n}", "title": "" }, { "docid": "3055cc9bc850dbdbff99c525cff31561", "score": "0.5722845", "text": "func NewPipeline(name string, processes []*Process, fns ...PipelineOptionFn) (*Pipeline, error) {\n\tif len(processes) < 2 {\n\t\treturn nil, fmt.Errorf(\"Pipelines require at least 2 processes, got [%d] process(es)\", len(processes))\n\t}\n\tp := &Pipeline{\n\t\tname: name,\n\t\tprocesses: processes,\n\t}\n\tp.exec = newExec(p.startFn, p.stopFn)\n\n\treturn p, nil\n}", "title": "" }, { "docid": "a43ab9c587eacc21f70cd80e4ce2e2a6", "score": "0.56938356", "text": "func newCmdAddResource(fSys filesys.FileSystem) *cobra.Command {\n\tvar o addResourceOptions\n\n\tcmd := &cobra.Command{\n\t\tUse: \"resource\",\n\t\tShort: \"Add the name of a file containing a resource to the kustomization file\",\n\t\tExample: `\n\t\tadd resource {filepath}`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\terr := o.Validate(args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn o.RunAddResource(fSys)\n\t\t},\n\t}\n\treturn cmd\n}", "title": "" }, { "docid": "4b01b543839ab7a9a10800c3d5de6d94", "score": "0.5636031", "text": "func resourceKibanaLogstashPipelineCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {\n\n\tlogstashPipeline, err := createOrUpdateLogstashPipeline(d, meta)\n\tif err != nil {\n\t\treturn diag.FromErr(err)\n\t}\n\n\td.SetId(logstashPipeline.ID)\n\n\tlog.Infof(\"Created logstash pipeline %s successfully\", logstashPipeline.ID)\n\tfmt.Printf(\"[INFO] Created logstash pipeline %s successfully\", logstashPipeline.ID)\n\n\treturn resourceKibanaLogstashPipelineRead(ctx, d, meta)\n}", "title": "" }, { "docid": "0a69944e53a5b424b49e6586bb3aee86", "score": "0.560949", "text": "func CreatePipeline(codecName string, tracks []*webrtc.TrackLocalStaticSample, pipelineSrc string) *Pipeline {\n\tpipelineStr := \"appsink name=appsink\"\n\tvar clockRate float32\n\n\tswitch codecName {\n\tcase \"vp8\":\n\t\tpipelineStr = pipelineSrc + \" ! vp8enc error-resilient=partitions keyframe-max-dist=10 auto-alt-ref=true cpu-used=5 deadline=1 ! \" + pipelineStr\n\t\tclockRate = videoClockRate\n\n\tcase \"vp9\":\n\t\tpipelineStr = pipelineSrc + \" ! vp9enc ! \" + pipelineStr\n\t\tclockRate = videoClockRate\n\n\tcase \"h264\":\n\t\tpipelineStr = pipelineSrc + \" ! video/x-raw,format=I420 ! x264enc speed-preset=ultrafast tune=zerolatency key-int-max=20 ! video/x-h264,stream-format=byte-stream ! \" + pipelineStr\n\t\tclockRate = videoClockRate\n\n\tcase \"opus\":\n\t\tpipelineStr = pipelineSrc + \" ! opusenc ! \" + pipelineStr\n\t\tclockRate = audioClockRate\n\n\tcase \"g722\":\n\t\tpipelineStr = pipelineSrc + \" ! avenc_g722 ! \" + pipelineStr\n\t\tclockRate = audioClockRate\n\n\tcase \"pcmu\":\n\t\tpipelineStr = pipelineSrc + \" ! audio/x-raw, rate=8000 ! mulawenc ! \" + pipelineStr\n\t\tclockRate = pcmClockRate\n\n\tcase \"pcma\":\n\t\tpipelineStr = pipelineSrc + \" ! audio/x-raw, rate=8000 ! alawenc ! \" + pipelineStr\n\t\tclockRate = pcmClockRate\n\n\tdefault:\n\t\tpanic(\"Unhandled codec \" + codecName)\n\t}\n\n\tpipelineStrUnsafe := C.CString(pipelineStr)\n\tdefer C.free(unsafe.Pointer(pipelineStrUnsafe))\n\n\tpipelinesLock.Lock()\n\tdefer pipelinesLock.Unlock()\n\n\tpipeline := &Pipeline{\n\t\tPipeline: C.gstreamer_send_create_pipeline(pipelineStrUnsafe),\n\t\ttracks: tracks,\n\t\tid: len(pipelines),\n\t\tcodecName: codecName,\n\t\tclockRate: clockRate,\n\t}\n\n\tpipelines[pipeline.id] = pipeline\n\treturn pipeline\n}", "title": "" }, { "docid": "2beb6d3291695a5b117a7c02ea879b4b", "score": "0.556812", "text": "func (kd *kubeDriver) CreatePipelineResources(ctx context.Context, pi *pps.PipelineInfo) error {\n\tlog.Info(ctx, \"creating resources for pipeline\")\n\tkd.limiter.Acquire()\n\tdefer kd.limiter.Release()\n\tif err := kd.createWorkerSvcAndRc(ctx, pi); err != nil {\n\t\tif errors.As(err, &noValidOptionsErr{}) {\n\t\t\t// these errors indicate invalid pipelineInfo, don't retry\n\t\t\treturn stepError{\n\t\t\t\terror: errors.Wrap(err, \"could not generate RC options\"),\n\t\t\t\tfailPipeline: true,\n\t\t\t}\n\t\t}\n\t\treturn newRetriableError(err, \"error creating resources\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7ac562291bece8f4794bfdfade7dc5be", "score": "0.55522263", "text": "func NewResource(name, prImage string, r *resourcev1alpha1.PipelineResource) (*Resource, error) {\n\tif r.Spec.Type != resourcev1alpha1.PipelineResourceTypePullRequest {\n\t\treturn nil, fmt.Errorf(\"cannot create a PR resource from a %s Pipeline Resource\", r.Spec.Type)\n\t}\n\tprResource := Resource{\n\t\tName: name,\n\t\tType: r.Spec.Type,\n\t\tSecrets: r.Spec.SecretParams,\n\t\tPRImage: prImage,\n\t\tInsecureSkipTLSVerify: false,\n\t\tDisableStrictJSONComments: false,\n\t}\n\tfor _, param := range r.Spec.Params {\n\t\tswitch {\n\t\tcase strings.EqualFold(param.Name, \"URL\"):\n\t\t\tprResource.URL = param.Value\n\t\tcase strings.EqualFold(param.Name, \"Provider\"):\n\t\t\tprResource.Provider = param.Value\n\t\tcase strings.EqualFold(param.Name, \"insecure-skip-tls-verify\"):\n\t\t\tverify, err := strconv.ParseBool(param.Value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error occurred converting %q to boolean in Pipeline Resource %s\", param.Value, r.Name)\n\t\t\t}\n\t\t\tprResource.InsecureSkipTLSVerify = verify\n\t\tcase strings.EqualFold(param.Name, \"disable-strict-json-comments\"):\n\t\t\tstrict, err := strconv.ParseBool(param.Value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error occurred converting %q to boolean in Pipeline Resource %s\", param.Value, r.Name)\n\t\t\t}\n\t\t\tprResource.DisableStrictJSONComments = strict\n\t\t}\n\t}\n\n\treturn &prResource, nil\n}", "title": "" }, { "docid": "7eb324a53e611e7d891d24e68888ab06", "score": "0.5532331", "text": "func CreatePipeline(c echo.Context) error {\n\tstoreService, _ := services.StorageService()\n\tp := &gaia.CreatePipeline{}\n\tif err := c.Bind(p); err != nil {\n\t\treturn c.String(http.StatusBadRequest, err.Error())\n\t}\n\n\t// Validate pipeline name\n\tif err := pipeline.ValidatePipelineName(p.Pipeline.Name); err != nil {\n\t\treturn c.String(http.StatusBadRequest, err.Error())\n\t}\n\n\t// Set initial value\n\tp.Created = time.Now()\n\tp.StatusType = gaia.CreatePipelineRunning\n\tp.ID = uuid.Must(uuid.NewV4(), nil).String()\n\n\t// Add pipeline type tag if not already existent\n\tif !stringhelper.IsContainedInSlice(p.Pipeline.Tags, p.Pipeline.Type.String(), true) {\n\t\tp.Pipeline.Tags = append(p.Pipeline.Tags, p.Pipeline.Type.String())\n\t}\n\n\t// Save this pipeline to our store\n\terr := storeService.CreatePipelinePut(p)\n\tif err != nil {\n\t\tgaia.Cfg.Logger.Debug(\"cannot put pipeline into store\", \"error\", err.Error())\n\t\treturn c.String(http.StatusInternalServerError, err.Error())\n\t}\n\n\t// Cloning the repo and compiling the pipeline will be done async\n\tgo pipeline.CreatePipeline(p)\n\n\treturn c.JSON(http.StatusOK, nil)\n}", "title": "" }, { "docid": "3d4525faa0f499494fecc7059dbe748e", "score": "0.55266076", "text": "func NewRegistry(ctx *pulumi.Context,\n\tname string, args *RegistryArgs, opts ...pulumi.ResourceOption) (*Registry, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.ResourceGroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ResourceGroupName'\")\n\t}\n\tif args.Sku == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Sku'\")\n\t}\n\tif args.AdminUserEnabled == nil {\n\t\targs.AdminUserEnabled = pulumi.BoolPtr(false)\n\t}\n\taliases := pulumi.Aliases([]pulumi.Alias{\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:containerregistry/v20190501:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:containerregistry:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:containerregistry:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:containerregistry/v20160627preview:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:containerregistry/v20160627preview:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:containerregistry/v20170301:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:containerregistry/v20170301:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:containerregistry/v20170601preview:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:containerregistry/v20170601preview:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:containerregistry/v20171001:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:containerregistry/v20171001:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:containerregistry/v20191201preview:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:containerregistry/v20191201preview:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:containerregistry/v20201101preview:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:containerregistry/v20201101preview:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:containerregistry/v20210601preview:Registry\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:containerregistry/v20210601preview:Registry\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource Registry\n\terr := ctx.RegisterResource(\"azure-native:containerregistry/v20190501:Registry\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "5e813cefcc672b007185607a369df256", "score": "0.54722154", "text": "func (exec *mrExecutor) PipelineAdd(name, uri string) error {\n\t// fetch the configuration from the storage service\n\trd, err := newFileReader(uri)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer rd.Close()\n\n\t// parse the configuration file\n\tconf, err := parsePipelineConfig(rd, exec.dataDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tp := &Pipeline{\n\t\tName: name,\n\t\tURI: uri,\n\t\tState: StateStopped,\n\t\tConfig: conf,\n\t}\n\texec.Lock()\n\tdefer exec.Unlock()\n\n\texec.pipelines[name] = p\n\tif p.Config.Spec.Schedule != nil {\n\t\tt := &pipelineTrigger{exec, p}\n\t\texec.cron.Add(p.Name, p.Config.Spec.Schedule, t.trigger)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fd14c2a205ff0ccd540e922b8bb687c0", "score": "0.54593635", "text": "func NewPipeline(steps ...NamedStep) *Pipeline {\n\tp := &Pipeline{NamedSteps: steps}\n\treturn p\n}", "title": "" }, { "docid": "69af66a6dfa45e392d4166976b5f3582", "score": "0.5453271", "text": "func CreateOrUpdatePipeline(tektonClient tektonclient.Interface, ns string, created *v1alpha1.Pipeline) (*v1alpha1.Pipeline, error) {\n\tresourceName := created.Name\n\tresourceInterface := tektonClient.TektonV1alpha1().Pipelines(ns)\n\n\tanswer, err := resourceInterface.Create(created)\n\tif err == nil {\n\t\treturn answer, nil\n\t}\n\n\tanswer, err = resourceInterface.Get(resourceName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn answer, errors.Wrapf(err, \"failed to get Pipeline %s after failing to create a new one\", resourceName)\n\t}\n\n\tif !reflect.DeepEqual(&created.Spec, &answer.Spec) || !reflect.DeepEqual(created.Labels, answer.Labels) {\n\t\tanswer.Annotations = util.MergeMaps(answer.Annotations, created.Annotations)\n\t\tanswer.Spec = created.Spec\n\t\tanswer, err = resourceInterface.Update(answer)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"failed to update Pipeline %s\", resourceName)\n\t\t}\n\t}\n\treturn answer, nil\n}", "title": "" }, { "docid": "6be483903ee1ff94860ce0787e7d89d5", "score": "0.5447576", "text": "func NewPipeline(kind state.Kind) (state.Pipeline, error) {\n\tif kind.String() == globals.NaplesPipelineIris {\n\t\tret, _ := iris.NewPipeline()\n\t\treturn ret, nil\n\t} else if kind.String() == globals.NaplesPipelineApollo {\n\t\tret, _ := apollo.NewPipeline()\n\t\treturn ret, nil\n\t}\n\treturn nil, errors.New(\"Unknown pipeline \" + kind.String())\n\n}", "title": "" }, { "docid": "cd354b2cc39fa5b8076d941da7bbcd25", "score": "0.5424124", "text": "func CreatePipelineRun(resources []*pipelineapi.PipelineResource,\n\tname string,\n\tapiVersion string,\n\tlabels map[string]string,\n\tserviceAccount string,\n\tpipelineParams []pipelineapi.Param,\n\ttimeout *metav1.Duration,\n\taffinity *corev1.Affinity,\n\ttolerations []corev1.Toleration) *pipelineapi.PipelineRun {\n\tvar resourceBindings []pipelineapi.PipelineResourceBinding\n\tfor _, resource := range resources {\n\t\tresourceBindings = append(resourceBindings, pipelineapi.PipelineResourceBinding{\n\t\t\tName: resource.Name,\n\t\t\tResourceRef: &pipelineapi.PipelineResourceRef{\n\t\t\t\tName: resource.Name,\n\t\t\t\tAPIVersion: resource.APIVersion,\n\t\t\t},\n\t\t})\n\t}\n\n\tif serviceAccount == \"\" {\n\t\tserviceAccount = DefaultPipelineSA\n\t}\n\tif timeout == nil {\n\t\ttimeout = &metav1.Duration{Duration: 240 * time.Hour}\n\t}\n\n\tpipelineRun := &pipelineapi.PipelineRun{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: syntax.TektonAPIVersion,\n\t\t\tKind: \"PipelineRun\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tLabels: util.MergeMaps(labels),\n\t\t},\n\t\tSpec: pipelineapi.PipelineRunSpec{\n\t\t\tServiceAccountName: serviceAccount,\n\t\t\tPipelineRef: &pipelineapi.PipelineRef{\n\t\t\t\tName: name,\n\t\t\t\tAPIVersion: apiVersion,\n\t\t\t},\n\t\t\tResources: resourceBindings,\n\t\t\tParams: pipelineParams,\n\t\t\t// TODO: We shouldn't have to set a default timeout in the first place. See https://github.com/tektoncd/pipeline/issues/978\n\t\t\tTimeout: timeout,\n\t\t\tPodTemplate: &pipelineapi.PodTemplate{\n\t\t\t\tAffinity: affinity,\n\t\t\t\tTolerations: tolerations,\n\t\t\t},\n\t\t},\n\t}\n\n\treturn pipelineRun\n}", "title": "" }, { "docid": "10e7a1b9ee44c879e88d9620248185f8", "score": "0.5335859", "text": "func (c *Client) NewPipeline(pipelineName string) *Pipeline {\n\tpipe := &Pipeline{\n\t\tc.Client.Pipeline(),\n\t\tc.cluster,\n\t\tc.psm,\n\t\tc.metricsServiceName,\n\t\tpipelineName,\n\t}\n\treturn pipe\n}", "title": "" }, { "docid": "de9c7cbd498ee1da7708b306f2ff25a6", "score": "0.5330611", "text": "func NewResource(name string, images pipeline.Images, r *resource.PipelineResource) (PipelineStorageResourceInterface, error) {\n\tif r.Spec.Type != v1beta1.PipelineResourceTypeStorage {\n\t\treturn nil, fmt.Errorf(\"StoreResource: Cannot create a storage resource from a %s Pipeline Resource\", r.Spec.Type)\n\t}\n\n\tfor _, param := range r.Spec.Params {\n\t\tif strings.EqualFold(param.Name, \"type\") {\n\t\t\tif strings.EqualFold(param.Value, resource.PipelineResourceTypeGCS) {\n\t\t\t\treturn NewGCSResource(name, images, r)\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"%s is an invalid or unimplemented PipelineStorageResource\", param.Value)\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"StoreResource: Cannot create a storage resource without type %s in spec\", r.Name)\n}", "title": "" }, { "docid": "2ad7a7ff66748eecdd54ac6a7ad294c2", "score": "0.5296287", "text": "func (gp *gpuImpl) NewPipeline(name string) gpu.Pipeline {\n\tpl := &glgpu.Pipeline{}\n\tpl.SetName(name)\n\treturn pl\n}", "title": "" }, { "docid": "85b252c963b66bd239a53038e87fbed1", "score": "0.52916515", "text": "func NewLabResource(ctx *pulumi.Context,\n\tname string, args *LabResourceArgs, opts ...pulumi.ResourceOption) (*LabResource, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.ResourceGroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ResourceGroupName'\")\n\t}\n\taliases := pulumi.Aliases([]pulumi.Alias{\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:devtestlab/v20150521preview:LabResource\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:devtestlab:LabResource\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:devtestlab:LabResource\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:devtestlab/v20160515:LabResource\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:devtestlab/v20160515:LabResource\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:devtestlab/v20180915:LabResource\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:devtestlab/v20180915:LabResource\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource LabResource\n\terr := ctx.RegisterResource(\"azure-native:devtestlab/v20150521preview:LabResource\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "d8e9d4afcc0be2a24f4f86a00aea3ca7", "score": "0.52851427", "text": "func CreateOrUpdateSourceResource(tektonClient tektonclient.Interface, ns string, created *v1alpha1.PipelineResource) (*v1alpha1.PipelineResource, error) {\n\tresourceName := created.Name\n\tfactory := jxfactory.NewFactory()\n\n\tresourceClient, _, err := factory.CreateTektonPipelineResourceClient()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to create Tekton PipelineResource client\")\n\t}\n\tresourceInterface := resourceClient.TektonV1alpha1().PipelineResources(ns)\n\n\t_, err = resourceInterface.Create(created)\n\tif err == nil {\n\t\treturn created, nil\n\t}\n\n\tanswer, err2 := resourceInterface.Get(resourceName, metav1.GetOptions{})\n\tif err2 != nil {\n\t\treturn answer, errors.Wrapf(err, \"failed to get PipelineResource %s with %v after failing to create a new one\", resourceName, err2)\n\t}\n\tif !reflect.DeepEqual(&created.Spec, &answer.Spec) {\n\t\tanswer.Spec = created.Spec\n\t\tanswer, err = resourceInterface.Update(answer)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"failed to update PipelineResource %s\", resourceName)\n\t\t}\n\t}\n\treturn answer, nil\n}", "title": "" }, { "docid": "9be147f0f6d99749a0f89240f35786d9", "score": "0.5266697", "text": "func NewPipeline(e Element) *Pipeline {\n\tp := &Pipeline{\n\t\telement: e,\n\t\tbuilders: make(map[string]*samples.Builder),\n\t}\n\n\treturn p\n}", "title": "" }, { "docid": "f8291e10e113da59c3c3b4c607381d9a", "score": "0.525518", "text": "func CreateClientPipeline(audioTrack *webrtc.TrackRemote, videoTrack *webrtc.TrackRemote) *Pipeline {\n\tpipelineStr := \"\"\n\tif audioTrack != nil {\n\t\taudioPipe := fmt.Sprintf(\"appsrc format=time is-live=true do-timestamp=true name=%s ! application/x-rtp\", audioTrack.ID())\n\t\tswitch strings.ToLower(audioTrack.Codec().MimeType) {\n\t\tcase \"audio/opus\":\n\t\t\taudioPipe += \", encoding-name=OPUS, payload=96 ! rtpopusdepay ! decodebin ! autoaudiosink\"\n\t\tcase \"audio/g722\":\n\t\t\taudioPipe += \" clock-rate=8000 ! rtpg722depay ! decodebin ! autoaudiosink\"\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"couldn't build gst pipeline for codec: %s \", audioTrack.Codec().MimeType))\n\t\t}\n\t\tpipelineStr += audioPipe + \"\\n\"\n\t}\n\n\tif videoTrack != nil {\n\t\tvideoPipe := fmt.Sprintf(\"appsrc format=time is-live=true name=%s ! application/x-rtp, payload=%d\", videoTrack.ID(), videoTrack.Codec().PayloadType)\n\t\tswitch strings.ToLower(videoTrack.Codec().MimeType) {\n\t\tcase \"video/vp8\":\n\t\t\tvideoPipe += \", encoding-name=VP8-DRAFT-IETF-01 ! rtpvp8depay ! decodebin ! autovideosink\"\n\t\tcase \"viode/vp9\":\n\t\t\tvideoPipe += \" ! rtpvp9depay ! decodebin ! autovideosink\"\n\t\tcase \"video/h264\":\n\t\t\tvideoPipe += fmt.Sprintf(\" ! rtph264depay ! h264parse config-interval=-1 ! %s ! glimagesink sync=false\", getDecoderString())\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"couldn't build gst pipeline for codec: %s \", videoTrack.Codec().MimeType))\n\t\t}\n\t\tpipelineStr += videoPipe + \"\\n\"\n\t}\n\n\tpipelineStrUnsafe := C.CString(pipelineStr)\n\tdefer C.free(unsafe.Pointer(pipelineStrUnsafe))\n\n\tpipelinesLock.Lock()\n\tdefer pipelinesLock.Unlock()\n\tpipeline := &Pipeline{\n\t\tPipeline: C.gstreamer_create_pipeline(pipelineStrUnsafe),\n\t\tinAudioTrack: audioTrack,\n\t\tinVideoTrack: videoTrack,\n\t}\n\treturn pipeline\n}", "title": "" }, { "docid": "c4376f914f6d49bf9457a923a6f363fc", "score": "0.525077", "text": "func (k *Visor) CreateResource(ctx context.Context, t ResourceType, v ManagedNames, name string) (err error) {\n\tvv, ok := v.(runtime.Object)\n\tif !ok {\n\t\treturn errors.Errorf(\"provided value was not castable to runtime.Object\")\n\t}\n\n\tgenfix := \"x-\"\n\tvar c rest.Interface\n\tswitch t {\n\tcase ResourceTypeJobs:\n\t\tc = k.api.BatchV1().RESTClient()\n\t\tgenfix = \"j-\"\n\tcase ResourceTypePods:\n\t\tc = k.api.CoreV1().RESTClient()\n\t\tgenfix = \"p-\"\n\tcase ResourceTypeDeployments, ResourceTypeDaemonsets:\n\t\tc = k.api.AppsV1().RESTClient()\n\t\tgenfix = \"d-\"\n\tcase ResourceTypeSecrets:\n\t\tc = k.api.CoreV1().RESTClient()\n\t\tgenfix = \"s-\"\n\tcase ResourceTypeDatasets:\n\t\tc = k.crd.NerdalizeV1().RESTClient()\n\t\tgenfix = \"d-\"\n\tdefault:\n\t\treturn errors.Errorf(\"unknown Kubernetes resource type provided for creation: '%s'\", t)\n\t}\n\n\tif name != \"\" && genfix != \"\" {\n\t\tv.SetName(k.applyPrefix(name))\n\t} else {\n\t\tv.SetGenerateName(k.prefix + genfix)\n\t}\n\n\tlabels := v.GetLabels()\n\tif labels == nil {\n\t\tlabels = map[string]string{}\n\t}\n\n\tlabels[\"nerd-app\"] = \"cli\"\n\tv.SetLabels(labels)\n\n\tk.logs.Debugf(\"creating %s '%s' in namespace '%s' and labels '%v': %s\", t, v.GetName(), k.ns, labels, ctx)\n\terr = c.Post().\n\t\tNamespace(k.ns).\n\t\tResource(string(t)).\n\t\tBody(vv).\n\t\tContext(ctx).\n\t\tDo().\n\t\tInto(vv)\n\n\tif err != nil {\n\t\treturn k.tagError(err)\n\t}\n\n\tv.SetName(k.removePrefix(v.GetName())) //normalize back to unprefixed resource name\n\treturn nil\n}", "title": "" }, { "docid": "cee5a9b6cd187364292c99d23f4e37f8", "score": "0.5247273", "text": "func NewPipeline(cfg PipeConfig) *RqPipeline {\n\tpool := RqPool{\n\t\tnDownload: cfg.Download,\n\t\tnSummarize: cfg.Summarize,\n\t\tnCleanup: cfg.Cleanup,\n\t\twg: sync.WaitGroup{},\n\t\tdownloadChn: make(chan RqJob),\n\t\tsummarizeChn: make(chan RqJob),\n\t\tcleanupChn: make(chan RqJob),\n\t\tsaveChn: make(chan RqJob),\n\t\terrorChn: make(chan RqError, 1000),\n\t\tdoneChn: make(chan int),\n\t\tclient: newClient(defaultTimeout),\n\t\tstopOnce: sync.Once{},\n\t}\n\n\treturn &RqPipeline{\n\t\tpool: &pool,\n\t\tsourceURLs: nil,\n\t\toutFile: nil,\n\t\timageCount: 0,\n\t}\n}", "title": "" }, { "docid": "13e2b3d9f41a6b5d110562cd5b833827", "score": "0.52258927", "text": "func (api PipelineAPI) Register(container *restful.Container) {\n\tws := new(restful.WebService)\n\n\tws.Path(\"/pipelines\").\n\t\tConsumes(restful.MIME_JSON).\n\t\tProduces(restful.MIME_JSON)\n\n\tws.Route(ws.GET(\"/{id}\").To(api.findPipeline).\n\t\tOperation(\"findPipeline\").\n\t\tParam(ws.PathParameter(\"id\", \"id of pipeline\").DataType(\"int\")).\n\t\tWrites(Pipeline{}))\n\n\tws.Route(ws.POST(\"\").To(api.createPipeline).\n\t\tOperation(\"createPipeline\").\n\t\tReads(Pipeline{}))\n\n\tcontainer.Add(ws)\n}", "title": "" }, { "docid": "7cee53e9e430b302b4ac2b65680dd4fc", "score": "0.5224852", "text": "func CreatePipeline(payloadType webrtc.PayloadType, codecName string) *Pipeline {\n\tpipelineStr := \"appsrc format=time is-live=true do-timestamp=true name=src ! application/x-rtp\"\n\tswitch strings.ToLower(codecName) {\n\tcase \"vp8\":\n\t\tpipelineStr += fmt.Sprintf(\", payload=%d, encoding-name=VP8-DRAFT-IETF-01 ! rtpvp8depay ! decodebin ! autovideosink\", payloadType)\n\tcase \"opus\":\n\t\tpipelineStr += fmt.Sprintf(\", payload=%d, encoding-name=OPUS ! rtpopusdepay ! decodebin ! autoaudiosink\", payloadType)\n\tcase \"vp9\":\n\t\tpipelineStr += \" ! rtpvp9depay ! decodebin ! autovideosink\"\n\tcase \"h264\":\n\t\tpipelineStr += \" ! rtph264depay ! decodebin ! autovideosink\"\n\tcase \"g722\":\n\t\tpipelineStr += \" clock-rate=8000 ! rtpg722depay ! decodebin ! autoaudiosink\"\n\tdefault:\n\t\tpanic(\"Unhandled codec \" + codecName)\n\t}\n\n\tpipelineStrUnsafe := C.CString(pipelineStr)\n\tdefer C.free(unsafe.Pointer(pipelineStrUnsafe))\n\treturn &Pipeline{Pipeline: C.gstreamer_receive_create_pipeline(pipelineStrUnsafe)}\n}", "title": "" }, { "docid": "d485e4e8cef65a2b6fda29b0c7f5692d", "score": "0.5153076", "text": "func CreatePlayerPipeline(containerPath string, audioTrack, videoTrack *webrtc.TrackLocalStaticSample) *Pipeline {\n\tpipelineStr := fmt.Sprintf(`\n\t\tfilesrc location=\"%s\" !\n\t\tdecodebin name=demux !\n\t\t\tqueue !\n\t\t\t%s ! \n\t\t\tvideo/x-h264,stream-format=byte-stream,profile=baseline !\n\t\t\tappsink name=%s\n\t\tdemux. ! \n\t\t\tqueue ! \n\t\t\taudioconvert ! \n\t\t\taudioresample ! \n\t\t\taudio/x-raw,rate=48000,channels=2 !\n\t\t\topusenc ! appsink name=%s\n\t`, containerPath, getEncoderString(), videoTrack.ID(), audioTrack.ID())\n\n\tpipelineStrUnsafe := C.CString(pipelineStr)\n\tdefer C.free(unsafe.Pointer(pipelineStrUnsafe))\n\n\tpipelinesLock.Lock()\n\tdefer pipelinesLock.Unlock()\n\tpipeline := &Pipeline{\n\t\tPipeline: C.gstreamer_create_pipeline(pipelineStrUnsafe),\n\t}\n\treturn pipeline\n}", "title": "" }, { "docid": "9e3503ddf27cb6c23a14da7f346f5ec6", "score": "0.5152696", "text": "func CreatePipeline(codecName string, tracks []*webrtc.TrackLocalStaticSample) *Pipeline {\n\tpipelineStr := \"appsrc format=time is-live=true do-timestamp=true name=src ! application/x-rtp\"\n\t// suffixPipelineStr := \"autoaudiosink\"\n\tsuffixPipelineStr := \"appsink name=appsink\"\n\taudioPipelineStr := \"decodebin ! audioconvert ! audiochebband mode=band-pass lower-frequency=1000 upper-frequency=3000 poles=4 ! freeverb ! audioconvert\"\n\t// videoPipelineStr := \"decodebin ! videoconvert ! warptv ! videoconvert\"\n\tvideoPipelineStr := \"decodebin ! videoconvert\"\n\tvar clockRate float32\n\n\tswitch codecName {\n\tcase \"vp8\":\n\t\t// pipelineStr += \", media=video, clock-rate=90000, encoding-name=VP8-DRAFT-IETF-01, payload=100 ! rtpvp8depay ! vp8dec ! vp8enc error-resilient=partitions keyframe-max-dist=10 auto-alt-ref=true cpu-used=5 deadline=1 ! \" + suffixPipelineStr\n\t\tpipelineStr += \", encoding-name=VP8-DRAFT-IETF-01 ! rtpvp8depay ! vp8dec ! vp8enc error-resilient=partitions keyframe-max-dist=10 auto-alt-ref=true cpu-used=5 deadline=1 ! \" + suffixPipelineStr\n\t\tclockRate = videoClockRate\n\tcase \"vp9\":\n\t\tpipelineStr += \" ! rtpvp9depay ! \" + videoPipelineStr + \" ! vp9enc ! \" + suffixPipelineStr\n\t\tclockRate = videoClockRate\n\tcase \"h264\":\n\t\tpipelineStr += \" ! rtph264depay ! \" + videoPipelineStr + \" ! video/x-raw,format=I420 ! x264enc speed-preset=ultrafast tune=zerolatency key-int-max=20 ! video/x-h264,stream-format=byte-stream ! \" + suffixPipelineStr\n\t\tclockRate = videoClockRate\n\tcase \"g722\":\n\t\tpipelineStr += \" clock-rate=8000 ! rtpg722depay ! \" + videoPipelineStr + \" ! avenc_g722 ! \" + suffixPipelineStr\n\t\tclockRate = audioClockRate\n\tcase \"opus\":\n\t\tpipelineStr += \", payload=96, encoding-name=OPUS ! rtpopusdepay ! \" + audioPipelineStr + \" ! opusenc ! \" + suffixPipelineStr\n\t\tclockRate = audioClockRate\n\n\tdefault:\n\t\tpanic(\"Unhandled codec \" + codecName)\n\t}\n\n\tpipelineStrUnsafe := C.CString(pipelineStr)\n\tdefer C.free(unsafe.Pointer(pipelineStrUnsafe))\n\n\tpipelinesLock.Lock()\n\tdefer pipelinesLock.Unlock()\n\n\tpipeline := &Pipeline{\n\t\tPipeline: C.gstreamer_send_create_pipeline(pipelineStrUnsafe),\n\t\ttracks: tracks,\n\t\tid: len(pipelines),\n\t\tcodecName: codecName,\n\t\tclockRate: clockRate,\n\t}\n\n\tpipelines[pipeline.id] = pipeline\n\treturn pipeline\n}", "title": "" }, { "docid": "4862cd6b64dd33a336ed5f0a616a24d8", "score": "0.51465386", "text": "func (s *PipelineStore) CreatePipeline(p *model.Pipeline) (*model.Pipeline, error) {\n\tnewPipeline := *p\n\n\t// Set pipeline creation time\n\tnewPipeline.CreatedAtInSec = s.time.Now().Unix()\n\n\t// Set pipeline id\n\tid, err := s.uuid.NewRandom()\n\tif err != nil {\n\t\treturn nil, util.NewInternalServerError(err, \"Failed to create a pipeline UUID\")\n\t}\n\tnewPipeline.UUID = id.String()\n\n\t// Create a query for the KFP DB\n\tsql, args, err := sq.\n\t\tInsert(\"pipelines\").\n\t\tSetMap(\n\t\t\tsq.Eq{\n\t\t\t\t\"UUID\": newPipeline.UUID,\n\t\t\t\t\"CreatedAtInSec\": newPipeline.CreatedAtInSec,\n\t\t\t\t\"Name\": newPipeline.Name,\n\t\t\t\t\"Description\": newPipeline.Description,\n\t\t\t\t\"Status\": string(newPipeline.Status),\n\t\t\t\t\"Namespace\": newPipeline.Namespace,\n\t\t\t\t// Parameters and DefaultVersionId are deprecated and set to empty string\n\t\t\t\t\"DefaultVersionId\": \"\",\n\t\t\t\t\"Parameters\": \"\",\n\t\t\t},\n\t\t).\n\t\tToSql()\n\tif err != nil {\n\t\treturn nil, util.NewInternalServerError(err, \"Failed to create query to insert pipeline to pipeline table\")\n\t}\n\n\t// Insert into pipelines table\n\ttx, err := s.db.Begin()\n\tif err != nil {\n\t\treturn nil, util.NewInternalServerError(err, \"Failed to start a transaction to create a new pipeline\")\n\t}\n\t_, err = tx.Exec(sql, args...)\n\tif err != nil {\n\t\tif s.db.IsDuplicateError(err) {\n\t\t\ttx.Rollback()\n\t\t\treturn nil, util.NewAlreadyExistError(\n\t\t\t\t\"Failed to create a new pipeline. The name %v already exist. Please specify a new name\", p.Name)\n\t\t}\n\t\ttx.Rollback()\n\t\treturn nil, util.NewInternalServerError(err, \"Failed to add pipeline to pipeline table\")\n\t}\n\tif err := tx.Commit(); err != nil {\n\t\ttx.Rollback()\n\t\treturn nil, util.NewInternalServerError(err, \"Failed to commit pipeline creation in a SQL transaction\")\n\t}\n\treturn &newPipeline, nil\n}", "title": "" }, { "docid": "865bfd20ee2d0111820ddedef0de494e", "score": "0.5129852", "text": "func NewCmdCreateMetaPipeline(commonOpts *opts.CommonOptions) *cobra.Command {\n\toptions := &StepCreatePipelineOptions{\n\t\tCommonOptions: commonOpts,\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"pipeline\",\n\t\tShort: \"Creates the Tekton meta pipeline for a given build pipeline.\",\n\t\tLong: createPipelineLong,\n\t\tExample: createPipelineExample,\n\t\tAliases: []string{\"bt\"},\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\toptions.Cmd = cmd\n\t\t\toptions.Args = args\n\t\t\terr := options.Run()\n\t\t\thelper.CheckErr(err)\n\t\t},\n\t\tHidden: true,\n\t}\n\n\tcmd.Flags().StringVar(&options.SourceURL, sourceURLOptionName, \"\", \"Specify the git URL for the source (required)\")\n\tcmd.Flags().StringVar(&options.Branch, branchOptionName, \"\", \"The git branch to trigger the build in. Defaults to the current local branch name (required)\")\n\tcmd.Flags().StringVarP(&options.PipelineKind, pipelineKindOptionName, \"k\", \"\", \"The kind of pipeline to create such as: \"+strings.Join(jenkinsfile.PipelineKinds, \", \"))\n\tcmd.Flags().StringVar(&options.Job, jobOptionName, \"\", \"The Prow job name in order to identify all pipelines belonging to a single trigger event (required)\")\n\n\tcmd.Flags().StringVar(&options.PullRefs, pullRefOptionName, \"\", \"The Prow pull ref specifying the references to merge into the source\")\n\tcmd.Flags().StringVarP(&options.Context, contextOptionName, \"c\", \"\", \"The pipeline context if there are multiple separate pipelines for a given branch\")\n\n\tcmd.Flags().StringVar(&options.DefaultImage, defaultImageOptionName, syntax.DefaultContainerImage, \"Specify the docker image to use if there is no image specified for a step. Default \"+syntax.DefaultContainerImage)\n\tcmd.Flags().StringArrayVarP(&options.CustomLabels, labelOptionName, \"l\", nil, \"List of custom labels to be applied to the generated PipelineRun (can be use multiple times)\")\n\tcmd.Flags().StringArrayVarP(&options.CustomEnvs, envOptionName, \"e\", nil, \"List of custom environment variables to be applied to resources that are created (can be use multiple times)\")\n\n\tcmd.Flags().StringVar(&options.PullRequestNumber, pullRequestOptionName, \"\", \"If a pull request this is it's number\")\n\tcmd.Flags().StringVar(&options.ServiceAccount, serviceAccountOptionName, \"tekton-bot\", \"The Kubernetes ServiceAccount to use to run the pipeline\")\n\n\t// options to control the output, mainly for development\n\tcmd.Flags().BoolVar(&options.NoApply, noApplyOptionName, false, \"Disables creating the pipeline resources in the cluster and just outputs the generated resources to file\")\n\tcmd.Flags().StringVarP(&options.OutDir, outputOptionName, \"o\", \"out\", \"Used in conjunction with --no-apply to determine the directory into which to write the output\")\n\n\toptions.AddCommonFlags(cmd)\n\treturn cmd\n}", "title": "" }, { "docid": "152c5ebf2702fb804676a7625d0b5b12", "score": "0.5129277", "text": "func (s *BoltStore) CreatePipelinePut(p *gaia.CreatePipeline) error {\n\treturn s.db.Update(func(tx *bolt.Tx) error {\n\t\t// Get bucket\n\t\tb := tx.Bucket(createPipelineBucket)\n\n\t\t// Marshal pipeline object\n\t\tm, err := json.Marshal(p)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Put pipeline\n\t\treturn b.Put([]byte(p.ID), m)\n\t})\n}", "title": "" }, { "docid": "92e89f14c0d4f1f98d69f148fdf967d5", "score": "0.5129052", "text": "func (r *resourceSet) newResource(name string, resource gfn.Resource) *gfnt.Value {\n\tmaybeSetNameTag(name, resource)\n\tr.template.Resources[name] = resource\n\treturn gfnt.MakeRef(name)\n}", "title": "" }, { "docid": "323c177d5b3c45a89ebd75c6709e5cb1", "score": "0.5121622", "text": "func NewPipeline() Pipeline {\n\treturn &pipeline{handlers: nil}\n}", "title": "" }, { "docid": "7695722d994e878de5140bc62893e3d9", "score": "0.509601", "text": "func (s *NewStepDetails) AddToPipeline(projectConfig *config.ProjectConfig) error {\n\tpipelines := projectConfig.GetOrCreatePipelineConfig()\n\tpipeline, err := pipelines.Pipelines.GetPipeline(s.Pipeline, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlifecycle, err := pipeline.GetLifecycle(s.Lifecycle, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn lifecycle.CreateStep(s.Mode, &s.Step)\n}", "title": "" }, { "docid": "bd0420359630c0626e3d052cd8b17c3f", "score": "0.50943065", "text": "func (s *PipelineServer) createPipeline(ctx context.Context, pipeline *model.Pipeline) (*model.Pipeline, error) {\n\tpipeline.Namespace = s.resourceManager.ReplaceNamespace(pipeline.Namespace)\n\t// Check authorization\n\tresourceAttributes := &authorizationv1.ResourceAttributes{\n\t\tNamespace: pipeline.Namespace,\n\t\tName: pipeline.Name,\n\t\tVerb: common.RbacResourceVerbCreate,\n\t}\n\terr := s.canAccessPipeline(ctx, \"\", resourceAttributes)\n\tif err != nil {\n\t\treturn nil, util.Wrapf(err, \"Failed to create a pipeline due to authorization error. Check if you have write permissions to namespace %s\", pipeline.Namespace)\n\t}\n\treturn s.resourceManager.CreatePipeline(pipeline)\n}", "title": "" }, { "docid": "92e783cf8b34d7699b4fbdbc1344078e", "score": "0.50737405", "text": "func NewPipeline(pipelineName string) *pps.Pipeline {\n\treturn &pps.Pipeline{Name: pipelineName}\n}", "title": "" }, { "docid": "570509e4a204528b6908e67b530c8b2c", "score": "0.50457877", "text": "func ScaleResourceArguments(ref corev1.ObjectReference) (gvr *schema.GroupVersionResource, name string, err error) {\n\tgv, err := schema.ParseGroupVersion(ref.APIVersion)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tresource := apis.KindToResource(gv.WithKind(ref.Kind))\n\treturn &resource, ref.Name, nil\n}", "title": "" }, { "docid": "a35f261d698b8a39da7b0be04f1f1157", "score": "0.50424623", "text": "func NameArg(args []string, p cli.Params, file string) (*v1beta1.Pipeline, error) {\n\tpipelineErr := &v1beta1.Pipeline{}\n\tif len(args) == 0 && file == \"\" {\n\t\treturn pipelineErr, errNoPipeline\n\t}\n\n\tif err := validate.NamespaceExists(p); err != nil {\n\t\treturn pipelineErr, err\n\t}\n\n\tc, err := p.Clients()\n\tif err != nil {\n\t\treturn pipelineErr, err\n\t}\n\n\tif file == \"\" {\n\t\tname, ns := args[0], p.Namespace()\n\t\t// get pipeline by pipeline name passed as arg[0] from namespace\n\t\tpipelineNs, err := pipeline.Get(c, name, metav1.GetOptions{}, ns)\n\t\tif err != nil {\n\t\t\treturn pipelineErr, fmt.Errorf(errInvalidPipeline, name, ns)\n\t\t}\n\t\treturn pipelineNs, nil\n\t}\n\n\t// file does not equal \"\" so the pipeline is parsed from local or remote file\n\tpipelineFile, err := parsePipeline(file, p)\n\tif err != nil {\n\t\treturn pipelineErr, err\n\t}\n\n\treturn pipelineFile, nil\n}", "title": "" }, { "docid": "687af1a532b31e8122a7d75c01002cb6", "score": "0.5022602", "text": "func NewResource(name string, kubeconfigWriterImage, shellImage string, r *resource.PipelineResource) (*Resource, error) {\n\tif r.Spec.Type != resource.PipelineResourceTypeCluster {\n\t\treturn nil, fmt.Errorf(\"cluster.Resource: Cannot create a Cluster resource from a %s Pipeline Resource\", r.Spec.Type)\n\t}\n\tclusterResource := Resource{\n\t\tType: r.Spec.Type,\n\t\tKubeconfigWriterImage: kubeconfigWriterImage,\n\t\tShellImage: shellImage,\n\t\tName: name,\n\t}\n\tfor _, param := range r.Spec.Params {\n\t\tswitch {\n\t\tcase strings.EqualFold(param.Name, \"URL\"):\n\t\t\tclusterResource.URL = param.Value\n\t\tcase strings.EqualFold(param.Name, \"Revision\"):\n\t\t\tclusterResource.Revision = param.Value\n\t\tcase strings.EqualFold(param.Name, \"Username\"):\n\t\t\tclusterResource.Username = param.Value\n\t\tcase strings.EqualFold(param.Name, \"Namespace\"):\n\t\t\tclusterResource.Namespace = param.Value\n\t\tcase strings.EqualFold(param.Name, \"Password\"):\n\t\t\tclusterResource.Password = param.Value\n\t\tcase strings.EqualFold(param.Name, \"Token\"):\n\t\t\tclusterResource.Token = param.Value\n\t\tcase strings.EqualFold(param.Name, \"Insecure\"):\n\t\t\tb, _ := strconv.ParseBool(param.Value)\n\t\t\tclusterResource.Insecure = b\n\t\tcase strings.EqualFold(param.Name, \"CAData\"):\n\t\t\tif param.Value != \"\" {\n\t\t\t\tsDec, _ := b64.StdEncoding.DecodeString(param.Value)\n\t\t\t\tclusterResource.CAData = sDec\n\t\t\t}\n\t\tcase strings.EqualFold(param.Name, \"ClientKeyData\"):\n\t\t\tif param.Value != \"\" {\n\t\t\t\tsDec, _ := b64.StdEncoding.DecodeString(param.Value)\n\t\t\t\tclusterResource.ClientKeyData = sDec\n\t\t\t}\n\t\tcase strings.EqualFold(param.Name, \"ClientCertificateData\"):\n\t\t\tif param.Value != \"\" {\n\t\t\t\tsDec, _ := b64.StdEncoding.DecodeString(param.Value)\n\t\t\t\tclusterResource.ClientCertificateData = sDec\n\t\t\t}\n\t\t}\n\t}\n\tclusterResource.Secrets = r.Spec.SecretParams\n\n\tif len(clusterResource.CAData) == 0 {\n\t\tclusterResource.Insecure = true\n\t\tfor _, secret := range clusterResource.Secrets {\n\t\t\tif strings.EqualFold(secret.FieldName, \"CAData\") {\n\t\t\t\tclusterResource.Insecure = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &clusterResource, nil\n}", "title": "" }, { "docid": "89bc704512c432729af109d1531b88c9", "score": "0.5018603", "text": "func NewPipeline(cfg *viper.Viper) (*Pipeline, error) {\n\tmangler, err := ManglerHandlers.Init(cfg, \"mangle\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttransformer, err := TransformerHandlers.Init(cfg, \"transform\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclassifier, err := ClassifierHandlers.Init(cfg, \"classify\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfilterer, err := FiltererHandlers.Init(cfg, \"filter\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstoreHeader, err := StoreHeaderHandlers.Init(cfg, \"storeheader\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tencoder, err := EncoderHandlers.Init(cfg, \"encode\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcompressor, err := CompressorHandlers.Init(cfg, \"compress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstorer, err := StorerHandlers.Init(cfg, \"store\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\taccounter, err := AccounterHandlers.Init(cfg, \"account\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\twriter, err := WriterHandlers.Init(cfg, \"write\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp := &Pipeline{\n\t\tMangler: mangler.(Mangler),\n\t\tTransformer: transformer.(Transformer),\n\t\tClassifier: classifier.(Classifier),\n\t\tFilterer: filterer.(Filterer),\n\t\tStoreHeader: storeHeader.(StoreHeader),\n\t\tEncoder: encoder.(Encoder),\n\t\tCompressor: compressor.(Compressor),\n\t\tStorer: storer.(Storer),\n\t\tAccounter: accounter.(Accounter),\n\t\tWriter: writer.(Writer),\n\t}\n\tstorer.(Storer).SetPipeline(p)\n\n\treturn p, nil\n}", "title": "" }, { "docid": "9f789c3b94ae6300909da7b7a87c322b", "score": "0.5004028", "text": "func createPipeline(\n\tconfig Config, mgr types.Manager, logger log.Modular, stats metrics.Type,\n) (*util.ClosablePool, *util.ClosablePool, chan struct{}, error) {\n\t// Create two pools, this helps manage ordered closure of all pipeline\n\t// components. We have a tiered (t1) and an non-tiered (t2) pool. If the\n\t// tiered pool cannot close within our allotted time period then we try\n\t// closing the second non-tiered pool. If the second pool also fails then we\n\t// exit the service ungracefully.\n\tpoolt1, poolt2 := util.NewClosablePool(), util.NewClosablePool()\n\n\t// Create our input pipe\n\tinputPipe, err := input.New(config.Input, mgr, logger, stats)\n\tif err != nil {\n\t\tlogger.Errorf(\"Input error (%s): %v\\n\", config.Input.Type, err)\n\t\treturn nil, nil, nil, err\n\t}\n\tpoolt1.Add(1, inputPipe)\n\tpoolt2.Add(0, inputPipe)\n\n\t// Create a buffer\n\tbuf, err := buffer.New(config.Buffer, logger, stats)\n\tif err != nil {\n\t\tlogger.Errorf(\"Buffer error (%s): %v\\n\", config.Buffer.Type, err)\n\t\treturn nil, nil, nil, err\n\t}\n\tpoolt1.Add(3, buf)\n\tpoolt2.Add(0, buf)\n\n\t// Create our output pipe\n\toutputPipe, err := output.New(config.Output, mgr, logger, stats)\n\tif err != nil {\n\t\tlogger.Errorf(\"Output error (%s): %v\\n\", config.Output.Type, err)\n\t\treturn nil, nil, nil, err\n\t}\n\tpoolt1.Add(10, outputPipe)\n\tpoolt2.Add(0, outputPipe)\n\n\toutputPipe.StartReceiving(buf.TransactionChan())\n\tbuf.StartReceiving(inputPipe.TransactionChan())\n\n\tcloseChan := make(chan struct{})\n\n\t// If our outputs close down then we should shut down the service\n\tgo func() {\n\t\tfor {\n\t\t\tif err := outputPipe.WaitForClose(time.Second * 60); err == nil {\n\t\t\t\tcloseChan <- struct{}{}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn poolt1, poolt2, closeChan, nil\n}", "title": "" }, { "docid": "135709c481f55f8249bf03bf13258cad", "score": "0.49964026", "text": "func createPipelineRunFromWebhookData(buildInformation BuildInformation, r Resource) {\n\tlogging.Log.Debugf(\"In createPipelineRunFromWebhookData, build information: %s\", buildInformation)\n\t// Todo should these be parameterised? Non-default namespace support and then RBAC/roles/bindings etc\n\tnamespaceToUse := \"default\"\n\tsaName := \"default\"\n\n\tstartTime := getDateTimeAsString()\n\n\t// Assumes you've already applied the yaml: so the pipeline definition and its tasks exist\n\tgeneratedPipelineRunName := fmt.Sprintf(\"devops-pipeline-run-%s\", startTime)\n\n\tpipelineTemplateName := \"simple-pipeline\"\n\tpipelineNs := \"default\"\n\n\t// Unique names\n\timageResourceName := fmt.Sprintf(\"docker-image-%s\", startTime)\n\tgitResourceName := fmt.Sprintf(\"git-source-%s\", startTime)\n\n\tpipeline, err := r.getPipeline(pipelineTemplateName, pipelineNs)\n\tif err != nil {\n\t\tlogging.Log.Errorf(\"could not find the pipeline template %s in namespace %s\", pipelineTemplateName, pipelineNs)\n\t\treturn\n\t} else {\n\t\tlogging.Log.Debugf(\"Found the pipeline template %s OK\", pipelineTemplateName)\n\t}\n\n\tlogging.Log.Debug(\"Creating PipelineResources next...\")\n\n\tregistryURL := os.Getenv(\"DOCKER_REGISTRY_LOCATION\")\n\turlToUse := fmt.Sprintf(\"%s/%s:%s\", registryURL, buildInformation.REPONAME, buildInformation.SHORTID)\n\tlogging.Log.Infof(\"Pushing the image to %s\", urlToUse)\n\n\tparamsForImageResource := []v1alpha1.Param{{Name: \"url\", Value: urlToUse}}\n\tpipelineImageResource := definePipelineResource(imageResourceName, pipelineNs, paramsForImageResource, \"image\")\n\tcreatedPipelineImageResource, err := r.PipelineClient.PipelineResources(pipelineNs).Create(pipelineImageResource)\n\tif err != nil {\n\t\tlogging.Log.Errorf(\"could not create pipeline image resource to be used in the pipeline, error: %s\", err)\n\t} else {\n\t\tlogging.Log.Infof(\"Created pipeline image resource %s successfully\", createdPipelineImageResource.Name)\n\t}\n\n\tparamsForGitResource := []v1alpha1.Param{{Name: \"revision\", Value: buildInformation.COMMITID}, {Name: \"url\", Value: buildInformation.REPOURL}}\n\tpipelineGitResource := definePipelineResource(gitResourceName, pipelineNs, paramsForGitResource, \"git\")\n\tcreatedPipelineGitResource, err := r.PipelineClient.PipelineResources(pipelineNs).Create(pipelineGitResource)\n\n\tif err != nil {\n\t\tlogging.Log.Errorf(\"could not create pipeline git resource to be used in the pipeline, error: %s\", err)\n\t} else {\n\t\tlogging.Log.Infof(\"Created pipeline git resource %s successfully\", createdPipelineGitResource.Name)\n\t}\n\n\tgitResourceRef := v1alpha1.PipelineResourceRef{Name: gitResourceName}\n\timageResourceRef := v1alpha1.PipelineResourceRef{Name: imageResourceName}\n\n\tresources := []v1alpha1.PipelineResourceBinding{{Name: \"docker-image\", ResourceRef: imageResourceRef}, {Name: \"git-source\", ResourceRef: gitResourceRef}}\n\n\t// PipelineRun yaml defines references to resources\n\tpipelineRunData := definePipelineRun(generatedPipelineRunName, namespaceToUse, saName, pipeline, v1alpha1.PipelineTriggerTypeManual, resources)\n\n\tlogging.Log.Infof(\"Creating a new PipelineRun named %s\", generatedPipelineRunName)\n\n\tpipelineRun, err := r.PipelineClient.PipelineRuns(pipelineNs).Create(pipelineRunData)\n\tif err != nil {\n\t\tlogging.Log.Errorf(\"error creating the PipelineRun: %s\", err)\n\t} else {\n\t\tlogging.Log.Infof(\"PipelineRun created: %s\", pipelineRun)\n\t}\n}", "title": "" }, { "docid": "dcb34ab0e23c494508bd6d0523d6efd9", "score": "0.4987469", "text": "func CreateResource(name string) *pkgtest.Resource {\n\treturn &pkgtest.Resource{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Resource\",\n\t\t\tAPIVersion: \"v1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: system.Namespace(),\n\t\t\tName: name,\n\t\t},\n\t\tSpec: pkgtest.ResourceSpec{\n\t\t\tFieldWithValidation: \"magic value\",\n\t\t},\n\t}\n}", "title": "" }, { "docid": "4b3f35021a5947fa33718f7202b3874c", "score": "0.49825808", "text": "func (m *MongoSearcher) CreatePipeline(query Query) *mgo.Pipe {\n\tc := m.db.C(models.PluralizeLowerResourceName(query.Resource))\n\tp := []bson.M{{\"$match\": m.createQueryObject(query)}}\n\n\to := query.Options()\n\n\t// support for _sort\n\tremoveParallelArraySorts(o)\n\tif len(o.Sort) > 0 {\n\t\tvar sortBSOND bson.D\n\t\tfor _, sort := range o.Sort {\n\t\t\t// Note: If there are multiple paths, we only look at the first one -- not ideal, but otherwise it gets tricky\n\t\t\tfield := convertSearchPathToMongoField(sort.Parameter.Paths[0].Path)\n\t\t\torder := 1\n\t\t\tif sort.Descending {\n\t\t\t\torder = -1\n\t\t\t}\n\t\t\tsortBSOND = append(sortBSOND, bson.DocElem{Name: field, Value: order})\n\t\t}\n\t\tp = append(p, bson.M{\"$sort\": sortBSOND})\n\t}\n\n\t// support for _offset\n\tif o.Offset > 0 {\n\t\tp = append(p, bson.M{\"$skip\": o.Offset})\n\t}\n\t// support for _count\n\tp = append(p, bson.M{\"$limit\": o.Count})\n\n\t// support for _include\n\tif len(o.Include) > 0 {\n\t\tfor _, incl := range o.Include {\n\t\t\tfor _, inclPath := range incl.Parameter.Paths {\n\t\t\t\tif inclPath.Type != \"Reference\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Mongo paths shouldn't have the array indicators, so remove them\n\t\t\t\tlocalField := strings.Replace(inclPath.Path, \"[]\", \"\", -1) + \".referenceid\"\n\t\t\t\tfor i, inclTarget := range incl.Parameter.Targets {\n\t\t\t\t\tif inclTarget == \"Any\" {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfrom := models.PluralizeLowerResourceName(inclTarget)\n\t\t\t\t\tas := fmt.Sprintf(\"_included%sResourcesReferencedBy%s\", inclTarget, strings.Title(incl.Parameter.Name))\n\t\t\t\t\t// If there are multiple paths, we need to store each path separately\n\t\t\t\t\tif len(incl.Parameter.Paths) > 1 {\n\t\t\t\t\t\tas += fmt.Sprintf(\"Path%d\", i+1)\n\t\t\t\t\t}\n\n\t\t\t\t\tp = append(p, bson.M{\"$lookup\": bson.M{\n\t\t\t\t\t\t\"from\": from,\n\t\t\t\t\t\t\"localField\": localField,\n\t\t\t\t\t\t\"foreignField\": \"_id\",\n\t\t\t\t\t\t\"as\": as,\n\t\t\t\t\t}})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// support for _revinclude\n\tif len(o.RevInclude) > 0 {\n\t\tfor _, incl := range o.RevInclude {\n\t\t\t// we only want parameters that have the search resource as their target\n\t\t\ttargetsSearchResource := false\n\t\t\tfor _, inclTarget := range incl.Parameter.Targets {\n\t\t\t\tif inclTarget == query.Resource || inclTarget == \"Any\" {\n\t\t\t\t\ttargetsSearchResource = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !targetsSearchResource {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// it comes from the other resource collection\n\t\t\tfrom := models.PluralizeLowerResourceName(incl.Parameter.Resource)\n\t\t\t// iterate through the paths, adding a join to the pipeline for each one\n\t\t\tfor i, inclPath := range incl.Parameter.Paths {\n\t\t\t\tif inclPath.Type != \"Reference\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Mongo paths shouldn't have the array indicators, so remove them\n\t\t\t\tforeignField := strings.Replace(inclPath.Path, \"[]\", \"\", -1) + \".referenceid\"\n\t\t\t\tas := fmt.Sprintf(\"_revIncluded%sResourcesReferencing%s\", incl.Parameter.Resource, strings.Title(incl.Parameter.Name))\n\t\t\t\t// If there are multiple paths, we need to store each path separately\n\t\t\t\tif len(incl.Parameter.Paths) > 1 {\n\t\t\t\t\tas += fmt.Sprintf(\"Path%d\", i+1)\n\t\t\t\t}\n\n\t\t\t\tp = append(p, bson.M{\"$lookup\": bson.M{\n\t\t\t\t\t\"from\": from,\n\t\t\t\t\t\"localField\": \"_id\",\n\t\t\t\t\t\"foreignField\": foreignField,\n\t\t\t\t\t\"as\": as,\n\t\t\t\t}})\n\n\t\t\t}\n\t\t}\n\t}\n\n\treturn c.Pipe(p)\n}", "title": "" }, { "docid": "cc70e0856f48426419ea8da32b9885f8", "score": "0.49802077", "text": "func CreatePipeline(p *gaia.CreatePipeline) {\n\tgitToken := p.GitHubToken\n\tp.GitHubToken = \"\"\n\tstoreService, _ := services.StorageService()\n\t// Define build process for the given type\n\tbP := newBuildPipeline(p.Pipeline.Type)\n\tif bP == nil {\n\t\t// Pipeline type is not supported\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tp.Output = fmt.Sprintf(\"create pipeline failed. Pipeline type is not supported %s is not supported\", p.Pipeline.Type)\n\t\t_ = storeService.CreatePipelinePut(p)\n\t\treturn\n\t}\n\n\t// Setup environment before cloning repo and command\n\terr := bP.PrepareEnvironment(p)\n\tif err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tp.Output = fmt.Sprintf(\"cannot prepare build: %s\", err.Error())\n\t\t_ = storeService.CreatePipelinePut(p)\n\t\treturn\n\t}\n\n\t// Clone git repo\n\terr = gitCloneRepo(p.Pipeline.Repo)\n\tif err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tp.Output = fmt.Sprintf(\"cannot prepare build: %s\", err.Error())\n\t\t_ = storeService.CreatePipelinePut(p)\n\t\treturn\n\t}\n\n\t// Update status of our pipeline build\n\tp.Status = pipelineCloneStatus\n\terr = storeService.CreatePipelinePut(p)\n\tif err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tgaia.Cfg.Logger.Error(\"cannot put create pipeline into store\", \"error\", err.Error())\n\t\treturn\n\t}\n\n\t// Run compile process\n\terr = bP.ExecuteBuild(p)\n\tif err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\t_ = storeService.CreatePipelinePut(p)\n\t\treturn\n\t}\n\n\t// Update status of our pipeline build\n\tp.Status = pipelineCompileStatus\n\terr = storeService.CreatePipelinePut(p)\n\tif err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tgaia.Cfg.Logger.Error(\"cannot put create pipeline into store\", \"error\", err.Error())\n\t\treturn\n\t}\n\n\t// Run update if needed\n\terr = updatePipeline(&p.Pipeline)\n\tif err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tp.Output = fmt.Sprintf(\"cannot update pipeline: %s\", err.Error())\n\t\t_ = storeService.CreatePipelinePut(p)\n\t\treturn\n\t}\n\n\t// Try to get pipeline jobs to check if this pipeline is valid.\n\tschedulerService, _ := services.SchedulerService()\n\tif err = schedulerService.SetPipelineJobs(&p.Pipeline); err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tp.Output = fmt.Sprintf(\"cannot validate pipeline: %s\", err.Error())\n\t\t_ = storeService.CreatePipelinePut(p)\n\t\treturn\n\t}\n\n\t// Update status of our pipeline build\n\tp.Status = pipelineValidateStatus\n\terr = storeService.CreatePipelinePut(p)\n\tif err != nil {\n\t\tgaia.Cfg.Logger.Error(\"cannot put create pipeline into store\", \"error\", err.Error())\n\t\treturn\n\t}\n\n\tp.Pipeline.TriggerToken = security.GenerateRandomUUIDV5()\n\n\t// Save the generated pipeline data\n\terr = bP.SavePipeline(&p.Pipeline)\n\tif err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tp.Output = fmt.Sprintf(\"failed to save the created pipeline: %s\", err.Error())\n\t\t_ = storeService.CreatePipelinePut(p)\n\t\treturn\n\t}\n\n\t// Copy compiled binary to plugins folder which is the final step\n\terr = bP.CopyBinary(p)\n\tif err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tp.Output = fmt.Sprintf(\"cannot copy compiled binary: %s\", err.Error())\n\t\t_ = storeService.CreatePipelinePut(p)\n\t\treturn\n\t}\n\n\t// Set create pipeline status to complete\n\tp.Status = pipelineCompleteStatus\n\tp.StatusType = gaia.CreatePipelineSuccess\n\terr = storeService.CreatePipelinePut(p)\n\tif err != nil {\n\t\tp.StatusType = gaia.CreatePipelineFailed\n\t\tgaia.Cfg.Logger.Error(\"cannot put create pipeline into store\", \"error\", err.Error())\n\t\treturn\n\t}\n\n\tif !gaia.Cfg.Poll && len(gitToken) > 0 {\n\t\t// if there is a githubtoken provided, that means that a webhook was requested to be added.\n\t\terr = createGithubWebhook(gitToken, p.Pipeline.Repo, nil)\n\t\tif err != nil {\n\t\t\tgaia.Cfg.Logger.Error(\"error while creating webhook for repository\", \"error\", err.Error())\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e855e3c8c17e9b950322de27a8a80a05", "score": "0.49790874", "text": "func (st *Postgres) CreatePipeline(p *Pipeline) error {\n\tlogger := logger.WithFields(log.Fields{\n\t\t\"name\": p.Name,\n\t\t\"url\": p.GitRemote.URL,\n\t\t\"branch\": p.GitRemote.Branch,\n\n\t\t\"query\": \"create_pipeline\",\n\t})\n\n\tsqlinsert := `\n\tWITH project_id AS (\n\t\tSELECT project_id FROM git_remotes\n\t\tWHERE git_remotes.url = $2\n\t\t\tAND git_remotes.branch = $3\n\t)\n\tINSERT INTO pipelines(name, remote_url, remote_branch, project_id)\n\tSELECT $1, $2, $3, project_id \n\tFROM project_id\n\tRETURNING id;\n\t`\n\n\tlogger.Debug(\"saving pipeline\")\n\n\t// Using QueryRow because the insert is returning \"count\".\n\terr := st.db.QueryRow(\n\t\tsqlinsert, p.Name, p.GitRemote.URL, p.GitRemote.Branch).\n\t\tScan(&p.ID)\n\tif err != nil {\n\t\tlogger.WithField(\"error\", err).Debug(\"unable to insert pipeline run\")\n\t\treturn err\n\t}\n\n\tlogger.Debug(\"pipeline saved\")\n\n\treturn nil\n}", "title": "" }, { "docid": "365eaa5c6547488fbf1e7fe74b2d694d", "score": "0.4969942", "text": "func (h *Harness) NewNamedPipe() Generator {\n\treturn func(parent *Mock) *Mock {\n\t\treturn h.NewMock(parent, MakePath(), p9.Attr{Mode: p9.ModeNamedPipe})\n\t}\n}", "title": "" }, { "docid": "0a94ea05190b09b8eae47eb54c77ea0e", "score": "0.49531958", "text": "func NewPipeline(pipes ...Pipe) Pipeline {\n\thead := make(chan interface{})\n\tvar next_chan chan interface{}\n\tfor _, pipe := range pipes {\n\t\tif next_chan == nil {\n\t\t\tnext_chan = pipe.Process(head)\n\t\t} else {\n\t\t\tnext_chan = pipe.Process(next_chan)\n\t\t}\n\t}\n\treturn Pipeline{head: head, tail: next_chan}\n}", "title": "" }, { "docid": "591ed86947a0da6421df83ac2ccdb0ab", "score": "0.49407804", "text": "func createPipe() pipeline.Pipe {\n\n\tconf := make(map[interface{}]interface{})\n\tconf[\"apidUri\"] = \"http://localhost:8181/verifiers/apikey\"\n\tconf[\"organization\"] = organization\n\tconf[\"environment\"] = environment\n\tconf[\"keyHeader\"] = headerKey\n\n\tfitting, err := CreateFitting(conf)\n\n\tExpect(err).Should(BeNil(), \"Error creating fitting\")\n\tExpect(fitting).ShouldNot(BeNil(), \"Error creating fitting\")\n\n\t// //create our handler from our fitting\n\thandler := fitting.RequestHandlerFunc()\n\n\treqFittings := []pipeline.FittingWithID{test_util.NewFittingFromHandlers(\"test\", handler, nil)}\n\n\tpipeDef := pipeline.NewDefinition(reqFittings, []pipeline.FittingWithID{})\n\n\tpipe := pipeDef.CreatePipe()\n\n\treturn pipe\n}", "title": "" }, { "docid": "2a970fb8d0a52e8d49ba95bbb3dff55f", "score": "0.49229628", "text": "func (w *Worker) AddPipeline(id uint) *pipeline.Pipeline {\n\treturn w.host.AddPipeline(uint32(id))\n}", "title": "" }, { "docid": "efd8580ba279b02276cf1b1645b12980", "score": "0.49193907", "text": "func CreatePipeline(filePath string) *Pipeline {\n\tpipelineStr := \"splitmuxsink name=filesink muxer=webmmux location=\"\n\tpipelineStr += filePath\n\tpipelineStr += \" appsrc format=time is-live=true do-timestamp=true name=vsrc ! application/x-rtp\"\n\tpipelineStr += \", payload=96, encoding-name=VP8-DRAFT-IETF-01 ! rtpvp8depay ! filesink.video\"\n\tpipelineStr += \" appsrc format=time is-live=true do-timestamp=true name=asrc ! application/x-rtp\"\n\tpipelineStr += \", payload=111, encoding-name=OPUS ! rtpopusdepay ! opusdec ! opusenc ! filesink.audio_0\"\n\n\tpipelineStrUnsafe := C.CString(pipelineStr)\n\tdefer C.free(unsafe.Pointer(pipelineStrUnsafe))\n\treturn &Pipeline{Pipeline: C.gstreamer_recordwebm_create_pipeline(pipelineStrUnsafe)}\n}", "title": "" }, { "docid": "995f529c42659624df320b1cbad4b511", "score": "0.49074927", "text": "func New(ss ...Stage) *Pipe {\n\treturn &Pipe{\n\t\tm: sync.Mutex{},\n\t\tstages: append([]Stage{}, ss...),\n\t\tlinks: make([]chan Item, len(ss)+1),\n\t}\n}", "title": "" }, { "docid": "0da8ae8bdb1b9069530e81b8c78527b1", "score": "0.48985675", "text": "func (c *Client) CreateResource(r *resource.Result) error {\n\tif err := r.Err(); err != nil {\n\t\treturn err\n\t}\n\treturn r.Visit(create)\n}", "title": "" }, { "docid": "c5a7df5248068d9d0de641345e047991", "score": "0.4889027", "text": "func NewPipeline(tb testing.TB, opts ...launcher.OptSetter) *Pipeline {\n\ttb.Helper()\n\n\ttl := launcher.NewTestLauncher()\n\tp := &Pipeline{\n\t\tLauncher: tl,\n\t}\n\n\ttl.RunOrFail(tb, context.Background(), opts...)\n\n\t// setup default operator\n\tres := p.Launcher.OnBoardOrFail(tb, &influxdb.OnboardingRequest{\n\t\tUser: DefaultUsername,\n\t\tPassword: DefaultPassword,\n\t\tOrg: DefaultOrgName,\n\t\tBucket: DefaultBucketName,\n\t\tRetentionPeriodSeconds: influxdb.InfiniteRetention,\n\t\tToken: OperToken,\n\t})\n\n\tp.DefaultOrgID = res.Org.ID\n\tp.DefaultUserID = res.User.ID\n\tp.DefaultBucketID = res.Bucket.ID\n\n\treturn p\n}", "title": "" }, { "docid": "ac43b086d6ab7b98f2f0cbd836102264", "score": "0.48887318", "text": "func (cf CloudFormation) CreatePipeline(bucketName string, stackConfig StackConfiguration) error {\n\ttemplateURL, err := cf.pushTemplateToS3Bucket(bucketName, stackConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts, err := toStackFromS3(stackConfig, templateURL)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = cf.cfnClient.CreateAndWait(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\toutput, err := cf.cfnClient.Outputs(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// If the pipeline has a PipelineConnectionARN in the output map, indicating that it is has a CodeStarConnections source provider, the user needs to update the connection status; Copilot will wait until that happens.\n\tif output[connectionARNKey] == \"\" {\n\t\treturn nil\n\t}\n\tctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(45*time.Minute))\n\tdefer cancel()\n\tif err = cf.codeStarClient.WaitUntilConnectionStatusAvailable(ctx, output[connectionARNKey]); err != nil {\n\t\treturn err\n\t}\n\n\tpipelineResourceName, err := cf.pipelinePhysicalResourceID(stackConfig.StackName())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = cf.cpClient.RetryStageExecution(pipelineResourceName, sourceStage); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b882dd4bf3832042475dabf774a0191f", "score": "0.487831", "text": "func (client *ImportPipelinesClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, importPipelineCreateParameters ImportPipeline, options *ImportPipelinesClientBeginCreateOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}\"\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif registryName == \"\" {\n\t\treturn nil, errors.New(\"parameter registryName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{registryName}\", url.PathEscape(registryName))\n\tif importPipelineName == \"\" {\n\t\treturn nil, errors.New(\"parameter importPipelineName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{importPipelineName}\", url.PathEscape(importPipelineName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-01-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\tif err := runtime.MarshalAsJSON(req, importPipelineCreateParameters); err != nil {\n\t\treturn nil, err\n\t}\n\treturn req, nil\n}", "title": "" }, { "docid": "2ec6ee5a9ffcd10a43cc40e2be5bf6d0", "score": "0.48742402", "text": "func NewPipeline() *Pipeline {\n\treturn &Pipeline{}\n}", "title": "" }, { "docid": "8ea849c835d70f6fc780b9138472f889", "score": "0.48736927", "text": "func newPipelineHandler(t *Transport, r Raft, cid types.ID) http.Handler {\n\th := &pipelineHandler{\n\t\tlg: t.Logger,\n\t\tlocalID: t.ID,\n\t\ttr: t,\n\t\tr: r,\n\t\tcid: cid,\n\t}\n\tif h.lg == nil {\n\t\th.lg = zap.NewNop()\n\t}\n\treturn h\n}", "title": "" }, { "docid": "159aef01df77fbe80b44dccedb985021", "score": "0.48621288", "text": "func NewTag(ctx *pulumi.Context,\n\tname string, args *TagArgs, opts ...pulumi.ResourceOption) (*Tag, error) {\n\tif args == nil || args.DisplayName == nil {\n\t\treturn nil, errors.New(\"missing required argument 'DisplayName'\")\n\t}\n\tif args == nil || args.ResourceGroupName == nil {\n\t\treturn nil, errors.New(\"missing required argument 'ResourceGroupName'\")\n\t}\n\tif args == nil || args.ServiceName == nil {\n\t\treturn nil, errors.New(\"missing required argument 'ServiceName'\")\n\t}\n\tif args == nil || args.TagId == nil {\n\t\treturn nil, errors.New(\"missing required argument 'TagId'\")\n\t}\n\tif args == nil {\n\t\targs = &TagArgs{}\n\t}\n\taliases := pulumi.Aliases([]pulumi.Alias{\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:apimanagement/latest:Tag\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:apimanagement/v20170301:Tag\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:apimanagement/v20180601preview:Tag\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:apimanagement/v20190101:Tag\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:apimanagement/v20191201:Tag\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:apimanagement/v20191201preview:Tag\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:apimanagement/v20200601preview:Tag\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource Tag\n\terr := ctx.RegisterResource(\"azure-nextgen:apimanagement/v20180101:Tag\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "3a51313bfe0b1d7e73aad4ac54bed60e", "score": "0.48601678", "text": "func NewFoo(ctx *pulumi.Context,\n\tname string, args *FooArgs, opts ...pulumi.ResourceOption) (*Foo, error) {\n\tif args == nil {\n\t\targs = &FooArgs{}\n\t}\n\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Foo\n\terr := ctx.RegisterRemoteComponentResource(\"example::Foo\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "2374a8c4359e4c8bd8306e1a4f638575", "score": "0.48464704", "text": "func (s *PipelineSvc) createPipelineGraph(p *spec.Pipeline, passedDataOpt ...passedDataWhenCreate) (err error) {\n\tvar passedData passedDataWhenCreate\n\tif len(passedDataOpt) > 0 {\n\t\tpassedData = passedDataOpt[0]\n\t}\n\tpassedData.initData(s.extMarketSvc)\n\n\t// tx\n\ttxSession := s.dbClient.NewSession()\n\tdefer txSession.Close()\n\tif err := txSession.Begin(); err != nil {\n\t\treturn apierrors.ErrCreatePipelineGraph.InternalError(err)\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\trbErr := txSession.Rollback()\n\t\t\tif rbErr != nil {\n\t\t\t\tlogrus.Errorf(\"[alert] failed to rollback when createPipelineGraph failed, pipeline: %+v, rollbackErr: %v\",\n\t\t\t\t\tp, rbErr)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\t// metrics.PipelineCounterTotalAdd(*p, 1)\n\t}()\n\n\t// 创建 pipeline\n\tif err := s.dbClient.CreatePipeline(p, dbclient.WithTxSession(txSession.Session)); err != nil {\n\t\treturn apierrors.ErrCreatePipeline.InternalError(err)\n\t}\n\n\t// 创建 stage -> task\n\tpipelineYml, err := pipelineyml.New(\n\t\t[]byte(p.PipelineYml),\n\t\t//pipelineyml.WithRunParams(p.Snapshot.RunPipelineParams), // runParams 在执行时才渲染,提前渲染在嵌套流水线中会导致渲染为 outputs 占位符,会引起歧义\n\t\t//pipelineyml.WithRenderSnippet(p.Labels, caches),\n\t)\n\tif err != nil {\n\t\treturn apierrors.ErrParsePipelineYml.InternalError(err)\n\t}\n\n\t// search and cache action define and spec\n\tif err := passedData.putPassedDataByPipelineYml(pipelineYml); err != nil {\n\t\treturn err\n\t}\n\n\tlastSuccessTaskMap, _, err := s.dbClient.ParseRerunFailedDetail(p.Extra.RerunFailedDetail)\n\tif err != nil {\n\t\treturn apierrors.ErrCreatePipelineGraph.InternalError(err)\n\t}\n\n\tvar snippetTasks []*spec.PipelineTask\n\tvar allStagedTasks [][]*spec.PipelineTask\n\tfor si, stage := range pipelineYml.Spec().Stages {\n\t\tvar stagedTasks []*spec.PipelineTask\n\t\tps := &spec.PipelineStage{\n\t\t\tPipelineID: p.ID,\n\t\t\tName: \"\",\n\t\t\tStatus: apistructs.PipelineStatusAnalyzed,\n\t\t\tCostTimeSec: -1,\n\t\t\tExtra: spec.PipelineStageExtra{StageOrder: si},\n\t\t}\n\t\tif err := s.dbClient.CreatePipelineStage(ps, dbclient.WithTxSession(txSession.Session)); err != nil {\n\t\t\treturn apierrors.ErrCreatePipelineGraph.InternalError(err)\n\t\t}\n\n\t\t// create tasks\n\t\tfor _, typedAction := range stage.Actions {\n\t\t\tfor actionType, action := range typedAction {\n\t\t\t\tvar pt *spec.PipelineTask\n\t\t\t\tlastSuccessTask, ok := lastSuccessTaskMap[string(action.Alias)]\n\t\t\t\tif ok {\n\t\t\t\t\tpt = lastSuccessTask\n\t\t\t\t\tpt.ID = 0\n\t\t\t\t\tpt.PipelineID = p.ID\n\t\t\t\t\tpt.StageID = ps.ID\n\t\t\t\t} else {\n\t\t\t\t\tswitch actionType {\n\t\t\t\t\tcase apistructs.ActionTypeSnippet: // 生成嵌套流水线任务\n\t\t\t\t\t\tpt, err = s.makeSnippetPipelineTask(p, ps, action)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn apierrors.ErrCreatePipelineTask.InternalError(err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsnippetTasks = append(snippetTasks, pt)\n\t\t\t\t\tdefault: // 生成普通任务\n\t\t\t\t\t\tpt, err = s.makeNormalPipelineTask(p, ps, action, passedData)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn apierrors.ErrCreatePipelineTask.InternalError(err)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// 创建当前节点\n\t\t\t\tif err := s.dbClient.CreatePipelineTask(pt, dbclient.WithTxSession(txSession.Session)); err != nil {\n\t\t\t\t\tlogrus.Errorf(\"[alert] failed to create pipeline task when create pipeline graph: %v\", err)\n\t\t\t\t\treturn apierrors.ErrCreatePipelineTask.InternalError(err)\n\t\t\t\t}\n\t\t\t\tstagedTasks = append(stagedTasks, pt)\n\t\t\t}\n\t\t}\n\t\tallStagedTasks = append(allStagedTasks, stagedTasks)\n\t}\n\n\t// commit transaction\n\tif err := txSession.Commit(); err != nil {\n\t\tlogrus.Errorf(\"[alert] failed to commit when createPipelineGraph success, pipeline: %+v, commitErr: %v\",\n\t\t\tp, err)\n\t\treturn apierrors.ErrCreatePipelineGraph.InternalError(err)\n\t}\n\n\t_ = s.PreCheck(p)\n\n\t// put into db gc\n\tp.EnsureGC()\n\t//s.engine.WaitDBGC(p.ID, *p.Extra.GC.DatabaseGC.Analyzed.TTLSecond, *p.Extra.GC.DatabaseGC.Analyzed.NeedArchive)\n\n\t// events\n\tevents.EmitPipelineInstanceEvent(p, p.GetSubmitUserID())\n\n\t// 统一处理嵌套流水线\n\t// 批量查询 snippet yaml\n\tvar sourceSnippetConfigs []apistructs.SnippetConfig\n\tfor _, snippetTask := range snippetTasks {\n\t\tyamlSnippetConfig := snippetTask.Extra.Action.SnippetConfig\n\t\tsnippetConfig := apistructs.SnippetConfig{\n\t\t\tSource: yamlSnippetConfig.Source,\n\t\t\tName: yamlSnippetConfig.Name,\n\t\t\tLabels: yamlSnippetConfig.Labels,\n\t\t}\n\t\tsourceSnippetConfigs = append(sourceSnippetConfigs, snippetConfig)\n\t}\n\tsourceSnippetConfigYamls, err := s.HandleQueryPipelineYamlBySnippetConfigs(sourceSnippetConfigs)\n\tif err != nil {\n\t\treturn apierrors.ErrQuerySnippetYaml.InternalError(err)\n\t}\n\n\t// 创建嵌套流水线\n\tvar sErrs []error\n\tvar sLock sync.Mutex\n\tvar wg sync.WaitGroup\n\tfor i := range snippetTasks {\n\t\tsnippet := snippetTasks[i]\n\t\tsnippetConfig := apistructs.SnippetConfig{\n\t\t\tSource: snippet.Extra.Action.SnippetConfig.Source,\n\t\t\tName: snippet.Extra.Action.SnippetConfig.Name,\n\t\t\tLabels: snippet.Extra.Action.SnippetConfig.Labels,\n\t\t}\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\t// snippetTask 转换为 pipeline 结构体\n\t\t\tsnippetPipeline, err := s.makeSnippetPipeline4Create(p, snippet, sourceSnippetConfigYamls[snippetConfig.ToString()])\n\t\t\tif err != nil {\n\t\t\t\tsLock.Lock()\n\t\t\t\tsErrs = append(sErrs, err)\n\t\t\t\tsLock.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// 创建嵌套流水线\n\t\t\tif err := s.createPipelineGraph(snippetPipeline, passedData); err != nil {\n\t\t\t\tsLock.Lock()\n\t\t\t\tsErrs = append(sErrs, err)\n\t\t\t\tsLock.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// 创建好的流水线数据塞回 snippetTask\n\t\t\tsnippet.SnippetPipelineID = &snippetPipeline.ID\n\t\t\tsnippet.Extra.AppliedResources = snippetPipeline.Snapshot.AppliedResources\n\t\t\tif err := s.dbClient.UpdatePipelineTask(snippet.ID, snippet); err != nil {\n\t\t\t\tsLock.Lock()\n\t\t\t\tsErrs = append(sErrs, err)\n\t\t\t\tsLock.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t}()\n\t}\n\twg.Wait()\n\tif len(sErrs) > 0 {\n\t\tvar errMsgs []string\n\t\tfor _, err := range sErrs {\n\t\t\terrMsgs = append(errMsgs, err.Error())\n\t\t}\n\t\treturn apierrors.ErrCreatePipelineGraph.InternalError(fmt.Errorf(strutil.Join(errMsgs, \"; \")))\n\t}\n\n\t// calculate pipeline applied resource after all snippetTask created\n\tpipelineAppliedResources := s.calculatePipelineResources(allStagedTasks)\n\tp.Snapshot.AppliedResources = pipelineAppliedResources\n\tif err := s.dbClient.UpdatePipelineExtraSnapshot(p.ID, p.Snapshot); err != nil {\n\t\treturn apierrors.ErrCreatePipelineGraph.InternalError(\n\t\t\tfmt.Errorf(\"failed to update pipeline snapshot for applied resources, err: %v\", err))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "452824070fc11b5d9b396c858d3d3320", "score": "0.4845414", "text": "func (o *StepCreatePipelineOptions) Run() error {\n\terr := o.validateCommandLineFlags()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgitInfo, _ := gits.ParseGitURL(o.SourceURL)\n\n\ttektonClient, jxClient, kubeClient, ns, err := o.getClientsAndNamespace()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpodTemplates, err := o.getPodTemplates(kubeClient, ns, apps.AppPodTemplateName)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to retrieve pod templates\")\n\t}\n\n\tpipelineName := tekton.PipelineResourceNameFromGitInfo(gitInfo, o.Branch, o.Context, tekton.MetaPipeline)\n\tbuildNumber, err := tekton.GenerateNextBuildNumber(tektonClient, jxClient, ns, gitInfo, o.Branch, retryDuration, pipelineName)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to determine next build number\")\n\t}\n\n\tif o.Verbose {\n\t\tlog.Logger().Infof(\"creating meta pipeline CRDs for build %s of repository '%s/%s'\", buildNumber, gitInfo.Organisation, gitInfo.Name)\n\t}\n\textendingApps, err := metapipeline.GetExtendingApps(jxClient, ns)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcrdCreationParams := metapipeline.CRDCreationParameters{\n\t\tNamespace: ns,\n\t\tContext: o.Context,\n\t\tPipelineName: pipelineName,\n\t\tPipelineKind: o.PipelineKind,\n\t\tBuildNumber: buildNumber,\n\t\tGitInfo: gitInfo,\n\t\tBranch: o.Branch,\n\t\tPullRef: o.PullRefs,\n\t\tSourceDir: defaultCheckoutDir,\n\t\tPodTemplates: podTemplates,\n\t\tTrigger: string(pipelineapi.PipelineTriggerTypeManual),\n\t\tServiceAccount: o.ServiceAccount,\n\t\tLabels: o.CustomLabels,\n\t\tEnvVars: o.CustomEnvs,\n\t\tDefaultImage: o.DefaultImage,\n\t\tApps: extendingApps,\n\t}\n\ttektonCRDs, err := metapipeline.CreateMetaPipelineCRDs(crdCreationParams)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to generate Tekton CRDs for meta pipeline\")\n\t}\n\n\terr = o.handleResult(tektonClient, jxClient, tektonCRDs, buildNumber, o.Branch, o.PullRefs, ns, gitInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7925388e1d2fd29c976cb424094c0341", "score": "0.4843811", "text": "func NewPipeline(logger log.Logger, stgs PipelineStages, plObserverMicroSeconds *prometheus.Observer) (*Pipeline, error) {\n\tst := []stages.Stage{}\n\tfor _, s := range stgs {\n\t\tstage, ok := s.(map[interface{}]interface{})\n\t\tif !ok {\n\t\t\treturn nil, errors.Errorf(\"invalid YAML config, \"+\n\t\t\t\t\"make sure each stage of your pipeline is a YAML object (must end with a `:`), check stage `- %s`\", s)\n\t\t}\n\t\tif len(stage) > 1 {\n\t\t\treturn nil, errors.New(\"pipeline stage must contain only one key\")\n\t\t}\n\t\tfor key, config := range stage {\n\t\t\tname, ok := key.(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, errors.New(\"pipeline stage key must be a string\")\n\t\t\t}\n\t\t\tswitch name {\n\t\t\tcase \"json\":\n\t\t\t\tjson, err := stages.NewJSON(logger, config)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrap(err, \"invalid json stage config\")\n\t\t\t\t}\n\t\t\t\tst = append(st, json)\n\t\t\tcase \"regex\":\n\t\t\t\tregex, err := stages.NewRegex(logger, config)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrap(err, \"invalid regex stage config\")\n\t\t\t\t}\n\t\t\t\tst = append(st, regex)\n\t\t\tcase \"docker\":\n\t\t\t\tdocker, err := stages.NewDocker(logger)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrap(err, \"invalid docker stage config\")\n\t\t\t\t}\n\t\t\t\tst = append(st, docker)\n\t\t\tcase \"cri\":\n\t\t\t\tcri, err := stages.NewCRI(logger)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrap(err, \"invalid cri stage config\")\n\t\t\t\t}\n\t\t\t\tst = append(st, cri)\n\t\t\t}\n\t\t}\n\t}\n\treturn &Pipeline{\n\t\tlogger: log.With(logger, \"component\", \"pipeline\"),\n\t\tstages: st,\n\t\tplObs: plObserverMicroSeconds,\n\t}, nil\n}", "title": "" }, { "docid": "c08cf904523bd6a26bc269f73e1984a0", "score": "0.48406407", "text": "func NewPipeline(filters []Filter) *Pipeline {\n\treturn &Pipeline{\n\t\tfilters: filters,\n\t}\n}", "title": "" }, { "docid": "3c43163eefb266f5013c834c4213ba89", "score": "0.48403728", "text": "func createResource(probe v1alpha1.ProbeAttributes, gvr schema.GroupVersionResource, clients clients.ClientSets) error {\n\tdecUnstructured := yaml.NewDecodingSerializer(unstructured.UnstructuredJSONScheme)\n\t// Decode YAML manifest into unstructured.Unstructured\n\tdata := &unstructured.Unstructured{}\n\t_, _, err = decUnstructured.Decode([]byte(probe.Data), nil, data)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err := clients.DynamicClient.Resource(gvr).Namespace(probe.K8sProbeInputs.Namespace).Create(data, v1.CreateOptions{})\n\n\treturn err\n}", "title": "" }, { "docid": "0f3473e8de4a489a6a7e09d32a6007fc", "score": "0.4831137", "text": "func definePipelineRun(pipelineRunName, namespace, saName, gitServer, gitOrg, gitRepo string,\n\tpipeline v1alpha1.Pipeline,\n\ttriggerType v1alpha1.PipelineTriggerType,\n\tresourceBinding []v1alpha1.PipelineResourceBinding,\n\tparams []v1alpha1.Param) *v1alpha1.PipelineRun {\n\n\tpipelineRunData := v1alpha1.PipelineRun{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: pipelineRunName,\n\t\t\tNamespace: namespace,\n\t\t\tLabels: map[string]string{\n\t\t\t\t\"app\": \"tekton-app\",\n\t\t\t\tgitServerLabel: gitServer,\n\t\t\t\tgitOrgLabel: gitOrg,\n\t\t\t\tgitRepoLabel: gitRepo,\n\t\t\t},\n\t\t},\n\n\t\tSpec: v1alpha1.PipelineRunSpec{\n\t\t\tPipelineRef: v1alpha1.PipelineRef{Name: pipeline.Name},\n\t\t\t// E.g. v1alpha1.PipelineTriggerTypeManual\n\t\t\tTrigger: v1alpha1.PipelineTrigger{Type: triggerType},\n\t\t\tServiceAccount: saName,\n\t\t\tTimeout: &metav1.Duration{Duration: 1 * time.Hour},\n\t\t\tResources: resourceBinding,\n\t\t\tParams: params,\n\t\t},\n\t}\n\tpipelineRunPointer := &pipelineRunData\n\treturn pipelineRunPointer\n}", "title": "" }, { "docid": "45678d997a688899cb7a238a6440cc94", "score": "0.4820349", "text": "func NewPipeline() *Pipeline {\n\treturn &Pipeline{\n\t\tcommands: []*Command{},\n\t}\n}", "title": "" }, { "docid": "2477fd532651633edb342bb037702468", "score": "0.48077947", "text": "func CreateResource(jsonFilePath string, oc *CLI) error {\n\terr := oc.Run(\"create\").Args(\"-f\", jsonFilePath).Execute()\n\treturn err\n}", "title": "" }, { "docid": "8ed06ec529c627ffc964d71b57db05f5", "score": "0.4806409", "text": "func NewPipe(capacity int) (c *Pipe) {\n c = new(Pipe)\n c.quantity = 0\n c.capacity = capacity\n c.output = nil\n return c\n}", "title": "" }, { "docid": "5d12c7f2b9849126a15b2b3db81fc0f4", "score": "0.4806382", "text": "func New(name string, fn interface{}) (*Resource, error) {\n\tnewFn, err := normalizeFunction(fn)\n\tif err != nil {\n\t\treturn nil, ErrBadFunctionSignature{err.Error()}\n\t}\n\treturn &Resource{name: name, fn: normalizedFn(newFn)}, nil\n}", "title": "" }, { "docid": "0d29954fb36af56067123e3891e6f478", "score": "0.4802119", "text": "func createResource(r *unstructured.Unstructured, factory client.DynamicFactory, w io.Writer) error {\n\tid := fmt.Sprintf(\"%s/%s\", r.GetKind(), r.GetName())\n\n\t// Helper to reduce boilerplate message about the same object\n\tlog := func(f string, a ...interface{}) {\n\t\tformat := strings.Join([]string{id, \": \", f, \"\\n\"}, \"\")\n\t\tfmt.Fprintf(w, format, a...)\n\t}\n\tlog(\"attempting to create resource\")\n\n\tgvk := schema.FromAPIVersionAndKind(r.GetAPIVersion(), r.GetKind())\n\n\tapiResource := metav1.APIResource{\n\t\tName: kindToResource[r.GetKind()],\n\t\tNamespaced: (r.GetNamespace() != \"\"),\n\t}\n\n\tc, err := factory.ClientForGroupVersionResource(gvk.GroupVersion(), apiResource, r.GetNamespace())\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"Error creating client for resource %s\", id)\n\t}\n\n\tif _, err := c.Create(r); apierrors.IsAlreadyExists(err) {\n\t\tlog(\"already exists, proceeding\")\n\t} else if err != nil {\n\t\treturn errors.Wrapf(err, \"Error creating resource %s\", id)\n\t}\n\n\tlog(\"created\")\n\treturn nil\n}", "title": "" }, { "docid": "292e1823e664d5435d33cdae61551984", "score": "0.47894102", "text": "func (s service) CreateResource(ctx context.Context, req *auth.CreateResourceRequest) (*auth.Resource, error) {\n\n\tfmt.Println(\"dddddddddddddddddd\", req)\n\n\tif err := ValidateResourceCreateRequest(req); err != nil {\n\t\treturn nil, err\n\t}\n\n\tapp, err := s.repo.GetApp(ctx, req.Uuid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tid, err := s.repo.CreateResource(ctx, app, entity.Resource{\n\t\tName: req.Name,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.GetResource(ctx, id)\n}", "title": "" }, { "docid": "5e5995c37de248134c3c5c631aa8d5b7", "score": "0.47878855", "text": "func newPipeline() *pipeline {\n\tpipe := &pipeline{}\n\tpipe.errors = make(chan error, 3)\n\tpipe.input = make(chan nodePackage, 10)\n\tpipe.results = pipe.input // short-curcuit, will be filled with filters\n\treturn pipe\n}", "title": "" }, { "docid": "702a36215f701fded9c9f9e28ae3a6ce", "score": "0.47754073", "text": "func (client LabOperationsClient) CreateOrUpdateResourcePreparer(resourceGroupName string, name string, lab Lab, cancel <-chan struct{}) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"name\": autorest.Encode(\"path\", name),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": client.APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsJSON(),\n\t\tautorest.AsPut(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}\", pathParameters),\n\t\tautorest.WithJSON(lab),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare(&http.Request{Cancel: cancel})\n}", "title": "" }, { "docid": "1e82a0e26f03aca23822761993579ab6", "score": "0.4764803", "text": "func CreateTestSrcPipeline(audioTrack, videoTrack *webrtc.TrackLocalStaticSample) *Pipeline {\n\tpipelineStr := fmt.Sprintf(`\n\t\tvideotestsrc ! \n\t\t\tvideo/x-raw,width=1280,height=720 !\n\t\t\tqueue !\n\t\t\t%s ! \n\t\t\tvideo/x-h264,stream-format=byte-stream,profile=baseline !\n\t\t\tappsink name=%s \n\t\taudiotestsrc wave=6 ! \n\t\t\tqueue ! \n\t\t\taudioconvert ! \n\t\t\taudioresample ! \n\t\t\taudio/x-raw,rate=48000,channels=2 !\n\t\t\topusenc ! appsink name=%s\n\t`, getEncoderString(), videoTrack.ID(), audioTrack.ID())\n\n\tpipelineStrUnsafe := C.CString(pipelineStr)\n\tdefer C.free(unsafe.Pointer(pipelineStrUnsafe))\n\n\tpipelinesLock.Lock()\n\tdefer pipelinesLock.Unlock()\n\tpipeline := &Pipeline{\n\t\tPipeline: C.gstreamer_create_pipeline(pipelineStrUnsafe),\n\t}\n\treturn pipeline\n}", "title": "" }, { "docid": "599b890244731adde9f8a571170d8ace", "score": "0.47632414", "text": "func NewResource(router *Router, path string, options ...ResourceOption) *Resource {\n\tr := &Resource{\n\t\topenAPIOperation: newOperation(),\n\t\trouter: router,\n\t\tpath: path,\n\t}\n\n\tfor _, option := range options {\n\t\toption.ApplyResource(r)\n\t}\n\n\treturn r\n}", "title": "" }, { "docid": "eafdfd393ab2998e51a5496fb76b9c4c", "score": "0.47616422", "text": "func (client LabOperationsClient) CreateOrUpdateResource(resourceGroupName string, name string, lab Lab, cancel <-chan struct{}) (result autorest.Response, err error) {\n\treq, err := client.CreateOrUpdateResourcePreparer(resourceGroupName, name, lab, cancel)\n\tif err != nil {\n\t\treturn result, autorest.NewErrorWithError(err, \"devtestlabs.LabOperationsClient\", \"CreateOrUpdateResource\", nil, \"Failure preparing request\")\n\t}\n\n\tresp, err := client.CreateOrUpdateResourceSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\treturn result, autorest.NewErrorWithError(err, \"devtestlabs.LabOperationsClient\", \"CreateOrUpdateResource\", resp, \"Failure sending request\")\n\t}\n\n\tresult, err = client.CreateOrUpdateResourceResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"devtestlabs.LabOperationsClient\", \"CreateOrUpdateResource\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "8d76c9e0de556c72545c4d0bd5c5b4d9", "score": "0.476141", "text": "func NewPipeline() *Pipeline {\n\treturn &Pipeline{\n\t\tconcurrency: 1,\n\n\t\tclient: NewDefaultClient(),\n\t\treqs: make(chan request),\n\n\t\trunning: false,\n\n\t\trl: newRateLimiter(0),\n\t\trateLimited: false,\n\t}\n}", "title": "" }, { "docid": "24474204e1b2a827c9b273e9f9e024f6", "score": "0.47548932", "text": "func (g *Group) AddResource(r Object) {\n\tname := r.Version()\n\tif name == \"\" {\n\t\treturn\n\t}\n\n\tv, ok := g.versions[name]\n\tif !ok {\n\t\tv = NewVersion(name, r.QualifiedGroup())\n\t\tg.versions[name] = v\n\t}\n\n\tv.AddResource(r)\n}", "title": "" }, { "docid": "334ef3017d46231e67a8021331beb261", "score": "0.4753077", "text": "func New(ksApp app.App, envName string, opts ...Opt) *Pipeline {\n\tp := &Pipeline{\n\t\tapp: ksApp,\n\t\tenvName: envName,\n\t\tcm: &defaultManager{},\n\t}\n\n\tfor _, opt := range opts {\n\t\topt(p)\n\t}\n\n\treturn p\n}", "title": "" }, { "docid": "57ba10cbab8bbb09ef7438bc36629211", "score": "0.47530735", "text": "func (s *PipelineServer) createPipelineAndPipelineVersion(ctx context.Context, pipeline *model.Pipeline, pipelineUrlStr string) (*model.Pipeline, *model.PipelineVersion, error) {\n\t// Resolve name and namespace\n\tpipelineFileName := path.Base(pipelineUrlStr)\n\tpipeline.Name = buildPipelineName(pipeline.Name, pipelineFileName)\n\tpipeline.Namespace = s.resourceManager.ReplaceNamespace(pipeline.Namespace)\n\n\t// Check authorization\n\tresourceAttributes := &authorizationv1.ResourceAttributes{\n\t\tNamespace: pipeline.Namespace,\n\t\tName: pipeline.Name,\n\t\tVerb: common.RbacResourceVerbCreate,\n\t}\n\terr := s.canAccessPipeline(ctx, \"\", resourceAttributes)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Create a pipeline version with the same name and description\n\tpipelineVersion := &model.PipelineVersion{\n\t\tName: pipeline.Name,\n\t\tPipelineSpecURI: pipelineUrlStr,\n\t\tDescription: pipeline.Description,\n\t\tStatus: model.PipelineVersionCreating,\n\t}\n\n\t// Download and parse pipeline spec\n\tpipelineUrl, err := url.ParseRequestURI(pipelineUrlStr)\n\tif err != nil {\n\t\treturn nil, nil, util.NewInvalidInputError(\"invalid pipeline spec URL: %v\", pipelineUrlStr)\n\t}\n\tresp, err := s.httpClient.Get(pipelineUrl.String())\n\tif err != nil {\n\t\treturn nil, nil, util.NewInternalServerError(err, \"error downloading the pipeline spec from %v\", pipelineUrl.String())\n\t} else if resp.StatusCode != http.StatusOK {\n\t\treturn nil, nil, util.NewInvalidInputError(\"error fetching pipeline spec from %v - request returned %v\", pipelineUrl.String(), resp.Status)\n\t}\n\tdefer resp.Body.Close()\n\tpipelineFile, err := ReadPipelineFile(pipelineFileName, resp.Body, common.MaxFileLength)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tpipelineVersion.PipelineSpec = string(pipelineFile)\n\n\t// Validate the pipeline version\n\tif err := s.validatePipelineVersionBeforeCreating(pipelineVersion); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Create both pipeline and pipeline version is a single transaction\n\treturn s.resourceManager.CreatePipelineAndPipelineVersion(pipeline, pipelineVersion)\n}", "title": "" }, { "docid": "9e130b2376d00cf2b5711f7094e00828", "score": "0.47518024", "text": "func NewPipe(s Stage) *Pipe {\n return &Pipe{ Vertex{ Data: s, } }\n}", "title": "" }, { "docid": "25cf9122f87ee4e071ebaba97d95e33f", "score": "0.4749557", "text": "func registerPlugin(constructor interface{}, options ...interface{}) {\n\tvar path, limit string\n\tvc := reflect.ValueOf(constructor)\n\n\t// Pre-processing options to make it work with reflect\n\tvo := []reflect.Value{}\n\tfor _, oi := range options {\n\t\tvo = append(vo, reflect.ValueOf(oi))\n\t}\n\n\tif len(vo) > 0 {\n\t\t// Removing limit options from path\n\t\tpath, limit = extractLimitOptions(vo[0].String())\n\n\t\t// Writing value back without limiter \"|\" options\n\t\tvo[0] = reflect.ValueOf(path)\n\t}\n\n\t// Calling our constructor with list of given options\n\tplugin := vc.Call(vo)[0].Interface()\n\n\tif limit != \"\" {\n\t\tplugin = NewLimiter(plugin, limit)\n\t}\n\n\t_, isR := plugin.(io.Reader)\n\t_, isW := plugin.(io.Writer)\n\n\t// Some of the output can be Readers as well because return responses\n\tif isR && !isW {\n\t\tPlugins.Inputs = append(Plugins.Inputs, plugin.(io.Reader))\n\t}\n\n\tif isW {\n\t\tPlugins.Outputs = append(Plugins.Outputs, plugin.(io.Writer))\n\t}\n\n\tPlugins.All = append(Plugins.All, plugin)\n}", "title": "" }, { "docid": "a5a7cc66250581df821b6f64440b5479", "score": "0.47493345", "text": "func (p *pipeline) AddPipe(name string, buffer int, f func(interface{}) interface{}) *pipe {\n\tpipe := p.newpipe(name, buffer, f)\n\tpipe.next = p.output\n\tif len(p.pipes) > 0 {\n\t\tlastPipe := p.pipes[len(p.pipes)-1]\n\t\tlastPipe.next = pipe.receive\n\t}\n\tp.pipes = append(p.pipes, &pipe)\n\treturn &pipe\n}", "title": "" }, { "docid": "e4c0b869cc06249106ff1b9098b59e11", "score": "0.4749296", "text": "func NewLab(ctx *pulumi.Context,\n\tname string, args *LabArgs, opts ...pulumi.ResourceOption) (*Lab, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.ResourceGroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ResourceGroupName'\")\n\t}\n\tif args.Security == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Security'\")\n\t}\n\tif args.Title == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Title'\")\n\t}\n\tif args.VirtualMachine == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'VirtualMachine'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Lab\n\terr := ctx.RegisterResource(\"azure:lab/lab:Lab\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "23cf3f1ea75ded042db9f2243e59be18", "score": "0.47480533", "text": "func NewPipeline() *pipeline {\n\tp := &pipeline{\n\t\tmake(chan interface{}),\n\t\tmake(chan struct{}, 1), make(chan struct{}, 1), make(chan struct{}, 1),\n\t\tfalse, false, make([]*pipe, 0),\n\t}\n\treturn p\n}", "title": "" }, { "docid": "41aa68206b447299fdd9d6f61fd32c41", "score": "0.47391576", "text": "func NewResource(id, typeName string) *Resource {\r\n\treturn &Resource{\r\n\t\tID: id,\r\n\t\tType: typeName,\r\n\t\tAttributes: make(map[string]interface{}),\r\n\t\tRelationships: make(map[string]*Relationship),\r\n\t\tLinks: make(map[string]interface{}),\r\n\t\tMeta: make(map[string]interface{}),\r\n\t}\r\n}", "title": "" }, { "docid": "865419f3cce39fc8ad34b430ebad1337", "score": "0.47308287", "text": "func newResourceFromNewDynamicResourceLifeCycle(name string, dlrc *crds.DRLCObject, now metav1.Time) *crds.ResourceObject {\n\treturn crds.NewResource(name, dlrc.Name, dlrc.Spec.InitialState, \"\", now)\n}", "title": "" }, { "docid": "dbcbf91876d6898676e0bb07bce021c2", "score": "0.47246948", "text": "func (w *Host) AddPipeline(id uint32) *pipeline.Pipeline {\n\tw.Pipelines[id] = pipeline.NewPipeline(id)\n\treturn w.Pipelines[id]\n}", "title": "" }, { "docid": "c5e7f4d31493f914889b8ed56d0c6dee", "score": "0.47041294", "text": "func (c *ocClient) CreateOrUpdatePipeline(exists bool, tmpl *template.Template, e *Event, data BuildConfigData) (int, error) {\n\tjsonBuffer, err := getBuildConfig(tmpl, data)\n\tif err != nil {\n\t\treturn 500, err\n\t}\n\n\tc.CheckAvailability(e)\n\n\turl := fmt.Sprintf(\n\t\t\"%s/namespaces/%s/buildconfigs\",\n\t\tc.OpenShiftAPIBaseURL,\n\t\te.Namespace,\n\t)\n\tverb := \"POST\"\n\tif exists {\n\t\tverb = \"PUT\"\n\t\turl = fmt.Sprintf(\"%s/%s\", url, data.Name)\n\t}\n\treq, _ := http.NewRequest(verb, url, jsonBuffer)\n\tres, err := c.do(req)\n\tif err != nil {\n\t\treturn 500, fmt.Errorf(\"could not make OpenShift request: %s\", err)\n\t}\n\tdefer res.Body.Close()\n\n\tbody, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn 500, fmt.Errorf(\"could not read OpenShift response body: %s\", err)\n\t}\n\n\tif res.StatusCode < 200 || res.StatusCode >= 300 {\n\t\treturn res.StatusCode, fmt.Errorf(\"unexpected return code for %s %s: %s\", verb, url, body)\n\t}\n\n\tlog.Println(e.RequestID, \"Created pipeline\", e.Pipeline)\n\n\treturn res.StatusCode, nil\n}", "title": "" }, { "docid": "c925d1bd367ce94458a9c38efe6ced55", "score": "0.47021365", "text": "func PipelineResourceName(organisation string, name string, branch string, context string, pipelineType string) string {\n\treturn possiblyUniquePipelineResourceName(organisation, name, branch, context, pipelineType, true)\n}", "title": "" }, { "docid": "55f3358ca7d1fbda766f2732dc59b69b", "score": "0.4700665", "text": "func (rm *resmon) RegisterResource(ctx context.Context,\n\treq *pulumirpc.RegisterResourceRequest,\n) (*pulumirpc.RegisterResourceResponse, error) {\n\t// Communicate the type, name, and object information to the iterator that is awaiting us.\n\tname := tokens.QName(req.GetName())\n\tcustom := req.GetCustom()\n\tremote := req.GetRemote()\n\tparent, err := resource.ParseOptionalURN(req.GetParent())\n\tif err != nil {\n\t\treturn nil, rpcerror.New(codes.InvalidArgument, fmt.Sprintf(\"invalid parent URN: %s\", err))\n\t}\n\tprotect := req.GetProtect()\n\tdeleteBeforeReplaceValue := req.GetDeleteBeforeReplace()\n\tignoreChanges := req.GetIgnoreChanges()\n\treplaceOnChanges := req.GetReplaceOnChanges()\n\tid := resource.ID(req.GetImportId())\n\tcustomTimeouts := req.GetCustomTimeouts()\n\tretainOnDelete := req.GetRetainOnDelete()\n\tdeletedWith, err := resource.ParseOptionalURN(req.GetDeletedWith())\n\tif err != nil {\n\t\treturn nil, rpcerror.New(codes.InvalidArgument, fmt.Sprintf(\"invalid DeletedWith URN: %s\", err))\n\t}\n\tsourcePosition := rm.sourcePositions.getFromRequest(req)\n\n\t// Custom resources must have a three-part type so that we can 1) identify if they are providers and 2) retrieve the\n\t// provider responsible for managing a particular resource (based on the type's Package).\n\tvar t tokens.Type\n\tif custom || remote {\n\t\tt, err = tokens.ParseTypeToken(req.GetType())\n\t\tif err != nil {\n\t\t\treturn nil, rpcerror.New(codes.InvalidArgument, err.Error())\n\t\t}\n\t} else {\n\t\t// Component resources may have any format type.\n\t\tt = tokens.Type(req.GetType())\n\t}\n\n\t// We handle updating the providers map to include the providers field of the parent if\n\t// both the current resource and its parent is a component resource.\n\tfunc() {\n\t\t// Function exists to scope the lock\n\t\trm.componentProvidersLock.Lock()\n\t\tdefer rm.componentProvidersLock.Unlock()\n\t\tif parentsProviders, parentIsComponent := rm.componentProviders[parent]; !custom &&\n\t\t\tparent != \"\" && parentIsComponent {\n\t\t\tfor k, v := range parentsProviders {\n\t\t\t\tif req.Providers == nil {\n\t\t\t\t\treq.Providers = map[string]string{}\n\t\t\t\t}\n\t\t\t\tif _, ok := req.Providers[k]; !ok {\n\t\t\t\t\treq.Providers[k] = v\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\tlabel := fmt.Sprintf(\"ResourceMonitor.RegisterResource(%s,%s)\", t, name)\n\n\tvar providerRef providers.Reference\n\tvar providerRefs map[string]string\n\n\tif custom && !providers.IsProviderType(t) || remote {\n\t\tproviderReq, err := parseProviderRequest(t.Package(), req.GetVersion(), req.GetPluginDownloadURL())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tproviderRef, err = getProviderReference(rm.defaultProviders, providerReq, req.GetProvider())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tproviderRefs = make(map[string]string, len(req.GetProviders()))\n\t\tfor name, provider := range req.GetProviders() {\n\t\t\tref, err := getProviderReference(rm.defaultProviders, providerReq, provider)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tproviderRefs[name] = ref.String()\n\t\t}\n\t}\n\n\taliases := []resource.Alias{}\n\tfor _, aliasURN := range req.GetAliasURNs() {\n\t\turn, err := resource.ParseURN(aliasURN)\n\t\tif err != nil {\n\t\t\treturn nil, rpcerror.New(codes.InvalidArgument, fmt.Sprintf(\"invalid alias URN: %s\", err))\n\t\t}\n\t\taliases = append(aliases, resource.Alias{URN: urn})\n\t}\n\n\t// We assume aliases are properly specified. However, if a request hasn't explicitly\n\t// indicated that it is using properly specified aliases and the request is coming\n\t// from Node.js, transform the aliases from the incorrect Node.js values to properly\n\t// specified values, to maintain backward compatibility for users of older Node.js\n\t// SDKs that aren't sending properly specified aliases.\n\ttransformAliases := !req.GetAliasSpecs() && requestFromNodeJS(ctx)\n\n\tfor _, aliasObject := range req.GetAliases() {\n\t\taliasSpec := aliasObject.GetSpec()\n\t\tvar alias resource.Alias\n\t\tif aliasSpec != nil {\n\t\t\tparentURN, err := resource.ParseOptionalURN(aliasSpec.GetParentUrn())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, rpcerror.New(codes.InvalidArgument, fmt.Sprintf(\"invalid parent alias URN: %s\", err))\n\t\t\t}\n\t\t\talias = resource.Alias{\n\t\t\t\tName: aliasSpec.Name,\n\t\t\t\tType: aliasSpec.Type,\n\t\t\t\tStack: aliasSpec.Stack,\n\t\t\t\tProject: aliasSpec.Project,\n\t\t\t\tParent: parentURN,\n\t\t\t\tNoParent: aliasSpec.GetNoParent(),\n\t\t\t}\n\t\t\tif transformAliases {\n\t\t\t\talias = transformAliasForNodeJSCompat(alias)\n\t\t\t}\n\t\t} else {\n\t\t\turn, err := resource.ParseURN(aliasObject.GetUrn())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, rpcerror.New(codes.InvalidArgument, fmt.Sprintf(\"invalid alias URN: %s\", err))\n\t\t\t}\n\t\t\talias = resource.Alias{URN: urn}\n\t\t}\n\t\taliases = append(aliases, alias)\n\t}\n\n\tdependencies := []resource.URN{}\n\tfor _, dependingURN := range req.GetDependencies() {\n\t\turn, err := resource.ParseURN(dependingURN)\n\t\tif err != nil {\n\t\t\treturn nil, rpcerror.New(codes.InvalidArgument, fmt.Sprintf(\"invalid dependency URN: %s\", err))\n\t\t}\n\t\tdependencies = append(dependencies, urn)\n\t}\n\n\tprops, err := plugin.UnmarshalProperties(\n\t\treq.GetObject(), plugin.MarshalOptions{\n\t\t\tLabel: label,\n\t\t\tKeepUnknowns: true,\n\t\t\tComputeAssetHashes: true,\n\t\t\tKeepSecrets: true,\n\t\t\tKeepResources: true,\n\t\t\t// To initially scope the use of this new feature, we only keep output values when unmarshaling\n\t\t\t// properties for RegisterResource (when remote is true for multi-lang components) and Call.\n\t\t\tKeepOutputValues: remote,\n\t\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif providers.IsProviderType(t) {\n\t\tif req.GetVersion() != \"\" {\n\t\t\tversion, err := semver.Parse(req.GetVersion())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"%s: passed invalid version: %w\", label, err)\n\t\t\t}\n\t\t\tproviders.SetProviderVersion(props, &version)\n\t\t}\n\t\tif req.GetPluginDownloadURL() != \"\" {\n\t\t\tproviders.SetProviderURL(props, req.GetPluginDownloadURL())\n\t\t}\n\n\t\t// Make sure that an explicit provider which doesn't specify its plugin gets the\n\t\t// same plugin as the default provider for the package.\n\t\tdefaultProvider, ok := rm.defaultProviders.defaultProviderInfo[providers.GetProviderPackage(t)]\n\t\tif ok && req.GetVersion() == \"\" && req.GetPluginDownloadURL() == \"\" {\n\t\t\tif defaultProvider.Version != nil {\n\t\t\t\tproviders.SetProviderVersion(props, defaultProvider.Version)\n\t\t\t}\n\t\t\tif defaultProvider.PluginDownloadURL != \"\" {\n\t\t\t\tproviders.SetProviderURL(props, defaultProvider.PluginDownloadURL)\n\t\t\t}\n\t\t}\n\t}\n\n\tpropertyDependencies := make(map[resource.PropertyKey][]resource.URN)\n\tif len(req.GetPropertyDependencies()) == 0 && !remote {\n\t\t// If this request did not specify property dependencies, treat each property as depending on every resource\n\t\t// in the request's dependency list. We don't need to do this when remote is true, because all clients that\n\t\t// support remote already support passing property dependencies, so there's no need to backfill here.\n\t\tfor pk := range props {\n\t\t\tpropertyDependencies[pk] = dependencies\n\t\t}\n\t} else {\n\t\t// Otherwise, unmarshal the per-property dependency information.\n\t\tfor pk, pd := range req.GetPropertyDependencies() {\n\t\t\tvar deps []resource.URN\n\t\t\tfor _, d := range pd.Urns {\n\t\t\t\turn, err := resource.ParseURN(d)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, rpcerror.New(codes.InvalidArgument, fmt.Sprintf(\"invalid dependency on property %s URN: %s\", pk, err))\n\t\t\t\t}\n\t\t\t\tdeps = append(deps, urn)\n\t\t\t}\n\t\t\tpropertyDependencies[resource.PropertyKey(pk)] = deps\n\t\t}\n\t}\n\n\tadditionalSecretOutputs := req.GetAdditionalSecretOutputs()\n\n\tvar deleteBeforeReplace *bool\n\tif deleteBeforeReplaceValue || req.GetDeleteBeforeReplaceDefined() {\n\t\tdeleteBeforeReplace = &deleteBeforeReplaceValue\n\t}\n\n\tlogging.V(5).Infof(\n\t\t\"ResourceMonitor.RegisterResource received: t=%v, name=%v, custom=%v, #props=%v, parent=%v, protect=%v, \"+\n\t\t\t\"provider=%v, deps=%v, deleteBeforeReplace=%v, ignoreChanges=%v, aliases=%v, customTimeouts=%v, \"+\n\t\t\t\"providers=%v, replaceOnChanges=%v, retainOnDelete=%v, deletedWith=%v\",\n\t\tt, name, custom, len(props), parent, protect, providerRef, dependencies, deleteBeforeReplace, ignoreChanges,\n\t\taliases, customTimeouts, providerRefs, replaceOnChanges, retainOnDelete, deletedWith)\n\n\t// If this is a remote component, fetch its provider and issue the construct call. Otherwise, register the resource.\n\tvar result *RegisterResult\n\n\tvar outputDeps map[string]*pulumirpc.RegisterResourceResponse_PropertyDependencies\n\tif remote {\n\t\tprovider, ok := rm.providers.GetProvider(providerRef)\n\t\tif providers.IsDenyDefaultsProvider(providerRef) {\n\t\t\tmsg := diag.GetDefaultProviderDenied(\"\").Message\n\t\t\treturn nil, fmt.Errorf(msg, t.Package().String(), t.String())\n\t\t}\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"unknown provider '%v'\", providerRef)\n\t\t}\n\n\t\t// Invoke the provider's Construct RPC method.\n\t\toptions := plugin.ConstructOptions{\n\t\t\t// We don't actually need to send a list of aliases to construct anymore because the engine does\n\t\t\t// all alias construction.\n\t\t\tAliases: []resource.Alias{},\n\t\t\tDependencies: dependencies,\n\t\t\tProtect: protect,\n\t\t\tPropertyDependencies: propertyDependencies,\n\t\t\tProviders: providerRefs,\n\t\t\tAdditionalSecretOutputs: additionalSecretOutputs,\n\t\t\tDeletedWith: deletedWith,\n\t\t\tIgnoreChanges: ignoreChanges,\n\t\t\tReplaceOnChanges: replaceOnChanges,\n\t\t\tRetainOnDelete: retainOnDelete,\n\t\t}\n\t\tif customTimeouts != nil {\n\t\t\toptions.CustomTimeouts = &plugin.CustomTimeouts{\n\t\t\t\tCreate: customTimeouts.Create,\n\t\t\t\tUpdate: customTimeouts.Update,\n\t\t\t\tDelete: customTimeouts.Delete,\n\t\t\t}\n\t\t}\n\t\tif deleteBeforeReplace != nil {\n\t\t\toptions.DeleteBeforeReplace = *deleteBeforeReplace\n\t\t}\n\n\t\tconstructResult, err := provider.Construct(rm.constructInfo, t, name, parent, props, options)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tresult = &RegisterResult{State: &resource.State{URN: constructResult.URN, Outputs: constructResult.Outputs}}\n\n\t\toutputDeps = map[string]*pulumirpc.RegisterResourceResponse_PropertyDependencies{}\n\t\tfor k, deps := range constructResult.OutputDependencies {\n\t\t\turns := make([]string, len(deps))\n\t\t\tfor i, d := range deps {\n\t\t\t\turns[i] = string(d)\n\t\t\t}\n\t\t\toutputDeps[string(k)] = &pulumirpc.RegisterResourceResponse_PropertyDependencies{Urns: urns}\n\t\t}\n\t} else {\n\t\tadditionalSecretKeys := slice.Prealloc[resource.PropertyKey](len(additionalSecretOutputs))\n\t\tfor _, name := range additionalSecretOutputs {\n\t\t\tadditionalSecretKeys = append(additionalSecretKeys, resource.PropertyKey(name))\n\t\t}\n\n\t\tvar timeouts resource.CustomTimeouts\n\t\tif customTimeouts != nil {\n\t\t\tif customTimeouts.Create != \"\" {\n\t\t\t\tseconds, err := generateTimeoutInSeconds(customTimeouts.Create)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\ttimeouts.Create = seconds\n\t\t\t}\n\t\t\tif customTimeouts.Delete != \"\" {\n\t\t\t\tseconds, err := generateTimeoutInSeconds(customTimeouts.Delete)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\ttimeouts.Delete = seconds\n\t\t\t}\n\t\t\tif customTimeouts.Update != \"\" {\n\t\t\t\tseconds, err := generateTimeoutInSeconds(customTimeouts.Update)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\ttimeouts.Update = seconds\n\t\t\t}\n\t\t}\n\n\t\tgoal := resource.NewGoal(t, name, custom, props, parent, protect, dependencies,\n\t\t\tproviderRef.String(), nil, propertyDependencies, deleteBeforeReplace, ignoreChanges,\n\t\t\tadditionalSecretKeys, aliases, id, &timeouts, replaceOnChanges, retainOnDelete, deletedWith,\n\t\t\tsourcePosition,\n\t\t)\n\n\t\tif goal.Parent != \"\" {\n\t\t\trm.resGoalsLock.Lock()\n\t\t\tparentGoal, ok := rm.resGoals[goal.Parent]\n\t\t\tif ok {\n\t\t\t\tgoal = inheritFromParent(*goal, parentGoal)\n\t\t\t}\n\t\t\trm.resGoalsLock.Unlock()\n\t\t}\n\t\t// Send the goal state to the engine.\n\t\tstep := &registerResourceEvent{\n\t\t\tgoal: goal,\n\t\t\tdone: make(chan *RegisterResult),\n\t\t}\n\n\t\tselect {\n\t\tcase rm.regChan <- step:\n\t\tcase <-rm.cancel:\n\t\t\tlogging.V(5).Infof(\"ResourceMonitor.RegisterResource operation canceled, name=%s\", name)\n\t\t\treturn nil, rpcerror.New(codes.Unavailable, \"resource monitor shut down while sending resource registration\")\n\t\t}\n\n\t\t// Now block waiting for the operation to finish.\n\t\tselect {\n\t\tcase result = <-step.done:\n\t\tcase <-rm.cancel:\n\t\t\tlogging.V(5).Infof(\"ResourceMonitor.RegisterResource operation canceled, name=%s\", name)\n\t\t\treturn nil, rpcerror.New(codes.Unavailable, \"resource monitor shut down while waiting on step's done channel\")\n\t\t}\n\t\tif result != nil && result.State != nil && result.State.URN != \"\" {\n\t\t\trm.resGoalsLock.Lock()\n\t\t\trm.resGoals[result.State.URN] = *goal\n\t\t\trm.resGoalsLock.Unlock()\n\t\t}\n\t}\n\n\tif !custom && result != nil && result.State != nil && result.State.URN != \"\" {\n\t\tfunc() {\n\t\t\trm.componentProvidersLock.Lock()\n\t\t\tdefer rm.componentProvidersLock.Unlock()\n\t\t\trm.componentProviders[result.State.URN] = req.GetProviders()\n\t\t}()\n\t}\n\n\t// Filter out partially-known values if the requestor does not support them.\n\toutputs := result.State.Outputs\n\n\t// Local ComponentResources may contain unresolved resource refs, so ignore those outputs.\n\tif !req.GetCustom() && !remote {\n\t\t// In the case of a SameStep, the old resource outputs are returned to the language host after the step is\n\t\t// executed. The outputs of a ComponentResource may depend on resources that have not been registered at the\n\t\t// time the ComponentResource is itself registered, as the outputs are set by a later call to\n\t\t// RegisterResourceOutputs. Therefore, when the SameStep returns the old resource outputs for a\n\t\t// ComponentResource, it may return references to resources that have not yet been registered, which will cause\n\t\t// the SDK's calls to getResource to fail when it attempts to resolve those references.\n\t\t//\n\t\t// Work on a more targeted fix is tracked in https://github.com/pulumi/pulumi/issues/5978\n\t\toutputs = resource.PropertyMap{}\n\t}\n\n\tif !req.GetSupportsPartialValues() {\n\t\tlogging.V(5).Infof(\"stripping unknowns from RegisterResource response for urn %v\", result.State.URN)\n\t\tfiltered := resource.PropertyMap{}\n\t\tfor k, v := range outputs {\n\t\t\tif !v.ContainsUnknowns() {\n\t\t\t\tfiltered[k] = v\n\t\t\t}\n\t\t}\n\t\toutputs = filtered\n\t}\n\n\t// TODO(@platform):\n\t// Currently component resources ignore these options:\n\t// • ignoreChanges\n\t// • customTimeouts\n\t// • additionalSecretOutputs\n\t// • replaceOnChanges\n\t// • retainOnDelete\n\t// • deletedWith\n\t// Revisit these semantics in Pulumi v4.0\n\t// See this issue for more: https://github.com/pulumi/pulumi/issues/9704\n\tif !custom {\n\t\trm.checkComponentOption(result.State.URN, \"ignoreChanges\", func() bool {\n\t\t\treturn len(ignoreChanges) > 0\n\t\t})\n\t\trm.checkComponentOption(result.State.URN, \"customTimeouts\", func() bool {\n\t\t\tif customTimeouts == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\thasUpdateTimeout := customTimeouts.Update != \"\"\n\t\t\thasCreateTimeout := customTimeouts.Create != \"\"\n\t\t\thasDeleteTimeout := customTimeouts.Delete != \"\"\n\t\t\treturn hasCreateTimeout || hasUpdateTimeout || hasDeleteTimeout\n\t\t})\n\t\trm.checkComponentOption(result.State.URN, \"additionalSecretOutputs\", func() bool {\n\t\t\treturn len(additionalSecretOutputs) > 0\n\t\t})\n\t\trm.checkComponentOption(result.State.URN, \"replaceOnChanges\", func() bool {\n\t\t\treturn len(replaceOnChanges) > 0\n\t\t})\n\t\trm.checkComponentOption(result.State.URN, \"retainOnDelete\", func() bool {\n\t\t\treturn retainOnDelete\n\t\t})\n\t\trm.checkComponentOption(result.State.URN, \"deletedWith\", func() bool {\n\t\t\treturn deletedWith != \"\"\n\t\t})\n\t}\n\n\tlogging.V(5).Infof(\n\t\t\"ResourceMonitor.RegisterResource operation finished: t=%v, urn=%v, #outs=%v\",\n\t\tresult.State.Type, result.State.URN, len(outputs))\n\n\t// Finally, unpack the response into properties that we can return to the language runtime. This mostly includes\n\t// an ID, URN, and defaults and output properties that will all be blitted back onto the runtime object.\n\tobj, err := plugin.MarshalProperties(outputs, plugin.MarshalOptions{\n\t\tLabel: label,\n\t\tKeepUnknowns: true,\n\t\tKeepSecrets: req.GetAcceptSecrets(),\n\t\tKeepResources: req.GetAcceptResources(),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &pulumirpc.RegisterResourceResponse{\n\t\tUrn: string(result.State.URN),\n\t\tId: string(result.State.ID),\n\t\tObject: obj,\n\t\tPropertyDependencies: outputDeps,\n\t}, nil\n}", "title": "" }, { "docid": "e0711674fb7850366169a67ce63784b5", "score": "0.46902186", "text": "func newResourceDef(apiDef *raml.APIDefinition, endpoint, packageName string) resourceDef {\n\trd := resourceDef{\n\t\tEndpoint: endpoint,\n\t\tAPIDef: apiDef,\n\t}\n\trd.Name = strings.Title(normalizeURI(endpoint))\n\trd.PackageName = packageName\n\treturn rd\n}", "title": "" }, { "docid": "03719723730f7990d2f25b3182a8cf04", "score": "0.467383", "text": "func NewWorkload(ctx *pulumi.Context,\n\tname string, args *WorkloadArgs, opts ...pulumi.ResourceOption) (*Workload, error) {\n\tif args == nil {\n\t\targs = &WorkloadArgs{}\n\t}\n\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Workload\n\terr := ctx.RegisterResource(\"newrelic:plugins/workload:Workload\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "c0e9e1708c23e9c4e39df0d712f144d1", "score": "0.46683207", "text": "func newResource(root *Resources, dsl DSL) *ResourceDefinition {\n\tvar rs ResourceDefinition\n\trs.Dsl = dsl\n\trs.Order = Any\n\trs.Root = root\n\trs.uuid = gu.NewKey()\n\trs.Manager = gu.NewRouteManager()\n\trs.Resolver = dispatch.NewResolver(\"*\")\n\n\trsp := &rs\n\troot.Resources = append(root.Resources, rsp)\n\n\tdispatch.Subscribe(func(rv ResourceViewUpdate) {\n\t\tif rv.Resource != rsp.uuid {\n\t\t\treturn\n\t\t}\n\n\t\tif !rsp.active {\n\t\t\treturn\n\t\t}\n\n\t\trs.Root.renderer.RenderUpdate(rv.View, rv.Target, true)\n\t})\n\n\treturn rsp\n}", "title": "" }, { "docid": "373f80af24e67b5323e2be0bae9bad39", "score": "0.4662075", "text": "func (r *Resource) Create(ctx context.Context, name string, obj interface{}) error {\n\tri, err := r.getResourceInterface()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn util.CreateObject(ctx, ri, name, r.gv.WithKind(r.kind), obj)\n}", "title": "" }, { "docid": "1eaab3608f2bf97a762684ecf01b4251", "score": "0.46595716", "text": "func NewRegistry(ctx *pulumi.Context,\n\tname string, args *RegistryArgs, opts ...pulumi.ResourceOption) (*Registry, error) {\n\tif args == nil {\n\t\targs = &RegistryArgs{}\n\t}\n\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Registry\n\terr := ctx.RegisterResource(\"gcp:kms/registry:Registry\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" } ]
46571d85347bc7c35d04aa1b28d3960c
The name of the user hierarchy level. Must not be more than 50 characters.
[ { "docid": "e3a77bc77b64b35583e095230f225077", "score": "0.0", "text": "func (o UserHierarchyStructureHierarchyStructureLevelFivePtrOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *UserHierarchyStructureHierarchyStructureLevelFive) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Name\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" } ]
[ { "docid": "bc0d999fe3e9628bb7cc109051a38e57", "score": "0.65774465", "text": "func (l level) String() string { return levels[l] }", "title": "" }, { "docid": "5db55a6bf11153f74e1dea069eeb597e", "score": "0.62990224", "text": "func (d *Default) LevelName(l int) string {\n\treturn LevelNames[l]\n}", "title": "" }, { "docid": "1db6cb1f54c6456aae6afe2b3896e67c", "score": "0.6232375", "text": "func (ll Level) String() string {\n\treturn levels[ll]\n}", "title": "" }, { "docid": "6e68cde05432e1a511c78ae91b9224e1", "score": "0.61825", "text": "func GetLevel() string {\n\treturn levelToString(currentLevel)\n}", "title": "" }, { "docid": "026ec6c671c94bf6a5a32d12e565199d", "score": "0.5913499", "text": "func GetLevel() string {\n\treturn atom.Level().String()\n}", "title": "" }, { "docid": "511fa82667ad301f6383386ec5176dc1", "score": "0.58645487", "text": "func (ul UseLevel) String() string {\n\tuseLevel2String := map[UseLevel]string{\n\t\tNoviceUser: \"NOVICE\",\n\t\tStandardUser: \"STANDARD\",\n\t\tExpertUser: \"EXPERT\",\n\t\tAdminUser: \"ADMIN\",\n\t\tInternalUse: \"INTERNAL\",\n\t\tRestrictedUse: \"RESTRICTED\",\n\t\tUnknownUseLevel: \"UNKNOWN\",\n\t}\n\tul = useLevelCheck(ul)\n\treturn useLevel2String[ul]\n}", "title": "" }, { "docid": "ef907074ecd5eaa4cf530fa2556aa850", "score": "0.57988226", "text": "func (l Level) String() string {\n\tif l >= None && l <= Error {\n\t\treturn levels[l]\n\t}\n\n\treturn \"unknown\"\n}", "title": "" }, { "docid": "49914fefdc069b95d9299a82cd0ca22e", "score": "0.5798194", "text": "func (l Level) String() string {\n\tif name, ok := LevelNames[l]; ok {\n\t\treturn name\n\t}\n\treturn \"Unknown\"\n}", "title": "" }, { "docid": "49914fefdc069b95d9299a82cd0ca22e", "score": "0.5798194", "text": "func (l Level) String() string {\n\tif name, ok := LevelNames[l]; ok {\n\t\treturn name\n\t}\n\treturn \"Unknown\"\n}", "title": "" }, { "docid": "81950cdd2a3f153088b816f6cbb22de9", "score": "0.57723075", "text": "func (l AllowedLevel) String() string {\n\treturn (zapcore.Level)(l).String()\n}", "title": "" }, { "docid": "bc67b9a50249c147c63ae593ddced377", "score": "0.5721276", "text": "func DomainLevel(name string) (level int) {\n\treturn len(strings.Split(name, \".\")) - 1\n}", "title": "" }, { "docid": "dd3d9127decce7abe8e1f5f938ab2ee1", "score": "0.5684696", "text": "func (level Level) String() string {\n\tif isValidLevel(level) {\n\t\treturn levels[level]\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "0ad34bd2da02fbc24481b78cb3049271", "score": "0.5663203", "text": "func (l *Levels) Name(level Level) string {\n\tif name, ok := l.Names[level]; ok {\n\t\treturn name\n\t}\n\treturn strconv.Itoa(int(level))\n}", "title": "" }, { "docid": "1c1aa4f42c7c006dfabd9b3ab2c1be16", "score": "0.5649135", "text": "func (l Level) String() string {\n\tif name, ok := LevelNames[l]; ok {\n\t\treturn name\n\t}\n\n\treturn LevelNames[LevelInfo]\n}", "title": "" }, { "docid": "ad5c70de6b22b580c63b0d4bff7e447b", "score": "0.5586536", "text": "func FindLogLevelName(level int32) string {\n\tif level < 0 {\n\t\treturn \"UNDEFINED\"\n\t}\n\tif int(level) > len(logLevelName) {\n\t\treturn fmt.Sprintf(\"%d\", level)\n\t}\n\treturn logLevelName[level]\n}", "title": "" }, { "docid": "6ac812bf9bf48be4363923b473eb646f", "score": "0.5580944", "text": "func (l Level) String() string {\n\treturn string(l)\n}", "title": "" }, { "docid": "0640c99e76d8a9f1da76c8cf1ea5cbfe", "score": "0.55739003", "text": "func (l Level) String() string {\n\tif l < 0 || int(l) > len(levelStrings) {\n\t\treturn \"\"\n\t}\n\t\n\treturn levelStrings[int(l)]\n}", "title": "" }, { "docid": "b3e34338dd0d46b55fba7487842518aa", "score": "0.5528381", "text": "func (o *VirtualizationVmwareSharesInfo) GetLevel() string {\n\tif o == nil || o.Level == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Level\n}", "title": "" }, { "docid": "ffcde79563e28581ce903d01c827467f", "score": "0.5525947", "text": "func (o GetUserHierarchyGroupHierarchyPathLevelFifeOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyGroupHierarchyPathLevelFife) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "fb3814d831a1206141c52e7f16388de5", "score": "0.5523283", "text": "func (w *WordResp) Level() string {\n\tif !w.HasLevel() {\n\t\treturn \"\"\n\t}\n\n\tbuf := new(strings.Builder)\n\tbuf.WriteString(\"Level:\")\n\tfor _, et := range w.EC.ExamType {\n\t\tbuf.WriteString(fmt.Sprintf(\"%s \", et))\n\t}\n\n\treturn buf.String()\n}", "title": "" }, { "docid": "2c120d88b434eba9a78f56ef4a3a72b5", "score": "0.54978335", "text": "func (g *affiliationImpl) GetLevel() int {\n\treturn g.Level\n}", "title": "" }, { "docid": "fb9cd809cc555ce656f9fef0c9212546", "score": "0.5486708", "text": "func (o UserHierarchyGroupOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *UserHierarchyGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4469072179117e98169a42ccaa3a04b9", "score": "0.54828584", "text": "func (c *EnvConfig) Level() string {\n\tcallPtr, _, _, _ := runtime.Caller(0)\n\tvalue := getConfigValueFromEnv(util.NameOfFunction(callPtr))\n\n\treturn value\n}", "title": "" }, { "docid": "b70ccbb22366db3a9f8bca83928d2ac9", "score": "0.54471236", "text": "func (l *Level) GetLevelName() string {\n\treturn string(l.levelData.Get(\"LevelName\").Data().(nbt.String))\n}", "title": "" }, { "docid": "d0966cdebdd3052c532d7d39136983c7", "score": "0.543916", "text": "func getLevelName(level int) string {\n\tswitch level {\n\tcase LevelDebug:\n\t\treturn DebugName\n\tcase LevelInfo:\n\t\treturn InfoName\n\tcase LevelWarn:\n\t\treturn WarnName\n\tcase LevelError:\n\t\treturn ErrorName\n\tcase LevelFatal:\n\t\treturn FatalName\n\tdefault:\n\t\treturn InfoName\n\t}\n}", "title": "" }, { "docid": "666964ada749f3cf11ebad50faf432e3", "score": "0.5418867", "text": "func (th *TabletHealth) GetHostNameLevel(level int) string {\n\thostname := th.Tablet.Hostname\n\tchunkedHostname := strings.Split(hostname, \".\")\n\n\tif level < 0 {\n\t\treturn chunkedHostname[0]\n\t} else if level >= len(chunkedHostname) {\n\t\treturn chunkedHostname[len(chunkedHostname)-1]\n\t} else {\n\t\treturn chunkedHostname[level]\n\t}\n}", "title": "" }, { "docid": "a223f8fd1c5ae2b49c52d440407cb5e1", "score": "0.5418664", "text": "func (o GetUserHierarchyGroupHierarchyPathLevelFourOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyGroupHierarchyPathLevelFour) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "3775d4fa8f515f444c199b600337fc22", "score": "0.5414782", "text": "func (o GetUserHierarchyGroupHierarchyPathLevelThreeOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyGroupHierarchyPathLevelThree) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "659f1e36a19ca2c637f70efe08663528", "score": "0.53933954", "text": "func (o GetUserHierarchyGroupHierarchyPathLevelTwoOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyGroupHierarchyPathLevelTwo) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b789edabaaa254a1080c2721a4a4f96f", "score": "0.53913945", "text": "func (o UserHierarchyGroupHierarchyPathLevelFifeOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v UserHierarchyGroupHierarchyPathLevelFife) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "0890c41c268af94297b7e7a2d9a57f07", "score": "0.538853", "text": "func (l level) Label() string { return Labels[l].String() }", "title": "" }, { "docid": "9673c84c44c1eab8260e467daad1f00b", "score": "0.5387172", "text": "func (l *Level) LevelName(name string) {\n\tl.setOption(\"LevelName\", nbt.String(name))\n}", "title": "" }, { "docid": "4726ce3656a83a9b4c6428a93cd2565e", "score": "0.53868616", "text": "func (m *UnifiedRoleManagementPolicyRuleTarget) GetLevel()(*string) {\n return m.level\n}", "title": "" }, { "docid": "eba12e2980240494ef0b78c785e98d3e", "score": "0.5386542", "text": "func (o UserHierarchyStructureHierarchyStructureLevelFiveOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v UserHierarchyStructureHierarchyStructureLevelFive) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "8660490a79612f2c5de8fb0d749e54fd", "score": "0.5383165", "text": "func (v AccessLevelType) String() string {\n switch v {\n case 0: \n return \"None\"\n case 1: \n return \"CurrentRead\"\n case 2: \n return \"CurrentWrite\"\n case 4: \n return \"HistoryRead\"\n case 8: \n return \"HistoryWrite\"\n case 16: \n return \"SemanticChange\"\n case 32: \n return \"StatusWrite\"\n case 64: \n return \"TimestampWrite\"\n default:\n return \"\"\n }\n}", "title": "" }, { "docid": "5647a047865858ae2546aa0b99681204", "score": "0.53766423", "text": "func UppercaseLevelEncoder() LevelEncoder { return uppercaseLevelEncoder }", "title": "" }, { "docid": "a16c1be23e77360ce59db595b0b53f0f", "score": "0.53661394", "text": "func (level Level) String() string {\n\tnames := [...]string{\n\t\t\"unassigned\",\n\t\t\"debug\",\n\t\t\"error\",\n\t\t\"warning\",\n\t\t\"info\",\n\t}\n\treturn names[level]\n}", "title": "" }, { "docid": "a72873f017500d8a9aa822f59ca009ff", "score": "0.5352725", "text": "func GetLevel() int {\n return defaultLevel.Val()\n}", "title": "" }, { "docid": "759f6a90ebd752983412f58722826c95", "score": "0.53492755", "text": "func LongestLevelLen() int {\n return longestLevelLen\n}", "title": "" }, { "docid": "74d56166ac6c51aa395a41c9e57baa38", "score": "0.5347201", "text": "func LevelS() string {\n\tswitch get() {\n\tcase 0:\n\t\treturn \"None\"\n\tcase 1:\n\t\treturn \"Info\"\n\tcase 2:\n\t\treturn \"More\"\n\tcase 3:\n\t\treturn \"Most\"\n\t}\n\n\treturn \"FixMePlease\"\n}", "title": "" }, { "docid": "4792dabc4c8599aaa23340fe5496dfc8", "score": "0.5344468", "text": "func getLevelRep(level Level) string {\n\treturn representations[level]\n}", "title": "" }, { "docid": "1982051145b2388e25655fc6dde7f8ba", "score": "0.5344034", "text": "func (lvl Level) String() string {\n\tswitch lvl {\n\tcase Panic:\n\t\treturn \"panic\"\n\tcase Fatal:\n\t\treturn \"fatal\"\n\tcase Error:\n\t\treturn \"error\"\n\tcase Warn:\n\t\treturn \"warn\"\n\tcase Info:\n\t\treturn \"info\"\n\tcase Debug:\n\t\treturn \"debug\"\n\t}\n\treturn strconv.Itoa(int(lvl))\n}", "title": "" }, { "docid": "d4419231bab2b14d6ed1e2bbb086bf9b", "score": "0.53373605", "text": "func (a *AdminAuth) LevelPermissions(user users.AdminUser) string {\n\tif user.Admin {\n\t\treturn sessions.AdminLevel\n\t}\n\tperms, err := a.Users.ConvertPermissions(user.Permissions.RawMessage)\n\tif err != nil {\n\t\tlog.Printf(\"error converting permissions %v\", err)\n\t\treturn sessions.UserLevel\n\t}\n\t// Check for query access\n\tif perms.Query {\n\t\treturn sessions.QueryLevel\n\t}\n\t// Check for carve access\n\tif perms.Carve {\n\t\treturn sessions.CarveLevel\n\t}\n\t// At this point, no access granted\n\treturn sessions.UserLevel\n}", "title": "" }, { "docid": "9dde4e2d5c10d2e37eb2b4d9aedd71ff", "score": "0.5325091", "text": "func (l Level) String() string {\n\tif v, ok := levelToString[l]; ok {\n\t\treturn v\n\t}\n\treturn fmt.Sprintf(\"level(%d)\", l)\n}", "title": "" }, { "docid": "3046e5b1fae3d3f9c470cdb5c318444b", "score": "0.53219336", "text": "func (o GetUserHierarchyGroupHierarchyPathLevelOneOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyGroupHierarchyPathLevelOne) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "78ad3784b33707dc487a17e7aae49448", "score": "0.53175706", "text": "func GetLevelOfAccount(username string) int {\n\tvar level = 0\n\terr := DB.QueryRow(`SELECT level FROM account WHERE username=?`, username).Scan(&level)\n\tif(err != nil) {\n\t\tlog.Println(\"error getting level of account in GetLevelOfAccount\")\n\t}\n\n\tlog.Println(level)\n\treturn level\n}", "title": "" }, { "docid": "59c209102043530d9d8560c0df5c88f0", "score": "0.531308", "text": "func (program Program) GetLevel() string {\n\treturn program.level\n}", "title": "" }, { "docid": "fb93f5bce738351b193ad93d056472ec", "score": "0.530673", "text": "func (l Level) String() string {\n\tif val, ok := levelStrings[l]; ok {\n\t\treturn val\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "02cce246f0f15a4259f5a70cf766873d", "score": "0.53056455", "text": "func (o GetUserHierarchyStructureHierarchyStructureLevelFifeOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyStructureHierarchyStructureLevelFife) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "994e43de31fb7660bfcfa1681e741586", "score": "0.52960116", "text": "func nodeLevel(l int) (s string) {\n\tfor i := 0; i < l; i++ {\n\t\ts += \"-\"\n\t}\n\ts += \">\"\n\treturn s\n}", "title": "" }, { "docid": "422f5c46403c5fcb17c3e5f2509301e2", "score": "0.5286602", "text": "func (l Level) String() string {\n\tswitch l {\n\tcase DBG:\n\t\treturn \"[D]\"\n\tcase INF:\n\t\treturn \"[I]\"\n\tcase WRN:\n\t\treturn \"[W]\"\n\tcase ERR:\n\t\treturn \"[E]\"\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "92f3a40c7b73b4f31bb17395cf1b4ebe", "score": "0.52837956", "text": "func (v HeaterLevel) String() string {\n\treturn spew.Sprintf(\"HEATER_LEVEL_%d\", v+1)\n}", "title": "" }, { "docid": "4a595339b63efbd1f040e97032cfde23", "score": "0.5276525", "text": "func (level Level) String() string {\n\t// implements the fmt.Stringer interface\n\tif level > FATAL {\n\t\treturn \"ALWAYS\"\n\t}\n\tif level == UNSET {\n\t\treturn \"UNSET\"\n\t}\n\treturn []string{\"NEVER\", \"TRACE\", \"DEBUG\", \"INFO\", \"WARN\", \"ERROR\", \"FATAL\"}[level/10]\n}", "title": "" }, { "docid": "582804c907743eead27d0712a74dbc58", "score": "0.5244054", "text": "func GenMaxNameLevels(r *rand.Rand) uint32 {\n\treturn uint32(r.Intn(10) + 1)\n}", "title": "" }, { "docid": "67df52611f1e016bac2d373c1e49b267", "score": "0.5233795", "text": "func (logLevel Level) String() (string, error) {\n\tvar result string\n\n\t// Get log level string\n\tvar levelStringObj, found = logLevelNames.Get(logLevel)\n\tif !found {\n\t\treturn result, fmt.Errorf(\"Invalid log level: %d\", logLevel)\n\t}\n\n\t// Cast it to a string\n\tvar ok bool\n\tresult, ok = levelStringObj.(string)\n\tif !ok {\n\t\tPanic(\"Unexpected log level string in log level names map: %s\", levelStringObj)\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "fa6ec5830b2f5ad91aafad33d0938b9b", "score": "0.52324456", "text": "func GetLevel() int {\n\treturn level\n}", "title": "" }, { "docid": "c09a1c38ebf5a54215333ba1589aa5c3", "score": "0.5228969", "text": "func (p Package) uniqueName(lvl int) string {\n\tpp := strings.Split(p.Path(), \"/\")\n\treverse(pp)\n\n\tvar name string\n\tfor i := 0; i < min(len(pp), lvl+1); i++ {\n\t\tname = strings.ToLower(replacer.Replace(pp[i])) + name\n\t}\n\n\treturn name\n}", "title": "" }, { "docid": "6c2e0936e87cb0de7a9636c346f86e60", "score": "0.5225411", "text": "func (l *Config) GetLevel() string {\n\tif l.Level == \"\" {\n\t\treturn defaultLevel\n\t}\n\n\treturn l.Level\n}", "title": "" }, { "docid": "066c959e65d642c6d7b5993084ef751a", "score": "0.51961976", "text": "func (o UserHierarchyStructureHierarchyStructureLevelFourOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v UserHierarchyStructureHierarchyStructureLevelFour) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4efde4492312545c9992b74dfe5c737f", "score": "0.51769245", "text": "func (o UserHierarchyStructureHierarchyStructureLevelTwoOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v UserHierarchyStructureHierarchyStructureLevelTwo) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "acb1f0b5b3138b9f99ee71e76e721f8d", "score": "0.5176096", "text": "func LevelText(level int) string {\n\treturn levelText[level]\n}", "title": "" }, { "docid": "a804521d3ba8d70adff67df761e6c9f1", "score": "0.5172479", "text": "func (o UserHierarchyStructureHierarchyStructureLevelThreeOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v UserHierarchyStructureHierarchyStructureLevelThree) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "14e1cc6e32a9005f6c8e322380c01e4c", "score": "0.5168947", "text": "func GetLevelStr(level Level) string {\n\tvar levelStr string\n\tswitch level {\n\tcase LEVEL_DEBUG:\n\t\tlevelStr = \"DEBUG\"\n\tcase LEVEL_INFO:\n\t\tlevelStr = \"INFO\"\n\tcase LEVEL_WARN:\n\t\tlevelStr = \"WARN\"\n\tcase LEVEL_ERROR:\n\t\tlevelStr = \"ERROR\"\n\tcase LEVEL_FATAL:\n\t\tlevelStr = \"FATAL\"\n\tdefault:\n\t\tlevelStr = \"UNKNOWN\"\n\t}\n\treturn levelStr\n}", "title": "" }, { "docid": "003c33991f4016d8b091f93147737d86", "score": "0.51555955", "text": "func (l Level) String() string {\n\tswitch l {\n\tdefault:\n\t\tfallthrough\n\tcase L_fatal:\n\t\treturn \"Fatal\"\n\tcase L_alert:\n\t\treturn \"Alert\"\n\tcase L_critical:\n\t\treturn \"Critical\"\n\tcase L_error:\n\t\treturn \"Error\"\n\tcase L_warning:\n\t\treturn \"Warning\"\n\tcase L_notice:\n\t\treturn \"Notice\"\n\tcase L_info:\n\t\treturn \"Info\"\n\tcase L_debug:\n\t\treturn \"Debug\"\n\t}\n}", "title": "" }, { "docid": "fb93a9635c716471d249e17561d15893", "score": "0.5154807", "text": "func (l Level) String() string {\n\tswitch l {\n\tcase FATAL:\n\t\treturn \"FATAL\"\n\tcase DEBUG:\n\t\treturn \"DEBUG\"\n\tcase WARNING:\n\t\treturn \"WARNING\"\n\tcase ERROR:\n\t\treturn \"ERROR\"\n\tcase INFO:\n\t\treturn \"INFO\"\n\t}\n\treturn \"UNKNOWN\"\n}", "title": "" }, { "docid": "0935c67f912eb44ff548da28c13ac987", "score": "0.5145764", "text": "func Level(sensor string, value float64) string {\n\tif IsMeasuredSensor(sensor) {\n\t\tif sensor == \"AIR_PM2P5\" {\n\t\t\treturn PM25Level(value)\n\t\t}\n\t\tif sensor == \"AIR_PM10\" {\n\t\t\treturn PM10Level(value)\n\t\t}\n\t}\n\n\treturn \"Great\"\n}", "title": "" }, { "docid": "a462c75c25f9c81f9fa227485d010748", "score": "0.51449174", "text": "func (o UserHierarchyStructureHierarchyStructureLevelOneOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v UserHierarchyStructureHierarchyStructureLevelOne) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "baf8509d001d38a77fa8b09633bd3f5f", "score": "0.5142805", "text": "func (o GetUserHierarchyStructureHierarchyStructureLevelFourOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyStructureHierarchyStructureLevelFour) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "6cd49445a1685ea11699aaadbdb29b27", "score": "0.5141325", "text": "func (s *L0SubLevels) String() string {\n\treturn s.describe(false)\n}", "title": "" }, { "docid": "7f61274d0c9922fe0ef79c90a65e8b1f", "score": "0.51398706", "text": "func (o UserHierarchyGroupHierarchyPathLevelOneOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v UserHierarchyGroupHierarchyPathLevelOne) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "eea9389b514fe0e170fbc37e6751e3d0", "score": "0.5136296", "text": "func (o UserHierarchyGroupHierarchyPathLevelTwoOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v UserHierarchyGroupHierarchyPathLevelTwo) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "3a787fc519a06133fec2f3e40f23a987", "score": "0.51351833", "text": "func (o UserHierarchyGroupHierarchyPathLevelThreeOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v UserHierarchyGroupHierarchyPathLevelThree) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "b27b8928e0addbe67d7bd3f8a5616106", "score": "0.511983", "text": "func PathLevel(path string, level ...uint) (subpath string) {\n\tlvl := 1\n\tif len(level) > 0 {\n\t\tlvl = int(level[0])\n\t}\n\tif path == \"\" {\n\t\treturn path\n\t}\n\t// On Windows filepath.Separator may not be that returned by runtime.Caller()\n\t// This is the case under GitBash at least so leaning towards '/'.\n\tsepr := '\\\\'\n\tif os.IsPathSeparator('/') { // If any O/S says this is legit, use it\n\t\tsepr = '/'\n\t}\n\tseparator := fmt.Sprintf(\"%c\", sepr)\n\ttokens := strings.Split(path, separator)\n\tln := len(tokens)\n\tif ln <= 1 {\n\t\t//fmt.Println(\"path not split\")\n\t\treturn path\n\t}\n\n\tidx := len(tokens) - int(lvl) - 1\n\tif idx < 0 {\n\t\tidx = 0\n\t}\n\treturn strings.Join(tokens[idx:], separator)\n}", "title": "" }, { "docid": "fbc9ebe9e5a89e83450cacd23beb4089", "score": "0.5117522", "text": "func (level Level) String() string {\n\tif b, err := level.MarshalText(); err == nil {\n\t\treturn string(b)\n\t} else {\n\t\treturn \"unknown\"\n\t}\n}", "title": "" }, { "docid": "a34c0a67b1369c45ea50054fd3869ea2", "score": "0.5115697", "text": "func (o *AuditLogMessage) GetLevel() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Level\n}", "title": "" }, { "docid": "10b9b29cd3750b6059bd79cd2bf87113", "score": "0.51083213", "text": "func (o GetUserHierarchyStructureHierarchyStructureLevelTwoOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyStructureHierarchyStructureLevelTwo) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "5a162b49f7fe5309c64c48913dfa9e87", "score": "0.51074475", "text": "func LevelListString() []string {\n\treturn levelString\n}", "title": "" }, { "docid": "cfa0192fee0579b12b2875b0e209698f", "score": "0.5105903", "text": "func (o GetUserHierarchyStructureHierarchyStructureLevelThreeOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyStructureHierarchyStructureLevelThree) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "e2d0b215ec7d5cc3e30a666ed3d26f8a", "score": "0.51030946", "text": "func (o UserHierarchyGroupHierarchyPathLevelFourOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v UserHierarchyGroupHierarchyPathLevelFour) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f228914019266cdcb3b19cfa84134bc2", "score": "0.5090555", "text": "func (lvl Level) String() string {\n\tswitch lvl {\n\tcase LvlDebug:\n\t\treturn \"DEBUG\"\n\tcase LvlInfo:\n\t\treturn \"INFO\"\n\tcase LvlWarning:\n\t\treturn \"WARN\"\n\tcase LvlError:\n\t\treturn \"ERROR\"\n\t}\n\tpanic(fmt.Errorf(\"fwk.Level: invalid fwk.Level value [%d]\", int(lvl)))\n}", "title": "" }, { "docid": "b4f0f4180e61a24563b96d43bc466b7f", "score": "0.50830597", "text": "func (nd Node) Level() int {\n\treturn int(nd.level)\n}", "title": "" }, { "docid": "88f45a342af72ec15562780f9e507f49", "score": "0.5079941", "text": "func (o SELinuxOptionsPtrOutput) Level() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *SELinuxOptions) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Level\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "a5cb2ea02c3b29f79f7af098fe2ab046", "score": "0.50667584", "text": "func (o GetUserHierarchyStructureHierarchyStructureLevelOneOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetUserHierarchyStructureHierarchyStructureLevelOne) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "f0d337366f79d8ae5a2b28e9d142347d", "score": "0.50498873", "text": "func (u *UnsignedEndorsement) GetLevel() int32 { return u.Level }", "title": "" }, { "docid": "564648fa5a75907eb33b1ad13fd37f09", "score": "0.5046743", "text": "func LevelText(l Level) string {\n\treturn levelText[l]\n}", "title": "" }, { "docid": "08ac6663cda732e60917e2098a175f5e", "score": "0.50392455", "text": "func (o SELinuxOptionsOutput) Level() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v SELinuxOptions) *string { return v.Level }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "6147e39c68dbf6d90fa34f8b80ef8f46", "score": "0.5031246", "text": "func (lvl level) String() string {\n\tswitch lvl {\n\tcase TRACE:\n\t\treturn \"TRACE\"\n\tcase DEBUG:\n\t\treturn \"DEBUG\"\n\tcase INFO:\n\t\treturn \"INFO\"\n\tcase WARNING:\n\t\treturn \"WARNING\"\n\tcase ERROR:\n\t\treturn \"ERROR\"\n\tcase CRITICAL:\n\t\treturn \"CRITICAL\"\n\tdefault:\n\t\treturn errUnknownLogLevel\n\t}\n}", "title": "" }, { "docid": "28b5af9a7c0c663ec9ec4ca418b013ae", "score": "0.503069", "text": "func numLevels(reldir string) (lv int) {\n\tif len(reldir) > 0 {\n\t\tlv = 1 + strings.Count(reldir, \"/\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "673446f2d51ddc44af13e651319425e2", "score": "0.50293547", "text": "func ParseLevel(level string) Level {\n\tlevel = strings.ToUpper(strings.TrimSpace(level))\n\tfor l := levelMin; l <= levelMax; l++ {\n\t\tif level == l.String() {\n\t\t\treturn l\n\t\t}\n\t}\n\n\treturn LevelInfo\n}", "title": "" }, { "docid": "2e31e6db26916fe9fad620791c8c40c5", "score": "0.5021128", "text": "func GetLevel(module string) Level {\n\treturn defaultBackend.GetLevel(module)\n}", "title": "" }, { "docid": "aaf01027c51258b85c00a5078bd0ced5", "score": "0.501328", "text": "func (u DBUser) level() int8 {\n\treturn u.F_level\n}", "title": "" }, { "docid": "7ed0c4f7aad2bc5339fc7d783b5f1bd4", "score": "0.5007177", "text": "func Level(s string) log.Lvl {\n\ts = strings.ToLower(s) // ignore case\n\tl, err := log.LvlFromString(s)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Could not parse log level: %v\", err))\n\t}\n\treturn l\n}", "title": "" }, { "docid": "b8da4ca12234916b3484e25e9927411b", "score": "0.49922577", "text": "func GetLevel() Level {\n\treturn level\n}", "title": "" }, { "docid": "6ae889537b9f1a9f68613daadb2b702c", "score": "0.49904612", "text": "func (v DiagnosticsLevel) String() string {\n switch v {\n case 0: \n return \"Basic\"\n case 1: \n return \"Advanced\"\n case 2: \n return \"Info\"\n case 3: \n return \"Log\"\n case 4: \n return \"Debug\"\n default:\n return \"\"\n }\n}", "title": "" }, { "docid": "637345c0d4a5da3859818f6947786674", "score": "0.49901175", "text": "func (qs UsersQuerySet) LevelLte(level int) UsersQuerySet {\n\treturn qs.w(qs.db.Where(\"level <= ?\", level))\n}", "title": "" }, { "docid": "107ba98c53e0d7b9cf3d87618d3e5586", "score": "0.4983929", "text": "func UserName() string {\n\tgender := randGender()\n\tswitch r.Intn(3) {\n\tcase 0:\n\t\treturn lookup(\"en\", gender+\"_first_names\", false) + lookup(lang, gender+\"_last_names\", false)\n\tcase 1:\n\t\treturn Character() + lookup(lang, gender+\"_last_names\", false)\n\tdefault:\n\t\treturn strings.Replace(WordsN(r.Intn(3)+1), \" \", \"_\", -1)\n\t}\n}", "title": "" }, { "docid": "a096827890506f50ce0caf3b38ebc6e5", "score": "0.49796322", "text": "func StringLevelOrder(T *Tree) string {\n\tlist := WalkLevelOrder(T)\n\t// fmt.Println(list.Len())\n\ts := \"\"\n\tfor elem := list.Front(); elem != nil; elem = elem.Next() {\n\t\ts += fmt.Sprintf(\"%v \", elem.Value.(*Tree).Value)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "facbda22861602ba76641006dfccdc25", "score": "0.4978106", "text": "func levelToString(l Level) string {\n\tswitch l {\n\tcase DebugLevel:\n\t\treturn \"debug\"\n\tcase InfoLevel:\n\t\treturn \"info\"\n\tcase WarnLevel:\n\t\treturn \"warn\"\n\tcase ErrorLevel:\n\t\treturn \"error\"\n\tcase FatalLevel:\n\t\treturn \"fatal\"\n\tdefault:\n\t\treturn \"info\"\n\t}\n}", "title": "" }, { "docid": "7482005145d3fb5aaffd9e0eedbebc02", "score": "0.4975353", "text": "func (level Level) String() string {\n\tswitch level {\n\tcase OFF:\n\t\treturn \"OFF\"\n\tcase FATAL:\n\t\treturn \"FATAL\"\n\tcase PANIC:\n\t\treturn \"PANIC\"\n\tcase ERROR:\n\t\treturn \"ERROR\"\n\tcase WARN:\n\t\treturn \"WARN\"\n\tcase INFO:\n\t\treturn \"INFO\"\n\tcase DEBUG:\n\t\treturn \"DEBUG\"\n\tdefault:\n\t\treturn \"UNKNOWN\"\n\t}\n}", "title": "" }, { "docid": "f57a37aab3320c1829337411b554a507", "score": "0.49714243", "text": "func GetLevel(name string) Level {\n\tv := levels.Get(name)\n\tif v == nil {\n\t\treturn Level(-1)\n\t}\n\treturn v.(Level)\n}", "title": "" }, { "docid": "47cb918e9aa5f772a8056fbb6f5a8b3c", "score": "0.49684176", "text": "func (l level) String() string {\n\tswitch l.Lvl {\n\tcase log15.LvlDebug:\n\t\treturn \"debug\"\n\tcase log15.LvlInfo:\n\t\treturn \"info\"\n\tcase log15.LvlWarn:\n\t\treturn \"warn\"\n\tcase log15.LvlCrit:\n\t\tfallthrough\n\tcase log15.LvlError:\n\t\treturn \"error\"\n\tdefault:\n\t\treturn \"bad\"\n\t}\n}", "title": "" } ]
064e959dcc8abb38608cacc2851b0e5b
PrintUndefined print undefined content type
[ { "docid": "8ea1810bca395246762238dd8060f3dd", "score": "0.85020363", "text": "func PrintUndefined() {\n\tfmt.Println()\n\tfmt.Println(\" |-------------------------------------|\")\n\tfmt.Println(\" | Undefined Content-Type |\")\n\tfmt.Println(\" |-------------------------------------|\")\n}", "title": "" } ]
[ { "docid": "76e1247a9ad3ecead9bc05db7fe61846", "score": "0.6297482", "text": "func Print(w http.ResponseWriter, status int, ctype string, content []byte) {\n\tif ctype != \"\" {\n\t\tw.Header().Set(\"Content-Type\", ctype)\n\t}\n\n\tw.WriteHeader(status)\n\tw.Write(content)\n}", "title": "" }, { "docid": "333e1464999acaf37cf68cecb2352444", "score": "0.6036719", "text": "func (m Undefined) String() string {\n\treturn fmt.Sprintf(\"%T type: % X\", m, m.Typ)\n}", "title": "" }, { "docid": "b02091f0cfc270ba178c463c5e64f493", "score": "0.582055", "text": "func (h *HumanReadablePrinter) Print(data []byte, output io.Writer) error {\n\tvar mapObj map[string]interface{}\n\tif err := json.Unmarshal([]byte(data), &mapObj); err != nil {\n\t\treturn err\n\t}\n\n\tif _, contains := mapObj[\"kind\"]; !contains {\n\t\treturn fmt.Errorf(\"unexpected object with no 'kind' field: %s\", data)\n\t}\n\n\tobj, err := api.Decode(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn h.PrintObj(obj, output)\n}", "title": "" }, { "docid": "57d7e4a58889e3eb6d1a54c1d9edff4f", "score": "0.5630187", "text": "func Print(v Type) string {\n\tbuf := bytes.NewBufferString(\"\")\n\tv.TypeName().Render(buf)\n\treturn buf.String()\n}", "title": "" }, { "docid": "28ec92e344bbf7295ea4110d883d5710", "score": "0.55722004", "text": "func dump(ctx *gin.Context) {\n\tvar content string\n\n\tcontentType, _, err := mime.ParseMediaType(ctx.Request.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\t//ctx.AbortWithError(http.StatusBadRequest, err)\n\t\tctx.Next()\n\t}\n\n\tswitch contentType {\n\tcase gin.MIMEJSON:\n\t\tif data, err := ioutil.ReadAll(ctx.Request.Body); err != nil {\n\t\t\tctx.AbortWithError(http.StatusBadRequest, err)\n\t\t} else {\n\t\t\tbuff := bytes.NewBuffer(nil)\n\t\t\terr := json.Indent(buff, []byte(data), \"\", \" \")\n\t\t\tif err != nil {\n\t\t\t\tcontent = string(data)\n\t\t\t} else {\n\t\t\t\tcontent = buff.String()\n\t\t\t}\n\n\t\t\t// 此处很重要,否则后面处理请求的函数无法读取到Body数据\n\t\t\tctx.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))\n\t\t}\n\tcase gin.MIMEXML:\n\t\tfallthrough\n\tcase gin.MIMEXML2:\n\t\t{\n\t\t\tif data, err := ioutil.ReadAll(ctx.Request.Body); err != nil {\n\t\t\t\tctx.AbortWithError(http.StatusBadRequest, err)\n\t\t\t} else {\n\t\t\t\tcontent = uxml.FormatXML(string(data), \"\", \"\t\")\n\t\t\t\t// 此处很重要,否则后面处理请求的函数无法读取到Body数据\n\t\t\t\tctx.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))\n\t\t\t}\n\t\t}\n\tcase gin.MIMEPOSTForm:\n\t\t{\n\t\t\tif data, err := ioutil.ReadAll(ctx.Request.Body); err != nil {\n\t\t\t\tctx.AbortWithError(http.StatusBadRequest, err)\n\t\t\t} else {\n\t\t\t\t// TODO\n\t\t\t\tcontent = string(data)\n\t\t\t\t// 此处很重要,否则后面处理请求的函数无法读取到Body数据\n\t\t\t\tctx.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))\n\t\t\t}\n\n\t\t}\n\tcase gin.MIMEMultipartPOSTForm:\n\t\t{\n\t\t\t// 多重表單中可能包含二進制文件,暫時先不處理\n\t\t\t// TODO\n\t\t}\n\tcase gin.MIMEPlain:\n\t\t{\n\t\t\tif data, err := ioutil.ReadAll(ctx.Request.Body); err != nil {\n\t\t\t\tctx.AbortWithError(http.StatusBadRequest, err)\n\t\t\t} else {\n\t\t\t\t// TODO\n\t\t\t\tcontent = string(data)\n\t\t\t\t// 此处很重要,否则后面处理请求的函数无法读取到Body数据\n\t\t\t\tctx.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))\n\t\t\t}\n\t\t}\n\tcase gin.MIMEYAML:\n\t\t{\n\t\t\tif data, err := ioutil.ReadAll(ctx.Request.Body); err != nil {\n\t\t\t\tctx.AbortWithError(http.StatusBadRequest, err)\n\t\t\t} else {\n\t\t\t\t// TODO\n\t\t\t\tcontent = string(data)\n\t\t\t\t// 此处很重要,否则后面处理请求的函数无法读取到Body数据\n\t\t\t\tctx.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))\n\t\t\t}\n\t\t}\n\tcase gin.MIMEHTML:\n\t\t{\n\t\t\tif data, err := ioutil.ReadAll(ctx.Request.Body); err != nil {\n\t\t\t\tctx.AbortWithError(http.StatusBadRequest, err)\n\t\t\t} else {\n\t\t\t\t// TODO\n\t\t\t\tcontent = string(data)\n\t\t\t\t// 此处很重要,否则后面处理请求的函数无法读取到Body数据\n\t\t\t\tctx.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))\n\t\t\t}\n\t\t}\n\tdefault:\n\t}\n\n\tctx.Request.Header.Set(Content, content)\n}", "title": "" }, { "docid": "8efda673f417dd05e92d377b3d5ec79b", "score": "0.54860127", "text": "func PrintDump(w http.ResponseWriter, r *http.Request, write bool) {\n\tdump, _ := httputil.DumpRequest(r, true)\n\tlog.Printf(\"%v\", string(dump))\n\tif write == true {\n\t\tw.Write(dump)\n\t}\n}", "title": "" }, { "docid": "cb3c283378c389446d4177c968980dab", "score": "0.54091483", "text": "func (res Result) Print() {\n\tswitch {\n\tcase res.status == http.StatusNotFound && !*verbose:\n\t\treturn\n\n\tcase res.err != nil:\n\t\treturn\n\n\tcase res.status < 200:\n\t\ty.Printf(\"%-3d %-9d %s\\n\", res.status, res.size, res.url)\n\n\tcase res.status >= 400 && res.status < 500:\n\t\tr.Printf(\"%-3d %-9d %s\\n\", res.status, res.size, res.url)\n\n\tcase res.status >= 300 && res.status < 400:\n\t\tb.Printf(\"%-3d %-9d %s -> %s\\n\", res.status, res.size, res.url, res.location)\n\n\tcase res.status >= 200 && res.status < 300:\n\t\tg.Printf(\"%-3d %-9d %s\\n\", res.status, res.size, res.url)\n\n\tcase res.status >= 500:\n\t\tn.Printf(\"%-3d %-9d %s\\n\", res.status, res.size, res.url)\n\t}\n}", "title": "" }, { "docid": "ce15e56941a3c547b17f63a0348a1b89", "score": "0.5403652", "text": "func handlePrint(r *Request) (interface{}, error) {\n\treturn fmt.Print(r.Args.One().MustString())\n}", "title": "" }, { "docid": "39fb35225d95173aa37ab978858c53df", "score": "0.53907067", "text": "func (me TContentTypeType) String() string { return xsdt.String(me).String() }", "title": "" }, { "docid": "90e64d7d1483a9162650543212b59656", "score": "0.5365673", "text": "func (p IntegralFormalParam) Print() string {\n\t// TODO not sure how to do this one\n\tif p.Type == \"__int128\" {\n\t\treturn \"\"\n\t}\n\t// TODO we will want custom printing based on the type here\n\treturn \"std::cout << \\\"\" + p.Name + \"\\\" << \" + p.Reference() + \" << std::endl;\"\n}", "title": "" }, { "docid": "ca77ff5addc96ed456b748bca368a005", "score": "0.52435464", "text": "func (f *Pretty) Undefined(pickle *messages.Pickle, step *messages.PickleStep, match *formatters.StepDefinition) {\n\tf.Base.Undefined(pickle, step, match)\n\n\tf.Lock.Lock()\n\tdefer f.Lock.Unlock()\n\n\tf.printStep(pickle, step)\n}", "title": "" }, { "docid": "dd62954bc95013df9e0e9b5a3236d9e8", "score": "0.52416563", "text": "func (kind Kind) Print() string {\n\treturn command.Print(kind)\n}", "title": "" }, { "docid": "539a44366b8c7c2264388b165f84fbe8", "score": "0.5201288", "text": "func (t *TemplatePrinter) Print(data []byte, w io.Writer) error {\n\tobj, err := api.Decode(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn t.PrintObj(obj, w)\n}", "title": "" }, { "docid": "9e59424466a1486c4f91b652ede23fe4", "score": "0.51908517", "text": "func PrintMaybe(m string, err error) {\n\tif err != nil {\n\t\tfmt.Println(m, err)\n\t}\n}", "title": "" }, { "docid": "c56413551e5eda3c0e78f421f360a703", "score": "0.5185431", "text": "func (c ContentType) String() string {\n\treturn fmt.Sprintf(\"%s(%d)\", c.getDesc(), c)\n}", "title": "" }, { "docid": "30fff4512a91c1ef80c69eb0e4cd453d", "score": "0.5153691", "text": "func printUnstructured(unstructured runtime.Unstructured, w io.Writer, options PrintOptions) error {\n\tmetadata, err := meta.Accessor(unstructured)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif options.WithNamespace {\n\t\tif _, err := fmt.Fprintf(w, \"%s\\t\", metadata.GetNamespace()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tcontent := unstructured.UnstructuredContent()\n\tkind := \"<missing>\"\n\tif objKind, ok := content[\"kind\"]; ok {\n\t\tif str, ok := objKind.(string); ok {\n\t\t\tkind = str\n\t\t}\n\t}\n\tif objAPIVersion, ok := content[\"apiVersion\"]; ok {\n\t\tif str, ok := objAPIVersion.(string); ok {\n\t\t\tversion, err := schema.ParseGroupVersion(str)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tkind = kind + \".\" + version.Version + \".\" + version.Group\n\t\t}\n\t}\n\tname := formatResourceName(options.Kind, metadata.GetName(), options.WithKind)\n\n\tif _, err := fmt.Fprintf(w, \"%s\\t%s\", name, kind); err != nil {\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprint(w, appendLabels(metadata.GetLabels(), options.ColumnLabels)); err != nil {\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprint(w, appendAllLabels(options.ShowLabels, metadata.GetLabels())); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d3a3fa2eadb94a3590211540bbb9896c", "score": "0.513749", "text": "func (j *JSONData) Print() {\n\tif j.value != nil {\n\t\tfmt.Printf(\"json: %T %#[1]v\\n\", *j.value)\n\t} else {\n\t\tfmt.Println(\"json: nil\")\n\t}\n}", "title": "" }, { "docid": "98c1d962b8e62a0e987adb0a78052e08", "score": "0.5115241", "text": "func displayHandler(w http.ResponseWriter, r *http.Request) {\n\t\n var s string\n bs,er := ioutil.ReadAll(r.Body)\n if er != nil{\n log.Println(er)\n http.Error(w,\"Error \",http.StatusInternalServerError)\n return\n }\n s = string(bs)\n res:=display_dictionary(s)\n mySlice := []byte(res)\n w.Write(mySlice)\n}", "title": "" }, { "docid": "9e541a4238ad93597152a1ba150536e4", "score": "0.5105069", "text": "func (w *Web) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(w, a...)\n}", "title": "" }, { "docid": "df202e368f1c099c896f80fe45196392", "score": "0.50930643", "text": "func (o *Memory) Print() {\n\tif o.URI != nil {\n\t\tlog.Info(\"URI = %#v\\n\", *o.URI)\n\t} else {\n\t\tlog.Info(\"URI = nil\\n\")\n\t}\n\tif o.PhysicalState != nil {\n\t\tlog.Info(\"PhysicalState = %#v\\n\", *o.PhysicalState)\n\t} else {\n\t\tlog.Info(\"PhysicalState = nil\\n\")\n\t}\n\tif o.Manufacturer != nil {\n\t\tlog.Info(\"Manufacturer = %#v\\n\", *o.Manufacturer)\n\t} else {\n\t\tlog.Info(\"Manufacturer = nil\\n\")\n\t}\n\tif o.MemoryLocation != nil {\n\t\tif o.MemoryLocation.Socket != nil {\n\t\t\tlog.Info(\"MemoryLocation.Socket = %#v\\n\", *o.MemoryLocation.Socket)\n\t\t} else {\n\t\t\tlog.Info(\"MemoryLocation.Socket = nil\\n\")\n\t\t}\n\t} else {\n\t\tlog.Info(\"MemoryLocation = nil\\n\")\n\t}\n\n}", "title": "" }, { "docid": "89d68f2df03a216f84d02596e3a75b3a", "score": "0.5085941", "text": "func notFound(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"text/plain; charset=UTF-8\")\n\tw.WriteHeader(http.StatusNotFound)\n\tfmt.Fprintf(w, \"%d Not Found\\n\", http.StatusNotFound)\n}", "title": "" }, { "docid": "aeae1696c07c20175f7daf372e5a75d6", "score": "0.5085514", "text": "func (context *Context) Print(depth int) {\n\tif context == nil {\n\t\tglog.Fatal()\n\t}\n\n\tfmt.Println(indents[depth], context.TypeSpec.Name)\n\tcontext.PrintType(depth+1, context.TypeSpec.Type)\n}", "title": "" }, { "docid": "c7c048a5feb8ea6871e06e7294d54393", "score": "0.50835776", "text": "func (r *Report) Print() error {\n\tdata, err := r.getJSON()\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\tfmt.Println(string(data))\n\n\tif r.hasErrors {\n\t\treturn errors.New(\"tests failed\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d0fe9f8126832d4a691667d89d231b36", "score": "0.50824106", "text": "func print(s string) {\n\tb := []byte(s)\n\text_print_utf8(&b[0], uint32(len(b)))\n}", "title": "" }, { "docid": "f553bd21d76cc77c7042c26dd200cfb3", "score": "0.5069944", "text": "func (w *updateArticleInlineTypeResponseWriter) NoContent() {\n\tw.Header().Set(\"Content-Type\", \"application/vnd.api+json\")\n\tw.WriteHeader(204)\n}", "title": "" }, { "docid": "0b78dd317d099e31f11812eee6f910da", "score": "0.50671333", "text": "func (logger nullLogger) Print(v ...interface{}) {}", "title": "" }, { "docid": "8ba9033abcbfcceb150d0ea41c056c93", "score": "0.50594103", "text": "func Print(obj *python.PyObject) {\n\tfmt.Println(python.PyUnicode_AsUTF8(obj.Str()))\n}", "title": "" }, { "docid": "535b78339bf724f35c0ef16d8eba4069", "score": "0.50590366", "text": "func (d *RemovalDiffer) Print(p Printer, w io.Writer) error {\n\tbuf, err := yaml.Marshal(d.Object)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts := Subject{\n\t\tA: string(buf),\n\t\tFromFile: d.Name,\n\t}\n\n\treturn p.Print(s, w)\n}", "title": "" }, { "docid": "f1c55bbededc311146315dd3f49eebcf", "score": "0.50474495", "text": "func (me TnoderoleCategoryType) IsPrint() bool { return me.String() == \"print\" }", "title": "" }, { "docid": "41ee5c1f1960bfc3fcc316ac0badcaaf", "score": "0.5029278", "text": "func OKWithoutContent(w http.ResponseWriter) {\n\t// We need to set Content-Type here, cause we can not do it after WriteHeader\n\tw.Header().Set(\"Content-Type\", contentTypeJSON)\n\tw.WriteHeader(204)\n}", "title": "" }, { "docid": "4acec7e3c60dbf7d83436606382d16b2", "score": "0.50199354", "text": "func PrintOutputWithType(data interface{}, outputType string) error {\n\tif outputType == \"json\" {\n\t\treturn dumpJSON(data, \"\")\n\t}\n\n\tif outputType == \"yaml\" {\n\t\treturn dumpYAML(data)\n\t}\n\n\tif re.MatchString(outputType) {\n\t\treturn dumpJSON(data, re.ReplaceAllString(outputType, \"$1\"))\n\t}\n\n\treturn fmt.Errorf(\"couldn't find output printer\")\n}", "title": "" }, { "docid": "23ba4329c5023261138c4d4677e5c986", "score": "0.50176245", "text": "func print(env Env, data []byte) {\n\tfmt.Println(string(data))\n}", "title": "" }, { "docid": "c43aa319da34d28e16686cf711c162bf", "score": "0.49981582", "text": "func (tpe Type) String() string { return string(tpe) }", "title": "" }, { "docid": "9b853a1a9bae85aafc730ea905f4f5cd", "score": "0.49933392", "text": "func Print(any ...interface{}) {\n\tTfprint(asIs, os.Stdout, any...)\n}", "title": "" }, { "docid": "92806475b89949bdc2ba7523b8addca6", "score": "0.49924687", "text": "func Default404(w ResponseBuffer , r *RequestBuffer) {\n\tfmt.Fprint(w,\"Page not found\")\n}", "title": "" }, { "docid": "60abab0c5e497eda51ee9dccebe6d3df", "score": "0.49897057", "text": "func printUnknown(text string) {\n\tfmt.Println(text, \": command not found\")\n}", "title": "" }, { "docid": "49118da43f87fad477541eb35e53a3d3", "score": "0.49843267", "text": "func emptyHandler(w http.ResponseWriter, r *http.Request) {\n\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tfmt.Fprintf(w, \"Nothing to see here. Move along please\\n\")\n}", "title": "" }, { "docid": "d1bb058fb703db276bbbf7fd97bf8183", "score": "0.49800602", "text": "func (vf vFile) print(modified bool) {\n\tfmt.Println(\"********************** \", vf.name, \" ********************\")\n\tfmt.Println(\"Path : \", vf.path)\n\tfmt.Println(\"Content : \")\n\tif !modified {\n\t\tfmt.Println(vf.content)\n\t} else {\n\t\tfmt.Println(vf.uContent)\n\t}\n}", "title": "" }, { "docid": "24414003b9b43f5adac1af83ae49173f", "score": "0.49794737", "text": "func unknownAction(w http.ResponseWriter, r *http.Request) {\n\tlog.Infof(\"Unknown HTTP request %s %q\", r.Method, r.URL.Path)\n\tlog.Infof(\"HTTP request headers %+v, URL: %+v\", r, r.URL)\n\n\tcontent, _ := ioutil.ReadAll(r.Body)\n\tlog.Infof(\"Body content: %s\", string(content))\n\tw.WriteHeader(http.StatusServiceUnavailable)\n}", "title": "" }, { "docid": "c973c6ff018e4094c9ceee4435d9a456", "score": "0.49595347", "text": "func Print(x interface{}) (err error) {\n\tp := &printer{\n\t\toutput: bufio.NewWriter(os.Stdout),\n\t\tfilter: NotNilFilter,\n\t}\n\tdefer p.output.Flush()\n\tif x == nil {\n\t\tp.printf(\"nil\\n\")\n\t\treturn\n\t}\n\n\tdefer func() {\n\t\tif e := recover(); e != nil {\n\t\t\terr = e.(localError).err\n\t\t}\n\t}()\n\n\tp.print(reflect.ValueOf(x))\n\tp.printf(\"\\n\")\n\n\treturn\n}", "title": "" }, { "docid": "d342711395adfbcbd301ed379c48b2f4", "score": "0.49588048", "text": "func print (m Message) {\n\tfmt.Println(m.txt)\n}", "title": "" }, { "docid": "fbf33c55d1ed3498f3c146611a7e2708", "score": "0.49467817", "text": "func PrintCGI() {\n contentString := strings.TrimSpace(contentBuffer.String())\n if statusHeader != \"\" {\n appendHeader(statusHeader)\n }\n if locationHeader != \"\" {\n appendHeader(locationHeader)\n }\n appendHeader(fmt.Sprintf(\"Content-Length: %d\\n\", len(contentString)))\n headerString := strings.Join(headers, \"\\n\")\n writer := bufio.NewWriter(os.Stdout)\n writer.WriteString(headerString)\n writer.WriteString(\"\\n\")\n writer.WriteString(contentString)\n writer.WriteString(\"\\n\")\n writer.Flush()\n}", "title": "" }, { "docid": "18f693d49b920a9b38d9c431c656b2a3", "score": "0.49392426", "text": "func DummyHandler(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(501)\n\tw.Write([]byte(\"501 Not Implemented\\n\"))\n\tfmt.Fprintf(w, \"%s?%s\\n%#v\", r.URL.Path, r.URL.RawQuery, mux.Vars(r))\n}", "title": "" }, { "docid": "cea0bc53ad3f69cd6e2c322b7e8b6159", "score": "0.49360618", "text": "func (t APIType) String() string {\n\treturn string(t)\n}", "title": "" }, { "docid": "4a4b0b80a1b552c04496e60d2efae2a6", "score": "0.49284142", "text": "func (c Printer) Print() (string, error) {\n\treturn fmt.Sprint(c.content), nil\n}", "title": "" }, { "docid": "6f4db38471504ccdf9a2c7c1166bac9a", "score": "0.49052113", "text": "func (s Stream) Print() error {\n\n\ts.Stream = strings.TrimSpace(s.Stream)\n\tif strings.Contains(s.Stream, \"Step\") {\n\t\tfmt.Println(s.Stream)\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "249c9c6263e7b50af9ef3da326f43d7c", "score": "0.4889034", "text": "func (m *Message) Print() {\n\tlog.Println(\"----- Begin Message ------\")\n\tlog.Printf(\"magic: %X\\n\", m.magic)\n\tlog.Printf(\"compression: %X\\n\", m.compression)\n\tlog.Printf(\"checksum: %X\\n\", m.checksum)\n\tif len(m.payload) < 1048576 { // 1 MB\n\t\tlog.Printf(\"payload: % X\\n\", m.payload)\n\t\tlog.Printf(\"payload(string): %s\\n\", m.PayloadString())\n\t} else {\n\t\tlog.Printf(\"long payload, length: %d\\n\", len(m.payload))\n\t}\n\tlog.Printf(\"length: %d\\n\", m.totalLength)\n\tlog.Printf(\"offset: %d\\n\", m.offset)\n\tlog.Println(\"----- End Message ------\")\n}", "title": "" }, { "docid": "67e5dc681dedf9677f650b6e285bb124", "score": "0.48698258", "text": "func (m MediaType) String() string {\n\treturn string(m)\n}", "title": "" }, { "docid": "dad94318fe607568d67c963e22b986c4", "score": "0.48518372", "text": "func (c chunkType) String() string {\n\tif !(cEOS <= c && c <= cLRND) {\n\t\treturn \"unknown\"\n\t}\n\treturn chunkTypeStrings[c]\n}", "title": "" }, { "docid": "e508376d40321d28601ff662212a9caf", "score": "0.4846077", "text": "func (w *updateArticleInlineRefResponseWriter) NoContent() {\n\tw.Header().Set(\"Content-Type\", \"application/vnd.api+json\")\n\tw.WriteHeader(204)\n}", "title": "" }, { "docid": "778e9bdd5f1b7fedb371370aa3ff2bca", "score": "0.4840336", "text": "func notFound(http_reply http.ResponseWriter, request *http.Request) {\n\tif MAIN_config.Debug_On {\n\t\tdisplayURLRequest(request)\n\t} // display url data\n\n\ttype notFoundReply struct {\n\t\tStatus string `json:\"status\"`\n\t\tMessage string `json:\"error_message\"`\n\t\tDocumentationUrl string `json:\"documentation_url\"`\n\t}\n\n\treplyData := notFoundReply{Status: \"failed\",\n\t\tMessage: \"Not Found\",\n\t\tDocumentationUrl: \"TBD\"}\n\thttpSendReply(http_reply, replyData)\n}", "title": "" }, { "docid": "eafcb5cc991f3f730c671ddd2bf315c0", "score": "0.4838566", "text": "func String(w http.ResponseWriter, status int, v interface{}) error {\n\tw.Header().Set(ContentType, ContentText)\n\tw.WriteHeader(status)\n\t_, err := w.Write([]byte(v.(string)))\n\treturn err\n}", "title": "" }, { "docid": "96fced1c0b3bcef73dfc5e3e1ba407e7", "score": "0.48318085", "text": "func httputilReqDump(r *http.Request) {\n\trequestDump, err := httputil.DumpRequest(r, true)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tlog.Println(string(requestDump))\n}", "title": "" }, { "docid": "61d9b4ab9462c5c64f1375d73dc2a109", "score": "0.48257983", "text": "func (u *Undef) String() string {\n\treturn \"undef()\"\n}", "title": "" }, { "docid": "09da54c35279f2ce88fed62698c7a28d", "score": "0.48250568", "text": "func dump_known_formats() {\n\tfmt.Printf(\"\\nKnown formats:\\n\")\n\tfor i := range globals.known_formats {\n\t\tfmt.Printf(\" '%s'\\n\", globals.known_formats[i].name)\n\t}\n\ttotal := strconv.Itoa(len(globals.known_formats))\n\tfmt.Println(\" Total \" + total)\n}", "title": "" }, { "docid": "9fbd52536ab3fdfbafeb6922a08f92c2", "score": "0.48088807", "text": "func (f Myfeed) print() {\n\ttemplate := \"linkImg = %s, link = %s, texto = %s, data = %s\"\n\ttbuild := fmt.Sprintf(template, f.linkImg, f.link, f.texto, f.data)\n\tfmt.Println(tbuild)\n}", "title": "" }, { "docid": "8a50c5138df62fb9870084a1f83fb0fd", "score": "0.48078132", "text": "func echoToFixedContentTypeRoutines(input *context.BeegoInput, output *context.BeegoOutput) {\n\toutput.JSON(input.Data()[\"someKey\"].(string), false, false)\n\toutput.JSONP(input.Data()[\"someKey\"].(string), false)\n\toutput.ServeFormatted(input.Data()[\"someKey\"].(string), false, false)\n\toutput.XML(input.Data()[\"someKey\"].(string), false)\n\toutput.YAML(input.Data()[\"someKey\"].(string))\n}", "title": "" }, { "docid": "ea58834d819c59a8b64d514c8c7fec3f", "score": "0.48031625", "text": "func builtinPrint(args *NodeStream) interface{} {\n\tstr := \"\"\n\n\tfor _, node := range args.nodes {\n\t\tstr += StringFromNode(node) + \" \"\n\t}\n\n\tstr = str[:len(str)-1]\n\tfmt.Print(str)\n\n\treturn nil\n}", "title": "" }, { "docid": "8817407357d403ec95ee453fc471dea4", "score": "0.4802304", "text": "func PrintRecord(record godaddygo.Record, message string) {\n\tfmt.Printf(\"%s\\t%-5s\\t%s\\n\", message, record.Type, record.Name)\n}", "title": "" }, { "docid": "06fe83744d4a054ed170e74960f6f075", "score": "0.48019665", "text": "func Print(val interface{}) {\n\tfmt.Print(val)\n}", "title": "" }, { "docid": "eb65378991fceb78224726ce3a02bbb6", "score": "0.47994316", "text": "func dumpResponse(r *http.Response, b, p bool, host string) []byte {\n\tdump, err := httputil.DumpResponse(r, b)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t}\n\t// \tisGzip := false\n\t// \tif v, ok := r.Header[\"Accept-Encoding\"]; ok {\n\t// \t\tif strings.Contains(v[0], \"gzip\") {\n\t// \t\t\tisGzip = true\n\t// \t\t\tlog.Println(\"is gzip\")\n\t// \t\t}\n\t// \t}\n\tif p {\n\t\tindex := bytes.Index(dump, []byte(\"\\r\\n\\r\\n\"))\n\t\theaders := dump[:index]\n\t\tbody := bytes.TrimLeft(dump[index:], \"\\r\\n\\r\\n\")\n\t\t// \t\tbody = bytes.TrimLeft(body, string([]byte{13, 10, 13, 10}))\n\n\t\t// \t\tif isGzip {\n\t\t// \t\t\treader := bytes.NewReader(body)\n\t\t// \t\t\tg, err := gzip.NewReader(reader)\n\t\t// \t\t\tif err != nil {\n\t\t// \t\t\t\tlog.Println(err.Error())\n\t\t// \t\t\t}\n\t\t// \t\t\tbody, err = ioutil.ReadAll(g)\n\t\t// \t\t\tif err != nil {\n\t\t// \t\t\t\tlog.Println(err.Error())\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t\tif *veryverbose {\n\t\t\tnow := time.Now()\n\t\t\tdirname := \"/tmp/stfdump/\" + host\n\t\t\tif _, err := os.Stat(dirname); err != nil {\n\t\t\t\tif err := os.MkdirAll(dirname, 0755); err != nil {\n\t\t\t\t\tlog.Fatalln(err.Error())\n\t\t\t\t}\n\t\t\t}\n\t\t\tfilename := fmt.Sprintf(\"%s/%d<\", dirname, now.UnixNano())\n\t\t\tioutil.WriteFile(filename, body, 0644)\n\t\t}\n\t\tif *colors {\n\t\t\t// \t\t\tcolor.Printf(\"@{b}%s@{|}\", string(dump))\n\t\t\tcolor.Printf(\"@{c}%v@{|}\\n\", string(headers))\n\t\t\tif *showBody {\n\t\t\t\tcolor.Printf(\"@{g}%v@{|}\\n\", string(body))\n\t\t\t}\n\t\t\t// \t\t\tcolor.Printf(\"@{g}%v@{|}\\n\", ehex.EncodeToString(body))\n\t\t\t// \t\t\tcolor.Printf(\"@{g}%v@{|}\\n\", body)\n\t\t} else {\n\t\t\tfmt.Println(string(headers))\n\t\t\tfmt.Println(string(body))\n\t\t}\n\t}\n\treturn dump\n}", "title": "" }, { "docid": "1676051cea060e3e0e9839b5b5890941", "score": "0.47981206", "text": "func (c *DescribeCommand) print(out io.Writer, v *fastly.Snippet) {\n\tfmt.Fprintf(out, \"\\nService ID: %s\\n\", v.ServiceID)\n\tfmt.Fprintf(out, \"Service Version: %d\\n\", v.ServiceVersion)\n\n\tfmt.Fprintf(out, \"\\nName: %s\\n\", v.Name)\n\tfmt.Fprintf(out, \"ID: %s\\n\", v.ID)\n\tfmt.Fprintf(out, \"Priority: %d\\n\", v.Priority)\n\tfmt.Fprintf(out, \"Dynamic: %t\\n\", cmd.IntToBool(v.Dynamic))\n\tfmt.Fprintf(out, \"Type: %s\\n\", v.Type)\n\tfmt.Fprintf(out, \"Content: \\n%s\\n\", v.Content)\n\tif v.CreatedAt != nil {\n\t\tfmt.Fprintf(out, \"Created at: %s\\n\", v.CreatedAt)\n\t}\n\tif v.UpdatedAt != nil {\n\t\tfmt.Fprintf(out, \"Updated at: %s\\n\", v.UpdatedAt)\n\t}\n\tif v.DeletedAt != nil {\n\t\tfmt.Fprintf(out, \"Deleted at: %s\\n\", v.DeletedAt)\n\t}\n}", "title": "" }, { "docid": "33d4da9ec46bb262336f1fdf1063d4d7", "score": "0.47977966", "text": "func (ct *ContentType) String() string {\n\tvar sb strings.Builder\n\n\tsb.WriteString(ct.Top)\n\tsb.WriteByte('/')\n\tsb.WriteString(ct.Sub)\n\tfor _, p := range ct.Params {\n\t\tsb.WriteByte(';')\n\t\tsb.WriteByte(' ')\n\t\tsb.WriteString(p.Key)\n\t\tsb.WriteByte('=')\n\t\tif p.Quoted {\n\t\t\tsb.WriteByte('\"')\n\t\t}\n\t\tsb.WriteString(p.Value)\n\t\tif p.Quoted {\n\t\t\tsb.WriteByte('\"')\n\t\t}\n\t}\n\n\treturn sb.String()\n}", "title": "" }, { "docid": "60317d3925d5cd6402528f17c9eecfbc", "score": "0.4775299", "text": "func dump_known_fields() {\n\tfmt.Printf(\"\\nKnown fields:\\n\")\n\tfor i := range globals.known_fields {\n\t\tfmt.Printf(\" '%s' containing \", globals.known_fields[i].String())\n\t\tnames := globals.known_fields[i].SubexpNames()\n\t\tfor j := range names {\n\t\t\tif j != 0 {\n\t\t\t\tfmt.Printf(\"<%s>\", names[j])\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t}\n\ttotal := strconv.Itoa(len(globals.known_fields))\n\tfmt.Println(\" Total \" + total)\n}", "title": "" }, { "docid": "d6fa7e8d6b90ff9783d840a3b9a97e3e", "score": "0.47746953", "text": "func (d *demandesReqType) String() string {\n\treturn fmt.Sprint(*d)\n}", "title": "" }, { "docid": "874a92477a91c6d87db42a90e936214b", "score": "0.47728786", "text": "func dumpResponse(resp *http.Response, body []byte) string {\n\tout := &bytes.Buffer{}\n\tfmt.Fprintln(out, resp.Status)\n\tresp.Header.Write(out)\n\tfmt.Fprintln(out)\n\tif len(body) == 0 {\n\t\tfmt.Fprintln(out, \"<empty body>\")\n\t} else if isTextContent(resp.Header) {\n\t\tout.Write(body)\n\t\tif body[len(body)-1] != '\\n' {\n\t\t\tfmt.Fprintln(out)\n\t\t}\n\t\tif int64(len(body)) < resp.ContentLength {\n\t\t\tfmt.Fprintln(out, \"<truncated>\")\n\t\t}\n\t} else {\n\t\tfmt.Fprintln(out, \"<binary response>\")\n\t}\n\treturn out.String()\n}", "title": "" }, { "docid": "c0beeaf291f1b38b887d5edb2ef5d9fb", "score": "0.4763709", "text": "func PrintNoColorFn(s *State, r *Result) {\n\toutput := \"\"\n\tif !s.NoStatus {\n\t\tcode := strconv.FormatInt(r.Code, 10)\n\t\toutput += fmt.Sprintf(\" Code %-10s \", code)\n\t}\n\tif r.Chars >= int64(0) {\n\t\toutput += fmt.Sprintf(\" C %-6.8s\", res2string(r.Chars))\n\t\toutput += fmt.Sprintf(\" W %-6.8s\", res2string(r.Words))\n\t\toutput += fmt.Sprintf(\" L %-6.8s\", res2string(r.Lines))\n\t}\n\toutput += fmt.Sprintf(\"%-30s\", r.URL)\n\toutput += \"\\n\"\n\tif s.PrintBody == true {\n\t\toutput += \"\\n\"\n\t\toutput += string(r.Body)\n\t\toutput += \"\\n\"\n\t}\n\tif s.OutputFile != nil {\n\t\tWriteToFile(output, s)\n\t}\n\tfmt.Printf(output)\n}", "title": "" }, { "docid": "049e1529fa6dcb2fc127139bf297ba7e", "score": "0.47583944", "text": "func (rp *ReportPrinter) Print(format string) error {\n\tif format == \"\" {\n\t\tformat = \"summary\"\n\t}\n\n\tswitch format {\n\tcase \"summary\", \"csv\":\n\t\toutputTmpl := defaultTmpl\n\t\tif format == \"csv\" {\n\t\t\toutputTmpl = csvTmpl\n\t\t}\n\t\tbuf := &bytes.Buffer{}\n\t\ttempl := template.Must(template.New(\"tmpl\").Funcs(tmplFuncMap).Parse(outputTmpl))\n\t\tif err := templ.Execute(buf, *rp.Report); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn rp.print(buf.String())\n\tcase \"json\", \"pretty\":\n\t\trep, err := json.Marshal(*rp.Report)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif format == \"pretty\" {\n\t\t\tvar out bytes.Buffer\n\t\t\terr = json.Indent(&out, rep, \"\", \" \")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\trep = out.Bytes()\n\t\t}\n\t\treturn rp.print(string(rep))\n\tcase \"html\":\n\t\tbuf := &bytes.Buffer{}\n\t\ttempl := template.Must(template.New(\"tmpl\").Funcs(tmplFuncMap).Parse(htmlTmpl))\n\t\tif err := templ.Execute(buf, *rp.Report); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn rp.print(buf.String())\n\tcase \"influx-summary\":\n\t\treturn rp.print(rp.getInfluxLine())\n\tcase \"influx-details\":\n\t\treturn rp.printInfluxDetails()\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown format: %s\", format)\n\t}\n}", "title": "" }, { "docid": "33fdfbd90af9166c0f4256acd6bffa5d", "score": "0.4757318", "text": "func dummyGoType() string {\n\treturn \"\"\n}", "title": "" }, { "docid": "ff07d0abd23f2d6e516f1277cc9c1887", "score": "0.47520328", "text": "func printString(value interface{}) {\n\tswitch str := value.(type) {\n\tcase string:\n\t\tfmt.Println(value)\n\tcase Stringer:\n\t\tfmt.Println(str.String())\n\t}\n}", "title": "" }, { "docid": "8367e26a6a5da10d90d11810b0568713", "score": "0.475166", "text": "func printHTTPRequest(w http.ResponseWriter, r *http.Request, msg string) {\n\tlog.Printf(\"user request info: %s\\n\", msg)\n\tfmt.Println(\"TLS:\", r.TLS)\n\tfmt.Println(\"Header:\", r.Header)\n\n\t// print out all request headers\n\tfmt.Printf(\"%s %s %s \\n\", r.Method, r.URL, r.Proto)\n\tfor k, v := range r.Header {\n\t\tfmt.Printf(\"Header field %q, Value %q\\n\", k, v)\n\t}\n\tfmt.Printf(\"Host = %q\\n\", r.Host)\n\tfmt.Printf(\"RemoteAddr= %q\\n\", r.RemoteAddr)\n\tfmt.Printf(\"\\n\\nFinding value of \\\"Accept\\\" %q\\n\", r.Header[\"Accept\"])\n}", "title": "" }, { "docid": "7e160e5bac91e037a71a81ce1568a778", "score": "0.47502908", "text": "func Print(x interface{}) {\n\tfmt.Print(String(x))\n}", "title": "" }, { "docid": "2c89ed592240b34c6c2dee6500c5ee43", "score": "0.4742462", "text": "func (*ResponseJSON) Print(resp []byte) error {\n\tresp, err := jsonformation.Format(resp)\n\tif err != nil {\n\t\treturn errors.New(\"can't format json response\")\n\t}\n\n\tif _, err := color.New(color.FgRed).Print(config.OutputIndicator); err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := fmt.Println(string(resp)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "35d6fd652cca5e7faa385347ba714a0f", "score": "0.4739541", "text": "func Dump(data interface{}) {\n\tif text, err := AsJSONText(data); err == nil {\n\t\tfmt.Printf(\"%v\\n\", text)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "de9b51ce610b38225006444d1bcd22f6", "score": "0.47361374", "text": "func (mvt ValueType) String() string {\n\treturn strings.Title(strings.ToLower(mvt.ValueType.String())) // nolint SA1019\n}", "title": "" }, { "docid": "aebf6ab3279fa982c71c05c4d30489ab", "score": "0.47326407", "text": "func (fl FilesystemList) ContentType() string {\n\treturn fl.rawResponse.Header.Get(\"Content-Type\")\n}", "title": "" }, { "docid": "1d0e8ed4c24d20377b5829eacd7c43f4", "score": "0.47309655", "text": "func Print(w io.Writer, args ...interface{}) {\n\tfor _, i := range args {\n\t\tif str, ok := i.(string); ok {\n\t\t\tw.Write([]byte(str))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "95d52296c5dc245cdbc3da8f165558ce", "score": "0.47299293", "text": "func NoContent(c http.ResponseWriter) {\n\thttp.Error(c, \"204 No Content\", http.StatusNoContent)\n}", "title": "" }, { "docid": "a5724fd5960c476e825db530ddabbe23", "score": "0.47290763", "text": "func (l *LogLine) Print() {\n\tfmt.Println(l.RemoteAddr)\n\tfmt.Println(l.TimeLocal)\n\tfmt.Println(l.RequestType)\n\tfmt.Println(l.RequestPath)\n\tfmt.Println(l.Status)\n\tfmt.Println(l.BodyBytesSent)\n\tfmt.Println(l.HTTPReferer)\n\tfmt.Println(l.HTTPUserAgent)\n\tfmt.Println(l.Created)\n}", "title": "" }, { "docid": "2c969008b8716e6971de6efa0a6d3bb9", "score": "0.47227362", "text": "func ProtocolPrint(ptl Protocol) {\n\tptl.Print()\n}", "title": "" }, { "docid": "3552e8ed8bed20f7b038afa262e30688", "score": "0.47223514", "text": "func (h *HTMLResponse) NotFound() {\n\th.writer.Header().Set(\"Content-Type\", \"text/html; charset=utf-8\")\n\th.writer.WriteHeader(http.StatusNotFound)\n\th.writer.Write([]byte(\"Page Not Found\"))\n}", "title": "" }, { "docid": "89fc597641ef38795079fb63a740b499", "score": "0.4721991", "text": "func (action ActionType) String() string {\n\tif v, ok := actionMap[action]; ok {\n\t\treturn v\n\t}\n\treturn \"none\"\n}", "title": "" }, { "docid": "38b796b06010d8f193058ce943431013", "score": "0.47210547", "text": "func (f *Plain) Print(value interface{}) {\n\tf.write(f.cfg.OutWriter, value)\n\tf.write(f.cfg.OutWriter, \"\\n\")\n}", "title": "" }, { "docid": "58d6701259b63501e3154860b5ee600d", "score": "0.4718833", "text": "func NoContent(w http.ResponseWriter) {\n\tjsonHeaders(w)\n\tw.WriteHeader(http.StatusNoContent)\n}", "title": "" }, { "docid": "dd8db0742bd3ca9bb3bda6903c94c52d", "score": "0.47173253", "text": "func (r Request) Print(db *sql.DB, w io.Writer) (int, error) {\n\treturn request.Print(db, w, request.Flags(r))\n}", "title": "" }, { "docid": "89576c5e909047e279782ee9fec9183e", "score": "0.47120497", "text": "func DumpAnything(anything any) string {\n\treturn DumpAnythingFixedWidth(anything, DefaultWidth)\n}", "title": "" }, { "docid": "72fcfbf9a4de5a2fd4439296041d10fb", "score": "0.4707091", "text": "func APIPanicHandler(rec interface{}, w http.ResponseWriter) {\n \n logrus.Errorln(rec)\n errorMessage := \"Internal server error\"\n errorCode := http.StatusInternalServerError\n \n switch x := rec.(type) {\n case merry.Error:\n logrus.Errorln(merry.Details(x))\n \n errorMessage = merry.UserMessage(x)\n errorCode = merry.HTTPCode(x)\n }\n \n w.WriteHeader(errorCode)\n \n _, err := w.Write([]byte(fmt.Sprintf(`{\"message\": \"%s\"}`, errorMessage)))\n if (err != nil) {\n logrus.Error(err)\n }\n w.Header().Set(\"Content-Type\", \"application/json\")\n}", "title": "" }, { "docid": "fb78a210cafae61a8bf19ad0adfab99f", "score": "0.4700361", "text": "func (r Renderer) WriteContentType(w http.ResponseWriter) {\n\theader := w.Header()\n\t// TODO: r.Page.ContentType\n\t//\tif val := header[\"Content-Type\"]; len(val) == 0 {\n\theader[\"Content-Type\"] = []string{r.page.ContentType}\n\t//\t}\n}", "title": "" }, { "docid": "a7b4713f46f0974a17260fb2941a81c6", "score": "0.4697242", "text": "func PrintBody(resp *http.Response) {\n\tfmt.Printf(\"\\n-------------------------------------------------\\n\")\n\treader := bufio.NewReader(resp.Body)\n\tfor {\n\t\tline, err := reader.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfmt.Println(err)\n\t\t}\n\t\tfmt.Print(line)\n\t}\n}", "title": "" }, { "docid": "d03de077eea0cefd5cd536cfbc67e7a7", "score": "0.4694008", "text": "func (me TsoftwarereferenceDtypeType) String() string { return xsdt.Nmtoken(me).String() }", "title": "" }, { "docid": "50fe231c3ab976663046642b21530c23", "score": "0.46889535", "text": "func (m Undefined) Raw() []byte {\n\treturn (&metaMessage{\n\t\tTyp: m.Typ,\n\t\tData: m.Data,\n\t}).Bytes()\n}", "title": "" }, { "docid": "569eae9f188e58dffc0df6ba91ba9532", "score": "0.46834698", "text": "func Println(e Empty) {\n\tfmt.Printf(\"[main.Println] e's value: %v, type: %T\\n\", e, e)\n}", "title": "" }, { "docid": "4ec703a6009eb5d3e0ab039a46ebb002", "score": "0.46833235", "text": "func echoToBodyNoContentType(input *context.BeegoInput, output *context.BeegoOutput) {\n\toutput.Body(input.Data()[\"someKey\"].([]byte))\n}", "title": "" }, { "docid": "79988db86e4f5377c2be8f388216aa27", "score": "0.46763375", "text": "func NoContent(w http.ResponseWriter) {\n\tw.WriteHeader(http.StatusNoContent)\n}", "title": "" }, { "docid": "79988db86e4f5377c2be8f388216aa27", "score": "0.46763375", "text": "func NoContent(w http.ResponseWriter) {\n\tw.WriteHeader(http.StatusNoContent)\n}", "title": "" }, { "docid": "ab3f02f24b30f801a03a902a776c5443", "score": "0.46732008", "text": "func printBody(resp *http.Response) {\n\tbuf, bodyErr := ioutil.ReadAll(resp.Body)\n\tif bodyErr != nil {\n\t\tfmt.Print(\"bodyErr \", bodyErr.Error())\n\t\treturn\n\t}\n\n\trdr1 := ioutil.NopCloser(bytes.NewBuffer(buf))\n\trdr2 := ioutil.NopCloser(bytes.NewBuffer(buf))\n\tfmt.Printf(\"BODY: %q\", rdr1)\n\tresp.Body = rdr2\n}", "title": "" }, { "docid": "d2780dcb36c9780607cfb74f5f497779", "score": "0.46645597", "text": "func NotFound(rw http.ResponseWriter, r *http.Request) {\n\tt, _ := template.New(\"beegoerrortemp\").Parse(errtpl)\n\t// template.New(\"sd\").ParseFiles(...)\n\tdata := make(map[string]interface{})\n\tdata[\"Title\"] = \"Page Not Found\"\n\tdata[\"Url\"] = r.URL\n\t//rw.WriteHeader(http.StatusNotFound)\n\tt.Execute(rw, data)\n}", "title": "" }, { "docid": "5f14c7adf5a731f1bd5ff7d1ce095dfc", "score": "0.4662848", "text": "func Print(v ...interface{}) {\n\tDefault.Print(v...)\n}", "title": "" }, { "docid": "637e9e47628767660e67e7b4579fd569", "score": "0.46593046", "text": "func unableToDetermine(w http.ResponseWriter, r *http.Request) error {\n\treturn errors.New(\"Unable to determine the upload type. Internal Server Error!\")\n}", "title": "" }, { "docid": "468adc918a897fdcd39248b7ad149185", "score": "0.4657414", "text": "func (ap ProbType) String() string {\n\tswitch ap {\n\tcase accountDoesNotExistErr:\n\t\treturn \"accountDoesNotExist\"\n\tcase alreadyRevokedErr:\n\t\treturn \"alreadyRevoked\"\n\tcase badCSRErr:\n\t\treturn \"badCSR\"\n\tcase badNonceErr:\n\t\treturn \"badNonce\"\n\tcase badPublicKeyErr:\n\t\treturn \"badPublicKey\"\n\tcase badRevocationReasonErr:\n\t\treturn \"badRevocationReason\"\n\tcase badSignatureAlgorithmErr:\n\t\treturn \"badSignatureAlgorithm\"\n\tcase caaErr:\n\t\treturn \"caa\"\n\tcase compoundErr:\n\t\treturn \"compound\"\n\tcase connectionErr:\n\t\treturn \"connection\"\n\tcase dnsErr:\n\t\treturn \"dns\"\n\tcase externalAccountRequiredErr:\n\t\treturn \"externalAccountRequired\"\n\tcase incorrectResponseErr:\n\t\treturn \"incorrectResponse\"\n\tcase invalidContactErr:\n\t\treturn \"invalidContact\"\n\tcase malformedErr:\n\t\treturn \"malformed\"\n\tcase orderNotReadyErr:\n\t\treturn \"orderNotReady\"\n\tcase rateLimitedErr:\n\t\treturn \"rateLimited\"\n\tcase rejectedIdentifierErr:\n\t\treturn \"rejectedIdentifier\"\n\tcase serverInternalErr:\n\t\treturn \"serverInternal\"\n\tcase tlsErr:\n\t\treturn \"tls\"\n\tcase unauthorizedErr:\n\t\treturn \"unauthorized\"\n\tcase unsupportedContactErr:\n\t\treturn \"unsupportedContact\"\n\tcase unsupportedIdentifierErr:\n\t\treturn \"unsupportedIdentifier\"\n\tcase userActionRequiredErr:\n\t\treturn \"userActionRequired\"\n\tcase notImplemented:\n\t\treturn \"notImplemented\"\n\tdefault:\n\t\treturn \"unsupported type\"\n\t}\n}", "title": "" } ]
658727b2eff88aa6d102d97869f9ac9d
String returns the string representation. API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".
[ { "docid": "a1641612b53eb8ab604daf14e1b9218d", "score": "0.0", "text": "func (s AccountTakeoverActionType) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
[ { "docid": "2e110f24163468aae67d3b2ae207c5b6", "score": "0.6636346", "text": "func (s Member) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.6544985", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.6544985", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.6544985", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.6544985", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.65447897", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.654307", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "209f0ca319514f420a9b219d4e6407fc", "score": "0.6411051", "text": "func (s ApiPassthrough) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "796d3da09122d3a6eda8d85cd2072b9e", "score": "0.6377984", "text": "func (s GetMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "796d3da09122d3a6eda8d85cd2072b9e", "score": "0.6377775", "text": "func (s GetMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d9ee2b223b7036b0844ac2370527fbfe", "score": "0.63318276", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Distribution Params:\n Community Tax: %s\n Withdraw Addr Enabled: %t`,\n\t\tp.CommunityTax, p.WithdrawAddrEnabled)\n}", "title": "" }, { "docid": "0283ad9a395e675fe0a9ec712bceb034", "score": "0.6257091", "text": "func (s RequestParametersStruct) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "41112ccec69ed7e5695800fb71ff6fea", "score": "0.6255295", "text": "func (rp RequestParam) String() string {\n\treturn rp.name + \":\" + rp.value\n}", "title": "" }, { "docid": "74841839d2e20d32eda2604b690f38eb", "score": "0.62474954", "text": "func (s CreateMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7422e92ddcee98e4ae227fd7e12e513f", "score": "0.6222185", "text": "func (s GroupMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3604a1d12813ce519872a998508d98c7", "score": "0.61857605", "text": "func (s GetMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "5c518cab9a26cf655d1488d854d900db", "score": "0.61753863", "text": "func (s ApiCallDetails) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "accd4137f896762440eab638351d91b7", "score": "0.61654717", "text": "func (s ExtraParam) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "db46495338ceb36924c9a961792081f1", "score": "0.61496437", "text": "func (s Parameter) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "0cac5cf7ba8a7cfec01584f819c0b895", "score": "0.6137705", "text": "func (cwm ClanWarMember) String() string {\n\tb, _ := json.Marshal(cwm)\n\treturn string(b)\n}", "title": "" }, { "docid": "1b1b87fc2777c2421db74b56907cfd22", "score": "0.6124354", "text": "func (o ExportPolicyGetRequestDesiredAttributes) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "5cfbfb73e613c5fbc899afb26c99fb8b", "score": "0.6115941", "text": "func (o VserverGetRequestDesiredAttributes) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "fea6b1db8f7c88035ae711e8ab461794", "score": "0.6103263", "text": "func (s OriginGroupMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "21b76ca7f7f0d64b84d5a5e4aa7bcffb", "score": "0.6098424", "text": "func (p Params) String() string {\n\tvar sb strings.Builder\n\tsb.WriteString(\"Params:\")\n\tsb.WriteString(fmt.Sprintf(\"TokenCacheSize:%v\\t\", p.TokenCacheSize))\n\tsb.WriteString(fmt.Sprintf(\"NewTokenFee:%v\\t\", p.NewTokenFee))\n\tsb.WriteString(fmt.Sprintf(\"ReservedSymbols:%s\\t\", strings.Join(p.ReservedSymbols, \",\")))\n\n\treturn sb.String()\n}", "title": "" }, { "docid": "be5fe10413aca4c98011d6d93dfe98a4", "score": "0.60911846", "text": "func (s GetMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "be5fe10413aca4c98011d6d93dfe98a4", "score": "0.6091067", "text": "func (s GetMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "27d311f685e6799a5346d860dceb8261", "score": "0.6082593", "text": "func (v *RPC) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [10]string\n\ti := 0\n\tfields[i] = fmt.Sprintf(\"SpanContext: %v\", v.SpanContext)\n\ti++\n\tfields[i] = fmt.Sprintf(\"CallerName: %v\", v.CallerName)\n\ti++\n\tfields[i] = fmt.Sprintf(\"ServiceName: %v\", v.ServiceName)\n\ti++\n\tfields[i] = fmt.Sprintf(\"Encoding: %v\", v.Encoding)\n\ti++\n\tfields[i] = fmt.Sprintf(\"Procedure: %v\", v.Procedure)\n\ti++\n\tif v.Headers != nil {\n\t\tfields[i] = fmt.Sprintf(\"Headers: %v\", v.Headers)\n\t\ti++\n\t}\n\tif v.ShardKey != nil {\n\t\tfields[i] = fmt.Sprintf(\"ShardKey: %v\", *(v.ShardKey))\n\t\ti++\n\t}\n\tif v.RoutingKey != nil {\n\t\tfields[i] = fmt.Sprintf(\"RoutingKey: %v\", *(v.RoutingKey))\n\t\ti++\n\t}\n\tif v.RoutingDelegate != nil {\n\t\tfields[i] = fmt.Sprintf(\"RoutingDelegate: %v\", *(v.RoutingDelegate))\n\t\ti++\n\t}\n\tif v.Body != nil {\n\t\tfields[i] = fmt.Sprintf(\"Body: %v\", v.Body)\n\t\ti++\n\t}\n\n\treturn fmt.Sprintf(\"RPC{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "ff5e36164a3ac20a1c3e997ce41e15b4", "score": "0.60813177", "text": "func (f Method) String() string {\n\treturn fmt.Sprintf(\"Name: %s (params: %s) (results: %s)\", f.Name, f.Params, f.Results)\n}", "title": "" }, { "docid": "73c0cab2005d31098ef74dae88190f1f", "score": "0.60696334", "text": "func (s CreateMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "73c0cab2005d31098ef74dae88190f1f", "score": "0.60696334", "text": "func (s CreateMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3d190d1152af6172b7350972bdbe6848", "score": "0.6041954", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Params:\t\n\tMinters:\t\t\t%s\t\n\t`, p.Minters)\n}", "title": "" }, { "docid": "8652251f99cffbd32be4152d2d6a2ee9", "score": "0.60415024", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Coinswap Params:\n Fee:\t\t\t%s`, p.Fee.String(),\n\t)\n}", "title": "" }, { "docid": "85ce395912b475acdf3ad6330161a646", "score": "0.60367465", "text": "func (s ParameterNameValue) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d95172027cde329e808e45600a7c3aeb", "score": "0.6007763", "text": "func (p *Param) String() string {\n\tif p.Name != \"\" {\n\t\treturn fmt.Sprintf(\"%v[name=%v]\", p.Type.String(), p.Name)\n\t}\n\treturn p.Type.String()\n}", "title": "" }, { "docid": "e0f5a58ecaf50ed33ec2a7c0afae36ed", "score": "0.59968424", "text": "func (p *Parameter) String() string {\n\tdata, _ := json.Marshal(p) //nolint:errchkjson // returns empty string on error\n\treturn string(data)\n}", "title": "" }, { "docid": "12464d698c01cb5597d16be5802fc720", "score": "0.5991581", "text": "func (s ApiKeyFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "11a4e7851f5e03cc5470dce5aef81d39", "score": "0.5987922", "text": "func (s GetMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c636ce7d494602bf2b03d1557a31bcd2", "score": "0.5982161", "text": "func (p paramHeader) String() string {\n\treturn fmt.Sprintf(\"%s (%d): %s\", p.typ, p.len, hex.Dump(p.raw))\n}", "title": "" }, { "docid": "d882e5469cada469c07e60688de9f546", "score": "0.5952483", "text": "func (o *Developmentactivityaggregateparam) String() string {\n \n o.Metrics = []string{\"\"} \n o.GroupBy = []string{\"\"} \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "a5801cfa047fa37eeeee06eeee90ad7f", "score": "0.5929012", "text": "func (mem *Member) String() string {\n\tstringGenes := make([]string, len(mem.Genes))\n\tfor i, v := range mem.Genes {\n\t\tstringGenes[i] = v.String()\n\t}\n\treturn fmt.Sprintf(\"Member:\\t(fitness: %d)\\n\\t%s\", mem.GetFitness(), strings.Join(stringGenes, \"\\n\\t\"))\n}", "title": "" }, { "docid": "c5ac32b50515a01e38f8086951fb488b", "score": "0.5927223", "text": "func (s CreateMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "bc3052ec2d6d17830a144a788ddc57d3", "score": "0.5906177", "text": "func (s ListMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "bc3052ec2d6d17830a144a788ddc57d3", "score": "0.5906177", "text": "func (s ListMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "bc3052ec2d6d17830a144a788ddc57d3", "score": "0.5905679", "text": "func (s ListMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0d6b867220b19e47e11b2823a3518237", "score": "0.5889985", "text": "func (r Reflection) String() string {\n\tswitch r {\n\tdefault:\n\t\tfallthrough\n\tcase ReflectionNormal:\n\t\treturn \"normal\"\n\tcase ReflectionX:\n\t\treturn \"x\"\n\tcase ReflectionY:\n\t\treturn \"y\"\n\t}\n}", "title": "" }, { "docid": "3ffc25a4edc5ca7652c4750de89130eb", "score": "0.5880915", "text": "func (s Parameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3ffc25a4edc5ca7652c4750de89130eb", "score": "0.5880915", "text": "func (s Parameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b5a12a6a081cfefe02aee76eec1bc881", "score": "0.5875569", "text": "func (s *Stat) String() string {\n\t// Print the name of the field along with value\n\treturn fmt.Sprintf(\"%+v\\n\", *s)\n}", "title": "" }, { "docid": "f2c7aa22279a96333bf8c8554ceba368", "score": "0.5868775", "text": "func (s InviteMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f2c7aa22279a96333bf8c8554ceba368", "score": "0.5868775", "text": "func (s InviteMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3815b87970f5ed84eedf754a2150de2c", "score": "0.5868483", "text": "func (s MethodSetting) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "698af678258fa8512793cfde326e693f", "score": "0.5866013", "text": "func (s AccessMethod) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a1339644818b1e2a2bf195e71a529b40", "score": "0.58635247", "text": "func (o IgroupGetIterRequestDesiredAttributes) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "ef0d371c5fc2163aaad4e4044a4ec646", "score": "0.5862402", "text": "func (a arg) String() string {\n\tswitch {\n\tcase a.plainText:\n\t\treturn combineKeyValue(a.key, a.value)\n\tdefault:\n\t\treturn combineKeyValue(a.key, argRedacted)\n\t}\n}", "title": "" }, { "docid": "a69e6d3c524cf7323692232ce1f978d0", "score": "0.58573395", "text": "func (o ExportPolicyGetRequest) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "bca0c3bff94fd964d3a5a9a6198c387f", "score": "0.58368194", "text": "func (oum *OrgUnitMember) String() string {\n\tvar builder strings.Builder\n\tbuilder.WriteString(\"OrgUnitMember(\")\n\tbuilder.WriteString(fmt.Sprintf(\"id=%v\", oum.ID))\n\tbuilder.WriteString(\", create_by_user=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", oum.CreateByUser))\n\tbuilder.WriteString(\", update_by_user=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", oum.UpdateByUser))\n\tbuilder.WriteString(\", create_time=\")\n\tbuilder.WriteString(oum.CreateTime.Format(time.ANSIC))\n\tif v := oum.UpdateTime; v != nil {\n\t\tbuilder.WriteString(\", update_time=\")\n\t\tbuilder.WriteString(v.Format(time.ANSIC))\n\t}\n\tbuilder.WriteString(\", is_additional=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", oum.IsAdditional))\n\tbuilder.WriteString(\", user_id=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", oum.UserID))\n\tbuilder.WriteString(\", org_unit_id=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", oum.OrgUnitID))\n\tbuilder.WriteString(\", org_unit_position_id=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", oum.OrgUnitPositionID))\n\tbuilder.WriteByte(')')\n\treturn builder.String()\n}", "title": "" }, { "docid": "8d6355121c22a97fa6189cd1c641837f", "score": "0.5827209", "text": "func (p Params) String() string {\n\tvar sb strings.Builder\n\tsb.WriteString(\"Params: \\n\")\n\tsb.WriteString(fmt.Sprintf(\"DexListFee:%s\\n\", p.ListFee))\n\t//sb.WriteString(fmt.Sprintf(\"DexDelistFee:%s\\n\", p.DelistFee))\n\tsb.WriteString(fmt.Sprintf(\"TransferOwnershipFee:%s\\n\", p.TransferOwnershipFee))\n\tsb.WriteString(fmt.Sprintf(\"DelistMaxDepositPeriod:%s\\n\", p.DelistMaxDepositPeriod))\n\tsb.WriteString(fmt.Sprintf(\"DelistMinDeposit:%s\\n\", p.DelistMinDeposit))\n\tsb.WriteString(fmt.Sprintf(\"DelistVotingPeriod:%s\\n\", p.DelistMaxDepositPeriod))\n\tsb.WriteString(fmt.Sprintf(\"WithdrawPeriod:%d\\n\", p.WithdrawPeriod))\n\treturn sb.String()\n}", "title": "" }, { "docid": "4872527d47e2548d9def20083f60dcdb", "score": "0.5821855", "text": "func (o VserverGetRequest) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "faa3a6df557dd556d32df74f6fe9e1da", "score": "0.5808877", "text": "func StructToString(si interface{}) string {\n\trval := reflect.ValueOf(si).Elem()\n\ttipe := rval.Type()\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"{ \")\n\tfor i := 0; i < rval.NumField(); i++ {\n\t\ttf := tipe.Field(i)\n\t\tif !rval.FieldByName(tf.Name).CanSet() {\n\t\t\tcontinue // skip unexported fields\n\t\t}\n\t\tvar fStr string\n\t\ttagv := tf.Tag.Get(SecretTag)\n\t\tif tagv == \"password\" || tagv == \"username\" {\n\t\t\tfStr = fmt.Sprintf(\"%s:**** \", tf.Name)\n\t\t} else if tagv == \"url\" {\n\t\t\tval, ok := rval.Field(i).Interface().(string)\n\t\t\tif ok {\n\t\t\t\tval = GetMaskedURL(val)\n\t\t\t\tfStr = fmt.Sprintf(\"%s:%v \", tf.Name, val)\n\t\t\t} else {\n\t\t\t\tfStr = fmt.Sprintf(\"%s:%v \", tf.Name, rval.Field(i).Interface())\n\t\t\t}\n\t\t} else {\n\t\t\tfStr = fmt.Sprintf(\"%s:%v \", tf.Name, rval.Field(i).Interface())\n\t\t}\n\t\tbuffer.WriteString(fStr)\n\t}\n\tbuffer.WriteString(\" }\")\n\treturn buffer.String()\n}", "title": "" }, { "docid": "8eb7908729d4790cbc3304828f38f9c5", "score": "0.5803484", "text": "func (m *Member) ToString() string {\n\treturn fmt.Sprintf(\n\t\t`ID: %s\nFullName: %s\nUsername: %s`, m.ID, m.FullName, m.Username)\n}", "title": "" }, { "docid": "660b6219c36433957afa564a2fd989f0", "score": "0.58025736", "text": "func (s OptionGroupMembership) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "597d4b75ffb5f0cfe6b14ad3f405187b", "score": "0.580113", "text": "func (id *Identity) String() string {\n\tbuffer := \"\"\n\tbuffer += id.Name\n\tif id.External {\n\t\tbuffer += \"(External)\"\n\t} else {\n\t\tbuffer += \"(Local) \" + id.ContactInfo\n\t}\n\treturn buffer\n}", "title": "" }, { "docid": "9c66cccdde8c717e9a130db2918369c1", "score": "0.5793869", "text": "func (s ParameterStringFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "ac25f3f6aea8da056068a0cf09489b4d", "score": "0.5784336", "text": "func (s DBParameterGroup) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "b66208ff2f26bed4c87dc66c3d623072", "score": "0.57737595", "text": "func (s OriginGroupMembers) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "14a5d8153fa38ed0e3c2c8e5825e17e4", "score": "0.57736397", "text": "func (s CreateMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "14a5d8153fa38ed0e3c2c8e5825e17e4", "score": "0.57736397", "text": "func (s CreateMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "be201c79a8f848e14066af00fcc41926", "score": "0.5771478", "text": "func (s AssociateMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d09cc4d4e9c343ece0da4ec8cc5f6443", "score": "0.57606673", "text": "func (s ApiKeyRestrictions) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7fa9ae680372df047f172b65f4ed06b4", "score": "0.57543606", "text": "func (s ApiKey) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "724ad565afd14fd20d58dfce8e46b8ee", "score": "0.57524085", "text": "func String() string {\n\treturn fmt.Sprintf(\"%s %v Protocol %s %s\", Name, Version, ProtocolCompat, Additional)\n}", "title": "" }, { "docid": "05ea32beea84864b4180f553f66334ae", "score": "0.5746682", "text": "func (s ExportApiOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6c58d1f8601f0c53d043a6c6c5dc49da", "score": "0.5734107", "text": "func layerString(v reflect.Value, anonymous bool, writeSpace bool) string {\n\t// Let String() functions take precedence.\n\tif v.CanInterface() {\n\t\tif s, ok := v.Interface().(fmt.Stringer); ok {\n\t\t\treturn s.String()\n\t\t}\n\t}\n\t// Reflect, and spit out all the exported fields as key=value.\n\tswitch v.Type().Kind() {\n\tcase reflect.Interface, reflect.Ptr:\n\t\tif v.IsNil() {\n\t\t\treturn \"nil\"\n\t\t}\n\t\tr := v.Elem()\n\t\treturn layerString(r, anonymous, writeSpace)\n\tcase reflect.Struct:\n\t\tvar b bytes.Buffer\n\t\ttyp := v.Type()\n\t\tif !anonymous {\n\t\t\tb.WriteByte('{')\n\t\t}\n\t\tfor i := 0; i < v.NumField(); i++ {\n\t\t\t// Check if this is upper-case.\n\t\t\tftype := typ.Field(i)\n\t\t\tf := v.Field(i)\n\t\t\tif ftype.Anonymous {\n\t\t\t\tanonStr := layerString(f, true, writeSpace)\n\t\t\t\twriteSpace = writeSpace || anonStr != \"\"\n\t\t\t\tb.WriteString(anonStr)\n\t\t\t} else if ftype.PkgPath == \"\" { // exported\n\t\t\t\tif writeSpace {\n\t\t\t\t\tb.WriteByte(' ')\n\t\t\t\t}\n\t\t\t\twriteSpace = true\n\t\t\t\tfmt.Fprintf(&b, \"%s=%s\", typ.Field(i).Name, layerString(f, false, writeSpace))\n\t\t\t}\n\t\t}\n\t\tif !anonymous {\n\t\t\tb.WriteByte('}')\n\t\t}\n\t\treturn b.String()\n\tcase reflect.Slice:\n\t\tvar b bytes.Buffer\n\t\tb.WriteByte('[')\n\t\tif v.Len() > 4 {\n\t\t\tfmt.Fprintf(&b, \"..%d..\", v.Len())\n\t\t} else {\n\t\t\tfor j := 0; j < v.Len(); j++ {\n\t\t\t\tif j != 0 {\n\t\t\t\t\tb.WriteString(\", \")\n\t\t\t\t}\n\t\t\t\tb.WriteString(layerString(v.Index(j), false, false))\n\t\t\t}\n\t\t}\n\t\tb.WriteByte(']')\n\t\treturn b.String()\n\t}\n\treturn fmt.Sprintf(\"%v\", v.Interface())\n}", "title": "" }, { "docid": "97a3e0ab0ec36bc8a67461db50075009", "score": "0.5723175", "text": "func (o NvmeRevertAnagrpidsRequest) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "f2998a80b837d9e2adde948576c10b0a", "score": "0.571995", "text": "func (p *Properties) String() string {\n\ts := p.Wire\n\ts += \",\"\n\ts += strconv.Itoa(p.Tag)\n\tif p.Required {\n\t\ts += \",req\"\n\t}\n\tif p.Optional {\n\t\ts += \",opt\"\n\t}\n\tif p.Repeated {\n\t\ts += \",rep\"\n\t}\n\tif p.Packed {\n\t\ts += \",packed\"\n\t}\n\ts += \",name=\" + p.OrigName\n\tif p.JSONName != p.OrigName {\n\t\ts += \",json=\" + p.JSONName\n\t}\n\tif p.proto3 {\n\t\ts += \",proto3\"\n\t}\n\tif p.oneof {\n\t\ts += \",oneof\"\n\t}\n\tif len(p.Enum) > 0 {\n\t\ts += \",enum=\" + p.Enum\n\t}\n\tif p.HasDefault {\n\t\ts += \",def=\" + p.Default\n\t}\n\treturn s\n}", "title": "" }, { "docid": "7b9f1adb1ea49a857bf6e208595f19a9", "score": "0.5716992", "text": "func (a *Plane) String() string {\n\treturn fmt.Sprintf(\"%+v\", *a)\n}", "title": "" }, { "docid": "cc960b69484075f7d705c86497200ee5", "score": "0.5709671", "text": "func (s VoiceChannelRequest) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d7df7519816a565be014dd5da39cc3f1", "score": "0.5699945", "text": "func (s Provider) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b51061d65495b779a4e1e06403b3e5d8", "score": "0.56971776", "text": "func (o *Effectiveconfiguration) String() string {\n o.Properties = map[string]interface{}{\"\": Interface{}} \n o.Advanced = map[string]interface{}{\"\": Interface{}} \n \n \n o.Credentials = map[string]Credentialinfo{\"\": {}} \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "05c123f93f222656e1cd07c1a3db6741", "score": "0.56958956", "text": "func (s InstanceInformationStringFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "61aefdbe87e3c94b33459a6e862fcbdc", "score": "0.56903714", "text": "func (o QtreeListIterRequestDesiredAttributes) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "24f0bfea8419e1d9c7653157a829aa39", "score": "0.56765294", "text": "func (op PipelineOp) String() string {\n\ts := make([]byte, 0, 32)\n\ts = append(s, \"get field \"...)\n\ts = strconv.AppendInt(s, int64(op.Field), 10)\n\tif op.DefaultValue == nil {\n\t\treturn string(s)\n\t}\n\ts = append(s, \" with default\"...)\n\treturn string(s)\n}", "title": "" }, { "docid": "24f0bfea8419e1d9c7653157a829aa39", "score": "0.56765294", "text": "func (op PipelineOp) String() string {\n\ts := make([]byte, 0, 32)\n\ts = append(s, \"get field \"...)\n\ts = strconv.AppendInt(s, int64(op.Field), 10)\n\tif op.DefaultValue == nil {\n\t\treturn string(s)\n\t}\n\ts = append(s, \" with default\"...)\n\treturn string(s)\n}", "title": "" }, { "docid": "653885e901219dba4585ec7155a26237", "score": "0.56749475", "text": "func (info Info) String() string {\n\treturn fmt.Sprintf(\"<key: %s, URL: %s, UID: %s, Inter: %v>\",\n\t\tinfo.Key, info.URL, info.UID, info.Inter)\n}", "title": "" }, { "docid": "1b1e307bd83c6a0f75ba16dd03a65acd", "score": "0.5669279", "text": "func (o *Routingconversationattributesrequest) String() string {\n \n o.SkillIds = []string{\"\"} \n \n o.RequestScoredAgents = []Requestscoredagent{{}} \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "cfd01141b2d7e6ebe283f9534990a302", "score": "0.56584644", "text": "func (m *Method) String() string {\n\n\tstr := m.Name + \"(\"\n\n\tparams := []string{}\n\n\tfor _, p := range m.Params {\n\t\tparams = append(params, strings.Join(p.Names, \", \")+\" \"+p.Type)\n\t}\n\n\tstr = str + strings.Join(params, \", \") + \")\"\n\n\tif len(m.Results) > 0 {\n\t\tstr = str + \" \"\n\t\tif len(m.Results) > 1 {\n\t\t\tstr = str + \"(\" + strings.Join(m.Results, \", \") + \")\"\n\t\t} else {\n\t\t\tstr = str + m.Results[0]\n\t\t}\n\t}\n\treturn str\n\n}", "title": "" }, { "docid": "bdd064e8e8ae04be0f9fb22e3ae855ad", "score": "0.56571686", "text": "func (s ExportApiInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b05fbb366f216fce0c964268232cf3bc", "score": "0.5651222", "text": "func (a Access) String() string {\n\t// Call Access' methods that take non arguments & return Access\n\t// if value == 0, return symbol/method that returns 0\n\t// Else, skip any method/symbol that returns 0;\n\t// append to string any method where return value & f == method's return value\n\t// return string\n\treturn enum.StringUintFlags(uint64(a), reflect.TypeOf(a), 16)\n}", "title": "" }, { "docid": "b09c49d422f61e9129da7177ef187e07", "score": "0.56450397", "text": "func (s BaiduChannelRequest) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f2131126c53ce9d241ade65d4c0e8c8c", "score": "0.56412804", "text": "func (v Verb) String() string {\n\treturn \"%\" + v.flags + v.verb\n}", "title": "" }, { "docid": "e48cc421d8de6ecad5a5da1526316415", "score": "0.5637882", "text": "func (s ListMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e48cc421d8de6ecad5a5da1526316415", "score": "0.563751", "text": "func (s ListMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e48cc421d8de6ecad5a5da1526316415", "score": "0.563751", "text": "func (s ListMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f1ea37433a881a056770fd1482b28582", "score": "0.56331027", "text": "func (de *endpoint) String() string {\n\treturn fmt.Sprintf(\"magicsock.endpoint{%v, %v}\", de.publicKey.ShortString(), de.discoShort())\n}", "title": "" }, { "docid": "61b9ead56774282db4e04c4b70570b94", "score": "0.56330127", "text": "func (s ParameterMetadata) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6e5b320dd95669bf151e7cd1556e77bf", "score": "0.56324756", "text": "func (s UsagePlanKey) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "149129bde7e23474e55545125a7e14d0", "score": "0.5628445", "text": "func (s AssociateMemberToGroupOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e041c6be9c819de6a5d40d1fd63acfc8", "score": "0.56267107", "text": "func (s ParametersFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "15b198ef69a6aad0707bb9925723c63d", "score": "0.5625523", "text": "func (s ExtendedKeyUsage) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "15b198ef69a6aad0707bb9925723c63d", "score": "0.5625523", "text": "func (s ExtendedKeyUsage) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c491613a0dbf57cdf045506b6be0cb1f", "score": "0.5624668", "text": "func (s RestApi) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
20ebec85cf259daab1b075f68066ba3e
NewStackFrame popoulates a stack frame object from the program counter.
[ { "docid": "64faca1f70f105c19e389c450d72d34a", "score": "0.7593829", "text": "func NewStackFrame(pc uintptr) (frame StackFrame) {\n\tframe = StackFrame{ProgramCounter: pc}\n\tif frame.Func() == nil {\n\t\treturn\n\t}\n\n\tframe.Package, frame.Name = packageAndName(frame.Func())\n\n\t// pc -1 because the program counters we use are usually return addresses,\n\t// and we want to show the line that corresponds to the function call\n\tframe.File, frame.LineNumber = frame.Func().FileLine(pc - 1)\n\treturn\n}", "title": "" } ]
[ { "docid": "fe5b8b2dc369246575c300954214c79b", "score": "0.76137966", "text": "func NewStackFrame(pc uintptr) (frame StackFrame) {\n\tframe = StackFrame{ProgramCounter: pc}\n\tif frame.Func() == nil {\n\t\treturn\n\t}\n\tframe.Package, frame.Name = packageAndName(frame.Func().Name())\n\n\t// pc -1 because the program counters we use are usually return addresses,\n\t// and we want to show the line that corresponds to the function call\n\tframe.File, frame.LineNumber = frame.Func().FileLine(pc - 1)\n\treturn\n}", "title": "" }, { "docid": "c75844ce8818b4ebe474d2ded880e217", "score": "0.76113725", "text": "func NewStackFrame(pc uintptr) (frame StackFrame) {\n\n\tframe = StackFrame{ProgramCounter: pc}\n\tif frame.Func() == nil {\n\t\treturn\n\t}\n\tframe.Package, frame.Name = packageAndName(frame.Func())\n\n\t// pc -1 because the program counters we use are usually return addresses,\n\t// and we want to show the line that corresponds to the function call\n\tframe.File, frame.LineNumber = frame.Func().FileLine(pc - 1)\n\treturn\n\n}", "title": "" }, { "docid": "2f18b60b717dc8790a90f6062605b8dd", "score": "0.58674294", "text": "func NewStackTrace() []*StackTrace {\n stackRecords := make([]runtime.StackRecord, STACK_BUFFERS)\n count, ok := runtime.GoroutineProfile(stackRecords)\n if !ok {\n return nil\n }\n\n results := make([]*StackTrace, 0)\n\n for i := 0; i < count; i++ {\n st := new(StackTrace)\n st.Id = i\n st.Frames = make([]*StackFrame, 0)\n frames := stackRecords[i].Stack()\n\n for x := range frames {\n f := runtime.FuncForPC(frames[x])\n file, line := f.FileLine(frames[x])\n sf := new(StackFrame)\n sf.Name = strings.TrimSpace(filepath.Base(f.Name()))\n sf.File = strings.TrimSpace(file)\n sf.Line = line\n\n st.Frames = append(st.Frames, sf)\n }\n\n results = append(results, st)\n }\n\n return results\n}", "title": "" }, { "docid": "1ee48963a6a14945aa8a39ea709c37b1", "score": "0.575521", "text": "func NewStack() *Stack { return NewStackCap(0) }", "title": "" }, { "docid": "32d7425931a37a59063e8496ec4e789c", "score": "0.5737837", "text": "func TopStackFrame(generateStacktrace func() []byte) []byte {\n\treturn generateStacktrace()\n}", "title": "" }, { "docid": "aa909c1be3064cdc01beccee1c2ca9d1", "score": "0.5707215", "text": "func newStacktrace() Stacktrace {\n\ts := make(Stacktrace, stacktraceDepth)\n\t// Skipping 3 runtime callers:\n\t// 0 - runtime.Callers()\n\t// 1 - stacktrace.New()\n\t// 2 - errors.newQueue()\n\t// 3 - errors.Wrap()\n\tn := runtime.Callers(3, s)\n\n\treturn s[0:n]\n}", "title": "" }, { "docid": "2f1fed25cd722171a56676b5ac512809", "score": "0.5641455", "text": "func NewStackFrameBuilder() StackFrameBuilder {\n\tframeBuilder := NewFrameBuilder()\n\treturn createStackFrameBuilder(frameBuilder)\n}", "title": "" }, { "docid": "51b61ab0bd8ce0f627810ba96051a04a", "score": "0.5563304", "text": "func newStack() *stack {\n\treturn &stack{}\n}", "title": "" }, { "docid": "cc40523beb8d221a3697a93a999f603d", "score": "0.5536145", "text": "func NewStackFrameFromRuntime(frame runtime.Frame) StackFrame {\n\tvar pkg, name string\n\tif frame.Func != nil {\n\t\tpkg, name = packageAndName(frame.Func.Name())\n\t} else if frame.Function != \"\" {\n\t\tpkg, name = packageAndName(frame.Function)\n\t} else {\n\t\treturn StackFrame{}\n\t}\n\treturn StackFrame{\n\t\tFile: frame.File,\n\t\tLineNumber: frame.Line,\n\t\tName: name,\n\t\tPackage: pkg,\n\t\tProgramCounter: frame.PC,\n\t}\n}", "title": "" }, { "docid": "a5dbe3076fbba9fceb2ab4b227b70046", "score": "0.5527543", "text": "func NewBacktraceFrame(pid int, fn *FunctionEntry, pc uintptr, regs *op.DwarfRegisters) (*BacktraceFrame, error) {\n\tvars, err := fn.GetVariables()\n\tif err != nil {\n\t\treturn nil, Error(err)\n\t}\n\n\tvalues, err := GetReadings(pid, pc, regs, vars...)\n\n\tsource := fmt.Sprintf(\"%#x (no debug info)\", pc)\n\tif fn.entry.data != nil {\n\t\tlineEntry, _ := NewLineEntry(pc, fn.entry.data)\n\t\tif lineEntry != nil {\n\t\t\tfilename := path.Base(lineEntry.Filename)\n\t\t\tsource = fmt.Sprintf(\"%s:%d\", filename, lineEntry.Line)\n\t\t}\n\t}\n\n\treturn &BacktraceFrame{\n\t\tfn: fn,\n\t\tFunction: fmt.Sprintf(\"%s (%#x+%#x)\", fn.Name, fn.LowPC, fn.StaticBase),\n\t\tSource: source,\n\t\tPC: fmt.Sprintf(\"%#x\", pc),\n\t\tCFA: fmt.Sprintf(\"%#x\", regs.CFA),\n\t\tFrameBase: fmt.Sprintf(\"%#x\", regs.FrameBase),\n\t\tVariables: values,\n\t}, nil\n}", "title": "" }, { "docid": "bb43d7b041d55f51106e85632c2dac2d", "score": "0.5399858", "text": "func StackNew() *Stack {\n\tretC := C.gtk_stack_new()\n\tretGo := StackNewFromC(unsafe.Pointer(retC))\n\n\treturn retGo\n}", "title": "" }, { "docid": "ed0278a54b99013494e98d7ddaab7f25", "score": "0.53920066", "text": "func newStack() *stack {\n\treturn &stack{\n\t\tnums: []int{},\n\t}\n}", "title": "" }, { "docid": "02873ba784dfb17bc88415b0c84cb3e1", "score": "0.5337001", "text": "func NewFrame(pc uintptr, file string, line int) Frame {\n\tfn := runtime.FuncForPC(pc)\n\tif fn == nil {\n\t\treturn Frame{}\n\t}\n\tpack, name := parseFunctionName(fn.Name())\n\treturn Frame{\n\t\tLine: line,\n\t\tFile: filepath.Base(file),\n\t\tPackage: pack,\n\t\tFunction: name,\n\t}\n}", "title": "" }, { "docid": "e583ebd9e801d814d968150831ce84dc", "score": "0.5298442", "text": "func NewFrameStack(cap int) *FrameStack {\n\treturn &FrameStack{\n\t\thead: &frameNode{},\n\t\tlen: 0,\n\t\tcap: cap,\n\t}\n}", "title": "" }, { "docid": "c395a6d83599931fac3a5c65a12497ac", "score": "0.5272071", "text": "func newChildFrame(back *Frame) *Frame {\n\tf := back.frameCache\n\tif f == nil {\n\t\tf = &Frame{Object: Object{typ: FrameType}}\n\t} else {\n\t\tback.frameCache, f.back = f.back, nil\n\t\t// Reset local state late.\n\t\tf.checkpoints = f.checkpoints[:0]\n\t\tf.state = 0\n\t\tf.lineno = 0\n\t}\n\tf.pushFrame(back)\n\treturn f\n}", "title": "" }, { "docid": "239305f9dd1f6e664cf89366508e0a83", "score": "0.52651745", "text": "func New() *Stack {\n\treturn &Stack{\n\t\tFrames: make([]PersistentFrame, 0),\n\t\tName: uuid.New().String(),\n\t}\n}", "title": "" }, { "docid": "31bc662c355e66221c6c2747aebf49c7", "score": "0.52533185", "text": "func buildStack(frames []runtime.Frame) stack {\n\tstack := make(stack, len(frames))\n\n\tfor i, fr := range frames {\n\t\tfile := shortenFilePath(fr.File)\n\t\tstack[i] = frame{file, functionName(fr.Function), fr.Line}\n\t}\n\n\treturn stack\n}", "title": "" }, { "docid": "410c248b24e7199bd63b32a6b045400a", "score": "0.52511895", "text": "func newStack(maxSize int) *stack {\n\treturn &stack{mu: &sync.Mutex{}, max: maxSize}\n}", "title": "" }, { "docid": "857a06977780cb33c880e2b5a955215d", "score": "0.52035254", "text": "func TestStackFrame_DoFormat(t *testing.T) {\n\n\tframe := GetStackTrace(0, 1)[0]\n\tfmt.Println(frame.doFormat())\n\n\tframe = new(T).foo()\n\tfmt.Println(frame.doFormat())\n}", "title": "" }, { "docid": "9e0958b093c1f6faecc4e1896445b973", "score": "0.519898", "text": "func NewStack() *Stack {\n\treturn &Stack{nil, 0, &sync.RWMutex{}}\n}", "title": "" }, { "docid": "28d5dcd3e0eb361588b4fbb3da652df1", "score": "0.5177919", "text": "func NewStack() *Stack {\n\treturn &Stack{nil, 0, sync.RWMutex{}}\n}", "title": "" }, { "docid": "fe1a78590e46d57e686443058df89325", "score": "0.514505", "text": "func New() *Stack { return new(Stack).Init() }", "title": "" }, { "docid": "ffe9ce9b4c35feeb52c2342d034a9fb0", "score": "0.51433986", "text": "func (app *builder) WithStackFrame(stackFrame string) Builder {\n\tapp.stackFrame = stackFrame\n\treturn app\n}", "title": "" }, { "docid": "96bd0949bd468ba319236ee482cb9286", "score": "0.51430964", "text": "func NewStack() Stack {\n\treturn Stack{}\n}", "title": "" }, { "docid": "7928c0a20e5a1d868ddddff9d492a582", "score": "0.5111397", "text": "func newAutoGrowingCallFrameStack(maxSize int) callFrameStack {\n\tcs := &autoGrowingCallFrameStack{\n\t\tsegments: make([]*callFrameStackSegment, (maxSize+(FramesPerSegment-1))/FramesPerSegment),\n\t\tsegIdx: 0,\n\t}\n\tcs.segments[0] = newCallFrameStackSegment()\n\treturn cs\n}", "title": "" }, { "docid": "7a27c0864de6bd980fbae16d304ca8be", "score": "0.50959116", "text": "func NewStack() (s *Stack) {\n\tLog(\"creating new stack\")\n\ts = new(Stack)\n\ts.Pointer = 0\n\ts.Items = make([]*StackItem, 100)\n\ts.Items[0] = NewItem()\n\treturn s\n}", "title": "" }, { "docid": "196fa94342b0476b0b2c5031ba710cdf", "score": "0.5091238", "text": "func NewStack() *Stack {\n\treturn &Stack{sync.Mutex{}, make([]interface{}, 0), 0}\n}", "title": "" }, { "docid": "a412848696d8e1087d22596454af5490", "score": "0.50859034", "text": "func (app *instructionBuilder) WithStackFrame(stackFrame StackFrame) InstructionBuilder {\n\tapp.stackFrame = stackFrame\n\treturn app\n}", "title": "" }, { "docid": "e97da1ac1731f046e29e399262e19863", "score": "0.50753945", "text": "func JNIEnvPopLocalFrame(env *JNIEnv, obj Jobject) Jobject {\n\tcenv, _ := (*C.JNIEnv)(unsafe.Pointer(env)), cgoAllocsUnknown\n\tcobj, _ := (C.jobject)(obj), cgoAllocsUnknown\n\t__ret := C.JNIEnv_PopLocalFrame(cenv, cobj)\n\t__v := (Jobject)(__ret)\n\treturn __v\n}", "title": "" }, { "docid": "50e5182f9488d8c735696e243c136126", "score": "0.50629056", "text": "func (b *bindings) popFrame() {\n\tf := b.frames[len(b.frames)-1]\n\tb.frames = b.frames[:len(b.frames)-1]\n\tf.sym0 = symbol.Invalid\n\tf.sym1 = symbol.Invalid\n\tfor k := range f.vars {\n\t\tdelete(f.vars, k)\n\t}\n\tb.pool.Put(f)\n}", "title": "" }, { "docid": "c8a525c95138937acfc1aa446b9720bc", "score": "0.50555855", "text": "func NewStack(cap int) *Stack {\n\ts := &Stack{\n\t\tsize: cap,\n\t\tcap: cap,\n\t\tmessages: make([]Message, cap),\n\t}\n\treturn s\n}", "title": "" }, { "docid": "855c5e1d99bcbe56d4fb4d85da065d78", "score": "0.5047278", "text": "func New(msg string) *StackTrace {\n\t_, file, line, _ := runtime.Caller(1)\n\tp, _ := os.Getwd()\n\n\treturn &StackTrace{\n\t\tmsg: msg,\n\t\tpath: fmt.Sprintf(\"%s:%d\", strings.TrimPrefix(file, p), line),\n\t}\n}", "title": "" }, { "docid": "f4c977585e0062084f3162c06b891d12", "score": "0.5034408", "text": "func (gip *GeneratorParser) EmitStackFrame(thread int, frame GIPStackFrame) {\n\tgip.threadList[thread] = append(gip.threadList[thread], frame)\n\tif frame.Placeholder == \"\" {\n\t\tif _, ok := gip.modules[frame.Module.ModuleName]; !ok {\n\t\t\tgip.modules[frame.Module.ModuleName] = frame.Module\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9e74537470d168cd4974e6cd9cc07afb", "score": "0.5033344", "text": "func (obj *instruction) StackFrame() StackFrame {\n\treturn obj.stackFrame\n}", "title": "" }, { "docid": "3f74b8c6daa1bbe53229370463f2211b", "score": "0.50308686", "text": "func newStack() *Stack {\n\tstk := make([]Operand, 0)\n\treturn &Stack{stk}\n}", "title": "" }, { "docid": "67554ad19a428db483d1a236c485e20a", "score": "0.5029139", "text": "func currentThread(frame *rtda.Frame) {\n\tjThread := frame.Thread().JThread()\n\tframe.OperandStack().PushRef(jThread)\n}", "title": "" }, { "docid": "b8265ed9aeab92f8b4033e257ec575c9", "score": "0.5024388", "text": "func (f *Frame) pushFrame(back *Frame) {\n\tf.back = back\n\tif back == nil {\n\t\tf.threadState = newThreadState()\n\t} else {\n\t\tf.threadState = back.threadState\n\t}\n}", "title": "" }, { "docid": "3f07a01cbb4d402cbc7aea64bf5ca457", "score": "0.50117856", "text": "func NewStack() (stack Stack) {\n\tstack.list = list.New()\n\treturn\n}", "title": "" }, { "docid": "ad154057d0548865280073bbc167c885", "score": "0.49925837", "text": "func ParseStackFrame(reader io.Reader) (routines []Goroutine, err error) {\n\tscanner := bufio.NewScanner(reader)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\troutine, err := ParseHeader(line)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Failed to parse routine header. Err: %s\", err.Error())\n\t\t\tcontinue\n\t\t}\n\n\t\troutine.StackTrace = make([]StackFrame, 0, 8)\n\t\tfor scanner.Scan() {\n\t\t\ttraceLine := scanner.Text()\n\n\t\t\tif len(traceLine) == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif strings.HasPrefix(traceLine, \"created by \") {\n\t\t\t\tif !scanner.Scan() {\n\t\t\t\t\terr = fmt.Errorf(\"Unexpected end of file\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tfile, line, pos, err := ParseStackPos(scanner.Text())\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"Failed to parse created by stack. Err: %s\", err.Error())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\troutine.CratedBy = &StackFrame{\n\t\t\t\t\tFuncName: traceLine[11:],\n\t\t\t\t\tFile: file,\n\t\t\t\t\tLine: line,\n\t\t\t\t\tPosition: pos,\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif !scanner.Scan() {\n\t\t\t\t\terr = fmt.Errorf(\"Unexpected end of file\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfile, line, pos, err := ParseStackPos(scanner.Text())\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"Failed to parse stack. Err: %s\", err.Error())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tframe := StackFrame{\n\t\t\t\t\tFuncName: traceLine,\n\t\t\t\t\tFile: file,\n\t\t\t\t\tLine: line,\n\t\t\t\t\tPosition: pos,\n\t\t\t\t}\n\t\t\t\troutine.StackTrace = append(routine.StackTrace, frame)\n\t\t\t}\n\t\t}\n\t\troutines = append(routines, routine)\n\t}\n\n\terr = scanner.Err()\n\treturn\n}", "title": "" }, { "docid": "e0db5ac32e81b71b0304d008bb67e879", "score": "0.4976845", "text": "func NewStack() *Stack {\n\treturn &Stack{lock: &sync.Mutex{}}\n}", "title": "" }, { "docid": "4f89a1b23914c357c15414cf620666c6", "score": "0.4975916", "text": "func NewStack() Stack {\r\n\treturn make(Stack, 0)\r\n}", "title": "" }, { "docid": "465f02dc7cc318cafe5db19bdb988772", "score": "0.4946569", "text": "func (vm *VM) PushFrame(frame *Frame) bool {\n\tif vm.FrameTop+1 == maxFrame {\n\t\treturn false\n\t}\n\tvm.FrameTop++\n\tvm.StackFrame[vm.FrameTop] = frame\n\treturn true\n\n}", "title": "" }, { "docid": "00885d980dd12c8ee2ed867132e6554d", "score": "0.49451673", "text": "func NewStack() Stack {\n\treturn Stack{\n\t\tdata: make([]interface{}, 0, 100),\n\t}\n}", "title": "" }, { "docid": "fb343ab6e41a28f7e59158466b16851c", "score": "0.49257845", "text": "func NewStack(context *context.Context) error {\n\ttemplate, stackName, incorrectPath := getTemplateFromFile(context)\n\tif incorrectPath != nil {\n\t\tcontext.Logger.Error(incorrectPath.Error())\n\t\treturn incorrectPath\n\t}\n\ttemplateStruct, templateError := createStackInput(&template, &stackName, context)\n\tif templateError != nil {\n\t\tcontext.Logger.Error(templateError.Error())\n\t\treturn templateError\n\t}\n\n\tcurrentSession, sessionError := prepareSession(context)\n\tif sessionError == nil {\n\n\t\tif *context.CliArguments.Progress {\n\t\t\tconn, remoteSinkError := progress.GetRemoteSink(context, currentSession)\n\t\t\tif remoteSinkError != nil {\n\t\t\t\tcontext.Logger.Error(\"Error getting remote sink configuration: \" + remoteSinkError.Error())\n\t\t\t\treturn remoteSinkError\n\t\t\t}\n\t\t\ttemplateStruct.NotificationARNs = []*string{conn.TopicArn}\n\t\t\tcreationError := createStack(templateStruct, currentSession)\n\t\t\tif creationError != nil {\n\t\t\t\tcontext.Logger.Error(\"Error creating stack: \" + creationError.Error())\n\t\t\t\treturn creationError\n\t\t\t}\n\t\t\tconn.MonitorQueue()\n\t\t} else {\n\t\t\tcreationError := createStack(templateStruct, currentSession)\n\t\t\tif creationError != nil {\n\t\t\t\tcontext.Logger.Error(\"Error creating stack: \" + creationError.Error())\n\t\t\t\treturn creationError\n\t\t\t}\n\t\t}\n\t} else {\n\t\tcontext.Logger.Error(sessionError.Error())\n\t\treturn sessionError\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "83186821a0f32c8db41d0187a1c87f88", "score": "0.48989743", "text": "func NewStack() *Stack {\n\treturn &Stack{\n\t\tg: instruments.NewGauge(0),\n\t}\n}", "title": "" }, { "docid": "0467b3f18accd1fcced7e27119994e43", "score": "0.48959246", "text": "func caller(skip int) *frame {\n\tpc, _, _, _ := runtime.Caller(skip)\n\tvar f frame = frame(pc)\n\treturn &f\n}", "title": "" }, { "docid": "25a359fc8e114aef89ed37ecbc4d972e", "score": "0.48665467", "text": "func StackTrace(skip int) Stack {\n\tpc := make([]uintptr, 50)\n\tn := runtime.Callers(skip, pc)\n\tpc = pc[:n]\n\n\tframes := runtime.CallersFrames(pc)\n\tstack := make(Stack, 0, n)\n\tfor {\n\t\tframe, more := frames.Next()\n\t\tstack = append(stack, Frame{Filename: frame.File, Method: frame.Function, Line: frame.Line})\n\n\t\tif !more {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn stack\n}", "title": "" }, { "docid": "8fc7b18b9669fbd23aac990ee83173ff", "score": "0.4852532", "text": "func NewStack(n int) *Stack {\n\treturn &Stack{}\n}", "title": "" }, { "docid": "4a1824268c6b0b0f7de4a3bd3f1f10f2", "score": "0.4843755", "text": "func (v *VM) StackPush(_ *exec.VirtualMachine) int64 {\n\tv.CallStack = append(v.CallStack, v.StackTop)\n\treturn v.StackTop\n}", "title": "" }, { "docid": "b21eee84e1ee1f99e7f15dfd09d8d820", "score": "0.4825086", "text": "func (sb *InfoBinder) popContext() {\n\tsb.contextStack = sb.contextStack[:len(sb.contextStack)-1]\n}", "title": "" }, { "docid": "ce69a295eb9a16df37e61509ccf80391", "score": "0.48129404", "text": "func newproc1(fn *funcval, argp *uint8, narg int32, nret int32, callerpc uintptr) *g {\n\t_g_ := getg()\n\n\tif fn == nil {\n\t\t_g_.m.throwing = -1 // do not dump full stacks\n\t\tthrow(\"go of nil func value\")\n\t}\n\t_g_.m.locks++ // disable preemption because it can be holding p in a local var\n\tsiz := narg + nret\n\tsiz = (siz + 7) &^ 7\n\n\t// We could allocate a larger initial stack if necessary.\n\t// Not worth it: this is almost always an error.\n\t// 4*sizeof(uintreg): extra space added below\n\t// sizeof(uintreg): caller's LR (arm) or return address (x86, in gostartcall).\n\tif siz >= _StackMin-4*sys.RegSize-sys.RegSize {\n\t\tthrow(\"newproc: function arguments too large for new goroutine\")\n\t}\n\n\t_p_ := _g_.m.p.ptr()\n\tnewg := gfget(_p_)\n\tif newg == nil {\n\t\tnewg = malg(_StackMin)\n\t\tcasgstatus(newg, _Gidle, _Gdead)\n\t\tallgadd(newg) // publishes with a g->status of Gdead so GC scanner doesn't look at uninitialized stack.\n\t}\n\tif newg.stack.hi == 0 {\n\t\tthrow(\"newproc1: newg missing stack\")\n\t}\n\n\tif readgstatus(newg) != _Gdead {\n\t\tthrow(\"newproc1: new g is not Gdead\")\n\t}\n\n\ttotalSize := 4*sys.RegSize + uintptr(siz) + sys.MinFrameSize // extra space in case of reads slightly beyond frame\n\ttotalSize += -totalSize & (sys.SpAlign - 1) // align to spAlign\n\tsp := newg.stack.hi - totalSize\n\tspArg := sp\n\tif usesLR {\n\t\t// caller's LR\n\t\t*(*unsafe.Pointer)(unsafe.Pointer(sp)) = nil\n\t\tprepGoExitFrame(sp)\n\t\tspArg += sys.MinFrameSize\n\t}\n\tmemmove(unsafe.Pointer(spArg), unsafe.Pointer(argp), uintptr(narg))\n\n\tmemclr(unsafe.Pointer(&newg.sched), unsafe.Sizeof(newg.sched))\n\tnewg.sched.sp = sp\n\tnewg.stktopsp = sp\n\tnewg.sched.pc = funcPC(goexit) + sys.PCQuantum // +PCQuantum so that previous instruction is in same function\n\tnewg.sched.g = guintptr(unsafe.Pointer(newg))\n\tgostartcallfn(&newg.sched, fn)\n\tnewg.gopc = callerpc\n\tnewg.startpc = fn.fn\n\tif isSystemGoroutine(newg) {\n\t\tatomic.Xadd(&sched.ngsys, +1)\n\t}\n\tcasgstatus(newg, _Gdead, _Grunnable)\n\n\tif _p_.goidcache == _p_.goidcacheend {\n\t\t// Sched.goidgen is the last allocated id,\n\t\t// this batch must be [sched.goidgen+1, sched.goidgen+GoidCacheBatch].\n\t\t// At startup sched.goidgen=0, so main goroutine receives goid=1.\n\t\t_p_.goidcache = atomic.Xadd64(&sched.goidgen, _GoidCacheBatch)\n\t\t_p_.goidcache -= _GoidCacheBatch - 1\n\t\t_p_.goidcacheend = _p_.goidcache + _GoidCacheBatch\n\t}\n\tnewg.goid = int64(_p_.goidcache)\n\t_p_.goidcache++\n\tif raceenabled {\n\t\tnewg.racectx = racegostart(callerpc)\n\t}\n\tif trace.enabled {\n\t\ttraceGoCreate(newg, newg.startpc)\n\t}\n\trunqput(_p_, newg, true)\n\n\tif atomic.Load(&sched.npidle) != 0 && atomic.Load(&sched.nmspinning) == 0 && unsafe.Pointer(fn.fn) != unsafe.Pointer(funcPC(main)) { // TODO: fast atomic\n\t\twakep()\n\t}\n\t_g_.m.locks--\n\tif _g_.m.locks == 0 && _g_.preempt { // restore the preemption request in case we've cleared it in newstack\n\t\t_g_.stackguard0 = stackPreempt\n\t}\n\treturn newg\n}", "title": "" }, { "docid": "882d993dc1e5fccc186dc1eb0227e5f4", "score": "0.48117885", "text": "func NewStack() *Stack {\r\n\treturn &Stack{[]int{}}\r\n}", "title": "" }, { "docid": "8141b8dea26b33250dd2ab0bd3858332", "score": "0.48077446", "text": "func NewStack() *Stack {\n\tstack := Stack{\n\t\tTargets: make([]*Target, 0),\n\t}\n\treturn &stack\n}", "title": "" }, { "docid": "2c047a108e38984f9134fdd35a441268", "score": "0.48046365", "text": "func (b *bindings) pushFrame0() {\n\tf := b.newFrame()\n\tb.frames = append(b.frames, f)\n}", "title": "" }, { "docid": "7b309f097576406180295b742e268b49", "score": "0.4804482", "text": "func NewStack() *Stack {\n\treturn &Stack{}\n}", "title": "" }, { "docid": "7b309f097576406180295b742e268b49", "score": "0.4804482", "text": "func NewStack() *Stack {\n\treturn &Stack{}\n}", "title": "" }, { "docid": "7b309f097576406180295b742e268b49", "score": "0.4804482", "text": "func NewStack() *Stack {\n\treturn &Stack{}\n}", "title": "" }, { "docid": "7b309f097576406180295b742e268b49", "score": "0.4804482", "text": "func NewStack() *Stack {\n\treturn &Stack{}\n}", "title": "" }, { "docid": "7b309f097576406180295b742e268b49", "score": "0.4804482", "text": "func NewStack() *Stack {\n\treturn &Stack{}\n}", "title": "" }, { "docid": "7b309f097576406180295b742e268b49", "score": "0.4804482", "text": "func NewStack() *Stack {\n\treturn &Stack{}\n}", "title": "" }, { "docid": "7b309f097576406180295b742e268b49", "score": "0.4804482", "text": "func NewStack() *Stack {\n\treturn &Stack{}\n}", "title": "" }, { "docid": "f8d0c1e283b652dc310058ff435d6426", "score": "0.4800476", "text": "func NewFrame() *Frame {\n\treturn framePool.Get().(*Frame)\n}", "title": "" }, { "docid": "51501bb349cd97a9967a648978023a11", "score": "0.47784123", "text": "func NewStack() *Stack {\n\treturn &Stack{array: make([]int, 10), top: -1}\n}", "title": "" }, { "docid": "b2d7e43f695873509ea548eec76203e1", "score": "0.47752142", "text": "func NewStack() *Stack {\n\tstack := new(Stack)\n\tstack.currentPage = make([]interface{}, sDefaultAllocPageSize)\n\tstack.pages = [][]interface{}{stack.currentPage}\n\tstack.offset = 0\n\tstack.capacity = sDefaultAllocPageSize\n\tstack.pageSize = sDefaultAllocPageSize\n\tstack.size = 0\n\tstack.currentPageIndex = 0\n\n\treturn stack\n}", "title": "" }, { "docid": "9adf97f61cef1d01fb046128a2fbe0ba", "score": "0.4765678", "text": "func NewFrame(err error, code, file string, line int, pkg, fn string, args ...interface{}) *Frame {\n\treturn &Frame{Err: err, Pkg: pkg, Func: fn, Args: args, Code: code, File: file, Line: line}\n}", "title": "" }, { "docid": "f2a53aa0b673dc21b5127bc2bcb21c26", "score": "0.4765017", "text": "func newTreeStack() treeStack {\n\te := treeStack{}\n\te.stack = list.New()\n\treturn e\n}", "title": "" }, { "docid": "450cad615fc9ad8130b9bf4a095465df", "score": "0.47524172", "text": "func NewStack() *Stack {\n\treturn &Stack{array: make([]int, Threshold), top: -1}\n}", "title": "" }, { "docid": "66a1398cac56e66dad6720fe5f01c82b", "score": "0.47447285", "text": "func NewStack() *Stack {\n\treturn new(Stack)\n}", "title": "" }, { "docid": "9e5157572dc2136681c9f5576c033fdf", "score": "0.47434592", "text": "func StackTrace(skip, n int) Trace {\n\ttr := make([]Location, n)\n\treturn FillStackTrace(1+skip, tr)\n}", "title": "" }, { "docid": "0da8c2c28c7aab2a4876091b7d4c2d19", "score": "0.47426057", "text": "func NewFrame(n int) Frame {\n\ti := framePool.Get()\n\tif i == nil {\n\t\treturn make(Frame, n)\n\t}\n\tf := i.(Frame)\n\tif cap(f) < n {\n\t\tf = append(f, make(Frame, n-cap(f))...)\n\t}\n\treturn f[:0:n]\n}", "title": "" }, { "docid": "ded753308dcc238b6506d9be25564b58", "score": "0.47291487", "text": "func (j *JNIState) PopLocalFrame(result JObject) {\n\tif len(j.localFrames) == 0 {\n\t\tlog.Errorf(\"No local frame to pop!\")\n\t\treturn\n\t}\n\tcurrentFrame := j.localFrames[len(j.localFrames)-1]\n\tj.localFrames = j.localFrames[:len(j.localFrames)-1]\n\tif result != 0 {\n\t\tfor _, obj := range currentFrame.allocatedObjects {\n\t\t\tif obj != result {\n\t\t\t\tj.DeallocObject(obj)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1fef0e96010dafbdda46280c8e0051ce", "score": "0.47281584", "text": "func NewStack(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\tif _, ok := err.(*StackError); ok {\n\t\treturn err\n\t}\n\treturn &StackError{Err: err, Stack: StackTrace(3)}\n}", "title": "" }, { "docid": "b2a0f29f19b7d570df42255305f6bc01", "score": "0.47215533", "text": "func New() Stack {\n\treturn stack{}\n}", "title": "" }, { "docid": "0dd45be5c93b77820fcb49ff85beb8e6", "score": "0.47143725", "text": "func newproc(siz int32, fn *funcval) {\n\targp := add(unsafe.Pointer(&fn), sys.PtrSize)\n\tpc := getcallerpc(unsafe.Pointer(&siz))\n\tsystemstack(func() {\n\t\tnewproc1(fn, (*uint8)(argp), siz, 0, pc)\n\t})\n}", "title": "" }, { "docid": "d9357a4a2d68c3c74594abb0b295557e", "score": "0.471222", "text": "func NewStack() *Stack {\n\tst := new(Stack)\n\treturn st\n}", "title": "" }, { "docid": "50b227ac43c5ad01557502df5d803523", "score": "0.4706545", "text": "func (j *JNIState) PushLocalFrame(length int) {\n\tj.localFrames = append(j.localFrames, &localFrame{\n\t\tlength: length,\n\t})\n}", "title": "" }, { "docid": "225daf2bf37ccb0330f642852f21f910", "score": "0.47047973", "text": "func CreateStack() *Stack {\n\treturn &Stack{nil, 0}\n}", "title": "" }, { "docid": "4fa654cd4ac8c5dd533e1e14d2458e80", "score": "0.47031516", "text": "func (j *JNIState) DelFromLocalFrame(obj JObject) {\n\tif len(j.localFrames) == 0 {\n\t\tlog.Errorf(\"No local frame to add!\")\n\t\treturn\n\t}\n\tframe := j.localFrames[len(j.localFrames)-1]\n\tfor i, v := range frame.allocatedObjects {\n\t\tif v == obj {\n\t\t\tframe.allocatedObjects = append(frame.allocatedObjects[:i], frame.allocatedObjects[i+1:]...)\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0fa4ad8c3da6c0dc0567b5cbb55a84fd", "score": "0.46945417", "text": "func (vm *VM) restoreStackframe(try *tryCatch) {\n\tif vm.fp == try.fp {\n\t\treturn\n\t}\n\n\t// clean up frames until the catch\n\tfor i := vm.fp; i > try.fp; i-- {\n\t\tvm.cleanupFrame(i)\n\t}\n\n\tvm.fp = try.fp\n}", "title": "" }, { "docid": "87b385f9c9aa510280ed03561f93f772", "score": "0.4692962", "text": "func New() *Stack {\n\treturn &Stack{nil, 0}\n}", "title": "" }, { "docid": "313c1e52ad81396ca98c24aaca898db7", "score": "0.46838778", "text": "func NewFrame(n, d string, s int) IFrame {\n\ta, ok := frameInst[n]\n\tif !ok {\n\t\tfmt.Printf(\"Unknown frame [%s]\\n\", n)\n\t\treturn nil\n\t}\n\n\tx := a()\n\t// if an interface could have vars...\n\tx.Init(n, d, s)\n\n\treturn x\n}", "title": "" }, { "docid": "6882f048e8d2ea71f850cd736792bd07", "score": "0.46762246", "text": "func (ls *LState) RemoveCallerFrame() *callFrame {\n\tcs := ls.stack\n\tsp := cs.Sp()\n\tparentFrame := cs.At(sp - 2)\n\tcurrentFrame := cs.At(sp - 1)\n\tparentsParentFrame := parentFrame.Parent\n\t*parentFrame = *currentFrame\n\tparentFrame.Parent = parentsParentFrame\n\tparentFrame.Idx = sp - 2\n\tcs.Pop()\n\treturn parentFrame\n}", "title": "" }, { "docid": "16896e7eb8a07f990016874543eab10f", "score": "0.46726477", "text": "func New() *Stack {\n\treturn new(Stack)\n}", "title": "" }, { "docid": "dfcfbb1a12cbff351fb8b859c18f2473", "score": "0.4671095", "text": "func Constructor() MyStack {\r\n\treturn MyStack{}\r\n}", "title": "" }, { "docid": "b5b4e98079a92082724c220195bab57c", "score": "0.4668392", "text": "func (c *StackSetController) CreateCurrentStack(ctx context.Context, ssc *core.StackSetContainer) error {\n\tnewStack, newStackVersion := ssc.NewStack()\n\tif newStack == nil {\n\t\treturn nil\n\t}\n\n\tcreated, err := c.client.ZalandoV1().Stacks(newStack.Namespace()).Create(ctx, newStack.Stack, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfixupStackTypeMeta(created)\n\n\tc.recorder.Eventf(\n\t\tssc.StackSet,\n\t\tv1.EventTypeNormal,\n\t\t\"CreatedStack\",\n\t\t\"Created stack %s\",\n\t\tnewStack.Name())\n\n\t// Persist ObservedStackVersion in the status\n\tupdated := ssc.StackSet.DeepCopy()\n\tupdated.Status.ObservedStackVersion = newStackVersion\n\n\tresult, err := c.client.ZalandoV1().StackSets(ssc.StackSet.Namespace).UpdateStatus(ctx, updated, metav1.UpdateOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfixupStackSetTypeMeta(result)\n\tssc.StackSet = result\n\n\tssc.StackContainers[created.UID] = &core.StackContainer{\n\t\tStack: created,\n\t\tPendingRemoval: false,\n\t\tResources: core.StackResources{},\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7743e04ad8adf94612942d7d0fe9a87b", "score": "0.46650004", "text": "func getFrameInfo() frameInfo {\n\t// target a the frame just outside the call stack of this logger\n\ttargetFrameIndex := 4\n\n\tprogramCounters := make([]uintptr, targetFrameIndex+1)\n\tn := runtime.Callers(0, programCounters)\n\n\tframe := runtime.Frame{Function: \"unknown\"}\n\tif n > 0 {\n\t\tframes := runtime.CallersFrames(programCounters[:n])\n\t\tfor more, frameIndex := true, 0; more && frameIndex <= targetFrameIndex; frameIndex++ {\n\t\t\tvar frameCandidate runtime.Frame\n\t\t\tframeCandidate, more = frames.Next()\n\t\t\tif frameIndex == targetFrameIndex {\n\t\t\t\tframe = frameCandidate\n\t\t\t}\n\t\t}\n\t}\n\n\treturn frameInfo{\n\t\tFunction: frame.Func.Name(),\n\t\tFile: frame.File,\n\t\tLine: frame.Line,\n\t}\n}", "title": "" }, { "docid": "99eca1de7a83b4fe6dd9709e669c4bd1", "score": "0.46620235", "text": "func New() Stack {\n\treturn &stack{}\n}", "title": "" }, { "docid": "e8e5e49582c8e38861092efc0ebc8df0", "score": "0.4660354", "text": "func (f *callFrame) clone() *callFrame {\n\tn := &callFrame{}\n\t*n = *f\n\tif f.vars != nil {\n\t\tn.vars = map[symbol.ID]Value{}\n\t\tfor k, v := range f.vars {\n\t\t\tn.vars[k] = v\n\t\t}\n\t}\n\treturn n\n}", "title": "" }, { "docid": "973ecd47d698d2c5d7967abac8ea797f", "score": "0.46580803", "text": "func (r *StackRecord) Stack() []uintptr {}", "title": "" }, { "docid": "34a0edbd80fc293bcb254f5e47246754", "score": "0.46539503", "text": "func (app *instruction) Receive(ins application_instruction.Instruction) error {\n\tif ins.IsStackframe() {\n\t\tstkFrame := ins.Stackframe()\n\t\tif stkFrame.IsPush() {\n\t\t\tapp.stackframes[app.currentStackFrameName].Push()\n\t\t\treturn nil\n\t\t}\n\n\t\tif stkFrame.IsPop() {\n\t\t\treturn app.stackframes[app.currentStackFrameName].Pop()\n\t\t}\n\n\t\tif stkFrame.IsIndex() {\n\t\t\tindexVariable := stkFrame.Index()\n\t\t\tstkFrameIndex := app.stackframes[app.currentStackFrameName].Index()\n\t\t\tvalue, err := app.computableValueBuilder.Create().WithInt64(int64(stkFrameIndex)).Now()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn app.stackframes[app.currentStackFrameName].Current().UpdateValue(indexVariable, value)\n\t\t}\n\n\t\tif stkFrame.IsSkip() {\n\t\t\tskip := stkFrame.Skip()\n\t\t\tif skip.IsVariable() {\n\t\t\t\tvariable := skip.Variable()\n\t\t\t\tindexVariable, err := app.stackframes[app.currentStackFrameName].Current().Fetch(variable)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tif !indexVariable.IsIntSixtyFour() {\n\t\t\t\t\tstr := fmt.Sprintf(\"the skip variable (%s) was expected to contain an int64 value\", variable)\n\t\t\t\t\treturn errors.New(str)\n\t\t\t\t}\n\n\t\t\t\tptrIndexVal := indexVariable.IntSixtyFour()\n\t\t\t\treturn app.stackframes[app.currentStackFrameName].Skip(int(*ptrIndexVal))\n\t\t\t}\n\t\t}\n\n\t\tif stkFrame.IsSave() {\n\t\t\tsave := stkFrame.Save()\n\t\t\tto := save.To()\n\t\t\tfrom := app.currentStackFrameName\n\t\t\tif save.HasFrom() {\n\t\t\t\tfrom = save.From()\n\t\t\t}\n\n\t\t\tif _, ok := app.stackframes[to]; !ok {\n\t\t\t\tstr := fmt.Sprintf(\"the to stackFrame (%s) does not exists\", to)\n\t\t\t\treturn errors.New(str)\n\t\t\t}\n\n\t\t\tif fromStackFrame, ok := app.stackframes[from]; ok {\n\t\t\t\tapp.stackframes[to] = fromStackFrame\n\t\t\t}\n\n\t\t\tstr := fmt.Sprintf(\"the from stackFrame (%s) does not exists\", from)\n\t\t\treturn errors.New(str)\n\t\t}\n\n\t\tif stkFrame.IsSwitch() {\n\t\t\tvariableName := stkFrame.Switch()\n\t\t\tif _, ok := app.stackframes[variableName]; !ok {\n\t\t\t\tstr := fmt.Sprintf(\"the stackFrame (%s) does not exists\", variableName)\n\t\t\t\treturn errors.New(str)\n\t\t\t}\n\n\t\t\tapp.currentStackFrameName = variableName\n\t\t}\n\t}\n\n\tif ins.IsCondition() {\n\t\tcondition := ins.Condition()\n\t\tproposition := condition.Proposition()\n\t\toperation := condition.Operation()\n\t\tif operation.IsJump() {\n\t\t\treturn app.proposition(proposition)\n\t\t}\n\n\t\treturn errors.New(\"the condition is invalid\")\n\t}\n\n\tif ins.IsStandard() {\n\t\tstandard := ins.Standard()\n\t\toperation := standard.Operation()\n\t\tresult := standard.Result()\n\t\tfirst := standard.First()\n\t\tsecond := standard.Second()\n\t\treturn app.stackframes[app.currentStackFrameName].Current().Standard(first, second, result, operation)\n\t}\n\n\tif ins.IsRemaining() {\n\t\trem := ins.Remaining()\n\t\tfirst := rem.First()\n\t\tsecond := rem.Second()\n\t\tresult := rem.Result()\n\t\tremaining := rem.Remaining()\n\t\toperation := rem.Operation()\n\t\treturn app.stackframes[app.currentStackFrameName].Current().Remaining(first, second, result, remaining, operation)\n\t}\n\n\tif ins.IsValue() {\n\t\tval := ins.Value()\n\t\tvarValue := val.Value()\n\t\toperation := val.Operation()\n\t\tif operation.IsPrint() {\n\t\t\treturn app.print(varValue)\n\t\t}\n\n\t\treturn errors.New(\"the value operation is invalid\")\n\t}\n\n\tif ins.IsInsert() {\n\t\tvr := ins.Insert()\n\t\treturn app.stackframes[app.currentStackFrameName].Current().Insert(vr)\n\t}\n\n\tif ins.IsSave() {\n\t\tvr := ins.Save()\n\t\treturn app.stackframes[app.currentStackFrameName].Current().Update(vr)\n\t}\n\n\tif ins.IsDelete() {\n\t\tname := ins.Delete()\n\t\tif _, ok := app.stackframes[name]; ok {\n\t\t\tif app.currentStackFrameName == name {\n\t\t\t\tstr := fmt.Sprintf(\"the stackFrame (%s) cannot be deleted because it is the current stackFrame\", name)\n\t\t\t\treturn errors.New(str)\n\t\t\t}\n\n\t\t\tdelete(app.stackframes, name)\n\t\t}\n\n\t\treturn app.stackframes[app.currentStackFrameName].Current().Delete(name)\n\t}\n\n\tif ins.IsCall() {\n\t\tpanic(errors.New(\"finish call in instruction (interpreter)\"))\n\t}\n\n\tif ins.IsModule() {\n\t\tpanic(errors.New(\"finish module in instruction (interpreter)\"))\n\t}\n\n\tif ins.IsExit() {\n\t\texit := ins.Exit()\n\t\tif exit.HasCondition() {\n\t\t\tcondition := exit.Condition()\n\t\t\tval, err := app.stackframes[app.currentStackFrameName].Current().Fetch(condition)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif val == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tif !val.IsBool() {\n\t\t\t\tstr := fmt.Sprintf(\"the condition inside the exit instruction was expected to be a boolean\")\n\t\t\t\treturn errors.New(str)\n\t\t\t}\n\n\t\t\tbl := val.Bool()\n\t\t\tif *bl {\n\t\t\t\tapp.stackframes[app.currentStackFrameName].Current().Stop()\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}\n\n\t\tapp.stackframes[app.currentStackFrameName].Current().Stop()\n\t\treturn nil\n\t}\n\n\tif ins.IsRegistry() {\n\t\tregistry := ins.Registry()\n\t\tif registry.IsFetch() {\n\t\t\tfetch := registry.Fetch()\n\t\t\tfrom := fetch.From()\n\t\t\tto := fetch.To()\n\t\t\tif fetch.HasIndex() {\n\t\t\t\tindex := fetch.Index()\n\t\t\t\tindexInt, err := app.registryIndexToIndex(index)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tcurrentIndex := app.stackframes[app.currentStackFrameName].Index()\n\t\t\t\terr = app.stackframes[app.currentStackFrameName].Skip(indexInt)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tfromVal, err := app.stackframes[app.currentStackFrameName].Registry().Fetch(from)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\terr = app.stackframes[app.currentStackFrameName].Current().UpdateValue(to, fromVal)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\terr = app.stackframes[app.currentStackFrameName].Skip(currentIndex)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tfromVal, err := app.stackframes[app.currentStackFrameName].Registry().Fetch(from)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\terr = app.stackframes[app.currentStackFrameName].Current().UpdateValue(to, fromVal)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}\n\n\t\tif registry.IsRegister() {\n\t\t\tregister := registry.Register()\n\t\t\tvariable := register.Variable()\n\t\t\tif register.HasIndex() {\n\t\t\t\tindex := register.Index()\n\t\t\t\tindexInt, err := app.registryIndexToIndex(index)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tcurrentIndex := app.stackframes[app.currentStackFrameName].Index()\n\t\t\t\terr = app.stackframes[app.currentStackFrameName].Skip(indexInt)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tfromVal, err := app.stackframes[app.currentStackFrameName].Current().Fetch(variable)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\terr = app.stackframes[app.currentStackFrameName].Registry().Insert(variable, fromVal)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\terr = app.stackframes[app.currentStackFrameName].Skip(currentIndex)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tfromVal, err := app.stackframes[app.currentStackFrameName].Current().Fetch(variable)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\terr = app.stackframes[app.currentStackFrameName].Registry().Insert(variable, fromVal)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}\n\n\t\tif registry.IsUnregister() {\n\t\t\tvariable := registry.Unregister()\n\t\t\terr := app.stackframes[app.currentStackFrameName].Registry().Delete(variable)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn errors.New(\"the instruction is invalid\")\n}", "title": "" }, { "docid": "baacc7597a3350a771b2f6c7a78baa2f", "score": "0.46499586", "text": "func NewLabelStack() *LabelStack {\n\treturn &LabelStack{\n\t\tLabels: make([]*Label, InitialLabelStackHeight),\n\t\tPtr: -1,\n\t}\n}", "title": "" }, { "docid": "f7f728c110414a2da612d3272d2bf2e0", "score": "0.46379775", "text": "func New() *Stack {\n\treturn &Stack{nil}\n}", "title": "" }, { "docid": "98abb8505fe8fa27b51f4354dbaa5a1b", "score": "0.46346045", "text": "func getStackAccessControlContext(frame *rtdt.Frame) {\n\t// todo\n\tframe.OperandStack.PushRef(nil)\n}", "title": "" }, { "docid": "1cc1272f9b3265bc5a4ce922ef2be96f", "score": "0.46325958", "text": "func (err *Error) StackFrames() []StackFrame {\n\tif err.frames == nil {\n\t\tfor _, pc := range err.stack {\n\t\t\tst := NewStackFrame(pc)\n\t\t\tif strings.HasPrefix(st.Package, \"plicca-go/cmd/\") {\n\t\t\t\tst.ProgramCounter = 0\n\t\t\t\terr.frames = append(err.frames, st) //err.frames[i] = st\n\t\t\t}\n\t\t}\n\t}\n\treturn err.frames\n}", "title": "" }, { "docid": "b38fe600df8d2a769f92ae849c2aa4ce", "score": "0.46294922", "text": "func getSystemStackPointer() uintptr", "title": "" }, { "docid": "f9d2fdf1da38249de7f1e1c83b3a5bec", "score": "0.46256682", "text": "func (v *VM) StackPop(_ *exec.VirtualMachine) int64 {\n\tlastEntry := len(v.CallStack) - 1\n\tnewTop, newStack := v.CallStack[lastEntry], v.CallStack[:lastEntry]\n\tv.StackTop = newTop\n\tv.CallStack = newStack\n\treturn v.StackTop\n}", "title": "" }, { "docid": "7095d5d36d6d28a29041ec059eb6d5df", "score": "0.46242276", "text": "func NewStack() Stack {\n\treturn &GenericStack{\n\t\tstack: make([]interface{}, 2),\n\t\tindex: -1,\n\t}\n}", "title": "" }, { "docid": "2c0967034028062983bbf59955190176", "score": "0.46232373", "text": "func initVM() *core.VM {\n\tvm := &core.VM{}\n\tvm.FrameTop = -1\n\tvm.StackFrame = make([]*core.Frame, 30)\n\tf := &core.Frame{}\n\tvm.PushFrame(f)\n\treturn vm\n}", "title": "" }, { "docid": "3317c7418fa55f6594b214d4587d2b38", "score": "0.4622738", "text": "func (ssc *StackSetContainer) NewStack() (*StackContainer, string) {\n\tobservedStackVersion := ssc.StackSet.Status.ObservedStackVersion\n\tstackVersion := currentStackVersion(ssc.StackSet)\n\tstackName := generateStackName(ssc.StackSet, stackVersion)\n\tstack := ssc.stackByName(stackName)\n\n\t// If the current stack doesn't exist, check that we haven't created it\n\t// before. We shouldn't recreate it if it was removed for any reason.\n\tif stack == nil && observedStackVersion != stackVersion {\n\t\tspec := &zv1.StackSpecInternal{}\n\n\t\tparentSpec := ssc.StackSet.Spec.StackTemplate.Spec.StackSpec.DeepCopy()\n\t\tif parentSpec.Service != nil {\n\t\t\tparentSpec.Service = sanitizeServicePorts(parentSpec.Service)\n\t\t}\n\t\tspec.StackSpec = *parentSpec\n\n\t\tif ssc.StackSet.Spec.Ingress != nil {\n\t\t\tspec.Ingress = ssc.StackSet.Spec.Ingress.DeepCopy()\n\t\t}\n\n\t\tif ssc.StackSet.Spec.ExternalIngress != nil {\n\t\t\tspec.ExternalIngress = ssc.StackSet.Spec.ExternalIngress.DeepCopy()\n\t\t}\n\n\t\tif ssc.StackSet.Spec.RouteGroup != nil {\n\t\t\tspec.RouteGroup = ssc.StackSet.Spec.RouteGroup.DeepCopy()\n\t\t}\n\n\t\treturn &StackContainer{\n\t\t\tStack: &zv1.Stack{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tName: stackName,\n\t\t\t\t\tNamespace: ssc.StackSet.Namespace,\n\t\t\t\t\tOwnerReferences: []metav1.OwnerReference{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAPIVersion: ssc.StackSet.APIVersion,\n\t\t\t\t\t\t\tKind: ssc.StackSet.Kind,\n\t\t\t\t\t\t\tName: ssc.StackSet.Name,\n\t\t\t\t\t\t\tUID: ssc.StackSet.UID,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tLabels: mergeLabels(\n\t\t\t\t\t\tmap[string]string{\n\t\t\t\t\t\t\tStacksetHeritageLabelKey: ssc.StackSet.Name,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tssc.StackSet.Labels,\n\t\t\t\t\t\tmap[string]string{StackVersionLabelKey: stackVersion},\n\t\t\t\t\t),\n\t\t\t\t\tAnnotations: ssc.StackSet.Spec.StackTemplate.Annotations,\n\t\t\t\t},\n\t\t\t\tSpec: *spec,\n\t\t\t},\n\t\t}, stackVersion\n\t}\n\n\treturn nil, \"\"\n}", "title": "" }, { "docid": "af53cc1274b7d0bfdb0d239fdca07208", "score": "0.46218652", "text": "func getName0(frame *rtda.Frame) {\n\tthis := frame.LocalVars().GetThis()\n\tclass := this.Extra().(*heap.Class)\n\n\tname := class.JavaName()\n\tnameObj := heap.JString(class.Loader(), name)\n\n\tframe.OperandStack().PushRef(nameObj)\n}", "title": "" } ]
a42c71832b80d179629699d8e892a05e
NormalizeHTTPRequestHeaders captures the headers (single and multivalue) sent in the API Gateway (HTTP) request and normalizes them to either an alllowercase form or to their canonical form (contenttype as opposed to ContentType) based on the value of the given 'canonical' parameter.
[ { "docid": "2b2b31c49aa06e3d7d00ff8c7b5b448a", "score": "0.81720334", "text": "func NormalizeHTTPRequestHeaders(canonical bool) gointercept.Interceptor {\n\treturn gointercept.Interceptor{\n\t\tBefore: func(context context.Context, payload interface{}) (interface{}, error) {\n\t\t\tif apiGatewayRequest, ok := payload.(events.APIGatewayProxyRequest); ok {\n\t\t\t\tif apiGatewayRequest.Headers != nil {\n\t\t\t\t\tfor key, value := range apiGatewayRequest.Headers {\n\t\t\t\t\t\tapiGatewayRequest.Headers[normalizeKey(key, canonical)] = value\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif apiGatewayRequest.MultiValueHeaders != nil {\n\t\t\t\t\tfor key, values := range apiGatewayRequest.MultiValueHeaders {\n\t\t\t\t\t\tapiGatewayRequest.MultiValueHeaders[normalizeKey(key, canonical)] = values\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn apiGatewayRequest, nil\n\t\t\t}\n\n\t\t\treturn payload, nil\n\t\t},\n\t}\n}", "title": "" } ]
[ { "docid": "2afe812e8f5046a1db8ec8cb79645610", "score": "0.6524441", "text": "func normalizeHeaders(headers map[string]string) map[string][]string {\n\ttarget := make(map[string][]string)\n\tfor key, value := range headers {\n\t\ttarget[key] = []string{value}\n\t}\n\treturn target\n}", "title": "" }, { "docid": "82293d8375e05086a9b54035ac6889f2", "score": "0.6388616", "text": "func (e *EdgeGridAuth) canonicalizedHeaders(req *http.Request) string {\n\tif len(e.HeadersToSign) < 1 {\n\t\treturn \"\"\n\t}\n\n\tvar headerNamesToSign []string\n\tfor headerName := range req.Header {\n\t\tfor _, sign := range e.HeadersToSign {\n\t\t\tif strings.EqualFold(sign, headerName) {\n\t\t\t\theaderNamesToSign = append(headerNamesToSign, headerName)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(headerNamesToSign) < 1 {\n\t\treturn \"\"\n\t}\n\n\tsort.Strings(headerNamesToSign)\n\n\tvar buffer bytes.Buffer\n\tfor _, headerName := range headerNamesToSign {\n\t\tfor _, c := range headerName {\n\t\t\tbuffer.WriteRune(unicode.ToLower(c))\n\t\t}\n\n\t\tbuffer.WriteRune(':')\n\n\t\twhite := false\n\t\tempty := true\n\t\tfor _, c := range req.Header.Get(headerName) {\n\t\t\tif unicode.IsSpace(c) {\n\t\t\t\twhite = true\n\t\t\t} else {\n\t\t\t\tif white && !empty {\n\t\t\t\t\tbuffer.WriteRune(' ')\n\t\t\t\t}\n\t\t\t\tbuffer.WriteRune(unicode.ToLower(c))\n\t\t\t\tempty = false\n\t\t\t\twhite = false\n\t\t\t}\n\t\t}\n\n\t\tbuffer.WriteRune('\\t')\n\t}\n\n\treturn buffer.String()\n}", "title": "" }, { "docid": "71005badb1b9a538ab8dd4441baa3740", "score": "0.6133487", "text": "func CanonicalizeHeaderKey(k string) string {\n\t// TODO: Deal with unsupported header keys (anything that's not a valid HTTP\n\t// header key).\n\treturn strings.ToLower(k)\n}", "title": "" }, { "docid": "92169f105b36dc8a1542b3261f0b634d", "score": "0.6026636", "text": "func (sig *Sign) getCanonicalHeaders(req *http.Request) string {\n\n\tvar headers []string\n\tfor key, values := range req.Header {\n\t\tsort.Strings(values)\n\t\tvar val []string\n\t\tfor _, value := range values {\n\t\t\t// trim the each header value\n\t\t\tval = append(val, strings.TrimSpace(value))\n\t\t}\n\t\t// canonical header by one key and all values\n\t\theaders = append(headers, strings.ToLower(key)+\":\"+strings.Join(val, \",\"))\n\t}\n\tsort.Strings(headers)\n\treturn strings.Join(headers, lineSeparator) + lineSeparator\n}", "title": "" }, { "docid": "1490aa546c81557d82af4e6804479064", "score": "0.599444", "text": "func (au *auth) canonicalHeaders(rfcdate, host string) string {\n\treturn fmt.Sprintf(\"date:%s\\nhost:%s\\n\", rfcdate, host)\n}", "title": "" }, { "docid": "16aadb7718a6e7551a0482bad2b3c6c8", "score": "0.5923611", "text": "func getCanonicalHeaders(signedHeaders http.Header) string {\n\tvar headers []string\n\tvals := make(http.Header)\n\tfor k, vv := range signedHeaders {\n\t\theaders = append(headers, strings.ToLower(k))\n\t\tvals[strings.ToLower(k)] = vv\n\t}\n\tsort.Strings(headers)\n\n\tvar buf bytes.Buffer\n\tfor _, k := range headers {\n\t\tbuf.WriteString(k)\n\t\tbuf.WriteByte(':')\n\t\tfor idx, v := range vals[k] {\n\t\t\tif idx > 0 {\n\t\t\t\tbuf.WriteByte(',')\n\t\t\t}\n\t\t\tbuf.WriteString(signV4TrimAll(v))\n\t\t}\n\t\tbuf.WriteByte('\\n')\n\t}\n\treturn buf.String()\n}", "title": "" }, { "docid": "20d6edcda570beb7a794b6ba87d6e2ec", "score": "0.5829447", "text": "func buildCanonicalizedHeader(headers http.Header) string {\n\tcm := map[string][]string{}\n\tfor k, v := range headers {\n\t\theaderName := strings.TrimSpace(strings.ToLower(k))\n\t\tif strings.HasPrefix(headerName, \"x-ms-\") {\n\t\t\tcm[headerName] = v // NOTE: the value must not have any whitespace around it.\n\t\t}\n\t}\n\tif len(cm) == 0 {\n\t\treturn \"\"\n\t}\n\n\tkeys := make([]string, 0, len(cm))\n\tfor key := range cm {\n\t\tkeys = append(keys, key)\n\t}\n\tsort.Strings(keys)\n\tch := bytes.NewBufferString(\"\")\n\tfor i, key := range keys {\n\t\tif i > 0 {\n\t\t\tch.WriteRune('\\n')\n\t\t}\n\t\tch.WriteString(key)\n\t\tch.WriteRune(':')\n\t\tch.WriteString(strings.Join(cm[key], \",\"))\n\t}\n\treturn ch.String()\n}", "title": "" }, { "docid": "a1d05dadb5c4ab95f045d37dd43b6988", "score": "0.5752162", "text": "func SanitizeHeader(header string) string {\n\n\t//Remove duplicate white space\n\tspace := regexp.MustCompile(`\\s+`)\n\theader = space.ReplaceAllString(header, \" \")\n\n\t//Now trim\n\theader = strings.TrimSpace(header)\n\n\t//Now to lower cawe\n\theader = strings.ToLower(header)\n\n\treturn header\n}", "title": "" }, { "docid": "51cf9079161a07bb05e27b1a88ec1bae", "score": "0.574557", "text": "func (txn *transaction) ProcessRequestHeaders() error {\n\tif C.msc_process_request_headers(txn.msc_txn) != 1 {\n\t\treturn errors.New(\"Could not process request headers\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ea52ffec292908a2053e176ed69f51f9", "score": "0.5658982", "text": "func ParseFromHeaders(headers http.Header) map[string]string {\n\tmetaData := make(map[string]string, 0)\n\tfor k, v := range headers {\n\t\tkey := strings.ToLower(k)\n\t\tprefix := \"x-ms-meta-\"\n\t\tif !strings.HasPrefix(key, prefix) {\n\t\t\tcontinue\n\t\t}\n\n\t\tkey = strings.TrimPrefix(key, prefix)\n\t\tmetaData[key] = v[0]\n\t}\n\treturn metaData\n}", "title": "" }, { "docid": "00bf569b0f292b185871d6afdc1ecce0", "score": "0.5630178", "text": "func NormalizeHeader(header *tar.Header, normalizeModTime bool) {\n\tif normalizeModTime {\n\t\theader.ModTime = NormalizedDateTime\n\t}\n\theader.Uid = 0\n\theader.Gid = 0\n\theader.Uname = \"\"\n\theader.Gname = \"\"\n}", "title": "" }, { "docid": "d5bb40ebd9e73eb9d516bb31b9eb0f92", "score": "0.562152", "text": "func ParseHeaders(header http.Header, v any) error {\n\tm := map[string]any{}\n\tfor k, v := range header {\n\t\tif len(v) == 1 {\n\t\t\tm[k] = v[0]\n\t\t} else {\n\t\t\tm[k] = v\n\t\t}\n\t}\n\n\treturn headerUnmarshaler.Unmarshal(m, v)\n}", "title": "" }, { "docid": "65de634e83bb5216775f8b65f2380c57", "score": "0.5621393", "text": "func (responseObject *ResponseObject) ValidateHTTPRequestHeaders(r *http.Request) bool {\n\t// check request Content-Type header\n\tif !strings.EqualFold(r.Header.Get(\"Content-Type\"), \"application/json\") {\n\t\tresponseObject.Error = &ErrorObject{\n\t\t\tCode: ParseErrorCode,\n\t\t\tMessage: ParseErrorMessage,\n\t\t\tData: \"Content-Type header must be set to 'application/json'\",\n\t\t}\n\n\t\t// set Response status code to 415 (unsupported media type)\n\t\tr = setHTTPStatusCode(r, http.StatusUnsupportedMediaType)\n\n\t\t// set pointer to HTTP request object\n\t\tresponseObject.r = r\n\n\t\treturn false\n\t}\n\n\t// check request Accept header\n\tif !strings.EqualFold(r.Header.Get(\"Accept\"), \"application/json\") {\n\t\tresponseObject.Error = &ErrorObject{\n\t\t\tCode: ParseErrorCode,\n\t\t\tMessage: ParseErrorMessage,\n\t\t\tData: \"Accept header must be set to 'application/json'\",\n\t\t}\n\n\t\t// set Response status code to 406 (not acceptable)\n\t\tr = setHTTPStatusCode(r, http.StatusNotAcceptable)\n\n\t\t// set pointer to HTTP request object\n\t\tresponseObject.r = r\n\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "33164e6bd7c2282808e60ae62edbc9eb", "score": "0.53266424", "text": "func cleanupHeaders(res *http.Response, cleanup []string) {\n\tfor _, val := range cleanup {\n\t\tdelete(res.Header, val)\n\t\tif val == \"Content-Length\" {\n\t\t\tres.ContentLength = 0\n\t\t} else if val == \"Transfer-Encoding\" {\n\t\t\tres.TransferEncoding = nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7c737a83f0387c9ad27eed1ba6dd8f36", "score": "0.53041637", "text": "func (proxy *Proxy) filterRequestHeaders(r *http.Request) {\n\tr.Header.Del(\"Accept-Encoding\")\n\tr.Header.Del(\"Proxy-Connection\")\n\tr.Header.Del(\"Proxy-Authenticate\")\n\tr.Header.Del(\"Proxy-Authorization\")\n\tr.Header.Del(\"Connection\")\n}", "title": "" }, { "docid": "e5d23d8cc44add2f0beb7f34d74d4066", "score": "0.5296081", "text": "func (au *auth) canonicalRequest(method, uri, query, rfcdate, host string) string {\n\treturn fmt.Sprintf(\n\t\t\"%s\\n%s\\n%s\\n%s\\n%s\\n%s\",\n\t\tmethod,\n\t\turi,\n\t\tquery,\n\t\tau.canonicalHeaders(rfcdate, host),\n\t\tau.signedHeaders(),\n\t\tau.payload(\"\"),\n\t)\n}", "title": "" }, { "docid": "7e15d0aafb85ed0e954ca1d055f22c8f", "score": "0.5263804", "text": "func (r Signature) getCanonicalHeaders(signedHeaders map[string][]string) string {\n\tvar headers []string\n\tvals := make(map[string][]string)\n\tfor k, vv := range signedHeaders {\n\t\theaders = append(headers, strings.ToLower(k))\n\t\tvals[strings.ToLower(k)] = vv\n\t}\n\theaders = append(headers, \"host\")\n\tsort.Strings(headers)\n\n\tvar buf bytes.Buffer\n\tfor _, k := range headers {\n\t\tbuf.WriteString(k)\n\t\tbuf.WriteByte(':')\n\t\tswitch {\n\t\tcase k == \"host\":\n\t\t\tbuf.WriteString(r.Request.Host)\n\t\t\tfallthrough\n\t\tdefault:\n\t\t\tfor idx, v := range vals[k] {\n\t\t\t\tif idx > 0 {\n\t\t\t\t\tbuf.WriteByte(',')\n\t\t\t\t}\n\t\t\t\tbuf.WriteString(v)\n\t\t\t}\n\t\t\tbuf.WriteByte('\\n')\n\t\t}\n\t}\n\treturn buf.String()\n}", "title": "" }, { "docid": "b99a15c31e1d12e9a5fa3ed0c96bdaaa", "score": "0.5201495", "text": "func (o GoogleCloudDialogflowCxV3beta1WebhookGenericWebServiceResponseOutput) RequestHeaders() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v GoogleCloudDialogflowCxV3beta1WebhookGenericWebServiceResponse) map[string]string {\n\t\treturn v.RequestHeaders\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "a0fb6f8850b9474546bd8787060ffea7", "score": "0.51661855", "text": "func FilterHeaders(r *http.Response) error {\n\tbadHeaders := []string{\n\t\t\"Connection\",\n\t\t\"Keep-Alive\",\n\t\t\"Proxy-Connection\",\n\t\t\"Transfer-Encoding\",\n\t\t\"Upgrade\",\n\t\t\"Access-Control-Allow-Headers\",\n\t\t\"Access-Control-Allow-Methods\",\n\t\t\"Access-Control-Allow-Origin\",\n\t\t\"Access-Control-Expose-Headers\",\n\t}\n\tfor _, h := range badHeaders {\n\t\tr.Header.Del(h)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ba4d4b1ad10d8ce4a170dffa2d254801", "score": "0.5163991", "text": "func (o SyntheticsTestApiStepOutput) RequestHeaders() pulumi.MapOutput {\n\treturn o.ApplyT(func(v SyntheticsTestApiStep) map[string]interface{} { return v.RequestHeaders }).(pulumi.MapOutput)\n}", "title": "" }, { "docid": "48dd5b1fb280405a8e3a2a405cefe51f", "score": "0.51517504", "text": "func (m *Mail) SanitizeHeaders() {\n\tm.Headers.Overwrite(\"From\", m.From)\n\tm.Headers.Overwrite(\"To\", strings.Join(m.To, \", \"))\n\tif m.Subject == \"\" {\n\t\tm.Headers.Overwrite(\"Subject\", \"\")\n\t} else {\n\t\tm.Headers.Overwrite(\"Subject\", string(qp.EncodedWord(m.Subject)))\n\t}\n\n\tm.Headers.Overwrite(\"MIME-Version\", \"1.0\")\n\tm.Headers.Set(\"Content-Type\", \"text/plain; charset=\\\"utf-8\\\"\")\n\tm.Headers.Set(\"Content-Disposition\", \"inline\")\n\tm.Headers.Overwrite(\"Content-Transfer-Encoding\", \"quoted-printable\")\n\tm.Headers.Set(\"User-Agent\", \"go-sendmail/1.0\")\n\tm.Headers.Set(\"Date\", time.Now().Format(time.RFC1123Z))\n\t// TODO: Message-Id?\n}", "title": "" }, { "docid": "4cd002a8890584afacd4689fddcd2e94", "score": "0.5135947", "text": "func getRequestHeaders(r *http.Request, fn headersProcessorFunc) http.Header {\n\th := r.Header\n\th.Set(\"Host\", r.Host)\n\tif len(r.TransferEncoding) > 0 {\n\t\th.Set(\"Transfer-Encoding\", strings.Join(r.TransferEncoding, \",\"))\n\t}\n\tif fn != nil {\n\t\treturn fn(h)\n\t}\n\treturn h\n}", "title": "" }, { "docid": "e7b25215eb98463306ee25bf82a33690", "score": "0.51302683", "text": "func extractSignedHeaders(signedHeaders []string, r *http.Request) (http.Header, s3err.ErrorCode) {\n\treqHeaders := r.Header\n\t// find whether \"host\" is part of list of signed headers.\n\t// if not return ErrUnsignedHeaders. \"host\" is mandatory.\n\tif !contains(signedHeaders, \"host\") {\n\t\treturn nil, s3err.ErrUnsignedHeaders\n\t}\n\textractedSignedHeaders := make(http.Header)\n\tfor _, header := range signedHeaders {\n\t\t// `host` will not be found in the headers, can be found in r.Host.\n\t\t// but its alway necessary that the list of signed headers containing host in it.\n\t\tval, ok := reqHeaders[http.CanonicalHeaderKey(header)]\n\t\tif ok {\n\t\t\tfor _, enc := range val {\n\t\t\t\textractedSignedHeaders.Add(header, enc)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tswitch header {\n\t\tcase \"expect\":\n\t\t\t// Golang http server strips off 'Expect' header, if the\n\t\t\t// client sent this as part of signed headers we need to\n\t\t\t// handle otherwise we would see a signature mismatch.\n\t\t\t// `aws-cli` sets this as part of signed headers.\n\t\t\t//\n\t\t\t// According to\n\t\t\t// http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.20\n\t\t\t// Expect header is always of form:\n\t\t\t//\n\t\t\t// Expect = \"Expect\" \":\" 1#expectation\n\t\t\t// expectation = \"100-continue\" | expectation-extension\n\t\t\t//\n\t\t\t// So it safe to assume that '100-continue' is what would\n\t\t\t// be sent, for the time being keep this work around.\n\t\t\t// Adding a *TODO* to remove this later when Golang server\n\t\t\t// doesn't filter out the 'Expect' header.\n\t\t\textractedSignedHeaders.Set(header, \"100-continue\")\n\t\tcase \"host\":\n\t\t\t// Go http server removes \"host\" from Request.Header\n\t\t\textractedSignedHeaders.Set(header, r.Host)\n\t\tcase \"transfer-encoding\":\n\t\t\tfor _, enc := range r.TransferEncoding {\n\t\t\t\textractedSignedHeaders.Add(header, enc)\n\t\t\t}\n\t\tcase \"content-length\":\n\t\t\t// Signature-V4 spec excludes Content-Length from signed headers list for signature calculation.\n\t\t\t// But some clients deviate from this rule. Hence we consider Content-Length for signature\n\t\t\t// calculation to be compatible with such clients.\n\t\t\textractedSignedHeaders.Set(header, strconv.FormatInt(r.ContentLength, 10))\n\t\tdefault:\n\t\t\treturn nil, s3err.ErrUnsignedHeaders\n\t\t}\n\t}\n\treturn extractedSignedHeaders, s3err.ErrNone\n}", "title": "" }, { "docid": "5cc117230633d79c1b61131b42e16676", "score": "0.5124795", "text": "func transformHeaders(req http.Header) map[string]string {\n\theaders := map[string]string{}\n\tfor key, header := range req {\n\t\theaders[key] = header[0]\n\t\tif len(header) > 1 {\n\t\t\theaders[key] = strings.Join(header, \", \")\n\t\t}\n\t}\n\n\treturn headers\n}", "title": "" }, { "docid": "5fae952b1946efc874829b68930caab2", "score": "0.51097566", "text": "func MatchHeaders(headers ...string) func([]string) bool {\n\tallowed := make([]string, len(headers))\n\tfor i, h := range headers {\n\t\tallowed[i] = http.CanonicalHeaderKey(h)\n\t}\n\tsort.Strings(allowed)\n\n\treturn func(reqHeaders []string) bool {\n\t\tfor _, h := range reqHeaders {\n\t\t\tch := http.CanonicalHeaderKey(h)\n\t\t\ti := sort.SearchStrings(allowed, ch)\n\t\t\tif i >= len(allowed) || allowed[i] != ch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "bb6b120aa4f24d130cfc97abf65cc143", "score": "0.5095408", "text": "func CanonicalHeaderKey(s string) string {}", "title": "" }, { "docid": "6d94fae60a00ca80fc83d769548ffa90", "score": "0.5082174", "text": "func GetHTTPHeaders(r *http.Request) http.Header {\n\t/*\n\t\tvar out []string\n\n\t\tfor name, headers := range r.Header {\n\t\t\tname = strings.ToLower(name)\n\t\t\tfor _, h := range headers {\n\t\t\t\tout = append(out, fmt.Sprintf(\"%v:%v\", name, h))\n\t\t\t}\n\t\t}\n\t\toutJSON, _ := json.Marshal(out)\n\n\t\treturn outJSON\n\t*/\n\treturn r.Header\n}", "title": "" }, { "docid": "94d620fadb8f4471a800d78cf1d2400f", "score": "0.50762016", "text": "func SanitizeHeaders(writers MetricsWriterList) MetricsWriterList {\n\tvar lastHeader string\n\tfor _, writer := range writers {\n\t\tfor i, header := range writer.stores[0].headers {\n\t\t\tif header == lastHeader {\n\t\t\t\twriter.stores[0].headers[i] = \"\"\n\t\t\t} else {\n\t\t\t\tlastHeader = header\n\t\t\t}\n\t\t}\n\t}\n\treturn writers\n}", "title": "" }, { "docid": "2c2ca01ba3bb85e57a80370f75a38557", "score": "0.50708014", "text": "func CopyRequestHeaders(originalRequest, newRequest *http.Request) {\n\tnewRequest.Header = originalRequest.Header.Clone()\n\tfor _, h := range HeaderBlacklist {\n\t\tnewRequest.Header.Del(h)\n\t}\n}", "title": "" }, { "docid": "3f06eb3b4d57301e94203d6e99b3341b", "score": "0.49924487", "text": "func (d *MessageDispatcher) toHTTPHeaders(headers map[string]string) http.Header {\n\tsafe := http.Header{}\n\n\tfor name, value := range headers {\n\t\t// Header names are case insensitive. Be sure to compare against a lower-cased version\n\t\t// (all our oracles are lower-case as well).\n\t\tname = strings.ToLower(name)\n\t\tif _, ok := d.forwardHeaders[name]; ok {\n\t\t\tsafe.Add(name, value)\n\t\t\tcontinue\n\t\t}\n\t\tfor _, prefix := range d.forwardPrefixes {\n\t\t\tif strings.HasPrefix(name, prefix) {\n\t\t\t\tsafe.Add(name, value)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn safe\n}", "title": "" }, { "docid": "3a5c9f571caab3d1351a98fb5e95688c", "score": "0.498859", "text": "func (o *ObjectMeta) Normalize() {}", "title": "" }, { "docid": "823dab21a592dca155192e0b9379f4bd", "score": "0.49459842", "text": "func (apiRequest *APIRequest) setHeaders(req *http.Request) {\n\theaders := make(map[string]string)\n\txarg := \"\"\n\n\ts := reflect.ValueOf(apiRequest).Elem()\n\ttypeOfT := s.Type()\n\tfor i := 0; i < s.NumField(); i++ {\n\t\tf := s.Field(i)\n\t\tname := typeOfT.Field(i).Name\n\t\tif name != \"Data\" && name != \"Text\" && name != \"Filename\" {\n\t\t\tif f.Interface().(string) != \"\" {\n\t\t\t\tif name == \"VoiceName\" || name == \"Volume\" || name == \"Tempo\" {\n\t\t\t\t\txarg += \",\" + name + \"=\" + f.Interface().(string)\n\t\t\t\t} else {\n\t\t\t\t\theaders[toDash(name)] = f.Interface().(string)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\theaders[\"X-Arg\"] += xarg\n\tfor key, value := range headers {\n\t\treq.Header.Add(key, value)\n\t}\n}", "title": "" }, { "docid": "4f41d01e6065a300e8343ef5e7d1be7b", "score": "0.49361512", "text": "func getCustomHTTPReqHeaders(ctx context.Context) http.Header {\n\theader, ok := twirp.HTTPRequestHeaders(ctx)\n\tif !ok || header == nil {\n\t\treturn nil\n\t}\n\tcopied := make(http.Header)\n\tfor k, vv := range header {\n\t\tif vv == nil {\n\t\t\tcopied[k] = nil\n\t\t\tcontinue\n\t\t}\n\t\tcopied[k] = make([]string, len(vv))\n\t\tcopy(copied[k], vv)\n\t}\n\treturn copied\n}", "title": "" }, { "docid": "4f41d01e6065a300e8343ef5e7d1be7b", "score": "0.49361512", "text": "func getCustomHTTPReqHeaders(ctx context.Context) http.Header {\n\theader, ok := twirp.HTTPRequestHeaders(ctx)\n\tif !ok || header == nil {\n\t\treturn nil\n\t}\n\tcopied := make(http.Header)\n\tfor k, vv := range header {\n\t\tif vv == nil {\n\t\t\tcopied[k] = nil\n\t\t\tcontinue\n\t\t}\n\t\tcopied[k] = make([]string, len(vv))\n\t\tcopy(copied[k], vv)\n\t}\n\treturn copied\n}", "title": "" }, { "docid": "4f41d01e6065a300e8343ef5e7d1be7b", "score": "0.49361512", "text": "func getCustomHTTPReqHeaders(ctx context.Context) http.Header {\n\theader, ok := twirp.HTTPRequestHeaders(ctx)\n\tif !ok || header == nil {\n\t\treturn nil\n\t}\n\tcopied := make(http.Header)\n\tfor k, vv := range header {\n\t\tif vv == nil {\n\t\t\tcopied[k] = nil\n\t\t\tcontinue\n\t\t}\n\t\tcopied[k] = make([]string, len(vv))\n\t\tcopy(copied[k], vv)\n\t}\n\treturn copied\n}", "title": "" }, { "docid": "4f41d01e6065a300e8343ef5e7d1be7b", "score": "0.49361512", "text": "func getCustomHTTPReqHeaders(ctx context.Context) http.Header {\n\theader, ok := twirp.HTTPRequestHeaders(ctx)\n\tif !ok || header == nil {\n\t\treturn nil\n\t}\n\tcopied := make(http.Header)\n\tfor k, vv := range header {\n\t\tif vv == nil {\n\t\t\tcopied[k] = nil\n\t\t\tcontinue\n\t\t}\n\t\tcopied[k] = make([]string, len(vv))\n\t\tcopy(copied[k], vv)\n\t}\n\treturn copied\n}", "title": "" }, { "docid": "4f41d01e6065a300e8343ef5e7d1be7b", "score": "0.49361512", "text": "func getCustomHTTPReqHeaders(ctx context.Context) http.Header {\n\theader, ok := twirp.HTTPRequestHeaders(ctx)\n\tif !ok || header == nil {\n\t\treturn nil\n\t}\n\tcopied := make(http.Header)\n\tfor k, vv := range header {\n\t\tif vv == nil {\n\t\t\tcopied[k] = nil\n\t\t\tcontinue\n\t\t}\n\t\tcopied[k] = make([]string, len(vv))\n\t\tcopy(copied[k], vv)\n\t}\n\treturn copied\n}", "title": "" }, { "docid": "4f41d01e6065a300e8343ef5e7d1be7b", "score": "0.49361512", "text": "func getCustomHTTPReqHeaders(ctx context.Context) http.Header {\n\theader, ok := twirp.HTTPRequestHeaders(ctx)\n\tif !ok || header == nil {\n\t\treturn nil\n\t}\n\tcopied := make(http.Header)\n\tfor k, vv := range header {\n\t\tif vv == nil {\n\t\t\tcopied[k] = nil\n\t\t\tcontinue\n\t\t}\n\t\tcopied[k] = make([]string, len(vv))\n\t\tcopy(copied[k], vv)\n\t}\n\treturn copied\n}", "title": "" }, { "docid": "4f41d01e6065a300e8343ef5e7d1be7b", "score": "0.49361512", "text": "func getCustomHTTPReqHeaders(ctx context.Context) http.Header {\n\theader, ok := twirp.HTTPRequestHeaders(ctx)\n\tif !ok || header == nil {\n\t\treturn nil\n\t}\n\tcopied := make(http.Header)\n\tfor k, vv := range header {\n\t\tif vv == nil {\n\t\t\tcopied[k] = nil\n\t\t\tcontinue\n\t\t}\n\t\tcopied[k] = make([]string, len(vv))\n\t\tcopy(copied[k], vv)\n\t}\n\treturn copied\n}", "title": "" }, { "docid": "4f41d01e6065a300e8343ef5e7d1be7b", "score": "0.49361512", "text": "func getCustomHTTPReqHeaders(ctx context.Context) http.Header {\n\theader, ok := twirp.HTTPRequestHeaders(ctx)\n\tif !ok || header == nil {\n\t\treturn nil\n\t}\n\tcopied := make(http.Header)\n\tfor k, vv := range header {\n\t\tif vv == nil {\n\t\t\tcopied[k] = nil\n\t\t\tcontinue\n\t\t}\n\t\tcopied[k] = make([]string, len(vv))\n\t\tcopy(copied[k], vv)\n\t}\n\treturn copied\n}", "title": "" }, { "docid": "3faa37328a76d377f42ad8bedaa25792", "score": "0.4904963", "text": "func setHeaders(req *http.Request, headers http.Header) {\n\tfor key, values := range headers {\n\t\tfor _, value := range values {\n\t\t\treq.Header.Add(key, value)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2da7b3dde13b6943a7abfd5faf3a9f6d", "score": "0.4897815", "text": "func setHeaders(resp http.ResponseWriter, headers map[string]string) {\n\tfor field, value := range headers {\n\t\tresp.Header().Set(http.CanonicalHeaderKey(field), value)\n\t}\n}", "title": "" }, { "docid": "daecf297b95c48aaf29594fc6c80a641", "score": "0.48865968", "text": "func TestMustHaveHeadersSet(t *testing.T) {\n\tt.Parallel()\n\tclients := test.Setup(t)\n\n\t_, ri, err := fetchRuntimeInfo(t, clients)\n\tif err != nil {\n\t\tt.Fatal(\"Error fetching runtime info:\", err)\n\t}\n\n\t// For incoming requests, the Host header is promoted to the\n\t// Request.Host field and removed from the Header map. Therefore we\n\t// check against the Host field instead of the map.\n\tif ri.Request.Host == \"\" {\n\t\t// We just check that the host header exists and is non-empty as the request\n\t\t// may be made internally or externally which will result in a different host.\n\t\tt.Error(\"Header host was not present on request\")\n\t}\n\n\texpectedHeaders := map[string]stringMatcher{\n\t\t// We expect the forwarded header to be key-value pairs separated by commas and semi-colons, where\n\t\t// the allowed keys are `for`, `by`, `proto` and `host` and values are loosely validated by shape.\n\t\t// See https://tools.ietf.org/html/rfc7239#section-4 for the full syntax rules.\n\t\t\"forwarded\": &checkForwardedHeader{expected: \"valid Forwarded header per RFC7239\"},\n\t}\n\n\theaders := ri.Request.Headers\n\n\tmatchHeaders(t, headers, expectedHeaders)\n}", "title": "" }, { "docid": "849dde9dc952f19463d0c9ab8fae680d", "score": "0.48800784", "text": "func cloneAllowedHeaders(in http.Header) http.Header {\n\tout := http.Header{}\n\tvar val string\n\tfor i := 0; i < len(allowedHeaders); i++ {\n\t\tval = in.Get(allowedHeaders[i])\n\t\tif val != \"\" {\n\t\t\tout.Add(allowedHeaders[i], val)\n\t\t}\n\t}\n\treturn out\n}", "title": "" }, { "docid": "36bc93952ce4eca0a31afbf5fbeb0f9e", "score": "0.4868326", "text": "func (o GoogleCloudDialogflowCxV3beta1WebhookGenericWebServiceOutput) RequestHeaders() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v GoogleCloudDialogflowCxV3beta1WebhookGenericWebService) map[string]string {\n\t\treturn v.RequestHeaders\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "921d3fcdfec04eeecf79a6cdc807bbf6", "score": "0.48621905", "text": "func CloneRequestHeaders(headers map[string][]string) map[string][]string {\n\tm := make(map[string][]string, len(headers))\n\tfor k, vs := range headers {\n\t\ttmp := make([]string, len(vs))\n\t\tcopy(tmp, vs)\n\t\tm[k] = tmp\n\t}\n\treturn m\n}", "title": "" }, { "docid": "56b02e087bb8fbf4c641d2a6d6f85945", "score": "0.48558536", "text": "func RequestHeaders() gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\n\t\tplatform := strings.ToLower(c.GetHeader(\"X-OPN-Platform\"))\n\t\tosVersion := strings.ToLower(c.GetHeader(\"X-OPN-OS-Version\"))\n\t\tdeviceName := strings.ToLower(c.GetHeader(\"X-OPN-Device-Name\"))\n\t\tclientVersion := strings.ToLower(c.GetHeader(\"X-OPN-Client-Version\"))\n\n\t\tif platform == \"\" {\n\t\t\tc.AbortWithStatusJSON(http.StatusBadRequest, responses.NewInvalidHeaderErrorStatus(\"Platform ( X-OPN-Platform ) should be ios or android\"))\n\t\t\treturn\n\t\t}\n\t\tif osVersion == \"\" {\n\t\t\tc.AbortWithStatusJSON(http.StatusBadRequest, responses.NewInvalidHeaderErrorStatus(\"OS Version( X-OPN-OS-Version ) is empty\"))\n\t\t\treturn\n\t\t}\n\t\tif deviceName == \"\" {\n\t\t\tc.AbortWithStatusJSON(http.StatusBadRequest, responses.NewInvalidHeaderErrorStatus(\"Device Name( X-OPN-Device-Name ) is empty\"))\n\t\t\treturn\n\t\t}\n\t\tif clientVersion == \"\" {\n\t\t\tc.AbortWithStatusJSON(http.StatusBadRequest, responses.NewInvalidHeaderErrorStatus(\"Client Version( X-OPN-Client-Version ) is empty\"))\n\t\t\treturn\n\t\t}\n\n\t\tc.Set(\"Platform\", platform)\n\t\tc.Set(\"OsVersion\", osVersion)\n\t\tc.Set(\"DeviceName\", deviceName)\n\t\tc.Set(\"ClientVersion\", clientVersion)\n\n\t\tc.Next()\n\t}\n}", "title": "" }, { "docid": "e368c2f48fe4846722b2dde41f829b9a", "score": "0.48454377", "text": "func setHeaders(req *http.Request, headers http.Header) {\n for key, values := range headers {\n for _, value := range values {\n req.Header.Add(key, value)\n }\n }\n}", "title": "" }, { "docid": "d9f542b4bd329c06a4e4935ee29f06d6", "score": "0.48181117", "text": "func (dsn Dsn) RequestHeaders() map[string]string {\n\tauth := fmt.Sprintf(\"Sentry sentry_version=%s, sentry_timestamp=%d, \"+\n\t\t\"sentry_client=sentry.go/%s, sentry_key=%s\", apiVersion, time.Now().Unix(), Version, dsn.publicKey)\n\n\tif dsn.secretKey != \"\" {\n\t\tauth = fmt.Sprintf(\"%s, sentry_secret=%s\", auth, dsn.secretKey)\n\t}\n\n\treturn map[string]string{\n\t\t\"Content-Type\": \"application/json\",\n\t\t\"X-Sentry-Auth\": auth,\n\t}\n}", "title": "" }, { "docid": "2d7fade1fc3f0c61013b455e42016ecb", "score": "0.48026517", "text": "func CheckHeaders(h *httptest.ResponseRecorder) error {\n\tacao := h.Header().Get(\"Access-Control-Allow-Origin\")\n\tif acao != \"*\" {\n\t\treturn errors.New(\"Access-Control-Allow-Origin Header not set\")\n\t}\n\tacam := h.Header().Get(\"Access-Control-Allow-Methods\")\n\tif acam != \"GET, PUT, POST, PATCH, DELETE\" {\n\t\treturn errors.New(\"Access-Control-Allow-Methods Header not set\")\n\t}\n\tacah := h.Header().Get(\"Access-Control-Allow-Headers\")\n\tif acah != \"Content-Type, Authorization\" {\n\t\treturn errors.New(\"Access-Control-Allow-Headers Header not set\")\n\t}\n\taceh := h.Header().Get(\"Access-Control-Expose-Headers\")\n\tif aceh != \"Authorization\" {\n\t\treturn errors.New(\"Access-Control-Expose-Headers Header not set\")\n\t}\n\tacma := h.Header().Get(\"Access-Control-Max-Age\")\n\tif acma != \"600\" {\n\t\treturn errors.New(\"Access-Control-Max-Age Header not set\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ffd24ac2d002caf564447cac5f2c9bac", "score": "0.47981238", "text": "func (ab *AccountBlock) Normalize() {\n\tab.Action = strings.TrimSpace(ab.Action)\n\tab.Account = strings.TrimSpace(ab.Account)\n\tab.Token = strings.TrimSpace(ab.Token)\n\tab.Previous = strings.TrimSpace(ab.Previous)\n\tab.Representative = strings.TrimSpace(ab.Representative)\n\tab.Link = strings.TrimSpace(ab.Link)\n\tab.Signature = strings.TrimSpace(ab.Signature)\n}", "title": "" }, { "docid": "b7dc605ff9ef876dde539ba4b559b7ef", "score": "0.47956583", "text": "func (o HttpRequestOutput) Headers() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v HttpRequest) map[string]string { return v.Headers }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "c9eafee79adb28c52350ff5d4f9f0115", "score": "0.47756672", "text": "func RequestHeader(req *http.Request) *Header {\n\treturn &Header{\n\t\th: req.Header,\n\t\thost: func() string { return req.Host },\n\t\tcl: func() int64 { return req.ContentLength },\n\t\tte: func() []string { return req.TransferEncoding },\n\t\tsetHost: func(host string) { req.Host = host },\n\t\tsetCL: func(cl int64) { req.ContentLength = cl },\n\t\tsetTE: func(te []string) { req.TransferEncoding = te },\n\t}\n}", "title": "" }, { "docid": "0faa7c92e155f383332dfc8a0b7d64ac", "score": "0.47582778", "text": "func (t *TypeMeta) Normalize() {}", "title": "" }, { "docid": "55876ba7e93deeddc0eef64e895b882a", "score": "0.47357363", "text": "func SetChromeHeaders(req *http.Request) *http.Request {\n\treq.Header.Add(\"Connection\", \"keep-alive\")\n\treq.Header.Add(\"Cache-Control\", \"max-age=0\")\n\treq.Header.Add(\"Upgrade-Insecure-Requests\", \"1\")\n\treq.Header.Add(\"User-Agent\", \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\")\n\treq.Header.Add(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\")\n\treq.Header.Add(\"Accept-Language\", \"ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7\")\n\treq.Header.Add(\"Accept-Encoding\", \"gzip, deflate\")\n\n\treturn req\n}", "title": "" }, { "docid": "80a4874b6f16d59e6fc531683e17579f", "score": "0.47349563", "text": "func (s Schema) Normalize(data map[string][]string) map[string][]string {\n\tfor _, values := range data {\n\t\tfor i, value := range values {\n\t\t\tvalues[i] = strings.TrimFunc(value, func(r rune) bool {\n\t\t\t\tif unicode.IsSpace(r) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\t// https://www.compart.com/en/unicode/U+200B, Zero Width Space\n\t\t\t\tif r == '\\u200B' {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\t// https://www.compart.com/en/unicode/U+200C, Zero Width Non-joiner\n\t\t\t\tif r == '\\u200C' {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\t// https://www.compart.com/en/unicode/U+200D, Zero Width Joiner\n\t\t\t\tif r == '\\u200D' {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\t// https://www.compart.com/en/unicode/U+2060, Word Joiner\n\t\t\t\tif r == '\\u2060' {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\treturn false\n\t\t\t})\n\t\t}\n\t}\n\treturn data\n}", "title": "" }, { "docid": "3302273506368f39fe0f2bcf277f4c4d", "score": "0.47311673", "text": "func mergePEMHeaders(original, newSet map[string]string) {\n\tfor key, value := range newSet {\n\t\tnormalizedKey := strings.TrimSpace(strings.ToLower(key))\n\t\tif normalizedKey != \"proc-type\" && normalizedKey != \"dek-info\" {\n\t\t\toriginal[key] = value\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5350534f1ae5475f707906d5c6cc46f7", "score": "0.4729834", "text": "func Normalize(s string) string {\n\ts = defaultNormalizer.normalize(s)\n\ts = cleanup(s)\n\treturn s\n}", "title": "" }, { "docid": "efe45521fe94f257550bdcb9b317da29", "score": "0.472059", "text": "func HTTPHeaderToMetadata(header http.Header) CrossProcessMetadata {\n\tif header == nil {\n\t\treturn CrossProcessMetadata{}\n\t}\n\n\treturn CrossProcessMetadata{\n\t\tID: header.Get(cat.NewRelicIDName),\n\t\tTxnData: header.Get(cat.NewRelicTxnName),\n\t\tSynthetics: header.Get(cat.NewRelicSyntheticsName),\n\t}\n}", "title": "" }, { "docid": "d00ff359c52166e799f2b4b64775d6fb", "score": "0.47152895", "text": "func (lc Lifecycle) SetPredictionHeaders(w http.ResponseWriter, obj ObjectOpts) {\n\tevent := lc.eval(obj, time.Time{})\n\tswitch event.Action {\n\tcase DeleteAction, DeleteVersionAction:\n\t\tw.Header()[xhttp.AmzExpiration] = []string{\n\t\t\tfmt.Sprintf(`expiry-date=\"%s\", rule-id=\"%s\"`, event.Due.Format(http.TimeFormat), event.RuleID),\n\t\t}\n\tcase TransitionAction, TransitionVersionAction:\n\t\tw.Header()[xhttp.MinIOTransition] = []string{\n\t\t\tfmt.Sprintf(`transition-date=\"%s\", rule-id=\"%s\"`, event.Due.Format(http.TimeFormat), event.RuleID),\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1055f8358f1bf8a145ff47b13274984c", "score": "0.47073427", "text": "func MetadataToHTTPHeader(metadata CrossProcessMetadata) http.Header {\n\theader := http.Header{}\n\n\tif metadata.ID != \"\" {\n\t\theader.Add(cat.NewRelicIDName, metadata.ID)\n\t}\n\n\tif metadata.TxnData != \"\" {\n\t\theader.Add(cat.NewRelicTxnName, metadata.TxnData)\n\t}\n\n\tif metadata.Synthetics != \"\" {\n\t\theader.Add(cat.NewRelicSyntheticsName, metadata.Synthetics)\n\t}\n\n\treturn header\n}", "title": "" }, { "docid": "046ffe89b031a0f90352b77f90c16e8f", "score": "0.47072986", "text": "func filterHeaders(headers http.Header, iterator headerIterator) {\n\tfor k, v := range headers {\n\t\t// Skip sensitive headers\n\t\tif k == \"Authorization\" || k == \"Cookie\" {\n\t\t\tcontinue\n\t\t}\n\t\titerator(k, v)\n\t}\n}", "title": "" }, { "docid": "3a767cf81cc4e3c8255aeb4dfc487ee6", "score": "0.470068", "text": "func (o GoogleCloudDialogflowCxV3beta1WebhookGenericWebServicePtrOutput) RequestHeaders() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *GoogleCloudDialogflowCxV3beta1WebhookGenericWebService) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.RequestHeaders\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "78700c9f3b0ba9c87f02784d6cbe8c3d", "score": "0.4694682", "text": "func sanitizeRequest(req *http.Request) *http.Request {\n\tr := new(http.Request)\n\n\t// shallow clone\n\t*r = *req\n\n\t// deep copy headers\n\tr.Header = cloneAllowedHeaders(req.Header)\n\n\treturn r\n}", "title": "" }, { "docid": "4f938dbbc28acbe220a5e25b9b0e1545", "score": "0.46940994", "text": "func Headers(headers ...string) func(http.Handler) http.Handler {\n\n\treturn func(h http.Handler) http.Handler {\n\n\t\tfn := func(w http.ResponseWriter, r *http.Request) {\n\t\t\tfor _, h := range headers {\n\t\t\t\telems := strings.Split(h, \":\")\n\t\t\t\tif len(elems) != 2 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tr.Header.Set(strings.TrimSpace(elems[0]), strings.TrimSpace(elems[1]))\n\t\t\t}\n\t\t\th.ServeHTTP(w, r)\n\t\t}\n\t\treturn http.HandlerFunc(fn)\n\t}\n}", "title": "" }, { "docid": "6a6febfa19e49b98c4932906f732f55b", "score": "0.46908197", "text": "func (c Chain) Normalize(document string) string {\n\tfor _, normalizer := range c {\n\t\tdocument = normalizer.normalize(document)\n\t}\n\n\treturn document\n}", "title": "" }, { "docid": "ce7cbc00d7c197e293b1a6162330b909", "score": "0.46857375", "text": "func filterHeaders(headers http.Header, iterator headerIterator) {\n\tfor k, v := range headers {\n\t\t// Skip sensitive headers\n\t\tif k == \"Authorization\" || k == \"Cookie\" {\n\t\t\titerator(k, []string{\"*****\"})\n\t\t\tcontinue\n\t\t}\n\t\titerator(k, v)\n\t}\n}", "title": "" }, { "docid": "8b5e905a1dc17e1d3992c22974b81bc0", "score": "0.46825492", "text": "func MergeHeader(base, extra http.Header, overwrite bool) http.Header {\n\tfor k, vals := range extra {\n\t\tif overwrite {\n\t\t\tbase.Del(k)\n\t\t}\n\n\t\tfor _, v := range vals {\n\t\t\tv = strings.TrimSpace(v)\n\t\t\tif len(v) > 0 {\n\t\t\t\tbase.Add(k, v)\n\t\t\t}\n\t\t}\n\t}\n\treturn base\n}", "title": "" }, { "docid": "73d8198f002aabeabc1f5606fb0f163a", "score": "0.46727967", "text": "func incomingHeaderMatcher(key string) (string, bool) {\n\tkey = textproto.CanonicalMIMEHeaderKey(key)\n\tif isPermanentHTTPHeader(key) {\n\t\treturn runtime.MetadataPrefix + key, true\n\t}\n\tif isReserved(key) {\n\t\treturn \"X-\" + key, true\n\t}\n\n\t// The Istio service mesh dislikes when you pass the Content-Length header\n\tif key == \"Content-Length\" {\n\t\treturn \"\", false\n\t}\n\n\treturn key, true\n}", "title": "" }, { "docid": "aa9080cf98ca57202712c6181ea5b7c4", "score": "0.46727723", "text": "func (t *File_Template) Normalize() error {\n\tif t.DistributorConfigName == \"\" {\n\t\treturn fmt.Errorf(\"missing distributor_config_name\")\n\t}\n\tif err := t.Payload.Normalize(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "268cead3e82cde4dca10d5e6e3a761f0", "score": "0.46716005", "text": "func (b *ConfirmBlock) Normalize() {\n\tb.Previous = strings.TrimSpace(b.Previous)\n\tb.Addr = strings.TrimSpace(b.Addr)\n\tb.Head = strings.TrimSpace(b.Head)\n\tb.Account = strings.TrimSpace(b.Account)\n\tb.Signature = strings.TrimSpace(b.Signature)\n}", "title": "" }, { "docid": "35bd350b62a7e6f99a3f421454289d20", "score": "0.46632352", "text": "func (o *NormalizeNamesParams) WithHTTPClient(client *http.Client) *NormalizeNamesParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "7f92d01bdeda118e838e04aa2117b1c0", "score": "0.46490604", "text": "func (n Normalizer) Normalize(env []string) []string {\n\tvar normalized []string\n\n\t// common\n\tnormalized = append(normalized, \"NCI=true\")\n\tnormalized = append(normalized, \"NCI_VERSION=\"+n.version)\n\tnormalized = append(normalized, \"NCI_SERVICE_NAME=\"+n.name)\n\tnormalized = append(normalized, \"NCI_SERVICE_SLUG=\"+n.slug)\n\n\t// server\n\tnormalized = append(normalized, \"NCI_SERVER_NAME=GitHub\")\n\tnormalized = append(normalized, \"NCI_SERVER_HOST=github.com\")\n\tnormalized = append(normalized, \"NCI_SERVER_VERSION=\")\n\n\t// worker\n\tnormalized = append(normalized, \"NCI_WORKER_ID=\"+common.GetEnvironment(env, \"RUNNER_TRACKING_ID\"))\n\tnormalized = append(normalized, \"NCI_WORKER_NAME=\"+common.GetEnvironment(env, \"RUNNER_TRACKING_ID\"))\n\tnormalized = append(normalized, \"NCI_WORKER_VERSION=\"+common.GetEnvironment(env, \"ImageVersion\"))\n\tnormalized = append(normalized, \"NCI_WORKER_ARCH=\"+runtime.GOOS+\"/\"+runtime.GOARCH)\n\n\t// pipeline\n\tpipelineEvent := common.GetEnvironment(env, \"GITHUB_EVENT_NAME\")\n\tswitch pipelineEvent {\n\tcase \"push\":\n\t\tnormalized = append(normalized, \"NCI_PIPELINE_TRIGGER=push\")\n\tcase \"pull_request\":\n\t\tnormalized = append(normalized, \"NCI_PIPELINE_TRIGGER=pull_request\")\n\tdefault:\n\t\tnormalized = append(normalized, \"NCI_PIPELINE_TRIGGER=unknown\")\n\t}\n\tif common.GetEnvironment(normalized, \"NCI_PIPELINE_TRIGGER\") == \"pull_request\" {\n\t\t// PR\n\t\tnormalized = append(normalized, \"NCI_PIPELINE_PULL_REQUEST_ID=unknown\") // not supported by GH yet.\n\t}\n\tnormalized = append(normalized, \"NCI_PIPELINE_STAGE_NAME=\"+common.GetEnvironment(env, \"GITHUB_WORKFLOW\"))\n\tnormalized = append(normalized, \"NCI_PIPELINE_STAGE_SLUG=\"+common.GetSlug(common.GetEnvironment(env, \"GITHUB_WORKFLOW\")))\n\tnormalized = append(normalized, \"NCI_PIPELINE_JOB_NAME=\"+common.GetEnvironment(env, \"GITHUB_ACTION\"))\n\tnormalized = append(normalized, \"NCI_PIPELINE_JOB_SLUG=\"+common.GetSlug(common.GetEnvironment(env, \"GITHUB_ACTION\")))\n\n\t// project\n\tnormalized = append(normalized, \"NCI_PROJECT_ID=\"+common.GetSlug(common.GetEnvironment(env, \"GITHUB_REPOSITORY\")))\n\tnormalized = append(normalized, \"NCI_PROJECT_NAME=\"+common.GetEnvironment(env, \"GITHUB_REPOSITORY\"))\n\tnormalized = append(normalized, \"NCI_PROJECT_SLUG=\"+common.GetSlug(common.GetEnvironment(env, \"GITHUB_REPOSITORY\")))\n\tnormalized = append(normalized, \"NCI_PROJECT_DIR=\"+common.GetGitDirectory())\n\n\t// repository\n\tnormalized = append(normalized, common.GetSCMArguments(common.GetGitDirectory())...)\n\n\treturn normalized\n}", "title": "" }, { "docid": "87625337ce635a965f9313964dae514e", "score": "0.4647668", "text": "func ExampleReverseAccessControlAllowHeaders_multiple_headers() {\n\th := AccessControlAllowHeaders{\n\t\tHeaders: []string{\"X-Custom-Header\", \"Upgrade-Insecure-Requests\"},\n\t}\n\tfmt.Printf(\"%s: %s\", h.Name(), h.Value())\n\t// Output: Access-Control-Allow-Headers: X-Custom-Header, Upgrade-Insecure-Requests\n}", "title": "" }, { "docid": "8bef2511c2bba7b894de0b695b4a4fa9", "score": "0.46435592", "text": "func (d *Jsondata) JsondataNormalize(regexps []*regexp.Regexp) {\n\td.NormalizedMessage = d.Message\n\tfor _, i := range regexps {\n\t\td.NormalizedMessage = i.ReplaceAllString(d.NormalizedMessage, \"\")\n\t}\n}", "title": "" }, { "docid": "f1d3008bbbbec6e57a57eb823261ee9a", "score": "0.46408036", "text": "func Headers(w http.ResponseWriter, req *http.Request) {\n\n\tfor name, headers := range req.Header {\n\t\tfor _, h := range headers {\n\t\t\tfmt.Fprintf(w, \"%v: %v\\n\", name, h)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "436e0cd9dc29aa350778f5bed89e8ea7", "score": "0.46401608", "text": "func (a *ResourceArgs) PrepareForwardHeaders() []string {\n\tif !a.Tag.ForwardHeadersAll && len(a.Tag.ForwardHeaders) == 0 {\n\t\treturn []string{}\n\t}\n\tif a.Tag.ForwardHeadersAll {\n\t\tret := make([]string, 0, len(a.ExternalReq.Header))\n\t\tfor hn, hvs := range a.ExternalReq.Header {\n\t\t\tif !DropHeadersForward[hn] {\n\t\t\t\tfor _, hv := range hvs {\n\t\t\t\t\tret = append(ret, hn, hv)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret\n\t}\n\n\tret := make([]string, 0, len(a.Tag.ForwardHeaders))\n\tfor _, hn := range a.Tag.ForwardHeaders {\n\t\tif hvs, ok := a.ExternalReq.Header[hn]; ok && !DropHeadersForward[hn] {\n\t\t\tfor _, hv := range hvs {\n\t\t\t\tret = append(ret, hn, hv)\n\t\t\t}\n\t\t}\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "372447e989486f04c60d02df97129824", "score": "0.4628283", "text": "func CanonicalMIMEHeaderKey(s string) string", "title": "" }, { "docid": "35ef7848822034abc6477621ac3f55ac", "score": "0.46174252", "text": "func execCanonicalHeaderKey(_ int, p *gop.Context) {\n\targs := p.GetArgs(1)\n\tret := http.CanonicalHeaderKey(args[0].(string))\n\tp.Ret(1, ret)\n}", "title": "" }, { "docid": "fa4cb5c8b3bb47fee1cedd73d1c1292f", "score": "0.4616298", "text": "func normalize(inputs ...string) string {\n\tsc := unicode.SpecialCase{}\n\tname := make([]string, 0, len(inputs))\n\n\tfor _, input := range inputs {\n\t\tinput = strings.TrimSpace(input)\n\t\tif input != \"\" {\n\n\t\t\toutput := strings.ToLowerSpecial(sc, input)\n\n\t\t\toutput = reSpecialA.ReplaceAllLiteralString(output, \"a\")\n\n\t\t\toutput = reSpecialE.ReplaceAllLiteralString(output, \"e\")\n\n\t\t\toutput = reSpecialI.ReplaceAllLiteralString(output, \"i\")\n\n\t\t\toutput = reSpecialO.ReplaceAllLiteralString(output, \"o\")\n\n\t\t\toutput = reSpecialU.ReplaceAllLiteralString(output, \"u\")\n\n\t\t\toutput = reSpecialN.ReplaceAllLiteralString(output, \"n\")\n\n\t\t\toutput = reSpecialNotAlpha.ReplaceAllLiteralString(output, \" \")\n\n\t\t\toutput = reSpecialSpaces.ReplaceAllLiteralString(output, \" \")\n\n\t\t\toutput = strings.Replace(strings.TrimSpace(output), \" \", fileSeparator, -1)\n\n\t\t\tname = append(name, output)\n\t\t}\n\t}\n\n\treturn strings.Join(name, fileSeparator)\n}", "title": "" }, { "docid": "c99006e04862264819fc79d881b2d7be", "score": "0.46115056", "text": "func (ab *OrderBlock) Normalize() {\n\tab.Action = strings.TrimSpace(ab.Action)\n\tab.Account = strings.TrimSpace(ab.Account)\n\tab.Token = strings.TrimSpace(ab.Token)\n\tab.ID = strings.TrimSpace(ab.ID)\n\tab.Previous = strings.TrimSpace(ab.Previous)\n\tab.Quote = strings.TrimSpace(ab.Quote)\n\tab.Link = strings.TrimSpace(ab.Link)\n\tab.Executor = strings.TrimSpace(ab.Executor)\n\tab.Signature = strings.TrimSpace(ab.Signature)\n}", "title": "" }, { "docid": "16333faf1afcc407d80af30316b36f3a", "score": "0.4609882", "text": "func Normalize(s string) string {\n\tregex := regexp.MustCompile(\"[^a-zA-Z0-9]+\")\n\ts = regex.ReplaceAllString(s, \"\")\n\ts = strings.ToLower(s)\n\treturn s\n}", "title": "" }, { "docid": "de8be9c1435454167f27f47e347d7712", "score": "0.46066865", "text": "func getSignedHeaders(signedHeaders http.Header) string {\n\tvar headers []string\n\tfor k := range signedHeaders {\n\t\theaders = append(headers, strings.ToLower(k))\n\t}\n\tsort.Strings(headers)\n\treturn strings.Join(headers, \";\")\n}", "title": "" }, { "docid": "1f767d950300ae29ee2b1ebfba18d647", "score": "0.45994478", "text": "func SanitizeHostForHeader(r *http.Request) {\n\thost := getHost(r)\n\tport := portOnly(host)\n\tif port != \"\" && isDefaultPort(r.URL.Scheme, port) {\n\t\tr.Host = stripPort(host)\n\t}\n}", "title": "" }, { "docid": "c148ab1ec55fe702aa7dee83b8b410f8", "score": "0.45972016", "text": "func (o StandardWebTestRequestOutput) Headers() StandardWebTestRequestHeaderArrayOutput {\n\treturn o.ApplyT(func(v StandardWebTestRequest) []StandardWebTestRequestHeader { return v.Headers }).(StandardWebTestRequestHeaderArrayOutput)\n}", "title": "" }, { "docid": "248cd2438ca4b030ed1d0b357bcdf479", "score": "0.4596064", "text": "func (opts *ExecOption) MatchCpRequestHeaders(host string, repo string, headers ...string) *ExecOption {\n\turlPrefix := fmt.Sprintf(\"://%s/v2/%s/\", host, repo)\n\topts.stderr = append(opts.stderr, match.NewRequestHeaderMatcher(urlPrefix, headers))\n\treturn opts\n}", "title": "" }, { "docid": "9e9850e954ee1ae495e67804f4d9c81e", "score": "0.45870486", "text": "func (opts *ExecOption) MatchRequestHeaders(headers ...string) *ExecOption {\n\topts.stderr = append(opts.stderr, match.NewRequestHeaderMatcher(\"\", headers))\n\treturn opts\n}", "title": "" }, { "docid": "4e767426b72b4341fc773a1ef2fb4851", "score": "0.45856056", "text": "func (n Name) Normalize() string {\n\tlower := strings.Map(normalize.ToLower, string(n))\n\tif isASCII(lower) {\n\t\treturn lower\n\t}\n\treturn norm.NFC.String(lower)\n}", "title": "" }, { "docid": "20b3ea38603c19f8ca4d7d041d2c2392", "score": "0.45827687", "text": "func (b *Bot) NormalizeInput(input string) string {\n\tif input == \"\" {\n\t\treturn \"\"\n\t}\n\n\tvar result []string\n\n\tinputSlice := strings.Split(input, \" \")\n\n\tfor _, t := range inputSlice {\n\t\tif strings.HasPrefix(t, \"<http\") && strings.Contains(t, \"|\") && strings.HasSuffix(t, \">\") {\n\t\t\tresult = append(result, t[strings.Index(t, \"|\")+1:len(t)-1])\n\t\t\tcontinue\n\t\t}\n\n\t\tif strings.HasPrefix(t, \"<@U\") && strings.HasSuffix(t, \">\") {\n\t\t\tuser := b.GetUser(t)\n\n\t\t\tif user.Name == \"\" {\n\t\t\t\tresult = append(result, t)\n\t\t\t} else {\n\t\t\t\tresult = append(result, \"@\"+user.Name)\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tresult = append(result, t)\n\t}\n\n\treturn strings.Join(result, \" \")\n}", "title": "" }, { "docid": "230dc7550bd5bc94449ddfc2c52b5e16", "score": "0.4578358", "text": "func EnsureCustomRequestHeaders(sp utils.ServicePort, be *composite.BackendService) bool {\n\tif sp.BackendConfig.Spec.CustomRequestHeaders == nil {\n\t\treturn false\n\t}\n\tbeTemp := &composite.BackendService{}\n\tapplyCustomRequestHeaders(sp, beTemp)\n\tif !reflect.DeepEqual(beTemp.CustomRequestHeaders, be.CustomRequestHeaders) {\n\t\tapplyCustomRequestHeaders(sp, be)\n\t\tklog.V(2).Infof(\"Updated Custom Request Headers for service %v/%v.\", sp.ID.Service.Namespace, sp.ID.Service.Name)\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "6923fcd1f0cbd9fc1212c3f3eeab1b0d", "score": "0.45622057", "text": "func setHeaders(req *http.Request) {\n\tActiveClient.Increment <- 1\n\t<-ActiveClient.Finished\n\treq.Header.Set(\"Authorization\", \"Bearer \"+ActiveClient.Authorization.AccessToken)\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"TrackingID\", TrackingID())\n}", "title": "" }, { "docid": "c43ba288cb3fbe787d1f8c91eaf732b8", "score": "0.45575386", "text": "func AuthenticateRequest(request *http.Request) *errors.RestError {\n\tif request == nil {\n\t\treturn nil\n\t}\n\n\tcleanRequest(request)\n\n\taccessTokenID := strings.TrimSpace(request.URL.Query().Get(paramAccessToken))\n\tif accessTokenID == \"\" {\n\t\treturn nil\n\t}\n\n\taccessToken, err := getAccessToken(accessTokenID)\n\tif err != nil {\n\t\tif err.Status == http.StatusNotFound {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\n\trequest.Header.Add(headerXCallerID, fmt.Sprintf(\"%v\", accessToken.UserID))\n\trequest.Header.Add(headerXClientID, fmt.Sprintf(\"%v\", accessToken.ClientID))\n\n\treturn nil\n}", "title": "" }, { "docid": "61b7bbac3d65190ab5ab9e87cda5bd06", "score": "0.45411617", "text": "func normalize(s string) string {\n\ts = strings.ToLower(s)\n\ts = nonAlphaNumRe.ReplaceAllString(s, \" \")\n\treturn strings.Trim(s, \" \")\n}", "title": "" }, { "docid": "3b078dca1a4e08f4c1fb04b16e8d71ea", "score": "0.4540871", "text": "func (h Headers) AsHTTPHeader() http.Header {\n\tout := make(http.Header)\n\tfor k, v := range h {\n\t\tout.Set(k, v)\n\t}\n\treturn out\n}", "title": "" }, { "docid": "ba474ad72ff17b2a739eff2d2f7c1c99", "score": "0.45394823", "text": "func (p *Prometheus) UpdateRequest(req *http.Request) {\n\treq.Host = p.Upstream.Host\n\tfor i, v := range p.Headers {\n\t\treq.Header.Set(i, v)\n\t}\n}", "title": "" }, { "docid": "00d0688f2c39f68794ac72ae1ac1c64f", "score": "0.45377314", "text": "func (r *Response) SetHeaders(headers map[string]string, unique bool) {\n\tfor k, v := range headers {\n\t\tr.SetHeader(k, v, unique)\n\t}\n}", "title": "" }, { "docid": "2a495a88b4fb5ca80ebbdd8d53ed9a3a", "score": "0.45370907", "text": "func GetFileNameFromHTTPHeader(headers http.Header) (string, error) {\n\tcontentDispositionHeader := headers.Get(\"content-disposition\")\n\tfor _, stmt := range strings.Split(contentDispositionHeader, \";\") {\n\t\tstmt = strings.TrimSpace(stmt)\n\t\tconst filenamePrefix = \"filename=\"\n\t\tif strings.HasPrefix(stmt, filenamePrefix) {\n\t\t\treturn strings.Trim(stmt[len(filenamePrefix):], `\"`), nil\n\t\t}\n\t}\n\treturn \"\", errors.Errorf(`could not resolve filename from content-disposition header<%s>`, contentDispositionHeader)\n}", "title": "" }, { "docid": "e8d1f9c1a69a804ec2ca1a0144958833", "score": "0.4534933", "text": "func (o HttpRequestPtrOutput) Headers() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *HttpRequest) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Headers\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "c80c814832c8cb4ff2b7e0bd15fcaded", "score": "0.453343", "text": "func (o AppEngineHttpRequestOutput) Headers() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v AppEngineHttpRequest) map[string]string { return v.Headers }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "1eedf53bf3587066cbd779c70eaab4a3", "score": "0.452963", "text": "func TestShouldHaveHeadersSet(t *testing.T) {\n\tt.Parallel()\n\tclients := test.Setup(t)\n\n\tuserHeaders := make(http.Header)\n\tuserHeaders.Add(userHeaderKey, userHeaderValue)\n\n\texpectedHeaders := map[string]stringMatcher{\n\t\t// We expect user headers to be passed through exactly as-is.\n\t\tuserHeaderKey: regexp.MustCompile(\"^\" + userHeaderValue + \"$\"),\n\t\t// We expect the protocol to be http for our test image.\n\t\t\"x-forwarded-proto\": regexp.MustCompile(\"https?\"),\n\t\t// We expect the value to be a list of at least one comma separated IP addresses (IPv4 or IPv6).\n\t\t\"x-forwarded-for\": &checkIPList{expected: \"comma separated IPv4 or IPv6 addresses\"},\n\n\t\t// Trace Headers\n\t\t// See https://github.com/openzipkin/b3-propagation#overall-process\n\t\t// We use the multiple header variant for tracing. We do not validate the single header variant.\n\t\t// We expect the value to be a 64-bit hex string\n\t\t\"x-b3-spanid\": regexp.MustCompile(\"[0-9a-f]{16}\"),\n\t\t// We expect the value to be a 64-bit or 128-bit hex string\n\t\t\"x-b3-traceid\": regexp.MustCompile(\"[0-9a-f]{16}|[0-9a-f]{32}\"),\n\n\t\t\"traceparent\": regexp.MustCompile(\"[0-9]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9]{2}\"),\n\n\t\t// \"x-b3-parentspanid\" and \"x-b3-sampled\" are often present for tracing, but are not\n\t\t// required for tracing so we do not validate them.\n\t}\n\n\t_, ri, err := fetchRuntimeInfo(t, clients, spoof.WithHeader(userHeaders))\n\tif err != nil {\n\t\tt.Fatal(\"Error fetching runtime info:\", err)\n\t}\n\n\theaders := ri.Request.Headers\n\n\tmatchHeaders(t, headers, expectedHeaders)\n}", "title": "" } ]
39fa3b67770ed5f00e3e2f4061146d6e
MarshalFields encodes the AWS API shape using the passed in protocol encoder.
[ { "docid": "ba65f451074eb46563728cd8f6f522cd", "score": "0.0", "text": "func (s GetCampaignsOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.CampaignsResponse != nil {\n\t\tv := s.CampaignsResponse\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.PayloadTarget, \"CampaignsResponse\", v, metadata)\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "378efa4e115b6b8a1167238817f3c9c6", "score": "0.62194437", "text": "func (s UpdatePipelineInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.AwsKmsKeyArn != nil {\n\t\tv := *s.AwsKmsKeyArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"AwsKmsKeyArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ContentConfig != nil {\n\t\tv := s.ContentConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"ContentConfig\", v, metadata)\n\t}\n\tif s.InputBucket != nil {\n\t\tv := *s.InputBucket\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"InputBucket\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Notifications != nil {\n\t\tv := s.Notifications\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Notifications\", v, metadata)\n\t}\n\tif s.Role != nil {\n\t\tv := *s.Role\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Role\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ThumbnailConfig != nil {\n\t\tv := s.ThumbnailConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"ThumbnailConfig\", v, metadata)\n\t}\n\tif s.Id != nil {\n\t\tv := *s.Id\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"Id\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1f6b8eaf624f440a516e17e4db3828b6", "score": "0.6200364", "text": "func (s CreateVoiceConnectorInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif len(s.AwsRegion) > 0 {\n\t\tv := s.AwsRegion\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"AwsRegion\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RequireEncryption != nil {\n\t\tv := *s.RequireEncryption\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"RequireEncryption\", protocol.BoolValue(v), metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7d09f3a1903392f6ff278a399504153b", "score": "0.6168215", "text": "func (s UpdateSchemaOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LastModified != nil {\n\t\tv := *s.LastModified\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastModified\",\n\t\t\tprotocol.TimeValue{V: v, Format: \"iso8601\", QuotedFormatTime: true}, metadata)\n\t}\n\tif s.SchemaArn != nil {\n\t\tv := *s.SchemaArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"SchemaArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.SchemaName != nil {\n\t\tv := *s.SchemaName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"SchemaName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.SchemaVersion != nil {\n\t\tv := *s.SchemaVersion\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"SchemaVersion\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.Type != nil {\n\t\tv := *s.Type\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Type\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.VersionCreatedDate != nil {\n\t\tv := *s.VersionCreatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"VersionCreatedDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: \"iso8601\", QuotedFormatTime: true}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96311423aae21a0f47a194da3acf1445", "score": "0.6163688", "text": "func (s CreateDeviceInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Location != nil {\n\t\tv := s.Location\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Location\", v, metadata)\n\t}\n\tif s.Model != nil {\n\t\tv := *s.Model\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Model\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.SerialNumber != nil {\n\t\tv := *s.SerialNumber\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"SerialNumber\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.SiteId != nil {\n\t\tv := *s.SiteId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"SiteId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Tags\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Type != nil {\n\t\tv := *s.Type\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Type\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Vendor != nil {\n\t\tv := *s.Vendor\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Vendor\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.GlobalNetworkId != nil {\n\t\tv := *s.GlobalNetworkId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"globalNetworkId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e7f75ab633a8108dfef38f9ff3e53c52", "score": "0.6112971", "text": "func (s UpdateSchemaInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tvar ClientTokenId string\n\tif s.ClientTokenId != nil {\n\t\tClientTokenId = *s.ClientTokenId\n\t} else {\n\t\tClientTokenId = protocol.GetIdempotencyToken()\n\t}\n\t{\n\t\tv := ClientTokenId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"ClientTokenId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Content != nil {\n\t\tv := *s.Content\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Content\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Type) > 0 {\n\t\tv := s.Type\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Type\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.RegistryName != nil {\n\t\tv := *s.RegistryName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"registryName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.SchemaName != nil {\n\t\tv := *s.SchemaName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"schemaName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a4acce986bcb6376638c7099f3b786c6", "score": "0.60270035", "text": "func (s CreateSignalingChannelInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.ChannelName != nil {\n\t\tv := *s.ChannelName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"ChannelName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.ChannelType) > 0 {\n\t\tv := s.ChannelType\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"ChannelType\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.SingleMasterConfiguration != nil {\n\t\tv := s.SingleMasterConfiguration\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"SingleMasterConfiguration\", v, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Tags\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "734f5ac3531eba4a4c8fe995dcd6752c", "score": "0.6004126", "text": "func (s UpdateInputInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Destinations != nil {\n\t\tv := s.Destinations\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"destinations\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.InputDevices != nil {\n\t\tv := s.InputDevices\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"inputDevices\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.InputSecurityGroups != nil {\n\t\tv := s.InputSecurityGroups\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"inputSecurityGroups\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.MediaConnectFlows != nil {\n\t\tv := s.MediaConnectFlows\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"mediaConnectFlows\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RoleArn != nil {\n\t\tv := *s.RoleArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"roleArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Sources != nil {\n\t\tv := s.Sources\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"sources\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.InputId != nil {\n\t\tv := *s.InputId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"inputId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c179d28e756508edc61170163c742c3c", "score": "0.6000429", "text": "func (s UpdateChannelInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Destinations != nil {\n\t\tv := s.Destinations\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"destinations\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.EncoderSettings != nil {\n\t\tv := s.EncoderSettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"encoderSettings\", v, metadata)\n\t}\n\tif s.InputAttachments != nil {\n\t\tv := s.InputAttachments\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"inputAttachments\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.InputSpecification != nil {\n\t\tv := s.InputSpecification\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"inputSpecification\", v, metadata)\n\t}\n\tif len(s.LogLevel) > 0 {\n\t\tv := s.LogLevel\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"logLevel\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RoleArn != nil {\n\t\tv := *s.RoleArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"roleArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ChannelId != nil {\n\t\tv := *s.ChannelId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"channelId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "98682c3d155732420f1429c98281918b", "score": "0.5998045", "text": "func (s UpdateDeviceInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Location != nil {\n\t\tv := s.Location\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Location\", v, metadata)\n\t}\n\tif s.Model != nil {\n\t\tv := *s.Model\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Model\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.SerialNumber != nil {\n\t\tv := *s.SerialNumber\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"SerialNumber\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.SiteId != nil {\n\t\tv := *s.SiteId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"SiteId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Type != nil {\n\t\tv := *s.Type\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Type\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Vendor != nil {\n\t\tv := *s.Vendor\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Vendor\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DeviceId != nil {\n\t\tv := *s.DeviceId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"deviceId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.GlobalNetworkId != nil {\n\t\tv := *s.GlobalNetworkId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"globalNetworkId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "42416bf429673ecb2676fd0f72919426", "score": "0.5979003", "text": "func (s UpdateCompanyNetworkConfigurationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.SecurityGroupIds) > 0 {\n\t\tv := s.SecurityGroupIds\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"SecurityGroupIds\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif len(s.SubnetIds) > 0 {\n\t\tv := s.SubnetIds\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"SubnetIds\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.VpcId != nil {\n\t\tv := *s.VpcId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"VpcId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d9aef15335425971df328d78527684cb", "score": "0.59369135", "text": "func (s CreateJobInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Input != nil {\n\t\tv := s.Input\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Input\", v, metadata)\n\t}\n\tif s.Inputs != nil {\n\t\tv := s.Inputs\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Inputs\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Output != nil {\n\t\tv := s.Output\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Output\", v, metadata)\n\t}\n\tif s.OutputKeyPrefix != nil {\n\t\tv := *s.OutputKeyPrefix\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"OutputKeyPrefix\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Outputs != nil {\n\t\tv := s.Outputs\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Outputs\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.PipelineId != nil {\n\t\tv := *s.PipelineId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"PipelineId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Playlists != nil {\n\t\tv := s.Playlists\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Playlists\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.UserMetadata != nil {\n\t\tv := s.UserMetadata\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"UserMetadata\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "804902c4cffcdc0dfc1491180997065a", "score": "0.5924836", "text": "func (s CreateFunctionDefinitionInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.InitialVersion != nil {\n\t\tv := s.InitialVersion\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"InitialVersion\", v, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.AmznClientToken != nil {\n\t\tv := *s.AmznClientToken\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.HeaderTarget, \"X-Amzn-Client-Token\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b1c1f6e77211aaf951d9a6668fcad14f", "score": "0.59047395", "text": "func (s UpdateStreamInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.CurrentVersion != nil {\n\t\tv := *s.CurrentVersion\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CurrentVersion\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DeviceName != nil {\n\t\tv := *s.DeviceName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"DeviceName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.MediaType != nil {\n\t\tv := *s.MediaType\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"MediaType\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.StreamARN != nil {\n\t\tv := *s.StreamARN\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"StreamARN\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.StreamName != nil {\n\t\tv := *s.StreamName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"StreamName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2ae5cecdfbee6603c06903f125b37ad0", "score": "0.5893685", "text": "func (s CreateStageInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.AccessLogSettings != nil {\n\t\tv := s.AccessLogSettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"accessLogSettings\", v, metadata)\n\t}\n\tif s.AutoDeploy != nil {\n\t\tv := *s.AutoDeploy\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"autoDeploy\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.ClientCertificateId != nil {\n\t\tv := *s.ClientCertificateId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"clientCertificateId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DefaultRouteSettings != nil {\n\t\tv := s.DefaultRouteSettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"defaultRouteSettings\", v, metadata)\n\t}\n\tif s.DeploymentId != nil {\n\t\tv := *s.DeploymentId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"deploymentId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RouteSettings != nil {\n\t\tv := s.RouteSettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"routeSettings\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetFields(k1, v1)\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.StageName != nil {\n\t\tv := *s.StageName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"stageName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.StageVariables != nil {\n\t\tv := s.StageVariables\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"stageVariables\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.ApiId != nil {\n\t\tv := *s.ApiId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"apiId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fa97f9f8a7fb0cb8ef3551b61b15e2e6", "score": "0.5870944", "text": "func (s UpdateStageInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.PatchOperations != nil {\n\t\tv := s.PatchOperations\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"patchOperations\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.RestApiId != nil {\n\t\tv := *s.RestApiId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"restapi_id\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.StageName != nil {\n\t\tv := *s.StageName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"stage_name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c32fa164e5de253c01ac582d142c9c4d", "score": "0.58583254", "text": "func (s UpdateDetectorInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Enable != nil {\n\t\tv := *s.Enable\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"enable\", protocol.BoolValue(v), metadata)\n\t}\n\tif len(s.FindingPublishingFrequency) > 0 {\n\t\tv := s.FindingPublishingFrequency\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"findingPublishingFrequency\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.DetectorId != nil {\n\t\tv := *s.DetectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"detectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2f2dc805835cd9355ec4d3409aaafd17", "score": "0.5854444", "text": "func (s UpdateFunctionConfigurationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.DeadLetterConfig != nil {\n\t\tv := s.DeadLetterConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"DeadLetterConfig\", v, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Environment != nil {\n\t\tv := s.Environment\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Environment\", v, metadata)\n\t}\n\tif s.Handler != nil {\n\t\tv := *s.Handler\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Handler\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.KMSKeyArn != nil {\n\t\tv := *s.KMSKeyArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"KMSKeyArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Layers != nil {\n\t\tv := s.Layers\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Layers\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.MemorySize != nil {\n\t\tv := *s.MemorySize\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"MemorySize\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.RevisionId != nil {\n\t\tv := *s.RevisionId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"RevisionId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Role != nil {\n\t\tv := *s.Role\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Role\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Runtime) > 0 {\n\t\tv := s.Runtime\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Runtime\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Timeout != nil {\n\t\tv := *s.Timeout\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Timeout\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.TracingConfig != nil {\n\t\tv := s.TracingConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"TracingConfig\", v, metadata)\n\t}\n\tif s.VpcConfig != nil {\n\t\tv := s.VpcConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"VpcConfig\", v, metadata)\n\t}\n\tif s.FunctionName != nil {\n\t\tv := *s.FunctionName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"FunctionName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1347514f4cc9dd71a51687bb2528c42b", "score": "0.5852404", "text": "func (s PublishVersionOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.CodeSha256 != nil {\n\t\tv := *s.CodeSha256\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CodeSha256\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.CodeSize != nil {\n\t\tv := *s.CodeSize\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CodeSize\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.DeadLetterConfig != nil {\n\t\tv := s.DeadLetterConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"DeadLetterConfig\", v, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Environment != nil {\n\t\tv := s.Environment\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Environment\", v, metadata)\n\t}\n\tif s.FunctionArn != nil {\n\t\tv := *s.FunctionArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FunctionArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FunctionName != nil {\n\t\tv := *s.FunctionName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FunctionName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Handler != nil {\n\t\tv := *s.Handler\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Handler\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.KMSKeyArn != nil {\n\t\tv := *s.KMSKeyArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"KMSKeyArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LastModified != nil {\n\t\tv := *s.LastModified\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastModified\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.LastUpdateStatus) > 0 {\n\t\tv := s.LastUpdateStatus\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastUpdateStatus\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.LastUpdateStatusReason != nil {\n\t\tv := *s.LastUpdateStatusReason\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastUpdateStatusReason\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.LastUpdateStatusReasonCode) > 0 {\n\t\tv := s.LastUpdateStatusReasonCode\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastUpdateStatusReasonCode\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Layers != nil {\n\t\tv := s.Layers\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Layers\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.MasterArn != nil {\n\t\tv := *s.MasterArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"MasterArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.MemorySize != nil {\n\t\tv := *s.MemorySize\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"MemorySize\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.RevisionId != nil {\n\t\tv := *s.RevisionId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"RevisionId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Role != nil {\n\t\tv := *s.Role\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Role\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Runtime) > 0 {\n\t\tv := s.Runtime\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Runtime\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif len(s.State) > 0 {\n\t\tv := s.State\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"State\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.StateReason != nil {\n\t\tv := *s.StateReason\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"StateReason\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.StateReasonCode) > 0 {\n\t\tv := s.StateReasonCode\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"StateReasonCode\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Timeout != nil {\n\t\tv := *s.Timeout\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Timeout\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.TracingConfig != nil {\n\t\tv := s.TracingConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"TracingConfig\", v, metadata)\n\t}\n\tif s.Version != nil {\n\t\tv := *s.Version\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Version\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.VpcConfig != nil {\n\t\tv := s.VpcConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"VpcConfig\", v, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ee4cc0ffbeb50587bb6fcd98547119a3", "score": "0.58076614", "text": "func (s VoiceConnector) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.CreatedTimestamp != nil {\n\t\tv := *s.CreatedTimestamp\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CreatedTimestamp\", protocol.TimeValue{V: v, Format: protocol.UnixTimeFormat}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.OutboundHostName != nil {\n\t\tv := *s.OutboundHostName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"OutboundHostName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RequireEncryption != nil {\n\t\tv := *s.RequireEncryption\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"RequireEncryption\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.UpdatedTimestamp != nil {\n\t\tv := *s.UpdatedTimestamp\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"UpdatedTimestamp\", protocol.TimeValue{V: v, Format: protocol.UnixTimeFormat}, metadata)\n\t}\n\tif s.VoiceConnectorId != nil {\n\t\tv := *s.VoiceConnectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"VoiceConnectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4c04ef8f462e6e7261e11cddb268a34c", "score": "0.5798693", "text": "func (s UpdateVoiceConnectorInput) MarshalFields(e protocol.FieldEncoder) error {\n\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RequireEncryption != nil {\n\t\tv := *s.RequireEncryption\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"RequireEncryption\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.VoiceConnectorId != nil {\n\t\tv := *s.VoiceConnectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"voiceConnectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a0d132b1a58231cb77510c7a2fcb8d5e", "score": "0.576937", "text": "func (s GetBotInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.VersionOrAlias != nil {\n\t\tv := *s.VersionOrAlias\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"versionoralias\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f80e5c333d4ed2aa714076ba87f9c448", "score": "0.5753359", "text": "func (s UpdateIdentityProviderConfigurationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.IdentityProviderSamlMetadata != nil {\n\t\tv := *s.IdentityProviderSamlMetadata\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"IdentityProviderSamlMetadata\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.IdentityProviderType) > 0 {\n\t\tv := s.IdentityProviderType\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"IdentityProviderType\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1a4a8d032bf7cd50420314449e9843e5", "score": "0.57291275", "text": "func (s CreateVoiceConnectorInput) MarshalFields(e protocol.FieldEncoder) error {\n\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RequireEncryption != nil {\n\t\tv := *s.RequireEncryption\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"RequireEncryption\", protocol.BoolValue(v), metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "04b31fef9f3cf75b1773fd5f10976d22", "score": "0.5727354", "text": "func (s CreateDocumentationVersionInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DocumentationVersion != nil {\n\t\tv := *s.DocumentationVersion\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"documentationVersion\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.StageName != nil {\n\t\tv := *s.StageName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"stageName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RestApiId != nil {\n\t\tv := *s.RestApiId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"restapi_id\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "86873a5f64bee073f5f80b033d32445a", "score": "0.5707159", "text": "func (s CreateFunctionDefinitionOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Arn != nil {\n\t\tv := *s.Arn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Arn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.CreationTimestamp != nil {\n\t\tv := *s.CreationTimestamp\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CreationTimestamp\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Id != nil {\n\t\tv := *s.Id\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Id\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LastUpdatedTimestamp != nil {\n\t\tv := *s.LastUpdatedTimestamp\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastUpdatedTimestamp\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LatestVersion != nil {\n\t\tv := *s.LatestVersion\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LatestVersion\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LatestVersionArn != nil {\n\t\tv := *s.LatestVersionArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LatestVersionArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0524649b1956c022a2dfb5a89662f79e", "score": "0.5706292", "text": "func (s CreateIntentVersionInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Checksum != nil {\n\t\tv := *s.Checksum\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"checksum\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2f81488949ad57eaa2b348bd7d52fc94", "score": "0.56946945", "text": "func (s CreateApplicationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"Tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "403af7225e818aa509943a22878088ec", "score": "0.56896096", "text": "func (s GetConnectivityInfoInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.ThingName != nil {\n\t\tv := *s.ThingName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"ThingName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2cfa42b5d3f7565a04d5e51de0c6a1a0", "score": "0.5672675", "text": "func (s UpdateFunctionConfigurationOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.CodeSha256 != nil {\n\t\tv := *s.CodeSha256\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CodeSha256\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.CodeSize != nil {\n\t\tv := *s.CodeSize\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CodeSize\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.DeadLetterConfig != nil {\n\t\tv := s.DeadLetterConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"DeadLetterConfig\", v, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Environment != nil {\n\t\tv := s.Environment\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Environment\", v, metadata)\n\t}\n\tif s.FunctionArn != nil {\n\t\tv := *s.FunctionArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FunctionArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FunctionName != nil {\n\t\tv := *s.FunctionName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FunctionName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Handler != nil {\n\t\tv := *s.Handler\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Handler\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.KMSKeyArn != nil {\n\t\tv := *s.KMSKeyArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"KMSKeyArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LastModified != nil {\n\t\tv := *s.LastModified\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastModified\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.LastUpdateStatus) > 0 {\n\t\tv := s.LastUpdateStatus\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastUpdateStatus\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.LastUpdateStatusReason != nil {\n\t\tv := *s.LastUpdateStatusReason\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastUpdateStatusReason\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.LastUpdateStatusReasonCode) > 0 {\n\t\tv := s.LastUpdateStatusReasonCode\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastUpdateStatusReasonCode\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Layers != nil {\n\t\tv := s.Layers\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Layers\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.MasterArn != nil {\n\t\tv := *s.MasterArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"MasterArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.MemorySize != nil {\n\t\tv := *s.MemorySize\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"MemorySize\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.RevisionId != nil {\n\t\tv := *s.RevisionId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"RevisionId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Role != nil {\n\t\tv := *s.Role\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Role\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Runtime) > 0 {\n\t\tv := s.Runtime\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Runtime\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif len(s.State) > 0 {\n\t\tv := s.State\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"State\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.StateReason != nil {\n\t\tv := *s.StateReason\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"StateReason\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.StateReasonCode) > 0 {\n\t\tv := s.StateReasonCode\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"StateReasonCode\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Timeout != nil {\n\t\tv := *s.Timeout\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Timeout\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.TracingConfig != nil {\n\t\tv := s.TracingConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"TracingConfig\", v, metadata)\n\t}\n\tif s.Version != nil {\n\t\tv := *s.Version\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Version\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.VpcConfig != nil {\n\t\tv := s.VpcConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"VpcConfig\", v, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7aa363db3e8ff91a98fef7a0b708acf3", "score": "0.56707436", "text": "func (s UpdateAssetModelInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.AssetModelDescription != nil {\n\t\tv := *s.AssetModelDescription\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"assetModelDescription\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.AssetModelHierarchies != nil {\n\t\tv := s.AssetModelHierarchies\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"assetModelHierarchies\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.AssetModelName != nil {\n\t\tv := *s.AssetModelName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"assetModelName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.AssetModelProperties != nil {\n\t\tv := s.AssetModelProperties\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"assetModelProperties\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tvar ClientToken string\n\tif s.ClientToken != nil {\n\t\tClientToken = *s.ClientToken\n\t} else {\n\t\tClientToken = protocol.GetIdempotencyToken()\n\t}\n\t{\n\t\tv := ClientToken\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"clientToken\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.AssetModelId != nil {\n\t\tv := *s.AssetModelId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"assetModelId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "684bd0f95df3526f9148b254c7a083c5", "score": "0.5666845", "text": "func (s UpdateInputOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Input != nil {\n\t\tv := s.Input\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"input\", v, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0a779fa395a4cc7292f03f64a5fa6ba7", "score": "0.5655401", "text": "func (s GetDetectorInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.DetectorId != nil {\n\t\tv := *s.DetectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"detectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "34b15207a190251cf00904059e811b39", "score": "0.5653884", "text": "func (s PublishVersionInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.CodeSha256 != nil {\n\t\tv := *s.CodeSha256\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CodeSha256\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RevisionId != nil {\n\t\tv := *s.RevisionId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"RevisionId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FunctionName != nil {\n\t\tv := *s.FunctionName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"FunctionName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4067afe11a61506f9eff264af506df65", "score": "0.5642992", "text": "func (s UpdatePipelineOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Pipeline != nil {\n\t\tv := s.Pipeline\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Pipeline\", v, metadata)\n\t}\n\tif s.Warnings != nil {\n\t\tv := s.Warnings\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Warnings\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c1af8227b3293876f6466e20d418f397", "score": "0.563436", "text": "func (s GetApiKeysOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Items != nil {\n\t\tv := s.Items\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"item\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Position != nil {\n\t\tv := *s.Position\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"position\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Warnings != nil {\n\t\tv := s.Warnings\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"warnings\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0131667ec71b8490de4aa51f5368b87d", "score": "0.5631612", "text": "func (s GetLayerVersionByArnOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.CompatibleRuntimes != nil {\n\t\tv := s.CompatibleRuntimes\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"CompatibleRuntimes\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Content != nil {\n\t\tv := s.Content\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Content\", v, metadata)\n\t}\n\tif s.CreatedDate != nil {\n\t\tv := *s.CreatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CreatedDate\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LayerArn != nil {\n\t\tv := *s.LayerArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LayerArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LayerVersionArn != nil {\n\t\tv := *s.LayerVersionArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LayerVersionArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LicenseInfo != nil {\n\t\tv := *s.LicenseInfo\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LicenseInfo\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Version != nil {\n\t\tv := *s.Version\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Version\", protocol.Int64Value(v), metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e3f55f710fcdf59ab27acd738b46a6dc", "score": "0.5628167", "text": "func (s GetDetectorOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.CreatedAt != nil {\n\t\tv := *s.CreatedAt\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"createdAt\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.FindingPublishingFrequency) > 0 {\n\t\tv := s.FindingPublishingFrequency\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"findingPublishingFrequency\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.ServiceRole != nil {\n\t\tv := *s.ServiceRole\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"serviceRole\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Status) > 0 {\n\t\tv := s.Status\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"status\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.UpdatedAt != nil {\n\t\tv := *s.UpdatedAt\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"updatedAt\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2fcae8ad8aa46fa466c60dadc42cc705", "score": "0.5623953", "text": "func (s CreateStageOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.AccessLogSettings != nil {\n\t\tv := s.AccessLogSettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"accessLogSettings\", v, metadata)\n\t}\n\tif s.ApiGatewayManaged != nil {\n\t\tv := *s.ApiGatewayManaged\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"apiGatewayManaged\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.AutoDeploy != nil {\n\t\tv := *s.AutoDeploy\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"autoDeploy\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.ClientCertificateId != nil {\n\t\tv := *s.ClientCertificateId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"clientCertificateId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.CreatedDate != nil {\n\t\tv := *s.CreatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"createdDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: \"iso8601\", QuotedFormatTime: true}, metadata)\n\t}\n\tif s.DefaultRouteSettings != nil {\n\t\tv := s.DefaultRouteSettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"defaultRouteSettings\", v, metadata)\n\t}\n\tif s.DeploymentId != nil {\n\t\tv := *s.DeploymentId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"deploymentId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LastDeploymentStatusMessage != nil {\n\t\tv := *s.LastDeploymentStatusMessage\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"lastDeploymentStatusMessage\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LastUpdatedDate != nil {\n\t\tv := *s.LastUpdatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"lastUpdatedDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: \"iso8601\", QuotedFormatTime: true}, metadata)\n\t}\n\tif s.RouteSettings != nil {\n\t\tv := s.RouteSettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"routeSettings\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetFields(k1, v1)\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.StageName != nil {\n\t\tv := *s.StageName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"stageName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.StageVariables != nil {\n\t\tv := s.StageVariables\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"stageVariables\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a64ece92a71a072aa813d41f8fd20db4", "score": "0.5612024", "text": "func (s DescribeDeviceOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.FirstAccessedTime != nil {\n\t\tv := *s.FirstAccessedTime\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FirstAccessedTime\", protocol.TimeValue{V: v, Format: protocol.UnixTimeFormat}, metadata)\n\t}\n\tif s.LastAccessedTime != nil {\n\t\tv := *s.LastAccessedTime\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"LastAccessedTime\", protocol.TimeValue{V: v, Format: protocol.UnixTimeFormat}, metadata)\n\t}\n\tif s.Manufacturer != nil {\n\t\tv := *s.Manufacturer\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Manufacturer\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Model != nil {\n\t\tv := *s.Model\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Model\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.OperatingSystem != nil {\n\t\tv := *s.OperatingSystem\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"OperatingSystem\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.OperatingSystemVersion != nil {\n\t\tv := *s.OperatingSystemVersion\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"OperatingSystemVersion\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.PatchLevel != nil {\n\t\tv := *s.PatchLevel\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"PatchLevel\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Status) > 0 {\n\t\tv := s.Status\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Status\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Username != nil {\n\t\tv := *s.Username\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Username\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7b680c791a5d8fb43b879dc3c4a2c683", "score": "0.5609987", "text": "func (s PutVoiceConnectorTerminationCredentialsInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Credentials != nil {\n\t\tv := s.Credentials\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Credentials\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.VoiceConnectorId != nil {\n\t\tv := *s.VoiceConnectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"voiceConnectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "68d6be68bf3a2350ad5ba0b27059a8c4", "score": "0.5601153", "text": "func (s DescribeIdentityProviderConfigurationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6e1b2c0d268645ef597c76509bace79b", "score": "0.5594219", "text": "func (s CreateThreatIntelSetInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Activate != nil {\n\t\tv := *s.Activate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"activate\", protocol.BoolValue(v), metadata)\n\t}\n\tvar ClientToken string\n\tif s.ClientToken != nil {\n\t\tClientToken = *s.ClientToken\n\t} else {\n\t\tClientToken = protocol.GetIdempotencyToken()\n\t}\n\t{\n\t\tv := ClientToken\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"clientToken\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Format) > 0 {\n\t\tv := s.Format\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"format\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Location != nil {\n\t\tv := *s.Location\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"location\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.DetectorId != nil {\n\t\tv := *s.DetectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"detectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ae29b498e6d61df690ec47f5f5ccd4db", "score": "0.55910796", "text": "func (s CreateIntentVersionOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Checksum != nil {\n\t\tv := *s.Checksum\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"checksum\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ConclusionStatement != nil {\n\t\tv := s.ConclusionStatement\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"conclusionStatement\", v, metadata)\n\t}\n\tif s.ConfirmationPrompt != nil {\n\t\tv := s.ConfirmationPrompt\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"confirmationPrompt\", v, metadata)\n\t}\n\tif s.CreatedDate != nil {\n\t\tv := *s.CreatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"createdDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DialogCodeHook != nil {\n\t\tv := s.DialogCodeHook\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"dialogCodeHook\", v, metadata)\n\t}\n\tif s.FollowUpPrompt != nil {\n\t\tv := s.FollowUpPrompt\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"followUpPrompt\", v, metadata)\n\t}\n\tif s.FulfillmentActivity != nil {\n\t\tv := s.FulfillmentActivity\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"fulfillmentActivity\", v, metadata)\n\t}\n\tif s.KendraConfiguration != nil {\n\t\tv := s.KendraConfiguration\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"kendraConfiguration\", v, metadata)\n\t}\n\tif s.LastUpdatedDate != nil {\n\t\tv := *s.LastUpdatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"lastUpdatedDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ParentIntentSignature != nil {\n\t\tv := *s.ParentIntentSignature\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"parentIntentSignature\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RejectionStatement != nil {\n\t\tv := s.RejectionStatement\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"rejectionStatement\", v, metadata)\n\t}\n\tif s.SampleUtterances != nil {\n\t\tv := s.SampleUtterances\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"sampleUtterances\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Slots != nil {\n\t\tv := s.Slots\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"slots\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Version != nil {\n\t\tv := *s.Version\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"version\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "410322bcf376c4d151dbb7ba4d734676", "score": "0.55825484", "text": "func (s CreateFleetInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.DisplayName != nil {\n\t\tv := *s.DisplayName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"DisplayName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FleetName != nil {\n\t\tv := *s.FleetName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.OptimizeForEndUserLocation != nil {\n\t\tv := *s.OptimizeForEndUserLocation\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"OptimizeForEndUserLocation\", protocol.BoolValue(v), metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8dcaa21be54d7de638ecd32dcd65b0e8", "score": "0.5582232", "text": "func (s DescribeDeviceInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.DeviceId != nil {\n\t\tv := *s.DeviceId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"DeviceId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a0a63e4d9dca0b2068e93ce5ec2ebb97", "score": "0.5567424", "text": "func (s UpdateBasePathMappingInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.PatchOperations != nil {\n\t\tv := s.PatchOperations\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"patchOperations\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.BasePath != nil {\n\t\tv := *s.BasePath\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"base_path\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DomainName != nil {\n\t\tv := *s.DomainName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"domain_name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2e17330f7765634cb7ba3d0cddb10cc9", "score": "0.55447894", "text": "func (s GetRegistrationCodeInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\treturn nil\n}", "title": "" }, { "docid": "aa034bedf26234afa8313ba705c9299d", "score": "0.554106", "text": "func (s UpdateDetectorOutput) MarshalFields(e protocol.FieldEncoder) error {\n\treturn nil\n}", "title": "" }, { "docid": "2f99db0559ab641bdcd57ba8e22c43fc", "score": "0.553184", "text": "func (s UpdateFleetMetadataInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.DisplayName != nil {\n\t\tv := *s.DisplayName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"DisplayName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.OptimizeForEndUserLocation != nil {\n\t\tv := *s.OptimizeForEndUserLocation\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"OptimizeForEndUserLocation\", protocol.BoolValue(v), metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4100ae62131bba435a06e2abcc8b2c65", "score": "0.55279154", "text": "func (s UpdateStreamOutput) MarshalFields(e protocol.FieldEncoder) error {\n\treturn nil\n}", "title": "" }, { "docid": "c5a53e7be60adb54bae04734dc264630", "score": "0.5514466", "text": "func (s CreateIngestionOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Arn != nil {\n\t\tv := *s.Arn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Arn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.IngestionId != nil {\n\t\tv := *s.IngestionId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"IngestionId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.IngestionStatus) > 0 {\n\t\tv := s.IngestionStatus\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"IngestionStatus\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.RequestId != nil {\n\t\tv := *s.RequestId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"RequestId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\t// ignoring invalid encode state, StatusCode. Status\n\treturn nil\n}", "title": "" }, { "docid": "b6323de30fd12faec95b7298e881c2f6", "score": "0.5512876", "text": "func (s UpdateDevicePolicyConfigurationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.DeviceCaCertificate != nil {\n\t\tv := *s.DeviceCaCertificate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"DeviceCaCertificate\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "67932918919bab1239727dcd7ea84296", "score": "0.55118644", "text": "func (s FinalizeDeviceClaimInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.DeviceId != nil {\n\t\tv := *s.DeviceId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"deviceId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6e2fbf3d4ef9cd4f227e5368cfeb06cc", "score": "0.5492656", "text": "func (s UpdateVoiceConnectorOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.VoiceConnector != nil {\n\t\tv := s.VoiceConnector\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"VoiceConnector\", v, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bc6b14bfd187efde889f1677f454944d", "score": "0.548608", "text": "func (s UpdateCACertificateInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.RegistrationConfig != nil {\n\t\tv := s.RegistrationConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"registrationConfig\", v, metadata)\n\t}\n\tif s.RemoveAutoRegistration != nil {\n\t\tv := *s.RemoveAutoRegistration\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"removeAutoRegistration\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.CertificateId != nil {\n\t\tv := *s.CertificateId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"caCertificateId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.NewAutoRegistrationStatus) > 0 {\n\t\tv := s.NewAutoRegistrationStatus\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.QueryTarget, \"newAutoRegistrationStatus\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif len(s.NewStatus) > 0 {\n\t\tv := s.NewStatus\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.QueryTarget, \"newStatus\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "60f39a992aeb9f2f197b81c147dfee78", "score": "0.54843986", "text": "func (s CreateSignalingChannelOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.ChannelARN != nil {\n\t\tv := *s.ChannelARN\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"ChannelARN\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3037e152eddbcdb276b3514108cece25", "score": "0.54805577", "text": "func (s PutBackupPolicyInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.BackupPolicy != nil {\n\t\tv := s.BackupPolicy\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"BackupPolicy\", v, metadata)\n\t}\n\tif s.FileSystemId != nil {\n\t\tv := *s.FileSystemId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"FileSystemId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "189bdd012bd2c31300dddaa9ba418d5f", "score": "0.5480318", "text": "func (s StartSimulationJobBatchInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.BatchPolicy != nil {\n\t\tv := s.BatchPolicy\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"batchPolicy\", v, metadata)\n\t}\n\tvar ClientRequestToken string\n\tif s.ClientRequestToken != nil {\n\t\tClientRequestToken = *s.ClientRequestToken\n\t} else {\n\t\tClientRequestToken = protocol.GetIdempotencyToken()\n\t}\n\t{\n\t\tv := ClientRequestToken\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"clientRequestToken\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.CreateSimulationJobRequests != nil {\n\t\tv := s.CreateSimulationJobRequests\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"createSimulationJobRequests\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "00b152e9b73ad44f19ca816557232dc8", "score": "0.5479444", "text": "func (s BatchPutMessageInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Messages != nil {\n\t\tv := s.Messages\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"messages\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6840b5a4078670ec252ffc2e25b5a776", "score": "0.54793847", "text": "func (s DeleteOriginEndpointInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Id != nil {\n\t\tv := *s.Id\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"id\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a8512591be5d4a0fd8ec66c9b4d0ac30", "score": "0.5474044", "text": "func (s UpdateBasePathMappingOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.BasePath != nil {\n\t\tv := *s.BasePath\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"basePath\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.RestApiId != nil {\n\t\tv := *s.RestApiId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"restApiId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Stage != nil {\n\t\tv := *s.Stage\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"stage\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "09726ea219ab477f03f1774630c912fe", "score": "0.54662573", "text": "func (s CreateVoiceConnectorOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.VoiceConnector != nil {\n\t\tv := s.VoiceConnector\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"VoiceConnector\", v, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "09726ea219ab477f03f1774630c912fe", "score": "0.5465279", "text": "func (s CreateVoiceConnectorOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.VoiceConnector != nil {\n\t\tv := s.VoiceConnector\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"VoiceConnector\", v, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "60802e0d0e21a2ebfaad685865691ca9", "score": "0.5463506", "text": "func (s CreateThemeInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.BaseThemeId != nil {\n\t\tv := *s.BaseThemeId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"BaseThemeId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Configuration != nil {\n\t\tv := s.Configuration\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Configuration\", v, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Permissions != nil {\n\t\tv := s.Permissions\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Permissions\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Tags\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.VersionDescription != nil {\n\t\tv := *s.VersionDescription\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"VersionDescription\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.AwsAccountId != nil {\n\t\tv := *s.AwsAccountId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"AwsAccountId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ThemeId != nil {\n\t\tv := *s.ThemeId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"ThemeId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bf496669b9fe147fc70707490286894d", "score": "0.5461517", "text": "func (s CreateApplicationOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Id != nil {\n\t\tv := *s.Id\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Id\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d263041838bb4b3e6e2ab20e4aad272d", "score": "0.54414076", "text": "func (s DescribeReservationOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Arn != nil {\n\t\tv := *s.Arn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"arn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Count != nil {\n\t\tv := *s.Count\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"count\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.CurrencyCode != nil {\n\t\tv := *s.CurrencyCode\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"currencyCode\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Duration != nil {\n\t\tv := *s.Duration\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"duration\", protocol.Int64Value(v), metadata)\n\t}\n\tif len(s.DurationUnits) > 0 {\n\t\tv := s.DurationUnits\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"durationUnits\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.End != nil {\n\t\tv := *s.End\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"end\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FixedPrice != nil {\n\t\tv := *s.FixedPrice\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"fixedPrice\", protocol.Float64Value(v), metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.OfferingDescription != nil {\n\t\tv := *s.OfferingDescription\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"offeringDescription\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.OfferingId != nil {\n\t\tv := *s.OfferingId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"offeringId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.OfferingType) > 0 {\n\t\tv := s.OfferingType\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"offeringType\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Region != nil {\n\t\tv := *s.Region\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"region\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ReservationId != nil {\n\t\tv := *s.ReservationId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"reservationId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ResourceSpecification != nil {\n\t\tv := s.ResourceSpecification\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"resourceSpecification\", v, metadata)\n\t}\n\tif s.Start != nil {\n\t\tv := *s.Start\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"start\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.State) > 0 {\n\t\tv := s.State\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"state\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.UsagePrice != nil {\n\t\tv := *s.UsagePrice\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"usagePrice\", protocol.Float64Value(v), metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9234c247d6100951b03bd04b495ef59e", "score": "0.54347664", "text": "func (s PutTelemetryRecordsInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.EC2InstanceId != nil {\n\t\tv := *s.EC2InstanceId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"EC2InstanceId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Hostname != nil {\n\t\tv := *s.Hostname\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Hostname\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ResourceARN != nil {\n\t\tv := *s.ResourceARN\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"ResourceARN\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.TelemetryRecords != nil {\n\t\tv := s.TelemetryRecords\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"TelemetryRecords\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "34f13ff9c06dfe1dbaf5e19f65b3299a", "score": "0.5434663", "text": "func (s GetApiKeysInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.CustomerId != nil {\n\t\tv := *s.CustomerId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.QueryTarget, \"customerId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.IncludeValues != nil {\n\t\tv := *s.IncludeValues\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.QueryTarget, \"includeValues\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.Limit != nil {\n\t\tv := *s.Limit\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.QueryTarget, \"limit\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.NameQuery != nil {\n\t\tv := *s.NameQuery\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.QueryTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Position != nil {\n\t\tv := *s.Position\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.QueryTarget, \"position\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e487a542915e9287a54c58ccea6be89c", "score": "0.5434291", "text": "func (s PutVoiceConnectorTerminationInput) MarshalFields(e protocol.FieldEncoder) error {\n\n\tif s.Termination != nil {\n\t\tv := s.Termination\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Termination\", v, metadata)\n\t}\n\tif s.VoiceConnectorId != nil {\n\t\tv := *s.VoiceConnectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"voiceConnectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0dae20ecb51c893e95769c7f7009af41", "score": "0.54296714", "text": "func (s CreateIngestionInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.AwsAccountId != nil {\n\t\tv := *s.AwsAccountId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"AwsAccountId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DataSetId != nil {\n\t\tv := *s.DataSetId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"DataSetId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.IngestionId != nil {\n\t\tv := *s.IngestionId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"IngestionId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e812051e1bf57f2d230adee1c6644377", "score": "0.54250395", "text": "func (s CreatePhoneNumberOrderInput) MarshalFields(e protocol.FieldEncoder) error {\n\n\tif len(s.E164PhoneNumbers) > 0 {\n\t\tv := s.E164PhoneNumbers\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"E164PhoneNumbers\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif len(s.ProductType) > 0 {\n\t\tv := s.ProductType\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"ProductType\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bd540b2eab5e5f1777071a21076ebdb9", "score": "0.5421551", "text": "func (s UpdateReservationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ReservationId != nil {\n\t\tv := *s.ReservationId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"reservationId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4c61789c36e88b5b4dc4b2139d7c80e6", "score": "0.5419561", "text": "func (s GetLifecyclePolicyInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.PolicyId != nil {\n\t\tv := *s.PolicyId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"policyId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "78c732b2dbd1e80bae8afe73e2758d06", "score": "0.54024935", "text": "func (s DescribeDevicePolicyConfigurationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8e6730e0259f4e204fd10a73b8d0bf81", "score": "0.5394684", "text": "func (s UpdateStageOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.AccessLogSettings != nil {\n\t\tv := s.AccessLogSettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"accessLogSettings\", v, metadata)\n\t}\n\tif s.CacheClusterEnabled != nil {\n\t\tv := *s.CacheClusterEnabled\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"cacheClusterEnabled\", protocol.BoolValue(v), metadata)\n\t}\n\tif len(s.CacheClusterSize) > 0 {\n\t\tv := s.CacheClusterSize\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"cacheClusterSize\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif len(s.CacheClusterStatus) > 0 {\n\t\tv := s.CacheClusterStatus\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"cacheClusterStatus\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.CanarySettings != nil {\n\t\tv := s.CanarySettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"canarySettings\", v, metadata)\n\t}\n\tif s.ClientCertificateId != nil {\n\t\tv := *s.ClientCertificateId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"clientCertificateId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.CreatedDate != nil {\n\t\tv := *s.CreatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"createdDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.DeploymentId != nil {\n\t\tv := *s.DeploymentId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"deploymentId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DocumentationVersion != nil {\n\t\tv := *s.DocumentationVersion\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"documentationVersion\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.LastUpdatedDate != nil {\n\t\tv := *s.LastUpdatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"lastUpdatedDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.MethodSettings != nil {\n\t\tv := s.MethodSettings\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"methodSettings\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetFields(k1, v1)\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.StageName != nil {\n\t\tv := *s.StageName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"stageName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.TracingEnabled != nil {\n\t\tv := *s.TracingEnabled\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"tracingEnabled\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.Variables != nil {\n\t\tv := s.Variables\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"variables\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.WebAclArn != nil {\n\t\tv := *s.WebAclArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"webAclArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d72d2cf0ad55cf640a892005f93511e4", "score": "0.53905535", "text": "func (s DescribeCompanyNetworkConfigurationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "eaa6651c10ac0099c337f3d7cf434b78", "score": "0.53889674", "text": "func (s *MyStruct) EncodeTo(e *xdr.Encoder) error {\n var err error\nif _, err = e.EncodeInt(int32(s.SomeInt)); err != nil {\n return err\n}\nif err = s.ABigInt.EncodeTo(e); err != nil {\n return err\n}\nif _, err = e.EncodeFixedOpaque(s.SomeOpaque[:]); err != nil {\n return err\n}\nif _, err = e.EncodeString(string(s.SomeString)); err != nil {\n return err\n}\nif _, err = e.EncodeString(string(s.MaxString)); err != nil {\n return err\n}\n return nil\n}", "title": "" }, { "docid": "212b354046a9cb8cb0cd3a62d0f0c2b3", "score": "0.5387246", "text": "func (s PhoneNumber) MarshalFields(e protocol.FieldEncoder) error {\n\tif len(s.Associations) > 0 {\n\t\tv := s.Associations\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Associations\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.Capabilities != nil {\n\t\tv := s.Capabilities\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Capabilities\", v, metadata)\n\t}\n\tif s.CreatedTimestamp != nil {\n\t\tv := *s.CreatedTimestamp\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"CreatedTimestamp\", protocol.TimeValue{V: v, Format: protocol.UnixTimeFormat}, metadata)\n\t}\n\tif s.DeletionTimestamp != nil {\n\t\tv := *s.DeletionTimestamp\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"DeletionTimestamp\", protocol.TimeValue{V: v, Format: protocol.UnixTimeFormat}, metadata)\n\t}\n\tif s.E164PhoneNumber != nil {\n\t\tv := *s.E164PhoneNumber\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"E164PhoneNumber\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.PhoneNumberId != nil {\n\t\tv := *s.PhoneNumberId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"PhoneNumberId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.ProductType) > 0 {\n\t\tv := s.ProductType\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"ProductType\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif len(s.Status) > 0 {\n\t\tv := s.Status\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Status\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.UpdatedTimestamp != nil {\n\t\tv := *s.UpdatedTimestamp\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"UpdatedTimestamp\", protocol.TimeValue{V: v, Format: protocol.UnixTimeFormat}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cd7ca731823e737a9988d7efdd0f2254", "score": "0.5381664", "text": "func (s UpdateDomainMetadataInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.DisplayName != nil {\n\t\tv := *s.DisplayName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"DisplayName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DomainName != nil {\n\t\tv := *s.DomainName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"DomainName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5d35501ea26d7075e1e213f57b872b64", "score": "0.53763044", "text": "func (s GetBotOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.AbortStatement != nil {\n\t\tv := s.AbortStatement\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"abortStatement\", v, metadata)\n\t}\n\tif s.Checksum != nil {\n\t\tv := *s.Checksum\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"checksum\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ChildDirected != nil {\n\t\tv := *s.ChildDirected\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"childDirected\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.ClarificationPrompt != nil {\n\t\tv := s.ClarificationPrompt\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"clarificationPrompt\", v, metadata)\n\t}\n\tif s.CreatedDate != nil {\n\t\tv := *s.CreatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"createdDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.DetectSentiment != nil {\n\t\tv := *s.DetectSentiment\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"detectSentiment\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.FailureReason != nil {\n\t\tv := *s.FailureReason\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"failureReason\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.IdleSessionTTLInSeconds != nil {\n\t\tv := *s.IdleSessionTTLInSeconds\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"idleSessionTTLInSeconds\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.Intents != nil {\n\t\tv := s.Intents\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"intents\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.LastUpdatedDate != nil {\n\t\tv := *s.LastUpdatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"lastUpdatedDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif len(s.Locale) > 0 {\n\t\tv := s.Locale\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"locale\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Status) > 0 {\n\t\tv := s.Status\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"status\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.Version != nil {\n\t\tv := *s.Version\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"version\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.VoiceId != nil {\n\t\tv := *s.VoiceId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"voiceId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4d1a3ed155dc2e98ee2ddc8ce29ed57a", "score": "0.5371399", "text": "func (s GetResolverInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.ApiId != nil {\n\t\tv := *s.ApiId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"apiId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FieldName != nil {\n\t\tv := *s.FieldName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"fieldName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.TypeName != nil {\n\t\tv := *s.TypeName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"typeName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5632b4ecbc63435448e96230d0eb0343", "score": "0.5371096", "text": "func (s AddThingToThingGroupInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.OverrideDynamicGroups != nil {\n\t\tv := *s.OverrideDynamicGroups\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"overrideDynamicGroups\", protocol.BoolValue(v), metadata)\n\t}\n\tif s.ThingArn != nil {\n\t\tv := *s.ThingArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"thingArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ThingGroupArn != nil {\n\t\tv := *s.ThingGroupArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"thingGroupArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ThingGroupName != nil {\n\t\tv := *s.ThingGroupName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"thingGroupName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.ThingName != nil {\n\t\tv := *s.ThingName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"thingName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e0a04bbad29e95363b0be9135891d26b", "score": "0.5366255", "text": "func (ProtoCodec) Marshal(v interface{}) ([]byte, error) {\n\treturn ProtoMarshal(v)\n}", "title": "" }, { "docid": "7b7b57093cbedf803597e599fdd59ffe", "score": "0.5351633", "text": "func (s CreateElasticsearchDomainInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.AccessPolicies != nil {\n\t\tv := *s.AccessPolicies\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"AccessPolicies\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.AdvancedOptions != nil {\n\t\tv := s.AdvancedOptions\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"AdvancedOptions\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.CognitoOptions != nil {\n\t\tv := s.CognitoOptions\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"CognitoOptions\", v, metadata)\n\t}\n\tif s.DomainEndpointOptions != nil {\n\t\tv := s.DomainEndpointOptions\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"DomainEndpointOptions\", v, metadata)\n\t}\n\tif s.DomainName != nil {\n\t\tv := *s.DomainName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"DomainName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.EBSOptions != nil {\n\t\tv := s.EBSOptions\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"EBSOptions\", v, metadata)\n\t}\n\tif s.ElasticsearchClusterConfig != nil {\n\t\tv := s.ElasticsearchClusterConfig\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"ElasticsearchClusterConfig\", v, metadata)\n\t}\n\tif s.ElasticsearchVersion != nil {\n\t\tv := *s.ElasticsearchVersion\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"ElasticsearchVersion\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.EncryptionAtRestOptions != nil {\n\t\tv := s.EncryptionAtRestOptions\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"EncryptionAtRestOptions\", v, metadata)\n\t}\n\tif s.LogPublishingOptions != nil {\n\t\tv := s.LogPublishingOptions\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"LogPublishingOptions\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetFields(k1, v1)\n\t\t}\n\t\tms0.End()\n\n\t}\n\tif s.NodeToNodeEncryptionOptions != nil {\n\t\tv := s.NodeToNodeEncryptionOptions\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"NodeToNodeEncryptionOptions\", v, metadata)\n\t}\n\tif s.SnapshotOptions != nil {\n\t\tv := s.SnapshotOptions\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"SnapshotOptions\", v, metadata)\n\t}\n\tif s.VPCOptions != nil {\n\t\tv := s.VPCOptions\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"VPCOptions\", v, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f957d7e3c734581675bed5a5812d19e2", "score": "0.5350698", "text": "func (s PutVoiceConnectorOriginationInput) MarshalFields(e protocol.FieldEncoder) error {\n\n\tif s.Origination != nil {\n\t\tv := s.Origination\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"Origination\", v, metadata)\n\t}\n\tif s.VoiceConnectorId != nil {\n\t\tv := *s.VoiceConnectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"voiceConnectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "eecf0e103a160ce3815efd6c76047c0f", "score": "0.53483593", "text": "func (s DescribeContactOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.ContactId != nil {\n\t\tv := *s.ContactId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"contactId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.ContactStatus) > 0 {\n\t\tv := s.ContactStatus\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"contactStatus\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.DataflowList != nil {\n\t\tv := s.DataflowList\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"dataflowList\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.EndTime != nil {\n\t\tv := *s.EndTime\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"endTime\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.ErrorMessage != nil {\n\t\tv := *s.ErrorMessage\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"errorMessage\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.GroundStation != nil {\n\t\tv := *s.GroundStation\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"groundStation\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.MaximumElevation != nil {\n\t\tv := s.MaximumElevation\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.BodyTarget, \"maximumElevation\", v, metadata)\n\t}\n\tif s.MissionProfileArn != nil {\n\t\tv := *s.MissionProfileArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"missionProfileArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.PostPassEndTime != nil {\n\t\tv := *s.PostPassEndTime\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"postPassEndTime\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.PrePassStartTime != nil {\n\t\tv := *s.PrePassStartTime\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"prePassStartTime\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.Region != nil {\n\t\tv := *s.Region\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"region\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.SatelliteArn != nil {\n\t\tv := *s.SatelliteArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"satelliteArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.StartTime != nil {\n\t\tv := *s.StartTime\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"startTime\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.Tags != nil {\n\t\tv := s.Tags\n\n\t\tmetadata := protocol.Metadata{}\n\t\tms0 := e.Map(protocol.BodyTarget, \"tags\", metadata)\n\t\tms0.Start()\n\t\tfor k1, v1 := range v {\n\t\t\tms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tms0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "428093762cdad03dad01de1a07b66f4f", "score": "0.53407085", "text": "func (s UpdateAuditStreamConfigurationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.AuditStreamArn != nil {\n\t\tv := *s.AuditStreamArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"AuditStreamArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d9317860b0b92ddf992561848719ab46", "score": "0.5337636", "text": "func (s UpdateFleetMetadataOutput) MarshalFields(e protocol.FieldEncoder) error {\n\treturn nil\n}", "title": "" }, { "docid": "f8f4f4e6c0c53603c465b02cb5e90aad", "score": "0.53371817", "text": "func (s DescribeCompanyNetworkConfigurationOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif len(s.SecurityGroupIds) > 0 {\n\t\tv := s.SecurityGroupIds\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"SecurityGroupIds\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif len(s.SubnetIds) > 0 {\n\t\tv := s.SubnetIds\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"SubnetIds\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.VpcId != nil {\n\t\tv := *s.VpcId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"VpcId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "21675d77fc1620308981030d5798b923", "score": "0.5336711", "text": "func (s SignOutUserInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Username != nil {\n\t\tv := *s.Username\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Username\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d52b1c2cfbbd982105f771069715264e", "score": "0.53321385", "text": "func (s UpdateMissionProfileInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.ContactPostPassDurationSeconds != nil {\n\t\tv := *s.ContactPostPassDurationSeconds\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"contactPostPassDurationSeconds\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.ContactPrePassDurationSeconds != nil {\n\t\tv := *s.ContactPrePassDurationSeconds\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"contactPrePassDurationSeconds\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.DataflowEdges != nil {\n\t\tv := s.DataflowEdges\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"dataflowEdges\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls1 := ls0.List()\n\t\t\tls1.Start()\n\t\t\tfor _, v2 := range v1 {\n\t\t\t\tls1.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v2)})\n\t\t\t}\n\t\t\tls1.End()\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.MinimumViableContactDurationSeconds != nil {\n\t\tv := *s.MinimumViableContactDurationSeconds\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"minimumViableContactDurationSeconds\", protocol.Int64Value(v), metadata)\n\t}\n\tif s.Name != nil {\n\t\tv := *s.Name\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"name\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.TrackingConfigArn != nil {\n\t\tv := *s.TrackingConfigArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"trackingConfigArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.MissionProfileId != nil {\n\t\tv := *s.MissionProfileId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"missionProfileId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ecf3469b2b8379eb9d3ceaeaeb004a3b", "score": "0.5330147", "text": "func (s PutVoiceConnectorTerminationCredentialsInput) MarshalFields(e protocol.FieldEncoder) error {\n\n\tif len(s.Credentials) > 0 {\n\t\tv := s.Credentials\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"Credentials\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddFields(v1)\n\t\t}\n\t\tls0.End()\n\n\t}\n\tif s.VoiceConnectorId != nil {\n\t\tv := *s.VoiceConnectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"voiceConnectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "eeadca8380b048b5589f9a36e6760472", "score": "0.53272456", "text": "func (s DescribeAuditStreamConfigurationInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/x-amz-json-1.1\"), protocol.Metadata{})\n\n\tif s.FleetArn != nil {\n\t\tv := *s.FleetArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"FleetArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2b3911c259268a9e59b483f6a557827c", "score": "0.53239256", "text": "func (s SampleChannelDataOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.Payloads != nil {\n\t\tv := s.Payloads\n\n\t\tmetadata := protocol.Metadata{}\n\t\tls0 := e.List(protocol.BodyTarget, \"payloads\", metadata)\n\t\tls0.Start()\n\t\tfor _, v1 := range v {\n\t\t\tls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.BytesValue(v1)})\n\t\t}\n\t\tls0.End()\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "490378f190fae8a5689d6f6316ff8198", "score": "0.5319146", "text": "func Marshal(pb proto.Message) ([]byte, error) { return proto.Marshal(pb) }", "title": "" }, { "docid": "b01f3de7127297ee5317ce4343369bd1", "score": "0.53140163", "text": "func (s UpdateUserInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.Email != nil {\n\t\tv := *s.Email\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Email\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Role) > 0 {\n\t\tv := s.Role\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Role\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.AwsAccountId != nil {\n\t\tv := *s.AwsAccountId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"AwsAccountId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Namespace != nil {\n\t\tv := *s.Namespace\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"Namespace\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.UserName != nil {\n\t\tv := *s.UserName\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"UserName\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "93a4fe8a6cc0c8a634902bf804cb160a", "score": "0.53121895", "text": "func (s UpdatePhoneNumberInput) MarshalFields(e protocol.FieldEncoder) error {\n\n\tif len(s.ProductType) > 0 {\n\t\tv := s.ProductType\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"ProductType\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\tif s.PhoneNumberId != nil {\n\t\tv := *s.PhoneNumberId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"phoneNumberId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8855df4536fb84c8279ea4dac6c217ee", "score": "0.5311145", "text": "func (s CreateDocumentationVersionOutput) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.CreatedDate != nil {\n\t\tv := *s.CreatedDate\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"createdDate\",\n\t\t\tprotocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)\n\t}\n\tif s.Description != nil {\n\t\tv := *s.Description\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"description\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.Version != nil {\n\t\tv := *s.Version\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"version\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "53cf1c93f6cc7144a3d5870a76f81064", "score": "0.5308831", "text": "func (s PutEventsInput) MarshalFields(e protocol.FieldEncoder) error {\n\te.SetValue(protocol.HeaderTarget, \"Content-Type\", protocol.StringValue(\"application/json\"), protocol.Metadata{})\n\n\tif s.ApplicationId != nil {\n\t\tv := *s.ApplicationId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"application-id\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif s.EventsRequest != nil {\n\t\tv := s.EventsRequest\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetFields(protocol.PayloadTarget, \"EventsRequest\", v, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "45a3fc26c4c62e54f0599ed8bb0ea6c4", "score": "0.53081125", "text": "func (s ExportServerSideEncryption) MarshalFields(e protocol.FieldEncoder) error {\n\tif s.KmsKeyArn != nil {\n\t\tv := *s.KmsKeyArn\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"KmsKeyArn\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\tif len(s.Type) > 0 {\n\t\tv := s.Type\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.BodyTarget, \"Type\", protocol.QuotedValue{ValueMarshaler: v}, metadata)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aef20a6209ed938a9b1180e71b3b385e", "score": "0.5306296", "text": "func (s GetVoiceConnectorTerminationInput) MarshalFields(e protocol.FieldEncoder) error {\n\n\tif s.VoiceConnectorId != nil {\n\t\tv := *s.VoiceConnectorId\n\n\t\tmetadata := protocol.Metadata{}\n\t\te.SetValue(protocol.PathTarget, \"voiceConnectorId\", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)\n\t}\n\treturn nil\n}", "title": "" } ]
49260879103f9edb548ce03acd8c8bbd
pc+=sBx; if (a) close all upvalues >= r[a 1]
[ { "docid": "2eb6f8afa0ea438c2a517cdddf5eb025", "score": "0.0", "text": "func (fi *funcInfo) emitJmp(a, sBx int) int {\n\tfi.emitAsBx(vm.OP_JMP, a, sBx)\n\treturn len(fi.insts) - 1\n}", "title": "" } ]
[ { "docid": "59d49bee98e409341ca94484e3139e43", "score": "0.56181085", "text": "func CarryOpp(out1 *TightFieldElement, arg1 *TightFieldElement) {\n\tx1 := (0x1ffffffe - arg1[0])\n\tx2 := (uint32(uint1((x1 >> 28))) + (0xffffffe - arg1[1]))\n\tx3 := (uint32(uint1((x2 >> 27))) + (0x1ffffffe - arg1[2]))\n\tx4 := (uint32(uint1((x3 >> 28))) + (0xffffffe - arg1[3]))\n\tx5 := (uint32(uint1((x4 >> 27))) + (0x1ffffffe - arg1[4]))\n\tx6 := (uint32(uint1((x5 >> 28))) + (0xffffffe - arg1[5]))\n\tx7 := (uint32(uint1((x6 >> 27))) + (0xffffffe - arg1[6]))\n\tx8 := (uint32(uint1((x7 >> 27))) + (0x1ffffffe - arg1[7]))\n\tx9 := (uint32(uint1((x8 >> 28))) + (0xffffffe - arg1[8]))\n\tx10 := (uint32(uint1((x9 >> 27))) + (0x1ffffffe - arg1[9]))\n\tx11 := (uint32(uint1((x10 >> 28))) + (0xffffffe - arg1[10]))\n\tx12 := (uint32(uint1((x11 >> 27))) + (0x1ffffffe - arg1[11]))\n\tx13 := (uint32(uint1((x12 >> 28))) + (0xffffffe - arg1[12]))\n\tx14 := (uint32(uint1((x13 >> 27))) + (0xffffffe - arg1[13]))\n\tx15 := (uint32(uint1((x14 >> 27))) + (0x1ffffffe - arg1[14]))\n\tx16 := (uint32(uint1((x15 >> 28))) + (0xffffffe - arg1[15]))\n\tx17 := (uint32(uint1((x16 >> 27))) + (0x1ffffffe - arg1[16]))\n\tx18 := (uint32(uint1((x17 >> 28))) + (0xffffffe - arg1[17]))\n\tx19 := (uint32(uint1((x18 >> 27))) + (0xffffffe - arg1[18]))\n\tx20 := ((x1 & 0xfffffff) + uint32(uint1((x19 >> 27))))\n\tx21 := (uint32(uint1((x20 >> 28))) + (x2 & 0x7ffffff))\n\tx22 := (x20 & 0xfffffff)\n\tx23 := (x21 & 0x7ffffff)\n\tx24 := (uint32(uint1((x21 >> 27))) + (x3 & 0xfffffff))\n\tx25 := (x4 & 0x7ffffff)\n\tx26 := (x5 & 0xfffffff)\n\tx27 := (x6 & 0x7ffffff)\n\tx28 := (x7 & 0x7ffffff)\n\tx29 := (x8 & 0xfffffff)\n\tx30 := (x9 & 0x7ffffff)\n\tx31 := (x10 & 0xfffffff)\n\tx32 := (x11 & 0x7ffffff)\n\tx33 := (x12 & 0xfffffff)\n\tx34 := (x13 & 0x7ffffff)\n\tx35 := (x14 & 0x7ffffff)\n\tx36 := (x15 & 0xfffffff)\n\tx37 := (x16 & 0x7ffffff)\n\tx38 := (x17 & 0xfffffff)\n\tx39 := (x18 & 0x7ffffff)\n\tx40 := (x19 & 0x7ffffff)\n\tout1[0] = x22\n\tout1[1] = x23\n\tout1[2] = x24\n\tout1[3] = x25\n\tout1[4] = x26\n\tout1[5] = x27\n\tout1[6] = x28\n\tout1[7] = x29\n\tout1[8] = x30\n\tout1[9] = x31\n\tout1[10] = x32\n\tout1[11] = x33\n\tout1[12] = x34\n\tout1[13] = x35\n\tout1[14] = x36\n\tout1[15] = x37\n\tout1[16] = x38\n\tout1[17] = x39\n\tout1[18] = x40\n}", "title": "" }, { "docid": "26c2bdb48dbd36b4ba702803f63dbcc3", "score": "0.55355793", "text": "func CarryOpp(out1 *TightFieldElement, arg1 *TightFieldElement) {\n\tx1 := (0x7ffffda - arg1[0])\n\tx2 := (uint32(uint1((x1 >> 26))) + (0x3fffffe - arg1[1]))\n\tx3 := (uint32(uint1((x2 >> 25))) + (0x7fffffe - arg1[2]))\n\tx4 := (uint32(uint1((x3 >> 26))) + (0x3fffffe - arg1[3]))\n\tx5 := (uint32(uint1((x4 >> 25))) + (0x7fffffe - arg1[4]))\n\tx6 := (uint32(uint1((x5 >> 26))) + (0x3fffffe - arg1[5]))\n\tx7 := (uint32(uint1((x6 >> 25))) + (0x7fffffe - arg1[6]))\n\tx8 := (uint32(uint1((x7 >> 26))) + (0x3fffffe - arg1[7]))\n\tx9 := (uint32(uint1((x8 >> 25))) + (0x7fffffe - arg1[8]))\n\tx10 := (uint32(uint1((x9 >> 26))) + (0x3fffffe - arg1[9]))\n\tx11 := ((x1 & 0x3ffffff) + (uint32(uint1((x10 >> 25))) * 0x13))\n\tx12 := (uint32(uint1((x11 >> 26))) + (x2 & 0x1ffffff))\n\tx13 := (x11 & 0x3ffffff)\n\tx14 := (x12 & 0x1ffffff)\n\tx15 := (uint32(uint1((x12 >> 25))) + (x3 & 0x3ffffff))\n\tx16 := (x4 & 0x1ffffff)\n\tx17 := (x5 & 0x3ffffff)\n\tx18 := (x6 & 0x1ffffff)\n\tx19 := (x7 & 0x3ffffff)\n\tx20 := (x8 & 0x1ffffff)\n\tx21 := (x9 & 0x3ffffff)\n\tx22 := (x10 & 0x1ffffff)\n\tout1[0] = x13\n\tout1[1] = x14\n\tout1[2] = x15\n\tout1[3] = x16\n\tout1[4] = x17\n\tout1[5] = x18\n\tout1[6] = x19\n\tout1[7] = x20\n\tout1[8] = x21\n\tout1[9] = x22\n}", "title": "" }, { "docid": "4bdf11ea6c6ab672c2e8208ee1778c5c", "score": "0.5431214", "text": "func opIFG(a,b *Word, cpu *DCPU) {\n\tif *a <= *b {\n\t\tcpu.pc++ // skip if greater or equal than\n\t}\n}", "title": "" }, { "docid": "b057dbd6aab862d732b0c715e5da4ab0", "score": "0.5351166", "text": "func (c *cpu) inc_r(opcode uint8, gb *GameBoy) {\n\tvar r *uint8\n\n\tswitch opcode {\n\tcase 0x04:\n\t\tr = &c.B\n\tcase 0x0C:\n\t\tr = &c.C\n\tcase 0x14:\n\t\tr = &c.D\n\tcase 0x1C:\n\t\tr = &c.E\n\tcase 0x24:\n\t\tr = &c.H\n\tcase 0x2C:\n\t\tr = &c.L\n\tcase 0x3C:\n\t\tr = &c.A\n\t}\n\n\tv := *r\n\tc.F.set(Z, v+1 == 0)\n\tc.F.set(N, false)\n\tc.F.set(H, v&0xF == 0xF)\n\t*r = v + 1\n}", "title": "" }, { "docid": "8ba5eb5b23ca248bf231484ddeab20b0", "score": "0.5336585", "text": "func get_upper_bound(p *readData.Problem, dr float32, j int) float32 {\n\tvar upper_1 float32\n\tvar upper_2 float32\n\tvar s1 float32\n\tvar s2 float32\n\tvar s_y_1 float32\n\tvar s_y_0 float32 //for label -1\n\tnnz := len(p.A_cols[j].Idxs)\n\tfor i := 0; i < len(p.A_cols[j].Idxs); i++ {\n\t\tsample_index := p.A_cols[j].Idxs[i]\n\t\ts1 = s1 + p.A_cols[j].Values[i]/(1.0+(mathOp.Exp(p.Ax[sample_index])))\n\t\ts2 = s2 + p.A_cols[j].Values[i]/(1.0+(mathOp.Exp(-p.Ax[sample_index])))\n\t\tif p.Labels[sample_index] == 1 {\n\t\t\ts_y_1 = s_y_1 + p.A_cols[j].Values[i]\n\t\t} else {\n\t\t\ts_y_0 = s_y_0 + p.A_cols[j].Values[i]\n\t\t}\n\t}\n\ts1 = s1 / float32(p.L)\n\ts1 = s1 * (mathOp.Exp(-dr*p.Xj_max[j]) - 1.0)\n\ts1 = s1 / p.Xj_max[j] * float32(nnz) / float32(p.L)\n\tupper_1 = float32(nnz) / float32(p.L) * (mathOp.Log(1.0 + s1))\n\ts_y_0 = dr*s_y_0/float32(p.L) + p.Lambda*(mathOp.Abs(p.X[j]+dr)-mathOp.Abs(p.X[j]))\n\tupper_1 = upper_1 + s_y_0\n\n\ts2 = s2 / float32(p.L)\n\ts2 = s2 * (mathOp.Exp(dr*p.Xj_max[j]) - 1.0)\n\ts2 = s2 / p.Xj_max[j] * float32(nnz) / float32(p.L)\n\tupper_2 = float32(nnz) / float32(p.L) * (mathOp.Log((1.0 + s2)))\n\ts_y_1 = -dr*s_y_1/float32(p.L) + p.Lambda*(mathOp.Abs(p.X[j]+dr)-mathOp.Abs(p.X[j]))\n\tupper_2 = upper_2 + s_y_1\n\n\tif upper_1 < upper_2 {\n\t\treturn upper_1\n\t} else {\n\t\treturn upper_2\n\t}\n}", "title": "" }, { "docid": "f3e84b201d8773663aa9a1fc9b644ede", "score": "0.5233976", "text": "func opPLA(cpu *MG6502) uint8 {\n\tcpu.A = cpu.pop()\n\tcpu.SetFlag(FlagZero, cpu.A == 0x00)\n\tcpu.SetFlag(FlagNegative, cpu.A&0x80 != 0)\n\treturn 0\n}", "title": "" }, { "docid": "99e892136ccf9d37380c62f874ed1f23", "score": "0.5166485", "text": "func replace(p int64, di int64) { \n var vrep int64\n for i:=np-1; i>=0; i-- {\n if bak[i].p <= p {\n break;\n } else {\n vrep += bak[i].vol\n bak[i].vol = 0\n np = i\n }\n }\n // adding bought fuel\n bak[np].p = p\n bak[np].vol = vrep + di\n np++\n //fmt.Printf(\"replaced %d\\n\",di)\n}", "title": "" }, { "docid": "0e35c970d3e5a97215984f93c44a304a", "score": "0.51253533", "text": "func Opp(out1 *LooseFieldElement, arg1 *TightFieldElement) {\n\tx1 := (0x1ffffffe - arg1[0])\n\tx2 := (0xffffffe - arg1[1])\n\tx3 := (0x1ffffffe - arg1[2])\n\tx4 := (0xffffffe - arg1[3])\n\tx5 := (0x1ffffffe - arg1[4])\n\tx6 := (0xffffffe - arg1[5])\n\tx7 := (0xffffffe - arg1[6])\n\tx8 := (0x1ffffffe - arg1[7])\n\tx9 := (0xffffffe - arg1[8])\n\tx10 := (0x1ffffffe - arg1[9])\n\tx11 := (0xffffffe - arg1[10])\n\tx12 := (0x1ffffffe - arg1[11])\n\tx13 := (0xffffffe - arg1[12])\n\tx14 := (0xffffffe - arg1[13])\n\tx15 := (0x1ffffffe - arg1[14])\n\tx16 := (0xffffffe - arg1[15])\n\tx17 := (0x1ffffffe - arg1[16])\n\tx18 := (0xffffffe - arg1[17])\n\tx19 := (0xffffffe - arg1[18])\n\tout1[0] = x1\n\tout1[1] = x2\n\tout1[2] = x3\n\tout1[3] = x4\n\tout1[4] = x5\n\tout1[5] = x6\n\tout1[6] = x7\n\tout1[7] = x8\n\tout1[8] = x9\n\tout1[9] = x10\n\tout1[10] = x11\n\tout1[11] = x12\n\tout1[12] = x13\n\tout1[13] = x14\n\tout1[14] = x15\n\tout1[15] = x16\n\tout1[16] = x17\n\tout1[17] = x18\n\tout1[18] = x19\n}", "title": "" }, { "docid": "e82df685d0b931732aa78162dfe35ca0", "score": "0.5092751", "text": "func tryAndIncrementEvm(message []byte, hashfunc func(message []byte) [32]byte, curve CurveSystem) (px, py *big.Int) {\n\tcounter := []byte{byte(0)}\n\tpx = new(big.Int)\n\tpy = new(big.Int)\n\tq := curve.GetG1Q()\n\tfor {\n\t\th := hashfunc(append(counter, message...))\n\t\tcounter[0]++\n\t\tpx.SetBytes(h[:32])\n\t\tpx.Mod(px, q)\n\t\tySqr := curve.g1XToYSquared(px)\n\t\troot := calcQuadRes(ySqr, q)\n\t\trootSqr := new(big.Int).Exp(root, two, q)\n\t\tif rootSqr.Cmp(ySqr) == 0 {\n\t\t\tpy = root\n\t\t\tcounter[0] = byte(255)\n\t\t\tsignY := hashfunc(append(counter, message...))[31] % 2\n\t\t\tif signY == 1 {\n\t\t\t\tpy.Sub(q, py)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "6d3fab057006151209c0326ec074e01e", "score": "0.506456", "text": "func step(p []byte, pc *uintptr, val *int32, first bool) (newp []byte, ok bool) {\n\t// For both uvdelta and pcdelta, the common case (~70%)\n\t// is that they are a single byte. If so, avoid calling readvarint.\n\tuvdelta := uint32(p[0])\n\tif uvdelta == 0 && !first {\n\t\treturn nil, false\n\t}\n\tn := uint32(1)\n\tif uvdelta&0x80 != 0 {\n\t\tn, uvdelta = readvarint(p)\n\t}\n\t*val += int32(-(uvdelta & 1) ^ (uvdelta >> 1))\n\tp = p[n:]\n\n\tpcdelta := uint32(p[0])\n\tn = 1\n\tif pcdelta&0x80 != 0 {\n\t\tn, pcdelta = readvarint(p)\n\t}\n\tp = p[n:]\n\t*pc += uintptr(pcdelta * PCQuantum)\n\treturn p, true\n}", "title": "" }, { "docid": "463e3f7351a475dc168841b283a90a5d", "score": "0.5048228", "text": "func B(input int) int {\n\tif input < 1 {\n\t\treturn 1\n\t}\n\n\tprev := []int{1}\n\tdepth := 1\n\n\tfor {\n\t\tarmLen := depth * 2\n\t\tnext := make([]int, armLen*4)\n\t\tvar armNum int\n\t\tadjSide := make([]int, armLen-1)\n\t\tfor i := range next {\n\t\t\tsum := 0\n\t\t\tarmPos := i % armLen\n\t\t\tif armPos == 0 {\n\t\t\t\tarmNum = i / armLen\n\t\t\t\tfor j := range adjSide[1:] {\n\t\t\t\t\tadjSide[j+1] = prev[armNum*(armLen-2)+(j)]\n\t\t\t\t}\n\t\t\t\tfirstPos := armNum*(armLen-2) - 1\n\t\t\t\tif firstPos < 0 {\n\t\t\t\t\tadjSide[0] = prev[len(prev)-1]\n\t\t\t\t} else {\n\t\t\t\t\tadjSide[0] = prev[firstPos]\n\t\t\t\t}\n\t\t\t\tif armNum == 3 {\n\t\t\t\t\tadjSide = append(adjSide, next[0])\n\t\t\t\t}\n\t\t\t}\n\t\t\tif i > 0 {\n\t\t\t\tsum += next[i-1]\n\t\t\t\tif armPos == 0 {\n\t\t\t\t\tsum += next[i-2]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif armPos < (len(adjSide)) {\n\t\t\t\tsum += adjSide[armPos]\n\t\t\t}\n\t\t\tif armPos < (len(adjSide) - 1) {\n\t\t\t\tsum += adjSide[armPos+1]\n\t\t\t}\n\t\t\tif armPos > 0 {\n\t\t\t\tsum += adjSide[armPos-1]\n\t\t\t}\n\t\t\tif sum > input {\n\t\t\t\treturn sum\n\t\t\t}\n\t\t\tnext[i] = sum\n\t\t}\n\t\tprev = next\n\t\tdepth++\n\t}\n}", "title": "" }, { "docid": "bf3a4f90c61a2eb20cb075ee75a2223e", "score": "0.502441", "text": "func (a *arc) pushUpward(child *node, parent *node, resCap int) {\n\tstats.Pushes++\n\tif resCap >= child.excess {\n\t\tparent.excess += child.excess\n\t\ta.flow += child.excess\n\t\tchild.excess = 0\n\t\treturn\n\t}\n\n\ta.direction = 0\n\tparent.excess += resCap\n\tchild.excess -= resCap\n\ta.flow = a.capacity\n\tparent.outOfTree[parent.numberOutOfTree] = a\n\tparent.numberOutOfTree++\n\tparent.breakRelationship(child)\n\tif PseudoCtx.LowestLabel {\n\t\tlowestStrongLabel = child.label\n\t}\n\n\tchild.addToStrongBucket(strongRoots[child.label])\n}", "title": "" }, { "docid": "2bce47b57e8213d5ed889d6e5e1120d6", "score": "0.50057894", "text": "func CxSimulatedBinaryBounded(ind1 *base.Float64Individual, ind2 *base.Float64Individual, eta float64, low interface{}, up interface{}) (*base.Float64Individual, *base.Float64Individual) {\n\tl1, l2 := ind1.Len(), ind2.Len()\n\tsize := utility.If(l1 < l2, l1, l2).(int)\n\tlows := utility.Interface2Float64Slice(\"low\", low, size)\n\tups := utility.Interface2Float64Slice(\"up\", up, size)\n\tgc1, gc2 := ind1.GetChromosome().([]float64), ind2.GetChromosome().([]float64)\n\tfor i := 0; i < size; i++ {\n\t\ty1, y2 := gc1[i], gc2[i]\n\t\tif rand.Float64() <= 0.5 {\n\t\t\tif math.Abs(y1-y2) > 1E-14 {\n\t\t\t\tx1 := math.Min(y1, y2)\n\t\t\t\tx2 := math.Max(y1, y2)\n\t\t\t\tran := rand.Float64()\n\n\t\t\t\tbeta := 1.0 + (2.0 * (x1 - lows[i]) / (x2 - x1))\n\t\t\t\talpha := 2.0 - math.Pow(beta, -(eta+1))\n\t\t\t\tvar betaQ float64\n\n\t\t\t\tif ran <= 1.0/alpha {\n\t\t\t\t\tbetaQ = math.Pow(ran*alpha, 1.0/(eta+1))\n\t\t\t\t} else {\n\t\t\t\t\tbetaQ = math.Pow(1.0/(2.0-ran*alpha), 1.0/(eta+1))\n\t\t\t\t}\n\t\t\t\tc1 := 0.5 * (x1 + x2 - betaQ*(x2-x1))\n\n\t\t\t\tbeta = 1.0 + (2.0 * (ups[i] - x2) / (x2 - x1))\n\t\t\t\talpha = 2.0 - math.Pow(beta, -(eta+1))\n\t\t\t\tif ran <= 1.0/alpha {\n\t\t\t\t\tbetaQ = math.Pow(ran*alpha, 1.0/(eta+1))\n\t\t\t\t} else {\n\t\t\t\t\tbetaQ = math.Pow(1.0/(2.0-ran*alpha), 1.0/(eta+1))\n\t\t\t\t}\n\t\t\t\tc2 := 0.5 * (x1 + x2 + betaQ*(x2-x1))\n\n\t\t\t\tc1 = math.Min(math.Max(c1, lows[i]), ups[i])\n\t\t\t\tc2 = math.Min(math.Max(c2, lows[i]), ups[i])\n\n\t\t\t\tif rand.Float64() <= 0.5 {\n\t\t\t\t\tgc1[i] = c2\n\t\t\t\t\tgc2[i] = c1\n\t\t\t\t} else {\n\t\t\t\t\tgc1[i] = c1\n\t\t\t\t\tgc2[i] = c2\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ind1, ind2\n}", "title": "" }, { "docid": "62a14c259530e2c867f3ef48cb9211e1", "score": "0.50052065", "text": "func maximizingXor(l int32, r int32) int32 {\nvar res int32 = 0\nvar a, b int32\n for a = l; a <= r; a++ {\n for b = a + 1; b <= r; b++ {\n temp := a ^ b\n if temp > res {\n res = temp\n }\n }\n }\n return res\n}", "title": "" }, { "docid": "66949c2bc46541b1e0a75a1ec7edaf89", "score": "0.49830884", "text": "func (c *cpu) dec_r(opcode uint8, gb *GameBoy) {\n\tvar r *uint8\n\n\tswitch opcode {\n\tcase 0x05:\n\t\tr = &c.B\n\tcase 0x0D:\n\t\tr = &c.C\n\tcase 0x15:\n\t\tr = &c.D\n\tcase 0x1D:\n\t\tr = &c.E\n\tcase 0x25:\n\t\tr = &c.H\n\tcase 0x2D:\n\t\tr = &c.L\n\tcase 0x3D:\n\t\tr = &c.A\n\t}\n\n\tv := *r\n\tc.F.set(Z, v-1 == 0)\n\tc.F.set(N, true)\n\tc.F.set(H, v&0xF == 0)\n\t*r = v - 1\n}", "title": "" }, { "docid": "098d58c020c8634347df708cf382c0bf", "score": "0.4980292", "text": "func PLA(c *CPU6502) byte {\n\tc.stkp++\n\n\tc.a, _ = c.CPUReadStack(Word(c.stkp))\n\tc.SetFlagsZeroAndNegative(c.a)\n\treturn 0\n}", "title": "" }, { "docid": "cf9a3c8d63b1c3a546bb114b86096a87", "score": "0.49725518", "text": "func Incircle(pa [2]Float, pb [2]Float, pc [2]Float, pd [2]Float) Float {\n\t// debug.Assert(Orient2d(pa, pb, pc) > 0, \"pa, pb, and pc must be in counterclockwise order\")\n\tvar adx, bdx, cdx, ady, bdy, cdy Float\n\tvar bdxcdy, cdxbdy, cdxady, adxcdy, adxbdy, bdxady Float\n\tvar alift, blift, clift Float\n\tvar det Float\n\tvar permanent, errbound Float\n\n\tadx = pa[0] - pd[0]\n\tbdx = pb[0] - pd[0]\n\tcdx = pc[0] - pd[0]\n\tady = pa[1] - pd[1]\n\tbdy = pb[1] - pd[1]\n\tcdy = pc[1] - pd[1]\n\n\tbdxcdy = bdx * cdy\n\tcdxbdy = cdx * bdy\n\talift = adx*adx + ady*ady\n\n\tcdxady = cdx * ady\n\tadxcdy = adx * cdy\n\tblift = bdx*bdx + bdy*bdy\n\n\tadxbdy = adx * bdy\n\tbdxady = bdx * ady\n\tclift = cdx*cdx + cdy*cdy\n\n\tdet = alift*(bdxcdy-cdxbdy) +\n\t\tblift*(cdxady-adxcdy) +\n\t\tclift*(adxbdy-bdxady)\n\n\tpermanent = (abs(bdxcdy)+abs(cdxbdy))*alift +\n\t\t(abs(cdxady)+abs(adxcdy))*blift +\n\t\t(abs(adxbdy)+abs(bdxady))*clift\n\terrbound = iccerrboundA * permanent\n\tif (det > errbound) || (-det > errbound) {\n\t\treturn det\n\t}\n\n\treturn IncircleAdapt(pa, pb, pc, pd, permanent)\n}", "title": "" }, { "docid": "e66cb4e20292d9213b55eea256b2c253", "score": "0.4967101", "text": "func evaluate(b *boardStruct) int {\n\tev := 0\n\tfor sq := A1; sq <= H8; sq++ {\n\t\tp12 := b.sq[sq]\n\t\tif p12 == empty {\n\t\t\tcontinue\n\t\t}\n\t\tev += pieceVal[p12]\n\t\tev += pcSqScore(p12, sq)\n\t}\n\treturn ev\n}", "title": "" }, { "docid": "8e893f7da36eff89cf91402e60c49fba", "score": "0.49423364", "text": "func (r *poly) pointwiseAcc(a, b *polyVec) {\n\tvar t uint16\n\tfor j := 0; j < kyberN; j++ {\n\t\tt = montgomeryReduce(4613 * uint32(b.vec[0].coeffs[j])) // 4613 = 2^{2*18} % q\n\t\tr.coeffs[j] = montgomeryReduce(uint32(a.vec[0].coeffs[j]) * uint32(t))\n\t\tfor i := 1; i < len(a.vec); i++ { // len(a.vec) is kyberK, 2 3 or 4\n\t\t\tt = montgomeryReduce(4613 * uint32(b.vec[i].coeffs[j]))\n\t\t\tr.coeffs[j] += montgomeryReduce(uint32(a.vec[i].coeffs[j]) * uint32(t))\n\t\t}\n\n\t\tr.coeffs[j] = barrettReduce(r.coeffs[j])\n\t}\n}", "title": "" }, { "docid": "e47b167b6d055fab025d66239997fc84", "score": "0.49374545", "text": "func bc(v uint16) uint8 {\n\tvar cnt uint8\n\tfor {\n\t\tif v == 0 {\n\t\t\treturn cnt\n\t\t}\n\t\tv &= (v - 1)\n\t\tcnt++\n\t}\n}", "title": "" }, { "docid": "19842a965c448e0d244697205b5481b9", "score": "0.49299484", "text": "func (h *BinaryHeap) up(i int) {\n\tfor {\n\t\tj := (i - 1) / 2\n\t\tif !h.comp(h.data[i], h.data[j]) {\n\t\t\tbreak\n\t\t}\n\t\th.swap(j, i)\n\t\ti = j\n\t}\n}", "title": "" }, { "docid": "4314d8653a8d696a33b1203dbd23598b", "score": "0.49221465", "text": "func BrentsMethod(f func(float64) float64, xl float64, xu float64, es float64, maxit int) (root float64, fx float64, ea float64, iter int, err error) {\n if es < 0.0 {\n return 0.0, 0.0, 0.0, 0, errors.New(\"es must be greater than 0\")\n }\n a := xl\n b := xu\n fa := f(a)\n fb := f(b)\n c := a\n fc := fa\n d := b - c\n e := d\n iter = 0\n var m, tol, s, p, q, r float64\n ea = 100\n for ; iter < maxit; iter ++ {\n if fb == 0.0 {\n break;\n }\n if math.Signbit(fa) == math.Signbit(fb) { // if needed rearrange points\n a = c\n fa = fc\n d = b - c\n e = d\n }\n if math.Abs(fa) < math.Abs(fb) {\n c = b\n b = a\n a = c\n fc = fb\n fb = fa\n fa = fc\n }\n m = 0.5*(a - b) // Termination test and possible exit\n tol = 2.0*es*math.Max(math.Abs(b), 1.0)\n if math.Abs(m) <= tol || fb == 0.0 {\n break;\n }\n // Choose open methods or bisection\n if math.Abs(e) >= tol && math.Abs(fc) > math.Abs(fb) {\n s = fb/fc\n if a == c { // Secant method\n p = 2.0*m*s\n q = 1.0 - s\n } else { // Inverse quadractic interpolation\n q = fc/fa\n r = fb/fa\n p = s*(2.0*m*q*(q - r) - (b - c)*(r - 1.0))\n q = (q - 1.0)*(r - 1.0)*(s - 1.0)\n }\n if p > 0.0 {\n q = -q\n } else {\n p = -p\n }\n if 2.0*p < 3.0*m*q - math.Abs(tol*q) && p < math.Abs(0.5*e*q) {\n e = d\n d = p/q\n } else {\n d = m\n e = m\n }\n } else { // Bisection\n d = m\n e = m\n }\n c = b\n fc = fb\n if math.Abs(d) > tol {\n b += d\n } else {\n if b-a >= 0.0 {\n b -= tol\n } else {\n b += tol\n }\n }\n fb = f(b)\n }\n root = b\n fx = fb\n ea = math.Abs(m)\n return root, fx, ea, iter, nil\n}", "title": "" }, { "docid": "1214d76aa6c984cb8155dd7829d70c9f", "score": "0.49043187", "text": "func (s *Search) quiescence(brd *Board, stk Stack, alpha, beta, depth, ply int) (int, int) {\n\n\tthisStk := &stk[ply]\n\n\tthisStk.hashKey = brd.hashKey\n\tif stk.IsRepetition(ply, brd.halfmoveClock) { // check for draw by threefold repetition\n\t\treturn ply - DRAW_VALUE, 1\n\t}\n\n\tinCheck := thisStk.inCheck\n\tif brd.halfmoveClock >= 100 {\n\t\tif isCheckmate(brd, inCheck) {\n\t\t\treturn ply - MATE, 1\n\t\t} else {\n\t\t\treturn ply - DRAW_VALUE, 1\n\t\t}\n\t}\n\n\tbest, sum := -INF, 1\n\tvar score, total int\n\n\tif !inCheck {\n\t\tscore = evaluate(brd, alpha, beta) // stand pat\n\t\tthisStk.eval = int16(score)\n\t\tif score > best {\n\t\t\tif score > alpha {\n\t\t\t\tif score >= beta {\n\t\t\t\t\treturn score, sum\n\t\t\t\t}\n\t\t\t\talpha = score\n\t\t\t}\n\t\t\tbest = score\n\t\t}\n\t}\n\n\tlegalMoves := false\n\tmemento := brd.NewMemento()\n\tselector := NewQMoveSelector(brd, thisStk, &s.htable, brd.worker.recycler, inCheck, depth >= MIN_CHECK_DEPTH)\n\n\tvar mayPromote, givesCheck bool\n\tfor m := selector.Next(); m != NO_MOVE; m = selector.Next() {\n\n\t\tmayPromote = brd.MayPromote(m)\n\n\t\tmakeMove(brd, m)\n\n\t\tgivesCheck = brd.InCheck()\n\n\t\tif !inCheck && !givesCheck && !mayPromote && alpha > -MIN_MATE &&\n\t\t\tbest+m.CapturedPiece().Value()+ROOK_VALUE < alpha {\n\t\t\tunmakeMove(brd, m, memento)\n\t\t\tcontinue\n\t\t}\n\n\t\tstk[ply+1].inCheck = givesCheck // avoid having to recalculate in_check at beginning of search.\n\n\t\tscore, total = s.quiescence(brd, stk, -beta, -alpha, depth-1, ply+1)\n\t\tscore = -score\n\t\tsum += total\n\t\tunmakeMove(brd, m, memento)\n\n\t\tif score > best {\n\t\t\tif score > alpha {\n\t\t\t\tif score >= beta {\n\t\t\t\t\tselector.Recycle()\n\t\t\t\t\treturn score, sum\n\t\t\t\t}\n\t\t\t\talpha = score\n\t\t\t}\n\t\t\tbest = score\n\t\t}\n\t\tlegalMoves = true\n\t}\n\n\tselector.Recycle()\n\tif inCheck && !legalMoves {\n\t\treturn ply - MATE, 1 // detect checkmate.\n\t}\n\treturn best, sum\n}", "title": "" }, { "docid": "ced55f95223f492700d6e7ad0a7a08a8", "score": "0.48994768", "text": "func fp503StrongReduce(x *FpElement)", "title": "" }, { "docid": "bfb538d875931ea654c33aa0fe166abd", "score": "0.4895744", "text": "func (c *cpu) cp_r(opcode uint8, gb *GameBoy) {\n\tvar v uint8\n\tswitch opcode {\n\tcase 0xB8:\n\t\tv = c.B\n\tcase 0xB9:\n\t\tv = c.C\n\tcase 0xBA:\n\t\tv = c.D\n\tcase 0xBB:\n\t\tv = c.E\n\tcase 0xBC:\n\t\tv = c.H\n\tcase 0xBD:\n\t\tv = c.L\n\tcase 0xBF:\n\t\tv = c.A\n\t}\n\n\ta := c.A\n\tc.sub8(c.A, v)\n\tc.A = a\n}", "title": "" }, { "docid": "5a98e2effa44dac623731d87461d1f0a", "score": "0.48930684", "text": "func paeth(a, b, c uint8) uint8 {\n\t// This is an optimized version of the sample code in the PNG spec.\n\t// For example, the sample code starts with:\n\t//\tp := int(a) + int(b) - int(c)\n\t//\tpa := abs(p - int(a))\n\t// but the optimized form uses fewer arithmetic operations:\n\t//\tpa := int(b) - int(c)\n\t//\tpa = abs(pa)\n\tpc := int(c)\n\tpa := int(b) - pc\n\tpb := int(a) - pc\n\tpc = abs(pa + pb)\n\tpa = abs(pa)\n\tpb = abs(pb)\n\tif pa <= pb && pa <= pc {\n\t\treturn a\n\t} else if pb <= pc {\n\t\treturn b\n\t}\n\treturn c\n}", "title": "" }, { "docid": "1190d6960a71c2a7aa944933ac8f062e", "score": "0.48901495", "text": "func (b *ocbtab) lvalue(j uint64) [2]uint64 {\n\tif j > b.max {\n\t\tfor i := (b.max + 1); i <= j; i++ { \n\t\t\tb.ls = append(b.ls, double(b.ls[i-1]))\n\t\t}\n\n\t\tb.max = j\n\t}\n\n\treturn b.ls[j]\n}", "title": "" }, { "docid": "1cdcc47bf671c4a66e20d6b5570299f6", "score": "0.4883705", "text": "func QAP_SolveSA(a *Matrix, b *Matrix, p Vector, m int64) int64 {\n\tvar i int64\n\tn := p.Len()\n\tw := make(Vector, n)\n\tw.Copy(p)\n\tcc := cost(a, b, p)\n\tc, dmin, dmax := initQAP(a, b, w, cc)\n\tvar t0 float64 = float64(dmin + (dmax-dmin)/10.0)\n\ttf := float64(dmin)\n\tbeta := (t0 - tf) / (float64(m) * t0 * tf)\n\tvar fail int64 = 0\n\ttries := n * (n - 1) / 2\n\ttfound := t0\n\tvar temp float64 = t0\n\tvar r int64 = 0\n\tvar s int64 = 1\n\n\t// SA iterations\n\tfor i = 0; i < m; i++ {\n\t\ttemp /= (beta*temp + 1)\n\t\ts++\n\t\tif s >= n {\n\t\t\tr++\n\t\t\tif r >= n-1 {\n\t\t\t\tr = 0\n\t\t\t}\n\t\t\ts = r + 1\n\t\t}\n\t\td := delta(a, b, w, r, s)\n\t\tif (d < 0) || (rand.Float64() < math.Exp(-float64(d)/temp)) || (fail == tries) {\n\t\t\tc += d\n\t\t\tw.Swap(r, s)\n\t\t\tfail = 0\n\t\t} else {\n\t\t\tfail++\n\t\t}\n\t\tif fail == tries {\n\t\t\tbeta = 0\n\t\t\ttemp = tfound\n\t\t}\n\n\t\t// Best solution improved ?\n\t\tif c < cc {\n\t\t\tcc = c\n\t\t\tp.Copy(w)\n\t\t\ttfound = temp\n\t\t\tif Verbose {\n\t\t\t\tfmt.Printf(\"iteration %d: cost=%d\\n\", i, cc)\n\t\t\t\tp.Print()\n\t\t\t}\n\t\t}\n\t}\n\treturn cc\n}", "title": "" }, { "docid": "a85fb268a9456cec71192029586362ad", "score": "0.48816276", "text": "func trap(height []int) int {\n\tvar cap int\n\tvar left_max int = 0\n\tvar right_max int = 0\n\tvar low int = 0\n\tvar high int = len(height) - 1\n\tfor low <= high{\n\t\tif(height[low] < height[high]){\n\t\t\tif(height[low] > left_max){\n\t\t\t\tleft_max = height[low]\n\t\t\t} else{\n\t\t\t\tcap += left_max - height[low]\n\t\t\t}\n\t\t\tlow++\n\t\t}else{\n\t\t\tif(height[high] > right_max){\n\t\t\t\tright_max = height[high]\n\t\t\t}else{\n\t\t\t\tcap += right_max - height[high]\n\t\t\t}\n\t\t\thigh--\n\t\t}\n\t}\n\treturn cap\n}", "title": "" }, { "docid": "2971108f8792f7b9972b90fa6c56edf3", "score": "0.48622394", "text": "func trap(height []int) int {\n\tsum := 0\n\tleft := 0\n\tright := len(height) - 1\n\tfor left < right {\n\t\tif height[left] < height[right] {\n\t\t\th := height[left]\n\t\t\tleft++\n\t\t\tfor h >= height[left] {\n\t\t\t\tsum += (h - height[left])\n\t\t\t\tleft++\n\t\t\t}\n\t\t} else {\n\t\t\th := height[right]\n\t\t\tright--\n\t\t\t// maybe height[left] == height[right]\n\t\t\tfor left < right && h >= height[right] {\n\t\t\t\tsum += (h - height[right])\n\t\t\t\tright--\n\t\t\t}\n\t\t}\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "e063061c992c53d97529bd7622522463", "score": "0.48583907", "text": "func opPLP(cpu *MG6502) uint8 {\n\tcpu.FLAG = cpu.pop()\n\tcpu.SetFlag(FlagUnused, true)\n\treturn 0\n}", "title": "" }, { "docid": "75ff49be1e3cf9d0bcdaf807664b0625", "score": "0.48010445", "text": "func bp() (int, int) {\n\treturn 0, 0\n}", "title": "" }, { "docid": "beaf702264edeb8138c4ad5c8de8fc6f", "score": "0.4797391", "text": "func (g *Gorc) IncBy(b int32) error {\n\tif b < 0 {\n\t\treturn ErrIncreasedByNegative\n\t}\n\tatomic.AddInt32(&g.count, b)\n\treturn nil\n}", "title": "" }, { "docid": "fb9b09f515c4faeceafc766bf7eec9ea", "score": "0.47941658", "text": "func sulP503(z, x, y *FpX2)", "title": "" }, { "docid": "0b453174a1a91156da6dcb0feea75092", "score": "0.47902787", "text": "func Verify(R *PublicKeyRing, m []byte, rs *RingSign) bool {\n\ts := R.Len()\n\tif s == 0 {\n\t\treturn false\n\t}\n\tc := R.Ring[0].Curve\n\tN := c.Params().N\n\tx, y := rs.X, rs.Y\n\n\tif x.Sign() == 0 || y.Sign() == 0 {\n\t\treturn false\n\t}\n\tif x.Cmp(N) >= 0 || y.Cmp(N) >= 0 {\n\t\treturn false\n\t}\n\tif !c.IsOnCurve(x, y) { // Is tau (x,y) on the curve\n\t\treturn false\n\t}\n\tmR := append(m, R.Bytes()...)\n\thx, hy := hashG(c, mR)\n\n\tsum := new(big.Int).SetInt64(0)\n\tax := make([]*big.Int, s, s)\n\tay := make([]*big.Int, s, s)\n\tbx := make([]*big.Int, s, s)\n\tby := make([]*big.Int, s, s)\n\tvar wg sync.WaitGroup\n\tfor j := 0; j < s; j++ {\n\t\t// Check that cj,tj is in range [0..N]\n\t\tif rs.C[j].Cmp(N) >= 0 || rs.T[j].Cmp(N) >= 0 {\n\t\t\treturn false\n\t\t}\n\t\twg.Add(1)\n\t\tgo func(j int) {\n\t\t\tdefer wg.Done()\n\t\t\tcb := rs.C[j].Bytes()\n\t\t\ttb := rs.T[j].Bytes()\n\t\t\tax1, ay1 := c.ScalarBaseMult(tb) // g^tj\n\t\t\tax2, ay2 := c.ScalarMult(R.Ring[j].X, R.Ring[j].Y, cb) // yj^cj\n\t\t\tax[j], ay[j] = c.Add(ax1, ay1, ax2, ay2)\n\t\t\tbx1, by1 := c.ScalarMult(hx, hy, tb) // H(mR)^tj\n\t\t\tbx2, by2 := c.ScalarMult(x, y, cb) // tau^cj\n\t\t\tbx[j], by[j] = c.Add(bx1, by1, bx2, by2)\n\t\t}(j)\n\t\tsum.Add(sum, rs.C[j])\n\t}\n\twg.Wait()\n\thashmRab := hashAllq(mR, ax, ay, bx, by)\n\t// hashmRab := hashAllqc(c, mR, ax, ay, bx, by)\n\thashmRab.Mod(hashmRab, N)\n\tsum.Mod(sum, N)\n\treturn sum.Cmp(hashmRab) == 0\n}", "title": "" }, { "docid": "01b2c240c22841e51f8f353c388f80db", "score": "0.47863993", "text": "func opcode0xCB90(c *CPU) int {\n\tc.res(2, &c.b)\n\treturn 4\n}", "title": "" }, { "docid": "c7ea252f1d38197092a6007d575fccb0", "score": "0.47838083", "text": "func Opp(out1 *LooseFieldElement, arg1 *TightFieldElement) {\n\tx1 := (0x7ffffda - arg1[0])\n\tx2 := (0x3fffffe - arg1[1])\n\tx3 := (0x7fffffe - arg1[2])\n\tx4 := (0x3fffffe - arg1[3])\n\tx5 := (0x7fffffe - arg1[4])\n\tx6 := (0x3fffffe - arg1[5])\n\tx7 := (0x7fffffe - arg1[6])\n\tx8 := (0x3fffffe - arg1[7])\n\tx9 := (0x7fffffe - arg1[8])\n\tx10 := (0x3fffffe - arg1[9])\n\tout1[0] = x1\n\tout1[1] = x2\n\tout1[2] = x3\n\tout1[3] = x4\n\tout1[4] = x5\n\tout1[5] = x6\n\tout1[6] = x7\n\tout1[7] = x8\n\tout1[8] = x9\n\tout1[9] = x10\n}", "title": "" }, { "docid": "6bf5d6530c5330be032ef4f3e1bd2eaf", "score": "0.47827575", "text": "func (h *hmap) incrnoverflow() {\n\t// We trigger same-size map growth if there are\n\t// as many overflow buckets as buckets.\n\t// We need to be able to count to 1<<h.B.\n\tif h.B < 16 {\n\t\th.noverflow++\n\t\treturn\n\t}\n\t// Increment with probability 1/(1<<(h.B-15)).\n\t// When we reach 1<<15 - 1, we will have approximately\n\t// as many overflow buckets as buckets.\n\tmask := uint32(1)<<(h.B-15) - 1\n\t// Example: if h.B == 18, then mask == 7,\n\t// and fastrand & 7 == 0 with probability 1/8.\n\tif fastrand()&mask == 0 {\n\t\th.noverflow++\n\t}\n}", "title": "" }, { "docid": "02eb7ad34f645e86e452cf333be0763d", "score": "0.4773308", "text": "func (f *Faidx) Q(pos *FaPos) (uint32, error) {\n\t// we can't use any info from the cache\n\tidx, ok := f.Index[pos.Chrom]\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"GC: unknown sequence %s\", pos.Chrom)\n\t}\n\n\tif pos.lastStart > pos.Start || pos.Start >= pos.lastEnd || pos.lastEnd > pos.End || pos.Chrom != pos.lastChrom {\n\t\tpos.lastChrom = pos.Chrom\n\t\tpos.As, pos.Cs, pos.Gs, pos.Ts = 0, 0, 0, 0\n\t\tfor _, b := range f.mmap[position(idx, pos.Start):position(idx, pos.End)] {\n\t\t\tswitch b {\n\t\t\tcase 'G', 'g':\n\t\t\t\tpos.Gs++\n\t\t\tcase 'C', 'c':\n\t\t\t\tpos.Cs++\n\t\t\tcase 'A', 'a':\n\t\t\t\tpos.As++\n\t\t\tcase 'T', 't':\n\t\t\t\tpos.Ts++\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/*\n\t\t ls -------------- le\n\t\t s----------------e\n\t\t*/\n\t\tfor _, b := range f.mmap[position(idx, pos.lastStart):position(idx, pos.Start)] {\n\t\t\tswitch b {\n\t\t\tcase 'G', 'g':\n\t\t\t\tpos.Gs--\n\t\t\tcase 'C', 'c':\n\t\t\t\tpos.Cs--\n\t\t\tcase 'A', 'a':\n\t\t\t\tpos.As--\n\t\t\tcase 'T', 't':\n\t\t\t\tpos.Ts--\n\t\t\t}\n\t\t\t/*\n\t\t\t\tif b == 'G' || b == 'g' {\n\t\t\t\t\tpos.Gs--\n\t\t\t\t} else if b == 'C' || b == 'c' {\n\t\t\t\t\tpos.Cs--\n\t\t\t\t} else if b == 'A' || b == 'a' {\n\t\t\t\t\tpos.As--\n\t\t\t\t} else if b == 'T' || b == 't' {\n\t\t\t\t\tpos.Ts--\n\t\t\t\t}\n\t\t\t*/\n\t\t}\n\t\tfor _, b := range f.mmap[position(idx, pos.lastEnd):position(idx, pos.End)] {\n\t\t\tswitch b {\n\t\t\tcase 'G', 'g':\n\t\t\t\tpos.Gs++\n\t\t\tcase 'C', 'c':\n\t\t\t\tpos.Cs++\n\t\t\tcase 'A', 'a':\n\t\t\t\tpos.As++\n\t\t\tcase 'T', 't':\n\t\t\t\tpos.Ts++\n\t\t\t}\n\t\t}\n\n\t}\n\tpos.lastStart = pos.Start\n\tpos.lastEnd = pos.End\n\treturn pos.Gs + pos.Cs, nil\n}", "title": "" }, { "docid": "02b9eef6ae6247964f121d1705b2e43f", "score": "0.47730404", "text": "func (c *cpu) rl_r(opcode uint8, gb *GameBoy) {\n\tvar r *uint8\n\n\tswitch opcode {\n\tcase 0x10:\n\t\tr = &c.B\n\tcase 0x11:\n\t\tr = &c.C\n\tcase 0x12:\n\t\tr = &c.D\n\tcase 0x13:\n\t\tr = &c.E\n\tcase 0x14:\n\t\tr = &c.H\n\tcase 0x15:\n\t\tr = &c.L\n\tcase 0x17:\n\t\tr = &c.A\n\t}\n\n\tcarryOut := *r & 0x80\n\tvar carryIn uint8\n\tif c.F.has(CY) {\n\t\tcarryIn = 1\n\t}\n\n\t*r = *r<<1 | carryIn\n\n\tc.F.set(Z, *r == 0)\n\tc.F.set(N, false)\n\tc.F.set(H, false)\n\tc.F.set(CY, carryOut > 0)\n}", "title": "" }, { "docid": "8665faf75b893251c1f549370ed0cdb4", "score": "0.4771639", "text": "func (c *cpu) swap_r(opcode uint8, gb *GameBoy) {\n\tvar r *uint8\n\n\tswitch opcode {\n\tcase 0x30:\n\t\tr = &c.B\n\tcase 0x31:\n\t\tr = &c.C\n\tcase 0x32:\n\t\tr = &c.D\n\tcase 0x33:\n\t\tr = &c.E\n\tcase 0x34:\n\t\tr = &c.H\n\tcase 0x35:\n\t\tr = &c.L\n\tcase 0x37:\n\t\tr = &c.A\n\t}\n\n\tlo := *r & 0xF0 >> 4\n\thi := *r & 0x0F << 4\n\t*r = hi | lo\n\n\tc.F.set(Z, *r == 0)\n\tc.F.set(N, false)\n\tc.F.set(H, false)\n\tc.F.set(CY, false)\n}", "title": "" }, { "docid": "03d35b88d69fa1e71dd8a0f94fa4bd25", "score": "0.47691682", "text": "func (h *Heap) percUp(){\n child := h.Len()-1\n for child > 0{\n parent := h.getParent(child)\n if !h.v.Less(child, parent){\n return\n }\n h.v.Swap(parent, child)\n child = parent\n }\n}", "title": "" }, { "docid": "bfc16f5a22a6241efa223ed23509c2a5", "score": "0.47648922", "text": "func (c *cpu) rra(opcode uint8, gb *GameBoy) {\n\tvar carryIn uint8\n\tif c.F.has(CY) {\n\t\tcarryIn = 1 << 7\n\t}\n\n\tcarryOut := c.A & 0x1\n\tc.A = c.A>>1 | carryIn\n\n\tc.F.set(Z, false)\n\tc.F.set(N, false)\n\tc.F.set(H, false)\n\tc.F.set(CY, carryOut > 0)\n}", "title": "" }, { "docid": "3581934d9c22b8ac653ff1d033897b0a", "score": "0.47643897", "text": "func rob(nums []int) int {\n\tif len(nums) == 0 {\n\t\treturn 0\n\t}\n\tvar prev1, prev2 int\n\tfor _, num := range nums {\n\n\t\toldPrev1 := prev1\n\t\tprev1 = max(prev1, num+prev2)\n\t\tprev2 = oldPrev1\n\t}\n\n\treturn prev1\n}", "title": "" }, { "docid": "3a41c8fc67c042508729993f33034756", "score": "0.4752235", "text": "func (x *gf) reduce() {\n\tx.limb[x448Limbs/2] += x.limb[x448Limbs-1] >> lBits\n\n\t// for j := uint(0); j < x448Limbs; j++ {\n\t//\tx.limb[j] += x.limb[(j-1)%x448Limbs] >> lBits\n\t//\tx.limb[(j-1)%x448Limbs] &= lMask\n\t// }\n\tx.limb[0] += x.limb[15] >> lBits\n\tx.limb[15] &= lMask\n\tx.limb[1] += x.limb[0] >> lBits\n\tx.limb[0] &= lMask\n\tx.limb[2] += x.limb[1] >> lBits\n\tx.limb[1] &= lMask\n\tx.limb[3] += x.limb[2] >> lBits\n\tx.limb[2] &= lMask\n\tx.limb[4] += x.limb[3] >> lBits\n\tx.limb[3] &= lMask\n\tx.limb[5] += x.limb[4] >> lBits\n\tx.limb[4] &= lMask\n\tx.limb[6] += x.limb[5] >> lBits\n\tx.limb[5] &= lMask\n\tx.limb[7] += x.limb[6] >> lBits\n\tx.limb[6] &= lMask\n\tx.limb[8] += x.limb[7] >> lBits\n\tx.limb[7] &= lMask\n\tx.limb[9] += x.limb[8] >> lBits\n\tx.limb[8] &= lMask\n\tx.limb[10] += x.limb[9] >> lBits\n\tx.limb[9] &= lMask\n\tx.limb[11] += x.limb[10] >> lBits\n\tx.limb[10] &= lMask\n\tx.limb[12] += x.limb[11] >> lBits\n\tx.limb[11] &= lMask\n\tx.limb[13] += x.limb[12] >> lBits\n\tx.limb[12] &= lMask\n\tx.limb[14] += x.limb[13] >> lBits\n\tx.limb[13] &= lMask\n\tx.limb[15] += x.limb[14] >> lBits\n\tx.limb[14] &= lMask\n}", "title": "" }, { "docid": "7d9bfbd4af0f20649eaf69aea338bf78", "score": "0.47353828", "text": "func Solution(A []int, B []int) int {\n\t// write your code in Go 1.4\n\n\tN := len(A)\n\n\tfor i := 0; i < N-1; i++ {\n\t\tif A[i]+B[i] >= A[i+1]+B[i+1] {\n\t\t\treturn -1\n\t\t}\n\t}\n\n\t// get all the good positions i.e.\n\t// where both A[i], B[i] are less than A[i+1] & B[i+1]\n\t// these are like good/safe barriers, which contain the spread of\n\t// change\n\tvar good []int\n\tfor i := 0; i < N-1; i++ {\n\t\tif A[i] < A[i+1] && A[i] < B[i+1] && B[i] < B[i+1] && B[i] < A[i+1] {\n\t\t\tgood = append(good, i+1)\n\t\t}\n\n\t}\n\n\tgood = append(good, N)\n\tngood := len(good)\n\t//fmt.Printf(\"ngood: %v\\n\", ngood)\n\tret := 0\n\tstart := 0\n\tfor j := 0; j < ngood; j++ {\n\t\tend := good[j]\n\t\ttret := 0\n\t\tfor i := start + 1; i < end; i++ {\n\t\t\tif A[i] <= A[i-1] || B[i] <= B[i-1] {\n\t\t\t\ttmp := A[i]\n\t\t\t\tA[i] = B[i]\n\t\t\t\tB[i] = tmp\n\t\t\t\ttret++\n\t\t\t}\n\t\t}\n\t\t//fmt.Printf(\"tret: %v\\n\", tret)\n\t\tdist := end - start\n\t\tif tret > dist/2 {\n\t\t\ttret = dist - tret\n\t\t}\n\t\tstart = end\n\t\tret += tret\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "ea98bfa7bae4ffdfbd6797e524373504", "score": "0.47273827", "text": "func scope(a uint, l uint) uint {\n return a & ((1 << l) - 1)\n}", "title": "" }, { "docid": "060fdbabd0a019f9ae91b5691485b972", "score": "0.47251475", "text": "func (P *projectivePoint) completeAdd(Q, R *projectivePoint) {\n\t// Reference:\n\t// \"Complete addition formulas for prime order elliptic curves\" by\n\t// Costello-Renes-Batina. [Alg.4] (eprint.iacr.org/2015/1060).\n\tX1, Y1, Z1 := &Q.x, &Q.y, &Q.z\n\tX2, Y2, Z2 := &R.x, &R.y, &R.z\n\tX3, Y3, Z3 := &fp384{}, &fp384{}, &fp384{}\n\tt0, t1, t2, t3, t4 := &fp384{}, &fp384{}, &fp384{}, &fp384{}, &fp384{}\n\tfp384Mul(t0, X1, X2) // 1. t0 ← X1 · X2\n\tfp384Mul(t1, Y1, Y2) // 2. t1 ← Y1 · Y2\n\tfp384Mul(t2, Z1, Z2) // 3. t2 ← Z1 · Z2\n\tfp384Add(t3, X1, Y1) // 4. t3 ← X1 + Y1\n\tfp384Add(t4, X2, Y2) // 5. t4 ← X2 + Y2\n\tfp384Mul(t3, t3, t4) // 6. t3 ← t3 · t4\n\tfp384Add(t4, t0, t1) // 7. t4 ← t0 + t1\n\tfp384Sub(t3, t3, t4) // 8. t3 ← t3 − t4\n\tfp384Add(t4, Y1, Z1) // 9. t4 ← Y1 + Z1\n\tfp384Add(X3, Y2, Z2) // 10. X3 ← Y2 + Z2\n\tfp384Mul(t4, t4, X3) // 11. t4 ← t4 · X3\n\tfp384Add(X3, t1, t2) // 12. X3 ← t1 + t2\n\tfp384Sub(t4, t4, X3) // 13. t4 ← t4 − X3\n\tfp384Add(X3, X1, Z1) // 14. X3 ← X1 + Z1\n\tfp384Add(Y3, X2, Z2) // 15. Y3 ← X2 + Z2\n\tfp384Mul(X3, X3, Y3) // 16. X3 ← X3 · Y3\n\tfp384Add(Y3, t0, t2) // 17. Y3 ← t0 + t2\n\tfp384Sub(Y3, X3, Y3) // 18. Y3 ← X3 − Y3\n\tfp384Mul(Z3, &bb, t2) // 19. Z3 ← b · t2\n\tfp384Sub(X3, Y3, Z3) // 20. X3 ← Y3 − Z3\n\tfp384Add(Z3, X3, X3) // 21. Z3 ← X3 + X3\n\tfp384Add(X3, X3, Z3) // 22. X3 ← X3 + Z3\n\tfp384Sub(Z3, t1, X3) // 23. Z3 ← t1 − X3\n\tfp384Add(X3, t1, X3) // 24. X3 ← t1 + X3\n\tfp384Mul(Y3, &bb, Y3) // 25. Y3 ← b · Y3\n\tfp384Add(t1, t2, t2) // 26. t1 ← t2 + t2\n\tfp384Add(t2, t1, t2) // 27. t2 ← t1 + t2\n\tfp384Sub(Y3, Y3, t2) // 28. Y3 ← Y3 − t2\n\tfp384Sub(Y3, Y3, t0) // 29. Y3 ← Y3 − t0\n\tfp384Add(t1, Y3, Y3) // 30. t1 ← Y3 + Y3\n\tfp384Add(Y3, t1, Y3) // 31. Y3 ← t1 + Y3\n\tfp384Add(t1, t0, t0) // 32. t1 ← t0 + t0\n\tfp384Add(t0, t1, t0) // 33. t0 ← t1 + t0\n\tfp384Sub(t0, t0, t2) // 34. t0 ← t0 − t2\n\tfp384Mul(t1, t4, Y3) // 35. t1 ← t4 · Y3\n\tfp384Mul(t2, t0, Y3) // 36. t2 ← t0 · Y3\n\tfp384Mul(Y3, X3, Z3) // 37. Y3 ← X3 · Z3\n\tfp384Add(Y3, Y3, t2) // 38. Y3 ← Y3 + t2\n\tfp384Mul(X3, t3, X3) // 39. X3 ← t3 · X3\n\tfp384Sub(X3, X3, t1) // 40. X3 ← X3 − t1\n\tfp384Mul(Z3, t4, Z3) // 41. Z3 ← t4 · Z3\n\tfp384Mul(t1, t3, t0) // 42. t1 ← t3 · t0\n\tfp384Add(Z3, Z3, t1) // 43. Z3 ← Z3 + t1\n\tP.x, P.y, P.z = *X3, *Y3, *Z3\n}", "title": "" }, { "docid": "7d093da8a30f59357d1e5e48ab8ad415", "score": "0.47244546", "text": "func (f *Fence ) Inc_used( c int64 ) {\n\tf.value += c\n\tif f.value > f.max_cap {\n\t\tobj_sheep.Baa( 1, \"WRN: clipping fence cap: max=%d cvalue=%d inc=%d tot=%d\", f.max_cap, f.value, c, c+f.value )\t // suggests something is wrong since it should not reach here if over\n\t\tf.value = f.max_cap\n\t} else {\n\t\tif f.value <= f.min_cap {\n\t\t\tf.value = f.min_cap\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a64f056083db5855ac1d46389e29875a", "score": "0.47231165", "text": "func (f *Forth) _UMplus() {\n\tb := f.Pop()\n\ta := f.Pop()\n\tr := a + b\n\tvar cf uint16\n\tcf = 0\n\tr32 := uint32(a) + uint32(b)\n\tif r32 > uint32(r) {\n\t\tcf = 1\n\t}\n\tf.Push(r)\n\tf.Push(cf)\n\tf.Next()\n}", "title": "" }, { "docid": "8b708f657f0f979f8902a4916823e9e9", "score": "0.47213593", "text": "func rob(nums []int) int {\n\tif len(nums) == 0 {\n\t\treturn 0\n\t}\n\n\tvar res = make([]int, len(nums)+1)\n\tres[0] = 0\n\tres[1] = nums[0]\n\tfor i := 2; i <= len(nums); i++ {\n\t\tif res[i-1] > res[i-2]+nums[i-1] {\n\t\t\tres[i] = res[i-1]\n\t\t} else {\n\t\t\tres[i] = res[i-2] + nums[i-1]\n\t\t}\n\t}\n\treturn res[len(nums)]\n}", "title": "" }, { "docid": "12137da6e6e6123138c866fb8d50b708", "score": "0.47120708", "text": "func solve_ns(ν *big.Rat, p, q Vector, debth int64) (RationalFunc, RationalFunc, Vector, Vector, Vector, string) {\n\tc := getCase(p, q)\n\tif c == \"i0\" {\n\t\tdebth++\n\t\tpn := ns_pn(p, q, debth)\n\t\tcoeff := ns_an(ν, p, q, pn)\n\t\tfmt.Println(coeff)\n\t\tpositiveCoeff := make([]Vector, len(coeff))\n\t\tnegativeCoeff := make([]Vector, len(coeff))\n\t\tfor j := range coeff {\n\t\t\tpositiveCoeff[j] = coeff[j][debth+1:]\n\t\t\tpositiveCoeff[j] = append(Vector{big.NewRat(0, 1)}, positiveCoeff[j]...)\n\t\t\tnegativeCoeff[j] = coeff[j][:debth]\n\t\t\tfor i := 0; i < len(negativeCoeff[j])/2; i++ {\n\t\t\t\tnegativeCoeff[j][i], negativeCoeff[j][len(negativeCoeff[j])-1-i] = negativeCoeff[j][len(negativeCoeff[j])-1-i], negativeCoeff[j][i]\n\t\t\t}\n\t\t\tnegativeCoeff[j] = append(Vector{big.NewRat(0, 1)}, negativeCoeff[j]...)\n\t\t}\n\t\tfp1, f := RationalFromContinuedVector(positiveCoeff)\n\t\tgp1, g := RationalFromContinuedVector(negativeCoeff)\n\t\t// computer := func(x *big.Rat) *big.Rat {\n\t\t// \ta := f.Compute(x)\n\t\t// \ta.Add(a, g.Compute(x))\n\t\t// \ta.Add(a, Vector{coeff[0][debth], coeff[1][debth]}.Compute(x))\n\t\t// \treturn a\n\t\t// }\n\t\t// yvals := \"[\"\n\t\t// xvals := \"[\"\n\t\t// steps := int64(1000)\n\t\t// lower, upper := int64(-19), int64(-10)\n\t\t// for i := 0; i < 1000; i++ {\n\t\t// \tif i != 0 {\n\t\t// \t\tyvals += \",\"\n\t\t// \t\txvals += \",\"\n\t\t// \t}\n\t\t// \tx := big.NewRat(int64(i), steps/(upper-lower))\n\t\t// \tx.Add(x, big.NewRat(lower, 1))\n\t\t// \tyvals += computer(x).FloatString(5)\n\t\t// \txvals += x.FloatString(5)\n\t\t// }\n\t\t// yvals += \"]\"\n\t\t// xvals += \"]\"\n\t\t// fmt.Println(xvals)\n\t\t// fmt.Println(\"------\")\n\t\t// fmt.Println(yvals)\n\t\t// fmt.Println(computer(big.NewRat(0, 1)).FloatString(5))\n\t\treturn f, g, fp1.bot, gp1.bot, Vector{coeff[0][debth], coeff[1][debth]}, c\n\t} else if c == \"i+\" {\n\t\tdebth++\n\t\tpn := ns_pn(p, q, debth)\n\t\tcoeff := ns_an(ν, p, q, pn)\n\t\tfmt.Println(coeff)\n\t\tnegativeCoeff := make([]Vector, len(coeff))\n\t\tfor j := range coeff {\n\t\t\tnegativeCoeff[j] = coeff[j][:debth]\n\t\t\tfor i := 0; i < len(negativeCoeff[j])/2; i++ {\n\t\t\t\tnegativeCoeff[j][i], negativeCoeff[j][len(negativeCoeff[j])-1-i] = negativeCoeff[j][len(negativeCoeff[j])-1-i], negativeCoeff[j][i]\n\t\t\t}\n\t\t\tnegativeCoeff[j] = append(Vector{big.NewRat(0, 1)}, negativeCoeff[j]...)\n\n\t\t}\n\t\tgp1, g := RationalFromContinuedVector(negativeCoeff)\n\t\treturn RationalFunc{}, g, Vector{}, gp1.bot, Vector{coeff[0][debth], coeff[1][debth]}, c\n\t} else if c == \"i-\" {\n\t\tdebth++\n\t\tpn := ns_pn(p, q, debth)\n\t\tfmt.Println(\"pn for i-,\", pn)\n\t\tcoeff := ns_an(ν, p, q, pn)\n\t\tfmt.Println(coeff)\n\t\tpositiveCoeff := make([]Vector, len(coeff))\n\t\tfor j := range coeff {\n\t\t\tpositiveCoeff[j] = coeff[j][debth+1:]\n\t\t\tpositiveCoeff[j] = append(Vector{big.NewRat(0, 1)}, positiveCoeff[j]...)\n\t\t}\n\t\tfp1, f := RationalFromContinuedVector(positiveCoeff)\n\t\treturn f, RationalFunc{}, fp1.bot, Vector{}, Vector{coeff[0][debth], coeff[1][debth]}, c\n\t}\n\treturn RationalFunc{}, RationalFunc{}, Vector{}, Vector{}, Vector{}, \"error\"\n}", "title": "" }, { "docid": "0af198e6cebac3546082dddd1e4433da", "score": "0.47120374", "text": "func (r *targetCssd) recomputeRP() {\n\tx64 := float64(r.usedKB) * 100 / float64(c_config.ssdCapacityMB) / 1000\n\tx := int(x64)\n\tswitch {\n\tcase x <= c_config.ssdLowmark:\n\t\tr.receivingPercentage = 100\n\tcase x < c_config.ssdHystmark:\n\t\tr.hysteresis = false\n\tcase r.hysteresis: // true for x between hystmark and highmark\n\t\tassert(x <= 100)\n\t\tr.receivingPercentage = 0\n\tcase x < c_config.ssdHighmark:\n\t\tp := float64(x-c_config.ssdLowmark) / float64(c_config.ssdHighmark-c_config.ssdLowmark) * 100\n\t\tr.receivingPercentage = 100 - int(p)\n\t\tif r.receivingPercentage < 60 {\n\t\t\tr.receivingPercentage += 10 // biased to write\n\t\t}\n\tcase x >= c_config.ssdHighmark && x <= 100:\n\t\tr.receivingPercentage = 0\n\t\tr.hysteresis = true\n\t\tlog(\"warn:hysteresis\")\n\tdefault:\n\t\tassert(false)\n\t}\n}", "title": "" }, { "docid": "d59f9782af008ec1afafab9bfe8e3181", "score": "0.47028977", "text": "func ABY(c *CPU6502) byte {\n\tlo, _ := c.CPURead(c.pc)\n\tc.pc++\n\thi, _ := c.CPURead(c.pc)\n\tc.pc++\n\n\tc.addressAbs = (Word(hi) << 8) | Word(lo)\n\tc.addressAbs += Word(c.y)\n\t// If Y added to address overflows, then page has\n\t// changed, therefore one extra cycle is needed\n\tif (c.addressAbs & 0xFF00) != (Word(hi) << 8) {\n\t\treturn 1\n\t}\n\n\treturn 0\n}", "title": "" }, { "docid": "eddc0129f7df2a6f18f29c50ab244d89", "score": "0.4701778", "text": "func (a Array) Upsert(x int) (cp Array, prev int, replaced bool) {\n\t// Binary search algorithm.\n\tvar has bool\n\tvar i int\n\t{\n\t\tl := 0\n\t\tr := a.size\n\t\tfor !has && l < r {\n\t\t\tm := l + (r-l)/2\n\t\t\tswitch {\n\t\t\tcase a.data[m] == x:\n\t\t\t\thas = true\n\t\t\t\tr = m\n\t\t\tcase a.data[m] < x:\n\t\t\t\tl = m + 1\n\t\t\tcase a.data[m] > x:\n\t\t\t\tr = m\n\t\t\t}\n\t\t}\n\t\ti = r\n\t\t_ = i // in case when i not being used\n\t}\n\tif has {\n\t\ta.data[i], prev = x, a.data[i]\n\t\treplaced = true\n\t} else {\n\t\ta.size++\n\t\tcopy(a.data[i+1:a.size], a.data[i:a.size-1])\n\t\ta.data[i] = x\n\t\tprev = 0\n\t}\n\treturn a, prev, replaced\n}", "title": "" }, { "docid": "08db4f48d5a0a71d7b2595a962965d2b", "score": "0.46956193", "text": "func (apop *Tpop) chernobyl1(sizepop int) {\n\n for i := 0; i < sizepop/2; i++ {\n apop[i*2] = apop[i]\n }\n\n for i := 0; i < sizepop; i++ {\n apop[i] = radiacao_gama1(apop[i])\n apop[i].v = apop[i].x*apop[i].x + apop[i].y*apop[i].y\n }\n\t\n sort.Sort(apop)\n}", "title": "" }, { "docid": "adeb2749f32281e47cf6f801e3d19c9b", "score": "0.46928528", "text": "func ROL(c *CPU6502) byte {\n\tc.fetch()\n\ttemp := Word(c.fetched)<<1 | c.StatusRegisterAsWord(C)\n\n\tc.SetStatusRegisterFlag(C, (temp&0xFF00) != 0)\n\tc.SetFlagsZeroAndNegative(byte(temp & 0x00FF))\n\tif FnEquals(OpCodesLookupTable[c.opcode].addressmode, IMP) {\n\t\tc.a = byte(temp & 0x00FF)\n\t} else {\n\t\tc.CPUWrite(c.addressAbs, byte(temp&0x00FF))\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "6ff59f59713eabdd7e58947fdb086ba0", "score": "0.46925458", "text": "func (x *gf) sub(y, z *gf) {\n\t// for i, yv := range y.limb {\n\t//\tx.limb[i] = yv - z.limb[i] + 2*p.limb[i]\n\t// }\n\tx.limb[0] = y.limb[0] - z.limb[0] + 2*lMask\n\tx.limb[1] = y.limb[1] - z.limb[1] + 2*lMask\n\tx.limb[2] = y.limb[2] - z.limb[2] + 2*lMask\n\tx.limb[3] = y.limb[3] - z.limb[3] + 2*lMask\n\tx.limb[4] = y.limb[4] - z.limb[4] + 2*lMask\n\tx.limb[5] = y.limb[5] - z.limb[5] + 2*lMask\n\tx.limb[6] = y.limb[6] - z.limb[6] + 2*lMask\n\tx.limb[7] = y.limb[7] - z.limb[7] + 2*lMask\n\tx.limb[8] = y.limb[8] - z.limb[8] + 2*(lMask-1)\n\tx.limb[9] = y.limb[9] - z.limb[9] + 2*lMask\n\tx.limb[10] = y.limb[10] - z.limb[10] + 2*lMask\n\tx.limb[11] = y.limb[11] - z.limb[11] + 2*lMask\n\tx.limb[12] = y.limb[12] - z.limb[12] + 2*lMask\n\tx.limb[13] = y.limb[13] - z.limb[13] + 2*lMask\n\tx.limb[14] = y.limb[14] - z.limb[14] + 2*lMask\n\tx.limb[15] = y.limb[15] - z.limb[15] + 2*lMask\n\n\tx.reduce()\n}", "title": "" }, { "docid": "40fd139371252aa382c3e0d16af49909", "score": "0.46886823", "text": "func LPSimplex(cc []float64,\n\tAub [][]float64, bub []float64,\n\tAeq [][]float64, beq []float64,\n\tbounds []Bound, callback Callbackfunc, disp bool,\n\tmaxiter int, tol float64, bland bool) OptResult {\n\n\t//tol=1.0E-12\n\tvar message string\n\tstatus := 0\n\tmessages := [...]string{\n\t\t\"Optimization terminated successfully.\",\n\t\t\"Iteration limit reached.\",\n\t\t\"Optimization failed. Unable to find a feasible starting point.\",\n\t\t\"Optimization failed. The problem appears to be unbounded.\",\n\t\t\"Optimization failed. Singular matrix encountered.\"}\n\n\thave_floor_variable := false\n\n\t// The initial value of the objective function element in the tableau\n\tf0 := float64(0)\n\n\t// The number of variables as given by c\n\tn := len(cc)\n\n\t// Analyze the bounds and determine what modifications to be made to\n\t// the constraints in order to accommodate them.\n\tL := make([]float64, n)\n\tU := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tU[i] = math.Inf(0)\n\t}\n\n\tif bounds == nil || len(bounds) == 0 {\n\t\t// do nothing\n\t} else if len(bounds) == 1 {\n\t\t// All bounds are the same\n\t\tfor i := 0; i < n; i++ {\n\t\t\tL[i] = bounds[0].Lb\n\t\t\tU[i] = bounds[0].Ub\n\t\t}\n\t} else {\n\t\tif len(bounds) != n {\n\t\t\tstatus = -1\n\t\t\tmessage = \"Invalid input for LPSimplex. Length of bounds is inconsistent with the length of c\"\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tL[i] = bounds[i].Lb\n\t\t\t\tU[i] = bounds[i].Ub\n\t\t\t}\n\t\t}\n\t}\n\n\tif anyNegInf(L) {\n\t\t// If any lower-bound constraint is a free variable\n\t\t// add the first column variable as the \"floor\" variable which\n\t\t// accommodates the most negative variable in the problem.\n\t\tn = n + 1\n\t\tL = append([]float64{0}, L...)\n\t\tU = append([]float64{0}, U...)\n\t\tcc = append([]float64{0}, cc...)\n\t\tfor i := 0; i < len(Aeq); i++ {\n\t\t\tAeq[i] = append([]float64{0}, Aeq[i]...)\n\t\t}\n\t\tfor i := 0; i < len(Aub); i++ {\n\t\t\tAub[i] = append([]float64{0}, Aub[i]...)\n\t\t}\n\t\thave_floor_variable = true\n\t}\n\n\t/*\n\t Now before we deal with any variables with lower bounds < 0,\n\t deal with finite positive bounds which can be simply added as\n\t new constraints. Also validate bounds inputs here.\n\t*/\n\tfor i := 0; i < n; i++ {\n\t\tif L[i] > U[i] {\n\t\t\tstatus = -1\n\t\t\tmessage = fmt.Sprintf(\"Invalid input for LPSimplex. Lower bound var %d is greater than upper bound var %d\", i, i)\n\t\t}\n\n\t\tif math.IsInf(L[i], 1) {\n\t\t\tstatus = -1\n\t\t\tmessage = \"Invalid input for LPSimplex \" +\n\t\t\t\t\"Lower bound may not be +infinity\"\n\t\t} else if L[i] > 0 {\n\t\t\t// Add a new lower-bound (negative upper-bound) constraint\n\t\t\tnewConstraint := make([]float64, n)\n\t\t\tAub = append(Aub, newConstraint)\n\t\t\tAub[len(Aub)-1][i] = -1\n\t\t\tbub = append(bub, -L[i])\n\t\t\tL[i] = 0\n\t\t}\n\n\t\tif math.IsInf(U[i], -1) {\n\t\t\tstatus = -1\n\t\t\tmessage = \"Invalid input for LPSimplex'. Upper bound may not be -infinity\"\n\t\t} else if !math.IsInf(U[i], 1) {\n\t\t\t// Add a new upper-bound constraint\n\t\t\tnewConstraint := make([]float64, n)\n\t\t\tAub = append(Aub, newConstraint)\n\t\t\tAub[len(Aub)-1][i] = 1\n\t\t\tbub = append(bub, U[i])\n\t\t\tU[i] = math.Inf(1)\n\t\t}\n\t}\n\n\t/*\n\t Now find negative lower bounds (finite or infinite) which require a\n\t change of variables or free variables and handle them appropriately\n\t*/\n\tfor i := 0; i < n; i++ {\n\t\tif L[i] < 0 {\n\t\t\tif !math.IsInf(L[i], 0) && L[i] < 0 {\n\t\t\t\t// Add a change of variables for x[i]\n\t\t\t\t// For each row in the constraint matrices, we take the\n\t\t\t\t// coefficient from column i in A,\n\t\t\t\t// and subtract the product of that and L[i] to the RHS b\n\t\t\t\tfor r := 0; r < len(Aeq); r++ {\n\t\t\t\t\tbeq[r] = beq[r] - (Aeq[r][i] * L[i])\n\t\t\t\t}\n\t\t\t\tfor r := 0; r < len(Aub); r++ {\n\t\t\t\t\tbub[r] = bub[r] - (Aub[r][i] * L[i])\n\t\t\t\t}\n\t\t\t\t// We now have a nonzero initial value for the objective\n\t\t\t\t// function as well.\n\t\t\t\tf0 = f0 - cc[i]*L[i]\n\t\t\t} else {\n\t\t\t\t// This is an unrestricted variable, let x[i] = u[i] - v[0]\n\t\t\t\t// where v is the first column in all matrices.\n\t\t\t\tfor r := 0; r < len(Aeq); r++ {\n\t\t\t\t\tAeq[r][0] = Aeq[r][0] - Aeq[r][i]\n\t\t\t\t}\n\t\t\t\tfor r := 0; r < len(Aeq); r++ {\n\t\t\t\t\tAub[r][0] = Aub[r][0] - Aub[r][i]\n\t\t\t\t}\n\t\t\t\tcc[0] = cc[0] - cc[i]\n\t\t\t}\n\t\t}\n\t\tif math.IsInf(U[i], -1) {\n\t\t\tstatus = -1\n\t\t\tmessage = \"Invalid input for LPSimplex. Upper bound may not be -inf.\"\n\t\t}\n\t}\n\t/*\n\t */\n\n\t// The number of upper bound constraints (rows in A_ub and elements in b_ub)\n\tmub := len(bub)\n\n\t// The number of equality constraints (rows in A_eq and elements in b_eq)\n\tmeq := len(beq)\n\n\t// The total number of constraints\n\tm := mub + meq\n\n\t// The number of slack variables (one for each inequality)\n\tn_slack := mub\n\n\t// The number of artificial variables (one for each negitive RHS\n\t// and one for each equality constraint)\n\tn_artificial := meq + countNegEntries(bub)\n\n\tAub_rows, Aub_cols, err := checkRectangle(Aub)\n\tif err != nil {\n\t\tfmt.Printf(\"A_ub Matrix error: %v\\n\", err)\n\t}\n\n\tAeq_rows, Aeq_cols, err := checkRectangle(Aeq)\n\tif err != nil {\n\t\tfmt.Printf(\"A_eq Matrix error: %v\\n\", err)\n\t}\n\n\tif Aeq_rows != meq {\n\t\tstatus = -1\n\t\tmessage = \"Invalid input for LPSimplex. \" +\n\t\t\t\"The number of rows in A_eq must be equal \" +\n\t\t\t\"to the number of values in b_eq\"\n\t\tfmt.Printf(\"%s\\n\", message)\n\t}\n\n\tif Aub_rows != mub {\n\t\tstatus = -1\n\t\tmessage = \"Invalid input for LPSimplex. \" +\n\t\t\t\"The number of rows in A_ub must be equal \" +\n\t\t\t\"to the number of values in b_ub\"\n\t\tfmt.Printf(\"%s\\n\", message)\n\t}\n\n\tif Aeq_cols > 0 && Aeq_cols != n {\n\t\tstatus = -1\n\t\tmessage = \"Invalid input for LPSimplex. \" +\n\t\t\t\"Number of columns in A_eq must be equal \" +\n\t\t\t\"to the size of c\"\n\t\tfmt.Printf(\"%s\\n\", message)\n\t}\n\n\tif Aub_cols > 0 && Aub_cols != n {\n\t\tstatus = -1\n\t\tmessage = \"Invalid input for LPSimplex. \" +\n\t\t\t\"Number of columns in A_ub must be equal to the size of c\"\n\t\tfmt.Printf(\"%s\\n\", message)\n\t}\n\n\tif status != 0 {\n\t\t// Invalid inputs provided\n\t\tos.Exit(1)\n\t}\n\n\t// FIXME: if I want to offer anonther entry point that does not\n\t// include setting bounds, this may be a good place to start the\n\t// new function so that the constaints can be passed in, same as\n\t// passed to LPSimplex but no bounds. Needs some thought.\n\t//\n\t// This might also be a place where a revised simplex inplementation\n\t// could be added / substitued.\n\t//\n\t// This may also be a good spot to include call to the scaling\n\t// routine. Give it a try here:\n\tif scaleWithEquilibration {\n\t\tEquilibrationModScalePivotOnly(cc, Aub, bub, Aeq, beq)\n\t}\n\n\t// Create the tableau\n\tT := make([][]float64, m+2)\n\tfor i := 0; i < m+2; i++ {\n\t\tT[i] = make([]float64, n+n_slack+n_artificial+1)\n\t}\n\t// Insert objective into tableau\n\tfor j, val := range cc {\n\t\tT[len(T)-2][j] = val //cc[j]\n\t}\n\tT[len(T)-2][len(T[0])-1] = f0\n\n\tif meq > 0 {\n\t\t//# Add Aeq to the tableau\n\t\tfor i, row := range Aeq {\n\t\t\tfor j, val := range row {\n\t\t\t\tT[i][j] = val //Aeq[i][j]\n\t\t\t}\n\t\t}\n\t\t// Add beq to the tableau\n\t\tfor i, val := range beq {\n\t\t\tT[i][len(T[0])-1] = val //beq[i]\n\t\t}\n\t}\n\tif mub > 0 {\n\t\t// Add Aub to the tableau\n\t\tfor i, row := range Aub {\n\t\t\tfor j, val := range row {\n\t\t\t\tT[meq+i][j] = val //Aub[i][j]\n\t\t\t}\n\t\t}\n\t\t// At bub to the tableau\n\t\tfor i, val := range bub {\n\t\t\tT[meq+i][len(T[0])-1] = val //bub[i]\n\t\t}\n\t\t// Add the slack variables to the tableau\n\t\tfor i := 0; i < m-meq; i++ {\n\t\t\tfor j := 0; j < n_slack; j++ {\n\t\t\t\tif i == j {\n\t\t\t\t\tT[meq+i][n+j] = float64(1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Further set up the tableau.\n\t// If a row corresponds to an equality constraint or a negative b\n\t// (a lower bound constraint), then an artificial variable is added\n\t// for that row. Also, if b is negative, first flip the signs in\n\t// that constraint.\n\tslcount := 0\n\tavcount := 0\n\tbasis := make([]int, m)\n\tr_artificial := make([]int, n_artificial)\n\tfor i := 0; i < m; i++ {\n\t\tif i < meq || T[i][len(T[0])-1] < 0 {\n\t\t\t// basic variable i is in column n+n_slack+avcount\n\t\t\tbasis[i] = n + n_slack + avcount\n\t\t\tr_artificial[avcount] = i\n\t\t\tavcount++\n\t\t\tif T[i][len(T[0])-1] < 0 { // b[i] is negative\n\t\t\t\tfor j := range T[i] {\n\t\t\t\t\tT[i][j] *= float64(-1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tT[i][basis[i]] = float64(1)\n\t\t\tT[len(T)-1][basis[i]] = float64(1)\n\t\t} else {\n\t\t\t// basic variable i is in column n+slcount\n\t\t\tbasis[i] = n + slcount\n\t\t\tslcount++\n\t\t}\n\t}\n\t// Make the artificial variables basic feasible variables by subtracting\n\t// each row with an artificial variable from the Phase 1 objective\n\tfor i := range r_artificial {\n\t\tr := r_artificial[i]\n\t\tfor j := 0; j < len(T[0]); j++ {\n\t\t\tT[len(T)-1][j] = T[len(T)-1][j] - T[r][j]\n\t\t}\n\t}\n\n\tdegeneritePivotCount = 0\n\tunboundedVarNumber = -1\n\tscalePivRowDiff = 0\n\tscalePivColDiff = 0\n\tphase := 1\n\tnit0 := 0\n\tnit1, status := solveSimplex(T, n, basis, maxiter, phase, callback, tol, nit0, bland)\n\n\t// if pseudo objective is zero, remove the last row from the tableau and\n\t// proceed to phase 2\n\tif math.Abs(T[len(T)-1][len(T[0])-1]) <= tol {\n\t\t// Remove the pseudo-objective row from the tableau\n\t\tT = T[:len(T)-1]\n\t\t// Remove the artificial variable columns from the tableau\n\t\tfor i := 0; i < len(T); i++ {\n\t\t\tT[i] = append(T[i][:n+n_slack], T[i][n+n_slack+n_artificial:]...)\n\t\t}\n\t} else {\n\t\t// Failure to find a feasible starting point\n\t\tstatus = 2\n\t}\n\n\tif status != 0 {\n\t\tmessage = messages[status]\n\t\tif disp {\n\t\t\tfmt.Printf(\"%s\\n\", message)\n\t\t}\n\t\tobj := -T[len(T)-1][len(T[0])-1]\n\t\treturn OptResult{[]float64{math.NaN()},\n\t\t\tobj, nit1,\n\t\t\tstatus, nil, message, false, nil, nil}\n\t}\n\n\t// Phase 2\n\tphase = 2\n\tmaxiter -= nit1\n\tnit2, status := solveSimplex(T, n, basis, maxiter, phase, callback,\n\t\ttol, nit1, bland)\n\n\tsolution := make([]float64, n+n_slack+n_artificial)\n\tfor i := 0; i < m; i++ {\n\t\tsolution[basis[i]] = T[i][len(T[0])-1]\n\t}\n\tx := solution[:n]\n\tslack := solution[n : n+n_slack]\n\n\t//\n\t// Now let's extract the dual solution\n\t//\n\t//dualSolution := make([]float64, len(T[0]))\n\tdualSolution := make([]float64, n+n_slack)\n\t//dual := make([]float64, len(A[0]))\n\tfor j := 0; j < n+n_slack; j++ {\n\t\t//for j := 0; j < len(T[0]); j++\n\t\tdualSolution[j] = T[len(T)-1][j] //-c[j]\n\t}\n\tz := dualSolution[:n] // Z is my Dual slack vals\n\ty := dualSolution[n:] // Y is my Dual solution vals\n\n\t//\n\t// re-Adjust the solution to match the original input\n\t//\n\tfor i := 0; i < n; i++ {\n\t\tif !math.IsInf(L[i], -1) {\n\t\t\tx[i] = x[i] + L[i]\n\t\t}\n\t}\n\t// For those variables with infinite negative lower bounds,\n\t// take x[i] as the difference between x[i] and the floor variable.\n\tif have_floor_variable {\n\t\tfor i := 1; i < n; i++ {\n\t\t\tif math.IsInf(L[i], -1) {\n\t\t\t\tx[i] -= x[0]\n\t\t\t\t// FIXME: do I need to change anything in the dual solution?\n\t\t\t}\n\t\t}\n\t\tx = x[1:]\n\t\ty = y[1:]\n\t\tn = n - 1\n\t}\n\n\t// Optimization complete at this point\n\tobj := -T[len(T)-1][len(T[0])-1]\n\tif status == 1 || status == 0 {\n\t\tif disp {\n\t\t\tfmt.Printf(\"%s\\n\", messages[status])\n\t\t\tfmt.Printf(\" Current function value: %12.6f\\n\", obj)\n\t\t\tfmt.Printf(\" Iterations: %d\\n\", nit2)\n\t\t}\n\t} else {\n\t\tif disp {\n\t\t\tfmt.Printf(\"%s\\n\", messages[status])\n\t\t\tfmt.Printf(\" Iterations: %d\\n\", nit2)\n\t\t}\n\t}\n\n\treturn OptResult{x, obj, nit2,\n\t\tstatus, slack,\n\t\tmessages[status],\n\t\t(status == 0), y, z}\n}", "title": "" }, { "docid": "5b120f591f4982c719bcbde97156ad6c", "score": "0.46803507", "text": "func (P *jacobianPoint) add(Q, R *jacobianPoint) {\n\tif Q.isZero() {\n\t\t*P = *R\n\t\treturn\n\t} else if R.isZero() {\n\t\t*P = *Q\n\t\treturn\n\t}\n\n\t// Cohen-Miyagi-Ono (1998)\n\t// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-1998-cmo-2\n\tX1, Y1, Z1 := &Q.x, &Q.y, &Q.z\n\tX2, Y2, Z2 := &R.x, &R.y, &R.z\n\tZ1Z1, Z2Z2, U1, U2 := &fp384{}, &fp384{}, &fp384{}, &fp384{}\n\tH, HH, HHH, RR := &fp384{}, &fp384{}, &fp384{}, &fp384{}\n\tV, t4, t5, t6, t7, t8 := &fp384{}, &fp384{}, &fp384{}, &fp384{}, &fp384{}, &fp384{}\n\tt0, t1, t2, t3, S1, S2 := &fp384{}, &fp384{}, &fp384{}, &fp384{}, &fp384{}, &fp384{}\n\tfp384Sqr(Z1Z1, Z1) // Z1Z1 = Z1 ^ 2\n\tfp384Sqr(Z2Z2, Z2) // Z2Z2 = Z2 ^ 2\n\tfp384Mul(U1, X1, Z2Z2) // U1 = X1 * Z2Z2\n\tfp384Mul(U2, X2, Z1Z1) // U2 = X2 * Z1Z1\n\tfp384Mul(t0, Z2, Z2Z2) // t0 = Z2 * Z2Z2\n\tfp384Mul(S1, Y1, t0) // S1 = Y1 * t0\n\tfp384Mul(t1, Z1, Z1Z1) // t1 = Z1 * Z1Z1\n\tfp384Mul(S2, Y2, t1) // S2 = Y2 * t1\n\tfp384Sub(H, U2, U1) // H = U2 - U1\n\tfp384Sqr(HH, H) // HH = H ^ 2\n\tfp384Mul(HHH, H, HH) // HHH = H * HH\n\tfp384Sub(RR, S2, S1) // r = S2 - S1\n\tfp384Mul(V, U1, HH) // V = U1 * HH\n\tfp384Sqr(t2, RR) // t2 = r ^ 2\n\tfp384Add(t3, V, V) // t3 = V + V\n\tfp384Sub(t4, t2, HHH) // t4 = t2 - HHH\n\tfp384Sub(&P.x, t4, t3) // X3 = t4 - t3\n\tfp384Sub(t5, V, &P.x) // t5 = V - X3\n\tfp384Mul(t6, S1, HHH) // t6 = S1 * HHH\n\tfp384Mul(t7, RR, t5) // t7 = r * t5\n\tfp384Sub(&P.y, t7, t6) // Y3 = t7 - t6\n\tfp384Mul(t8, Z2, H) // t8 = Z2 * H\n\tfp384Mul(&P.z, Z1, t8) // Z3 = Z1 * t8\n}", "title": "" }, { "docid": "e67f5dea21b76dde5de825917a910c75", "score": "0.46773955", "text": "func reachingPoints(sx int, sy int, tx int, ty int) bool {\n\tfor sx < tx && sy < ty {\n\t\tif tx < ty {\n\t\t\tty %= tx\n\t\t} else {\n\t\t\ttx %= ty\n\t\t}\n\t}\n\n\treturn sx == tx && (ty-sy)%sx == 0 || sy == ty && (tx-sx)%sy == 0\n\t// if sx == tx && sy == ty {\n\t// \treturn true\n\t// }\n\t// a1 := strconv.Itoa(sx)\n\t// a2 := strconv.Itoa(sy)\n\t// b1 := strconv.Itoa(tx)\n\t// b2 := strconv.Itoa(ty)\n\t// sutiation := a1 + \",\" + a2 + \",\" + b1 + \",\" + b2\n\t// fmt.Println(\"situation:\", sutiation)\n\t// if v, ok := dp[sutiation]; ok {\n\t// \treturn v\n\t// }\n\t// r1 := []int{sx + sy, sy}\n\t// r2 := []int{sx, sx + sy}\n\t// var r1dead, r2dead bool\n\t// var d1, d2, d3, d4 float64\n\t// d1 = (float64)(sx - tx)\n\t// d2 = (float64)(r1[0] - tx)\n\t// d3 = (float64)(sy - ty)\n\t// d4 = (float64)(r2[1] - ty)\n\t// fmt.Println(\"distance:\", math.Abs(d1) < math.Abs(d2), math.Abs(d3) < math.Abs(d4))\n\t// if math.Abs(d1) < math.Abs(d2) {\n\t// \tr1dead = true\n\t// }\n\t// if math.Abs(d3) < math.Abs(d4) {\n\t// \tr2dead = true\n\t// }\n\t// if r1dead && r2dead {\n\t// \tdp[sutiation] = false\n\n\t// \treturn false\n\t// }\n\t// if r1dead != true && r1[0] == tx && r1[1] == ty {\n\t// \tdp[sutiation] = true\n\n\t// \treturn true\n\t// } else if r2dead != true && r2[0] == tx && r2[1] == ty {\n\t// \tdp[sutiation] = true\n\n\t// \treturn true\n\t// } else if r1dead == true && r2dead != true {\n\t// \t//speed up\n\t// \tif (ty-r2[1])/r2[0] > THREADHOLD {\n\t// \t\tr2[1] = ty - (ty-r2[1])%r2[0]\n\t// \t}\n\t// \treturn reachingPoints(r2[0], r2[1], tx, ty)\n\t// } else if r1dead != true && r2dead == true {\n\t// \t//speed up\n\t// \tif (tx-r1[0])/r1[1] > THREADHOLD {\n\t// \t\tr1[0] = tx - (tx-r1[0])%r1[1]\n\t// \t}\n\t// \treturn reachingPoints(r1[0], r1[1], tx, ty)\n\t// }\n\t// //speed up\n\t// if (ty-r2[1])/r2[0] > THREADHOLD {\n\t// \tr2[1] = (ty - (ty-r2[1])%r2[0]) / 1\n\t// \tif (tx-r2[0])/r2[1] > THREADHOLD {\n\t// \t\tr2[0] = (tx - (tx-r2[0])%r2[1]) / 1\n\t// \t}\n\t// }\n\t// //speed up\n\t// if (tx-r1[0])/r1[1] > THREADHOLD {\n\t// \tr1[0] = (tx - (tx-r1[0])%r1[1]) / 1\n\t// \tif (ty-r1[1])/r1[0] > THREADHOLD {\n\t// \t\tr1[1] = (ty - (ty-r1[1])%r1[0]) / 1\n\t// \t}\n\t// }\n\n\t// return reachingPoints(r1[0], r1[1], tx, ty) || reachingPoints(r2[0], r2[1], tx, ty)\n}", "title": "" }, { "docid": "565bc5e83e7517c6320422c66f3ff537", "score": "0.46738788", "text": "func (c *cpu) sra_r(opcode uint8, gb *GameBoy) {\n\tvar r *uint8\n\n\tswitch opcode {\n\tcase 0x28:\n\t\tr = &c.B\n\tcase 0x29:\n\t\tr = &c.C\n\tcase 0x2A:\n\t\tr = &c.D\n\tcase 0x2B:\n\t\tr = &c.E\n\tcase 0x2C:\n\t\tr = &c.H\n\tcase 0x2D:\n\t\tr = &c.L\n\tcase 0x2F:\n\t\tr = &c.A\n\t}\n\n\tcarryIn := *r & 0x80\n\tcarryOut := *r & 0x01\n\t*r = *r>>1 | carryIn\n\n\tc.F.set(Z, *r == 0)\n\tc.F.set(N, false)\n\tc.F.set(H, false)\n\tc.F.set(CY, carryOut > 0) // rednex says this is set, I guess we'll see\n}", "title": "" }, { "docid": "bd2000f2f53d7061c7673219901083bd", "score": "0.46723765", "text": "func (f *Forth) _RPbang() {\n\tf.RP = f.Pop()\n\tf.Next()\n}", "title": "" }, { "docid": "c150ef900ba3a579bf9757ccd1a0c58d", "score": "0.46700427", "text": "func (c *cpu) rr_r(opcode uint8, gb *GameBoy) {\n\tvar r *uint8\n\n\tswitch opcode {\n\tcase 0x18:\n\t\tr = &c.B\n\tcase 0x19:\n\t\tr = &c.C\n\tcase 0x1A:\n\t\tr = &c.D\n\tcase 0x1B:\n\t\tr = &c.E\n\tcase 0x1C:\n\t\tr = &c.H\n\tcase 0x1D:\n\t\tr = &c.L\n\tcase 0x1F:\n\t\tr = &c.A\n\t}\n\n\tcarryOut := *r & 0x01\n\tvar carryIn uint8\n\tif c.F.has(CY) {\n\t\tcarryIn = 1 << 7\n\t}\n\n\t*r = *r>>1 | carryIn\n\tc.F.set(Z, *r == 0)\n\tc.F.set(N, false)\n\tc.F.set(H, false)\n\tc.F.set(CY, carryOut > 0)\n}", "title": "" }, { "docid": "20264ebe6aabf6b4afccfdb96c30528d", "score": "0.4668457", "text": "func inc(ip net.IP) (ret net.IP) {\n\tret = make(net.IP, len(ip))\n\tcopy(ret, ip)\n\n\tfor j := len(ret) - 1; j >= 0; j-- {\n\t\tret[j]++\n\t\tif ret[j] > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "5489e4ea7a3a8ce255cd3e8d49830c2e", "score": "0.46598646", "text": "func CarrySub(out1 *TightFieldElement, arg1 *TightFieldElement, arg2 *TightFieldElement) {\n\tx1 := ((0x1ffffffe + arg1[0]) - arg2[0])\n\tx2 := ((x1 >> 28) + ((0xffffffe + arg1[1]) - arg2[1]))\n\tx3 := ((x2 >> 27) + ((0x1ffffffe + arg1[2]) - arg2[2]))\n\tx4 := ((x3 >> 28) + ((0xffffffe + arg1[3]) - arg2[3]))\n\tx5 := ((x4 >> 27) + ((0x1ffffffe + arg1[4]) - arg2[4]))\n\tx6 := ((x5 >> 28) + ((0xffffffe + arg1[5]) - arg2[5]))\n\tx7 := ((x6 >> 27) + ((0xffffffe + arg1[6]) - arg2[6]))\n\tx8 := ((x7 >> 27) + ((0x1ffffffe + arg1[7]) - arg2[7]))\n\tx9 := ((x8 >> 28) + ((0xffffffe + arg1[8]) - arg2[8]))\n\tx10 := ((x9 >> 27) + ((0x1ffffffe + arg1[9]) - arg2[9]))\n\tx11 := ((x10 >> 28) + ((0xffffffe + arg1[10]) - arg2[10]))\n\tx12 := ((x11 >> 27) + ((0x1ffffffe + arg1[11]) - arg2[11]))\n\tx13 := ((x12 >> 28) + ((0xffffffe + arg1[12]) - arg2[12]))\n\tx14 := ((x13 >> 27) + ((0xffffffe + arg1[13]) - arg2[13]))\n\tx15 := ((x14 >> 27) + ((0x1ffffffe + arg1[14]) - arg2[14]))\n\tx16 := ((x15 >> 28) + ((0xffffffe + arg1[15]) - arg2[15]))\n\tx17 := ((x16 >> 27) + ((0x1ffffffe + arg1[16]) - arg2[16]))\n\tx18 := ((x17 >> 28) + ((0xffffffe + arg1[17]) - arg2[17]))\n\tx19 := ((x18 >> 27) + ((0xffffffe + arg1[18]) - arg2[18]))\n\tx20 := ((x1 & 0xfffffff) + (x19 >> 27))\n\tx21 := (uint32(uint1((x20 >> 28))) + (x2 & 0x7ffffff))\n\tx22 := (x20 & 0xfffffff)\n\tx23 := (x21 & 0x7ffffff)\n\tx24 := (uint32(uint1((x21 >> 27))) + (x3 & 0xfffffff))\n\tx25 := (x4 & 0x7ffffff)\n\tx26 := (x5 & 0xfffffff)\n\tx27 := (x6 & 0x7ffffff)\n\tx28 := (x7 & 0x7ffffff)\n\tx29 := (x8 & 0xfffffff)\n\tx30 := (x9 & 0x7ffffff)\n\tx31 := (x10 & 0xfffffff)\n\tx32 := (x11 & 0x7ffffff)\n\tx33 := (x12 & 0xfffffff)\n\tx34 := (x13 & 0x7ffffff)\n\tx35 := (x14 & 0x7ffffff)\n\tx36 := (x15 & 0xfffffff)\n\tx37 := (x16 & 0x7ffffff)\n\tx38 := (x17 & 0xfffffff)\n\tx39 := (x18 & 0x7ffffff)\n\tx40 := (x19 & 0x7ffffff)\n\tout1[0] = x22\n\tout1[1] = x23\n\tout1[2] = x24\n\tout1[3] = x25\n\tout1[4] = x26\n\tout1[5] = x27\n\tout1[6] = x28\n\tout1[7] = x29\n\tout1[8] = x30\n\tout1[9] = x31\n\tout1[10] = x32\n\tout1[11] = x33\n\tout1[12] = x34\n\tout1[13] = x35\n\tout1[14] = x36\n\tout1[15] = x37\n\tout1[16] = x38\n\tout1[17] = x39\n\tout1[18] = x40\n}", "title": "" }, { "docid": "146622ffd75f4afe68249f61ee5c7cf7", "score": "0.46539488", "text": "func cpuPoints(CPUHandLen int) {\r\n\r\n\tvar total int = 0\r\n\r\n\t//counts CPU's hand\r\n\tfor i := 0; i < CPUHandLen; i++ {\r\n\r\n\t\tif i == 0 {\r\n\t\t\t//cpu has an ace and a 10, jack, queen, or king\r\n\t\t\tif ((CPUHand[i].num == ACE && CPUHand[i+1].num >= 10) || (CPUHand[i].num >= 10 && CPUHand[i+1].num == ACE)) && CPUHandLen == 2 {\r\n\r\n\t\t\t\ttotal = 21\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t}\r\n\t\t//cpu has a jack, queen, or king\r\n\t\tif CPUHand[i].num == JACK || CPUHand[i].num == QUEEN || CPUHand[i].num == KING {\r\n\r\n\t\t\ttotal += 10\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttotal += CPUHand[i].num\r\n\t\t}\r\n\t}\r\n\r\n\tcpuTotal = total\r\n}", "title": "" }, { "docid": "d735ed0ccd9b7f711ca8ef7efcc686e9", "score": "0.46525875", "text": "func p1s2() int {\n\tsum := 0\n\tfor i := 3; i < 1000; i += 3 {\n\t\tsum += i\n\t}\n\tfor i := 5; i < 1000; i += 5 {\n\t\tsum += i\n\t}\n\tfor i := 15; i < 1000; i += 15 {\n\t\tsum -= i\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "0b2126bf4937aa78e3f9f710037e2422", "score": "0.46525657", "text": "func multiPeriodBinomial(S, K, r, u, d float64, noPeriod int) float64{\n\n // var Rinv, uu, probUp, probDown float64\n var Rinv, uu, probUp, probDown float64\n\n prices := make([]float64,noPeriod*2)\n callValues := make([]float64,noPeriod*2)\n \n Rinv = math.Exp(-r)\n\n uu = u*u\n\n probUp = (math.Exp(r)-d)/(u-d)\n\n probDown = 1.00 - probUp\n\n prices[0] = S*math.Pow(d,float64(noPeriod))\n\n for i := 1; i <= noPeriod; i++ {\n prices[i] = uu*prices[i-1]\n }\n\n for i := 0; i <= noPeriod; i++ {\n callValues[i] = math.Max(0.00,(prices[i]-K))\n }\n\n for step := (noPeriod-1); step>=0; step-- {\n\n for i := 0; i <= step; i++ {\n\n callValues[i] = (probUp*callValues[i+1]+probDown*callValues[i])*Rinv\n }\n\n }\n\n return callValues[0]\n\n}", "title": "" }, { "docid": "17bb18c98d9dc7c3264b88bae55ba736", "score": "0.4651323", "text": "func handle(gas []int, cost []int, s int, res *int) bool {\n\trest := gas[s] - cost[s]\n\tfor i := s+1; i != s; i++{\n\t\tif i == len(gas) {\n\t\t\ti = -1\n\t\t\tcontinue\n\t\t}\n\t\trest += gas[i] - cost[i]\n\t\tif rest < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tif rest < 0 {\n\t\treturn false\n\t}\n\t*res = s\n\treturn true\n}", "title": "" }, { "docid": "f98d4a2ae504edb38ab75fe79d779b41", "score": "0.46498343", "text": "func FixUp(top Top, values []uint64, heap, coHeap []int, index int) {\n\tvalue := values[index]\n\ti := coHeap[index]\n\tfor i > 0 {\n\t\tpi := (i+1)/2 - 1\n\t\tparent := values[heap[pi]]\n\t\tif parent > value == top {\n\t\t\tswapintint.Swap(heap, coHeap, i, pi)\n\t\t\ti = pi\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c15a3c30c95d0bd86e536630e126fa0b", "score": "0.46494088", "text": "func sumLE(total int, as, bs []int) int {\n\ta := 0\n\tb := sort.SearchInts(bs, total-as[a])\n\tif b == len(bs) {\n\t\tb--\n\t}\n\tfor b > 0 && as[a]+bs[b] > total {\n\t\tb--\n\t}\n\tmax := as[a] + bs[b]\n\tif max > total {\n\t\treturn -1\n\t}\n\tif max == total {\n\t\treturn max\n\t}\nouter:\n\tfor {\n\t\ta++\n\t\tif a == len(as) {\n\t\t\tbreak\n\t\t}\n\t\tfor as[a]+bs[b] > total {\n\t\t\tb--\n\t\t\tif b < 0 {\n\t\t\t\tbreak outer\n\t\t\t}\n\t\t}\n\t\t//fmt.Println(a, b)\n\t\tif as[a]+bs[b] > max {\n\t\t\tmax = as[a] + bs[b]\n\t\t\tif max == total {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn max\n}", "title": "" }, { "docid": "8438668788a23a95708d6c409494cc73", "score": "0.4648534", "text": "func openSimplex(x, y float64) float64 {\n\tstretchOffset := (x + y) * StretchConstant\n\txs := float64(x + stretchOffset)\n\tys := float64(y + stretchOffset)\n\n\txsb := int(xs)\n\tysb := int(ys)\n\n\tsquishOffset := float64(xsb+ysb) * SquishConstant\n\txb := float64(xsb) + squishOffset\n\tyb := float64(ysb) + squishOffset\n\n\txins := xs - float64(xsb)\n\tyins := ys - float64(ysb)\n\n\tinSum := xins + yins\n\n\tdx0 := x - xb\n\tdy0 := y - yb\n\n\tvar dxExt, dyExt float64\n\tvar xsvExt, ysvExt int\n\n\tvar value float64\n\n\tdx1 := dx0 - 1 - SquishConstant\n\tdy1 := dy0 - 0 - SquishConstant\n\tattn1 := 2 - dx1*dx1 - dy1*dy1\n\tif attn1 > 0 {\n\t\tattn1 *= attn1\n\t\tvalue += attn1 * attn1 * extrapolate(xsb+1, ysb+0, dx1, dy1)\n\t}\n\n\tdx2 := dx0 - 0 - SquishConstant\n\tdy2 := dy0 - 1 - SquishConstant\n\tattn2 := 2 - dx2*dx2 - dy2*dy2\n\tif attn2 > 0 {\n\t\tattn2 *= attn2\n\t\tvalue += attn2 * attn2 * extrapolate(xsb+0, ysb+1, dx2, dy2)\n\t}\n\n\tif inSum <= 1 {\n\t\tzins := 1 - inSum\n\t\tif zins > xins || zins > yins {\n\t\t\tif xins > yins {\n\t\t\t\txsvExt = xsb + 1\n\t\t\t\tysvExt = ysb - 1\n\t\t\t\tdxExt = dx0 - 1\n\t\t\t\tdyExt = dy0 + 1\n\t\t\t} else {\n\t\t\t\txsvExt = xsb - 1\n\t\t\t\tysvExt = ysb + 1\n\t\t\t\tdxExt = dx0 + 1\n\t\t\t\tdyExt = dy0 - 1\n\t\t\t}\n\t\t} else {\n\t\t\txsvExt = xsb + 1\n\t\t\tysvExt = ysb + 1\n\t\t\tdxExt = dx0 - 1 - 2*SquishConstant\n\t\t\tdyExt = dy0 - 1 - 2*SquishConstant\n\t\t}\n\t} else {\n\t\tzins := 2 - inSum\n\t\tif zins < xins || zins < yins {\n\t\t\tif xins > yins {\n\t\t\t\txsvExt = xsb + 2\n\t\t\t\tysvExt = ysb + 0\n\t\t\t\tdxExt = dx0 - 2 - 2*SquishConstant\n\t\t\t\tdyExt = dy0 + 0 - 2*SquishConstant\n\t\t\t} else {\n\t\t\t\txsvExt = xsb + 0\n\t\t\t\tysvExt = ysb + 2\n\t\t\t\tdxExt = dx0 + 0 - 2*SquishConstant\n\t\t\t\tdyExt = dy0 - 2 - 2*SquishConstant\n\t\t\t}\n\t\t} else {\n\t\t\tdxExt = dx0\n\t\t\tdyExt = dy0\n\t\t\txsvExt = xsb\n\t\t\tysvExt = ysb\n\t\t}\n\t\txsb++\n\t\tysb++\n\t\tdx0 = dx0 - 1 - 2*SquishConstant\n\t\tdy0 = dy0 - 1 - 2*SquishConstant\n\t}\n\n\tattn0 := 2 - dx0*dx0 - dy0*dy0\n\tif attn0 > 0 {\n\t\tattn0 *= attn0\n\t\tvalue += attn0 * attn0 * extrapolate(xsb, ysb, dx0, dy0)\n\t}\n\n\tattnExt := 2 - dxExt*dxExt - dyExt*dyExt\n\tif attnExt > 0 {\n\t\tattnExt *= attnExt\n\t\tvalue += attnExt * attnExt * extrapolate(xsvExt, ysvExt, dxExt, dyExt)\n\t}\n\n\treturn value / NormConstant\n}", "title": "" }, { "docid": "e95b7dc1dd538663aca42028ecc7316f", "score": "0.46480903", "text": "func bottomUp(prices []int) int {\n\tn := len(prices)\n\tvar none, buy, sell int\n\tbuy = -prices[0]\n\tfor i := 1; i < n; i++ {\n\t\tnone1 := max(none, sell)\n\t\tbuy1 := max(-prices[i]+none, buy)\n\t\tsell = buy + prices[i]\n\n\t\tnone, buy = none1, buy1\n\t}\n\n\treturn max(none, sell)\n}", "title": "" }, { "docid": "f8891cc2697d94aad247f3e2c253dbaf", "score": "0.4646323", "text": "func zlavheRook(uplo mat.MatUplo, trans mat.MatTrans, diag mat.MatDiag, n, nrhs int, a *mat.CMatrix, ipiv *[]int, b *mat.CMatrix) (err error) {\n\tvar nounit bool\n\tvar cone, d11, d12, d21, d22, t1, t2 complex128\n\tvar j, k, kp int\n\n\tcone = (1.0 + 0.0*1i)\n\n\t// Test the input parameters.\n\tif uplo != Upper && uplo != Lower {\n\t\terr = fmt.Errorf(\"uplo != Upper && uplo != Lower: uplo=%s\", uplo)\n\t} else if trans != NoTrans && trans != ConjTrans {\n\t\terr = fmt.Errorf(\"trans != NoTrans && trans != ConjTrans: trans=%s\", trans)\n\t} else if diag != Unit && diag != NonUnit {\n\t\terr = fmt.Errorf(\"diag != Unit && diag != NonUnit: diag=%s\", diag)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if a.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=%v, n=%v\", a.Rows, n)\n\t} else if b.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=%v, n=%v\", b.Rows, n)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"zlavheRook\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible.\n\tif n == 0 {\n\t\treturn\n\t}\n\n\tnounit = diag == NonUnit\n\t//------------------------------------------\n\t//\n\t// Compute B := A * B (No transpose)\n\t//\n\t//------------------------------------------\n\tif trans == NoTrans {\n\t\t// Compute B := U*B\n\t\t// where U = P(m)*inv(U(m))* ... *P(1)*inv(U(1))\n\t\tif uplo == Upper {\n\t\t\t// Loop forward applying the transformations.\n\t\t\tk = 1\n\t\tlabel10:\n\t\t\t;\n\t\t\tif k > n {\n\t\t\t\tgoto label30\n\t\t\t}\n\t\t\tif (*ipiv)[k-1] > 0 {\n\t\t\t\t// 1 x 1 pivot block\n\t\t\t\t//\n\t\t\t\t// Multiply by the diagonal element if forming U * D.\n\t\t\t\tif nounit {\n\t\t\t\t\tb.Off(k-1, 0).CVector().Scal(nrhs, a.Get(k-1, k-1), b.Rows)\n\t\t\t\t}\n\n\t\t\t\t// Multiply by P(K) * inv(U(K)) if K > 1.\n\t\t\t\tif k > 1 {\n\t\t\t\t\t// Apply the transformation.\n\t\t\t\t\terr = b.Off(0, 0).Geru(k-1, nrhs, cone, a.Off(0, k-1).CVector(), 1, b.Off(k-1, 0).CVector(), b.Rows)\n\t\t\t\t\t//\n\t\t\t\t\t// Interchange if P(K) != I.\n\t\t\t\t\t//\n\t\t\t\t\tkp = (*ipiv)[k-1]\n\t\t\t\t\tif kp != k {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tk = k + 1\n\t\t\t} else {\n\t\t\t\t// 2 x 2 pivot block\n\t\t\t\t//\n\t\t\t\t// Multiply by the diagonal block if forming U * D.\n\t\t\t\tif nounit {\n\t\t\t\t\td11 = a.Get(k-1, k-1)\n\t\t\t\t\td22 = a.Get(k, k)\n\t\t\t\t\td12 = a.Get(k-1, k)\n\t\t\t\t\td21 = cmplx.Conj(d12)\n\t\t\t\t\tfor j = 1; j <= nrhs; j++ {\n\t\t\t\t\t\tt1 = b.Get(k-1, j-1)\n\t\t\t\t\t\tt2 = b.Get(k, j-1)\n\t\t\t\t\t\tb.Set(k-1, j-1, d11*t1+d12*t2)\n\t\t\t\t\t\tb.Set(k, j-1, d21*t1+d22*t2)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Multiply by P(K) * inv(U(K)) if K > 1.\n\t\t\t\tif k > 1 {\n\t\t\t\t\t// Apply the transformations.\n\t\t\t\t\tif err = b.Off(0, 0).Geru(k-1, nrhs, cone, a.Off(0, k-1).CVector(), 1, b.Off(k-1, 0).CVector(), b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\t\t\t\t\tif err = b.Off(0, 0).Geru(k-1, nrhs, cone, a.Off(0, k).CVector(), 1, b.Off(k, 0).CVector(), b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Interchange if a permutation was applied at the\n\t\t\t\t\t// K-th step of the factorization.\n\t\t\t\t\t//\n\t\t\t\t\t// Swap the first of pair with IMAXth\n\t\t\t\t\tkp = abs((*ipiv)[k-1])\n\t\t\t\t\tif kp != k {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\n\t\t\t\t\t// NOW swap the first of pair with Pth\n\t\t\t\t\tkp = abs((*ipiv)[k])\n\t\t\t\t\tif kp != k+1 {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tk = k + 2\n\t\t\t}\n\t\t\tgoto label10\n\t\tlabel30:\n\n\t\t\t// Compute B := L*B\n\t\t\t// where L = P(1)*inv(L(1))* ... *P(m)*inv(L(m)) .\n\t\t} else {\n\t\t\t// Loop backward applying the transformations to B.\n\t\t\tk = n\n\t\tlabel40:\n\t\t\t;\n\t\t\tif k < 1 {\n\t\t\t\tgoto label60\n\t\t\t}\n\n\t\t\t// Test the pivot index. If greater than zero, a 1 x 1\n\t\t\t// pivot was used, otherwise a 2 x 2 pivot was used.\n\t\t\tif (*ipiv)[k-1] > 0 {\n\t\t\t\t// 1 x 1 pivot block:\n\t\t\t\t//\n\t\t\t\t// Multiply by the diagonal element if forming L * D.\n\t\t\t\tif nounit {\n\t\t\t\t\tb.Off(k-1, 0).CVector().Scal(nrhs, a.Get(k-1, k-1), b.Rows)\n\t\t\t\t}\n\n\t\t\t\t// Multiply by P(K) * inv(L(K)) if K < N.\n\t\t\t\tif k != n {\n\t\t\t\t\tkp = (*ipiv)[k-1]\n\n\t\t\t\t\t// Apply the transformation.\n\t\t\t\t\tif err = b.Off(k, 0).Geru(n-k, nrhs, cone, a.Off(k, k-1).CVector(), 1, b.Off(k-1, 0).CVector(), b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Interchange if a permutation was applied at the\n\t\t\t\t\t// K-th step of the factorization.\n\t\t\t\t\tif kp != k {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tk = k - 1\n\n\t\t\t} else {\n\t\t\t\t// 2 x 2 pivot block:\n\t\t\t\t//\n\t\t\t\t// Multiply by the diagonal block if forming L * D.\n\t\t\t\tif nounit {\n\t\t\t\t\td11 = a.Get(k-1-1, k-1-1)\n\t\t\t\t\td22 = a.Get(k-1, k-1)\n\t\t\t\t\td21 = a.Get(k-1, k-1-1)\n\t\t\t\t\td12 = cmplx.Conj(d21)\n\t\t\t\t\tfor j = 1; j <= nrhs; j++ {\n\t\t\t\t\t\tt1 = b.Get(k-1-1, j-1)\n\t\t\t\t\t\tt2 = b.Get(k-1, j-1)\n\t\t\t\t\t\tb.Set(k-1-1, j-1, d11*t1+d12*t2)\n\t\t\t\t\t\tb.Set(k-1, j-1, d21*t1+d22*t2)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Multiply by P(K) * inv(L(K)) if K < N.\n\t\t\t\tif k != n {\n\t\t\t\t\t// Apply the transformation.\n\t\t\t\t\tif err = b.Off(k, 0).Geru(n-k, nrhs, cone, a.Off(k, k-1).CVector(), 1, b.Off(k-1, 0).CVector(), b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\t\t\t\t\tif err = b.Off(k, 0).Geru(n-k, nrhs, cone, a.Off(k, k-1-1).CVector(), 1, b.Off(k-1-1, 0).CVector(), b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Interchange if a permutation was applied at the\n\t\t\t\t\t// K-th step of the factorization.\n\t\t\t\t\t//\n\t\t\t\t\t//\n\t\t\t\t\t// Swap the second of pair with IMAXth\n\t\t\t\t\tkp = abs((*ipiv)[k-1])\n\t\t\t\t\tif kp != k {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\n\t\t\t\t\t// NOW swap the first of pair with Pth\n\t\t\t\t\tkp = abs((*ipiv)[k-1-1])\n\t\t\t\t\tif kp != k-1 {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tk = k - 2\n\t\t\t}\n\t\t\tgoto label40\n\t\tlabel60:\n\t\t}\n\t\t//--------------------------------------------------\n\t\t//\n\t\t// Compute B := A^H * B (conjugate transpose)\n\t\t//\n\t\t//--------------------------------------------------\n\t} else {\n\t\t// Form B := U^H*B\n\t\t// where U = P(m)*inv(U(m))* ... *P(1)*inv(U(1))\n\t\t// and U^H = inv(U^H(1))*P(1)* ... *inv(U^H(m))*P(m)\n\t\tif uplo == Upper {\n\t\t\t// Loop backward applying the transformations.\n\t\t\tk = n\n\t\tlabel70:\n\t\t\t;\n\t\t\tif k < 1 {\n\t\t\t\tgoto label90\n\t\t\t}\n\n\t\t\t// 1 x 1 pivot block.\n\t\t\tif (*ipiv)[k-1] > 0 {\n\t\t\t\tif k > 1 {\n\t\t\t\t\t// Interchange if P(K) != I.\n\t\t\t\t\tkp = (*ipiv)[k-1]\n\t\t\t\t\tif kp != k {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply the transformation\n\t\t\t\t\t// y = y - B' DCONJG(x),\n\t\t\t\t\t// where x is a column of A and y is a row of B.\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1, 0).CVector(), b.Rows)\n\t\t\t\t\tif err = b.Off(k-1, 0).CVector().Gemv(ConjTrans, k-1, nrhs, cone, b, a.Off(0, k-1).CVector(), 1, cone, b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1, 0).CVector(), b.Rows)\n\t\t\t\t}\n\t\t\t\tif nounit {\n\t\t\t\t\tb.Off(k-1, 0).CVector().Scal(nrhs, a.Get(k-1, k-1), b.Rows)\n\t\t\t\t}\n\t\t\t\tk = k - 1\n\n\t\t\t\t// 2 x 2 pivot block.\n\t\t\t} else {\n\t\t\t\tif k > 2 {\n\t\t\t\t\t// Swap the second of pair with Pth\n\t\t\t\t\tkp = abs((*ipiv)[k-1])\n\t\t\t\t\tif kp != k {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Now swap the first of pair with IMAX(r)th\n\t\t\t\t\tkp = abs((*ipiv)[k-1-1])\n\t\t\t\t\tif kp != k-1 {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply the transformations\n\t\t\t\t\t// y = y - B' DCONJG(x),\n\t\t\t\t\t// where x is a block column of A and y is a block\n\t\t\t\t\t// row of B.\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1, 0).CVector(), b.Rows)\n\t\t\t\t\tif err = b.Off(k-1, 0).CVector().Gemv(ConjTrans, k-2, nrhs, cone, b, a.Off(0, k-1).CVector(), 1, cone, b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1, 0).CVector(), b.Rows)\n\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1-1, 0).CVector(), b.Rows)\n\t\t\t\t\tif err = b.Off(k-1-1, 0).CVector().Gemv(ConjTrans, k-2, nrhs, cone, b, a.Off(0, k-1-1).CVector(), 1, cone, b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1-1, 0).CVector(), b.Rows)\n\t\t\t\t}\n\n\t\t\t\t// Multiply by the diagonal block if non-unit.\n\t\t\t\tif nounit {\n\t\t\t\t\td11 = a.Get(k-1-1, k-1-1)\n\t\t\t\t\td22 = a.Get(k-1, k-1)\n\t\t\t\t\td12 = a.Get(k-1-1, k-1)\n\t\t\t\t\td21 = cmplx.Conj(d12)\n\t\t\t\t\tfor j = 1; j <= nrhs; j++ {\n\t\t\t\t\t\tt1 = b.Get(k-1-1, j-1)\n\t\t\t\t\t\tt2 = b.Get(k-1, j-1)\n\t\t\t\t\t\tb.Set(k-1-1, j-1, d11*t1+d12*t2)\n\t\t\t\t\t\tb.Set(k-1, j-1, d21*t1+d22*t2)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tk = k - 2\n\t\t\t}\n\t\t\tgoto label70\n\t\tlabel90:\n\n\t\t\t// Form B := L^H*B\n\t\t\t// where L = P(1)*inv(L(1))* ... *P(m)*inv(L(m))\n\t\t\t// and L^H = inv(L^H(m))*P(m)* ... *inv(L^H(1))*P(1)\n\t\t} else {\n\t\t\t// Loop forward applying the L-transformations.\n\t\t\tk = 1\n\t\tlabel100:\n\t\t\t;\n\t\t\tif k > n {\n\t\t\t\tgoto label120\n\t\t\t}\n\n\t\t\t// 1 x 1 pivot block\n\t\t\tif (*ipiv)[k-1] > 0 {\n\t\t\t\tif k < n {\n\t\t\t\t\t// Interchange if P(K) != I.\n\t\t\t\t\tkp = (*ipiv)[k-1]\n\t\t\t\t\tif kp != k {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply the transformation\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1, 0).CVector(), b.Rows)\n\t\t\t\t\tif err = b.Off(k-1, 0).CVector().Gemv(ConjTrans, n-k, nrhs, cone, b.Off(k, 0), a.Off(k, k-1).CVector(), 1, cone, b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1, 0).CVector(), b.Rows)\n\t\t\t\t}\n\t\t\t\tif nounit {\n\t\t\t\t\tb.Off(k-1, 0).CVector().Scal(nrhs, a.Get(k-1, k-1), b.Rows)\n\t\t\t\t}\n\t\t\t\tk = k + 1\n\n\t\t\t\t// 2 x 2 pivot block.\n\t\t\t} else {\n\t\t\t\tif k < n-1 {\n\t\t\t\t\t// Swap the first of pair with Pth\n\t\t\t\t\tkp = abs((*ipiv)[k-1])\n\t\t\t\t\tif kp != k {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k-1, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Now swap the second of pair with IMAX(r)th\n\t\t\t\t\tkp = abs((*ipiv)[k])\n\t\t\t\t\tif kp != k+1 {\n\t\t\t\t\t\tb.Off(kp-1, 0).CVector().Swap(nrhs, b.Off(k, 0).CVector(), b.Rows, b.Rows)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply the transformation\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k, 0).CVector(), b.Rows)\n\t\t\t\t\tif err = b.Off(k, 0).CVector().Gemv(ConjTrans, n-k-1, nrhs, cone, b.Off(k+2-1, 0), a.Off(k+2-1, k).CVector(), 1, cone, b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k, 0).CVector(), b.Rows)\n\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1, 0).CVector(), b.Rows)\n\t\t\t\t\tif err = b.Off(k-1, 0).CVector().Gemv(ConjTrans, n-k-1, nrhs, cone, b.Off(k+2-1, 0), a.Off(k+2-1, k-1).CVector(), 1, cone, b.Rows); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\t\t\t\t\tgolapack.Zlacgv(nrhs, b.Off(k-1, 0).CVector(), b.Rows)\n\t\t\t\t}\n\n\t\t\t\t// Multiply by the diagonal block if non-unit.\n\t\t\t\tif nounit {\n\t\t\t\t\td11 = a.Get(k-1, k-1)\n\t\t\t\t\td22 = a.Get(k, k)\n\t\t\t\t\td21 = a.Get(k, k-1)\n\t\t\t\t\td12 = cmplx.Conj(d21)\n\t\t\t\t\tfor j = 1; j <= nrhs; j++ {\n\t\t\t\t\t\tt1 = b.Get(k-1, j-1)\n\t\t\t\t\t\tt2 = b.Get(k, j-1)\n\t\t\t\t\t\tb.Set(k-1, j-1, d11*t1+d12*t2)\n\t\t\t\t\t\tb.Set(k, j-1, d21*t1+d22*t2)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tk = k + 2\n\t\t\t}\n\t\t\tgoto label100\n\t\tlabel120:\n\t\t}\n\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "6e0f73b78c35277dab9d64a990a14d52", "score": "0.464432", "text": "func main() {\n\tdefer timeTrack(time.Now())\n\tsieveRange := rosserTheorem(10001)\n\tcount := 0\n\tfor p, b := range sieve(2, sieveRange) {\n\t\tif b == false && p >= 2 {\n\t\t\tcount++\n\t\t}\n\t\tif count == 10001 {\n\t\t\tfmt.Printf(\"Answer %d\\n\", p)\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cd740facfcb61e4e74ce3f801803ca62", "score": "0.4643359", "text": "func supChange(x int) bool {\n\tfor i := 0; i < variables.N; i++ {\n\t\tvar set []int\n\t\tfor j := 0; j < variables.N; j++ {\n\t\t\tif vcm[i].Prim == vcm[j].Prim {\n\t\t\t\tset = append(set, j)\n\t\t\t}\n\t\t}\n\t\tif len(set) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tvar intersection []int\n\t\tintersection = vcm[set[0]].NeedChgSet\n\t\tfor _, j := range set {\n\t\t\tintersection = types.IntersectionInt(intersection, vcm[j].NeedChgSet)\n\t\t}\n\t\tif len(intersection) >= 3*variables.F+1 && len(set) >= x {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "1e1ca3f2369ecdf86629c326ff44c2f9", "score": "0.46427262", "text": "func montQ2SpecialCaseNoADX(rsize int, tape *tape, W *repr, sCarry, lCarry *limb) *repr {\n\tcommentHeader(\"montgomerry reduction q2\")\n\n\t// get carries and constants\n\tmodulus := tape.lookupRepr(\"modulus\")\n\tiCarry := tape.dx() // internal carry\n\n\t// calculate bounds\n\tsize := modulus.size\n\toffset, bound := size-1, size-1\n\tW.updateIndex(offset)\n\n\t// process where j = size - 1 only\n\tsCarry.clear()\n\tfor i := 0; i < bound; i++ {\n\t\tfirstI, lastI := i == 0, i == bound-1\n\t\tW.updateIndex(offset + i)\n\t\tmodulus.updateIndex(-1)\n\t\t/////////////////////\n\t\tcommentI(i)\n\t\tW.commentCurrent(\"w\")\n\t\t/////////////////////\n\t\tu := tape.lookupLimb(fmt.Sprintf(\"u%d\", i))\n\t\tw1, w2 := W.next(), W.next()\n\t\tif firstI {\n\t\t\tmodulus.next().mul(u, w1, w2, _MUL_ADD)\n\t\t\tsCarry.addCarry()\n\t\t\tcontinue\n\t\t}\n\t\tmodulus.next().mul(u, w1, nil, _MUL_ADD)\n\t\tiCarry.adc(sCarry)\n\t\tsCarry.clear()\n\t\tw2.add(iCarry, _NO_CARRY)\n\t\t// may not work\n\t\tif i != size-3 {\n\t\t\tsCarry.addCarry()\n\t\t} else {\n\t\t\tcomment(\"carry from q1\")\n\t\t\tsCarry.adc(lCarry)\n\t\t}\n\t\ttape.free(u)\n\t\t_, _ = firstI, lastI\n\t}\n\treturn W\n}", "title": "" }, { "docid": "bf5210433021476bb3eb71cde5624b67", "score": "0.46386105", "text": "func tryX(vx, xmin, xmax int) bool {\n\tx := 0\n\td := 0 - sign(vx)\n\tfor vx != 0 {\n\t\tx += vx\n\t\tvx += d\n\t\tif x > xmax {\n\t\t\treturn false\n\t\t}\n\t\tif x >= xmin {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "4dfa0678ba197f2869dd9e8bceb9a2d4", "score": "0.46355435", "text": "func (c *cpu) rrca(opcode uint8, gb *GameBoy) {\n\tcarryOut := c.A & 0x1 << 7\n\tc.A = c.A>>1 | carryOut\n\n\tc.F.set(Z, false)\n\tc.F.set(N, false)\n\tc.F.set(H, false)\n\tc.F.set(CY, carryOut > 0)\n}", "title": "" }, { "docid": "3d46028c1bef30cad915a62b50674eb2", "score": "0.4632244", "text": "func (c *cpu) pop_rr(opcode uint8, gb *GameBoy) {\n\tvar rrhi, rrlo *uint8\n\tvar isf bool\n\tswitch opcode {\n\tcase 0xC1:\n\t\trrhi = &c.B\n\t\trrlo = &c.C\n\tcase 0xD1:\n\t\trrhi = &c.D\n\t\trrlo = &c.E\n\tcase 0xE1:\n\t\trrhi = &c.H\n\t\trrlo = &c.L\n\tcase 0xF1:\n\t\trrhi = &c.A\n\t\trrlo = (*uint8)(&c.F)\n\t\tisf = true\n\t}\n\n\t*rrlo = c.readFrom(gb, c.SP)\n\tif isf {\n\t\t*rrlo &= 0xF0\n\t}\n\tc.SP++\n\t*rrhi = c.readFrom(gb, c.SP)\n\tc.SP++\n}", "title": "" }, { "docid": "7a49e17f5e808093ab644c4aff78cd0f", "score": "0.46275803", "text": "func energy(random string, hp string) (bool, int){\n\tm := DrawFold(random, hp)\n\tcross := false\n\tcount := 0\n\ts := 0\n\tfor i := 2; i < len(m)-2; i++{\n\t\tfor j:= 2; j < len(m[0])-2; j++{\n\t\t\tif m[i][j] == \"H\" || m[i][j] == \"P\" {\n\t\t\t\tcount++// count total num of points exists\n\t\t\t\tif m[i][j] == \"H\"{// 'P' is 0, no influence, only 'H' matters\n\t\t\t\t\t// diagonal existence must result in s++\n\t\t\t\t\tif m[i-2][j-2] == \"H\" || m[i-2][j-2]== \"P\"{\n\t\t\t\t\t\ts++\n\t\t\t\t\t}\n\t\t\t\t\tif m[i-2][j+2] == \"H\" || m[i-2][j+2]== \"P\"{\n\t\t\t\t\t\ts++\n\t\t\t\t\t}\n\t\t\t\t\tif m[i+2][j-2] == \"H\" || m[i+2][j-2]== \"P\"{\n\t\t\t\t\t\ts++\n\t\t\t\t\t}\n\t\t\t\t\tif m[i+2][j+2] == \"H\" || m[i+2][j+2]== \"P\"{\n\t\t\t\t\t\ts++\n\t\t\t\t\t}\n\t\t\t\t\t// not adjacent in the structure\n\t\t\t\t\t// && precedent ||\n\t\t\t\t\tif (m[i-2][j] == \"H\" || m[i-2][j]== \"P\") && m[i-1][j] == \"O\"{\n\t\t\t\t\t\ts++\n\t\t\t\t\t}\n\t\t\t\t\tif (m[i][j-2] == \"H\" || m[i][j-2]== \"P\") && m[i][j-1] == \"O\"{\n\t\t\t\t\t\ts++\n\t\t\t\t\t}\t\n\t\t\t\t\tif (m[i][j+2] == \"H\" || m[i][j+2]== \"P\") && m[i][j+1] == \"O\"{\n\t\t\t\t\t\ts++\n\t\t\t\t\t}\t\n\t\t\t\t\tif (m[i+2][j] == \"H\" || m[i+2][j]== \"P\") && m[i+1][j] == \"O\"{\n\t\t\t\t\t\ts++\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tx := len(hp) - count// num of cross occurence\n\tif x != 0{\n\t\tcross = true\n\t}\n\tenergy := 10 * x - s\n\treturn cross, energy\n}", "title": "" }, { "docid": "d43f0f8c8b95ebd17d8d84954c414c7a", "score": "0.46225852", "text": "func CPY(c *CPU6502) byte {\n\tc.fetch()\n\ttemp := Word(c.y) - Word(c.fetched)\n\tc.SetStatusRegisterFlag(C, c.y >= c.fetched)\n\tc.SetFlagsZeroAndNegative(byte(temp))\n\treturn 0\n}", "title": "" }, { "docid": "e84d5749c3c7a2b5472e1e95ab8db7da", "score": "0.46126747", "text": "func opcode0xCBAA(c *CPU) int {\n\tc.res(5, &c.d)\n\treturn 4\n}", "title": "" }, { "docid": "c20ee0d2e128eaca4fc191f3c69c011b", "score": "0.4609849", "text": "func partitionQ(a []int, p, r int) int {\n\ti := p - 1\n\tx := a[r]\n\tfor j := p; j < r; j++ {\n\t\tif a[j] <= x {\n\t\t\ti++\n\t\t\tif i != j {\n\t\t\t\ta[j], a[i] = a[i], a[j]\n\t\t\t}\n\t\t}\n\t}\n\ti++\n\ta[i], a[r] = a[r], a[i]\n\treturn i\n}", "title": "" }, { "docid": "2c6710ca3041f57c9a99901011c5fb3f", "score": "0.46088699", "text": "func (x Binom) R() (res int) {\n\tvar b = NewBern(x.p)\n\t// sums the result of n Bern(p) draws and sums them\n\tres = rgo.IntArr(b.Rn(int(x.n))).Sum()\n\treturn\n}", "title": "" }, { "docid": "84afb61e5fd4e445a8ac5f7f0074e6d6", "score": "0.46080247", "text": "func alignUp(n, a uintptr) uintptr {\n\treturn (n + a - 1) &^ (a - 1)\n}", "title": "" }, { "docid": "850292967862f82a75eaa94b925c0562", "score": "0.46054384", "text": "func Quiescence(alpha, beta int, info *SearchInfo, pos *Board) int {\n\terr := pos.Check()\n\tif err != nil {\n\t\tlog.Fatalln(\"Error occurred in Quiescence\")\n\t}\n\tcheckUp(info)\n\tinfo.nodes++\n\tif isRepetition(pos) || pos.FiftyMove >= 100 {\n\t\treturn 0\n\t}\n\tif pos.Ply > MaxDepth-1 {\n\t\tscore, _ := EvalPosition(pos)\n\t\treturn score\n\t}\n\tscore, _ := EvalPosition(pos)\n\tif score >= beta {\n\t\treturn beta\n\t}\n\tif score > alpha {\n\t\talpha = score\n\t}\n\tvar list MoveList\n\tOnlyCapturedMoves = true\n\t(&list).GenerateAllMoves(pos)\n\tOnlyCapturedMoves = false\n\tlegalMovesCount := 0\n\toldAlpha := alpha\n\tbestMove := NoMove\n\tscore = -Infinite\n\n\tfor i := 0; i < list.count; i++ {\n\t\t(&list).PickNextMove(i)\n\t\tmoveMade, _ := MakeMove(list.moves[i].move, pos)\n\t\tif !moveMade {\n\t\t\tcontinue\n\t\t}\n\t\tlegalMovesCount++\n\t\tscore = -Quiescence(-beta, -alpha, info, pos)\n\t\tTakeMove(pos)\n\t\tif info.stopped == true {\n\t\t\treturn 0\n\t\t}\n\t\tif score > alpha {\n\t\t\tif score >= beta {\n\t\t\t\tif legalMovesCount == 1 {\n\t\t\t\t\tinfo.fhf++\n\t\t\t\t}\n\t\t\t\tinfo.fh++\n\t\t\t\treturn beta\n\t\t\t}\n\t\t\talpha = score\n\t\t\tbestMove = list.moves[i].move\n\t\t}\n\t}\n\n\tif alpha != oldAlpha {\n\t\tStorePvMove(pos, bestMove)\n\t}\n\treturn alpha\n}", "title": "" }, { "docid": "2d60b10ad935e4ec4ce4b14be6e83714", "score": "0.46036398", "text": "func (c *counter) increment() {\n\t// If the counter is already invalid due to overflow, there is no need to\n\t// increase it. We check for the hasOverflowed flag in the call to value().\n\tif c.hasOverflowed {\n\t\treturn\n\t}\n\tc.val++\n\tif c.val == 0 {\n\t\tc.hasOverflowed = true\n\t}\n}", "title": "" }, { "docid": "b491125ec6df9c619447315ba2a9dd2c", "score": "0.46030927", "text": "func (c *cpu) res_r(opcode uint8, gb *GameBoy) {\n\tvar r *uint8\n\tvar mask uint8\n\n\t// ew again\n\tswitch opcode {\n\tcase 0x80:\n\t\tmask = 1 << 0\n\t\tr = &c.B\n\tcase 0x81:\n\t\tmask = 1 << 0\n\t\tr = &c.C\n\tcase 0x82:\n\t\tmask = 1 << 0\n\t\tr = &c.D\n\tcase 0x83:\n\t\tmask = 1 << 0\n\t\tr = &c.E\n\tcase 0x84:\n\t\tmask = 1 << 0\n\t\tr = &c.H\n\tcase 0x85:\n\t\tmask = 1 << 0\n\t\tr = &c.L\n\tcase 0x87:\n\t\tmask = 1 << 0\n\t\tr = &c.A\n\tcase 0x88:\n\t\tmask = 1 << 1\n\t\tr = &c.B\n\tcase 0x89:\n\t\tmask = 1 << 1\n\t\tr = &c.C\n\tcase 0x8A:\n\t\tmask = 1 << 1\n\t\tr = &c.D\n\tcase 0x8B:\n\t\tmask = 1 << 1\n\t\tr = &c.E\n\tcase 0x8C:\n\t\tmask = 1 << 1\n\t\tr = &c.H\n\tcase 0x8D:\n\t\tmask = 1 << 1\n\t\tr = &c.L\n\tcase 0x8F:\n\t\tmask = 1 << 1\n\t\tr = &c.A\n\tcase 0x90:\n\t\tmask = 1 << 2\n\t\tr = &c.B\n\tcase 0x91:\n\t\tmask = 1 << 2\n\t\tr = &c.C\n\tcase 0x92:\n\t\tmask = 1 << 2\n\t\tr = &c.D\n\tcase 0x93:\n\t\tmask = 1 << 2\n\t\tr = &c.E\n\tcase 0x94:\n\t\tmask = 1 << 2\n\t\tr = &c.H\n\tcase 0x95:\n\t\tmask = 1 << 2\n\t\tr = &c.L\n\tcase 0x97:\n\t\tmask = 1 << 2\n\t\tr = &c.A\n\tcase 0x98:\n\t\tmask = 1 << 3\n\t\tr = &c.B\n\tcase 0x99:\n\t\tmask = 1 << 3\n\t\tr = &c.C\n\tcase 0x9A:\n\t\tmask = 1 << 3\n\t\tr = &c.D\n\tcase 0x9B:\n\t\tmask = 1 << 3\n\t\tr = &c.E\n\tcase 0x9C:\n\t\tmask = 1 << 3\n\t\tr = &c.H\n\tcase 0x9D:\n\t\tmask = 1 << 3\n\t\tr = &c.L\n\tcase 0x9F:\n\t\tmask = 1 << 3\n\t\tr = &c.A\n\tcase 0xA0:\n\t\tmask = 1 << 4\n\t\tr = &c.B\n\tcase 0xA1:\n\t\tmask = 1 << 4\n\t\tr = &c.C\n\tcase 0xA2:\n\t\tmask = 1 << 4\n\t\tr = &c.D\n\tcase 0xA3:\n\t\tmask = 1 << 4\n\t\tr = &c.E\n\tcase 0xA4:\n\t\tmask = 1 << 4\n\t\tr = &c.H\n\tcase 0xA5:\n\t\tmask = 1 << 4\n\t\tr = &c.L\n\tcase 0xA7:\n\t\tmask = 1 << 4\n\t\tr = &c.A\n\tcase 0xA8:\n\t\tmask = 1 << 5\n\t\tr = &c.B\n\tcase 0xA9:\n\t\tmask = 1 << 5\n\t\tr = &c.C\n\tcase 0xAA:\n\t\tmask = 1 << 5\n\t\tr = &c.D\n\tcase 0xAB:\n\t\tmask = 1 << 5\n\t\tr = &c.E\n\tcase 0xAC:\n\t\tmask = 1 << 5\n\t\tr = &c.H\n\tcase 0xAD:\n\t\tmask = 1 << 5\n\t\tr = &c.L\n\tcase 0xAF:\n\t\tmask = 1 << 5\n\t\tr = &c.A\n\tcase 0xB0:\n\t\tmask = 1 << 6\n\t\tr = &c.B\n\tcase 0xB1:\n\t\tmask = 1 << 6\n\t\tr = &c.C\n\tcase 0xB2:\n\t\tmask = 1 << 6\n\t\tr = &c.D\n\tcase 0xB3:\n\t\tmask = 1 << 6\n\t\tr = &c.E\n\tcase 0xB4:\n\t\tmask = 1 << 6\n\t\tr = &c.H\n\tcase 0xB5:\n\t\tmask = 1 << 6\n\t\tr = &c.L\n\tcase 0xB7:\n\t\tmask = 1 << 6\n\t\tr = &c.A\n\tcase 0xB8:\n\t\tmask = 1 << 7\n\t\tr = &c.B\n\tcase 0xB9:\n\t\tmask = 1 << 7\n\t\tr = &c.C\n\tcase 0xBA:\n\t\tmask = 1 << 7\n\t\tr = &c.D\n\tcase 0xBB:\n\t\tmask = 1 << 7\n\t\tr = &c.E\n\tcase 0xBC:\n\t\tmask = 1 << 7\n\t\tr = &c.H\n\tcase 0xBD:\n\t\tmask = 1 << 7\n\t\tr = &c.L\n\tcase 0xBF:\n\t\tmask = 1 << 7\n\t\tr = &c.A\n\t}\n\n\t*r &^= mask\n}", "title": "" }, { "docid": "a06ba291fecd09c54d6f95bd26122e29", "score": "0.46009502", "text": "func ABX(c *CPU6502) byte {\n\tlo, _ := c.CPURead(c.pc)\n\tc.pc++\n\thi, _ := c.CPURead(c.pc)\n\n\tc.pc++\n\tc.addressAbs = (Word(hi) << 8) | Word(lo)\n\tc.addressAbs += Word(c.x)\n\t// If X added to address overflows, then page has\n\t// changed, therefore one extra cycle is needed\n\tif (c.addressAbs & 0xFF00) != (Word(hi) << 8) {\n\t\treturn 1\n\t}\n\n\treturn 0\n}", "title": "" }, { "docid": "6879008170901bbc6387b9cb5f9516d9", "score": "0.45992342", "text": "func opcode0xCBBA(c *CPU) int {\n\tc.res(7, &c.d)\n\treturn 4\n}", "title": "" }, { "docid": "93c97ac902938a913eb32b649de31141", "score": "0.45991835", "text": "func payout(dv int, pc []card, pb float64) float64 {\n\tvar po float64\n\tpa := sumHand(pc)\n\tsort.Ints(pa[:])\n\tvar pv int\n\tif pa[0] == 0 {\n\t\tpv = pa[1]\n\t}\n\tif pa[0] != 0 {\n\t\tif pa[1] <= 21 {\n\t\t\tpv = pa[1]\n\t\t}\n\t\tif pa[1] > 21 {\n\t\t\tpv = pa[0]\n\t\t}\n\t}\n\tswitch p := pv; {\n\tcase p == 21 && len(pc) == 2:\n\t\tpo = pb + pb*1.5\n\t\tfmt.Println(\"Blackjack!\")\n\tcase p > 21:\n\t\tpo = 0\n\t\tfmt.Println(\"Bust!\")\n\tcase p == dv:\n\t\tpo = pb\n\t\tfmt.Println(\"Draw\")\n\tcase p <= 21 && dv > 21:\n\t\tpo = pb * 2\n\t\tfmt.Println(\"You win\")\n\tcase p > dv && dv <= 21:\n\t\tpo = pb * 2\n\t\tfmt.Println(\"You win\")\n\tcase p < dv && dv <= 21:\n\t\tpo = 0\n\t\tfmt.Printf(\"You lose - Dealer had %d, You had %d\", dv, p)\n\t}\n\treturn po\n}", "title": "" }, { "docid": "549fe2803b302f7bf7b3f0b3a723fc2c", "score": "0.4599092", "text": "func (p BPos) X() uint8 { return uint8(p) % 16 }", "title": "" }, { "docid": "92375a69c6395a14776f5e107472386b", "score": "0.45984313", "text": "func (s *Solution) bSearch(t int, l int, r int) int {\n\tfor l < r {\n\t\tpiv := (l + r) / 2\n\t\tif s.arr[piv] < t {\n\t\t\tl = piv + 1\n\t\t} else {\n\t\t\tr = piv\n\t\t}\n\t}\n\treturn l\n}", "title": "" }, { "docid": "f00e429ce4d0a3e9cb4a97c41eeb8209", "score": "0.459754", "text": "func (p *Prover) ProveUL(x, r *big.Int, cm *bn256.G2) (*ProofUL, error) {\n\tvar (\n\t\ti int64\n\t\tv []*big.Int\n\t\tproof_out ProofUL\n\t)\n\tdecx, err := Decompose(x, p.params.u, p.params.l)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Initialize variables\n\tv = make([]*big.Int, p.params.l, p.params.l)\n\tproof_out.V = make([]*bn256.G2, p.params.l, p.params.l)\n\tproof_out.a = make([]*bn256.GT, p.params.l, p.params.l)\n\ts := make([]*big.Int, p.params.l, p.params.l)\n\tt := make([]*big.Int, p.params.l, p.params.l)\n\tproof_out.zsig = make([]*big.Int, p.params.l, p.params.l)\n\tproof_out.zv = make([]*big.Int, p.params.l, p.params.l)\n\tproof_out.D = new(bn256.G2)\n\tproof_out.D.SetInfinity()\n\tm, err := rand.Int(rand.Reader, bn256.Order)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// D = H^m\n\tD := new(bn256.G2).ScalarMult(p.params.H, m)\n\tfor i = 0; i < p.params.l; i++ {\n\t\tv[i], err = rand.Int(rand.Reader, bn256.Order)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tA, ok := p.params.signatures[strconv.FormatInt(decx[i], 10)]\n\t\tif ok {\n\t\t\tproof_out.V[i] = new(bn256.G2).ScalarMult(A, v[i])\n\t\t\ts[i], err = rand.Int(rand.Reader, bn256.Order)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tt[i], err = rand.Int(rand.Reader, bn256.Order)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tproof_out.a[i] = bn256.Pair(G1, proof_out.V[i])\n\t\t\tproof_out.a[i].ScalarMult(proof_out.a[i], s[i])\n\t\t\tproof_out.a[i].Invert(proof_out.a[i])\n\t\t\tproof_out.a[i].Add(proof_out.a[i], new(bn256.GT).ScalarMult(E, t[i]))\n\n\t\t\tui := new(big.Int).Exp(new(big.Int).SetInt64(p.params.u), new(big.Int).SetInt64(i), nil)\n\t\t\tmuisi := new(big.Int).Mul(s[i], ui)\n\t\t\tmuisi = Mod(muisi, bn256.Order)\n\t\t\taux := new(bn256.G2).ScalarBaseMult(muisi)\n\t\t\tD.Add(D, aux)\n\t\t} else {\n\t\t\treturn nil, errors.New(\"Could not generate proof. Element does not belong to the interval.\")\n\t\t}\n\t}\n\tproof_out.D.Add(proof_out.D, D)\n\n\t// Consider passing C as input,\n\t// so that it is possible to delegate the commitment computation to an external party.\n\tproof_out.C = cm //Commit(x, r, p.H)\n\t// Fiat-Shamir heuristic\n\tproof_out.c, err = Hash(proof_out.a, proof_out.D)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tproof_out.c = Mod(proof_out.c, bn256.Order)\n\n\tproof_out.zr = Sub(m, Multiply(r, proof_out.c))\n\tproof_out.zr = Mod(proof_out.zr, bn256.Order)\n\tfor i = 0; i < p.params.l; i++ {\n\t\tproof_out.zsig[i] = Sub(s[i], Multiply(new(big.Int).SetInt64(decx[i]), proof_out.c))\n\t\tproof_out.zsig[i] = Mod(proof_out.zsig[i], bn256.Order)\n\t\tproof_out.zv[i] = Sub(t[i], Multiply(v[i], proof_out.c))\n\t\tproof_out.zv[i] = Mod(proof_out.zv[i], bn256.Order)\n\t}\n\n\treturn &proof_out, nil\n}", "title": "" }, { "docid": "d531c5e4c0167d605ec34edf1bcfc474", "score": "0.4596579", "text": "func (x ir1PrimitiveVar) Steps() int { return 0 }", "title": "" }, { "docid": "d555a9abde9c0a75f76298d34cc699e6", "score": "0.45923465", "text": "func sucin(a int64, b int64) *big.Int {\n\taccumulator := big.NewInt(1)\n\tfor i := a; i <= b; i++ {\n\t\taccumulator = accumulator.Mul(accumulator, big.NewInt(i))\n\t}\n\treturn accumulator\n}", "title": "" }, { "docid": "1ebd20180f2d324973ccbac806aed28a", "score": "0.45847252", "text": "func (r *MMSA) hkcb() time.Duration {\n\t// 1. refresh stats and sort idle < busy\n\tr.refreshStatsSortIdle()\n\n\t// 2. update swapping state and compute mem-pressure ranking\n\terr := r.mem.Get()\n\tdebug.AssertNoErr(err)\n\tr.updSwap(&r.mem)\n\tpressure := r.Pressure(&r.mem)\n\n\t// 3. memory is enough, free only those that are idle for a while\n\tif pressure == PressureLow {\n\t\tr.optDepth.Store(optDepth)\n\t\tif freed := r.freeIdle(); freed > 0 {\n\t\t\tr.toGC.Add(freed)\n\t\t\tr.doGC(sizeToGC, false)\n\t\t}\n\t\treturn r.hkIval(pressure)\n\t}\n\n\t// 4. calibrate and mem-free accordingly\n\tvar (\n\t\tmingc = sizeToGC // minimum accumulated size that triggers GC\n\t\tdepth int // => current ring depth tbd\n\t)\n\tswitch pressure {\n\tcase OOM, PressureExtreme:\n\t\tr.optDepth.Store(minDepth)\n\t\tdepth = minDepth\n\t\tmingc = sizeToGC / 4\n\tcase PressureHigh:\n\t\ttmp := cos.MaxI64(r.optDepth.Load()/2, optDepth/4)\n\t\tr.optDepth.Store(tmp)\n\t\tdepth = int(tmp)\n\t\tmingc = sizeToGC / 2\n\tdefault: // PressureModerate\n\t\tr.optDepth.Store(optDepth)\n\t\tdepth = optDepth / 2\n\t}\n\n\t// 5. reduce\n\tvar gced bool\n\tfor _, s := range r.sorted { // idle first\n\t\tif idle := r.statsSnapshot.Idle[s.ringIdx()]; idle > freeIdleMinDur/2 {\n\t\t\tdepth = minDepth\n\t\t}\n\t\tfreed := s.reduce(depth)\n\t\tif freed > 0 {\n\t\t\tr.toGC.Add(freed)\n\t\t\tif !gced {\n\t\t\t\tgced = r.doGC(mingc, true)\n\t\t\t}\n\t\t}\n\t}\n\n\t// 6. GC\n\tif pressure >= PressureHigh {\n\t\tr.doGC(mingc, true)\n\t}\n\treturn r.hkIval(pressure)\n}", "title": "" }, { "docid": "2bda3e0d361cf783cc09d3defdc264e9", "score": "0.45837837", "text": "func downresArray(hires, lores []byte, vx, vy, vz int32, blockSize dvid.Point3d) {\n\tvotemap := make(map[uint64]int, 8)\n\tnyx := blockSize[0] * blockSize[1]\n\tvar lx, ly, lz, x, y, z int32\n\tfor z = 0; z < blockSize[2]; z += 2 {\n\t\tlz = z >> 1\n\t\tfor y = 0; y < blockSize[1]; y += 2 {\n\t\t\tly = y >> 1\n\t\t\tfor x = 0; x < blockSize[0]; x += 2 {\n\t\t\t\tlx = x >> 1\n\n\t\t\t\tvar ix, iy, iz int32\n\t\t\t\tfor iz = 0; iz < 2; iz++ {\n\t\t\t\t\tfor iy = 0; iy < 2; iy++ {\n\t\t\t\t\t\tfor ix = 0; ix < 2; ix++ {\n\t\t\t\t\t\t\ti := (z+iz)*nyx + (y+iy)*blockSize[0] + x + ix\n\t\t\t\t\t\t\tlbl := binary.LittleEndian.Uint64(hires[i*8 : i*8+8])\n\t\t\t\t\t\t\tif lbl != 0 {\n\t\t\t\t\t\t\t\tvotemap[lbl]++\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar winner uint64\n\t\t\t\tvar winnerVotes int\n\t\t\t\tfor lbl, votes := range votemap {\n\t\t\t\t\tif winnerVotes < votes {\n\t\t\t\t\t\twinnerVotes = votes\n\t\t\t\t\t\twinner = lbl\n\t\t\t\t\t} else if winnerVotes == votes && lbl < winner {\n\t\t\t\t\t\twinnerVotes = votes\n\t\t\t\t\t\twinner = lbl\n\t\t\t\t\t}\n\t\t\t\t\tdelete(votemap, lbl)\n\t\t\t\t}\n\t\t\t\tli := (lz+vz)*nyx + (ly+vy)*blockSize[0] + lx + vx\n\t\t\t\tbinary.LittleEndian.PutUint64(lores[li*8:li*8+8], winner)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "29f4b64cb262a956cf03a48e02aabf7d", "score": "0.45835647", "text": "func (c *cpu) inc_rr(opcode uint8, gb *GameBoy) {\n\tvar rrhi, rrlo *uint8\n\n\tswitch opcode {\n\tcase 0x03:\n\t\trrhi = &c.B\n\t\trrlo = &c.C\n\tcase 0x13:\n\t\trrhi = &c.D\n\t\trrlo = &c.E\n\tcase 0x23:\n\t\trrhi = &c.H\n\t\trrlo = &c.L\n\t}\n\n\tv := uint16(*rrhi)<<8 | uint16(*rrlo)\n\tv++\n\t*rrhi = uint8(v >> 8)\n\t*rrlo = uint8(v & 0xFF)\n\n\tc.readFrom(gb, c.PC) // TODO: what actually gets read (or written)?\n}", "title": "" } ]
79778e2fa1133f11eaee3abed3bf76e6
SNMPV3ConfigFactory is just a simple function to instantiate the SNMPV3ConfigStruct
[ { "docid": "d351b47ed4be7960a1bd428261f8d5d6", "score": "0.86167616", "text": "func SNMPV3ConfigFactory(\n\tEnabled *bool,\n\tLocation string,\n\tSeverity string,\n) SNMPV3ConfigStruct {\n\treturn SNMPV3ConfigStruct{\n\t\tType: \"SNMPV3Config\",\n\t\tEnabled: Enabled,\n\t\tLocation: Location,\n\t\tSeverity: Severity,\n\t}\n}", "title": "" } ]
[ { "docid": "270b3df6421fdd53758b47314bd3924e", "score": "0.71783555", "text": "func SNMPV3USMUserConfigFactory(\n\tAuthenticationPassphrase string,\n\tAuthenticationProtocol string,\n\tNamespace string,\n\tPrivacyPassphrase string,\n\tPrivacyProtocol string,\n\tReference string,\n\tUsername string,\n) SNMPV3USMUserConfigStruct {\n\treturn SNMPV3USMUserConfigStruct{\n\t\tType: \"SNMPV3USMUserConfig\",\n\t\tAuthenticationPassphrase: AuthenticationPassphrase,\n\t\tAuthenticationProtocol: AuthenticationProtocol,\n\t\tNamespace: Namespace,\n\t\tPrivacyPassphrase: PrivacyPassphrase,\n\t\tPrivacyProtocol: PrivacyProtocol,\n\t\tReference: Reference,\n\t\tUsername: Username,\n\t}\n}", "title": "" }, { "docid": "e5db64d8d67edf77153fe3df2706af93", "score": "0.7149304", "text": "func newConfigV3() *configV3 {\n\tconf := new(configV3)\n\tconf.Version = \"3\"\n\tconf.Aliases = make(map[string]string)\n\tconf.Hosts = make(map[string]hostConfigV3)\n\treturn conf\n}", "title": "" }, { "docid": "2220c814c35206521bdf8fec06ca1c23", "score": "0.6830698", "text": "func SNMPV3ManagerFactory(\n\tAddress string,\n\tAuthenticationPassphrase string,\n\tAuthenticationProtocol string,\n\tNamespace string,\n\tPort *int,\n\tPrivacyPassphrase string,\n\tPrivacyProtocol string,\n\tReference string,\n\tUseInform *bool,\n\tUsername string,\n) SNMPV3ManagerStruct {\n\treturn SNMPV3ManagerStruct{\n\t\tType: \"SNMPV3Manager\",\n\t\tAddress: Address,\n\t\tAuthenticationPassphrase: AuthenticationPassphrase,\n\t\tAuthenticationProtocol: AuthenticationProtocol,\n\t\tNamespace: Namespace,\n\t\tPort: Port,\n\t\tPrivacyPassphrase: PrivacyPassphrase,\n\t\tPrivacyProtocol: PrivacyProtocol,\n\t\tReference: Reference,\n\t\tUseInform: UseInform,\n\t\tUsername: Username,\n\t}\n}", "title": "" }, { "docid": "6a3e1dccf53e264f6cfb46fa506d0ada", "score": "0.66473776", "text": "func SNMPV2ConfigFactory(\n\tAuthorizedNetwork string,\n\tCommunity string,\n\tEnabled *bool,\n\tLocation string,\n\tSeverity string,\n) SNMPV2ConfigStruct {\n\treturn SNMPV2ConfigStruct{\n\t\tType: \"SNMPV2Config\",\n\t\tAuthorizedNetwork: AuthorizedNetwork,\n\t\tCommunity: Community,\n\t\tEnabled: Enabled,\n\t\tLocation: Location,\n\t\tSeverity: Severity,\n\t}\n}", "title": "" }, { "docid": "e152bedfc82d5c99b9aae52ff91d3ca9", "score": "0.6266792", "text": "func MSSqlCommvaultConfigFactory(\n\tCommserveHostName string,\n\tConfigParams map[string]string,\n\tConfigTemplate string,\n\tSourceClientName string,\n\tStagingClientName string,\n) MSSqlCommvaultConfigStruct {\n\treturn MSSqlCommvaultConfigStruct{\n\t\tType: \"MSSqlCommvaultConfig\",\n\t\tCommserveHostName: CommserveHostName,\n\t\tConfigParams: ConfigParams,\n\t\tConfigTemplate: ConfigTemplate,\n\t\tSourceClientName: SourceClientName,\n\t\tStagingClientName: StagingClientName,\n\t}\n}", "title": "" }, { "docid": "a35d915d0bad5fcda93ad6f9c8f21b37", "score": "0.58231395", "text": "func NewSNMPv3Client(ctx context.Context, ipAddress string, port, timeout, retries int, v3Data SNMPv3ConnectionData) (SNMPClient, error) {\n\tclient := &gosnmp.GoSNMP{\n\t\tContext: ctx,\n\t\tTarget: ipAddress,\n\t\tPort: uint16(port),\n\t\tTransport: \"udp\",\n\t\tVersion: gosnmp.Version3,\n\t\tTimeout: time.Duration(timeout) * time.Second,\n\t\tMaxOids: gosnmp.MaxOids,\n\t\tRetries: retries,\n\t\tSecurityModel: gosnmp.UserSecurityModel,\n\t}\n\n\tif v3Data.ContextName != nil {\n\t\tclient.ContextName = *v3Data.ContextName\n\t}\n\n\tswitch *v3Data.Level {\n\tcase \"noAuthNoPriv\":\n\t\tclient.MsgFlags = gosnmp.NoAuthNoPriv\n\t\tclient.SecurityParameters = &gosnmp.UsmSecurityParameters{\n\t\t\tUserName: *v3Data.User,\n\t\t}\n\tcase \"authNoPriv\":\n\t\tauthProtocol, err := getGoSNMPV3AuthProtocol(*v3Data.AuthProtocol)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tclient.MsgFlags = gosnmp.AuthNoPriv\n\t\tclient.SecurityParameters = &gosnmp.UsmSecurityParameters{\n\t\t\tUserName: *v3Data.User,\n\t\t\tAuthenticationProtocol: authProtocol,\n\t\t\tAuthenticationPassphrase: *v3Data.AuthKey,\n\t\t}\n\tcase \"authPriv\":\n\t\tauthProtocol, err := getGoSNMPV3AuthProtocol(*v3Data.AuthProtocol)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tprivProtocol, err := getGoSNMPV3PrivProtocol(*v3Data.PrivProtocol)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tclient.MsgFlags = gosnmp.AuthPriv\n\t\tclient.SecurityParameters = &gosnmp.UsmSecurityParameters{\n\t\t\tUserName: *v3Data.User,\n\t\t\tAuthenticationProtocol: authProtocol,\n\t\t\tAuthenticationPassphrase: *v3Data.AuthKey,\n\t\t\tPrivacyProtocol: privProtocol,\n\t\t\tPrivacyPassphrase: *v3Data.PrivKey,\n\t\t}\n\t}\n\n\treturn newSNMPClientTestConnection(client)\n}", "title": "" }, { "docid": "6843726a8722319b2c5d8dca2e39f19a", "score": "0.5797942", "text": "func NTPConfigFactory(\n\tEnabled *bool,\n\tMulticastAddress string,\n\tServers []string,\n\tUseMulticast *bool,\n) NTPConfigStruct {\n\treturn NTPConfigStruct{\n\t\tType: \"NTPConfig\",\n\t\tEnabled: Enabled,\n\t\tMulticastAddress: MulticastAddress,\n\t\tServers: Servers,\n\t\tUseMulticast: UseMulticast,\n\t}\n}", "title": "" }, { "docid": "5195995ecd5f3960aaedd058f75d1c8c", "score": "0.5777538", "text": "func NfsConfigFactory(\n\tMountVersion string,\n) NfsConfigStruct {\n\treturn NfsConfigStruct{\n\t\tType: \"NfsConfig\",\n\t\tMountVersion: MountVersion,\n\t}\n}", "title": "" }, { "docid": "8da11ff916037b7dbfd4198bb7376b71", "score": "0.569394", "text": "func CertificateConfigFactory(\n\tCertificateExpirationCriticalThreshold *int,\n\tCertificateExpirationWarningThreshold *int,\n\tEnableUserManagedClientAuthForEngineToHostDsp *bool,\n\tEnableUserManagedClientAuthForNetworkThroughputTests *bool,\n\tEnableUserManagedClientAuthForReplication *bool,\n\tEnableUserManagedServerAuthForEngineToHostDsp *bool,\n\tEnableUserManagedServerAuthForNetworkThroughputTests *bool,\n\tEnableUserManagedServerAuthForReplication *bool,\n\tValidateWindowsConnectorCertificate *bool,\n) CertificateConfigStruct {\n\treturn CertificateConfigStruct{\n\t\tType: \"CertificateConfig\",\n\t\tCertificateExpirationCriticalThreshold: CertificateExpirationCriticalThreshold,\n\t\tCertificateExpirationWarningThreshold: CertificateExpirationWarningThreshold,\n\t\tEnableUserManagedClientAuthForEngineToHostDsp: EnableUserManagedClientAuthForEngineToHostDsp,\n\t\tEnableUserManagedClientAuthForNetworkThroughputTests: EnableUserManagedClientAuthForNetworkThroughputTests,\n\t\tEnableUserManagedClientAuthForReplication: EnableUserManagedClientAuthForReplication,\n\t\tEnableUserManagedServerAuthForEngineToHostDsp: EnableUserManagedServerAuthForEngineToHostDsp,\n\t\tEnableUserManagedServerAuthForNetworkThroughputTests: EnableUserManagedServerAuthForNetworkThroughputTests,\n\t\tEnableUserManagedServerAuthForReplication: EnableUserManagedServerAuthForReplication,\n\t\tValidateWindowsConnectorCertificate: ValidateWindowsConnectorCertificate,\n\t}\n}", "title": "" }, { "docid": "f0a994d7f2368028e9cb8e93011acba3", "score": "0.54790705", "text": "func MSSqlNetbackupConfigFactory(\n\tConfigParams map[string]string,\n\tConfigTemplate string,\n\tMasterName string,\n\tSourceClientName string,\n) MSSqlNetbackupConfigStruct {\n\treturn MSSqlNetbackupConfigStruct{\n\t\tType: \"MSSqlNetbackupConfig\",\n\t\tConfigParams: ConfigParams,\n\t\tConfigTemplate: ConfigTemplate,\n\t\tMasterName: MasterName,\n\t\tSourceClientName: SourceClientName,\n\t}\n}", "title": "" }, { "docid": "2660babba8ba1424ce6ff5e94b2d3f98", "score": "0.5417362", "text": "func New() interface{} {\n\treturn &Config{}\n}", "title": "" }, { "docid": "0473cc3bc626b4b4a45e0281fe0c7a21", "score": "0.5405581", "text": "func SystemInitializationParametersFactory(\n\tDefaultEmail string,\n\tDefaultPassword string,\n\tDefaultUser string,\n\tDevices []string,\n) SystemInitializationParametersStruct {\n\treturn SystemInitializationParametersStruct{\n\t\tType: \"SystemInitializationParameters\",\n\t\tDefaultEmail: DefaultEmail,\n\t\tDefaultPassword: DefaultPassword,\n\t\tDefaultUser: DefaultUser,\n\t\tDevices: Devices,\n\t}\n}", "title": "" }, { "docid": "ce1db6e4af3c6f33631df065e21edb4a", "score": "0.53798264", "text": "func PgSQLDBConfigFactory(\n\tCredentials Credential,\n\tDatabaseCluster string,\n\tDatabaseName string,\n\tUser string,\n) PgSQLDBConfigStruct {\n\treturn PgSQLDBConfigStruct{\n\t\tType: \"PgSQLDBConfig\",\n\t\tCredentials: Credentials,\n\t\tDatabaseCluster: DatabaseCluster,\n\t\tDatabaseName: DatabaseName,\n\t\tUser: User,\n\t}\n}", "title": "" }, { "docid": "9738732dda863e5e8f41a65c7f874432", "score": "0.53645945", "text": "func New(jsonfilename string) (*Config, error) {\n\t// var err error\n\n\tif !fileExists(jsonfilename) {\n\t\treturn nil, errors.New(fmt.Sprintf(\"package config - Can't find file %s\", jsonfilename))\n\t}\n\n\tc := &Config{}\n\tc.filename = jsonfilename\n\n\t// Try to load a json file\n\tjsonFile, err := os.Open(jsonfilename)\n\tif err != nil {\n\t\tfmt.Printf(\"Error - problem opening %s\\n%s\\n\", jsonfilename, err)\n\t\treturn nil, errors.New(fmt.Sprintf(\"package config - Can't open file %s\", jsonfilename))\n\t}\n\t// defer the closing\n\tdefer jsonFile.Close()\n\n\t// read the file in a byte slice.\n\tbuffer, err := ioutil.ReadAll(jsonFile)\n\tif err != nil {\n\t\treturn nil, errors.New(fmt.Sprintf(\"package config - Issue reading %s %v\", jsonfilename, err))\n\t}\n\n\t// fmt.Printf(\"file read: %s\", buffer)\n\t// fmt.Printf(\"struct: %v\", c.conf)\n\n\t// Unmarshal json buffer in struct\n\terr = json.Unmarshal(buffer, &c.conf)\n\t// fmt.Printf(\"struct: %v\", c.conf)\n\tif err != nil {\n\t\treturn nil, errors.New(fmt.Sprintf(\"package config - Issue unmarshalling json %v\", err))\n\t}\n\n\t// Move project details into a map to simplify access to data\n\tprj = make(map[string]ProjectDef)\n\tfor _, v := range c.conf.Projects {\n\t\tprj[v.Name] = v\n\t}\n\tif len(prj) <= 0 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"package config - at least one project needs to be defined\"))\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "ec96f3bddf1a8735bd499017540e80f8", "score": "0.53508973", "text": "func newConfigV1() *configV1 {\n\tconf := new(configV1)\n\tconf.Version = \"1.0.0\"\n\t// make sure to allocate map's otherwise Golang\n\t// exits silently without providing any errors\n\tconf.Aliases = make(map[string]string)\n\tconf.Hosts = make(map[string]hostConfigV1)\n\treturn conf\n}", "title": "" }, { "docid": "62cb5a3f5b533ed48ce3cbaee8135edd", "score": "0.5318664", "text": "func SyslogConfigFactory(\n\tEnabled *bool,\n\tFormat string,\n\tPattern string,\n\tServers []*SyslogServerStruct,\n\tSeverity string,\n) SyslogConfigStruct {\n\treturn SyslogConfigStruct{\n\t\tType: \"SyslogConfig\",\n\t\tEnabled: Enabled,\n\t\tFormat: Format,\n\t\tPattern: Pattern,\n\t\tServers: Servers,\n\t\tSeverity: Severity,\n\t}\n}", "title": "" }, { "docid": "badaaf99d5069d636234c4d404a751f9", "score": "0.52801776", "text": "func DatabaseTemplateConfigFactory(\n\tReserved []string,\n\tSourceType string,\n) DatabaseTemplateConfigStruct {\n\treturn DatabaseTemplateConfigStruct{\n\t\tType: \"DatabaseTemplateConfig\",\n\t\tReserved: Reserved,\n\t\tSourceType: SourceType,\n\t}\n}", "title": "" }, { "docid": "55093e77a08dfcf8a38d222abdc1e82b", "score": "0.52716804", "text": "func InitConfigFactory(f string, force bool) {\n\n\tif !force && SubscriberConfig != nil {\n\t\treturn\n\t}\n\n\tcontent, err := ioutil.ReadFile(f)\n\tcheckErr(err)\n\n\tSubscriberConfig = &Config{}\n\n\terr = yaml.Unmarshal([]byte(content), &SubscriberConfig)\n\tcheckErr(err)\n\tlogger.SubscriberLog.Infof(\"Successfully load module configuration %s\", f)\n}", "title": "" }, { "docid": "c3c941d7ae1b8ada79bcb3f96fff9ec4", "score": "0.5268045", "text": "func PgSQLDBClusterConfigFactory(\n\tClusterDataDirectory string,\n\tConnectionDatabase string,\n\tCredentials string,\n\tDiscovered *bool,\n\tEnvironmentUser string,\n\tLinkingEnabled *bool,\n\tName string,\n\tNamespace string,\n\tPort *int,\n\tReference string,\n\tRepository string,\n\tUser string,\n) PgSQLDBClusterConfigStruct {\n\treturn PgSQLDBClusterConfigStruct{\n\t\tType: \"PgSQLDBClusterConfig\",\n\t\tClusterDataDirectory: ClusterDataDirectory,\n\t\tConnectionDatabase: ConnectionDatabase,\n\t\tCredentials: Credentials,\n\t\tDiscovered: Discovered,\n\t\tEnvironmentUser: EnvironmentUser,\n\t\tLinkingEnabled: LinkingEnabled,\n\t\tName: Name,\n\t\tNamespace: Namespace,\n\t\tPort: Port,\n\t\tReference: Reference,\n\t\tRepository: Repository,\n\t\tUser: User,\n\t}\n}", "title": "" }, { "docid": "c76f5a3edaa53fa24e22882abb4a2427", "score": "0.5238821", "text": "func new() (*InitConfig, error) {\n\t// TODO: make flag-dependent\n\tswitch viper.GetString(\"mode\") {\n\tcase \"standalone\":\n\t\treturn getByKubeCfg()\n\tcase \"k8s\":\n\t\treturn getInCluster()\n\t}\n\n\treturn nil, errors.New(\"Invalid mode\")\n}", "title": "" }, { "docid": "4bb06a311c9f4fabedc1b8a92a21b27a", "score": "0.5215229", "text": "func New(v *viper.Viper) (*Config, error) {\n\tv.SetEnvKeyReplacer(strings.NewReplacer(\"-\", \"_\", \".\", \"_\"))\n\tv.AutomaticEnv()\n\n\tmbp, err := util.FreePort()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tv.SetDefault(\"memberlist.port\", mbp)\n\n\tv.SetDefault(\"port\", DefaultPort)\n\tv.SetDefault(\"replica\", DefaultReplica)\n\tv.SetDefault(\"volume-downtime\", DefaultVolumeDowntime)\n\tv.SetDefault(\"cache.size\", DefaultCacheSize)\n\n\tname := randomstring.HumanFriendlyEnglishString(defaultNameLen)\n\tv.SetDefault(\"name\", name)\n\n\tif v.GetString(\"config\") != \"\" {\n\t\tv.SetConfigFile(v.GetString(\"config\"))\n\t\terr = v.ReadInConfig()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tvar cfg Config\n\terr = v.Unmarshal(&cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif cfg.VolumeDowntime < volume.TickerDuration {\n\t\treturn nil, fmt.Errorf(\"the volume-downtime cannot be lower than %s\", volume.TickerDuration)\n\t}\n\n\treturn &cfg, nil\n}", "title": "" }, { "docid": "d553e6de9284b92edad9a0a5b5f1201b", "score": "0.52106196", "text": "func New() (*Config, error) {\n\n\tmyFuncName := caller.GetFuncName()\n\n\tlogger.Printf(\n\t\t\"%s: parsing local LOCKSS daemon configuration file %q\\n\",\n\t\tmyFuncName,\n\t\tDefaultConfigFile,\n\t)\n\n\t// parse the local LOCKSS Daemon configuration file for available settings\n\tlocalDaemonCfg, err := getLocalDaemonConfig(DefaultConfigFile, ConfigFileCommentChar)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"%s: error occurred retrieving local LOCKSS daemon configuration settings from %q\",\n\t\t\tmyFuncName,\n\t\t\tDefaultConfigFile,\n\t\t)\n\t}\n\n\tlogger.Printf(\n\t\t\"%s: retrieving local LOCKSS daemon config settings\",\n\t\tmyFuncName,\n\t)\n\n\t// Retrieve the URL configured within the local LOCKSS daemon\n\t// configuration file\n\tpropsURL, err := localDaemonCfg.get(PropertiesURLVarName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"%s: error occurred retrieving the value for %q: %w\",\n\t\t\tmyFuncName,\n\t\t\tPropertiesURLVarName,\n\t\t\terr,\n\t\t)\n\t}\n\n\tpreservationGroup, err := localDaemonCfg.get(PropertiesGroupName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"%s: error occurred retrieving the value for %q: %w\",\n\t\t\tmyFuncName,\n\t\t\tPropertiesGroupName,\n\t\t\terr,\n\t\t)\n\t}\n\n\tcfg := Config{\n\t\tpropsURL: propsURL,\n\t\tIDInitialV3Peers: IDInitialV3Peers{\n\t\t\tpreservationGroup: preservationGroup,\n\t\t},\n\t}\n\n\treturn cfg.loadFromPropsURL(propsURL)\n}", "title": "" }, { "docid": "8343869eab80e49b393dc97100cbd3be", "score": "0.5202018", "text": "func New(filename string, paths ...string) *Config {\n if filename == \"\" {\n filename = \"app.config\"\n }\n constants := initViper(filename, paths...)\n // init log\n log.Init(constants.Log.Dir, constants.Log.Filename, constants.App.Debug)\n // init Infrastructure DB\n return &Config{\n constants,\n }\n}", "title": "" }, { "docid": "4e3b423861b6ff81ae97814e03b01468", "score": "0.52018386", "text": "func (pool *Pool) createConfig() (*Config, error) {\n\trandInt, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbackendID := randInt.Text(16)\n\tinstanceName := \"user-vm-\" + backendID\n\tserviceAccountName := \"sa-\" + backendID\n\treturn &Config{\n\t\tInstanceName: instanceName,\n\t\tServiceAccountName: serviceAccountName,\n\t\tProxyURL: pool.proxyURL,\n\t\tApplicationImage: pool.applicationImage,\n\t\tBackendID: backendID,\n\t\tProxiedHostname: pool.proxiedHostname,\n\t}, nil\n}", "title": "" }, { "docid": "17a77d125eb9b62310480518e1ae977b", "score": "0.5197387", "text": "func (n *IPNet) vppPodL3CustomIfConfig(pod *podmanager.LocalPod, customIf *podCustomIfInfo) controller.KeyValuePairs {\n\tconfig := make(controller.KeyValuePairs)\n\n\t// ARP entry for the GW\n\tk, arp := n.podMicroserviceGatewayARP(pod, customIf.ifName, customIf.ifType, customIf.ifNet)\n\tconfig[k] = arp\n\n\t// route for the whole L3 subnet\n\tk, route := n.podMicroserviceRoute(pod, customIf.ifName, customIf.ifType, customIf.ifNet,\n\t\tn.IPAM.PodSubnetAllNodes(customIf.ifNet))\n\tconfig[k] = route\n\n\treturn config\n}", "title": "" }, { "docid": "c2d61fedb328de3724ff2b4dd9e1221b", "score": "0.5194108", "text": "func NewForConfig(c *rest.Config) (*LvmV1Client, error) {\n\tconfig := *c\n\tif err := setConfigDefaults(&config); err != nil {\n\t\treturn nil, err\n\t}\n\tclient, err := rest.RESTClientFor(&config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LvmV1Client{client}, nil\n}", "title": "" }, { "docid": "38324ccc3522c81a3b6c31656c5680e5", "score": "0.5180646", "text": "func newConfig(resolver *providerconfig.ConfigVarResolver, spec v1alpha1.ProviderSpec) (*config, error) {\n\t// Create cloud provider spec.\n\tcpSpec, providerConfig, err := newCloudProviderSpec(spec)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Setup configuration.\n\tcfg := &config{\n\t\tproviderConfig: providerConfig,\n\t\tlabels: cpSpec.Labels,\n\t\ttags: cpSpec.Tags,\n\t\tdiskSize: cpSpec.DiskSize,\n\t\tguestOSFeatures: cpSpec.GuestOSFeatures,\n\t}\n\n\tcfg.serviceAccount, err = resolver.GetConfigVarStringValueOrEnv(cpSpec.ServiceAccount, envGoogleServiceAccount)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot retrieve service account: %w\", err)\n\t}\n\n\tcfg.projectID, err = resolver.GetConfigVarStringValue(cpSpec.ProjectID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to retrieve project id: %w\", err)\n\t}\n\n\terr = cfg.postprocessServiceAccount()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot prepare JWT: %w\", err)\n\t}\n\n\tcfg.zone, err = resolver.GetConfigVarStringValue(cpSpec.Zone)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot retrieve zone: %w\", err)\n\t}\n\n\tcfg.machineType, err = resolver.GetConfigVarStringValue(cpSpec.MachineType)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot retrieve machine type: %w\", err)\n\t}\n\n\tcfg.diskType, err = resolver.GetConfigVarStringValue(cpSpec.DiskType)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot retrieve disk type: %w\", err)\n\t}\n\n\tcfg.network, err = resolver.GetConfigVarStringValue(cpSpec.Network)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot retrieve network: %w\", err)\n\t}\n\n\tcfg.subnetwork, err = resolver.GetConfigVarStringValue(cpSpec.Subnetwork)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot retrieve subnetwork: %w\", err)\n\t}\n\n\tcfg.preemptible, _, err = resolver.GetConfigVarBoolValue(cpSpec.Preemptible)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot retrieve preemptible: %w\", err)\n\t}\n\n\tif cpSpec.AutomaticRestart != nil {\n\t\tautomaticRestart, _, err := resolver.GetConfigVarBoolValue(*cpSpec.AutomaticRestart)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot retrieve automaticRestart: %w\", err)\n\t\t}\n\t\tcfg.automaticRestart = &automaticRestart\n\n\t\tif *cfg.automaticRestart && cfg.preemptible {\n\t\t\treturn nil, fmt.Errorf(\"automatic restart option can only be enabled for standard instances. Preemptible instances cannot be automatically restarted\")\n\t\t}\n\t}\n\n\tif cpSpec.ProvisioningModel != nil {\n\t\tprovisioningModel, err := resolver.GetConfigVarStringValue(*cpSpec.ProvisioningModel)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot retrieve provisioningModel: %w\", err)\n\t\t}\n\t\tcfg.provisioningModel = &provisioningModel\n\t}\n\n\t// make it true by default\n\tcfg.assignPublicIPAddress = true\n\n\tif cpSpec.AssignPublicIPAddress != nil {\n\t\tcfg.assignPublicIPAddress, _, err = resolver.GetConfigVarBoolValue(*cpSpec.AssignPublicIPAddress)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to retrieve assignPublicIPAddress: %w\", err)\n\t\t}\n\t}\n\n\tcfg.multizone, _, err = resolver.GetConfigVarBoolValue(cpSpec.MultiZone)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to retrieve multizone: %w\", err)\n\t}\n\n\tcfg.regional, _, err = resolver.GetConfigVarBoolValue(cpSpec.Regional)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to retrieve regional: %w\", err)\n\t}\n\n\tcfg.customImage, err = resolver.GetConfigVarStringValue(cpSpec.CustomImage)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to retrieve gce custom image: %w\", err)\n\t}\n\n\tcfg.disableMachineServiceAccount, _, err = resolver.GetConfigVarBoolValue(cpSpec.DisableMachineServiceAccount)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to retrieve disable machine service account: %w\", err)\n\t}\n\n\tcfg.enableNestedVirtualization, _, err = resolver.GetConfigVarBoolValue(cpSpec.EnableNestedVirtualization)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to retrieve enable nested virtualization: %w\", err)\n\t}\n\n\tcfg.minCPUPlatform, err = resolver.GetConfigVarStringValue(cpSpec.MinCPUPlatform)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to retrieve min cpu platform: %w\", err)\n\t}\n\n\treturn cfg, nil\n}", "title": "" }, { "docid": "22888ddc3d46e2c79b4f923d32810c35", "score": "0.5176654", "text": "func JSConfigFactory(\n\tDefaultBookmarkExpiration *int,\n\tRetryAttempts *int,\n) JSConfigStruct {\n\treturn JSConfigStruct{\n\t\tType: \"JSConfig\",\n\t\tDefaultBookmarkExpiration: DefaultBookmarkExpiration,\n\t\tRetryAttempts: RetryAttempts,\n\t}\n}", "title": "" }, { "docid": "81b44d7d16253193758ae794dcff6970", "score": "0.51626176", "text": "func DNSConfigFactory(\n\tDomain []string,\n\tServers []string,\n\tSource string,\n) DNSConfigStruct {\n\treturn DNSConfigStruct{\n\t\tType: \"DNSConfig\",\n\t\tDomain: Domain,\n\t\tServers: Servers,\n\t\tSource: Source,\n\t}\n}", "title": "" }, { "docid": "ea2d08aa13f8d5dfe3d18966d0b2c764", "score": "0.5158221", "text": "func New(filename string, schemaVersions Versions) (VersionedConfig, error) {\n\tcfg, err := unmarshalConfiguration(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tkind, present := cfg[\"kind\"]\n\tif !present {\n\t\treturn nil, errors.New(\"missing kind\")\n\t}\n\n\tschemaVersion, present := cfg[\"schemaVersion\"]\n\tif !present {\n\t\treturn nil, errors.New(\"missing schemaVersion\")\n\t}\n\n\tfactory, present := schemaVersions.Find(kind.(string), schemaVersion.(string))\n\tif !present {\n\t\treturn nil, errors.Errorf(\"unknown schema version %s/%s\", kind, schemaVersion)\n\t}\n\n\tresult := factory()\n\n\terr = mapstructure.Decode(cfg, &result)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"parse config failure\")\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "986553e8ae7047ef05fc8f4850a83278", "score": "0.5138413", "text": "func NewFromString(configtext string) (config *Config, err error) {\n\tconfig = &Config{}\n\n\terr = json.NewDecoder(strings.NewReader(configtext)).Decode(config)\n\n\treturn config, err\n}", "title": "" }, { "docid": "224d228a4f2b55abb374109b005d0568", "score": "0.5122404", "text": "func NewConfig(token string) configImpl {\n\treturn configImpl{token: token}\n}", "title": "" }, { "docid": "811fbb60be4e596075e52cec1c70b270", "score": "0.51076347", "text": "func New() types.Config {\n\treturn newConfig()\n}", "title": "" }, { "docid": "0fff290c22a6931626bae24269621699", "score": "0.5093614", "text": "func NewFormat3(pan string) *Iso3PinBlockAlgorithm {\n\treturn &Iso3PinBlockAlgorithm{\n\t\tGeneratePadding: dedfaultFormat3GeneratePadding,\n\t\tPan: pan,\n\t}\n}", "title": "" }, { "docid": "efdfa385d95ecc5e8b12730c49460b71", "score": "0.50874144", "text": "func New(port int, krbconf, lp string) (*Config, error) {\n\tif port > 65535 || port < 1 {\n\t\treturn &Config{}, errors.New(\"port number invalid\")\n\t}\n\tk, err := config.Load(krbconf)\n\tif err != nil {\n\t\treturn &Config{}, fmt.Errorf(\"could not load krb5.conf: %v\", err)\n\t}\n\tc := &Config{\n\t\tPort: port,\n\t\tLogPath: lp,\n\t\tKRB5Conf: k,\n\t}\n\t//Default logging to stdout\n\terr = c.SetApplicationLog(lp)\n\tif err != nil {\n\t\treturn &Config{}, err\n\t}\n\terr = c.SetAccessLog(lp)\n\tif err != nil {\n\t\treturn &Config{}, err\n\t}\n\terr = c.SetEventLog(lp)\n\tif err != nil {\n\t\treturn &Config{}, err\n\t}\n\treturn c, nil\n}", "title": "" }, { "docid": "4b4f6aef0d587e192e5b4bcd66ab7994", "score": "0.5086636", "text": "func NewFromFile(filename string) (*Config, error) {\n\n\tmyFuncName := caller.GetFuncName()\n\n\t// parse the local LOCKSS Daemon configuration file for available settings\n\tlocalDaemonCfg, err := getLocalDaemonConfig(DefaultConfigFile, ConfigFileCommentChar)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"%s: error occurred retrieving local LOCKSS daemon configuration settings from %q\",\n\t\t\tmyFuncName,\n\t\t\tDefaultConfigFile,\n\t\t)\n\t}\n\n\t// Retrieve the URL configured within the local LOCKSS daemon\n\t// configuration file\n\tpropsURL, err := localDaemonCfg.get(PropertiesURLVarName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"%s: error occurred retrieving the value for %q: %w\",\n\t\t\tmyFuncName,\n\t\t\tPropertiesURLVarName,\n\t\t\terr,\n\t\t)\n\t}\n\n\tpreservationGroup, err := localDaemonCfg.get(PropertiesGroupName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"%s: error occurred retrieving the value for %q: %w\",\n\t\t\tmyFuncName,\n\t\t\tPropertiesGroupName,\n\t\t\terr,\n\t\t)\n\t}\n\n\tcfg := Config{\n\t\tpropsURL: propsURL,\n\t\tIDInitialV3Peers: IDInitialV3Peers{\n\t\t\tpreservationGroup: preservationGroup,\n\t\t},\n\t}\n\n\treturn cfg.loadFromPropsFile(filename)\n}", "title": "" }, { "docid": "e2962ff8232cd50d6627def504534e1c", "score": "0.5085907", "text": "func MSSqlSIConfigFactory(\n\tDatabaseName string,\n\tDiscovered *bool,\n\tEnvironmentUser string,\n\tLinkingEnabled *bool,\n\tMirroringState string,\n\tMssqlUser MSSqlUser,\n\tName string,\n\tNamespace string,\n\tRecoveryModel string,\n\tReference string,\n\tRepository string,\n) MSSqlSIConfigStruct {\n\treturn MSSqlSIConfigStruct{\n\t\tType: \"MSSqlSIConfig\",\n\t\tDatabaseName: DatabaseName,\n\t\tDiscovered: Discovered,\n\t\tEnvironmentUser: EnvironmentUser,\n\t\tLinkingEnabled: LinkingEnabled,\n\t\tMirroringState: MirroringState,\n\t\tMssqlUser: MssqlUser,\n\t\tName: Name,\n\t\tNamespace: Namespace,\n\t\tRecoveryModel: RecoveryModel,\n\t\tReference: Reference,\n\t\tRepository: Repository,\n\t}\n}", "title": "" }, { "docid": "3eb80613f2de4d1c49b143fb3e120db1", "score": "0.50691116", "text": "func newConfigStruct() *configStruct {\n\tthis := new(configStruct)\n\n\t// defaul rest error handler\n\tthis.SetRESTErrObjectFunc(func(code int, err error) interface{} {\n\t\tobj := t.Map{\"code\": code}\n\t\tif err != nil {\n\t\t\tobj[\"error\"] = err.Error()\n\t\t}\n\t\treturn obj\n\t})\n\n\treturn this\n}", "title": "" }, { "docid": "02fd53dd5a3ccdac470f6d3eab98c32c", "score": "0.5068189", "text": "func NewConfig() *Config {\n return &Config{\n Port: DefaultPort,\n PidPath: DefaultPidPath,\n }\n}", "title": "" }, { "docid": "c3a70e330b95f020fe381bea6a876d98", "score": "0.50506467", "text": "func New() *Config {\n\t//Read ENV`s only once\n\tonce.Do(func() {\n\t\tif modeEnv := os.Getenv(\"MODE\"); modeEnv == \"\" || modeEnv == \"development\" || modeEnv == \"dev\" {\n\t\t\tdev()\n\t\t}\n\t\tconfig = &Config{\n\t\t\tPort: getEnv(\"PORT\"),\n\t\t\tTokenSecret: getEnv(\"TOKEN_SECRET\"),\n\t\t\tDbUser: getEnv(\"DB_USER\"),\n\t\t\tDbPassword: getEnv(\"DB_PASSWORD\"),\n\t\t\tDbName: getEnv(\"DB_NAME\"),\n\t\t\tDbPort: getEnv(\"DB_PORT\"),\n\t\t}\n\n\t\tconfigJSON, err := json.MarshalIndent(config, \"\", \" \")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t//Print configuration as JSON into terminal\n\t\tlog.Println(\"Application ENVs:\", string(configJSON))\n\n\t})\n\treturn config\n}", "title": "" }, { "docid": "4b38ccd84810c821f9cbd5f3444ee8bb", "score": "0.5043754", "text": "func newConfigV101() *configV101 {\n\tconf := new(configV101)\n\tconf.Version = \"1.0.1\"\n\tconf.Aliases = make(map[string]string)\n\tconf.Hosts = make(map[string]hostConfigV101)\n\treturn conf\n}", "title": "" }, { "docid": "720139b230881c29a31c1fbcb5f553cc", "score": "0.5043529", "text": "func MSSqlFailoverClusterDBConfigFactory(\n\tDatabaseName string,\n\tDiscovered *bool,\n\tDriveLetter string,\n\tEnvironmentUser string,\n\tLinkingEnabled *bool,\n\tMirroringState string,\n\tMssqlUser MSSqlUser,\n\tName string,\n\tNamespace string,\n\tRecoveryModel string,\n\tReference string,\n\tRepository string,\n) MSSqlFailoverClusterDBConfigStruct {\n\treturn MSSqlFailoverClusterDBConfigStruct{\n\t\tType: \"MSSqlFailoverClusterDBConfig\",\n\t\tDatabaseName: DatabaseName,\n\t\tDiscovered: Discovered,\n\t\tDriveLetter: DriveLetter,\n\t\tEnvironmentUser: EnvironmentUser,\n\t\tLinkingEnabled: LinkingEnabled,\n\t\tMirroringState: MirroringState,\n\t\tMssqlUser: MssqlUser,\n\t\tName: Name,\n\t\tNamespace: Namespace,\n\t\tRecoveryModel: RecoveryModel,\n\t\tReference: Reference,\n\t\tRepository: Repository,\n\t}\n}", "title": "" }, { "docid": "230e95d9273079fb2929240791674d6e", "score": "0.5041772", "text": "func newMemberlistConf(c *Config) (*memlist.Config, error) {\n\tbindAddr, sport, err := net.SplitHostPort(c.Memberlist.Addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbindPort, err := strconv.Atoi(sport)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmc, err := olricdb.NewMemberlistConfig(c.Memberlist.Environment)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmc.BindAddr = bindAddr\n\tmc.BindPort = bindPort\n\tmc.EnableCompression = c.Memberlist.EnableCompression\n\tif len(c.Memberlist.TCPTimeout) != 0 {\n\t\tmc.TCPTimeout, err = time.ParseDuration(c.Memberlist.TCPTimeout)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif c.Memberlist.IndirectChecks != 0 {\n\t\tmc.IndirectChecks = c.Memberlist.IndirectChecks\n\t}\n\n\tif c.Memberlist.RetransmitMult != 0 {\n\t\tmc.RetransmitMult = c.Memberlist.RetransmitMult\n\t}\n\n\tif c.Memberlist.SuspicionMult != 0 {\n\t\tmc.SuspicionMult = c.Memberlist.SuspicionMult\n\t}\n\n\tif c.Memberlist.PushPullInterval != \"\" {\n\t\tmc.PushPullInterval, err = time.ParseDuration(c.Memberlist.PushPullInterval)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif c.Memberlist.ProbeTimeout != \"\" {\n\t\tmc.ProbeTimeout, err = time.ParseDuration(c.Memberlist.ProbeTimeout)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif c.Memberlist.ProbeInterval != \"\" {\n\t\tmc.ProbeInterval, err = time.ParseDuration(c.Memberlist.ProbeInterval)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif c.Memberlist.GossipInterval != \"\" {\n\t\tmc.GossipInterval, err = time.ParseDuration(c.Memberlist.GossipInterval)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif c.Memberlist.GossipToTheDeadTime != \"\" {\n\t\tmc.GossipToTheDeadTime, err = time.ParseDuration(c.Memberlist.GossipToTheDeadTime)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn mc, nil\n}", "title": "" }, { "docid": "7987f4a5d49df09011979b5bfb6391b2", "score": "0.5026209", "text": "func CommvaultConnectivityParametersFactory(\n\tCommserveHostName string,\n\tEnvironment string,\n\tEnvironmentUser string,\n\tSourceClientName string,\n\tStagingClientName string,\n) CommvaultConnectivityParametersStruct {\n\treturn CommvaultConnectivityParametersStruct{\n\t\tType: \"CommvaultConnectivityParameters\",\n\t\tCommserveHostName: CommserveHostName,\n\t\tEnvironment: Environment,\n\t\tEnvironmentUser: EnvironmentUser,\n\t\tSourceClientName: SourceClientName,\n\t\tStagingClientName: StagingClientName,\n\t}\n}", "title": "" }, { "docid": "bb98f6e3d9ebc82a3c7865e7efc3d11e", "score": "0.5018745", "text": "func newConfigV6() *configV6 {\n\tconf := new(configV6)\n\tconf.Version = \"6\"\n\tconf.Aliases = make(map[string]string)\n\tconf.Hosts = make(map[string]hostConfigV6)\n\treturn conf\n}", "title": "" }, { "docid": "da4f53bca9f22b177029024d262d44b7", "score": "0.49960786", "text": "func NewConfig(fname string) NTConfig {\n\tdata, err := ioutil.ReadFile(fname)\n\tif err != nil {\n\t\tfmt.Printf(\"/!\\\\ nt: Unable to read config at %s\\n\", fname)\n\t\tfmt.Printf(\"/!\\\\ nt: Does the config exist? Is it readable?\\n\")\n\t\tos.Exit(1)\n\t}\n\tconfig := NTConfig{}\n\terr = json.Unmarshal(data, &config)\n\tif err != nil {\n\t\tfmt.Printf(\"/!\\\\ nt: Unable to parse JSON. Is %s valid JSON?\\n\", fname)\n\t\tos.Exit(1)\n\t}\n\treturn config\n}", "title": "" }, { "docid": "fdee460fb509bca1b92d1e44f6dfcae8", "score": "0.49845353", "text": "func HashiCorpVaultTestParametersFactory(\n\tAuthentication HashiCorpAuthentication,\n\tHost string,\n\tPort *int,\n\tVaultNamespace string,\n) HashiCorpVaultTestParametersStruct {\n\treturn HashiCorpVaultTestParametersStruct{\n\t\tType: \"HashiCorpVaultTestParameters\",\n\t\tAuthentication: Authentication,\n\t\tHost: Host,\n\t\tPort: Port,\n\t\tVaultNamespace: VaultNamespace,\n\t}\n}", "title": "" }, { "docid": "19aa7453a250ecfa08e86c2af4fa8bf2", "score": "0.49811018", "text": "func TimeConfigFactory(\n\tCurrentTime string,\n\tNtpConfig *NTPConfigStruct,\n\tSystemTimeZone string,\n\tSystemTimeZoneOffset *int,\n\tSystemTimeZoneOffsetString string,\n) TimeConfigStruct {\n\treturn TimeConfigStruct{\n\t\tType: \"TimeConfig\",\n\t\tCurrentTime: CurrentTime,\n\t\tNtpConfig: NtpConfig,\n\t\tSystemTimeZone: SystemTimeZone,\n\t\tSystemTimeZoneOffset: SystemTimeZoneOffset,\n\t\tSystemTimeZoneOffsetString: SystemTimeZoneOffsetString,\n\t}\n}", "title": "" }, { "docid": "44a017fa00463ce64051ae859e828981", "score": "0.49769166", "text": "func New(raw []byte) (*Config, error) {\n\tvar config Config\n\terr := json.Unmarshal(raw, &config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif config.Endpoint == \"\" {\n\t\treturn nil, errors.New(\"empty endpoint\")\n\t}\n\n\tif config.Token == \"\" {\n\t\treturn nil, errors.New(\"empty token\")\n\t}\n\n\tif len(config.Queries) == 0 {\n\t\treturn nil, errors.New(\"empty queries\")\n\t}\n\n\tif config.RequestTimeoutSeconds <= 0 {\n\t\tconfig.RequestTimeoutSeconds = defaultRequestTimeoutSeconds\n\t}\n\n\tif config.RefreshDelaySeconds <= 0 {\n\t\tconfig.RefreshDelaySeconds = defaultRefreshDelaySeconds\n\t}\n\n\tif config.ListenPort <= 0 {\n\t\tconfig.ListenPort = defaultListenPort\n\t}\n\n\treturn &config, nil\n}", "title": "" }, { "docid": "89a126cacc0520c238b77fbe0223e7b2", "score": "0.4972604", "text": "func SsoConfigFactory(\n\tCloudSso *bool,\n\tEnabled *bool,\n\tEntityId string,\n\tMaxAuthenticationAge string,\n\tResponseSkewTime string,\n\tSamlMetadata string,\n) SsoConfigStruct {\n\treturn SsoConfigStruct{\n\t\tType: \"SsoConfig\",\n\t\tCloudSso: CloudSso,\n\t\tEnabled: Enabled,\n\t\tEntityId: EntityId,\n\t\tMaxAuthenticationAge: MaxAuthenticationAge,\n\t\tResponseSkewTime: ResponseSkewTime,\n\t\tSamlMetadata: SamlMetadata,\n\t}\n}", "title": "" }, { "docid": "686511d26014ce802c3732e5a723c90b", "score": "0.49623397", "text": "func KerberosConfigFactory(\n\tEnabled *bool,\n\tKdcs []*KerberosKDCStruct,\n\tKeytab string,\n\tName string,\n\tNamespace string,\n\tPrincipal string,\n\tRealm string,\n\tReference string,\n) KerberosConfigStruct {\n\treturn KerberosConfigStruct{\n\t\tType: \"KerberosConfig\",\n\t\tEnabled: Enabled,\n\t\tKdcs: Kdcs,\n\t\tKeytab: Keytab,\n\t\tName: Name,\n\t\tNamespace: Namespace,\n\t\tPrincipal: Principal,\n\t\tRealm: Realm,\n\t\tReference: Reference,\n\t}\n}", "title": "" }, { "docid": "32dd8b60917cb8a4a4e190cc39465963", "score": "0.49622855", "text": "func OracleSIConfigFactory(\n\tCredentials Credential,\n\tDatabaseName string,\n\tDiscovered *bool,\n\tEnvironmentUser string,\n\tInstance *OracleInstanceStruct,\n\tLinkingEnabled *bool,\n\tName string,\n\tNamespace string,\n\tNonSysCredentials string,\n\tNonSysUser string,\n\tReference string,\n\tRepository string,\n\tServices []*OracleServiceStruct,\n\tTdeKeystorePassword string,\n\tUniqueName string,\n\tUser string,\n) OracleSIConfigStruct {\n\treturn OracleSIConfigStruct{\n\t\tType: \"OracleSIConfig\",\n\t\tCredentials: Credentials,\n\t\tDatabaseName: DatabaseName,\n\t\tDiscovered: Discovered,\n\t\tEnvironmentUser: EnvironmentUser,\n\t\tInstance: Instance,\n\t\tLinkingEnabled: LinkingEnabled,\n\t\tName: Name,\n\t\tNamespace: Namespace,\n\t\tNonSysCredentials: NonSysCredentials,\n\t\tNonSysUser: NonSysUser,\n\t\tReference: Reference,\n\t\tRepository: Repository,\n\t\tServices: Services,\n\t\tTdeKeystorePassword: TdeKeystorePassword,\n\t\tUniqueName: UniqueName,\n\t\tUser: User,\n\t}\n}", "title": "" }, { "docid": "7adbb0740ddd716b24f25881e886cb42", "score": "0.49594876", "text": "func newS3Config(urlStr string, hostCfg *hostConfigV9) *Config {\n\t// We have a valid alias and hostConfig. We populate the\n\t// credentials from the match found in the config file.\n\ts3Config := new(Config)\n\n\ts3Config.AppName = filepath.Base(os.Args[0])\n\ts3Config.AppVersion = Version\n\ts3Config.AppComments = []string{os.Args[0], runtime.GOOS, runtime.GOARCH}\n\ts3Config.Debug = globalDebug\n\ts3Config.Insecure = globalInsecure\n\n\ts3Config.HostURL = urlStr\n\tif hostCfg != nil {\n\t\ts3Config.AccessKey = hostCfg.AccessKey\n\t\ts3Config.SecretKey = hostCfg.SecretKey\n\t\ts3Config.Signature = hostCfg.API\n\t}\n\ts3Config.Lookup = getLookupType(hostCfg.Lookup)\n\treturn s3Config\n}", "title": "" }, { "docid": "02598906ec7c933f0ade558d31d1f128", "score": "0.4951695", "text": "func NetworkInterfaceFactory(\n\tAddresses []*InterfaceAddressStruct,\n\tDevice string,\n\tMacAddress string,\n\tMtu *int,\n\tMtuRange string,\n\tName string,\n\tNamespace string,\n\tReference string,\n\tState string,\n) NetworkInterfaceStruct {\n\treturn NetworkInterfaceStruct{\n\t\tType: \"NetworkInterface\",\n\t\tAddresses: Addresses,\n\t\tDevice: Device,\n\t\tMacAddress: MacAddress,\n\t\tMtu: Mtu,\n\t\tMtuRange: MtuRange,\n\t\tName: Name,\n\t\tNamespace: Namespace,\n\t\tReference: Reference,\n\t\tState: State,\n\t}\n}", "title": "" }, { "docid": "b9b292f459bb9a6bec3a92692a3759b5", "score": "0.4924309", "text": "func ASESIConfigFactory(\n\tCredentials Credential,\n\tDatabaseName string,\n\tDiscovered *bool,\n\tEnvironmentUser string,\n\tLinkingEnabled *bool,\n\tName string,\n\tNamespace string,\n\tReference string,\n\tRepository string,\n\tUser string,\n) ASESIConfigStruct {\n\treturn ASESIConfigStruct{\n\t\tType: \"ASESIConfig\",\n\t\tCredentials: Credentials,\n\t\tDatabaseName: DatabaseName,\n\t\tDiscovered: Discovered,\n\t\tEnvironmentUser: EnvironmentUser,\n\t\tLinkingEnabled: LinkingEnabled,\n\t\tName: Name,\n\t\tNamespace: Namespace,\n\t\tReference: Reference,\n\t\tRepository: Repository,\n\t\tUser: User,\n\t}\n}", "title": "" }, { "docid": "cc47a8c2d4493f29b5ed38e42e02abee", "score": "0.49187234", "text": "func NewFromURL(url string) (*Config, error) {\n\n\tmyFuncName := caller.GetFuncName()\n\n\t// parse the local LOCKSS Daemon configuration file for available settings\n\tlocalDaemonCfg, err := getLocalDaemonConfig(DefaultConfigFile, ConfigFileCommentChar)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"%s: error occurred retrieving local LOCKSS daemon configuration settings from %q\",\n\t\t\tmyFuncName,\n\t\t\tDefaultConfigFile,\n\t\t)\n\t}\n\n\tpreservationGroup, err := localDaemonCfg.get(PropertiesGroupName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"%s: error occurred retrieving the value for %q: %w\",\n\t\t\tmyFuncName,\n\t\t\tPropertiesGroupName,\n\t\t\terr,\n\t\t)\n\t}\n\n\tcfg := Config{\n\t\t// use the URL provided by the user, not the one defined within the\n\t\t// local LOCKSS daemon configuration file\n\t\tpropsURL: url,\n\t\tIDInitialV3Peers: IDInitialV3Peers{\n\t\t\tpreservationGroup: preservationGroup,\n\t\t},\n\t}\n\n\treturn cfg.loadFromPropsURL(url)\n}", "title": "" }, { "docid": "f546ee2e58dc127f051d7c2757a72b7b", "score": "0.4916546", "text": "func New() (*Config, error) {\n\tif err := createConfigDir(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := createDataDir(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tbs, err := ioutil.ReadFile(filepath.Join(ConfigDir(), ConfigFileName))\n\tif err != nil {\n\t\tlog.Debug(\"config:\", err)\n\t\treturn nil, errors.New(\"cannot read configuration file\")\n\t}\n\n\tcfg := new(Config)\n\tif err = json.Unmarshal(bs, &cfg); err != nil {\n\t\tlog.Debug(\"config:\", err)\n\t\treturn nil, errors.New(\"malformed configuration file\")\n\t}\n\n\tif err = cfg.verify(); err != nil {\n\t\treturn nil, fmt.Errorf(\"config: %v\", err)\n\t}\n\n\treturn cfg, nil\n}", "title": "" }, { "docid": "b5b399123d962f1401464fa610da0d51", "score": "0.49160057", "text": "func UserInterfaceConfigFactory(\n\tAnalyticsEnabled *bool,\n) UserInterfaceConfigStruct {\n\treturn UserInterfaceConfigStruct{\n\t\tType: \"UserInterfaceConfig\",\n\t\tAnalyticsEnabled: AnalyticsEnabled,\n\t}\n}", "title": "" }, { "docid": "d51f32b5a83d274cb88bc1496ae86039", "score": "0.49128574", "text": "func New() *Config {\r\n\treturn &Config{\r\n\t\tConnStr: \"user=postgres dbname=minera_catalog sslmode=disable host=/run/postgresql\",\r\n\t\tHostAddr: \"127.0.0.1:5252\",\r\n\t\tTmp: Templates{\r\n\t\t\tEditor: \"templates/editor/*\",\r\n\t\t\tCatalog: \"templates/catalog/*\",\r\n\t\t},\r\n\t\tMaxAtt: 10,\r\n\t\tImgDir: \"images/\",\r\n\t\tCookieName: \"minera\",\r\n\t\tReadTimeout: time.Second * 10,\r\n\t\tWriteTimeout: time.Second * 10,\r\n\t}\r\n}", "title": "" }, { "docid": "f36b9933c3688e0bdcf742e8c361da8c", "score": "0.49098992", "text": "func New(args *cniSkel.CmdArgs) (*NetConfig, error) {\n\t// Parse network configuration.\n\tvar configJSON netConfigJSON\n\terr := json.Unmarshal(args.StdinData, &configJSON)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse network configJSON: %v\", err)\n\t}\n\n\t// Parse optional per-container arguments.\n\tif args.Args != \"\" {\n\t\tvar pca pcArgs\n\t\tpca.IgnoreUnknown = ignoreUnknown\n\n\t\tif err := cniTypes.LoadArgs(args.Args, &pca); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse per-container args: %v\", err)\n\t\t}\n\n\t\t// Per-container arguments override the ones from network configuration.\n\t\tif pca.DestinationIPAddress != \"\" {\n\t\t\tconfigJSON.DestinationIPAddress = string(pca.DestinationIPAddress)\n\t\t}\n\t\tif pca.VNI != \"\" {\n\t\t\tconfigJSON.VNI = string(pca.VNI)\n\t\t}\n\t\tif pca.DestinationPort != \"\" {\n\t\t\tconfigJSON.DestinationPort = string(pca.DestinationPort)\n\t\t}\n\t\tif pca.IPAddresses != \"\" {\n\t\t\tconfigJSON.IPAddresses = strings.Split(string(pca.IPAddresses), \",\")\n\t\t}\n\t\tif pca.GatewayIPAddress != \"\" {\n\t\t\tconfigJSON.GatewayIPAddress = string(pca.GatewayIPAddress)\n\t\t}\n\t\tif pca.Primary != \"\" {\n\t\t\tconfigJSON.Primary, err = strconv.ParseBool(string(pca.Primary))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid value for primary flag\")\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set defaults.\n\tif configJSON.InterfaceType == \"\" {\n\t\tconfigJSON.InterfaceType = IfTypeTAP\n\t}\n\n\t// Validate if all the required fields are present.\n\tif configJSON.DestinationIPAddress == \"\" {\n\t\treturn nil, fmt.Errorf(\"missing required parameter destinationIPAddress\")\n\t}\n\tif configJSON.VNI == \"\" {\n\t\treturn nil, fmt.Errorf(\"missing required parameter vni\")\n\t}\n\tif configJSON.DestinationPort == \"\" {\n\t\treturn nil, fmt.Errorf(\"missing required parameter destination port\")\n\t}\n\n\t// Under TAP mode, UID and GID are required to set TAP ownership.\n\tif configJSON.InterfaceType == IfTypeTAP {\n\t\tif configJSON.Uid == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"missing required parameter uid\")\n\t\t}\n\t\tif configJSON.Gid == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"missing required parameter gid\")\n\t\t}\n\t}\n\n\t// Populate NetConfig.\n\tnetConfig := NetConfig{\n\t\tNetConf: configJSON.NetConf,\n\t\tInterfaceType: configJSON.InterfaceType,\n\t\tPrimary: configJSON.Primary,\n\t}\n\n\t// Parse the tunnel ip address.\n\tif configJSON.DestinationIPAddress != \"\" {\n\t\tnetConfig.DestinationIPAddress = net.ParseIP(configJSON.DestinationIPAddress)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid destinationIPAddress %s\", configJSON.DestinationIPAddress)\n\t\t}\n\t}\n\n\t// Extract the VNI.\n\tnetConfig.VNI = configJSON.VNI\n\n\t// Parse the Destination port address.\n\tdPort, err := strconv.Atoi(configJSON.DestinationPort)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid destination port %s\", configJSON.DestinationPort)\n\t}\n\tnetConfig.DestinationPort = uint16(dPort)\n\n\t// Parse IP addresses. These can be IPv4 or IPv6 addresses and are optional for some\n\t// setups like TAP interfaces where the IP addresses are assigned through other means.\n\tfor _, s := range configJSON.IPAddresses {\n\t\taddr, err := vpc.GetIPAddressFromString(s)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid ipAddress %s\", s)\n\t\t}\n\t\tnetConfig.IPAddresses = append(netConfig.IPAddresses, *addr)\n\t}\n\n\t// Parse gateway IP addresses.\n\taddr := net.ParseIP(configJSON.GatewayIPAddress)\n\tif addr == nil {\n\t\treturn nil, fmt.Errorf(\"invalid gatewayIPAddress %s\", configJSON.GatewayIPAddress)\n\t}\n\tnetConfig.GatewayIPAddress = addr\n\n\t// Parse the TAP interface owner UID and GID.\n\tif configJSON.InterfaceType == IfTypeTAP {\n\t\tnetConfig.Tap = &TAPConfig{\n\t\t\tQueues: defaultTapQueues,\n\t\t}\n\n\t\tif configJSON.Uid != \"\" {\n\t\t\tnetConfig.Tap.Uid, err = strconv.Atoi(configJSON.Uid)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid uid %s\", configJSON.Uid)\n\t\t\t}\n\t\t}\n\n\t\tif configJSON.Gid != \"\" {\n\t\t\tnetConfig.Tap.Gid, err = strconv.Atoi(configJSON.Gid)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid gid %s\", configJSON.Gid)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Validation complete. Return the parsed NetConfig object.\n\tlog.Debugf(\"Created NetConfig: %+v\", netConfig)\n\treturn &netConfig, nil\n}", "title": "" }, { "docid": "5c20fc5bd33e6455a4100e10082f91ad", "score": "0.4908447", "text": "func HostConfigurationFactory(\n\tDiscovered *bool,\n\tLastRefreshed string,\n\tLastUpdated string,\n\tMachine *HostMachineStruct,\n\tOperatingSystem *HostOSStruct,\n\tPowerShellVersion string,\n) HostConfigurationStruct {\n\treturn HostConfigurationStruct{\n\t\tType: \"HostConfiguration\",\n\t\tDiscovered: Discovered,\n\t\tLastRefreshed: LastRefreshed,\n\t\tLastUpdated: LastUpdated,\n\t\tMachine: Machine,\n\t\tOperatingSystem: OperatingSystem,\n\t\tPowerShellVersion: PowerShellVersion,\n\t}\n}", "title": "" }, { "docid": "71ae3840282b482250e0744130118293", "score": "0.48934448", "text": "func New(filename string) (config.Config, error) {\n\tvar (\n\t\terr error\n\t\ttlsConfig *tls.Config\n\t)\n\n\tetcd := &etcd{\n\t\tinformer: make(chan struct{}, 1),\n\t\tglobal: &config.Global{},\n\t\tlogger: config.GetDefaultLogger(),\n\t}\n\n\tconfig := &etcdConfig{}\n\n\terr = yaml.Read(filename, config)\n\tif err != nil && filename != \"-\" {\n\t\tetcd.logger.Fatal(\"etcd\", zap.Error(err))\n\t}\n\n\tprefix := \"panoptes_config_etcd\"\n\terr = envconfig.Process(prefix, config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsetDefaultConfig(config)\n\n\tetcd.prefix = config.Prefix\n\n\tif config.TLSConfig.Enabled {\n\t\ttlsConfig, err = secret.GetTLSConfig(&config.TLSConfig)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tetcd.client, err = clientv3.New(clientv3.Config{\n\t\tEndpoints: config.Endpoints,\n\t\tDialTimeout: time.Duration(config.DialTimeout) * time.Second,\n\t\tTLS: tlsConfig,\n\t\tLogConfig: &zap.Config{\n\t\t\tDevelopment: false,\n\t\t\tLevel: zap.NewAtomicLevelAt(zap.ErrorLevel),\n\t\t\tEncoding: \"json\",\n\t\t\tEncoderConfig: zap.NewProductionEncoderConfig(),\n\t\t\tOutputPaths: []string{\"stderr\"},\n\t\t\tErrorOutputPaths: []string{\"stderr\"},\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = etcd.getRemoteConfig(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tetcd.logger.Info(\"panoptes-stream\", zap.String(\"version\", etcd.global.Version))\n\tetcd.logger.Info(\"panoptes-stream\", zap.String(\"go version\", runtime.Version()), zap.String(\"go os/arch\", runtime.GOOS+\"/\"+runtime.GOARCH))\n\n\tif !etcd.global.WatcherDisabled {\n\t\tgo etcd.watch(etcd.informer)\n\t} else {\n\t\tgo etcd.signalHandler()\n\t}\n\n\treturn etcd, nil\n}", "title": "" }, { "docid": "2392995f387a900d90cc212ff662ea57", "score": "0.48822835", "text": "func NewOnuConfig(sn, intf string) *OnuConfig {\n\to := &OnuConfig{\n\t\tIfName: intf,\n\t\tPassword: \"\",\n\t\tEnablePm: 0, // disabled by default\n\t\tSerialNumber: sn,\n\t\tAdminState: 1,\n\t\tOnuDhcpMode: 1,\n\t\tOnuIPAddress: \"0.0.0.0\",\n\t\tOnuIPMask: \"0.0.0.0\",\n\t\tOnuDefaultGateway: \"0.0.0.0\",\n\t\tDefaultConfigFile: \"\",\n\t\tSendConfig: 2,\n\t\tSendConfigStatus: 6,\n\t\tOnuResync: 2,\n\t\tOnuResetFactoryDefault: 2,\n\t}\n\t//fmt.Println(o)\n\treturn o\n}", "title": "" }, { "docid": "e70bae8621564755a3853e3648d37ed3", "score": "0.48798594", "text": "func New() Config {\n\treturn Config{\n\t\tNKeyFile: \"\",\n\t\tUserCredentialsFile: \"\",\n\t}\n}", "title": "" }, { "docid": "7419294ef5771d21ba4ddcfa12a4e7de", "score": "0.48697844", "text": "func SMTPConfigFactory(\n\tAuthenticationEnabled *bool,\n\tEnabled *bool,\n\tFromAddress string,\n\tPassword string,\n\tPort *int,\n\tSendTimeout *int,\n\tServer string,\n\tTlsEnabled *bool,\n\tUsername string,\n) SMTPConfigStruct {\n\treturn SMTPConfigStruct{\n\t\tType: \"SMTPConfig\",\n\t\tAuthenticationEnabled: AuthenticationEnabled,\n\t\tEnabled: Enabled,\n\t\tFromAddress: FromAddress,\n\t\tPassword: Password,\n\t\tPort: Port,\n\t\tSendTimeout: SendTimeout,\n\t\tServer: Server,\n\t\tTlsEnabled: TlsEnabled,\n\t\tUsername: Username,\n\t}\n}", "title": "" }, { "docid": "c11d68970d617763aabc6e3f4276d883", "score": "0.48684317", "text": "func new() *Config {\n return &Config{\n Maria: MariaConfig{\n DBUser: getEnv(\"MARIA_USER\", \"root\"),\n DBPass: getEnv(\"MARIA_PASSWORD\", \"secret\"),\n DBHost: getEnv(\"MARIA_HOST\", \"127.0.0.1\"),\n DBPort: getEnv(\"MARIA_PORT\", \"3306\"),\n DBName: getEnv(\"MARIA_DB\", \"database\"),\n },\n ServerPort: getEnv(\"SERVER_PORT\", \"8080\"),\n }\n}", "title": "" }, { "docid": "ddf5c4c94ee48738b5b69227544d6a18", "score": "0.4866886", "text": "func New() (config *Config) {\n\tconfig = new(Config)\n\tconfig.structure = make(map[string]ConfigNode)\n\n\treturn config\n}", "title": "" }, { "docid": "3abbb9edbf26682efc782a0a18e206a6", "score": "0.48658517", "text": "func newConfigV2() *configV2 {\n\tconf := new(configV2)\n\tconf.Version = \"2\"\n\tconf.Aliases = make(map[string]string)\n\tconf.Hosts = make(map[string]hostConfigV2)\n\treturn conf\n}", "title": "" }, { "docid": "3d65509771fd212b0e4d1d17fc475280", "score": "0.4857324", "text": "func New(cnf ...*Configuration) Interface {\n\tvar db *Implementation\n\tvar i int\n\n\tdb = new(Implementation)\n\t// Установка яавно переданной конфигурации подключения к базе данных\n\tfor i = range cnf {\n\t\tif cnf[i] != nil {\n\t\t\tdb.cnf = cnf[i]\n\t\t}\n\t}\n\t// Установка конфигурации подключения к базе данных по умолчанию\n\tif db.cnf == nil {\n\t\tdb.cnf = defaultConfiguration\n\t}\n\treturn db\n}", "title": "" }, { "docid": "380c97324c0e311c15a3a53555923d3a", "score": "0.4856912", "text": "func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error) {\n\trollupConfig, err := NewRollupConfig(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdriverConfig, err := NewDriverConfig(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp2pSignerSetup, err := p2p.LoadSignerSetup(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load p2p signer: %v\", err)\n\t}\n\n\tp2pConfig, err := p2p.NewConfig(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load p2p config: %v\", err)\n\t}\n\n\tl1Endpoint, err := NewL1EndpointConfig(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load l1 endpoint info: %v\", err)\n\t}\n\n\tl2Endpoint, err := NewL2EndpointConfig(ctx, log)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load l2 endpoints info: %v\", err)\n\t}\n\n\tcfg := &node.Config{\n\t\tL1: l1Endpoint,\n\t\tL2: l2Endpoint,\n\t\tRollup: *rollupConfig,\n\t\tDriver: *driverConfig,\n\t\tRPC: node.RPCConfig{\n\t\t\tListenAddr: ctx.GlobalString(flags.RPCListenAddr.Name),\n\t\t\tListenPort: ctx.GlobalInt(flags.RPCListenPort.Name),\n\t\t},\n\t\tMetrics: node.MetricsConfig{\n\t\t\tEnabled: ctx.GlobalBool(flags.MetricsEnabledFlag.Name),\n\t\t\tListenAddr: ctx.GlobalString(flags.MetricsAddrFlag.Name),\n\t\t\tListenPort: ctx.GlobalInt(flags.MetricsPortFlag.Name),\n\t\t},\n\t\tP2P: p2pConfig,\n\t\tP2PSigner: p2pSignerSetup,\n\t}\n\tif err := cfg.Check(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn cfg, nil\n}", "title": "" }, { "docid": "b17a2003a3b618d1ed87fa94bc3c5164", "score": "0.48533294", "text": "func (s *Service) configFactory() *handlerfactory.Options {\n\treturn &handlerfactory.Options{\n\t\tTypeName: \"config\",\n\t\tPathPrefix: configPath,\n\t\tHasNamedIdentifiers: false,\n\t\tService: func() handlerfactory.Service {\n\t\t\treturn &config{\n\t\t\t\ts: s,\n\t\t\t\tinput: &pb.ConfigRequest{},\n\t\t\t}\n\t\t},\n\t}\n}", "title": "" }, { "docid": "c6c1cb030571d4afc13e2f29a34cea20", "score": "0.48467776", "text": "func makeConfig(t *testing.T, n int, reliable bool) (c *testConfig) {\n\tonce.Do(func() {\n\t\tif runtime.NumCPU() == 1 {\n\t\t\tglog.Infof(\"Warning: Testing on a unicore system may hide locking bugs (numcpu = %v).\", runtime.NumCPU())\n\t\t}\n\t\trand.Seed(time.Now().UnixNano())\n\t})\n\n\tc = &testConfig{}\n\tc.t = t\n\tc.n = n\n\n\tc.net = rpc.MakeNetwork()\n\tc.rafts = make([]*Raft, n)\n\tc.connected = make([]bool, n)\n\tc.states = make([]*PersistentState, n)\n\tc.logs = make([]map[int]int, n)\n\tc.errors = make([]string, n)\n\n\tc.topo = make([][]rpc.EndpointID, n)\n\n\tc.net.Reliable(reliable)\n\tc.net.LongTimeout(true) // enable long timeouts by default\n\n\t// Create/initialize config state.\n\tfor i := 0; i < n; i++ {\n\t\tc.logs[i] = make(map[int]int)\n\t\tc.startServer(i)\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tc.connectServer(i)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "893c6b64d267c8223543ce443c34a46e", "score": "0.4846381", "text": "func newPaxosConfig(addrs []string, quorumSize int) (*Configuration, *Manager) {\n\tgrpcOpts := []grpc.DialOption{\n\t\tgrpc.WithBlock(),\n\t\tgrpc.WithTimeout(time.Second),\n\t\tgrpc.WithInsecure(),\n\t}\n\tmgrOpts := []ManagerOption{WithGrpcDialOptions(grpcOpts...), WithTracing()}\n\tmgr, err := NewManager(addrs, mgrOpts...)\n\tif err != nil {\n\t\tlog.Fatalf(\"%v\\n\", err)\n\t}\n\t// get all available node ids from the manager\n\tids := mgr.NodeIDs()\n\t// create new quorum specification for Paxos\n\tqspec := NewPaxosQSpec(quorumSize)\n\t// create new configuration with all node ids and the quorum specification\n\tconfig, err := mgr.NewConfiguration(ids, qspec)\n\tif err != nil {\n\t\tlog.Fatalf(\"%v\\n\", err)\n\t}\n\treturn config, mgr\n}", "title": "" }, { "docid": "e80ca9a8c29daa73ee35df5db6f85d9d", "score": "0.48460782", "text": "func SNMPV2ManagerFactory(\n\tAddress string,\n\tCommunityString string,\n\tNamespace string,\n\tPort *int,\n\tReference string,\n\tUseInform *bool,\n) SNMPV2ManagerStruct {\n\treturn SNMPV2ManagerStruct{\n\t\tType: \"SNMPV2Manager\",\n\t\tAddress: Address,\n\t\tCommunityString: CommunityString,\n\t\tNamespace: Namespace,\n\t\tPort: Port,\n\t\tReference: Reference,\n\t\tUseInform: UseInform,\n\t}\n}", "title": "" }, { "docid": "b6381262c126564ba7acdeaf466d00cb", "score": "0.48431182", "text": "func New() *Cfg {\n\tonce.Do(\n\t\tfunc() {\n\t\t\tconfig = Cfg{\n\t\t\t\tAPIPort: parseEnvString(apiPort, \"8080\"),\n\t\t\t\tDbPort: parseEnvString(dbPort, \"5432\"),\n\t\t\t\tDbHost: parseEnvString(dbHost, \"db\"),\n\t\t\t\tDbUser: parseEnvString(dbUser, \"admin\"),\n\t\t\t\tDbPassword: parseEnvString(dbPassword, \"password\"),\n\t\t\t\tDbName: parseEnvString(dbUser, \"admin\"),\n\t\t\t\tAuthDbPort: parseEnvString(authDbPassword, \"27017\"),\n\t\t\t\tAuthDbHost: parseEnvString(authDbHost, \"authDB\"),\n\t\t\t\tAuthDbUser: parseEnvString(authDbUser, \"admin\"),\n\t\t\t\tAuthDbPassword: parseEnvString(authDbPassword, \"password\"),\n\t\t\t\tAuthDBName: parseEnvString(authDbName, \"admin\"),\n\t\t\t\tJWTSalt: parseEnvString(jwtSalt, \"secret123\"),\n\t\t\t}\n\t\t},\n\t)\n\treturn &config\n}", "title": "" }, { "docid": "7fd18e2a238968c7dea07d4ac1d232d1", "score": "0.48177353", "text": "func New(config Config) (StoreClient, error) {\n\n\tif config.Backend == \"\" {\n\t\tconfig.Backend = \"etcdv3\"\n\t}\n\tbackendNodes := config.BackendNodes\n\n\tlog.Info(\"Backend source(s) set to \" + strings.Join(backendNodes, \", \"))\n\n\treturn etcdv3.NewEtcdClient(backendNodes, config.ClientCert, config.ClientKey, config.ClientCaKeys, config.BasicAuth, config.Username, config.Password)\n}", "title": "" }, { "docid": "f64a6c48b74ffb96b22479ee469fccad", "score": "0.4812698", "text": "func newViperConfig(fs afero.Fs) *viper.Viper {\n\tv := viper.New()\n\n\t// Initialize with real or virtual FS\n\tif fs != nil {\n\t\tv.SetFs(fs)\n\t}\n\n\t// From --config\n\tif ViperConfigFile != \"\" {\n\t\tv.SetConfigFile(ViperConfigFile)\n\t}\n\n\t// Tie configuration to ENV\n\tv.SetEnvKeyReplacer(strings.NewReplacer(\".\", \"_\"))\n\tv.SetEnvPrefix(\"paperboy\")\n\tv.AutomaticEnv()\n\n\t// Defaults (General)\n\tv.SetDefault(\"smtp.url\", \"\")\n\tv.SetDefault(\"smtp.user\", \"\")\n\tv.SetDefault(\"smtp.pass\", \"\")\n\tv.SetDefault(\"dryRun\", false)\n\n\t// Defaults (Dirs)\n\tv.SetDefault(\"contentDir\", \"content\")\n\tv.SetDefault(\"layoutDir\", \"layouts\")\n\tv.SetDefault(\"themeDir\", \"themes\")\n\tv.SetDefault(\"listDir\", \"lists\")\n\n\t// Delivery workers/rate\n\tv.SetDefault(\"sendRate\", 1)\n\tv.SetDefault(\"workers\", 3)\n\n\t// Prepare for project's config.*\n\tv.SetConfigName(\"config\")\n\tv.AddConfigPath(\".\")\n\n\t// 🐍\n\treturn v\n}", "title": "" }, { "docid": "0bff2972b538b5df2105b9ed99134222", "score": "0.4809126", "text": "func (cfg *Config) init() {\n\tcfg.Version = viper.GetString(\"version\")\n\tcfg.setLogLevel(viper.GetString(\"loglevel\"))\n\tcfg.JwtSecret = viper.GetString(\"jwt_secret\")\n\tcfg.AdminSecret = viper.GetString(\"admin_secret\")\n\tcfg.API.Port = viper.GetInt(\"api.port\")\n\tcfg.API.SecretKey = viper.GetString(\"api.secret_key\")\n\tcfg.Database.Host = viper.GetString(\"db.host\")\n\tcfg.Database.Port = viper.GetInt(\"db.port\")\n\tcfg.Database.Database = viper.GetString(\"db.database\")\n\tcfg.Database.User = viper.GetString(\"db.user\")\n}", "title": "" }, { "docid": "085266a14a549434bd3fbaf04130d6ff", "score": "0.48064712", "text": "func NewFromFile(filePath string) (*Config, error) {\n\tv, err := newViperFromFile(filePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Get sub vipers for all objects with parents\n\tservicesViper := newSubViper(v, keysServices)\n\tservicesAPIViper := newSubViper(servicesViper, keysServicesAPI)\n\tservicesDBViper := newSubViper(servicesViper, keysServicesDB)\n\tservicesRedisViper := newSubViper(servicesViper, keysServicesRedis)\n\n\tstreamViper := newSubViper(v, keysStream)\n\tstreamKafkaViper := newSubViper(streamViper, keysStreamKafka)\n\tstreamFilterViper := newSubViper(streamViper, keysStreamFilter)\n\tstreamProducerViper := newSubViper(streamViper, keysStreamProducer)\n\tstreamConsumerViper := newSubViper(streamViper, keysStreamConsumer)\n\n\t// Get chains config\n\tchains, err := newChainsConfig(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Put it all together\n\treturn &Config{\n\t\tNetworkID: v.GetUint32(keysNetworkID),\n\t\tLogDirectory: v.GetString(keysLogDirectory),\n\t\tChains: chains,\n\t\tServices: Services{\n\t\t\tAPI: API{\n\t\t\t\tListenAddr: servicesAPIViper.GetString(keysServicesAPIListenAddr),\n\t\t\t},\n\t\t\tDB: &DB{\n\t\t\t\tDriver: servicesDBViper.GetString(keysServicesDBDriver),\n\t\t\t\tDSN: servicesDBViper.GetString(keysServicesDBDSN),\n\t\t\t\tTXDB: servicesDBViper.GetBool(keysServicesDBTXDB),\n\t\t\t},\n\t\t\tRedis: &Redis{\n\t\t\t\tAddr: servicesRedisViper.GetString(keysServicesRedisAddr),\n\t\t\t\tPassword: servicesRedisViper.GetString(keysServicesRedisPassword),\n\t\t\t\tDB: servicesRedisViper.GetInt(keysServicesRedisDB),\n\t\t\t},\n\t\t},\n\t\tStream: Stream{\n\t\t\tKafka: Kafka{\n\t\t\t\tBrokers: streamKafkaViper.GetStringSlice(keysStreamKafkaBrokers),\n\t\t\t},\n\t\t\tFilter: Filter{\n\t\t\t\tMin: streamFilterViper.GetUint32(keysStreamFilterMin),\n\t\t\t\tMax: streamFilterViper.GetUint32(keysStreamFilterMax),\n\t\t\t},\n\t\t\tProducer: Producer{\n\t\t\t\tIPCRoot: streamProducerViper.GetString(keysStreamProducerIPCRoot),\n\t\t\t},\n\t\t\tConsumer: Consumer{\n\t\t\t\tStartTime: streamConsumerViper.GetTime(keysStreamConsumerStartTime),\n\t\t\t\tGroupName: streamConsumerViper.GetString(keysStreamConsumerGroupName),\n\t\t\t},\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "3db78ceb4a1f9671d13251e422ad762f", "score": "0.48040015", "text": "func Factory() hal.DriverFactory {\n\tonce.Do(func() {\n\t\tcontext, err := oto.NewContext(44100, 2, 2, 8192)\n\t\tif err != nil {\n\t\t\tlog.Println(\"ERROR: failed to initialize mp3 player context.\", err)\n\t\t} else {\n\t\t\tctx = context\n\t\t}\n\t\tf = &factory{\n\t\t\tmeta: hal.Metadata{\n\t\t\t\tName: \"mp3\",\n\t\t\t\tDescription: \"MP3 Audio as digital output driver\",\n\t\t\t\tCapabilities: []hal.Capability{\n\t\t\t\t\thal.DigitalOutput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tparameters: []hal.ConfigParameter{\n\t\t\t\t{\n\t\t\t\t\tName: fileParam,\n\t\t\t\t\tType: hal.String,\n\t\t\t\t\tOrder: 0,\n\t\t\t\t\tDefault: \"/var/lib/reef-pi/mp3/alert.mp3\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: loopParam,\n\t\t\t\t\tType: hal.Boolean,\n\t\t\t\t\tOrder: 1,\n\t\t\t\t\tDefault: false,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t})\n\treturn f\n}", "title": "" }, { "docid": "a85ff32964202f197c109e0fb9a7ea9f", "score": "0.48036546", "text": "func OraclePDBConfigFactory(\n\tCdbConfig string,\n\tCredentials Credential,\n\tDatabaseName string,\n\tDiscovered *bool,\n\tEnvironmentUser string,\n\tLinkingEnabled *bool,\n\tName string,\n\tNamespace string,\n\tNonSysCredentials string,\n\tNonSysUser string,\n\tReference string,\n\tRepository string,\n\tServices []*OracleServiceStruct,\n\tUser string,\n) OraclePDBConfigStruct {\n\treturn OraclePDBConfigStruct{\n\t\tType: \"OraclePDBConfig\",\n\t\tCdbConfig: CdbConfig,\n\t\tCredentials: Credentials,\n\t\tDatabaseName: DatabaseName,\n\t\tDiscovered: Discovered,\n\t\tEnvironmentUser: EnvironmentUser,\n\t\tLinkingEnabled: LinkingEnabled,\n\t\tName: Name,\n\t\tNamespace: Namespace,\n\t\tNonSysCredentials: NonSysCredentials,\n\t\tNonSysUser: NonSysUser,\n\t\tReference: Reference,\n\t\tRepository: Repository,\n\t\tServices: Services,\n\t\tUser: User,\n\t}\n}", "title": "" }, { "docid": "82466c7656955d330eeb3869f70b7830", "score": "0.47892871", "text": "func InitConfig() error {\n\ttype config struct {\n\t\tCoffeeUser string `json:\"coffeeUser\"`\n\t\tCoffeePass string `json:\"coffeePass\"`\n\t\tCoffeeSerial string `json:\"coffeeSerial\"`\n\t\tWikiUser string `json:\"wikiUser\"`\n\t\tWikiPass string `json:\"wikiPass\"`\n\t\tDBSchema string `json:\"dbSchema\"`\n\t\tDBUser string `json:\"dbUser\"`\n\t\tDBPass string `json:\"dbPass\"`\n\t\tDBAddr string `json:\"dbAddr\"`\n\t\tAPIPort string `json:\"apiPort\"`\n\t\tAdventOfCodeSession string `json:\"adventOfCodeSession\"`\n\t\tAdventOfCodeLeaderboardID string `json:\"adventOfCodeLeaderboardId\"`\n\t\tDarkSkyAPIKey string `json:\"darkSkyApiKey\"`\n\t\tOfficeLongitude string `json:\"OfficeLongitude\"`\n\t\tOfficeLatitude string `json:\"OfficeLatitude\"`\n\t\tDCMetroHeroAPIKey string `json:\"dcMetroHeroApiKey\"`\n\t\tESPNFantasyLeagueID string `json:\"espnFantasyLeagueId\"`\n\t\tESPNFantasySeasonID string `json:\"espnFantasySeasonId\"`\n\t\tESPNMarchMadnessYear string `json:\"espnMarchMadnessYear\"`\n\t\tESPNMarchMadnessGroupID string `json:\"espnMarchMadnessGroupID\"`\n\t\tSlackAppInclementWeatherWebhookURL string `json:\"slackAppInclementWeatherWebhookUrl\"`\n\t\tCompanyWikiURL string `json:\"companyWikiUrl\"`\n\t}\n\tfile, err := ioutil.ReadFile(\"./config.json\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar c config\n\terr = json.Unmarshal(file, &c)\n\tif err != nil {\n\t\treturn err\n\t}\n\tCoffeeUser = c.CoffeeUser\n\tCoffeePass = c.CoffeePass\n\tCoffeeSerial = c.CoffeeSerial\n\tWikiUser = c.WikiUser\n\tWikiPass = c.WikiPass\n\tDBSchema = c.DBSchema\n\tDBUser = c.DBUser\n\tDBPass = c.DBPass\n\tDBAddr = c.DBAddr\n\tAPIPort = c.APIPort\n\tAdventOfCodeSession = c.AdventOfCodeSession\n\tAdventOfCodeLeaderboardID = c.AdventOfCodeLeaderboardID\n\tDarkSkyAPIKey = c.DarkSkyAPIKey\n\tOfficeLongitude = c.OfficeLongitude\n\tOfficeLatitude = c.OfficeLatitude\n\tDCMetroHeroAPIKey = c.DCMetroHeroAPIKey\n\tESPNFantasyLeagueID = c.ESPNFantasyLeagueID\n\tESPNFantasySeasonID = c.ESPNFantasySeasonID\n\tESPNMarchMadnessYear = c.ESPNMarchMadnessYear\n\tESPNMarchMadnessGroupID = c.ESPNMarchMadnessGroupID\n\tSlackAppInclementWeatherWebhookURL = c.SlackAppInclementWeatherWebhookURL\n\tCompanyWikiURL = c.CompanyWikiURL\n\treturn nil\n}", "title": "" }, { "docid": "c8138be7fbc48bfec54ac12e1c51041b", "score": "0.47849995", "text": "func New(user, pass, signature string) *Config {\n\treturn &Config{\n\t\tUser: user,\n\t\tPass: pass,\n\t\tSignature: signature,\n\t\tVersion: defaultVersion,\n\t}\n}", "title": "" }, { "docid": "8491b6492327286750911faba9a17608", "score": "0.4780337", "text": "func New() *config {\n\tc := config{\n\t\tXGrid: 160, XDiv: 5, XGutter: 32, XShow: true, XGutterShow: true,\n\t\tYGrid: 160, YDiv: 5, YGutter: 32, YShow: true, YGutterShow: true,\n\t\tXGridC: DefGridC, XDivC: DefDivC,\n\t\tYGridC: DefGridC, YDivC: DefDivC,\n\t}\n\n\tc.setGridType(\"standard\")\n\tc.EndConfig()\n\treturn &c\n}", "title": "" }, { "docid": "182114774cc7bb2014066610b48cd8e2", "score": "0.47797054", "text": "func NewForConfig(c *rest.Config) (*ProjectcalicoV3Client, error) {\n\tconfig := *c\n\tif err := setConfigDefaults(&config); err != nil {\n\t\treturn nil, err\n\t}\n\thttpClient, err := rest.HTTPClientFor(&config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewForConfigAndClient(&config, httpClient)\n}", "title": "" }, { "docid": "80bf665a6676c963750bb33f7005f955", "score": "0.47745714", "text": "func Test_createnetStore(t *testing.T) {\n\tnwStore, err := NewNetworkConfiguration(\"testnwstore\", \"onos\", make(map[ConfigName]change.ID))\n\tassert.NilError(t, err, \"Unexpected error\")\n\n\tassert.Equal(t, nwStore.User, \"onos\")\n\tassert.Equal(t, nwStore.Name, \"testnwstore\")\n\tassert.Equal(t, len(nwStore.ConfigurationChanges), 0)\n}", "title": "" }, { "docid": "79efc3732fb8f624b9be330d32d81cb5", "score": "0.47713125", "text": "func NetworkDSPTestParametersFactory(\n\tBlockSize *int,\n\tCompression *bool,\n\tDestinationType string,\n\tDirection string,\n\tDuration *int,\n\tEncryption *bool,\n\tNumConnections *int,\n\tQueueDepth *int,\n\tReceiveSocketBuffer *int,\n\tRemoteDelphixEngineInfo *RemoteDelphixEngineInfoStruct,\n\tRemoteHost string,\n\tSendSocketBuffer *int,\n\tXportScheduler string,\n) NetworkDSPTestParametersStruct {\n\treturn NetworkDSPTestParametersStruct{\n\t\tType: \"NetworkDSPTestParameters\",\n\t\tBlockSize: BlockSize,\n\t\tCompression: Compression,\n\t\tDestinationType: DestinationType,\n\t\tDirection: Direction,\n\t\tDuration: Duration,\n\t\tEncryption: Encryption,\n\t\tNumConnections: NumConnections,\n\t\tQueueDepth: QueueDepth,\n\t\tReceiveSocketBuffer: ReceiveSocketBuffer,\n\t\tRemoteDelphixEngineInfo: RemoteDelphixEngineInfo,\n\t\tRemoteHost: RemoteHost,\n\t\tSendSocketBuffer: SendSocketBuffer,\n\t\tXportScheduler: XportScheduler,\n\t}\n}", "title": "" }, { "docid": "70cd590698f401d796586a867275246b", "score": "0.4770012", "text": "func HashiCorpVaultFactory(\n\tAuthentication HashiCorpAuthentication,\n\tHost string,\n\tName string,\n\tNamespace string,\n\tPort *int,\n\tReference string,\n\tVaultNamespace string,\n) HashiCorpVaultStruct {\n\treturn HashiCorpVaultStruct{\n\t\tType: \"HashiCorpVault\",\n\t\tAuthentication: Authentication,\n\t\tHost: Host,\n\t\tName: Name,\n\t\tNamespace: Namespace,\n\t\tPort: Port,\n\t\tReference: Reference,\n\t\tVaultNamespace: VaultNamespace,\n\t}\n}", "title": "" }, { "docid": "02d97118dedfe2b16b46277069beec0e", "score": "0.4762874", "text": "func (n *IPNet) linuxPodL3CustomIfConfig(pod *podmanager.LocalPod, customIf *podCustomIfInfo,\n\tcustomNwCounter map[string]uint32) controller.KeyValuePairs {\n\tconfig := make(controller.KeyValuePairs)\n\n\tif n.isDefaultPodNetwork(customIf.ifNet) {\n\t\t// Do not configure routes / ARP for interfaces in default network,\n\t\t// since they are already present on the main pod interface.\n\t\t// Linux does not allow multiple link-scope routes for the same destination IP.\n\t\treturn config\n\t}\n\tif customNwCounter[customIf.ifNet] > 0 {\n\t\t// configure routes / ARP for interfaces in non-default networks only once per pod\n\t\treturn config\n\t}\n\tcustomNwCounter[customIf.ifNet]++\n\n\t// ARP entry for the GW\n\tkey, podArp := n.podToVPPArpEntry(pod, customIf.ifName, customIf.ifType, customIf.ifNet)\n\tconfig[key] = podArp\n\n\t// link scope route for the GW\n\tkey, route := n.podToVPPLinkRoute(pod, customIf.ifName, customIf.ifType, customIf.ifNet)\n\tconfig[key] = route\n\n\t// route for the whole L3 subnet\n\tkey, route = n.podToVPPRoute(pod, customIf.ifName, customIf.ifType, customIf.ifNet,\n\t\tn.IPAM.PodSubnetAllNodes(customIf.ifNet))\n\tconfig[key] = route\n\n\treturn config\n}", "title": "" }, { "docid": "92e17f349ed3e7a2467d3837482cf87a", "score": "0.47627178", "text": "func MySQLProvisionParametersFactory(\n\tContainer *MySQLDatabaseContainerStruct,\n\tMasked *bool,\n\tMaskingJob string,\n\tSource *MySQLVirtualSourceStruct,\n\tSourceConfig *MySQLServerConfigStruct,\n\tTimeflowPointParameters TimeflowPointParameters,\n) MySQLProvisionParametersStruct {\n\treturn MySQLProvisionParametersStruct{\n\t\tType: \"MySQLProvisionParameters\",\n\t\tContainer: Container,\n\t\tMasked: Masked,\n\t\tMaskingJob: MaskingJob,\n\t\tSource: Source,\n\t\tSourceConfig: SourceConfig,\n\t\tTimeflowPointParameters: TimeflowPointParameters,\n\t}\n}", "title": "" }, { "docid": "8ad3659e0e620f6f8c6dc1e187cdee02", "score": "0.47522655", "text": "func New() *Config {\n\treturn &Config{\n\t\tCommon: make(map[string]string),\n\t\tSector: make(map[string]*Section),\n\n\t\t// default config\n\t\tComment: Comment,\n\t\tSplit: Split,\n\t\tDelimit: Delimit,\n\t}\n}", "title": "" }, { "docid": "710542ac1620dbf3798acfd736b93e2a", "score": "0.47426155", "text": "func New(config json.RawMessage) (Notifier, error) {\n\tvar notifier Notifier\n\terr := json.Unmarshal(config, &notifier)\n\t// Fall back to port 25 if not defined\n\tif notifier.SMTP.Port == 0 {\n\t\tnotifier.SMTP.Port = 25\n\t}\n\tif strings.TrimSpace(notifier.Subject) == \"\" {\n\t\tnotifier.Subject = \"Checkup: Service Unavailable\"\n\t}\n\treturn notifier, err\n}", "title": "" }, { "docid": "8f4bbfc897b94a569f8b155003b548b2", "score": "0.47249737", "text": "func TestConfig(t *testing.T) {\n\t// Embedded kv\n\tembeddedKV, err := etcd.New(etcd.NewOptions())\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\trequire.NoError(t, embeddedKV.Close())\n\t}()\n\trequire.NoError(t, embeddedKV.Start())\n\n\t// Create config file\n\ttmpl, err := template.New(\"config\").Parse(testConfig)\n\trequire.NoError(t, err)\n\n\tconfigFd, cleanup := tempFile(t, \"config.yaml\")\n\tdefer cleanup()\n\n\tlogFile, cleanupLogFile := tempFileTouch(t, \"m3dbnode.log\")\n\tdefer cleanupLogFile()\n\n\tconfigServiceCacheDir, cleanupConfigServiceCacheDir := tempDir(t, \"kv\")\n\tdefer cleanupConfigServiceCacheDir()\n\n\tdataDir, cleanupDataDir := tempDir(t, \"data\")\n\tdefer cleanupDataDir()\n\n\terr = tmpl.Execute(configFd, struct {\n\t\tHostID string\n\t\tLogFile string\n\t\tDataDir string\n\t\tServicePort string\n\t\tServiceName string\n\t\tServiceEnv string\n\t\tServiceZone string\n\t\tConfigServiceCacheDir string\n\t\tEtcdEndpoints string\n\t}{\n\t\tHostID: hostID,\n\t\tLogFile: logFile,\n\t\tDataDir: dataDir,\n\t\tServicePort: strconv.Itoa(int(servicePort)),\n\t\tServiceName: serviceName,\n\t\tServiceEnv: serviceEnv,\n\t\tServiceZone: serviceZone,\n\t\tConfigServiceCacheDir: configServiceCacheDir,\n\t\tEtcdEndpoints: yamlArray(t, embeddedKV.Endpoints()),\n\t})\n\trequire.NoError(t, err)\n\n\t// Setup the placement\n\tvar cfg config.Configuration\n\terr = xconfig.LoadFile(&cfg, configFd.Name())\n\trequire.NoError(t, err)\n\n\tconfigSvcClient, err := cfg.EnvironmentConfig.Service.NewClient(instrument.NewOptions().\n\t\tSetLogger(xlog.NullLogger))\n\trequire.NoError(t, err)\n\n\tsvcs, err := configSvcClient.Services(services.NewOverrideOptions())\n\trequire.NoError(t, err)\n\n\tserviceID := services.NewServiceID().\n\t\tSetName(serviceName).\n\t\tSetEnvironment(serviceEnv).\n\t\tSetZone(serviceZone)\n\n\tmetadata := services.NewMetadata().\n\t\tSetPort(servicePort).\n\t\tSetLivenessInterval(time.Minute).\n\t\tSetHeartbeatInterval(10 * time.Second)\n\n\terr = svcs.SetMetadata(serviceID, metadata)\n\trequire.NoError(t, err)\n\n\tplacementOpts := placement.NewOptions().\n\t\tSetValidZone(serviceZone)\n\tplacementSvc, err := svcs.PlacementService(serviceID, placementOpts)\n\trequire.NoError(t, err)\n\n\tinstance := placement.NewInstance().\n\t\tSetID(hostID).\n\t\tSetEndpoint(endpoint(\"127.0.0.1\", servicePort)).\n\t\tSetPort(servicePort).\n\t\tSetIsolationGroup(\"local\").\n\t\tSetWeight(1).\n\t\tSetZone(serviceZone)\n\tinstances := []placement.Instance{instance}\n\tshards := 256\n\treplicas := 1\n\t_, err = placementSvc.BuildInitialPlacement(instances, shards, replicas)\n\trequire.NoError(t, err)\n\n\t// Setup the namespace\n\tns, err := newNamespaceProtoValue(namespaceID)\n\trequire.NoError(t, err)\n\n\tkvStore, err := configSvcClient.KV()\n\trequire.NoError(t, err)\n\n\t_, err = kvStore.Set(kvconfig.NamespacesKey, ns)\n\trequire.NoError(t, err)\n\n\t// Run server\n\tvar (\n\t\tinterruptCh = make(chan error, 1)\n\t\tbootstrapCh = make(chan struct{}, 1)\n\t\tserverWg sync.WaitGroup\n\t)\n\tserverWg.Add(1)\n\tgo func() {\n\t\tserver.Run(server.RunOptions{\n\t\t\tConfigFile: configFd.Name(),\n\t\t\tBootstrapCh: bootstrapCh,\n\t\t\tInterruptCh: interruptCh,\n\t\t})\n\t\tserverWg.Done()\n\t}()\n\n\t// Wait for bootstrap\n\t<-bootstrapCh\n\n\t// Create client, read and write some data\n\t// NB(r): Make sure client config points to the root config\n\t// service since we're going to instantiate the client configuration\n\t// just by itself.\n\tcfg.Client.EnvironmentConfig.Service = cfg.EnvironmentConfig.Service\n\n\tcli, err := cfg.Client.NewClient(client.ConfigurationParameters{})\n\trequire.NoError(t, err)\n\n\tsession, err := cli.DefaultSession()\n\trequire.NoError(t, err)\n\n\tdefer session.Close()\n\n\tstart := time.Now().Add(-time.Minute)\n\tvalues := []struct {\n\t\tvalue float64\n\t\tat time.Time\n\t\tunit xtime.Unit\n\t}{\n\t\t{value: 1.0, at: start, unit: xtime.Second},\n\t\t{value: 2.0, at: start.Add(1 * time.Second), unit: xtime.Second},\n\t\t{value: 3.0, at: start.Add(2 * time.Second), unit: xtime.Second},\n\t}\n\n\tfor _, v := range values {\n\t\terr := session.Write(ident.StringID(namespaceID), ident.StringID(\"foo\"), v.at, v.value, v.unit, nil)\n\t\trequire.NoError(t, err)\n\t}\n\n\t// Account for first value inserted at xtime.Second precision\n\tfetchStart := start.Truncate(time.Second)\n\n\t// Account for last value being inserted at xtime.Second and\n\t// the \"end\" param to fetch being exclusive\n\tfetchEnd := values[len(values)-1].at.Truncate(time.Second).Add(time.Nanosecond)\n\n\titer, err := session.Fetch(ident.StringID(namespaceID), ident.StringID(\"foo\"), fetchStart, fetchEnd)\n\trequire.NoError(t, err)\n\n\tfor _, v := range values {\n\t\trequire.True(t, iter.Next())\n\t\tdp, unit, _ := iter.Current()\n\t\tassert.Equal(t, v.value, dp.Value)\n\t\t// Account for xtime.Second precision on values going in\n\t\texpectAt := v.at.Truncate(time.Second)\n\t\tassert.Equal(t, expectAt, dp.Timestamp)\n\t\tassert.Equal(t, v.unit, unit)\n\t}\n\n\t// Wait for server to stop\n\tinterruptCh <- fmt.Errorf(\"test complete\")\n\tserverWg.Wait()\n}", "title": "" }, { "docid": "de4edb12ad33ee71ea49d8ed7f435493", "score": "0.47113135", "text": "func newConfig() *config {\n\tvar dict ini.Dict\n\tvar err error\n\n\tconf := &config{\n\t\toutputs: make(map[string]string),\n\t\theadConfigs: make(map[string]headConfig),\n\t}\n\n\tif len(flagConfig) > 0 {\n\t\tdict, err = ini.Load(flagConfig)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"There was an error when trying to load '%s': %s.\",\n\t\t\t\tflagConfig, err)\n\t\t\treturn conf\n\t\t}\n\t} else {\n\t\tdict, err = ini.Load(xdgfile)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) && xdgfile != myfile {\n\t\t\t\tdict, err = ini.Load(myfile)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"Neither '%s' nor '%s' could be read: %s.\",\n\t\t\t\t\t\txdgfile, myfile, err)\n\t\t\t\t\treturn conf\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlog.Printf(\"There was an error when trying to load '%s': %s.\",\n\t\t\t\t\txdgfile, err)\n\t\t\t\treturn conf\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, section := range dict.GetSections() {\n\t\tswitch section {\n\t\tcase \"monitors\":\n\t\t\tfor niceName := range dict[section] {\n\t\t\t\tif output, ok := dict.GetString(section, niceName); ok {\n\t\t\t\t\tconf.outputs[output] = niceName\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"\":\n\t\tdefault:\n\t\t\thconfig := headConfig{}\n\t\t\tfor key := range dict[section] {\n\t\t\t\tswitch key {\n\t\t\t\tcase \"mode\":\n\t\t\t\t\tif mode, ok := dict.GetString(section, key); ok {\n\t\t\t\t\t\thconfig.mode = mode\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tlog.Printf(\n\t\t\t\t\t\t\"unknown head config key '%s.%s'\",\n\t\t\t\t\t\tsection,\n\t\t\t\t\t\tkey,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconf.headConfigs[section] = hconfig\n\t\t}\n\t}\n\treturn conf\n}", "title": "" }, { "docid": "03f2b07e4f6f427d1c3875920d72934f", "score": "0.47032377", "text": "func newEtcd3Backend(conf map[string]string, logger log.Logger) (physical.Backend, error) {\n\t// Get the etcd path form the configuration.\n\tpath, ok := conf[\"path\"]\n\tif !ok {\n\t\tpath = \"/vault\"\n\t}\n\n\t// Ensure path is prefixed.\n\tif !strings.HasPrefix(path, \"/\") {\n\t\tpath = \"/\" + path\n\t}\n\n\tendpoints, err := getEtcdEndpoints(conf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcfg := clientv3.Config{\n\t\tEndpoints: endpoints,\n\t}\n\n\thaEnabled := os.Getenv(\"ETCD_HA_ENABLED\")\n\tif haEnabled == \"\" {\n\t\thaEnabled = conf[\"ha_enabled\"]\n\t}\n\tif haEnabled == \"\" {\n\t\thaEnabled = \"false\"\n\t}\n\thaEnabledBool, err := strconv.ParseBool(haEnabled)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"value [%v] of 'ha_enabled' could not be understood\", haEnabled)\n\t}\n\n\tcert, hasCert := conf[\"tls_cert_file\"]\n\tkey, hasKey := conf[\"tls_key_file\"]\n\tca, hasCa := conf[\"tls_ca_file\"]\n\tif (hasCert && hasKey) || hasCa {\n\t\ttls := transport.TLSInfo{\n\t\t\tTrustedCAFile: ca,\n\t\t\tCertFile: cert,\n\t\t\tKeyFile: key,\n\t\t}\n\n\t\ttlscfg, err := tls.ClientConfig()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcfg.TLS = tlscfg\n\t}\n\n\t// Set credentials.\n\tusername := os.Getenv(\"ETCD_USERNAME\")\n\tif username == \"\" {\n\t\tusername, _ = conf[\"username\"]\n\t}\n\n\tpassword := os.Getenv(\"ETCD_PASSWORD\")\n\tif password == \"\" {\n\t\tpassword, _ = conf[\"password\"]\n\t}\n\n\tif username != \"\" && password != \"\" {\n\t\tcfg.Username = username\n\t\tcfg.Password = password\n\t}\n\n\tif maxReceive, ok := conf[\"max_receive_size\"]; ok {\n\t\t// grpc converts this to uint32 internally, so parse as that to avoid passing invalid values\n\t\tval, err := strconv.ParseUint(maxReceive, 10, 32)\n\t\tif err != nil {\n\t\t\treturn nil, errwrap.Wrapf(fmt.Sprintf(\"value of 'max_receive_size' (%v) could not be understood: {{err}}\", maxReceive), err)\n\t\t}\n\t\tcfg.MaxCallRecvMsgSize = int(val)\n\t}\n\n\tetcd, err := clientv3.New(cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsReqTimeout := conf[\"request_timeout\"]\n\tif sReqTimeout == \"\" {\n\t\t// etcd3 default request timeout is set to 5s. It should be long enough\n\t\t// for most cases, even with internal retry.\n\t\tsReqTimeout = \"5s\"\n\t}\n\treqTimeout, err := parseutil.ParseDurationSecond(sReqTimeout)\n\tif err != nil {\n\t\treturn nil, errwrap.Wrapf(fmt.Sprintf(\"value [%v] of 'request_timeout' could not be understood: {{err}}\", sReqTimeout), err)\n\t}\n\n\tssync, ok := conf[\"sync\"]\n\tif !ok {\n\t\tssync = \"true\"\n\t}\n\tsync, err := strconv.ParseBool(ssync)\n\tif err != nil {\n\t\treturn nil, errwrap.Wrapf(fmt.Sprintf(\"value of 'sync' (%v) could not be understood: {{err}}\", ssync), err)\n\t}\n\n\tif sync {\n\t\tctx, cancel := context.WithTimeout(context.Background(), reqTimeout)\n\t\terr := etcd.Sync(ctx)\n\t\tcancel()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tsLock := conf[\"lock_timeout\"]\n\tif sLock == \"\" {\n\t\t// etcd3 default lease duration is 60s. set to 15s for faster recovery.\n\t\tsLock = \"15s\"\n\t}\n\tlock, err := parseutil.ParseDurationSecond(sLock)\n\tif err != nil {\n\t\treturn nil, errwrap.Wrapf(fmt.Sprintf(\"value [%v] of 'lock_timeout' could not be understood: {{err}}\", sLock), err)\n\t}\n\n\treturn &EtcdBackend{\n\t\tpath: path,\n\t\tetcd: etcd,\n\t\tpermitPool: physical.NewPermitPool(physical.DefaultParallelOperations),\n\t\tlogger: logger,\n\t\thaEnabled: haEnabledBool,\n\t\tlockTimeout: lock,\n\t\trequestTimeout: reqTimeout,\n\t}, nil\n}", "title": "" }, { "docid": "135c6c7f21ab73125305b396b72595ca", "score": "0.46982944", "text": "func NewRTCFG() (RTCFG, error) {\n rtcfg := RTCFG{}\n\n rtcfg.MongoURI = os.Getenv(\"UVEIRA_MONGO_URI\")\n if rtcfg.MongoURI == \"\" {\n return rtcfg, fmt.Errorf(\"please specify UVEIRA_MONGO_URI with the mongodb:// connection string\")\n }\n\n rtcfg.Database = os.Getenv(\"UVEIRA_DATABASE\")\n if rtcfg.Database == \"\" {\n return rtcfg, fmt.Errorf(\"please specify UVEIRA_DATABASE with the database name (e.g. enwiki)\")\n }\n\n rtcfg.Collection = os.Getenv(\"UVEIRA_COLLECTION\")\n if rtcfg.Collection == \"\" {\n return rtcfg, fmt.Errorf(\"please specify UVEIRA_COLLECTION with the collection name (usually pages)\")\n }\n\n return rtcfg, nil\n}", "title": "" }, { "docid": "75f25bdb63779a85d8e11cc220d15ebf", "score": "0.4696257", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (IMUV3Bricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 0}, uid, &internalIPCon, 0, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn IMUV3Bricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionGetAcceleration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetMagneticField] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetAngularVelocity] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetTemperature] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetOrientation] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetLinearAcceleration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetGravityVector] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetQuaternion] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetAllData] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSaveCalibration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetSensorConfiguration] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetSensorConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetSensorFusionMode] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetSensorFusionMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetAccelerationCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetAccelerationCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetMagneticFieldCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetMagneticFieldCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetAngularVelocityCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetAngularVelocityCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetTemperatureCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetTemperatureCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetOrientationCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetOrientationCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetLinearAccelerationCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetLinearAccelerationCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetGravityVectorCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetGravityVectorCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetQuaternionCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetQuaternionCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetAllDataCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetAllDataCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetSPITFPErrorCount] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetBootloaderMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetBootloaderMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetWriteFirmwarePointer] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionWriteFirmware] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetStatusLEDConfig] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetStatusLEDConfig] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetChipTemperature] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionReset] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionWriteUID] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionReadUID] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn IMUV3Bricklet{dev}, nil\n}", "title": "" }, { "docid": "194d7c941f5c1d10301a46082ffbb5a2", "score": "0.46955943", "text": "func newConfig() (*config, error) {\n\twdir, err := os.Getwd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc := &config{\n\t\tPeople: make(PeopleToIdentify),\n\t\tWorkingDir: wdir,\n\t}\n\treturn c, nil\n}", "title": "" }, { "docid": "8d5aac64cec93e27578a32059f098959", "score": "0.46932012", "text": "func New(config interface{}, opts ...Option) error {\n\tif reflect.ValueOf(config).Type().Kind() != reflect.Ptr {\n\t\treturn errors.New(\"pointer is required\")\n\t}\n\to := newOption(opts...)\n\tmanager := &Manager{\n\t\tfile: o.file,\n\t\tconfig: config,\n\t\tapollo: o.apollo,\n\t}\n\n\terr := manager.getConfFromFile()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tif o.apolloSwitch == false {\n\t\treturn nil\n\t}\n\n\terr = manager.getConfFromApollo()\n\treturn err\n}", "title": "" }, { "docid": "28b88d697f770d1891abda1fcc95cd1e", "score": "0.46917772", "text": "func New(email string, token string, provider Provider, keys ...Key) (*Config, error) {\n\tcfg := new(Config)\n\tcfg.Email = email\n\tcfg.Token = token\n\tcfg.Provider = provider\n\tcfg.Keys = keys\n\n\tif err := cfg.Write(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not write initial config\")\n\t}\n\t// read back config to populate metadata\n\treturn Read()\n}", "title": "" } ]
67803825838f0f521473adcdff18f53d
Deprecated: Use WriteBatchResponse.ProtoReflect.Descriptor instead.
[ { "docid": "6baeb964190ff1918034e8e1befba9ca", "score": "0.69695294", "text": "func (*WriteBatchResponse) Descriptor() ([]byte, []int) {\n\treturn file_rpcdb_proto_rawDescGZIP(), []int{15}\n}", "title": "" } ]
[ { "docid": "21f7a76df84d66945cbe069fae732f95", "score": "0.69396067", "text": "func (*WriteBatchRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpcdb_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "600a0434e8d08dde6c029c8f047becaf", "score": "0.66667193", "text": "func (*UpdateBatch) Descriptor() ([]byte, []int) {\n\treturn file_requests_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "c7572401474cb8c1634b71a6491a0cd2", "score": "0.65348804", "text": "func (*DeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_board_proto_board_board_service_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "14f550ad0a4cad7eb2af3b863bb81015", "score": "0.651669", "text": "func (*SdkDiagsCollectResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_api_proto_rawDescGZIP(), []int{209}\n}", "title": "" }, { "docid": "d50f6d2da8953fa13b87d1b89730704d", "score": "0.6510741", "text": "func (*BatchDeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_volume_server_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "ec99bcb490de6f16189c11400b1ab265", "score": "0.64985895", "text": "func (*ClientBatchSubmitResponse) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_client_batch_submit_pb2_client_batch_submit_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "033207780218e17424fbaea1a3a0e148", "score": "0.64717853", "text": "func (*DeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_language_proto_skill_skill_service_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "7d896aa45ed840bec9c087af63642e4a", "score": "0.6435182", "text": "func (*DeleteRelationTuplesResponse) Descriptor() ([]byte, []int) {\n\treturn file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "9d2add533f61da799743eb0227482a24", "score": "0.64327824", "text": "func (*MetricBatchesResponse) Descriptor() ([]byte, []int) {\n\treturn file_determined_api_v1_experiment_proto_rawDescGZIP(), []int{54}\n}", "title": "" }, { "docid": "96363a26d5576765b02391e78e9b1680", "score": "0.6431934", "text": "func (*UpdateResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_board_proto_board_board_service_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "14198f61938f996fd726251277278037", "score": "0.6419982", "text": "func (*BatchRunReportsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_analytics_data_v1alpha_analytics_data_api_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "90acad3f0a3e27f8a34a32e5461fe91f", "score": "0.6419755", "text": "func (*BatchGetPermissionSetsResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_internal_bugs_monorail_api_proto_permissions_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "0e51aabb7e69b3ff4ad7206a0404c200", "score": "0.6403436", "text": "func (*BatchDeleteRequest) Descriptor() ([]byte, []int) {\n\treturn file_volume_server_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "e29ebf0513d26ab6cb71cca13745318d", "score": "0.63959074", "text": "func (*WriteResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_AliasMapProtocol_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "3f92569849dd04813b5f8a28ad38bde1", "score": "0.6384211", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_board_proto_board_board_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "9161a97f7c2fc8e628f033e9dcf4c9ac", "score": "0.6377007", "text": "func (*DeleteRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_board_proto_board_board_service_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "20682afc5b74de734e9b4edbbd417fc4", "score": "0.6375724", "text": "func (*BatchUpdateEntityTypesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dialogflow_v2beta1_entity_type_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "d4379619653c9be8d5b634ab59272186", "score": "0.6365168", "text": "func (*DeleteRecordsResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "9fba0775f29d302d7760124dc757e757", "score": "0.6358973", "text": "func (*BatchGetProjectsResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_devices_proto_v1alpha_project_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "caef3ed6ef5769bec984318695203903", "score": "0.6357772", "text": "func (*BatchImportModelEvaluationSlicesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_aiplatform_v1beta1_model_service_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "6689434707e0e97580251c77d53b7e17", "score": "0.63527685", "text": "func (*ListResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_AliasMapProtocol_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "4926c973a5c17c51a286210bc5639652", "score": "0.63431233", "text": "func (*UpdateStoredInfoTypeRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{129}\n}", "title": "" }, { "docid": "9e6ad4e84b27930a5ce9df6ccc092a93", "score": "0.6342937", "text": "func (*ClientBatchStatusResponse) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_client_batch_submit_pb2_client_batch_submit_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "f9530be07cdb763611546b41322795f7", "score": "0.6340499", "text": "func (*DeleteRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_language_proto_skill_skill_service_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "fdc13a5ccff259d6e35f9dce97223c3a", "score": "0.6323839", "text": "func (*UpdateResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_language_proto_skill_skill_service_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "ba0cb99fd68da32f07ebac501256d027", "score": "0.6321107", "text": "func (*BulkDeleteReply) Descriptor() ([]byte, []int) {\n\treturn file_indexpb_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "d6fd0b2793fd8df590df8671c64ecf9e", "score": "0.6298067", "text": "func (*ListStoredInfoTypesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{132}\n}", "title": "" }, { "docid": "78d70e633f75b56bd96208f882d37e95", "score": "0.62961096", "text": "func (*BatchRunPivotReportsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_analytics_data_v1alpha_analytics_data_api_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "2d9c35fa2558a11a78d863911215b442", "score": "0.62912655", "text": "func (*AddActionsResponse) Descriptor() ([]byte, []int) {\n\treturn file_datastore_v3_proto_rawDescGZIP(), []int{35}\n}", "title": "" }, { "docid": "72255ab4dcf643f02af6ef78bfdb466c", "score": "0.6290651", "text": "func (*BatchGetPodsResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_applications_proto_v1alpha2_pod_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "e0c371143a9125901ee5e0ef7e4752cf", "score": "0.62846607", "text": "func (*ClientBatchStatusRequest) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_client_batch_submit_pb2_client_batch_submit_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "1a120f0ce12ec1af4d4050149a1e095c", "score": "0.6281644", "text": "func (*BulkDeleteReq) Descriptor() ([]byte, []int) {\n\treturn file_indexpb_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "14c06798592a9014082323cb95994b1e", "score": "0.62770945", "text": "func (*DeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_dashboard_api_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "07a1dc66a244a9bd4266f0f873b45b76", "score": "0.6275296", "text": "func (*DeleteStoredInfoTypeRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{133}\n}", "title": "" }, { "docid": "e479c98fef863ca8da9dd4089d85f97e", "score": "0.62618804", "text": "func (*BulkCommissionResponse) Descriptor() ([]byte, []int) {\n\treturn file_bol_api_proto_go_bol_api_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "88b2791382833be025f620b85a77ffad", "score": "0.62600034", "text": "func (*ListTasksResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_batch_v1_batch_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "7125025147a0b687bebe6b8629510dc1", "score": "0.6258917", "text": "func (*ListRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_board_proto_board_board_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "5190fef4238aa26e8b25bedd141283e3", "score": "0.6258899", "text": "func (*ListMetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_carbonapi_v3_pb_carbonapi_v3_pb_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "ca97764af53b89abd05660fb00795a78", "score": "0.62555087", "text": "func (*Batch) Descriptor() ([]byte, []int) {\n\treturn file_person_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "1f1541af8a04298234f97addcc6881f7", "score": "0.6251053", "text": "func (*DeleteRelationTuplesRequest) Descriptor() ([]byte, []int) {\n\treturn file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "8928b245dca94f6a5224c603b25f6c22", "score": "0.6242392", "text": "func (*ExecuteBatchRequest) Descriptor() ([]byte, []int) {\n\treturn file_requests_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "1f828955c84567a66b65f9e2d66d79cf", "score": "0.62385905", "text": "func (*Medication_Batch) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r4_core_resources_medication_proto_rawDescGZIP(), []int{0, 2}\n}", "title": "" }, { "docid": "3bf7363736c19f5eb4bbfe95f949ace3", "score": "0.6237868", "text": "func (*ClientBatchStatus) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_client_batch_submit_pb2_client_batch_submit_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "d14277f7989880b559c6b71942b578e0", "score": "0.6228927", "text": "func (*DeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_datastore_v3_proto_rawDescGZIP(), []int{28}\n}", "title": "" }, { "docid": "a478b851794c1148e8d0e7456988aba8", "score": "0.62286484", "text": "func (*BatchProcessDocumentsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_documentai_v1beta1_document_understanding_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "05b68933b7d257b5612e6b2096f0afe5", "score": "0.6218815", "text": "func (*CancelBatchOrdersResponse) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{70}\n}", "title": "" }, { "docid": "014de142e1400be57eb2d8791e0c572a", "score": "0.62186825", "text": "func (*BatchGetPermissionSetsRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_internal_bugs_monorail_api_proto_permissions_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "f26075c2d01df266d4f7922c96485a0c", "score": "0.62170327", "text": "func (x *fastReflection_MsgTripCircuitBreakerResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgTripCircuitBreakerResponse\n}", "title": "" }, { "docid": "0ff8d18c7115d1ee9c53017e9480cac9", "score": "0.62168837", "text": "func (*MonitoringInfosMetadataResponse) Descriptor() ([]byte, []int) {\n\treturn file_org_apache_beam_model_fn_execution_v1_beam_fn_api_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "4c61ed9a6764a5c458fa5ec09eaed85e", "score": "0.6213189", "text": "func (*UpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_board_proto_board_board_service_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "1d816e1f9935d7b2468c5fe66edde186", "score": "0.62074256", "text": "func (*DatasetUpdateResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_bigquery_logging_v1_audit_data_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "b18246a5c5ad6eb6ee632d3af514e913", "score": "0.6203444", "text": "func (*UpdateResponse) Descriptor() ([]byte, []int) {\n\treturn file_dashboard_api_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "6911e47ec28c207c6a3a913b15dd6e7a", "score": "0.6196139", "text": "func (*QueryRecordsResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_open_saves_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "c6adb10009f10a7c705023637e6e4f97", "score": "0.61929953", "text": "func (*UpdateRecordRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_open_saves_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "2afc42c3afa282954f0590909d484525", "score": "0.6192709", "text": "func (*DeleteRecordRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_open_saves_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "5785f2f0144fa5d0ce11197eb776b9e2", "score": "0.61917484", "text": "func (*WriteRequestProto) Descriptor() ([]byte, []int) {\n\treturn file_AliasMapProtocol_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "4825e2d9c9c4baed298a5e5b596f8651", "score": "0.6184487", "text": "func (*SdkDiagsCollectRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_api_proto_rawDescGZIP(), []int{208}\n}", "title": "" }, { "docid": "5b09d9d6268bf7c9305e58256f9b59d5", "score": "0.618398", "text": "func (*FooResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_kubernetes_csi_csi_proxy_integrationtests_csiapigen_new_group_api_v1alpha1_api_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "f660bc5bd085315c7adced2b05b32886", "score": "0.61801213", "text": "func (*DeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_todo_proto_todo_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "1dfe6db18102063761ea67667ae271cb", "score": "0.6177388", "text": "func (*OperationMetadata) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_batch_v1_batch_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "65505303c73d3b112dec4df6c622ddca", "score": "0.617261", "text": "func (*BatchRunReportsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_analytics_data_v1alpha_analytics_data_api_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "becafb65c8db2a287dee02f60f7081ad", "score": "0.61703944", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_comment_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "bde4a692688bdb7268eb5438532d483e", "score": "0.6166771", "text": "func (*BulkDeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_interservice_nodemanager_nodes_nodes_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "81d136fe0ed95a2a6526e9115b10e23d", "score": "0.6164779", "text": "func (*CreateResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_board_proto_board_board_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "bbdd8f2c868061f854bc44f0f8c59bde", "score": "0.61646384", "text": "func (*DeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_url_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "dc3a69052a4a78b5a90f249cbda96f74", "score": "0.6162764", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_dashboard_api_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "25fad68cf1e683e2e9a738df3949158c", "score": "0.61619794", "text": "func (*UpdateExplanationDatasetResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_aiplatform_v1beta1_model_service_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "137e8012a065127c022c7c00bf23a546", "score": "0.6156891", "text": "func (*ListResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_language_proto_skill_skill_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "45245285de1a86b93140314bdf02ae31", "score": "0.61540216", "text": "func (*BatchUpdateEntitiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dialogflow_v2beta1_entity_type_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "6b5125e6aaf138b452378aec1e5b250f", "score": "0.61456704", "text": "func (*UpdateGroupResponse) Descriptor() ([]byte, []int) {\n\treturn file_determined_api_v1_group_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "2534b1b1b4b994a3e51cc64f7be7aef7", "score": "0.6143901", "text": "func (x *fastReflection_MsgResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgResponse\n}", "title": "" }, { "docid": "c601097efb259f092e3f6cbc4b2e0cae", "score": "0.61417806", "text": "func (*BatchRunPivotReportsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_analytics_data_v1alpha_analytics_data_api_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "de4a1207da9d8d62059f79c0d6428448", "score": "0.61399865", "text": "func (*ExportDocumentsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_firestore_admin_v1_operation_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "35276ef898ae41852a2ce2fe44c0b250", "score": "0.61389047", "text": "func (*TurnInPlaceResponse) Descriptor() ([]byte, []int) {\n\treturn file_messages_proto_rawDescGZIP(), []int{86}\n}", "title": "" }, { "docid": "df54521249d42df058a37e1f29aff8ed", "score": "0.61384225", "text": "func (*MultiMetricsInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_carbonapi_v3_pb_carbonapi_v3_pb_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "1070af54425923e941019b4a96917c9b", "score": "0.61376613", "text": "func (*MetricBatchesRequest) Descriptor() ([]byte, []int) {\n\treturn file_determined_api_v1_experiment_proto_rawDescGZIP(), []int{53}\n}", "title": "" }, { "docid": "d5fb01906d5eb9b493813679bc7b6541", "score": "0.61369306", "text": "func (*BulkCommissionRequest) Descriptor() ([]byte, []int) {\n\treturn file_bol_api_proto_go_bol_api_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "aa014e7847349910212e1e6d9b1114a2", "score": "0.6134098", "text": "func (*ListRequestProto) Descriptor() ([]byte, []int) {\n\treturn file_AliasMapProtocol_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "b2be71ecc92cce3cf76235105d209e74", "score": "0.61274266", "text": "func (*ListTargetGroupOperationsResponse) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_apploadbalancer_v1_target_group_service_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "ed6228f53435b77f7d132e85e71afc6e", "score": "0.6126816", "text": "func (*RuleDeleteResponse) Descriptor() ([]byte, []int) {\n\treturn file_automate_gateway_api_notifications_notifications_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "0654ded40a49244c810cb7bb01f412ab", "score": "0.6125538", "text": "func (*UpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_language_proto_skill_skill_service_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "f9d38b1227abe84589d425f0154014ff", "score": "0.6124886", "text": "func (*DeleteCategoryResponse) Descriptor() ([]byte, []int) {\n\treturn file_grpc_proto_category_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "a7a4f9eb7b798b0fc93c64ff37861a6b", "score": "0.61224717", "text": "func (*DeleteStudioRequestResponse) Descriptor() ([]byte, []int) {\n\treturn file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "01b426b5d42c99dd15a020a1e62df598", "score": "0.61224586", "text": "func (*UpdateRecordRequest) Descriptor() ([]byte, []int) {\n\treturn file_open_saves_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "cf6c8c354eb993e2dbdade279462ac6d", "score": "0.612226", "text": "func (*ListMetricsResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_orchestrator_orchestrator_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "49209274419cb84b38fa1e2902f33d2f", "score": "0.61221737", "text": "func (*DeleteFriendInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_firend_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "0723e57b45baa11c88a6bce1b9ecfa20", "score": "0.61212444", "text": "func (*MergeDLQMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_history_v1_service_proto_rawDescGZIP(), []int{75}\n}", "title": "" }, { "docid": "70a05664815a635ced3fd0a17aaa572b", "score": "0.6119637", "text": "func (*CMsgDOTARequestBatchPlayerResourcesResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_server_proto_rawDescGZIP(), []int{29}\n}", "title": "" }, { "docid": "6cfdc0b9bcd0409e5793d8bea3dc7192", "score": "0.6117546", "text": "func (*ListInfoTypesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{39}\n}", "title": "" }, { "docid": "a8ffe1d543e94b85731be76d4aee051c", "score": "0.6112593", "text": "func (*RuleUpdateResponse) Descriptor() ([]byte, []int) {\n\treturn file_automate_gateway_api_notifications_notifications_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "7acc24b9624b471247eab71ddb54d99a", "score": "0.6102567", "text": "func (*ListRecordsResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "7929040ef39e420f44b8bc1043e121e1", "score": "0.6099436", "text": "func (*BulkPropertiesResponse) Descriptor() ([]byte, []int) {\n\treturn file_v1_properties_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "dcbc6855281d696a63a9167537c60017", "score": "0.60983676", "text": "func (*BulkDetailsResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_playstore_playstore_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "deba0c4fcb4f149c290a1da589078283", "score": "0.60980314", "text": "func (*AddGroupMembersResp) Descriptor() ([]byte, []int) {\n\treturn file_logic_ext_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "e2ed21792a474ec4e3dc27b99a0d72ef", "score": "0.6097808", "text": "func (*BatchGetPodsRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_applications_proto_v1alpha2_pod_service_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "1b17b8acc72825369c5d3b446091daf2", "score": "0.6094307", "text": "func (*QueryRecordsResponse) Descriptor() ([]byte, []int) {\n\treturn file_open_saves_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "072b2518035c76c30bc6bac11a226612", "score": "0.6093604", "text": "func (*BatchCommitWriteStreamsResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_bigquery_storage_v1beta2_storage_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "6f140bd7f1047eb97c82b23394f94a96", "score": "0.60929036", "text": "func (*DeleteTargetResponse) Descriptor() ([]byte, []int) {\n\treturn file_filter_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "4ea6bdb7c785cb9c703a511e94697f53", "score": "0.6092874", "text": "func (x *fastReflection_QueryPoolResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryPoolResponse\n}", "title": "" }, { "docid": "3c4f3d42080ed64a781a32118e5db96f", "score": "0.6088127", "text": "func (*TransactRelationTuplesResponse) Descriptor() ([]byte, []int) {\n\treturn file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" } ]
6fe5f57c689f56c77d6b4f93bb027f8b
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
[ { "docid": "f3b809c882b9e1fac93add7f3af3ef05", "score": "0.0", "text": "func (c *ProjectsLocationsRuntimesSwitchCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" } ]
[ { "docid": "e6b827481d014f858a8a22260a9a1cb3", "score": "0.7330852", "text": "func (c *PermissionsCreateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "74af8ff0e293ac96e42ab5d9fcb082d1", "score": "0.7255515", "text": "func (c *RevisionsUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "e13569aeb60bc99f57572a541f963b92", "score": "0.7252598", "text": "func (c *FilesCreateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "e270ac89e56263352b7e8e237cd07964", "score": "0.7242401", "text": "func (c *StatesUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "9a89bed94292c31e9543e9bab5e5753b", "score": "0.7233513", "text": "func (c *PermissionsUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "5493ee5399712cd417206cae8beaf87f", "score": "0.7200771", "text": "func (r *Request) Header(header http.Header) *Request {\n\tr.header = header\n\treturn r\n}", "title": "" }, { "docid": "b4d1c8697e2e11f3a2c3e2eee36d6f9b", "score": "0.71910787", "text": "func (c *TypeProvidersUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "d15d982ad0e4e569243d4e6c0bededc3", "score": "0.71850395", "text": "func (c *StatsGetUserCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "2be8f3b46d2e2e9725011f3d06134e0e", "score": "0.7178873", "text": "func (r *Request) Header() http.Header {\n\treturn r.header\n}", "title": "" }, { "docid": "ace64ada0cbbaed9e5402189980990f9", "score": "0.71705574", "text": "func (c *RevisionsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "0074e863f9ec396f23b2f40e39dc3eec", "score": "0.71603835", "text": "func (c *SitesAddCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "e10349dda9faa986e8819dd8ce7b65cd", "score": "0.71519315", "text": "func (c *FilesUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "8fa05e13f3cf15344c55f1c8c5fe8fde", "score": "0.7148584", "text": "func (c *StatesGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "f0a27f700a96d3fc97fdb63d277b99bd", "score": "0.7143761", "text": "func (c *OperationsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "f0a27f700a96d3fc97fdb63d277b99bd", "score": "0.7143761", "text": "func (c *OperationsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "f0a27f700a96d3fc97fdb63d277b99bd", "score": "0.7143761", "text": "func (c *OperationsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "f0a27f700a96d3fc97fdb63d277b99bd", "score": "0.7143761", "text": "func (c *OperationsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "dd90aeb63289ddb41c18a843c30f958e", "score": "0.7138789", "text": "func (c *PermissionsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "c421298e1efb81bb5e7a0b7a4454e405", "score": "0.71335423", "text": "func (req *HTTPRequest) Header(key, value string) *HTTPRequest {\n\tif req.customHeaders == nil {\n\t\treq.customHeaders = make(map[string]string)\n\t}\n\n\treq.customHeaders[key] = value\n\n\treturn req\n}", "title": "" }, { "docid": "3bf6400e0ba2e48b2aabc3e5327fa302", "score": "0.7112589", "text": "func (c *FilesCopyCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "dee4d74e2db361f60ca29d11da6d8af1", "score": "0.710953", "text": "func (c *DeploymentsSetIamPolicyCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "5ebe62b52b07f0a753395bdcdec615ae", "score": "0.71082085", "text": "func (c *ProjectsIapWebTestIamPermissionsCall) Header() http.Header {\r\n\tif c.header_ == nil {\r\n\t\tc.header_ = make(http.Header)\r\n\t}\r\n\treturn c.header_\r\n}", "title": "" }, { "docid": "c2bdb0d6823b2427a6d8dfabcdea476d", "score": "0.70984715", "text": "func (c *CompositeTypesUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "cc4883c9fa26c3a75996dede23f46ca6", "score": "0.70954394", "text": "func (c *EventsRecordCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "dc22b005b4dc2441ee400af0a515db57", "score": "0.7087777", "text": "func (c *EventsListByPlayerCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "2c5cef898634e5eefb54933d2d8782ea", "score": "0.7084268", "text": "func (c *FilesGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "a592b94060e11f7bd8c72cd7c389612a", "score": "0.70802504", "text": "func (c *TypeProvidersPatchCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "a9983f48debd57d973491c09124dddca", "score": "0.7078986", "text": "func (c *DrivesUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "9c22376858e9c29cb0aa9873bcda4b78", "score": "0.70734817", "text": "func (c *ProjectsSetAclCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "987f05c8b9fe98dd89dafe58b6c56725", "score": "0.7072876", "text": "func (c *AccountsCreativesUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "7edc2644130bf6faa80f8b5a455170e8", "score": "0.7072588", "text": "func (c *LabelsRevisionsUpdatePermissionsCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "bd8a7691b4433975819f2ead4967e17e", "score": "0.7069886", "text": "func (c *RevisionsCheckCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "f43b5b4cdc7085b78b3a91bb204899dd", "score": "0.70651466", "text": "func (c *LabelsRevisionsPermissionsCreateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "c86fc4ae03a48b19c11bd98ae3718fed", "score": "0.70640403", "text": "func (c *ProjectsLocationsInstancesIsUpgradeableCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "b72c7449c2f0ea865ac63b7c731b6ce6", "score": "0.7062275", "text": "func (c *UsersGetCapabilitiesCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "8f3e86a07c07827f0e6514bf9dc8c93c", "score": "0.7056135", "text": "func Header(name, value string) {\n\tDecorateHandler(http.HandlerFunc(func(w http.ResponseWriter, request *http.Request) {\n\t\tw.Header().Add(name, value)\n\t}), NoopHandler)\n}", "title": "" }, { "docid": "92c155eee2c795126c4c6a0b153ef9cd", "score": "0.70555747", "text": "func (c *MediaUploadCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "92c155eee2c795126c4c6a0b153ef9cd", "score": "0.70555747", "text": "func (c *MediaUploadCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "30d01db387f28895067e24b91885bd2f", "score": "0.7053564", "text": "func (r *Request) Header(key, value string) *Request {\n\tr.header.Set(key, value)\n\treturn r\n}", "title": "" }, { "docid": "767e9cb171bd0f89b4dde9be4690ec46", "score": "0.70527107", "text": "func Header(key, value string) RequestMutation {\n\treturn func(req *http.Request) (*http.Request, error) {\n\t\treq.Header.Add(key, value)\n\t\treturn req, nil\n\t}\n}", "title": "" }, { "docid": "12f6ae65dbfc2c52c1d84c514f952f30", "score": "0.70526946", "text": "func (c *StatsGetSearchapplicationCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "05eb817f965e343176c0251ed74cc1e0", "score": "0.705246", "text": "func (c *RepliesCreateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "1e9c3e5604735fdcf573f22e5450b051", "score": "0.705142", "text": "func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "2c40e35b3e56ded4f9b791e6b7bfee2d", "score": "0.70509005", "text": "func (c *StatsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "3548cee6df2bea897ea4be97271aaf5d", "score": "0.70503855", "text": "func (c *ManifestsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "5ea3bd71dba666966551fb774d149652", "score": "0.70503217", "text": "func (c *DrivesCreateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "9ab60fdc14b869305e209c4f98981fb3", "score": "0.7047544", "text": "func (c *ChangesWatchCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "a9b356c2b96da3aade896d848467461d", "score": "0.7047066", "text": "func (l *httpInfo) Header() http.Header {\n\treturn l.w.Header()\n}", "title": "" }, { "docid": "c3ede8caa85ac40b1df01d72264eb36f", "score": "0.70444363", "text": "func (c *ServicesCheckCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "c3ede8caa85ac40b1df01d72264eb36f", "score": "0.70444363", "text": "func (c *ServicesCheckCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "b2d3e655f40bf027d653b46daa33a2b2", "score": "0.7037972", "text": "func (c *ProjectsIapWebSetIamPolicyCall) Header() http.Header {\r\n\tif c.header_ == nil {\r\n\t\tc.header_ = make(http.Header)\r\n\t}\r\n\treturn c.header_\r\n}", "title": "" }, { "docid": "a6dd8ec61aaaf9cdc8e30c4f9efcacdd", "score": "0.7032859", "text": "func (c *AccountsCreativesWatchCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "e26cdeee054c54247ef16fe2c2192544", "score": "0.70316297", "text": "func (c *DeploymentsUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "31b09acc87a4d0a1954f5ad45981c9ab", "score": "0.70315695", "text": "func (c *FilesEmptyTrashCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "0770e1e2e2d4c0075a4cabe5e981febd", "score": "0.702751", "text": "func (c *CseListCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "0667aacb3384a5b3d988ed324c02edcb", "score": "0.7021998", "text": "func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "7aaddcb627e965b55696f91b5df2a165", "score": "0.70208895", "text": "func (c *StatsGetIndexCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "b73ea26b5ed53d6986ae0d964f5278ae", "score": "0.70124286", "text": "func (c *ProjectsIapWebServicesTestIamPermissionsCall) Header() http.Header {\r\n\tif c.header_ == nil {\r\n\t\tc.header_ = make(http.Header)\r\n\t}\r\n\treturn c.header_\r\n}", "title": "" }, { "docid": "f90bb8bf3d44176900f0baff836d16e9", "score": "0.7008884", "text": "func (c *StatsGetSessionCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "3c2e330bb158f67cb03ba158ec82f5c2", "score": "0.7007221", "text": "func (c *AboutGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "25cd1f5b23f467e4eb90e4b1134f19ec", "score": "0.70066", "text": "func (c *StatesListCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "d849bc3edf6cb0277cb4d3849ee9fb94", "score": "0.7005702", "text": "func (c *FilesWatchCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "4b8d74721c796252cf2af302d8dde8ce", "score": "0.6999127", "text": "func (c *TypeProvidersInsertCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "9430a79aacc64b0185da24fd4f35f4ca", "score": "0.6998314", "text": "func (c *ProjectsIapWebServicesVersionsSetIamPolicyCall) Header() http.Header {\r\n\tif c.header_ == nil {\r\n\t\tc.header_ = make(http.Header)\r\n\t}\r\n\treturn c.header_\r\n}", "title": "" }, { "docid": "1ee12dde879956070634779f7dcfe070", "score": "0.699611", "text": "func (c *SnapshotsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "3306b592f3b6bf9adef0baeb985af778", "score": "0.6994843", "text": "func (c *FilesExportCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "fd0ecbbccb63adef0694e7c50c9aa626", "score": "0.69912463", "text": "func (c *ProjectsIapWebServicesSetIamPolicyCall) Header() http.Header {\r\n\tif c.header_ == nil {\r\n\t\tc.header_ = make(http.Header)\r\n\t}\r\n\treturn c.header_\r\n}", "title": "" }, { "docid": "93c652f2e46a95b4f765c151f8040890", "score": "0.69855976", "text": "func (c *LabelsUpdatePermissionsCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "c97df548baa8585c3425ef1a81619237", "score": "0.69839483", "text": "func (c *QuerySearchCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "79799d91a44b744a0420bb8a7be5a219", "score": "0.69827193", "text": "func (cli *HTTPClient) Header(key, value string) *HTTPClient {\n\tif cli.customHeaders == nil {\n\t\tcli.customHeaders = make(map[string]string)\n\t}\n\n\tcli.customHeaders[key] = value\n\n\treturn cli\n}", "title": "" }, { "docid": "d1c955a61bbdc5fcd0b4ece280a23354", "score": "0.69802386", "text": "func (c *TeamdrivesUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "77121f3ae4a9a6b0cbf4be61a88dd262", "score": "0.69785", "text": "func (c *RepliesUpdateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "1e965d9d1db6ab6363a0cd356ada5c7b", "score": "0.6974997", "text": "func (r *Request) Header(k, v string) *Request {\n\tif r == nil || r.req == nil {\n\t\treturn nil\n\t}\n\tr.req.Header.Set(k, v)\n\treturn r\n}", "title": "" }, { "docid": "98e7ca5b4be966ebc83e9a3b276c8dc5", "score": "0.69749665", "text": "func (c *DeploymentsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "53b251b637e9dfcf9f469aabeccce8a2", "score": "0.69739825", "text": "func (c *ProjectsIapWebServicesVersionsTestIamPermissionsCall) Header() http.Header {\r\n\tif c.header_ == nil {\r\n\t\tc.header_ = make(http.Header)\r\n\t}\r\n\treturn c.header_\r\n}", "title": "" }, { "docid": "53e3692c6f5f3696ec593de6d742c147", "score": "0.6973787", "text": "func (c *LabelsPermissionsCreateCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "5a47aab919aea95f43804f147c065f87", "score": "0.69692117", "text": "func (c *SettingsUpdateCustomerCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "b4991d5d897eb5b73b35848fc9a1a7bb", "score": "0.69691753", "text": "func (c *AchievementsIncrementCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "af55d7e3d91cea06ec360ec455e3b180", "score": "0.6965319", "text": "func (w *mossResponseWriter) Header() http.Header {\n\tif w.headers == nil {\n\t\tw.headers = w.w.Header()\n\t}\n\treturn w.headers\n}", "title": "" }, { "docid": "0d8e534ce5f9e941805588fb5033c73c", "score": "0.69650507", "text": "func (c *DeploymentsInsertCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "8fcf04b626c40dadce8e11353fad27d2", "score": "0.69646764", "text": "func (c *DeploymentsTestIamPermissionsCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "d5bee058c0ed2e7a41212eb6ad579326", "score": "0.6962975", "text": "func (c *ManifestsListCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "0d3fee50e002cd1fe779e550477cdecc", "score": "0.69610775", "text": "func (c *LabelsUpdateLabelCopyModeCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "c3ad2deb44e8f98706835c01f15f017f", "score": "0.69606763", "text": "func (c *DrivesGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "92c8a584c1d317703ac286df01eadd23", "score": "0.69583976", "text": "func (c *ProjectsLocationsMeshesSetIamPolicyCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "e12436b6c8ef9be152170c47450caba5", "score": "0.69552577", "text": "func (c *LabelsDeltaCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "4af5016f856a48ed2f25acf5bcc3f112", "score": "0.6954004", "text": "func (c *StatesDeleteCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "a2a109997f7c3b7b5e7270acb353b75e", "score": "0.69528335", "text": "func (c *OperationsDeleteCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "ed3bc1bb493fe234764691c11daf50ad", "score": "0.6951633", "text": "func (c *ChangesGetStartPageTokenCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "7d16098c89f3c6d2490970c527379d18", "score": "0.6949505", "text": "func (c *ApplicationsGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "c78edee9a5ffb55dca3ddffddfa0f44d", "score": "0.69470274", "text": "func (c *StatsGetQueryCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "7392bbce4dcb667c84161aab1780e914", "score": "0.6943345", "text": "func (c *AccountsRegisterCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "1a934d2196c666b81aa3fade2032c7df", "score": "0.69432104", "text": "func (c *RevisionsDeleteCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "be583ba06ad612862c0ad63929310e03", "score": "0.6940854", "text": "func (c *PawsRegisterCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "5bd93163484c232c41cbc87b09bb24bd", "score": "0.69363326", "text": "func Header(name, value string) Decorator {\n\treturn func(c Client) Client {\n\t\treturn ClientFunc(func(r *http.Request) (*http.Response, error) {\n\t\t\tr.Header.Add(name, value)\n\t\t\treturn c.Do(r)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "8e083b782b3fdcaade89d7d6797cb9da", "score": "0.6933404", "text": "func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "8a836ff88cef0d828c115dea2e6cfccc", "score": "0.6931692", "text": "func (c *PlayersGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "81c4844a1cdbf8e993eea05a17f3f50e", "score": "0.6930854", "text": "func (c *ResourcesGetCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "5bf656455dfd8deacbd23024583d67dc", "score": "0.6929455", "text": "func (c *AccountsCreativesStopWatchingCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "8a646d279f74c39e1e035eea909339c3", "score": "0.6929109", "text": "func (c *SearchanalyticsQueryCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "53a6822b0aab8c62b33ebb9bc27f34c1", "score": "0.6928876", "text": "func (c *OperationsCancelCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" } ]
c65fcf4c664248c00cfca982ec13d578
Deprecated: Use StoredBottle.ProtoReflect.Descriptor instead.
[ { "docid": "0738c81eaf09c39fc9b12b5fa1d95283", "score": "0.0", "text": "func (*StoredBottle) Descriptor() ([]byte, []int) {\n\treturn file_goadesign_goagen_storage_proto_rawDescGZIP(), []int{2}\n}", "title": "" } ]
[ { "docid": "92d2a11771696b691d7a6174818f76ad", "score": "0.72209054", "text": "func (desc *immutable) DescriptorProto() *descpb.Descriptor {\n\treturn &descpb.Descriptor{\n\t\tUnion: &descpb.Descriptor_Type{\n\t\t\tType: &desc.TypeDescriptor,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "dd440b8d86dbd6bebe8eb008acefd3d8", "score": "0.71291745", "text": "func (*DeprecatedMessage) Descriptor() ([]byte, []int) {\n\treturn file_cmd_protoc_gen_go_testdata_comments_deprecated_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "11c0cfceb8f96997fddfcc315e13f95a", "score": "0.6804899", "text": "func (*NetworkProxy) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_provenance_api_spikepb_ids_inspect_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "21e0bb1621f0146605e8848ae6d99dab", "score": "0.6744972", "text": "func (*ProtocolSignatureProto) Descriptor() ([]byte, []int) {\n\treturn file_ProtocolInfo_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "18e9d01724e99c49655da40e52d1b80b", "score": "0.67303133", "text": "func (*DisconnectReq) Descriptor() ([]byte, []int) {\n\treturn file_api_logic_grpc_api_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "059d90cc90c5978386e9e190c2636e92", "score": "0.6715581", "text": "func (*Details) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_provenance_api_spikepb_ids_inspect_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "2d80d16f9a50e76db8d36e9f3ee93bb6", "score": "0.6700672", "text": "func (*TokenProto) Descriptor() ([]byte, []int) {\n\treturn file_preprocess_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "898ac189e415f61a9391db0dc973003a", "score": "0.6700112", "text": "func (*GetProtocolSignatureResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ProtocolInfo_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "745646d2aecf3c4af811f7649f49b099", "score": "0.66865987", "text": "func (DeprecatedEnum) EnumDescriptor() ([]byte, []int) {\n\treturn file_cmd_protoc_gen_go_testdata_comments_deprecated_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "fdb297920f6d32c676ce0212ce606cc3", "score": "0.6676477", "text": "func (*Wrapper) Descriptor() ([]byte, []int) {\n\treturn file_tests_enum_enum_renames_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "417be51712d9ccb2a429fa1c244c055a", "score": "0.6673349", "text": "func (*TypedObjectRef) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_skv2_api_core_v1_core_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "a14766fe251150d8600e50cc6b27166b", "score": "0.6635757", "text": "func (*Type) Descriptor() ([]byte, []int) {\n\treturn file_go_pkg_beam_core_runtime_graphx_v1_v1_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "0a3b50eeb6988eda97d7b807d39aba5b", "score": "0.6630024", "text": "func (*GetProtocolVersionsResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ProtocolInfo_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "b2a024126e3e2eb715f00b0593d90d75", "score": "0.6617343", "text": "func (*RuntimeDouble) Descriptor() ([]byte, []int) {\n\treturn file_envoy_api_v2_core_base_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "981ef13d457171f3ac6b9545a7ab2ed7", "score": "0.6616903", "text": "func (*RuntimeUInt32) Descriptor() ([]byte, []int) {\n\treturn file_envoy_api_v2_core_base_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "12c1c5f2f85569ef22a11f9389796e81", "score": "0.6609896", "text": "func (*OnlineWrapperDto) Descriptor() ([]byte, []int) {\n\treturn file_online_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "206dd6ac509534f682d4c3e23d6010eb", "score": "0.6590433", "text": "func (*GetTeamRequest) Descriptor() ([]byte, []int) {\n\treturn file_transport_grpc_proto_soccer_soccer_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "45b6c84437a086a4c9164c1f2d234d43", "score": "0.65848494", "text": "func (*Name) Descriptor() ([]byte, []int) {\n\treturn file_models_greet_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "0aa6bac39f216fe653ecd16e7d7af4a1", "score": "0.6576481", "text": "func (*People) Descriptor() ([]byte, []int) {\n\treturn file_grpc_pb_myproto_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "cb9d05f670230a75dc7cd9c1d1b147a9", "score": "0.6566809", "text": "func (*OnlineWrapperDto_OnlineDto) Descriptor() ([]byte, []int) {\n\treturn file_online_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "25eef79e7b449084586bd4c2e5c8895e", "score": "0.6562443", "text": "func (*CustomInfoType_DetectionRule) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_storage_proto_rawDescGZIP(), []int{3, 3}\n}", "title": "" }, { "docid": "6a1930305cb28ee2e6eadd6d2dee3895", "score": "0.6559661", "text": "func (*BotGet) Descriptor() ([]byte, []int) {\n\treturn file_chat_bot_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "fae60da952a10a13c8287469614c19da", "score": "0.6546601", "text": "func (*Metadata) Descriptor() ([]byte, []int) {\n\treturn file_envoy_api_v2_core_base_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "69e11bebbda8b435f3af708d72382bcd", "score": "0.6538251", "text": "func (*BotRecall) Descriptor() ([]byte, []int) {\n\treturn file_chat_bot_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "3686b391ce20167ff328350039aff37a", "score": "0.65378964", "text": "func (*UpdateTelemetryReportedRequest) Descriptor() ([]byte, []int) {\n\treturn file_external_cfgmgmt_request_telemetry_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "afd26a126cd3d75885353cde0718d093", "score": "0.6536566", "text": "func (*NetProtocolInfos) Descriptor() ([]byte, []int) {\n\treturn file_p2pnext_proto_rawDescGZIP(), []int{43}\n}", "title": "" }, { "docid": "0b4a9eca05aa0605fffa5ea50f3a53dd", "score": "0.6535725", "text": "func (*DynFn) Descriptor() ([]byte, []int) {\n\treturn file_go_pkg_beam_core_runtime_graphx_v1_v1_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "df5187a7a50b46904deb2b27230469c0", "score": "0.65346783", "text": "func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUpdateParams\n}", "title": "" }, { "docid": "6bcdd3c66a38a8a21ac40048f7022ce2", "score": "0.6533456", "text": "func (*DisableStaticRuleRequest) Descriptor() ([]byte, []int) {\n\treturn file_policydb_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "eafc710b36fa855f95af951cdb7457bf", "score": "0.6532588", "text": "func (sd *ServiceDescriptor) AsProto() proto.Message {\n\treturn sd.proto\n}", "title": "" }, { "docid": "3caf65a6dee84b066afe84cc3de79045", "score": "0.6523232", "text": "func (*ProtocolInfo) Descriptor() ([]byte, []int) {\n\treturn file_p2pnext_proto_rawDescGZIP(), []int{44}\n}", "title": "" }, { "docid": "5f14d7f7d3d193a702dbd328fad8820f", "score": "0.65187305", "text": "func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_Params\n}", "title": "" }, { "docid": "9890451e35b66925dd01984081d39cc1", "score": "0.6511303", "text": "func (*BotRecalled) Descriptor() ([]byte, []int) {\n\treturn file_chat_bot_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "8f2d91a52cbd38b3dd506ef972ea618d", "score": "0.65108854", "text": "func (*StoredType) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_storage_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "85cc523466e92e828a65fa20e3160008", "score": "0.64945513", "text": "func (*Peer) Descriptor() ([]byte, []int) {\n\treturn file_ligato_vpp_wireguard_wireguard_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "5181049a80e0d0c816fc5f2815763eae", "score": "0.6491223", "text": "func (*Trust) Descriptor() ([]byte, []int) {\n\treturn file_v2_reputation_grpc_types_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "35071c6a67d4afe9bf60911ec2f120e0", "score": "0.64882636", "text": "func (*Disconnect) Descriptor() ([]byte, []int) {\n\treturn file_proto_cmd_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "2757410b2f7d20e42496e413a0d461c6", "score": "0.64856285", "text": "func (*Blacklist) Descriptor() ([]byte, []int) {\n\treturn file_p2pnext_proto_rawDescGZIP(), []int{45}\n}", "title": "" }, { "docid": "16440c01705f2f58a8a661ce563c10c3", "score": "0.6479062", "text": "func (*P4NewTypeTranslation) Descriptor() ([]byte, []int) {\n\treturn file_p4_config_v1_p4types_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "0076cda4cc2ab00f43720a4ccd26b6c8", "score": "0.6478499", "text": "func (*WatchRequest) Descriptor() ([]byte, []int) {\n\treturn file_deals_rpc_rpc_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "cf9b29647f5bb8ad7ac957c89476b493", "score": "0.6466386", "text": "func (x *fastReflection_ResolverInfo) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ResolverInfo\n}", "title": "" }, { "docid": "b516ec9ccf2064e4cd28e254c78e73c3", "score": "0.64653456", "text": "func (*InjectPayload) Descriptor() ([]byte, []int) {\n\treturn file_go_pkg_beam_core_runtime_graphx_v1_v1_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "0c4b6f216c934ad97fef167cdd0d9623", "score": "0.6462269", "text": "func (*Metadata) Descriptor() ([]byte, []int) {\n\treturn file_proto_messages_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "90bd723f0c8a578dd528bf003d5c4f8f", "score": "0.64604324", "text": "func (*ConnectReq) Descriptor() ([]byte, []int) {\n\treturn file_api_logic_grpc_api_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "4865326ab5e64c56349d19dc7ba484cc", "score": "0.6457106", "text": "func (*LogDescriptorChange_Removed) Descriptor() ([]byte, []int) {\n\treturn edgelq_logging_proto_v1alpha2_log_descriptor_change_proto_rawDescGZIP(), []int{0, 3}\n}", "title": "" }, { "docid": "fa561db20e3eab5383b7069ad1d4e8c1", "score": "0.64568514", "text": "func (*Demo_Internal) Descriptor() ([]byte, []int) {\n\treturn file_example_proto_demo_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "8e0040537ca61fd8c4e1e230aa1f33a3", "score": "0.6455919", "text": "func (*SetLogLevelRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_debug_debug_api_debug_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "fe037f1c2408fd926245e88c9eed195b", "score": "0.64556026", "text": "func (*CMsgGCtoServerTensorflowInstance) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_server_proto_rawDescGZIP(), []int{77}\n}", "title": "" }, { "docid": "d6295b5c9ca51ce86507f8f4329e7e3b", "score": "0.6455594", "text": "func (*WatchRequest) Descriptor() ([]byte, []int) {\n\treturn file_deals_rpc_rpc_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "f4942082fe38ad42448e634459680f7f", "score": "0.64545685", "text": "func (*BotToken) Descriptor() ([]byte, []int) {\n\treturn file_chat_bot_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "dca3584506c0b71e91cd7f46697bb939", "score": "0.6454519", "text": "func (*Tmember) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_team_CreateTeam_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "4999c99b2e137f059a9b8be26e7c1886", "score": "0.64508283", "text": "func (*Disconnect) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "9b60f909282ddde70769e4bbc478c5d3", "score": "0.6449931", "text": "func (*OnlineReq) Descriptor() ([]byte, []int) {\n\treturn file_api_logic_grpc_api_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "8c7127cc354f7c6fcc26765e95c460c2", "score": "0.64458025", "text": "func (*Rule) Descriptor() ([]byte, []int) {\n\treturn file_build_proto_build_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "af3b2fa4ef14f4155df7881bd62a1442", "score": "0.64420605", "text": "func (*TcpProxy_DeprecatedV1) Descriptor() ([]byte, []int) {\n\treturn file_envoy_config_filter_network_tcp_proxy_v2_tcp_proxy_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "f7785a68c1a58420b0cde0b26a88b587", "score": "0.6439695", "text": "func (*NotifyFriendChange) Descriptor() ([]byte, []int) {\n\treturn file_liqi_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "ad85cb8487299d7ff602e1d109f4662d", "score": "0.6436952", "text": "func (*GetDelegationTokenResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_OmClientProtocol_proto_rawDescGZIP(), []int{112}\n}", "title": "" }, { "docid": "2da74649a777aff4583c22ba371c4653", "score": "0.64368016", "text": "func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) {\n\treturn file_kythe_proto_metadata_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "26db23e4059e501485bc2ae60d383492", "score": "0.643633", "text": "func (*ModelVersionListProto) Descriptor() ([]byte, []int) {\n\treturn file_metadata_service_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "669eb8635f9446af7f22304381808363", "score": "0.6435737", "text": "func (*Trickle) Descriptor() ([]byte, []int) {\n\treturn file_proto_rtc_rtc_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "3e45950181e9d4f9a680744f1694d55e", "score": "0.6434459", "text": "func (*Fn) Descriptor() ([]byte, []int) {\n\treturn file_go_pkg_beam_core_runtime_graphx_v1_v1_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "cb58403e22b1f3af43e34530318a2183", "score": "0.6433742", "text": "func (*VersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_debug_debug_api_debug_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "868f771e5f77b231de12d4a26b2debd8", "score": "0.6425099", "text": "func (*GetProtocolSignatureRequestProto) Descriptor() ([]byte, []int) {\n\treturn file_ProtocolInfo_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "ffe6a30bbf61a6e91083b56fb3e55ace", "score": "0.6423872", "text": "func (*TeamDemote) Descriptor() ([]byte, []int) {\n\treturn file_team_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "f21a053ece190732bc02481cf63780ff", "score": "0.6423127", "text": "func (*SetPeer) Descriptor() ([]byte, []int) {\n\treturn file_p2pnext_proto_rawDescGZIP(), []int{49}\n}", "title": "" }, { "docid": "f667d77953e96651ae47c092e71cf3e9", "score": "0.6423056", "text": "func (*TestUpdatedAuthInfo) Descriptor() ([]byte, []int) {\n\treturn file_testpb_unknonwnproto_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "ab5eee9d34af335d4d8e4e2da8bdd26c", "score": "0.6421879", "text": "func (x *fastReflection_LastValidatorPower) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_LastValidatorPower\n}", "title": "" }, { "docid": "4c5f53465a0a3470c1f2dcd91c782b1f", "score": "0.6420625", "text": "func (*CreateTeamReq) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_team_CreateTeam_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "fc3be3285dca5e8d166a69a2c876691b", "score": "0.6414166", "text": "func (*Message7843) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_1_proto_rawDescGZIP(), []int{35}\n}", "title": "" }, { "docid": "802238d4003bb699324cc187241e7d21", "score": "0.6412467", "text": "func (*MessagePeerInfoReq) Descriptor() ([]byte, []int) {\n\treturn file_p2pnext_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "670dc65685466336369d8b1ab3b201cd", "score": "0.6411724", "text": "func (*BuilderMethod) Descriptor() ([]byte, []int) {\n\treturn file_org_apache_beam_model_pipeline_v1_external_transforms_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "4198fa4c394174456b3d1f4452d9eeec", "score": "0.6410578", "text": "func (*Message12685) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_1_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "f9adb2641dc52bef84574aa5f705216f", "score": "0.6410334", "text": "func (*DatasetListProto) Descriptor() ([]byte, []int) {\n\treturn file_metadata_service_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "f384ea318669d2eb9d8cfce72ecfc653", "score": "0.6409154", "text": "func (*Message12798) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_1_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "700ce06312e17d1cf853588625be37a5", "score": "0.64060783", "text": "func (*MessageExternalNetReq) Descriptor() ([]byte, []int) {\n\treturn file_p2pnext_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "0811d05d9af3482ae7cdae5bd2efacbf", "score": "0.640519", "text": "func (*Metadata) Descriptor() ([]byte, []int) {\n\treturn file_harmonytypes_v1_types_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "9231574ce254a88aa6735b5e3807fae0", "score": "0.6403414", "text": "func (*PeerToPeerTrust) Descriptor() ([]byte, []int) {\n\treturn file_v2_reputation_grpc_types_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "f7defdbef857e9272f2dd8b005dc920f", "score": "0.6402792", "text": "func (x *fastReflection_MsgVote) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgVote\n}", "title": "" }, { "docid": "f7defdbef857e9272f2dd8b005dc920f", "score": "0.6402792", "text": "func (x *fastReflection_MsgVote) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgVote\n}", "title": "" }, { "docid": "53811166261571b8190f87740b338976", "score": "0.640192", "text": "func (*UpdateLabelDeleted) Descriptor() ([]byte, []int) {\n\treturn file_updates_proto_rawDescGZIP(), []int{33}\n}", "title": "" }, { "docid": "ac08f0d2049606ba8ac6d6580760f74d", "score": "0.64015305", "text": "func (*TestVersion3) Descriptor() ([]byte, []int) {\n\treturn file_testpb_unknonwnproto_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "4156c38edb09e3b3d39325fd82d17332", "score": "0.6401178", "text": "func (*FriendDelMessage) Descriptor() ([]byte, []int) {\n\treturn file_protobuf_im_message_proto_rawDescGZIP(), []int{48}\n}", "title": "" }, { "docid": "4ee2a9fa76845f09ac51e5c82f042f8c", "score": "0.6400258", "text": "func (*TraceRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_debug_debug_api_debug_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "8f7ef68fa4ed322b803e01b2c23f0eef", "score": "0.6399618", "text": "func (*Policy) Descriptor() ([]byte, []int) {\n\treturn file_ligato_vpp_srv6_srv6_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "32d666204f2a65ec902e9a0f9609f8fb", "score": "0.63989186", "text": "func (*ReplaceLabelsRequest) Descriptor() ([]byte, []int) {\n\treturn file_label_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "5435cabce4c77f5c0fe2ee0dbdb5441a", "score": "0.6396179", "text": "func (*CallRequest) Descriptor() ([]byte, []int) {\n\treturn file___proto_rpc_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "bcf747fe3aed534973504aef3749089c", "score": "0.63922", "text": "func (*HeartbeatReq) Descriptor() ([]byte, []int) {\n\treturn file_api_logic_grpc_api_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "47ce1cc5e5d0e7800b598a9698ce4624", "score": "0.63917655", "text": "func (*ReqCheckPrivacy) Descriptor() ([]byte, []int) {\n\treturn file_liqi_proto_rawDescGZIP(), []int{467}\n}", "title": "" }, { "docid": "690433d323720536069629d895aca163", "score": "0.6390276", "text": "func (*TraceRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_debug_debug_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "3ab297a1009b24252ed077e0e4ea0959", "score": "0.63895905", "text": "func (*UpdateTeam) Descriptor() ([]byte, []int) {\n\treturn file_updates_proto_rawDescGZIP(), []int{44}\n}", "title": "" }, { "docid": "d03fffe7d3d6a26122105b16db7cf633", "score": "0.6387846", "text": "func (*Message7864) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_1_proto_rawDescGZIP(), []int{31}\n}", "title": "" }, { "docid": "3c18276c0b3298580ce5aa6b220f7dbb", "score": "0.63873494", "text": "func (*BotRevokeToken) Descriptor() ([]byte, []int) {\n\treturn file_chat_bot_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "343a9fd6044255f1f9575ed53e643c68", "score": "0.6386333", "text": "func (*MessageUtil) Descriptor() ([]byte, []int) {\n\treturn file_p2pnext_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "1080c35c9213141f1b91359648e98fdf", "score": "0.63863033", "text": "func (*Message12797) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_1_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "035e65b7d7b9b70f641db81176906d47", "score": "0.63819706", "text": "func (*DisconnectRequest) Descriptor() ([]byte, []int) {\n\treturn file_vpn_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "e995304f323b172f5cd51129f1e72d08", "score": "0.6381857", "text": "func (*BroadcastRequest) Descriptor() ([]byte, []int) {\n\treturn file___proto_rpc_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "770c0a6d94bffde6dfaf86a721ee5637", "score": "0.6381311", "text": "func (*Metadata) Descriptor() ([]byte, []int) {\n\treturn file_protoconfig_v1_extensions_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "a209ccb2291a78ed4d4abf8ef6657518", "score": "0.63765574", "text": "func (ProxyProtoVersion) EnumDescriptor() ([]byte, []int) {\n\treturn file_test_echo_proto_echo_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "de19e6b8c229eec6f9329e1709fd9dce", "score": "0.63756746", "text": "func (*Message12776) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_1_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "9bcf93675fac602535ff4a548020a0b4", "score": "0.6374746", "text": "func (*CSODACParty_TeamInfo) Descriptor() ([]byte, []int) {\n\treturn file_underlords_dac_gcmessages_common_proto_rawDescGZIP(), []int{5, 3}\n}", "title": "" }, { "docid": "8a2fe334670a87d8e3cfd74d67bab800", "score": "0.6374503", "text": "func (x *fastReflection_TestVersion3) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_TestVersion3\n}", "title": "" } ]
1f17bb015b4e7fbabe85e367cf9f3b71
/ Method to simulate latency
[ { "docid": "9323d5a50415319d5b37334ae6880958", "score": "0.7904925", "text": "func simulateLatency() {\n\tsleepDuration := time.Duration(rand.Intn(600 - 40 + 1) + 40) * time.Millisecond\n\ttime.Sleep(sleepDuration)\n}", "title": "" } ]
[ { "docid": "4fc38a9ee8c22b7013373495fe36812c", "score": "0.64701414", "text": "func TestTimeToServeLatency(t *testing.T) {\n\ttimeToServe(t, \"helloworld\", \"\", hwReqtimeout)\n}", "title": "" }, { "docid": "bd7b759d00e4607a733ddedf7e0101d2", "score": "0.63512814", "text": "func main() {\n\tvar stat Stat\n\tvar microsecond = string(\"µs\")\n\tnethandle := getPacketSource()\n\n\tc := pollNet(nethandle)\n\tfor {\n\t\tselect {\n\t\tcase s := <-c:\n\t\t\tstat.calc(s.netLatency)\n\t\t\tfmt.Printf(\" %v\\tLatency: %-v\\tAvg: %-.0f%v \\tSDev: %-.2f%v\", stat.n, s.netLatency, stat.avg,\n\t\t\t\tmicrosecond, math.Sqrt(stat.svar) / 1000, microsecond)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "056307bc648cf9f76db6aa2d4a1c1e99", "score": "0.63036036", "text": "func TestTimeToServeLatencyLongRunning(t *testing.T) {\n\tq := fmt.Sprintf(\"timeout=%d\", sleepTime.Milliseconds())\n\ttimeToServe(t, \"timeout\", q, sleepReqTimeout)\n}", "title": "" }, { "docid": "42e3127186038b5e1097c9cf54e9e5d8", "score": "0.6193617", "text": "func (t *timedConn) delay(start time.Time, n int) {\n\tif t.rate > 0 {\n\t\texpected := time.Duration(n * int(time.Second) / t.rate.Int())\n\t\tif actual := time.Since(start); expected > actual {\n\t\t\ttime.Sleep(expected - actual)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2f7aff12b26abe532f794fed832ffb39", "score": "0.6097555", "text": "func getLatency(req LatencyReq) (latency int) {\n\tvar latencyList []int\n\n\tfor i := 0; i < req.Samples; i++ {\n\t\tlatency := pingSite(req.URL)\n\t\tlatencyList = append(latencyList, latency)\n\t\t// detected a timeout or other error\n\t\t// consider url unresponsive, don't re-call\n\t\tif latency == -1 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tsort.Ints(latencyList)\n\tfmt.Println(\"latencyList after sorting:\", latencyList)\n\n\tlatency = latencyList[0]\n\treturn\n}", "title": "" }, { "docid": "95f451135a67e9f9b0fa03e2491be73b", "score": "0.60805637", "text": "func (c *cassandraConnector) sendLatency(\n\tctx context.Context, name string, d time.Duration) {\n\tc.scope.Timer(name).Record(d)\n}", "title": "" }, { "docid": "e46db3053d5722a04109be54e99dbe1d", "score": "0.5935215", "text": "func main() {\n\tvar host string\n\tflag.StringVar(&host, \"h\", \"us.pool.ntp.org:123\", \"NTP host\")\n\tflag.Parse()\n\n\t// req data packet is a 48-byte long value\n\t// that is used for sending time request.\n\treq := make([]byte, 48)\n\n\t// req is initialized with 0x1B or 0001 1011 which is\n\t// a request setting for time server.\n\treq[0] = 0x1B\n\n\t// rsp byte slice used to receive server response\n\trsp := make([]byte, 48)\n\n\t// setup generic connection (net.Conn) using net.Dial\n\tconn, err := net.Dial(\"udp\", host)\n\tif err != nil {\n\t\tfmt.Printf(\"failed to connect: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tdefer func() {\n\t\tif err := conn.Close(); err != nil {\n\t\t\tfmt.Println(\"failed while closing connection:\", err)\n\t\t}\n\t}()\n\n\tfmt.Printf(\"requesting time from %s (%s)\\n\", host, conn.RemoteAddr())\n\n\t// Once connection is established, the code pattern\n\t// is the same as in the other impl.\n\n\t// send time request\n\tif _, err = conn.Write(req); err != nil {\n\t\tfmt.Printf(\"failed to send request: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\n\t//block to receive server response\n\tread, err := conn.Read(rsp)\n\tif err != nil {\n\t\tfmt.Printf(\"failed to receive response: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\t//ensure we read 48 bytes back (NTP protocol spec)\n\tif read != 48 {\n\t\tfmt.Println(\"did not get all expected bytes from server\")\n\t\tos.Exit(1)\n\t}\n\n\t// NTP data comes in as big-endian (LSB [0...47] MSB)\n\t// with a 64-bit value containing the server time in seconds\n\t// where the first 32-bits are seconds and last 32-bit are fractional.\n\t// The following extracts the seconds from [0...[40:43]...47]\n\t// it is the number of secs since 1900 (NTP epoch)\n\tsecs := binary.BigEndian.Uint32(rsp[40:])\n\tfrac := binary.BigEndian.Uint32(rsp[44:])\n\n\t// Many OSs use Unix time epoch which is num of secs since 1970,\n\t// while NTP's ephoch starts on Jan 1, 1900. Therefore,\n\t// to get the correct time, we must adjust the epocs properly\n\t// by removing 70 yrs of seconds (1970-1900) offset.\n\tntpEpoch := time.Date(1900, 1, 1, 0, 0, 0, 0, time.UTC)\n\tunixEpoch := time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC)\n\toffset := unixEpoch.Sub(ntpEpoch).Seconds()\n\tnow := float64(secs) - offset\n\tfmt.Printf(\"%v\\n\", time.Unix(int64(now), int64(frac)))\n}", "title": "" }, { "docid": "cbae1fdac508bfce23ea9c94549174c0", "score": "0.5895639", "text": "func (l *link) setRTT(d time.Duration) {\n\tl.Lock()\n\n\tif l.length <= 0 {\n\t\tl.length = d.Nanoseconds()\n\t\tl.Unlock()\n\t\treturn\n\t}\n\n\t// https://fishi.devtail.io/weblog/2015/04/12/measuring-bandwidth-and-round-trip-time-tcp-connection-inside-application-layer/\n\tlength := 0.8*float64(l.length) + 0.2*float64(d.Nanoseconds())\n\t// set new length\n\tl.length = int64(length)\n\n\tl.Unlock()\n}", "title": "" }, { "docid": "a12ad624f0bb85a3c9833f627b32b45d", "score": "0.57931626", "text": "func testThroughputWith(t *testing.T, numConnections int, averageAggregateBytesPerSecond int, withSlow bool) {\n\trestart(t)\n\ttotalExpected := uint64(0)\n\ttotalRead := uint64(0)\n\tdone := uint64(0)\n\tduration_seconds := 10\n\n\t// Create some slow and some fast readers\n\tnumSlow := numConnections / 2\n\tif !withSlow {\n\t\tnumSlow = 0\n\t}\n\t// The slow speed can't be TOO slow, otherwise it takes too long to fill the TCP buffer.\n\tslowSpeed := 200000\n\tfastSpeed := (averageAggregateBytesPerSecond - (numSlow * slowSpeed)) / (numConnections - numSlow)\n\n\tconst meg = 1024 * 1024\n\n\t// You must make the minimum size quite large, like 2MB, otherwise the TCP receive buffer\n\t// of the HTTP client just eats it all up, and you don't end up with blocking buffers on the send side.\n\tminSize := tcpBufferSize\n\n\tfmt.Printf(\"Theoretical speed: %v MB/s\\n\", (numSlow*slowSpeed+(numConnections-numSlow)*fastSpeed)/meg)\n\tfmt.Printf(\"Slow speed: %v KB/s\\n\", slowSpeed/1024)\n\tfmt.Printf(\"Fast speed: %v KB/s\\n\", fastSpeed/1024)\n\n\tfor i := 0; i < numConnections; i++ {\n\t\tlaunch := func(bytesPerSecond int) {\n\t\t\tfmt.Printf(\"Launching %v\\n\", bytesPerSecond)\n\t\t\tsize := minSize + bytesPerSecond*duration_seconds\n\t\t\tlimit := bytesPerSecond\n\t\t\tif !withSlow {\n\t\t\t\tlimit = -1\n\t\t\t}\n\t\t\tatomic.AddUint64(&totalExpected, uint64(size))\n\t\t\tdoRequestAndReadSlowly(t, fmt.Sprintf(\"/garbage-stream?Size=%v\", size), limit, &totalRead)\n\t\t\tif bytesPerSecond == slowSpeed {\n\t\t\t\tfmt.Printf(\"Finished slow\\n\")\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"Finished fast\\n\")\n\t\t\t}\n\t\t\tatomic.AddUint64(&done, 1)\n\t\t}\n\t\tif i < numSlow {\n\t\t\tgo launch(slowSpeed)\n\t\t} else {\n\t\t\tgo launch(fastSpeed)\n\t\t}\n\t}\n\n\tstart := time.Now()\n\ttotalReadAtStart := atomic.LoadUint64(&totalRead)\n\n\tfor {\n\t\telapsed := time.Now().Sub(start)\n\t\tbps := float64(atomic.LoadUint64(&totalRead)-totalReadAtStart) / elapsed.Seconds()\n\t\texpected := float64(averageAggregateBytesPerSecond)\n\t\tbps_percent := 100.0 * float64(bps) / float64(expected)\n\t\tmeg := 1024.0 * 1024.0\n\t\tfmt.Printf(\"MB per second: %.3f (%.1f%%) (expected %v, %v connections)\\n\", bps/meg, bps_percent, expected/meg, numConnections)\n\t\ttotalReadAtStart = atomic.LoadUint64(&totalRead)\n\t\tstart = time.Now()\n\t\ttime.Sleep(1 * time.Second)\n\t\tif atomic.LoadUint64(&done) == uint64(numConnections) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif totalRead != totalExpected {\n\t\tt.Errorf(\"Total bytes read != expected bytes read (%v expected. %v actual)\", totalExpected, totalRead)\n\t}\n}", "title": "" }, { "docid": "ceb03b68c92e5d04dc2b2065d7ac0e4d", "score": "0.57529044", "text": "func (o *TcpSocket) xmit_timer(rtt int16) {\n\tvar delta uint16\n\tsts := &o.ctx.tcpStats\n\tsts.tcps_rttupdated++\n\tif o.srtt != 0 {\n\t\t/*\n\t\t* srtt is stored as fixed point with 3 bits after the\n\t\t* binary point (i.e., scaled by 8). The following magic\n\t\t* is equivalent to the smoothing algorithm in rfc793 with\n\t\t* an alpha of .875 (srtt = rtt/8 + srtt*7/8 in fixed\n\t\t* point). Adjust rtt to origin 0.\n\t\t */\n\t\tdelta = uint16(rtt - 1 - (o.srtt >> TCP_RTT_SHIFT))\n\t\to.srtt += int16(delta)\n\t\tif o.srtt <= 0 {\n\t\t\to.srtt = 1\n\t\t}\n\t\t/*\n\t\t* We accumulate a smoothed rtt variance (actually, a\n\t\t* smoothed mean difference), then set the retransmit\n\t\t* timer to smoothed rtt + 4 times the smoothed variance.\n\t\t* rttvar is stored as fixed point with 2 bits after the\n\t\t* binary point (scaled by 4). The following is\n\t\t* equivalent to rfc793 smoothing with an alpha of .75\n\t\t* (rttvar = rttvar*3/4 + |delta| / 4). This replaces\n\t\t* rfc793's wired-in beta.\n\t\t */\n\t\tif delta < 0 {\n\t\t\tdelta = -delta\n\t\t}\n\t\tdelta -= uint16((o.rttvar >> TCP_RTTVAR_SHIFT))\n\t\to.rttvar += int16(delta)\n\t\tif o.rttvar <= 0 {\n\t\t\to.rttvar = 1\n\t\t}\n\t} else {\n\t\t/*\n\t\t* No rtt measurement yet - use the unsmoothed rtt.\n\t\t* Set the variance to half the rtt (so our first\n\t\t* retransmit happens at 3*rtt).\n\t\t */\n\t\to.srtt = rtt << TCP_RTT_SHIFT\n\t\to.rttvar = rtt << (TCP_RTTVAR_SHIFT - 1)\n\t}\n\to.rtt = 0\n\to.rxtshift = 0\n\n\t/*\n\t* the retransmit should happen at rtt + 4 * rttvar.\n\t* Because of the way we do the smoothing, srtt and rttvar\n\t* will each average +1/2 tick of bias. When we compute\n\t* the retransmit timer, we want 1/2 tick of rounding and\n\t* 1 extra tick because of +-1/2 tick uncertainty in the\n\t* firing of the timer. The bias will give us exactly the\n\t* 1.5 tick we need. But, because the bias is\n\t* statistical, we have to test that we don't drop below\n\t* the minimum feasible timer (which is 2 ticks).\n\t */\n\trangeset(&o.rxtcur, uint16(o.rexmtval()),\n\t\to.rttmin, TCPTV_REXMTMAX)\n\n\t/*\n\t* We received an ack for a packet that wasn't retransmitted\n\t* it is probably safe to discard any error indications we've\n\t* received recently. This isn't quite right, but close enough\n\t* for now (a route might have failed after we sent a segment,\n\t* and the return path might not be symmetrical).\n\t */\n\to.softerror = 0\n}", "title": "" }, { "docid": "c0e23e5deb28b79f16f62a87ab7773e7", "score": "0.5744174", "text": "func (c *Counter) pperf() {\n sps := c.s_count - c.s_lastcount\n pps := c.count - c.lastcount\n c.backlog = c.s_count - c.count - c.totalerrors\n\n atomic.StoreInt64(&c.lastcount, c.count)\n atomic.StoreInt64(&c.s_lastcount, c.s_count)\n\n c.avg_time = float64(c.totaltime) / (float64(c.count) * 1.0e9)\n // c.last_avg_time = TODO!!\n\n log.Println(\" SendPS: \", fmt.Sprintf(\"%4d\", sps),\n \" ReceivePS: \", fmt.Sprintf(\"%4d\", pps), fmt.Sprintf(\"%2.4f\", c.avg_time),\n \" Pending Requests: \", c.backlog,\n \" Error:\", c.totalerrors,\n \"|\", fmt.Sprintf(\"%2.2f%s\", (float64(c.totalerrors)*100.0/float64(c.totalerrors+c.count)), \"%\"),\n \" Slow Ratio: \", fmt.Sprintf(\"%2.2f%s\", (float64(c.totalslowresp)*100.0/float64(c.totalerrors+c.count)), \"%\"))\n}", "title": "" }, { "docid": "45abfc2b45f04eb4e49e9534faeb80ea", "score": "0.57267654", "text": "func SetLatency(waitStates int) {\n\tf.acr = f.acr&^0xf | uint32(waitStates)&0xf\n}", "title": "" }, { "docid": "bfcffb016a132827e72628fdff727c53", "score": "0.5681047", "text": "func (client *StatsdClient) Timing(stat string, time int64) {\r\n\tupdateString := fmt.Sprintf(\"%d|ms\", time)\r\n\tstats := map[string]string{stat: updateString}\r\n\tclient.Send(stats, 1)\r\n}", "title": "" }, { "docid": "d2b207d69e2be4c99949bec2880a3017", "score": "0.5640125", "text": "func testForward() {\n\tfor {\n\t\ttime.Sleep(1 * time.Second)\n\t\tcur := time.Now() + 7000\n\t\tnext := BigTaskGetTimeBase(cur, 7200)\n\t\tfor next <= time.Now()+ 7000*1 + 2098 {\n\t\t\tback := next + 7200 + 3600 \n\t\t\tif back < cur {\n\t\t\t\tfmt.Printf(format, ...)\n\t\t\t}\n\t\t\tnext += 7200\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a3821388c7ce732699b7c9b0506480c0", "score": "0.5596286", "text": "func latencyMiddleware() echo.MiddlewareFunc {\n\treturn func(next echo.HandlerFunc) echo.HandlerFunc {\n\t\treturn func(c echo.Context) error {\n\t\t\t// First piece for calculating the latency.\n\t\t\tstartTime := time.Now()\n\t\t\tc.Set(\"startTime\", startTime)\n\n\t\t\t// Call the next middleware in the chain.\n\t\t\treturn next(c)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3ecec29f021f25399fd40649dca85c54", "score": "0.556266", "text": "func TestHedgedRequest_WithLatency(t *testing.T) {\n\ttailLatency := 20\n\treqsCalled := 0\n\n\treq := func() []byte {\n\t\treqsCalled++\n\t\tif reqsCalled == 1 {\n\t\t\tselect {\n\t\t\tcase <-time.After(time.Duration(tailLatency+1) * time.Millisecond): // Trigger subsequent request\n\t\t\t\treturn []byte(\"test\")\n\t\t\t}\n\t\t} else if reqsCalled == 2 { // Second request\n\t\t\treturn []byte(\"test\") // Return immediately\n\t\t}\n\t\treturn []byte(\"fail, return called outside of if\")\n\t}\n\n\tres := HedgedRequest(req, tailLatency, 2)\n\n\tif string(res) != \"test\" {\n\t\tt.Fatal(\"latency test failed\")\n\t}\n\tif reqsCalled != 2 {\n\t\tt.Fatal(reqsCalled, \"reqs were called instead of 2\")\n\t}\n}", "title": "" }, { "docid": "a9e8303ec4fdee2f64da180c992e0e04", "score": "0.55618215", "text": "func TestGetCurrentTimeNonSyncTime(t *testing.T) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tt.Errorf(panicFormatString, r)\n\t\t}\n\t}()\n\n\tservice := Mp1Service{}\n\n\t// Create http get request\n\tgetRequest, _ := http.NewRequest(\"GET\",\n\t\tfmt.Sprintf(getTiming, getCurrentTIme),\n\t\tbytes.NewReader([]byte(\"\")))\n\n\t// Mock the response writer\n\tmockWriter := &mockHttpWriter{}\n\tresponseHeader := http.Header{} // Create http response header\n\tmockWriter.On(\"Header\").Return(responseHeader)\n\tmockWriter.On(\"Write\", []byte(writeCurTimeNonSynct+\"\\n\")).\n\t\tReturn(0, nil)\n\tmockWriter.On(\"WriteHeader\", 200)\n\n\tpatches := gomonkey.ApplyFunc(ntp.QueryWithOptions, func(host string, opt ntp.QueryOptions) (*ntp.Response, error) {\n\t\tvar ntpRsp ntp.Response\n\n\t\tntpRsp.Time = time.Unix(1623770544, 468538768)\n\t\tntpRsp.Stratum = 16\n\t\treturn &ntpRsp, nil\n\t})\n\n\tdefer patches.Reset()\n\n\t// 13 is the order of the DNS get all handler in the URLPattern\n\tservice.URLPatterns()[24].Func(mockWriter, getRequest)\n\n\tassert.Equal(t, \"200\", responseHeader.Get(responseStatusHeader),\n\t\tresponseCheckFor200)\n\n\tmockWriter.AssertExpectations(t)\n}", "title": "" }, { "docid": "4cdee20f9f79935cec2afb9857496362", "score": "0.55517983", "text": "func (s *NoopClient) Timing(stat string, delta int64, rate float32) error {\n\treturn nil\n}", "title": "" }, { "docid": "878e2bca15d04f069fcfa624730c9d4d", "score": "0.5513859", "text": "func Test_TW_SmallMs(t *testing.T) {\n\tvar exit = make(chan int, 1)\n\tvar count int64\n\tvar interval int64 = 5\n\tvar runs int64 = 1000\n\tvar now = time.Now()\n\tAddTimer(TW_SmallMs, interval, runs, func() {\n\t\tcount++\n\t\takLog.FmtPrintln(\"TW_SmallMs hello...\", count)\n\t\tif count >= runs && runs > 0 {\n\t\t\texit <- 1\n\t\t}\n\t})\n\tselect {\n\tcase <-exit:\n\t\takLog.FmtPrintln(\"TW_SmallMs exit...\", time.Since(now))\n\t}\n}", "title": "" }, { "docid": "712e8ee06124aa198722fbb0ee0bdf94", "score": "0.55121607", "text": "func Overhead() time.Duration { return nanoOverhead }", "title": "" }, { "docid": "d5cf6279cdbd33bee39f2ab8f5e16752", "score": "0.55068254", "text": "func (mux *Muxer) Latency() (d time.Duration) {\n\tping := atomic.LoadInt64(&mux.lastPingSent)\n\tif ping > 0 {\n\t\tpong := atomic.LoadInt64(&mux.lastPongRcvd)\n\t\tif ping <= pong {\n\t\t\td = time.Nanosecond * time.Duration(pong-ping)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "2d34c9860305e6cbdcbc476e726fea41", "score": "0.5459024", "text": "func main() {\n\tctx, cancelFunc := context.WithCancel(context.Background())\n\n\ttimer := time.NewTimer(time.Minute)\n\tgo func() {\n\t\tselect {\n\t\tcase <-timer.C:\n\t\t\tcancelFunc()\n\t\t}\n\t}()\n\n\tsource, err := ext.NewNetSource(ctx, ext.UDP, \"127.0.0.1:3434\")\n\tutil.Check(err)\n\tflow1 := flow.NewMap(toUpper, 1)\n\tsink, err := ext.NewNetSink(ext.UDP, \"127.0.0.1:3535\")\n\tutil.Check(err)\n\n\tsource.Via(flow1).To(sink)\n}", "title": "" }, { "docid": "ded6c62b9a36cfff05462df436f595b3", "score": "0.5452737", "text": "func (l *Loop) Start() error {\n\tl.mu.Lock()\n\tdefer l.mu.Unlock()\n\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\t// Silently fail on re-starts.\n\tif l.curState != stateInit {\n\t\treturn wrapLoopError(nil, TokenLoop, \"Loop is already running or is done\")\n\t}\n\tl.curState = stateRun\n\n\tgo func() {\n\t\t// Stats heartbeat channel set up\n\t\theartTick := time.NewTicker(time.Second)\n\t\tsendBeat := func(ps LatencySample) {\n\t\t\tselect {\n\t\t\tcase l.heartbeat <- ps:\n\t\t\tdefault: // Throw it away if no one is listening.\n\t\t\t}\n\t\t}\n\n\t\t// simTick has an internal limiter, and I need to make sure the\n\t\t// delay isn't accidentally doubled.\n\t\tsimChan := time.NewTimer(time.Duration(0))\n\t\t// rendTick has no internal limiter, the Ticker controls\n\t\t// the execution rate.\n\t\trendTick := time.NewTicker(l.RenderLatency)\n\n\t\tdefer simChan.Stop()\n\t\tdefer rendTick.Stop()\n\t\tdefer heartTick.Stop()\n\t\tdefer close(l.heartbeat)\n\t\tdefer l.Stop(nil)\n\n\t\t// Time tracking.\n\t\tsimAccumulator := time.Duration(0)\n\t\tnow := time.Now()\n\t\tsimLatency := newLatencyTracker()\n\t\tpreviousSim := now\n\t\trendLatency := newLatencyTracker()\n\t\tpreviousRend := now\n\n\t\twg.Done()\n\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-l.doneSignal:\n\t\t\t\tbreak\n\t\t\tcase <-l.done:\n\t\t\t\tl.signalDone()\n\t\t\t\tbreak\n\t\t\tcase <-heartTick.C:\n\t\t\t\tsendBeat(LatencySample{\n\t\t\t\t\tRenderLatency: rendLatency.Latency(),\n\t\t\t\t\tSimulateLatency: simLatency.Latency(),\n\t\t\t\t})\n\t\t\tcase <-simChan.C:\n\t\t\t\t// How much are we behind?\n\t\t\t\tcurTime := time.Now()\n\t\t\t\tframeTime := curTime.Sub(previousSim)\n\t\t\t\tpreviousSim = curTime\n\t\t\t\tsimAccumulator += frameTime\n\t\t\t\t// Call simulate() if we built up enough lag.\n\t\t\t\tfor simAccumulator >= l.SimulationLatency {\n\t\t\t\t\t// Run the simulation with a fixed step.\n\n\t\t\t\t\t// Actually call simulate...\n\t\t\t\t\tif er := l.Simulate(l.SimulationLatency); er != nil {\n\t\t\t\t\t\twrapped := wrapLoopError(er, TokenSimulate, \"Error returned by Simulate(%s)\", l.SimulationLatency.String())\n\t\t\t\t\t\twrapped.Misc[\"curTime\"] = curTime\n\t\t\t\t\t\tl.Stop(wrapped)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tsimLatency.MarkDone(l.SimulationLatency)\n\n\t\t\t\t\t// Keep track of leftover time.\n\t\t\t\t\tsimAccumulator -= l.SimulationLatency\n\t\t\t\t}\n\t\t\t\t// Set up next call to simulate()...\n\t\t\t\tsimChan.Reset(l.SimulationLatency - simAccumulator)\n\t\t\tcase <-rendTick.C:\n\t\t\t\t// How much are we behind?\n\t\t\t\tcurTime := time.Now()\n\t\t\t\tframeTime := curTime.Sub(previousRend)\n\t\t\t\tpreviousRend = curTime\n\n\t\t\t\t// Call render() if we built up enough lag.\n\t\t\t\t// Unlike simulate(), we can skip calls by varying the input time delta.\n\t\t\t\t// Actually call render...\n\t\t\t\tif er := l.Render(frameTime); er != nil {\n\t\t\t\t\twrapped := wrapLoopError(er, TokenRender, \"Error returned by Render(%s)\", frameTime.String())\n\t\t\t\t\twrapped.Misc[\"curTime\"] = curTime\n\t\t\t\t\tl.Stop(wrapped)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\trendLatency.MarkDone(frameTime)\n\t\t\t}\n\t\t}\n\t}()\n\t// Don't return until timer loop goroutine is actually starting.\n\twg.Wait()\n\treturn nil\n}", "title": "" }, { "docid": "2793e82a2a6057ab08d9e18f4b897125", "score": "0.5428943", "text": "func main() {\n\n offset := 0\n\n fmt.Println(\"Type of offset: \", reflect.TypeOf(offset))\n pkt := make ([]byte, max_pktlen)\n srcmac := []byte {0x00, 0x0c, 0x29, 0x6b, 0xa6, 0xc7}\n dstmac := []byte {0x00, 0x0c, 0x29, 0xc0, 0xa2, 0x0f}\n\n // 00:0c:29:c0:a2:0f with IP 172.16.108.26/24\n\n // Destination mac\n copy (pkt, dstmac)\n offset += 6\n// copy ((pkt+offset), srcmac)\n// offset += 6\n\n fmt.Println(\"Packet length: \", len(pkt))\n\n hex_dump(pkt, offset)\n\n //for _, val := range pkt {\n // if val != nil {\n // fmt.Println(val)\n // }\n //}\n\n // Tickers use a similar mechanism to timers: a channel that is\n // sent values. Here we’ll use the select builtin on the channel\n // to await the values as they arrive every 500ms.\n\n/* ticker := time.NewTicker(500 * time.Millisecond)\n done := make(chan bool)\n\n go func() {\n for {\n select {\n case <-done:\n return\n case t := <-ticker.C:\n fmt.Println(\"Tick at\", t)\n }\n }\n }()\n\n time.Sleep(1600 * time.Millisecond)\n ticker.Stop()\n done <- true\n fmt.Println(\"Ticker stopped\")\n*/\n}", "title": "" }, { "docid": "46bb90922b57b23b36497ccbade7993d", "score": "0.54140204", "text": "func goSleep(){\n\tamt := time.Duration(rand.Intn(1000))\n time.Sleep(time.Millisecond * amt)\n\t// fmt.Printf(\"server has slept for %v seconds\\n\", amt)\n}", "title": "" }, { "docid": "c559296061f9f8df6d3afdd198785e7c", "score": "0.5402709", "text": "func executeLatency(ctx context.Context, s *testing.State, info runInfo) (float64, map[string]float64, error) {\n\tif len(info.options) == 0 {\n\t\treturn 0.0, nil, errors.New(\"no run options are given\")\n\t}\n\t// Only run the first option and return.\n\topt := info.options[0]\n\ts.Logf(\"Start to run %s benchmark (run %s): %s %s\", info.testName, opt.name, info.command, strings.Join(opt.option, \" \"))\n\treturn execute(ctx, info, opt.option)\n}", "title": "" }, { "docid": "d0c140ed2e6dd0a17a974a1733ece7b7", "score": "0.53994435", "text": "func ScreenLatency(ctx context.Context, s *testing.State) {\n\tkeyboard, err := input.Keyboard(ctx)\n\tif err != nil {\n\t\ts.Fatal(\"Failed to create keyboard device: \", err)\n\t}\n\n\tln, _ := net.Listen(\"tcp\", \"127.0.0.1:\")\n\t_, serverPort, _ := net.SplitHostPort(ln.Addr().String())\n\ttesting.ContextLog(ctx, \"Listening on address: \", ln.Addr())\n\n\topenAppCommand := testexec.CommandContext(ctx, \"adb\", \"shell\", \"am\", \"start\", \"-n\",\n\t\t\"com.android.example.camera2.slowmo/com.example.android.camera2.slowmo.CameraActivity\",\n\t\t\"--es\", \"port \"+serverPort)\n\tif err := openAppCommand.Run(testexec.DumpLogOnError); err != nil {\n\t\ts.Fatal(\"Failed to start companion Android app using adb\")\n\t}\n\n\tportForwardingCommand := testexec.CommandContext(ctx, \"adb\", \"reverse\", \"tcp:\"+serverPort, \"tcp:\"+serverPort)\n\tif err := portForwardingCommand.Run(testexec.DumpLogOnError); err != nil {\n\t\ts.Fatal(\"Failed to initiate TCP connection with a companion Android app\")\n\t}\n\n\tscreenlatency.CommunicateWithCompanionApp(ctx, s, ln, keyboard)\n}", "title": "" }, { "docid": "39dc106a37df7ef12fffb0b1b0c43ec4", "score": "0.5394992", "text": "func (ls *LogStatic) RandomDelay(i int32,du time.Duration,con1 interface{},con2 interface{}){\n\n\ts1:=fmt.Sprint(con1)\n\ts2:=fmt.Sprint(con2)\n\tif !(con1==nil||con2==nil)&&!strings.EqualFold(s1, s2) {\n\t\treturn\n\t}\n\n\tvar err error\n\tif du==0{\n\t\tdu,err=time.ParseDuration( ls.config.GetString(\"delay.defaultTime\"))\n\t}\n\tif err!=nil {\n\t\tlogger.Errorf(\"delay.defaultTime read error :%v\",err)\n\t\treturn\n\t}\n\tif i==0 {\n\t\ti=100\n\t}\n\tc:=rand.Int31n(i)\n\t//time.Sleep(time.Duration(c)*du)\n\ttick:=time.Tick(time.Duration(c)*du)\n\t<-tick\n}", "title": "" }, { "docid": "307d986ef7c6ccf9556c5a1a9993f794", "score": "0.53883225", "text": "func Latency(Host *CLV2Host) int32 {\n\tcHost, _ := (C.CLV2Host)(unsafe.Pointer(Host)), cgoAllocsUnknown\n\t__ret := C.lv2host_latency(cHost)\n\t__v := (int32)(__ret)\n\treturn __v\n}", "title": "" }, { "docid": "16d1798108b8327076495b5afed03468", "score": "0.5379195", "text": "func ts() uint64 { return tsoff + uint64(time.Now().UnixNano()/100) }", "title": "" }, { "docid": "6ecacda40b58babd5b433a5810feb1a9", "score": "0.5373", "text": "func (d *Device) LatencyTimer() (int, error) {\n\tvar lt C.uchar\n\te := C.ftdi_get_latency_timer(d.ctx, &lt)\n\treturn int(lt), d.makeError(e)\n}", "title": "" }, { "docid": "884fcc5b1baf6c425df1916f3c0c228e", "score": "0.5369826", "text": "func Delay(rate float64) {\n\tseconds := rand.ExpFloat64() / rate\n\ttime.Sleep(time.Duration(seconds * 1e9))\n}", "title": "" }, { "docid": "0f992901588f4dac18b5d4e42aba6a1a", "score": "0.53634024", "text": "func (s *Siego) doDelay() {\n\tif s.delay > 0 && !s.benchmark {\n\t\tdelay := float64(rand.Intn(s.delay*1000)) / 1000\n\n\t\ttime.Sleep(time.Duration(delay) * time.Second)\n\t}\n}", "title": "" }, { "docid": "baae924f67afe3dac69115c890f1ce0c", "score": "0.536306", "text": "func ResponseTime(url string, c chan float64, to int) {\n\n\tclient := &http.Client{\n\t\tTimeout: time.Duration(to) * time.Millisecond,\n\t}\n\n\tstart := time.Now()\n\n\trequest, err := http.NewRequest(\"GET\", url, nil)\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tc <- BadRequest\n\t}\n\n\tresponse, err := client.Do(request)\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tc <- RequestTimeoutOrError\n\t}\n\n\tdefer response.Body.Close()\n\n\telapsed := time.Since(start).Seconds()\n\n\tc <- elapsed\n}", "title": "" }, { "docid": "525ffe582f694e2b6fda347781afc846", "score": "0.5353824", "text": "func logLatency (latency time.Duration, tag string) {\n go func(latency time.Duration, tag string) {\n file, _ := os.Create(config.OutDir + \"/\" + strconv.Itoa(int(C.NUM_DOCS)) + \"_docs_\" + strconv.Itoa(int(C.BLOOM_FILTER_SZ)) + \"bf_latency_\" + tag)\n defer file.Close()\n io.WriteString(file, latency.String())\n }(latency, tag)\n}", "title": "" }, { "docid": "22cab35d2ab514a578021dd1fbaf8629", "score": "0.5350026", "text": "func latencyAggregator() {\n\tfor {\n\t\tselect {\n\t\tcase i := <-latency_chan:\n\t\t\tlatency = append(latency, i)\n\t\tcase <-resetLat_chan:\n\t\t\tlatency = latency[:0]\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6cb54befb781673424b3df09c8a29c96", "score": "0.5330243", "text": "func (n *Dialer) Latency(nodeID roachpb.NodeID) (time.Duration, error) {\n\tif n == nil || n.resolver == nil {\n\t\treturn 0, errors.New(\"no node dialer configured\")\n\t}\n\taddr, err := n.resolver(nodeID)\n\tif err != nil {\n\t\t// Don't trip the breaker.\n\t\treturn 0, err\n\t}\n\tlatency, ok := n.rpcContext.RemoteClocks.Latency(addr.String())\n\tif !ok {\n\t\tlatency = 0\n\t}\n\treturn latency, nil\n}", "title": "" }, { "docid": "928b2ec54477e4b4f7cff7d0acec775e", "score": "0.5328183", "text": "func SetTPS(tps int) {\n\tclock.SetTPS(tps)\n}", "title": "" }, { "docid": "32a5ab4adbb15c13bd695e6bc9d430c9", "score": "0.5312551", "text": "func (bt *BufferTrace) StartProbing() {\n\t<-bt.R.SendStartChan\n\n\tbt.BorderDistance = bt.MaxTtl\n\tbt.ReachedFlowTimeout = false\n\tbt.FlowEnded = false\n\tiT := time.NewTicker(time.Microsecond * time.Duration(bt.InterIter))\n\ti := 1\n\tmissingHops := 0\nProbingLoop:\n\tfor _ = range iT.C {\n\t\tmissingHops += 1\n\t\t//If DropProbes flag is enabled, stop the loop\n\t\tpT := time.NewTicker(time.Microsecond * time.Duration(bt.InterProbe))\n\t\tj := 0\n\t\treachedBorder := false\n\n\t\tfor _ = range pT.C {\n\t\t\tbt.ReachedFlowTimeout = !bt.IsFlowAlive()\n\t\t\tif bt.ReachedFlowTimeout || bt.FlowEnded {\n\t\t\t\tbt.BorderDistance = i\n\t\t\t\tbreak ProbingLoop\n\t\t\t}\n\n\t\t\tid := uint16(j*bt.MaxTtl + i - 1)\n\n\t\t\tif bt.IPVersion == V4 {\n\t\t\t\tif bt.TransportProtocol == Tcp {\n\t\t\t\t\tethernetLayer, ipLayer, tcpLayer := bt.BuildTCP(i, bt.ConvertIDtoPktID(id), bt.R.Curr.Seq, bt.R.Curr.Ack)\n\t\t\t\t\tbt.SendTCP([]gopacket.SerializableLayer{&ethernetLayer, &ipLayer, &tcpLayer})\n\t\t\t\t} else if bt.TransportProtocol == Udp {\n\t\t\t\t\tethernetLayer, ipLayer, udpLayer := bt.BuildUDP(i, bt.ConvertIDtoPktID(id))\n\t\t\t\t\tbt.SendUDP([]gopacket.SerializableLayer{&ethernetLayer, &ipLayer, &udpLayer})\n\t\t\t\t} else {\n\t\t\t\t\tlog.Fatal(errors.New(\"Wrong transport protocol\"))\n\t\t\t\t}\n\t\t\t} else if bt.IPVersion == V6 {\n\t\t\t\tif bt.TransportProtocol == Tcp {\n\t\t\t\t\tethernetLayer, ipLayer, ipDestinationLayer, tcpLayer := bt.BuildTCPIPv6(i, bt.ConvertIDtoPktID(id), bt.R.Curr.Seq, bt.R.Curr.Ack)\n\n\t\t\t\t\tbt.SendTCP([]gopacket.SerializableLayer{&ethernetLayer, &ipLayer, &ipDestinationLayer, &tcpLayer})\n\t\t\t\t} else if bt.TransportProtocol == Udp {\n\t\t\t\t\tethernetLayer, ipLayer, ipDestinationLayer, udpLayer := bt.BuildUDPIPv6(i, bt.ConvertIDtoPktID(id))\n\t\t\t\t\tbt.SendUDP([]gopacket.SerializableLayer{&ethernetLayer, &ipLayer, &ipDestinationLayer, &udpLayer})\n\t\t\t\t} else {\n\t\t\t\t\tlog.Fatal(errors.New(\"Wrong transport protocol\"))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif bt.ProbingAlgorithm == PacketByPacket {\n\t\t\t\treached, receivedReply := bt.WaitProbe(id)\n\t\t\t\treachedBorder = reachedBorder || reached\n\n\t\t\t\tif receivedReply {\n\t\t\t\t\tmissingHops = 0\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif bt.ProbingAlgorithm == Concurrent {\n\t\t\t\tmissingHops = 0\n\t\t\t}\n\n\t\t\tj++\n\t\t\tif j >= bt.Iter {\n\t\t\t\tpT.Stop()\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t}\n\n\t\t//Wait until we receive the #Iter of replies or until a timeout\n\t\t//What if we receive an old reply or wrong one? we may keep the last IDs and check whether they corresponds or not\n\t\t//The check should be done in this thread to avoid problems and to avoid monitors\n\n\t\t//Or, I may use a chan of booleans, where AnalyzePackets insert False to say \"go ahead, don't stop, it is not a border router\" and True to say \"stop, we reached a border router\"\n\t\t//So:\n\t\t//Send #Iteration packets (or 1)\n\t\t//Wait that AnalyzePackets receives them\n\t\t//Wait that AnalyzePackets insert True/False (if the received IP matches one of the border routers) into the queue\n\t\t//If true, send next train of TTL\n\n\t\tif bt.ProbingAlgorithm == HopByHop {\n\t\t\treached, receivedReply := bt.WaitTrain(uint16(i), bt.Iter)\n\t\t\treachedBorder = reached\n\n\t\t\tif receivedReply {\n\t\t\t\tmissingHops = 0\n\t\t\t}\n\t\t}\n\n\t\ti++\n\n\t\tif i > bt.MaxTtl || reachedBorder || (missingHops >= bt.MaxMissingHops && bt.MaxMissingHops > 0) {\n\t\t\tiT.Stop()\n\t\t\tbt.BorderDistance = i - 1\n\t\t\tif reachedBorder {\n\t\t\t\tbt.ReachedBorderRouter = true\n\t\t\t}\n\t\t\tif missingHops >= bt.MaxMissingHops {\n\t\t\t\tbt.ReachedMaxMissingHops = true\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif bt.ProbingAlgorithm == Concurrent {\n\t\ttime.Sleep(time.Duration(bt.Timeout) * time.Millisecond)\n\t}\n\tbt.DoneSend <- true\n}", "title": "" }, { "docid": "97ba9ffe82c662673de6ebc2db797367", "score": "0.5309133", "text": "func getLatency(w Worker, url string) (latency int) {\n\twIpPort := getWorkerIpPort(w)\n\treq := LatencyReq{url, samplesPerWorker}\n\tclient, err := rpc.Dial(\"tcp\", wIpPort)\n\tcheckError(\"rpc.Dial in getLatency()\", err, true)\n\terr = client.Call(\"WorkerRPC.GetLatency\", req, &latency)\n\tcheckError(\"client.Call(WorkerRPC.GetLatency: \", err, true)\n\terr = client.Close()\n\tcheckError(\"client.Close() in getLatency call: \", err, true)\n\treturn\n}", "title": "" }, { "docid": "a5c98b5a1648f8b7c9235dbba96d0111", "score": "0.5293467", "text": "func (client *StatsdClient) TimingWithSampleRate(stat string, time int64, sampleRate float32) {\r\n\tupdateString := fmt.Sprintf(\"%d|ms\", time)\r\n\tstats := map[string]string{stat: updateString}\r\n\tclient.Send(stats, sampleRate)\r\n}", "title": "" }, { "docid": "fc675c9a8a6adc008557e576b38c95e3", "score": "0.5274363", "text": "func TestEncodeTxTimeUsage(t *testing.T) {\n\tvar txCount = 2000\n\n\tstart := time.Now()\n\tfor i := 0; i < txCount; i++ {\n\t\ttx := mockTx()\n\t\t_, err := proto.Marshal(tx)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tt.FailNow()\n\t\t}\n\t}\n\n\tt.Log(time.Since(start))\n}", "title": "" }, { "docid": "48b47622778f030479dbf398d4650170", "score": "0.5270752", "text": "func getPingTime(pingTest regionPingTime, ch chan regionPingTime) {\n\n\tpinger, err := ping.NewPinger(pingTest.address)\n\tif err == nil {\n\n\t\t// set ping parameters\n\t\tpinger.Count = 3\n\t\tpinger.Timeout = time.Millisecond * maxPingTime // milliseconds\n\n\t\t// do the ping test\n\t\terr = pinger.Run() // blocks until finished\n\t\tif err == nil {\n\t\t\t// get results\n\t\t\tstats := pinger.Statistics() // get send/receive/rtt stats\n\n\t\t\t// save results\n\t\t\tpingTime := stats.AvgRtt.Milliseconds()\n\t\t\tpingTest.time = int(pingTime)\n\t\t}\n\t}\n\n\tif err != nil {\n\t\t// log the error\n\t\tfmt.Println(err)\n\t}\n\n\t// pass results back to caller\n\t// note: need to pass something back whether worked or not\n\t// callers waits until gets all results\n\tch <- pingTest\n\n}", "title": "" }, { "docid": "2220f85638beb1380da7603b0a1c713c", "score": "0.5269818", "text": "func DelaySecond(n time.Duration) {\n\ttime.Sleep(n * time.Second)\n}", "title": "" }, { "docid": "6bfbd21473b3c8690fdc6f39ff2fe475", "score": "0.5264757", "text": "func (g *gossip) ComputeProtocolDelay() time.Duration {\n\tg.protocol.RLock()\n\tdefer g.protocol.RUnlock()\n\n\tvar delay time.Duration\n\n\tif g.protocol.numPeriods != 0 {\n\t\ttarget := g.protocol.lastPeriod.Add(g.protocol.lastRate)\n\t\tdelay = time.Duration(math.Max(float64(target.Sub(time.Now())), float64(g.minProtocolPeriod)))\n\t} else {\n\t\t// delay for first tick in [0, minProtocolPeriod]ms\n\t\tdelay = time.Duration(rand.Intn(int(g.minProtocolPeriod + 1)))\n\t}\n\n\tg.node.EmitEvent(ProtocolDelayComputeEvent{\n\t\tDuration: delay,\n\t})\n\treturn delay\n}", "title": "" }, { "docid": "130266106adcc8eaf3d05c41307fe12d", "score": "0.52538335", "text": "func start(conn *net.TCPConn) {\n session := getSession()\n message := &pb.Message{\n Action: pb.Message_CONNECT,\n NodeId: nodeId,\n SiteId: 1,\n Session: session,\n IpBlackList: []string{randomdata.IpV4Address(), randomdata.IpV4Address()},\n UuidBlackList: []string{randomdata.MacAddress(), randomdata.MacAddress()},\n UuidWhiteList: []string{randomdata.MacAddress(), randomdata.MacAddress()},\n }\n\n sessions[session] = time.Now()\n\n buffer, _ := proto.Marshal(message)\n _, err := conn.Write(buffer)\n //fmt.Println(lens)\n if err != nil {\n fmt.Println(err.Error())\n conn.Close()\n return\n }\n\n for {\n ticker := time.NewTicker(time.Millisecond * 500)\n select {\n case <-ticker.C:\n session := getSession()\n message := &pb.Message{\n Action: pb.Message_REPORT,\n NodeId: nodeId,\n SiteId: 1,\n Session: session,\n IpBlackList: []string{randomdata.IpV4Address(), randomdata.IpV4Address()},\n UuidBlackList: []string{randomdata.MacAddress(), randomdata.MacAddress()},\n UuidWhiteList: []string{randomdata.MacAddress(), randomdata.MacAddress()},\n }\n sessions[session] = time.Now()\n\n if send(conn, message) == false {\n break\n }\n }\n }\n}", "title": "" }, { "docid": "5f284082bc7b69ca8dd85391cd7fd6b7", "score": "0.5250056", "text": "func benchmarkStreamThroughput(b *testing.B, client, server *muxTester, srvAddr string) {\n\t// Prepare a handler to be registered by the server.\n\thandler := func(stream Stream) {\n\t\t// Read from the stream.\n\t\t_, err := io.Copy(ioutil.Discard, stream)\n\t\tif errors.Contains(err, io.ErrClosedPipe) {\n\t\t\treturn // shutdown\n\t\t}\n\t\tif err != nil {\n\t\t\tb.Error(err)\n\t\t}\n\t}\n\tif err := server.NewListener(\"test\", handler); err != nil {\n\t\tb.Fatal(err)\n\t}\n\n\t// Declare some vars.\n\tnumThreads := runtime.NumCPU()\n\tbytesPerOperation := numThreads * 10 * 1 << 20 // 10 MiB * numThreads\n\tb.SetBytes(int64(bytesPerOperation))\n\tdata := fastrand.Bytes(bytesPerOperation)\n\n\t// Declare the sending thread.\n\tstart := make(chan struct{})\n\tsender := func(stream Stream) {\n\t\t<-start\n\t\t// Write data\n\t\tfor i := 0; i < b.N; i++ {\n\t\t\t_, err := stream.Write(data)\n\t\t\tif err != nil {\n\t\t\t\tb.Error(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\t// Close the stream.\n\t\terr := stream.Close()\n\t\tif err != nil {\n\t\t\tb.Error(err)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// start pool\n\tvar wg sync.WaitGroup\n\tfor i := 0; i < numThreads; i++ {\n\t\t// Connect to the server.\n\t\tstream, err := client.NewStream(\"test\", srvAddr, server.publicKey())\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t\treturn\n\t\t}\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tsender(stream)\n\t\t\twg.Done()\n\t\t}()\n\t}\n\n\t// reset timer\n\tb.ResetTimer()\n\n\t// start the threads\n\tclose(start)\n\n\t// wait for them to finish\n\twg.Wait()\n\n\t// log some info\n\tb.Logf(\"Ran test with %v threads\", numThreads)\n}", "title": "" }, { "docid": "0ee97b3d9d10acaa2cd5e8833fe8bc6a", "score": "0.52499115", "text": "func runtimeNano() int64", "title": "" }, { "docid": "0ee97b3d9d10acaa2cd5e8833fe8bc6a", "score": "0.52499115", "text": "func runtimeNano() int64", "title": "" }, { "docid": "03b20e5ba9d4bce8a8e87c0e301583ba", "score": "0.5244603", "text": "func collectStats(url string, sampleSec int) {\n\tfirstResult := request(url, sampleSec, nil)\n\tfor {\n\t\ttime.Sleep(time.Duration(sampleSec) * time.Second)\n\t\tfirstResult = request(url, sampleSec, firstResult)\n\t}\n}", "title": "" }, { "docid": "deddc6f9cabd0a14b3d64b79dea2f9c3", "score": "0.5238035", "text": "func TestStressBroadcastMessageMultiplePeers(t *testing.T) {\n\n}", "title": "" }, { "docid": "91f41038b1a0f7e4db052031095e47bb", "score": "0.52353746", "text": "func Start(tps structs.TPSReport, responseChannels []chan *structs.Response,\n\tconnectionStart time.Time, metrics *structs.Bootstrap, waitGroup *sync.WaitGroup) {\n\tdefer waitGroup.Done()\n\tdone := false\n\n\trandom := rand.New(rand.NewSource(time.Now().UnixNano()))\n\n\t// Send a request every 1/Frequency seconds (at fastest)\n\tticker := time.NewTicker(time.Second / time.Duration(tps.Frequency))\n\tfor range ticker.C {\n\t\t// if boot channel was closed, it's time to break\n\t\tif done {\n\t\t\tticker.Stop()\n\t\t\tbreak\n\t\t}\n\n\t\tindex := random.Intn(len(tps.Routes)) // Generate random index\n\t\troute := tps.Routes[index]\n\n\t\t//request := createRequest(route)\n\n\t\trequestStart := time.Now()\n //httpResponse, err := tps.Transport.RoundTrip(request)\n httpResponse, err := http.Get(route.Url)\n duration := time.Since(requestStart).Nanoseconds()\n\t\tresponse := handleResponse(httpResponse, err != nil)\n\n\t\t// hit all the described dependencies in routes.json\n\t\tfor _, dependency := range route.MandatoryDependencies {\n\t\t\trequest := createRequest(dependency)\n\t\t\thttpResponse, err := tps.Transport.RoundTrip(request)\n\t\t\thandleResponse(httpResponse, err != nil)\n\t\t}\n\n\t\tresponse.Start = requestStart\n\t\tresponse.Duration = duration\n\n\t\tselect {\n\t\tcase responseChannels[index] <- response:\n\t\t\t// if response.Duration > threshold ... \n\t\t\t\t// tails.AddResponse(response.Duration)\n\t\t\tdone = metrics.AddResponse(response.Duration)\n\t\t\tfmt.Printf(\"Sending requests: %.1f seconds\\r\", time.Since(connectionStart).Seconds())\n\t\tdefault:\n\t\t\tdone = true\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d84290442eb27b00a26b36def85c56cf", "score": "0.52325815", "text": "func load(testUrl string, reqRate int, burstRate int, timeout int, runtime int) {\n\ttimeoutTick := time.Tick(time.Duration(runtime) * time.Second)\n\tinterval := time.Duration((1000000*burstRate)/reqRate) * time.Microsecond\n\tperiod := time.Tick(interval)\n\tfor {\n\t\t// fire off burst\n\t\tfor i := 0; i < burstRate; i++ {\n\t\t\tgo request(timeout, testUrl)\n\t\t}\n\t\t// wait for next tick\n\t\t<-period\n\t\tselect {\n\t\tcase <-timeoutTick:\n\t\t\treturn\n\t\tdefault:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fb24f2806598d7143ead3ae5bd09646f", "score": "0.52318627", "text": "func Delay64(r1 uint64) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "44e2fcedca472a0e8787e94e6a3b4955", "score": "0.52313054", "text": "func (e *Endpoint) ReduceLatency() {\n\te.mutex.Lock()\n\te.averageLatency = e.averageLatency * 0.99\n\te.mutex.Unlock()\n}", "title": "" }, { "docid": "30e00a851fbb2e597ee9ddbbb9246d10", "score": "0.5226323", "text": "func Delay(duration int, timescale string) error {\n\tif timescale == \"ms\" {\n\t\ttime.Sleep(time.Millisecond * time.Duration(duration))\n\t\treturn nil\n\t}\n\n\tif timescale == \"s\" {\n\t\ttime.Sleep(time.Second * time.Duration(duration))\n\t\treturn nil\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "32dba4b61fbea7934ed01ad6371f7a0d", "score": "0.5223457", "text": "func (t *Timer) Send() {\n\tt.statser.TimingDuration(t.name, t.duration(), t.tags)\n}", "title": "" }, { "docid": "8f8434ccbd183c90b8476beb38277262", "score": "0.52218795", "text": "func c_nanosleep(time *Timespec, leftover *Timespec) _C_int", "title": "" }, { "docid": "95a364a6f0494e6d5841d298dd206f10", "score": "0.52080625", "text": "func networkDelayTime(times [][]int, N int, K int) int {\n\tkToNodeCost := make(map[int]int)\n\tminArrival := make(map[int]bool)\n\tminArrival[K] = true\n\tkToNodeCost[K] = 0\n\tcurrMinArrival := K\n\tg := makeGraph(times, N)\n\n\tfor len(minArrival) != N {\n\t\tedges := g.FindNeighbor(currMinArrival)\n\t\t// fmt.Printf(\"curr:%d\\n\", currMinArrival)\n\t\tfor _, e := range edges {\n\t\t\t_, ok := kToNodeCost[e.to]\n\n\t\t\t// fmt.Printf(\"%s\\n\", e)\n\t\t\tif !ok || kToNodeCost[currMinArrival]+e.cost < kToNodeCost[e.to] {\n\t\t\t\tkToNodeCost[e.to] = kToNodeCost[currMinArrival] + e.cost\n\t\t\t}\n\t\t}\n\t\tcurrMinArrival = nextMinArrival(kToNodeCost, minArrival)\n\t\tif currMinArrival == -1 {\n\t\t\tbreak\n\t\t}\n\t\t// fmt.Printf(\"next:%d\\n\", currMinArrival)\n\t\tminArrival[currMinArrival] = true\n\t\t// fmt.Printf(\"%+v\\n\", kToNodeCost)\n\t}\n\n\tif len(minArrival) != N {\n\t\treturn -1\n\t}\n\n\tmaxCost := 0\n\tfor _, cost := range kToNodeCost {\n\t\tif cost > maxCost {\n\t\t\tmaxCost = cost\n\t\t}\n\t}\n\n\treturn maxCost\n}", "title": "" }, { "docid": "87c030d918e80b1af0787a13ac4f0c40", "score": "0.5201724", "text": "func (client *TCPClient) getTime() {\n\tvar tms syscall.Tms\n\tsyscall.Times(&tms)\n\tclient.Times = append(client.Times, tms)\n}", "title": "" }, { "docid": "e9aa51d39bbf0819aa1d4b98e6a9fe24", "score": "0.51945615", "text": "func c_times(tms *Tms) _clock_t", "title": "" }, { "docid": "85c18cce8a8d3b9c2192638a7dc50211", "score": "0.5180638", "text": "func (c *Counter) record(_time int64) {\n atomic.AddInt64(&c.count, 1)\n atomic.AddInt64(&c.totaltime, _time)\n\n // if longer that 200ms, it is a slow response\n //if _time > 200000000 {\n if _time > 9000000000 {\n atomic.AddInt64(&c.totalslowresp, 1)\n log.Println(\"Slow response -> \", float64(_time)/1.0e9)\n }\n}", "title": "" }, { "docid": "6bf8c876162960e729ffa7bd14b6ab92", "score": "0.51802886", "text": "func TestAdaptiveThrottling(t *testing.T) {\n\tdefer leaktest.AfterTest(t)()\n\tdefer log.Scope(t).Close(t)\n\tctx := context.Background()\n\tif !*runManual {\n\t\tskip.IgnoreLint(t, \"manual test with no --run-manual\")\n\t}\n\ts, sqlDB, _ := serverutils.StartServer(t, base.TestServerArgs{})\n\tdefer s.Stopper().Stop(ctx)\n\n\tr := sqlutils.MakeSQLRunner(sqlDB)\n\tr.Exec(t, \"SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false\")\n\tr.Exec(t, \"CREATE TABLE xyz (x INT, y INT, z INT)\")\n\n\t// log prints the message to stdout and to the test log.\n\tlog := func(msg string) {\n\t\tfmt.Println(msg)\n\t\tt.Log(msg)\n\t}\n\n\tstep := func(msg string, fn func()) {\n\t\tfmt.Println(msg)\n\t\tbefore := timeutil.Now()\n\t\tfn()\n\t\tlog(fmt.Sprintf(\"%s took %s\", msg, timeutil.Now().Sub(before)))\n\t}\n\n\tstep(\"Populate table\", func() {\n\t\tfor i := 0; i < 200; i++ {\n\t\t\tr.Exec(t, \"INSERT INTO xyz SELECT x, 2*x, 3*x FROM generate_series(1, 1000) AS g(x)\")\n\t\t}\n\t})\n\n\tfor _, load := range []int{0, 3, 5, 7} {\n\t\tlog(fmt.Sprintf(\"--- Load %d%% ---\", load*10))\n\t\t// Set up a load on each CPU.\n\t\tcancel := make(chan struct{})\n\t\tvar wg sync.WaitGroup\n\t\tfor i := 0; i < runtime.GOMAXPROCS(0); i++ {\n\t\t\twg.Add(1)\n\t\t\tgo func() {\n\t\t\t\trunLoad(load, cancel)\n\t\t\t\twg.Done()\n\t\t\t}()\n\t\t}\n\n\t\t// Sleep for 2 * DefaultMetricsSampleInterval, to make sure the runtime\n\t\t// stats reflect the load we want.\n\t\tsleep := 2 * base.DefaultMetricsSampleInterval\n\t\tfmt.Printf(\"Sleeping for %s\\n\", sleep)\n\t\ttime.Sleep(sleep)\n\t\tstep(\"Create stats\", func() {\n\t\t\tr.Exec(t, \"CREATE STATISTICS __auto__ FROM xyz\")\n\t\t})\n\t\tclose(cancel)\n\t\twg.Wait()\n\t}\n}", "title": "" }, { "docid": "11764d5e869951fc5b8df5c39c39a14b", "score": "0.51800627", "text": "func TestNUDStateReachableTime(t *testing.T) {\n\ttests := []struct {\n\t\tname string\n\t\tbaseReachableTime time.Duration\n\t\tminRandomFactor float32\n\t\tmaxRandomFactor float32\n\t\twant time.Duration\n\t}{\n\t\t{\n\t\t\tname: \"AllZeros\",\n\t\t\tbaseReachableTime: 0,\n\t\t\tminRandomFactor: 0,\n\t\t\tmaxRandomFactor: 0,\n\t\t\twant: 0,\n\t\t},\n\t\t{\n\t\t\tname: \"ZeroMaxRandomFactor\",\n\t\t\tbaseReachableTime: time.Second,\n\t\t\tminRandomFactor: 0,\n\t\t\tmaxRandomFactor: 0,\n\t\t\twant: 0,\n\t\t},\n\t\t{\n\t\t\tname: \"ZeroMinRandomFactor\",\n\t\t\tbaseReachableTime: time.Second,\n\t\t\tminRandomFactor: 0,\n\t\t\tmaxRandomFactor: 1,\n\t\t\twant: time.Duration(defaultFakeRandomNum * float32(time.Second)),\n\t\t},\n\t\t{\n\t\t\tname: \"FractionalRandomFactor\",\n\t\t\tbaseReachableTime: time.Duration(math.MaxInt64),\n\t\t\tminRandomFactor: 0.001,\n\t\t\tmaxRandomFactor: 0.002,\n\t\t\twant: time.Duration((0.001 + (0.001 * defaultFakeRandomNum)) * float32(math.MaxInt64)),\n\t\t},\n\t\t{\n\t\t\tname: \"MinAndMaxRandomFactorsEqual\",\n\t\t\tbaseReachableTime: time.Second,\n\t\t\tminRandomFactor: 1,\n\t\t\tmaxRandomFactor: 1,\n\t\t\twant: time.Second,\n\t\t},\n\t\t{\n\t\t\tname: \"MinAndMaxRandomFactorsDifferent\",\n\t\t\tbaseReachableTime: time.Second,\n\t\t\tminRandomFactor: 1,\n\t\t\tmaxRandomFactor: 2,\n\t\t\twant: time.Duration((1.0 + defaultFakeRandomNum) * float32(time.Second)),\n\t\t},\n\t\t{\n\t\t\tname: \"MaxInt64\",\n\t\t\tbaseReachableTime: time.Duration(math.MaxInt64),\n\t\t\tminRandomFactor: 1,\n\t\t\tmaxRandomFactor: 1,\n\t\t\twant: time.Duration(math.MaxInt64),\n\t\t},\n\t\t{\n\t\t\tname: \"Overflow\",\n\t\t\tbaseReachableTime: time.Duration(math.MaxInt64),\n\t\t\tminRandomFactor: 1.5,\n\t\t\tmaxRandomFactor: 1.5,\n\t\t\twant: time.Duration(math.MaxInt64),\n\t\t},\n\t\t{\n\t\t\tname: \"DoubleOverflow\",\n\t\t\tbaseReachableTime: time.Duration(math.MaxInt64),\n\t\t\tminRandomFactor: 2.5,\n\t\t\tmaxRandomFactor: 2.5,\n\t\t\twant: time.Duration(math.MaxInt64),\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tc := stack.NUDConfigurations{\n\t\t\t\tBaseReachableTime: test.baseReachableTime,\n\t\t\t\tMinRandomFactor: test.minRandomFactor,\n\t\t\t\tMaxRandomFactor: test.maxRandomFactor,\n\t\t\t}\n\t\t\t// A fake random number generator is used to ensure deterministic\n\t\t\t// results.\n\t\t\trng := fakeRand{\n\t\t\t\tnum: defaultFakeRandomNum,\n\t\t\t}\n\t\t\tvar clock faketime.NullClock\n\t\t\ts := stack.NewNUDState(c, &clock, rand.New(&rng))\n\t\t\tif got, want := s.ReachableTime(), test.want; got != want {\n\t\t\t\tt.Errorf(\"got ReachableTime = %q, want = %q\", got, want)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "06cefcd2565ae2173190d17d4458c8a9", "score": "0.5160256", "text": "func (d *controller) minimizeLatency() {\n\td.minRetryDelay = 50 * time.Millisecond\n\td.maxRetryDelay = 2 * time.Second\n}", "title": "" }, { "docid": "a2bed8c408c3235b2b8fe50d35bf00a6", "score": "0.51579136", "text": "func sleepTicks(d timeUnit) {\n\tfor d != 0 {\n\t\tticks() // update timestamp\n\t\tticks := uint32(d)\n\t\ttimerSleep(ticks)\n\t\td -= timeUnit(ticks)\n\t}\n}", "title": "" }, { "docid": "12ac9ae7c74124e3aae2cb9bfc032d48", "score": "0.5153667", "text": "func MSleep(t int64) {\n\ttime.Sleep(time.Duration(t) * time.Millisecond)\n}", "title": "" }, { "docid": "6496fcf3a245440f393a4286a831ea83", "score": "0.5146301", "text": "func Benchmark_Throughput(b *testing.B) {\n\twq := NewWorkQueue()\n\tip := data.InformationPacket{Type: data.PacketTypeData, Priority: 1}\n\tvar wg sync.WaitGroup\n\n\tvar count = 0\n\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\t<-time.After(200 * time.Millisecond)\n\tLOOP:\n\t\tfor {\n\t\t\tif ip, _ := wq.Pop(); ip != nil {\n\t\t\t\tif ip.Type == data.PacketTypeShutdown {\n\t\t\t\t\tbreak LOOP\n\t\t\t\t} else {\n\t\t\t\t\tcount = count + 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\twq.Push(&ip)\n\t}\n\twq.Push(&data.InformationPacket{Type: data.PacketTypeShutdown, Priority: 0})\n\twg.Wait()\n\tif count != b.N {\n\t\tb.Errorf(\"Popped count does not equal sent count: %d != %d\", count, b.N)\n\t}\n}", "title": "" }, { "docid": "cbb60a5ffb3b22f2b57deed5e71a3310", "score": "0.5142548", "text": "func someNetworkCall(ctx context.Context) error {\n\tselect {\n\tcase <-time.After(20 * time.Second):\n\t\treturn nil\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\t}\n}", "title": "" }, { "docid": "5b1a6a4cb47a79be1ebb21e7a7765f84", "score": "0.5134719", "text": "func TestEncodeBlockTimeUsage(t *testing.T) {\n\tvar blockCount = 500\n\tblock := mockBlock(3000)\n\n\tstart := time.Now()\n\tfor i := 0; i < blockCount; i++ {\n\t\t_, err := proto.Marshal(block)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tt.FailNow()\n\t\t}\n\t}\n\n\tt.Log(time.Since(start))\n}", "title": "" }, { "docid": "792548e0530dac70ca7aa14e49145503", "score": "0.513147", "text": "func Delay(seconds float32) {\n\ttime.Sleep(int64(seconds * 1e9))\n}", "title": "" }, { "docid": "2764e27a12660865157bc830834a1f5b", "score": "0.5130867", "text": "func TestScalability_1(t *testing.T){\n\tservernumber:=7\n\tserveraddrs:= make([]string,servernumber)\n\tHTTPHosts:=make([]string,servernumber)\n\tfor i:=0;i<servernumber;i++{\n\t\tserveraddrs[i]=\"localhost:\"+strconv.Itoa(9000+i)\n\t\tHTTPHosts[i]=\"http://\"+serveraddrs[i]\n\t}\n\tvar value int64 \n\tservers := make([]*Server,servernumber)\n\tsCloseChans :=make([]chan error,servernumber)\n\tfor i:=0;i<servernumber;i++{\n\t\tservers[i],sCloseChans[i]=YourServer(serveraddrs[i])\n\t\tservers[i].AddHandlerFunc(\"/add\", wrapYourAddFunc(&value))\n\t\tservers[i].AddHandlerFunc(\"/value\", wrapYourValueFunc(&value))\n\t}\n\tc := NewClientSize(100)\n\tnum:=5040\n\ttype Status struct{\n\t\tflag bool\n\t\turl string\n\t\terr error\n\t}\n\twaitComplete :=make(chan Status,num)\n\t//index:=make(chan int, num)\n\tfor i:=1;i<=servernumber;i++{\n\t\tn:=i\n\t\tfmt.Printf(\"connect to %v server:\\n\",n)\n\t\t/*for n:=0;n<num/i;n++{\n\t\t\tfor m:=0;m<i;m++{\n\t\t\t\tindex<-m\n\t\t\t}\n\t\t}*/\n\t\tstart:=time.Now()\n\t\tfor j:=0;j<n;j++{\n\t\t\tm:=j\n\t\t\tgo func(){\n\t\t\t\tfor jj:=0;jj<num/n;jj++{\n\t\t\t\t\tgo func(ii int){\n\t\t\t\t\t\treqBodyData := []byte(\"1\")\n\t\t\t\t\t\tif resp, err := c.Post(HTTPHosts[m]+\"/add\", int64(len(reqBodyData)),\n\t\t\t\t\t\t\tbytes.NewReader(reqBodyData)); err != nil || resp == nil {\n\t\t\t\t\t\t\twaitComplete <- Status{flag: false, url: \"/add\", err: err}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresp.Body.Close()\n\t\t\t\t\t\t\twaitComplete <- Status{flag: true}\n\t\t\t\t\t\t}\n\t\t\t\t\t}(jj)\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\t\n\t\tfor i := 0; i < cap(waitComplete); i++ {\n\t\t\tselect {\n\t\t\t\tcase status := <-waitComplete:\n\t\t\t\t\tif !status.flag {\n\t\t\t\t\t\tt.Fatalf(\"Get(%v) failed, error:%v\", status.url, status.err)\n\t\t\t\t\t}\n\t\t\t\t\tcase <-time.After(time.Millisecond * 500):\n\t\t\t\t\t\tt.Fatalf(\"wait reply timeout\")\n\t\t\t\t\t}\n\t\t}\n\t\telapsedMs := time.Since(start).Nanoseconds() / int64(time.Millisecond)\n\t\tfmt.Printf(\"Cost: %v ms\\n\", elapsedMs)\n\t}\n\tfor i:=0;i<servernumber;i++{\n\t\tservers[i].Close()\n\t\tif err := <-sCloseChans[i]; err == nil {\n\t\t\tfmt.Printf(\"Server%v closed\\n\",i)\n\t\t} else {\n\t\t\tt.Fatalf(\"%v\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "998035f29ea0eb5163bdb819bb22df0e", "score": "0.51287353", "text": "func MS(d int) {\n\ttime.Sleep(time.Duration(d) * time.Millisecond)\n}", "title": "" }, { "docid": "0a608703bb0d07f358ede15983332d83", "score": "0.5121479", "text": "func latencyFunc(rpcCtx *rpc.Context) kvcoord.LatencyFunc {\n\tif rpcCtx != nil {\n\t\treturn rpcCtx.RemoteClocks.Latency\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c9bfa0e8b6efe863c5efe31fe3ff75f3", "score": "0.5119517", "text": "func (d LatencyReportingDoer) Do(req *http.Request) (*http.Response, error) {\n\tstartedAt := time.Now()\n\tresp, err := d.Doer.Do(req)\n\telapsed := time.Since(startedAt)\n\n\td.Collector.Send(\n\t\tVncAPILatencyStatsLog(req.Context(), d.Operation, d.Application, int64(elapsed/time.Microsecond)),\n\t)\n\n\treturn resp, err\n}", "title": "" }, { "docid": "0b99c9036a92d5d85c154433820de2e6", "score": "0.5118082", "text": "func USleep(t int64) {\n\ttime.Sleep(time.Duration(t) * time.Microsecond)\n}", "title": "" }, { "docid": "3efe79f589f7a9eca0149f5d7d73178c", "score": "0.5117711", "text": "func cpu(p float64) tasklet {\n\treturn func(l *log.Logger, done <-chan struct{}) {\n\t\tl.Printf(\"Start CPU load %2.2f%%\", p*100)\n\t\tfor end := false; !end; {\n\t\t\tselect {\n\t\t\tcase <-done:\n\t\t\t\tend = true\n\t\t\tdefault: // this should run about 10 ms\n\t\t\t\tt := time.Now()\n\t\t\t\tcpuloop(int(p * 10000.0))\n\t\t\t\ttime.Sleep(\n\t\t\t\t\ttime.Duration(\n\t\t\t\t\t\t(1.0 - p) * float64(time.Since(t))))\n\t\t\t}\n\t\t}\n\t\tl.Println(\"End CPU load\")\n\t}\n}", "title": "" }, { "docid": "00df3febb543565743dba5872f3949fb", "score": "0.51135266", "text": "func Latency(t time.Duration) Option {\n\treturn func(args *Options) {\n\t\targs.Latency = t\n\t}\n}", "title": "" }, { "docid": "6511514df9b2a42d6db5ae2c3b079b67", "score": "0.5106473", "text": "func TestStressBroadcastMessage(t *testing.T) {\n\n}", "title": "" }, { "docid": "e084c4cca7e8d782e88f942ce2c4e69e", "score": "0.50949025", "text": "func (c8 *cpu) emulateOneCycle() {\n // Fetch instruction\n inst := c8.fetchInstruction()\n // Execute instruction\n c8.executeInstruction(inst)\n //update timers\n}", "title": "" }, { "docid": "9a4bf41569d78503ce02529fddae1dc6", "score": "0.508744", "text": "func Test_CheckErrorThrottling(t *testing.T) {\n\tthrottleTimeSec := time.Duration(2)\n\totpUser, hotp := addDefaultOtpUserGetHotp(t, throttleTimeSec)\n\n\tfor i := 0; i < 10; i++ {\n\t\trefTime := time.Now()\n\t\totpUser.setBlockedState(false) // so the user will not be blocked\n\t\tfactor := time.Duration(i+1) * throttleTimeSec //was int32(math.Pow(2, float64(i))) * throttleTimeSec\n\t\tok, err := otpUser.verifyOtpUserCodeHelper(wrongCode, HotpType, factor) // error codes to increase the delay\n\t\tif err != nil {\n\t\t\tt.Error(\"Test fail, err:\", err)\n\t\t}\n\t\tthrottleTimer, err := otpUser.getOtpUserThrottlingTimer(TotpType)\n\t\tif err != nil {\n\t\t\tt.Error(\"Test fail, err:\", err)\n\t\t} else {\n\t\t\texpected := time.Now().Add(time.Duration(factor) * time.Second)\n\t\t\tif throttleTimer.After(expected) {\n\t\t\t\tfmt.Printf(\"Test failed, expected the throttle value to be lower than %v, but the return throttling value was %v. Time now is %v and factor is%v\\n\",\n\t\t\t\t\texpected, throttleTimer, time.Now(), factor)\n\t\t\t\tt.Errorf(\"Test failed, expected the throttle value to be lower than %v, but the returned throttling value was %v\",\n\t\t\t\t\texpected, throttleTimer)\n\t\t\t}\n\t\t\tif i == 0 { // check that the throttling timer work OK for the basic unit\n\t\t\t\tcode, _ := hotp.AtCount(hotp.Count)\n\t\t\t\tcodeOk, _ := otpUser.VerifyOtpUserCode(code, HotpType) // test should not be checked before throttling duration\n\t\t\t\tif codeOk {\n\t\t\t\t\tt.Error(\"Test fail, Time:\", time.Now(), \", OTP shuld not be checked before:\", throttleTimer)\n\t\t\t\t}\n\t\t\t\tcodeOk, err = otpUser.verifyOtpUserCodeHelper(code, HotpType, factor)\n\t\t\t\tif debug {\n\t\t\t\t\tfmt.Println(\"Calculated code = \", code, \", match = \", ok)\n\t\t\t\t}\n\t\t\t\tif !codeOk || err != nil {\n\t\t\t\t\tt.Errorf(\"Test fail, expected to be throttle for: %vs, checked after %v, err: %v\",\n\t\t\t\t\t\tthrottleTimeSec, time.Now().Unix()-refTime.Unix(), err)\n\t\t\t\t}\n\t\t\t\tif codeOk { // advance the internal counter\n\t\t\t\t\thotp.Next()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "50c601b2853ea9d0e5ff9e0c0d4b4c9e", "score": "0.5086244", "text": "func TestLoadGen(t *testing.T) {\n\n\t// Execution values\n\tconfig := RunConfig{}\n\tconfig.TPS = 1\n\tconfig.Duration = 10\n\n\tbody, _ := json.Marshal(map[string]string{\n\t\t\"message\": \"Hello world\",\n\t})\n\n\t// Use the built-in http hammer\n\thammer := HTTPHammer{}\n\thammer.Endpoint = \"http://127.0.0.1:3000/foo\"\n\thammer.Method = \"PUT\"\n\thammer.ContentType = \"application/json\"\n\thammer.Body = body\n\n\t// Expected values\n\trequests := 0\n\ttotalExpected := config.TPS * config.Duration\n\n\t// Prepare web server\n\tdone := make(chan bool)\n\ttimeout := time.After(20 * time.Second)\n\thttp.HandleFunc(\"/foo\", func(w http.ResponseWriter, r *http.Request) {\n\t\t// Incrementing this global vairable is a bad idea because\n\t\t// there may be race conditions if tps > 1. But for now is fine\n\t\t// as I only have 1 tps.\n\t\trequests++\n\n\t\tvar msg map[string]string\n\t\tjson.NewDecoder(r.Body).Decode(&msg)\n\n\t\t// Assertions\n\t\tif r.Method != \"PUT\" {\n\t\t\tt.Error(\"Expected http method to be PUT\")\n\t\t}\n\n\t\tif r.Header.Get(\"Content-Type\") != \"application/json\" {\n\t\t\tt.Error(\"Expected content-type to be json\")\n\t\t}\n\n\t\tif msg[\"message\"] != \"Hello world\" {\n\t\t\tt.Error(\"Expected body to have a hello world message\")\n\t\t}\n\n\t\tif requests == totalExpected {\n\t\t\t// We are done\n\t\t\tfmt.Printf(\"Total requests received %d\\n\", requests)\n\t\t\tdone <- true\n\t\t}\n\t})\n\n\t// Start listening for requests\n\tgo http.ListenAndServe(\":3000\", nil)\n\ttime.Sleep(2 * time.Second)\n\n\t// Start load test\n\tgo Run(config, hammer)\n\n\t// This select is useful to know if we have finished\n\t// receiving all requests or if we timeout.\n\tselect {\n\tcase <-done:\n\t\tfmt.Println(\"Test completed\")\n\tcase <-timeout:\n\t\tt.Error(\"Test timeout\")\n\t\tfmt.Printf(\"Requests received %d\\n\", requests)\n\t}\n}", "title": "" }, { "docid": "4207df53eccacf911bf1f3945e62bde6", "score": "0.50858104", "text": "func (p *WorkerRPC) GetLatency(req LatencyReq, latency *int) error {\n\tfmt.Println(\"received call to GetLatency()\")\n\t*latency = getLatency(req)\n\treturn nil\n}", "title": "" }, { "docid": "56af1da20b12da92abd9fd1437648b0d", "score": "0.50853074", "text": "func (s sender) Timing(stat string, duration time.Duration, tags ...string) {\n\t// Not supported, just ignored\n}", "title": "" }, { "docid": "52dc0bc37661cebf2bac9abe575307d2", "score": "0.50808", "text": "func statsTracker(start time.Time) {\n\ts.lock.Lock()\n\tdefer s.lock.Unlock()\n\t\n\ts.requests++\n\ts.totalTime = s.totalTime + time.Since(start).Nanoseconds() / 1000;\n}", "title": "" }, { "docid": "39a735cb0722eb291ffe5ec0f8de7206", "score": "0.507725", "text": "func profile(profFile string, dieAfter time.Duration, readyCh <-chan struct{}) {\n\tch := make(chan os.Signal, 1)\n\tsignal.Notify(ch, os.Interrupt)\n\tgo func() {\n\t\tif readyCh != nil {\n\t\t\t<-readyCh\n\t\t}\n\t\tstart := time.Now()\n\t\tinitialUserTime, initialSysTime := getRusage()\n\t\tpacketsInitiallySent, packetsInitiallyReceived := MQTT.GetStats()\n\n\t\tf, err := os.Create(profFile)\n\t\tif err != nil {\n\t\t\tError.Fatalf(\"error creating profiling file: %s\", err)\n\t\t}\n\t\tpprof.StartCPUProfile(f)\n\n\t\t// TBD: add timer\n\t\tvar dieCh <-chan time.Time = nil\n\t\tif dieAfter > 0 {\n\t\t\tdieCh = time.After(dieAfter)\n\t\t}\n\t\tselect {\n\t\tcase <-ch:\n\t\tcase <-dieCh:\n\t\t}\n\t\tnewUserTime, newSysTime := getRusage()\n\t\telapsed := time.Since(start)\n\t\tif elapsed == 0 {\n\t\t\tfmt.Fprintln(os.Stderr, \"oops, no time elapsed?\")\n\t\t\treturn\n\t\t}\n\t\telapsedUserTime := newUserTime - initialUserTime\n\t\telapsedSysTime := newSysTime - initialSysTime\n\t\telapsedCpuTime := elapsedUserTime + elapsedSysTime\n\t\tcpuLoadUser := float64(elapsedUserTime) * 100.0 / float64(elapsed)\n\t\tcpuLoadSys := float64(elapsedSysTime) * 100.0 / float64(elapsed)\n\t\tcpuLoad := float64(elapsedCpuTime) * 100.0 / float64(elapsed)\n\n\t\tnewPacketsSent, newPacketsReceived := MQTT.GetStats()\n\t\tpacketsSent := newPacketsSent - packetsInitiallySent\n\t\tpacketsReceived := newPacketsReceived - packetsInitiallyReceived\n\t\tif packetsSent > 0 || packetsReceived > 0 {\n\t\t\tpacketsSentPerSecond := float64(packetsSent) * float64(time.Second) /\n\t\t\t\tfloat64(elapsed)\n\t\t\tpacketsReceivedPerSecond := float64(packetsReceived) * float64(time.Second) /\n\t\t\t\tfloat64(elapsed)\n\t\t\tpacketsSentPerCpuSecond := float64(packetsSent) * float64(time.Second) /\n\t\t\t\tfloat64(elapsedCpuTime)\n\t\t\tpacketsReceivedPerCpuSecond := float64(packetsReceived) * float64(time.Second) /\n\t\t\t\tfloat64(elapsedCpuTime)\n\n\t\t\tfmt.Printf(\"\\n*** %d packets sent (%.2f per sec, %.2f per cpu sec), \"+\n\t\t\t\t\"%d packets received (%.2f per sec, %.2f per cpu sec)\\n\",\n\t\t\t\tpacketsSent, packetsSentPerSecond, packetsSentPerCpuSecond,\n\t\t\t\tpacketsReceived, packetsReceivedPerSecond, packetsReceivedPerCpuSecond)\n\t\t}\n\n\t\tfmt.Printf(\"*** %.2f seconds elapsed, %.2f user, %.2f sys\\n\",\n\t\t\tfloat64(elapsed)/float64(time.Second),\n\t\t\tfloat64(elapsedUserTime)/float64(time.Second),\n\t\t\tfloat64(elapsedSysTime)/float64(time.Second))\n\t\tfmt.Printf(\"*** %.2f%% CPU load, %.2f%% user, %.2f%% sys\\n\",\n\t\t\tcpuLoad, cpuLoadUser, cpuLoadSys)\n\t\tpprof.StopCPUProfile()\n\t\tos.Exit(130)\n\t}()\n}", "title": "" }, { "docid": "3b431f66b1f48e74898050b59cff05d0", "score": "0.507089", "text": "func getNextDelay(t time.Duration) time.Duration {\n\tif t == 0 {\n\t\treturn 5 * time.Millisecond\n\t} else {\n\t\tt *= 2\n\t}\n\tif t > time.Second {\n\t\treturn time.Second\n\t}\n\treturn t\n}", "title": "" }, { "docid": "d7520926daefbe7c00bf076cc71200d2", "score": "0.50685483", "text": "func jitter(t time.Duration) time.Duration {\n\tn, err := rand.Int(rand.Reader, big.NewInt(int64(t)))\n\tif err != nil {\n\t\t// Hopefully, this would never happen.\n\t\tpanic(fmt.Sprintf(\"unable to read random bytes: %s\", err.Error()))\n\t}\n\treturn time.Duration(n.Int64())\n}", "title": "" }, { "docid": "ba9c615ff47378d96f8d5c8bad1ed243", "score": "0.506268", "text": "func Stat(isSuccess bool, rtime time.Time) {\n\tcost := uint64(common.ToMSTimestamp(time.Now()) - common.ToMSTimestamp(rtime))\n\n\tif atomic.LoadUint64(&reqCount) == 0 {\n\t\tstartTime = uint64(common.ToMSTimestamp(time.Now()))\n\t}\n\n\tatomic.AddUint64(&rtimeCount, cost)\n\tatomic.AddUint64(&reqCount, 1)\n\n\tif isSuccess {\n\t\tatomic.AddUint64(&succCount, 1)\n\t} else {\n\t\tatomic.AddUint64(&failCount, 1)\n\t}\n\n\tfor {\n\t\tmax := atomic.LoadUint64(&maxRtime)\n\n\t\tif cost > max {\n\t\t\tif atomic.CompareAndSwapUint64(&maxRtime, max, cost) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor {\n\t\tmin := atomic.LoadUint64(&minRtime)\n\n\t\tif cost < min || min == 0 {\n\t\t\tif atomic.CompareAndSwapUint64(&minRtime, min, cost) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1313c4063c3629a7bb9f88dbf40f774e", "score": "0.50624734", "text": "func ActualTPS() float64 {\n\treturn clock.ActualTPS()\n}", "title": "" }, { "docid": "ef4247d8c9d9e233e1f3e1204daa524a", "score": "0.50577575", "text": "func TestClock_Ticker_Stp(t *testing.T) {\n\tgo func() {\n\t\ttime.Sleep(10 * time.Millisecond)\n\t}()\n\n\tgosched()\n\n\tticker := clock.New().Ticker(20 * time.Millisecond)\n\t<-ticker.C\n\tticker.Stop()\n\tselect {\n\tcase <-ticker.C:\n\t\tt.Fatal(\"unexpected send\")\n\tcase <-time.After(30 * time.Millisecond):\n\t}\n}", "title": "" }, { "docid": "38baa44b654d639e776dbc3dd6bdca75", "score": "0.50566816", "text": "func main() {\n\tscnAirs := scenarioParser.ReadScenarioFile()\n\tthreats := make([]Threat, len(scnAirs))\n\n\tfor i, air := range scnAirs {\n\t\tthreats[i].id = air.ID\n\t\tthreats[i].x = air.PositionX\n\t\tthreats[i].y = air.PositionY\n\t\tthreats[i].z = air.PositionZ\n\t}\n\n\tconn := connectServer()\n\n\truntime.GOMAXPROCS(1)\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\n\tfmt.Println(\"goroutine go !\")\n\n\tgo func() {\n\t\tdefer wg.Done()\n\n\t\tticker := time.NewTicker(time.Nanosecond * 100)\n\t\toverRange := false\n\n\t\tfor tick := range ticker.C {\n\t\t\tfor i := 0; i < len(threats); i++ {\n\t\t\t\tUpdatePosition(&threats[i])\n\t\t\t\tif threats[i].x > 5000 {\n\t\t\t\t\tfmt.Println(\"theat id '\", i, \"' x range is over 5000 \")\n\t\t\t\t\tticker.Stop()\n\t\t\t\t\toverRange = true\n\t\t\t\t\tbreak\n\n\t\t\t\t} else {\n\t\t\t\t\tdata := scenarioParser.Airthreat{i, \n\t\t\t\t\t\tthreats[i].x, threats[i].y, threats[i].z}\n\t\t\t\t\tsendSimulationData(data, conn)\n\t\t\t\t\tfmt.Println(data, tick)\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif overRange == true {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}()\n\n\tfmt.Println(\"waiting ...\")\n\twg.Wait()\n\n\tdefer conn.Close()\n}", "title": "" }, { "docid": "925ba169a52e2f205e19a1e9d5e5f51c", "score": "0.50494164", "text": "func TrickleRequest(host, url string, payload, min, max uint, counter *Counter) {\n\tconn, err := net.Dial(\"tcp\", \"\", host)\n\tif err != nil {\n\t\tlog.Printf(\"Failed to connect to web server: %s\", err)\n\t\treturn\n\t}\n\n\tcounter.Increment()\n\n\tstupid := \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\trequest := fmt.Sprintf(\"GET /%s HTTP/1.1\\n\", url)\n\tfor len(request) < int(payload) {\n\t\trequest = fmt.Sprintf(\"%sFakeData%d: \\\"%s\\\"\\n\", request, len(request), stupid)\n\t}\n\n\tbytes := []byte(request)\n\tfor idx, _ := range bytes {\n\t\t_, err := conn.Write(bytes[idx:idx+1])\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tdelay := int(min) - rand.Intn(int(max - min))\n\t\ttime.Sleep(int64(delay))\n\t}\n\n\t// Trickle receive the response one byte at a time\n\tsize_32k := 32 * 1024\n\tvar buf []byte = make([]byte, 0, size_32k)\n\n\tfor {\n\t\tn, err := conn.Read(buf)\n\t\tif n == 0 && err == os.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Got an error when reading response: %s\", err)\n\t\t\tbreak\n\t\t}\n\n\t}\n\n\tcounter.Decrement()\n\tif conn != nil {\n\t\tconn.Close()\n\t}\n}", "title": "" }, { "docid": "5983b9a37860985c7dc76be2bda9d58e", "score": "0.50437355", "text": "func (client *StatsdClient) Send(data map[string]string, sampleRate float32) {\r\n\tsampledData := make(map[string]string)\r\n\tif sampleRate < 1 {\r\n\t\tr := rand.New(rand.NewSource(time.Now().Unix()))\r\n\t\trNum := r.Float32()\r\n\t\tif rNum <= sampleRate {\r\n\t\t\tfor stat, value := range data {\r\n\t\t\t\tsampledUpdateString := fmt.Sprintf(\"%s|@%f\", value, sampleRate)\r\n\t\t\t\tsampledData[stat] = sampledUpdateString\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\tsampledData = data\r\n\t}\r\n\r\n\tfor k, v := range sampledData {\r\n\t\tupdate_string := fmt.Sprintf(\"%s:%s\", k, v)\r\n\t\t_, err := fmt.Fprintf(client.conn, update_string)\r\n\t\tif err != nil {\r\n\t\t\tlog.Println(err)\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "7db55bf6d58dfa8da0d4d6837d546608", "score": "0.50360036", "text": "func Test_TW_BigMs(t *testing.T) {\n\tvar exit = make(chan int, 1)\n\tvar count int64\n\tvar interval int64 = 101\n\tvar runs int64 = 2\n\tvar now = time.Now()\n\tAddTimer(TW_BigMs, interval, runs, func() {\n\t\tcount++\n\t\takLog.FmtPrintln(\"TW_BigMs hello...\", count)\n\t\tif count >= runs && runs > 0 {\n\t\t\texit <- 1\n\t\t}\n\t})\n\tselect {\n\tcase <-exit:\n\t\takLog.FmtPrintln(\"TW_BigMs exit...\", time.Since(now))\n\t}\n}", "title": "" }, { "docid": "e38679b13c1a8243c20c2afde5615600", "score": "0.50316495", "text": "func Request(host string) (NtpStats, error) {\n\tsaneEpoch := time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC)\n\tstats := NtpStats{}\n\traddr, err := net.ResolveUDPAddr(\"udp\", host+\":123\")\n\tif err != nil {\n\t\treturn stats, err\n\t}\n\n\tcon, err := net.DialUDP(\"udp\", nil, raddr)\n\tif err != nil {\n\t\treturn stats, err\n\t}\n\tdefer con.Close()\n\tcon.SetDeadline(time.Now().Add(5 * time.Second))\n\n\tm := new(msg)\n\tm.SetMode(client)\n\tm.SetVersion(4)\n\toriginTime := time.Now() // time client sent request\n\tm.SetTransmitTime(toNtpTime(originTime))\n\n\terr = binary.Write(con, binary.BigEndian, m)\n\tif err != nil {\n\t\treturn stats, err\n\t}\n\n\terr = binary.Read(con, binary.BigEndian, m)\n\tif err != nil {\n\t\treturn stats, err\n\t}\n\n\tdestinationTime := time.Now() // time client got reply\n\n\treceiveTime := m.ReceiveTime.UTC() // time server got request\n\ttransmitTime := m.TransmitTime.UTC() // time server scheduled reply\n\n\tif receiveTime.Before(saneEpoch) || transmitTime.Before(saneEpoch) {\n\t\treturn stats, errors.New(\"received zero packet\")\n\t}\n\n\t// check that server replies to our request\n\tif m.OriginTime != toNtpTime(originTime) {\n\t\treturn stats, errors.New(\"received bogus packet\")\n\t}\n\n\tnetRttDelay := destinationTime.Sub(originTime)\n\tsrvSchedDelay := transmitTime.Sub(receiveTime)\n\tdelay := netRttDelay - srvSchedDelay\n\n\toffset := (receiveTime.Sub(originTime) + transmitTime.Sub(destinationTime)) / 2\n\n\tstats = NtpStats{delay, offset}\n\treturn stats, nil\n\n}", "title": "" }, { "docid": "cefc7b0c07394a97b936cf97a82e6a13", "score": "0.5023702", "text": "func Endpoint(w http.ResponseWriter, r *http.Request) {\n\ttime.Sleep(200 * time.Millisecond)\n\tfmt.Fprintf(w, \"Slept for 200ms!\")\n}", "title": "" }, { "docid": "efdaeaf1a910d25958f7e9e5effd21e3", "score": "0.5021543", "text": "func pingSite(uri string) (latency int) {\n\ttimeout := time.Duration(time.Duration(httpGetTimeout) * time.Second)\n\tclient := http.Client{\n\t\tTimeout: timeout,\n\t}\n\tstart := time.Now()\n\t_, err := client.Get(uri)\n\n\telapsed := time.Since(start)\n\tcheckError(\"Error in pingSiteOnce(), http.Get():\", err, false)\n\tif err != nil {\n\t\tlatency = -1\n\t} else {\n\t\tlatency = int(elapsed / time.Millisecond)\n\t}\n\treturn\n}", "title": "" }, { "docid": "a34c1f63bd005c4fe7f6ada6be4ed2cb", "score": "0.5021131", "text": "func jitter(baseDelay time.Duration) time.Duration {\n\tdelayNs := baseDelay.Nanoseconds()\n\tmaxJitter := delayNs / 3\n\n\tdelayNs += rand.Int63n(2*maxJitter) - maxJitter\n\n\tif delayNs <= 0 {\n\t\tdelayNs = 1\n\t}\n\n\treturn time.Duration(delayNs) * time.Nanosecond\n}", "title": "" }, { "docid": "429a2d3ba1d531402cb7349230a8232a", "score": "0.50195223", "text": "func timeIt(start time.Time) {\n\telapsed := time.Since(start)\n\tms := int64(elapsed) / int64(time.Millisecond)\n\ts := float64(elapsed) / float64(time.Second)\n\tfmt.Printf(\"Completed in %d milliseconds (%.3f seconds)\\n\", ms, s)\n}", "title": "" } ]
8821c98565a3c29d88b843d2091d7ab4
NewInitCommand returns a new `opsani init` command instance
[ { "docid": "17e8b05d3e41c14d28acf9f9ebd7d16f", "score": "0.8375079", "text": "func NewInitCommand(baseCommand *BaseCommand) *cobra.Command {\n\tinitCmd := &initCommand{BaseCommand: baseCommand}\n\tcmd := &cobra.Command{\n\t\tUse: \"init [INIT_TOKEN]\",\n\t\tAnnotations: map[string]string{\"other\": \"true\"},\n\t\tShort: \"Initialize Opsani CLI configuration\",\n\t\tLong: `Initializes an Opsani config file and acquires the required settings:\n\t\n * 'optimizer': Opsani app to control (OPSANI_OPTIMIZER).\n * 'token': API token to authenticate with (OPSANI_TOKEN).\n\t`,\n\t\tArgs: cobra.MaximumNArgs(1),\n\t\tPersistentPreRunE: initCmd.InitConfigRunE, // Skip loading the config file\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\tif len(args) == 1 {\n\t\t\t\treturn initCmd.RunInitWithTokenCommand(c, args)\n\t\t\t} else {\n\t\t\t\treturn initCmd.RunInitCommand(c, args)\n\t\t\t}\n\t\t},\n\t}\n\tcmd.Flags().BoolVar(&initCmd.confirmed, confirmedArg, false, \"Write config without asking for confirmation\")\n\treturn cmd\n}", "title": "" } ]
[ { "docid": "a453e3b61c5919a3f13486c30ac79d65", "score": "0.8044487", "text": "func NewInitCommand() *cobra.Command {\n\treturn NewCmd(\"init\").\n\t\tWithDescription(\"initialize goployer manifest\").\n\t\tSetFlags().\n\t\tRunWithArgs(funcInit)\n}", "title": "" }, { "docid": "4aaed767526c64ab6d705eeb036cb6f5", "score": "0.7828159", "text": "func newInitCommand(client *client.Client) *Command {\n\n\tinitStrings := docstrings.Get(\"init\")\n\n\tcmd := BuildCommandKS(nil, runInit, initStrings, client, requireSession)\n\n\tcmd.Args = cobra.RangeArgs(0, 1)\n\n\t// TODO: Move flag descriptions into the docStrings\n\tcmd.AddStringFlag(StringFlagOpts{\n\t\tName: \"name\",\n\t\tDescription: \"The app name to use\",\n\t})\n\n\tcmd.AddStringFlag(StringFlagOpts{\n\t\tName: \"org\",\n\t\tDescription: `The organization that will own the app`,\n\t})\n\n\tcmd.AddStringFlag(StringFlagOpts{\n\t\tName: \"port\",\n\t\tShorthand: \"p\",\n\t\tDescription: \"Internal port on application to connect to external services\",\n\t})\n\n\tcmd.AddStringFlag(StringFlagOpts{\n\t\tName: \"builder\",\n\t\tDescription: `The Cloud Native Buildpacks builder to use when deploying the app`,\n\t})\n\n\tcmd.AddStringFlag(StringFlagOpts{\n\t\tName: \"builtin\",\n\t\tDescription: `The Fly Runtime to use for building the app`,\n\t})\n\n\tcmd.AddStringFlag(StringFlagOpts{\n\t\tName: \"image\",\n\t\tDescription: `Deploy this named image`,\n\t})\n\n\tcmd.AddBoolFlag(BoolFlagOpts{\n\t\tName: \"dockerfile\",\n\t\tDescription: `Use a dockerfile when deploying the app`,\n\t\tDefault: false,\n\t})\n\n\tcmd.AddStringFlag(StringFlagOpts{\n\t\tName: \"import\",\n\t\tDescription: \"Create but import all settings from the given file\",\n\t})\n\n\tcmd.AddBoolFlag(BoolFlagOpts{\n\t\tName: \"overwrite\",\n\t\tDescription: \"Always silently overwrite an existing fly.toml file\",\n\t})\n\n\tcmd.AddBoolFlag(BoolFlagOpts{\n\t\tName: \"nowrite\",\n\t\tDescription: \"Never write a fly.toml file\",\n\t})\n\n\tcmd.AddBoolFlag(BoolFlagOpts{\n\t\tName: \"generatename\",\n\t\tDescription: \"Always generate a name for the app\", Hidden: true,\n\t})\n\n\treturn cmd\n}", "title": "" }, { "docid": "ac222102d1aa23bf29383f6ccdd5a0df", "score": "0.7732523", "text": "func NewInitCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Initialize bundle directory\",\n\t\tArgs: cobra.NoArgs,\n\t}\n\n\tsetupInit(cmd)\n\n\treturn cmd\n}", "title": "" }, { "docid": "1f1d02e0f5905354aef26e5b31585df4", "score": "0.750879", "text": "func (c *WebstorectlCommand) newInitCommand() {\n\tinitCmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Write a sample custom resource manifest for a workload to standard out\",\n\t\tLong: \"Write a sample custom resource manifest for a workload to standard out\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\toutputStream := os.Stdout\n\n\t\t\tif _, err := outputStream.WriteString(defaultManifest); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to write to stdout, %w\", err)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tc.AddCommand(initCmd)\n}", "title": "" }, { "docid": "870ff758b845f88d0d9d6725e2a001d6", "score": "0.7297185", "text": "func NewServiceInitCommand(io ui.IO, newClient newClientFunc) *ServiceInitCommand {\n\treturn &ServiceInitCommand{\n\t\tclipWriter: &ClipboardWriterAutoClear{\n\t\t\tclipper: clip.NewClipboard(),\n\t\t},\n\t\tio: io,\n\t\tnewClient: newClient,\n\t\twriteFileFunc: os.WriteFile,\n\t\tcredential: credentials.CreateKey(),\n\t}\n}", "title": "" }, { "docid": "8144bf9706e80ff226d1c38f520a4a92", "score": "0.72957486", "text": "func NewInitCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Create a fresh config file\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tRunInit()\n\t\t},\n\t}\n\n\treturn cmd\n}", "title": "" }, { "docid": "bc363ea084174e9ad60c1361fc378a31", "score": "0.7283029", "text": "func NewCmdInit() *cobra.Command {\n\treturn NewCmd(\"init\").\n\t\tWithDescription(\"Generate configuration for deploying an application\").\n\t\tWithCommonFlags().\n\t\tWithFlags([]*Flag{\n\t\t\t{Value: &skipBuild, Name: \"skip-build\", DefValue: false, Usage: \"Skip generating build artifacts in Skaffold config\", IsEnum: true},\n\t\t\t{Value: &skipDeploy, Name: \"skip-deploy\", DefValue: false, Usage: \"Skip generating deploy stanza in Skaffold config\", Hidden: true, IsEnum: true},\n\t\t\t{Value: &force, Name: \"force\", DefValue: false, Usage: \"Force the generation of the Skaffold config\", IsEnum: true},\n\t\t\t{Value: &composeFile, Name: \"compose-file\", DefValue: \"\", Usage: \"Initialize from a docker-compose file\"},\n\t\t\t{Value: &defaultKustomization, Name: \"default-kustomization\", DefValue: \"\", Usage: \"Default Kustomization overlay path (others will be added as profiles)\"},\n\t\t\t{Value: &cliArtifacts, Name: \"artifact\", FlagAddMethod: \"StringArrayVar\", Shorthand: \"a\", DefValue: []string{}, Usage: \"'='-delimited Dockerfile/image pair, or JSON string, to generate build artifact\\n(example: --artifact='{\\\"builder\\\":\\\"Docker\\\",\\\"payload\\\":{\\\"path\\\":\\\"/web/Dockerfile.web\\\"},\\\"image\\\":\\\"gcr.io/web-project/image\\\"}')\"},\n\t\t\t{Value: &cliKubernetesManifests, Name: \"kubernetes-manifest\", FlagAddMethod: \"StringArrayVar\", Shorthand: \"k\", DefValue: []string{}, Usage: \"A path or a glob pattern to kubernetes manifests (can be non-existent) to be added to the kubectl deployer (overrides detection of kubernetes manifests). Repeat the flag for multiple entries. E.g.: skaffold init -k pod.yaml -k k8s/*.yml\"},\n\t\t\t{Value: &analyze, Name: \"analyze\", DefValue: false, Usage: \"Print all discoverable Dockerfiles and images in JSON format to stdout\", IsEnum: true},\n\t\t\t{Value: &enableNewInitFormat, Name: \"XXenableNewInitFormat\", DefValue: false, Usage: \"\", Hidden: true, IsEnum: true},\n\t\t\t{Value: &enableJibInit, Name: \"XXenableJibInit\", DefValue: true, Usage: \"\", Hidden: true, IsEnum: true},\n\t\t\t{Value: &enableJibGradleInit, Name: \"XXenableJibGradleInit\", DefValue: false, Usage: \"\", Hidden: true, IsEnum: true},\n\t\t\t{Value: &enableKoInit, Name: \"XXenableKoInit\", DefValue: false, Usage: \"\", Hidden: true, IsEnum: true},\n\t\t\t{Value: &enableBuildpacksInit, Name: \"XXenableBuildpacksInit\", DefValue: true, Usage: \"\", Hidden: true, IsEnum: true},\n\t\t\t{Value: &buildpacksBuilder, Name: \"XXdefaultBuildpacksBuilder\", DefValue: \"gcr.io/buildpacks/builder:v1\", Usage: \"\", Hidden: true},\n\t\t\t{Value: &enableManifestGeneration, Name: \"generate-manifests\", DefValue: false, Usage: \"Allows skaffold to try and generate basic kubernetes resources to get your project started\", IsEnum: true},\n\t\t}).\n\t\tNoArgs(doInit)\n}", "title": "" }, { "docid": "c4f6d027979b78b3dfdd8affa1a4badc", "score": "0.72140765", "text": "func NewCmdInit(loader hailconfig.Loader, w io.Writer) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"init [title]\",\n\t\tShort: \"init initializes an empty .hailconfig file with title as provided\",\n\t\tExample: cmdutil.InitExample,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\to := NewInitOptions()\n\t\t\to.Interpreter, _ = cmd.Flags().GetString(\"interpreter\")\n\t\t\to.Title, _ = cmd.Flags().GetString(\"title\")\n\t\t\tif o.Title == \"\" {\n\t\t\t\tif len(args) < 1 {\n\t\t\t\t\to.Title = \"default\"\n\t\t\t\t} else {\n\t\t\t\t\to.Title = args[0]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcmdutil.CheckErr(\"error in init\", o.Run(&hailconfig.Hailconfig{}, w))\n\t\t\tcmdutil.Success(fmt.Sprintf(\"Initialized a file '%s'\\n\", o.CfgFile))\n\n\t\t},\n\t}\n\tcmd.Flags().StringP(\"title\", \"t\", \"default\", \"title of .hailconfig\")\n\tcmd.Flags().StringP(\"interpreter\", \"i\", \"bash\", \"the default interpreter to run cmds\")\n\treturn cmd\n}", "title": "" }, { "docid": "541228e468801d7df571ed705261a746", "score": "0.71589464", "text": "func NewCmdInit(out io.Writer, initOptions *initOptions) *cobra.Command {\n\tif initOptions == nil {\n\t\tinitOptions = newInitOptions()\n\t}\n\tinitRunner := workflow.NewRunner()\n\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Run this command in order to create a high availability Kubernetes cluster\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t_, err := initRunner.InitData(args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := initRunner.Run(args); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t\tArgs: cobra.NoArgs,\n\t}\n\n\t// adds flags to the init command\n\t// init command local flags could be eventually inherited by the sub-commands automatically generated for phases\n\taddInitConfigFlags(cmd.Flags(), initOptions.kubei)\n\toptions.AddKubeadmConfigFlags(cmd.Flags(), initOptions.kubeadm)\n\n\t// initialize the workflow runner with the list of phases\n\tinitRunner.AppendPhase(phases.NewContainerEnginePhase())\n\tinitRunner.AppendPhase(phases.NewKubeComponentPhase())\n\tinitRunner.AppendPhase(phases.NewKubeadmPhase())\n\n\t// sets the rundata builder function, that will be used by the runner\n\t// both when running the entire workflow or single phases\n\tinitRunner.SetDataInitializer(func(cmd *cobra.Command, args []string) (workflow.RunData, error) {\n\t\treturn newInitData(cmd, args, initOptions, out)\n\t})\n\n\t// binds the Runner to kubei init command by altering\n\t// command help, adding --skip-phases flag and by adding phases subcommands\n\tinitRunner.BindToCommand(cmd)\n\n\treturn cmd\n}", "title": "" }, { "docid": "5e1a5612cc1363bbe2f47d8d5616d0f4", "score": "0.71086025", "text": "func NewCmdInit(commonOpts *opts.CommonOptions) *cobra.Command {\n\toptions := &InitOptions{\n\t\tCommonOptions: commonOpts,\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Init Jenkins X\",\n\t\tLong: initLong,\n\t\tExample: initExample,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\toptions.Cmd = cmd\n\t\t\toptions.Args = args\n\t\t\terr := options.Run()\n\t\t\thelper.CheckErr(err)\n\t\t},\n\t}\n\n\tcmd.Flags().StringVarP(&options.Flags.Provider, \"provider\", \"\", \"\", \"Cloud service providing the Kubernetes cluster. Supported providers: \"+cloud.KubernetesProviderOptions())\n\tcmd.Flags().StringVarP(&options.Flags.Namespace, optionNamespace, \"\", \"jx\", \"The namespace the Jenkins X platform should be installed into\")\n\toptions.AddInitFlags(cmd)\n\treturn cmd\n}", "title": "" }, { "docid": "7c053dd029dac7959e23742649ab838f", "score": "0.7013063", "text": "func NewCmdInit(cmdOut io.Writer, config util.AdminConfig, defaultServerImage, defaultEtcdImage string) *cobra.Command {\n\topts := &initFederation{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"init FEDERATION_NAME --host-cluster-context=HOST_CONTEXT\",\n\t\tShort: \"init initializes a federation control plane\",\n\t\tLong: init_long,\n\t\tExample: init_example,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tcmdutil.CheckErr(opts.Complete(cmd, args))\n\t\t\tcmdutil.CheckErr(opts.Run(cmdOut, config))\n\t\t},\n\t}\n\n\tflags := cmd.Flags()\n\topts.commonOptions.Bind(flags)\n\topts.options.Bind(flags, defaultServerImage, defaultEtcdImage)\n\n\treturn cmd\n}", "title": "" }, { "docid": "3ab47a8a8a461a52522c3d79b750aea0", "score": "0.699271", "text": "func NewCmdInit() *cobra.Command {\n\treturn NewCmd(\"init\").\n\t\tWithDescription(\"[alpha] Generate configuration for deploying an application\").\n\t\tWithCommonFlags().\n\t\tWithFlags(func(f *pflag.FlagSet) {\n\t\t\tf.BoolVar(&skipBuild, \"skip-build\", false, \"Skip generating build artifacts in Skaffold config\")\n\t\t\tf.BoolVar(&skipDeploy, \"skip-deploy\", false, \"Skip generating deploy stanza in Skaffold config\")\n\t\t\tf.MarkHidden(\"skip-deploy\")\n\t\t\tf.BoolVar(&force, \"force\", false, \"Force the generation of the Skaffold config\")\n\t\t\tf.StringVar(&composeFile, \"compose-file\", \"\", \"Initialize from a docker-compose file\")\n\t\t\tf.StringArrayVarP(&cliArtifacts, \"artifact\", \"a\", nil, \"'='-delimited Dockerfile/image pair, or JSON string, to generate build artifact\\n(example: --artifact='{\\\"builder\\\":\\\"Docker\\\",\\\"payload\\\":{\\\"path\\\":\\\"/web/Dockerfile.web\\\"},\\\"image\\\":\\\"gcr.io/web-project/image\\\"}')\")\n\t\t\tf.StringArrayVarP(&cliKubernetesManifests, \"kubernetes-manifest\", \"k\", nil, \"a path or a glob pattern to kubernetes manifests (can be non-existent) to be added to the kubectl deployer (overrides detection of kubernetes manifests). Repeat the flag for multiple entries. E.g.: skaffold init -k pod.yaml -k k8s/*.yml\")\n\t\t\tf.BoolVar(&analyze, \"analyze\", false, \"Print all discoverable Dockerfiles and images in JSON format to stdout\")\n\t\t\tf.BoolVar(&enableNewInitFormat, \"XXenableNewInitFormat\", false, \"\")\n\t\t\tf.MarkHidden(\"XXenableNewInitFormat\")\n\t\t\tf.BoolVar(&enableJibInit, \"XXenableJibInit\", false, \"\")\n\t\t\tf.MarkHidden(\"XXenableJibInit\")\n\t\t\tf.BoolVar(&enableJibGradleInit, \"XXenableJibGradleInit\", false, \"\")\n\t\t\tf.MarkHidden(\"XXenableJibGradleInit\")\n\t\t\tf.BoolVar(&enableBuildpacksInit, \"XXenableBuildpacksInit\", false, \"\")\n\t\t\tf.MarkHidden(\"XXenableBuildpacksInit\")\n\t\t\tf.StringVar(&buildpacksBuilder, \"XXdefaultBuildpacksBuilder\", \"gcr.io/buildpacks/builder\", \"\")\n\t\t\tf.MarkHidden(\"XXdefaultBuildpacksBuilder\")\n\t\t\tf.BoolVar(&enableManifestGeneration, \"XXenableManifestGeneration\", false, \"\")\n\t\t\tf.MarkHidden(\"XXenableManifestGeneration\")\n\t\t}).\n\t\tNoArgs(doInit)\n}", "title": "" }, { "docid": "4e71bc3986e62a8390c339fcfbd634bf", "score": "0.6931295", "text": "func (v *VolumeCreateCommand) Init(c *Cli) {\n\tv.cli = c\n\n\tv.cmd = &cobra.Command{\n\t\tUse: \"create [OPTIONS]\",\n\t\tShort: \"Create a volume\",\n\t\tLong: volumeCreateDescription,\n\t\tArgs: cobra.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn v.runVolumeCreate(args)\n\t\t},\n\t\tExample: volumeCreateExample(),\n\t}\n\tv.addFlags()\n}", "title": "" }, { "docid": "cb2f6b9bddfb925504843ca28a75e6d6", "score": "0.68965006", "text": "func NewCmdMinkInit() (*cobra.Command, *Options) {\n\to := &Options{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\n\t\tShort: \"Creates a .mink.yaml file if one does not exist and the project has a Dockerfileor a buildpack overrides.toml\",\n\t\tLong: cmdLong,\n\t\tExample: fmt.Sprintf(cmdExample, rootcmd.BinaryName),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\terr := o.Run()\n\t\t\thelper.CheckErr(err)\n\t\t},\n\t}\n\tcmd.Flags().StringVarP(&o.Dir, \"dir\", \"d\", \".\", \"the directory to use\")\n\tcmd.Flags().StringVarP(&o.Dockerfile, \"dockerfile\", \"f\", \"Dockerfile\", \"the name of the dockerfile to use\")\n\tcmd.Flags().BoolVarP(&o.NoGit, \"no-git\", \"\", false, \"disables adding of the generated .mink.yaml file to git\")\n\n\to.BaseOptions.AddBaseFlags(cmd)\n\treturn cmd, o\n}", "title": "" }, { "docid": "4a951a98a8e10de729ea348135854563", "score": "0.68164986", "text": "func InitCommand() cli.Command {\n\tvar fileName = `tango-init.sh`\n\n\treturn cli.Command{\n\t\tName: \"init\",\n\t\tAliases: []string{\"i\"},\n\t\tUsage: \"tango init <project_name>\",\n\t\tAction: func(c *cli.Context) {\n\t\t\tvar err error\n\n\t\t\tprojectName := \"\"\n\t\t\t_ = survey.AskOne(&survey.Input{\n\t\t\t\tRenderer: survey.Renderer{},\n\t\t\t\tMessage: \"Project name:\",\n\t\t\t\tDefault: c.Args().Get(0),\n\t\t\t}, &projectName)\n\n\t\t\tif \"\" == projectName {\n\t\t\t\tfmt.Println(missingProjectName)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif \"test\" == projectName {\n\t\t\t\tfmt.Println(invalidProjectName)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfmt.Println(\"Initialize project directory..\")\n\t\t\tif runtime.GOOS == \"darwin\" { // mac\n\t\t\t\terr = util.RunScript(fileName, initMacScripts, projectName)\n\t\t\t} else { // linux\n\t\t\t\terr = util.RunScript(fileName, initLinuxScripts, projectName)\n\t\t\t}\n\n\t\t\tif nil != err {\n\t\t\t\tfmt.Println(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfmt.Println(\"Project skeleton generated.\")\n\t\t},\n\t}\n}", "title": "" }, { "docid": "0187bcb274552ff48c4ecfbcd1143be7", "score": "0.66383857", "text": "func (command SimpleCommand) Init() {\n\n}", "title": "" }, { "docid": "155595b98f39f87f979a9ae4ca9a32d6", "score": "0.6616875", "text": "func InitCommand(profile *param.Profile, repository, encryptionKey string) []string {\n\tcmd := resticArgs(profile, repository, encryptionKey)\n\tcmd = append(cmd, \"init\")\n\tcommand := strings.Join(cmd, \" \")\n\treturn shCommand(command)\n}", "title": "" }, { "docid": "eb0d189bcbbdca143051d401b3614b51", "score": "0.64570886", "text": "func InitCommand() *cobra.Command {\n\tvar setupErr error\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"initialize a new sensu installation\",\n\t\tSilenceErrors: true,\n\t\tSilenceUsage: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t_ = viper.BindPFlags(cmd.Flags())\n\t\t\tif setupErr != nil {\n\t\t\t\treturn setupErr\n\t\t\t}\n\n\t\t\tcfg := &backend.Config{\n\t\t\t\tStore: backend.StoreConfig{\n\t\t\t\t\tPostgresStore: postgres.Config{\n\t\t\t\t\t\tDSN: viper.GetString(flagPGDSN),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\n\t\t\ttimeout := viper.GetDuration(flagTimeout)\n\t\t\tif timeout < 1*time.Second {\n\t\t\t\ttimeout = timeout * time.Second\n\t\t\t}\n\n\t\t\tinitConfig := initConfig{\n\t\t\t\tConfig: *cfg,\n\t\t\t\tSeedConfig: seeds.Config{\n\t\t\t\t\tAdminUsername: viper.GetString(flagInitAdminUsername),\n\t\t\t\t\tAdminPassword: viper.GetString(flagInitAdminPassword),\n\t\t\t\t\tAdminAPIKey: viper.GetString(flagInitAdminAPIKey),\n\t\t\t\t},\n\t\t\t\tTimeout: timeout,\n\t\t\t}\n\n\t\t\tif viper.GetBool(flagInteractive) {\n\t\t\t\tvar opts initOpts\n\t\t\t\tif err := opts.administerQuestionnaire(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif opts.AdminPassword != opts.AdminPasswordConfirmation {\n\t\t\t\t\t//lint:ignore ST1005 this error is written to stdout/stderr\n\t\t\t\t\treturn errors.New(\"Password confirmation doesn't match the password\")\n\t\t\t\t}\n\t\t\t\tinitConfig.SeedConfig.AdminUsername = opts.AdminUsername\n\t\t\t\tinitConfig.SeedConfig.AdminPassword = opts.AdminPassword\n\t\t\t\tinitConfig.SeedConfig.AdminAPIKey = opts.AdminAPIKey\n\t\t\t}\n\n\t\t\tif err := initConfig.Validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\terr := initializeStore(initConfig)\n\t\t\tif err != nil {\n\t\t\t\tif errors.Is(err, seeds.ErrAlreadyInitialized) {\n\t\t\t\t\tif viper.GetBool(flagIgnoreAlreadyInitialized) {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tlogger.Error(err.Error())\n\t\t\t}\n\t\t\treturn err\n\t\t},\n\t}\n\n\tcmd.Flags().Bool(flagIgnoreAlreadyInitialized, false, \"exit 0 if the cluster has already been initialized\")\n\tcmd.Flags().String(flagInitAdminUsername, \"\", \"cluster admin username\")\n\tcmd.Flags().String(flagInitAdminPassword, \"\", \"cluster admin password\")\n\tcmd.Flags().Bool(flagInteractive, false, \"interactive mode\")\n\tcmd.Flags().String(flagTimeout, defaultTimeout, \"duration to wait before a connection attempt to etcd is considered failed (must be >= 1s)\")\n\tcmd.Flags().Bool(flagWait, false, \"continuously retry to establish a connection to etcd until it is successful\")\n\tcmd.Flags().String(flagInitAdminAPIKey, \"\", \"cluster admin API key\")\n\n\tsetupErr = handleConfig(cmd, os.Args[1:], false)\n\n\treturn cmd\n}", "title": "" }, { "docid": "2a919757b0bbcdc19fb9aac9b017bd36", "score": "0.6406655", "text": "func (p *PsCommand) Init(c *Cli) {\n\tp.cli = c\n\tp.cmd = &cobra.Command{\n\t\tUse: \"ps [OPTIONS]\",\n\t\tShort: \"List containers\",\n\t\tLong: psDescription,\n\t\tArgs: cobra.NoArgs,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn p.runPs(args)\n\t\t},\n\t\tExample: psExample(),\n\t}\n\tp.addFlags()\n}", "title": "" }, { "docid": "17146377b3253c79476dc67a0f460f59", "score": "0.6395667", "text": "func newSubCmdInit(cmdOut io.Writer, pathOptions *clientcmd.PathOptions,\n\tdefaultServerImage,\n\tdefaultEtcdImage string) *cobra.Command {\n\topts := &standaloneClusterRegistryOptions{}\n\n\tinitCmd := &cobra.Command{\n\t\tUse: \"init CLUSTER_REGISTRY_NAME --host-cluster-context=HOST_CONTEXT\",\n\t\tShort: \"Initialize a standalone cluster registry\",\n\t\tLong: longInitCommandDescription,\n\t\tExample: initCommandExample,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\terr := opts.SetName(args)\n\t\t\tif err != nil {\n\t\t\t\tglog.Fatalf(\"error: %v\", err)\n\t\t\t}\n\n\t\t\terr = validateOptions(opts)\n\t\t\tif err != nil {\n\t\t\t\tglog.Fatalf(\"error: %v\", err)\n\t\t\t}\n\n\t\t\terr = opts.MarshalOptions()\n\t\t\tif err != nil {\n\t\t\t\tglog.Fatalf(\"error: %v\", err)\n\t\t\t}\n\n\t\t\thostConfig, err := util.GetClientConfig(pathOptions, opts.Host, opts.Kubeconfig).ClientConfig()\n\t\t\tif err != nil {\n\t\t\t\tglog.Fatalf(\"error: %v\", err)\n\t\t\t}\n\n\t\t\thostClientset, err := client.NewForConfig(hostConfig)\n\t\t\tif err != nil {\n\t\t\t\tglog.Fatalf(\"error: %v\", err)\n\t\t\t}\n\n\t\t\terr = runInit(opts, cmdOut, hostClientset, pathOptions)\n\t\t\tif err != nil {\n\t\t\t\tglog.Fatalf(\"error: %v\", err)\n\t\t\t}\n\t\t},\n\t}\n\n\tflags := initCmd.Flags()\n\topts.BindCommon(flags)\n\topts.BindCommonInit(flags, defaultServerImage, defaultEtcdImage)\n\topts.Bind(flags)\n\treturn initCmd\n}", "title": "" }, { "docid": "e585cb94faee4e8fdc0a4ecf1dc47c50", "score": "0.638982", "text": "func (ug *UpgradeCommand) Init(c *Cli) {\n\tug.cli = c\n\tug.cmd = &cobra.Command{\n\t\tUse: \"upgrade [OPTIONS] CONTAINER [COMMAND] [ARG...]\",\n\t\tShort: \"Upgrade a container with new image and args\",\n\t\tLong: upgradeDescription,\n\t\tArgs: cobra.MinimumNArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn ug.runUpgrade(args)\n\t\t},\n\t\tExample: upgradeExample(),\n\t}\n\tug.addFlags()\n}", "title": "" }, { "docid": "973a49bfd90ecf7d7e0e0df12e51414b", "score": "0.6383309", "text": "func (rc *RunCommand) Init(c *Cli) {\n\trc.cli = c\n\trc.cmd = &cobra.Command{\n\t\tUse: \"run [OPTIONS] IMAGE [ARG...]\",\n\t\tShort: \"Create a new container and start it\",\n\t\tLong: runDescription,\n\t\tArgs: cobra.MinimumNArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn rc.runRun(args)\n\t\t},\n\t\tExample: runExample(),\n\t}\n\trc.addFlags()\n}", "title": "" }, { "docid": "4801be9513780915f8a1122c649972e9", "score": "0.6372659", "text": "func (v *VolumeCommand) Init(c *Cli) {\n\tv.cli = c\n\n\tv.cmd = &cobra.Command{\n\t\tUse: \"volume [command]\",\n\t\tShort: \"Manage pouch volumes\",\n\t\tLong: volumeDescription,\n\t\tArgs: cobra.MinimumNArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn fmt.Errorf(\"command 'pouch volume %s' does not exist.\\nPlease execute `pouch volume --help` for more help\", args[0])\n\t\t},\n\t}\n\n\tc.AddCommand(v, &VolumeCreateCommand{})\n\tc.AddCommand(v, &VolumeRemoveCommand{})\n\tc.AddCommand(v, &VolumeInspectCommand{})\n\tc.AddCommand(v, &VolumeListCommand{})\n}", "title": "" }, { "docid": "26989b1b8967f2e410d9fb02a06bc008", "score": "0.6365613", "text": "func InitCommand() {\n\tworklogs.InitCommand()\n\tCommand.AddCommand(worklogs.Command)\n\n\ttoken.InitCommand()\n\tCommand.AddCommand(token.Command)\n}", "title": "" }, { "docid": "f5bac03ec3a27fe24572cbbfd9b90390", "score": "0.63415486", "text": "func (v *VolumeRemoveCommand) Init(c *Cli) {\n\tv.cli = c\n\tv.cmd = &cobra.Command{\n\t\tUse: \"remove [OPTIONS] NAME\",\n\t\tAliases: []string{\"rm\"},\n\t\tShort: \"Remove a volume\",\n\t\tLong: volumeRmDescription,\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn v.runVolumeRm(args)\n\t\t},\n\t\tExample: volumeRmExample(),\n\t}\n\tv.addFlags()\n}", "title": "" }, { "docid": "94147f9dbbc2555f411dc953fdfe98ba", "score": "0.6303061", "text": "func Init(appName string, longHelp string, shortHelp string, defaultAction func()) {\n\trootCmd = &cobra.Command{\n\t\tUse: appName,\n\t\tLong: longHelp,\n\t\tShort: shortHelp,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tdefaultAction()\n\t\t},\n\t}\n\trootCmd.AddCommand(cliCmd)\n\n\t// cliCmd.AddCommand(...)\n}", "title": "" }, { "docid": "7ac8ebad9cf832cf6f6207d9d61f836d", "score": "0.63001204", "text": "func NewInitiateCmd(cp2Addr *btcutil.AddressPubKeyHash, amount btcutil.Amount, lockTime int64) *InitiateCmd {\n\treturn &InitiateCmd{\n\t\tcp2Addr: cp2Addr,\n\t\tamount: amount,\n\t\tlockTime: lockTime,\n\t}\n}", "title": "" }, { "docid": "71cbdb45d8f0d5cab046b800d7ea7a57", "score": "0.6288773", "text": "func init() {\n\tgenerateCommand := NewGenerateCommand()\n\tVandameCommand.AddCommand(generateCommand.command)\n}", "title": "" }, { "docid": "8f0a88b37fe14942d87f8c76f473873b", "score": "0.6274943", "text": "func NewInit() *Init {\n\treturn &Init{}\n}", "title": "" }, { "docid": "05e7b7acdb03c7be7c777e4ef9293d79", "score": "0.62741715", "text": "func NewNetworkChainInit() *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse: \"init [launch-id]\",\n\t\tShort: \"Initialize a chain from a published chain ID\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: networkChainInitHandler,\n\t}\n\n\tflagSetClearCache(c)\n\tc.Flags().String(flagValidatorAccount, cosmosaccount.DefaultAccount, \"Account for the chain validator\")\n\tc.Flags().String(flagValidatorWebsite, \"\", \"Associate a website with the validator\")\n\tc.Flags().String(flagValidatorDetails, \"\", \"Details about the validator\")\n\tc.Flags().String(flagValidatorSecurityContact, \"\", \"Validator security contact email\")\n\tc.Flags().String(flagValidatorMoniker, \"\", \"Custom validator moniker\")\n\tc.Flags().String(flagValidatorIdentity, \"\", \"Validator identity signature (ex. UPort or Keybase)\")\n\tc.Flags().String(flagValidatorSelfDelegation, \"\", \"Validator minimum self delegation\")\n\tc.Flags().String(flagValidatorGasPrice, \"\", \"Validator gas price\")\n\tc.Flags().AddFlagSet(flagNetworkFrom())\n\tc.Flags().AddFlagSet(flagSetHome())\n\tc.Flags().AddFlagSet(flagSetKeyringBackend())\n\tc.Flags().AddFlagSet(flagSetKeyringDir())\n\tc.Flags().AddFlagSet(flagSetYes())\n\tc.Flags().AddFlagSet(flagSetCheckDependencies())\n\treturn c\n}", "title": "" }, { "docid": "87e46b331e59653df2a84595a3938eb4", "score": "0.6254327", "text": "func Init(name string, version string) *Commander {\n\tp := &Commander{\n\t\tName: name,\n\t\tVersion: version,\n\t}\n\n\tp.Add(&Option{\n\t\tName: \"help\",\n\t\tTiny: \"-h\",\n\t\tVerbose: \"--help\",\n\t\tDescription: \"display usage\",\n\t\tRequired: false,\n\t\tCallback: func(args ...string) {\n\t\t\tp.Usage()\n\t\t},\n\t})\n\n\tp.Add(&Option{\n\t\tName: \"version\",\n\t\tTiny: \"-V\",\n\t\tVerbose: \"--version\",\n\t\tDescription: \"display version\",\n\t\tRequired: false,\n\t\tCallback: func(args ...string) {\n\t\t\tfmt.Fprintf(os.Stdout, \"%s\\n\", p.Version)\n\t\t},\n\t})\n\n\treturn p\n}", "title": "" }, { "docid": "70d8487248e07109b89dad5126f24204", "score": "0.62445253", "text": "func New() Commander { return &commander{cmds: make(map[string]*cmdCont)} }", "title": "" }, { "docid": "49f5926f4a9073fd567d85c8050d7c9b", "score": "0.6223896", "text": "func (c *Commander) Init(driver gxui.Driver, theme *basic.Theme, font gxui.Font) {\n\tc.LinearLayout.Init(c, theme)\n\tc.bindings = make(map[gxui.KeyboardEvent]commands.Command)\n\tc.driver = driver\n\tc.theme = theme\n\tc.font = font\n\tc.SetDirection(gxui.BottomToTop)\n\tc.SetSize(math.MaxSize)\n\n\tc.controller = controller.New(c.driver, c.theme, c.font)\n\tc.box = NewCommandBox(c.theme, c.controller)\n\n\tc.AddChild(c.box)\n\tc.AddChild(c.controller)\n\n\t// TODO: Store these in a config file or something\n\topenFile := commands.NewFileOpener(c.driver, c.theme)\n\tc.commands = append(c.commands, openFile)\n\tctrlO := gxui.KeyboardEvent{\n\t\tKey: gxui.KeyO,\n\t\tModifier: gxui.ModControl,\n\t}\n\tsupO := gxui.KeyboardEvent{\n\t\tKey: gxui.KeyO,\n\t\tModifier: gxui.ModSuper,\n\t}\n\tc.bindings[ctrlO] = openFile\n\tc.bindings[supO] = openFile\n\n\taddProject := commands.NewProjectAdder(c.driver, c.theme)\n\tc.commands = append(c.commands, addProject)\n\tctrlShiftN := gxui.KeyboardEvent{\n\t\tKey: gxui.KeyN,\n\t\tModifier: gxui.ModControl | gxui.ModShift,\n\t}\n\tsupShiftN := gxui.KeyboardEvent{\n\t\tKey: gxui.KeyN,\n\t\tModifier: gxui.ModSuper | gxui.ModShift,\n\t}\n\tc.bindings[ctrlShiftN] = addProject\n\tc.bindings[supShiftN] = addProject\n}", "title": "" }, { "docid": "f8323325e13cc836d0171f7aab1fd01c", "score": "0.621406", "text": "func (v *VersionCmd) Init() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print the current Atlantis version\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"atlantis %s\\n\", v.Viper.Get(\"version\"))\n\t\t},\n\t}\n}", "title": "" }, { "docid": "63e446df05b195dba27cbfff9dbbb74b", "score": "0.6213742", "text": "func getInitCmds() *cobra.Command {\n\n\t// Creating \"init\" happens here.\n\tvar cmdInit = &cobra.Command{\n\t\tUse: \"init [To initialize neuron]\",\n\t\tShort: \"command to initialize/configure neuron\",\n\t\tLong: `This will help user to bring up neuron with the help of configuration file and make it usable.`,\n\t\tRun: initNeuron,\n\t}\n\tregisterinitFlags(cmdInit)\n\n\treturn cmdInit\n}", "title": "" }, { "docid": "2cfea6c5a59ba8da59e367dcc3d992da", "score": "0.6212132", "text": "func init() {\n\trootCommand.AddCommand(versionCommand, convertCommand, createCommand, updateCommand, transcodeCommand)\n}", "title": "" }, { "docid": "2f271f68db758497ff8e9554893e207a", "score": "0.62120724", "text": "func InitCmd(gen GenOptions, logger log.Logger) *cobra.Command {\n\tcmd := initCmd{\n\t\tgen: gen,\n\t\tlogger: logger,\n\t}\n\treturn &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Initialize genesis files\",\n\t\tRunE: cmd.run,\n\t}\n}", "title": "" }, { "docid": "24c7a98bc25e09e1d13a17464676f703", "score": "0.61827636", "text": "func init() {\n\trootCmd.AddCommand(componentCreateCmd)\n}", "title": "" }, { "docid": "980e950b17c59a2140f7eb2c16e2e85e", "score": "0.61796635", "text": "func buildSvcInitCmd() *cobra.Command {\n\tvars := initSvcVars{}\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Creates a new service in an application.\",\n\t\tLong: `Creates a new service in an application.\nThis command is also run as part of \"copilot init\".`,\n\t\tExample: `\n Create a \"frontend\" load balanced web service.\n /code $ copilot svc init --name frontend --svc-type \"Load Balanced Web Service\" --dockerfile ./frontend/Dockerfile\n\n Create a \"subscribers\" backend service.\n /code $ copilot svc init --name subscribers --svc-type \"Backend Service\"`,\n\t\tRunE: runCmdE(func(cmd *cobra.Command, args []string) error {\n\t\t\topts, err := newInitSvcOpts(vars)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.Validate(); err != nil { // validate flags\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlog.Warningln(\"It's best to run this command in the root of your workspace.\")\n\t\t\tif err := opts.Ask(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.Execute(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.RecommendActions(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t}),\n\t}\n\tcmd.Flags().StringVarP(&vars.appName, appFlag, appFlagShort, \"\", appFlagDescription)\n\tcmd.Flags().StringVarP(&vars.name, nameFlag, nameFlagShort, \"\", svcFlagDescription)\n\tcmd.Flags().StringVarP(&vars.wkldType, svcTypeFlag, typeFlagShort, \"\", svcTypeFlagDescription)\n\tcmd.Flags().StringVarP(&vars.dockerfilePath, dockerFileFlag, dockerFileFlagShort, \"\", dockerFileFlagDescription)\n\tcmd.Flags().StringVarP(&vars.image, imageFlag, imageFlagShort, \"\", imageFlagDescription)\n\tcmd.Flags().Uint16Var(&vars.port, svcPortFlag, 0, svcPortFlagDescription)\n\tcmd.Flags().StringArrayVar(&vars.subscriptions, subscribeTopicsFlag, []string{}, subscribeTopicsFlagDescription)\n\tcmd.Flags().BoolVar(&vars.noSubscribe, noSubscriptionFlag, false, noSubscriptionFlagDescription)\n\tcmd.Flags().StringVar(&vars.ingressType, ingressTypeFlag, \"\", ingressTypeFlagDescription)\n\tcmd.Flags().StringArrayVar(&vars.sourcePaths, sourcesFlag, nil, sourcesFlagDescription)\n\tcmd.Flags().BoolVar(&vars.allowAppDowngrade, allowDowngradeFlag, false, allowDowngradeFlagDescription)\n\n\treturn cmd\n}", "title": "" }, { "docid": "12424849b1892a8679acf16e04e1d59f", "score": "0.61761767", "text": "func initializeInitCommand(cmd *cobra.Command, args []string) {\n\tlogger.Debug(\"[Init] called\")\n\tutil.Init(username, []byte(password))\n\tfmt.Fprintln(os.Stderr, constant.DONE_MSG)\n}", "title": "" }, { "docid": "90930beeaf8fe67d0bdb29f9747736dc", "score": "0.6162418", "text": "func New(rootConfig *rootcmd.Config, out io.Writer) *ffcli.Command {\n\tcfg := Config{\n\t\trootConfig: rootConfig,\n\t\tout: out,\n\t}\n\n\tfs := flag.NewFlagSet(\"objectctl create\", flag.ExitOnError)\n\tfs.BoolVar(&cfg.overwrite, \"overwrite\", false, \"overwrite existing object, if it exists\")\n\trootConfig.RegisterFlags(fs)\n\n\treturn &ffcli.Command{\n\t\tName: \"create\",\n\t\tShortUsage: \"objectctl create [flags] <key> <value data...>\",\n\t\tShortHelp: \"Create or overwrite an object\",\n\t\tFlagSet: fs,\n\t\tExec: cfg.Exec,\n\t}\n}", "title": "" }, { "docid": "d7ae3b4d93d0b6ee429f96839732865f", "score": "0.6151542", "text": "func Init(options ...micro.Option) {\n\tSetup(cmd.App(), options...)\n\n\tregularArguments(cmd.App())\n\n\tcmd.Init(\n\t\tcmd.Name(name),\n\t\tcmd.Description(description),\n\t\tcmd.Version(buildVersion()),\n\t)\n}", "title": "" }, { "docid": "59c91fdc1f7b30b1b8f6feb869d789f3", "score": "0.6136908", "text": "func InitCommand(c *cli.Context) error {\n\tpwd, err := passwd.GetNewPassword(c, c.String(\"password\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tparsedData := make(map[string]interface{})\n\treturn uri.WriteMapToURI(c, c.Args().Get(0), parsedData, uri.WriteDataToEncryptedStream(pwd))\n}", "title": "" }, { "docid": "98ec1ddaae050fe4f952562941b66e47", "score": "0.6136865", "text": "func buildSvcInitCmd() *cobra.Command {\n\tvars := initSvcVars{}\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Creates a new service in an application.\",\n\t\tLong: `Creates a new service in an application.\nThis command is also run as part of \"copilot init\".`,\n\t\tExample: `\n Create a \"frontend\" load balanced web service.\n /code $ copilot svc init --name frontend --svc-type \"Load Balanced Web Service\" --dockerfile ./frontend/Dockerfile\n\n Create a \"subscribers\" backend service.\n /code $ copilot svc init --name subscribers --svc-type \"Backend Service\"`,\n\t\tRunE: runCmdE(func(cmd *cobra.Command, args []string) error {\n\t\t\topts, err := newInitSvcOpts(vars)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.Validate(); err != nil { // validate flags\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlog.Warningln(\"It's best to run this command in the root of your workspace.\")\n\t\t\tif err := opts.Ask(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.Execute(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlog.Infoln(\"Recommended follow-up actions:\")\n\t\t\tfor _, followup := range opts.RecommendedActions() {\n\t\t\t\tlog.Infof(\"- %s\\n\", followup)\n\t\t\t}\n\t\t\treturn nil\n\t\t}),\n\t}\n\tcmd.Flags().StringVarP(&vars.appName, appFlag, appFlagShort, tryReadingAppName(), appFlagDescription)\n\tcmd.Flags().StringVarP(&vars.name, nameFlag, nameFlagShort, \"\", svcFlagDescription)\n\tcmd.Flags().StringVarP(&vars.wkldType, svcTypeFlag, typeFlagShort, \"\", svcTypeFlagDescription)\n\tcmd.Flags().StringVarP(&vars.dockerfilePath, dockerFileFlag, dockerFileFlagShort, \"\", dockerFileFlagDescription)\n\tcmd.Flags().StringVarP(&vars.image, imageFlag, imageFlagShort, \"\", imageFlagDescription)\n\n\tcmd.Flags().Uint16Var(&vars.port, svcPortFlag, 0, svcPortFlagDescription)\n\n\t// Bucket flags by service type.\n\trequiredFlags := pflag.NewFlagSet(\"Required Flags\", pflag.ContinueOnError)\n\trequiredFlags.AddFlag(cmd.Flags().Lookup(nameFlag))\n\trequiredFlags.AddFlag(cmd.Flags().Lookup(svcTypeFlag))\n\trequiredFlags.AddFlag(cmd.Flags().Lookup(dockerFileFlag))\n\trequiredFlags.AddFlag(cmd.Flags().Lookup(imageFlag))\n\n\tlbWebSvcFlags := pflag.NewFlagSet(manifest.LoadBalancedWebServiceType, pflag.ContinueOnError)\n\tlbWebSvcFlags.AddFlag(cmd.Flags().Lookup(svcPortFlag))\n\n\tbackendSvcFlags := pflag.NewFlagSet(manifest.BackendServiceType, pflag.ContinueOnError)\n\tbackendSvcFlags.AddFlag(cmd.Flags().Lookup(svcPortFlag))\n\n\tcmd.Annotations = map[string]string{\n\t\t// The order of the sections we want to display.\n\t\t\"sections\": fmt.Sprintf(`Required,%s`, strings.Join(manifest.ServiceTypes, \",\")),\n\t\t\"Required\": requiredFlags.FlagUsages(),\n\t\tmanifest.LoadBalancedWebServiceType: lbWebSvcFlags.FlagUsages(),\n\t\tmanifest.BackendServiceType: lbWebSvcFlags.FlagUsages(),\n\t}\n\tcmd.SetUsageTemplate(`{{h1 \"Usage\"}}{{if .Runnable}}\n {{.UseLine}}{{end}}{{$annotations := .Annotations}}{{$sections := split .Annotations.sections \",\"}}{{if gt (len $sections) 0}}\n\n{{range $i, $sectionName := $sections}}{{h1 (print $sectionName \" Flags\")}}\n{{(index $annotations $sectionName) | trimTrailingWhitespaces}}{{if ne (inc $i) (len $sections)}}\n\n{{end}}{{end}}{{end}}{{if .HasAvailableInheritedFlags}}\n\n{{h1 \"Global Flags\"}}\n{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasExample}}\n\n{{h1 \"Examples\"}}{{code .Example}}{{end}}\n`)\n\treturn cmd\n}", "title": "" }, { "docid": "66aa0516425381fe5f8d39f390793574", "score": "0.61356235", "text": "func (mc *MakeBucketCommand) Init(args []string, options OptionMapType) error {\n\treturn mc.command.Init(args, options, mc)\n}", "title": "" }, { "docid": "e18449f7b17c58bb1fe0d992b91aa9f4", "score": "0.6102072", "text": "func (g *GitCLI) Init(dir string) error {\n\treturn g.gitCmd(dir, \"init\")\n}", "title": "" }, { "docid": "1c0e6769d74c4a6ccff73298dd1a8f0c", "score": "0.607245", "text": "func (v *VolumeListCommand) Init(c *Cli) {\n\tv.cli = c\n\tv.cmd = &cobra.Command{\n\t\tUse: \"list\",\n\t\tAliases: []string{\"ls\"},\n\t\tShort: \"List volumes\",\n\t\tLong: volumeListDescription,\n\t\tArgs: cobra.ExactArgs(0),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn v.runVolumeList(args)\n\t\t},\n\t\tExample: volumeListExample(),\n\t}\n\tv.addFlags()\n}", "title": "" }, { "docid": "78e374ad1cd3636310c4982880de6568", "score": "0.6058079", "text": "func (h *HistoryCommand) Init(c *Cli) {\n\th.cli = c\n\th.cmd = &cobra.Command{\n\t\tUse: \"history [OPTIONS] IMAGE\",\n\t\tShort: \"Display history information on image\",\n\t\tLong: historyDescription,\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn h.runHistory(args)\n\t\t},\n\t\tExample: h.example(),\n\t}\n\th.addFlags()\n}", "title": "" }, { "docid": "12af90361abe1b133f6a582b0068b36d", "score": "0.60458916", "text": "func (cmd *Cmd) Init() (e error) {\n\t// (1)\n\te = cmd.NewConfig()\n\tif e != nil {\n\t\treturn e\n\t}\n\n\tfmt.Printf(\"CONFIG = %+v\\n\", cmd.Config)\n\n\t// (2)\n\tcmd.JiraCl, e = NewJiraClient(cmd.Config)\n\tif e != nil {\n\t\treturn e\n\t}\n\n\t// (3)\n\tcmd.GonduitCl = gonduit.NewClient(cmd.Config.Phab.URL,\n\t\tcmd.Config.Phab.Token, cmd.Config.Phab.Secure)\n\n\treturn nil\n}", "title": "" }, { "docid": "f78b0f97343d8701db7fe06ffd417f49", "score": "0.60400003", "text": "func (v *VolumeInspectCommand) Init(c *Cli) {\n\tv.cli = c\n\tv.cmd = &cobra.Command{\n\t\tUse: \"inspect [OPTIONS] Volume [Volume...]\",\n\t\tShort: \"Inspect one or more pouch volumes\",\n\t\tLong: volumeInspectDescription,\n\t\tArgs: cobra.MinimumNArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn v.runVolumeInspect(args)\n\t\t},\n\t\tExample: volumeInspectExample(),\n\t}\n\tv.addFlags()\n}", "title": "" }, { "docid": "5fd6c9e32f79fafeb743f866229a062f", "score": "0.6039279", "text": "func NewCmd() *cobra.Command {\n\tparams := newParams()\n\tcmd := &cobra.Command{\n\t\tUse: \"init [DIR]\",\n\t\tShort: \"Scaffold a new Envoy extension.\",\n\t\tLong: `\nScaffold a new Envoy extension in a language of your choice.`,\n\t\tExample: `\n # Scaffold a new extension in interactive mode.\n getenvoy extension init\n\n # Scaffold a new extension according to command options: Envoy HTTP filter, in Rust, with a given name, in the current working directory.\n getenvoy extension init --category envoy.filters.http --language rust --name mycompany.filters.http.custom_metrics\n\n # Scaffold a new extension according to command options: Envoy Access logger, in Rust, with a given name, in the \"my-access-logger\" directory.\n getenvoy extension init my-access-logger --category envoy.access_loggers --language rust --name mycompany.access_loggers.custom_log`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\toutputDir := \"\"\n\t\t\tif len(args) > 0 {\n\t\t\t\toutputDir = args[0]\n\t\t\t}\n\t\t\tparams.OutputDir.Value = outputDir\n\n\t\t\tusedWizard := false\n\t\t\tif err := params.Validate(); err != nil {\n\t\t\t\tif globals.NoPrompt {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := newWizard(cmd).Fill(params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tusedWizard = true\n\t\t\t}\n\n\t\t\tdescriptor, err := scaffold.NewExtension(params.Category.Value, params.Language.Value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdescriptor.Name = params.Name.Value\n\t\t\tdescriptor.Runtime.Envoy.Version = defaultSupportedEnvoyVersion\n\n\t\t\toutputDir, err = scaffold.NormalizeOutputPath(params.OutputDir.Value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\topts := &scaffold.ScaffoldOpts{}\n\t\t\topts.Extension = descriptor\n\t\t\topts.TemplateName = \"default\"\n\t\t\topts.OutputDir = outputDir\n\t\t\topts.ProgressSink = &feedback{\n\t\t\t\tcmd: cmd,\n\t\t\t\topts: opts,\n\t\t\t\tusedWizard: usedWizard,\n\t\t\t\tw: cmd.ErrOrStderr(),\n\t\t\t}\n\t\t\treturn scaffold.Scaffold(opts)\n\t\t},\n\t}\n\tcmd.PersistentFlags().StringVar(&params.Category.Value, \"category\", \"\", \"Choose extension category. \"+hintOneOf(supportedCategories.Values()...))\n\tcmd.PersistentFlags().StringVar(&params.Language.Value, \"language\", \"\", \"Choose programming language. \"+hintOneOf(supportedLanguages.Values()...))\n\tcmd.PersistentFlags().StringVar(&params.Name.Value, \"name\", \"\", `Choose extension name, e.g. \"mycompany.filters.http.custom_metrics\"`)\n\treturn cmd\n}", "title": "" }, { "docid": "28f2574eab4f739a246b16a1cf4ea306", "score": "0.60294497", "text": "func New() *cobra.Command {\n\n\treturn getCmd\n}", "title": "" }, { "docid": "810d9f82320ff152e45f226a278cd8fa", "score": "0.6024484", "text": "func (rc *RemoveCommand) Init(args []string, options OptionMapType) error {\n\treturn rc.command.Init(args, options, rc)\n}", "title": "" }, { "docid": "be4179536deacbcbf94b1143773d090a", "score": "0.6020952", "text": "func New(cfg *Config) *Command {\n\treturn &Command{Config: cfg}\n}", "title": "" }, { "docid": "62fe4a7d70b2d15b25e7a6030fc337ef", "score": "0.600501", "text": "func init() {\n\tRootCmd.AddCommand(version.NewCommand())\n\tRootCmd.AddCommand(start.NewCommand())\n}", "title": "" }, { "docid": "cb21811416ca764834d57b3735a1ddd8", "score": "0.6004446", "text": "func (c *Start) Init() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"start\",\n\t\tShort: \"Start the payment processing service\",\n\t\tRun: c.start,\n\t}\n\n\tcmd.PersistentFlags().StringVarP(&config.RedisURL, \"redis-url\", \"r\", \"redis://localhost:6379\", \"Redis server URL.\")\n\tcmd.PersistentFlags().StringVarP(&config.NatsURL, \"nats-url\", \"n\", nats.DefaultURL, \"The NATS server URLs (separated by comma).\")\n\tcmd.PersistentFlags().StringVarP(&config.NatsUserCreds, \"nats-creds\", \"c\", \"\", \"NATS User Credentials File.\")\n\tcmd.PersistentFlags().StringVarP(&config.NatsKeyFile, \"nats-nkey\", \"k\", \"\", \"NATS NKey Seed File.\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "b32960d17abd42d6d3cdfc9ffa47bbf1", "score": "0.59283483", "text": "func initCmd() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Initialises Configration for BOPR\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tdefaultConfig := config.GetDefaultConfig()\n\t\t\tconfig.WriteConfigFile(\"./config.toml\", &defaultConfig)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "bc31ba6ccdfd454f4333ba14d6c5aed2", "score": "0.59106356", "text": "func New(cmd string, args ...string) Command {\n\tc := &command{\n\t\tcmd: cmd,\n\t\targs: args,\n\t\tenvs: make(map[string]string),\n\t\taliases: make(map[string]string),\n\t\tsources: make([]string, 0),\n\t\tstdin: os.Stdin,\n\t\tstdout: os.Stdout,\n\t\tstderr: os.Stderr,\n\t}\n\treturn c\n}", "title": "" }, { "docid": "18b8a6e68adf1d1c17ba21799b79e335", "score": "0.5898978", "text": "func New(driver gxui.Driver, theme *basic.Theme, font gxui.Font) *Commander {\n\tcommander := new(Commander)\n\tcommander.Init(driver, theme, font)\n\treturn commander\n}", "title": "" }, { "docid": "740a89c9fc1799917d3009d9260980d3", "score": "0.58873737", "text": "func New(issuer thing.Interface, input string) *Command {\n\tcmd := Command{Issuer: issuer}\n\tcmd.New(input)\n\treturn &cmd\n}", "title": "" }, { "docid": "040b23f634ca27da0997bde76503db1a", "score": "0.58803695", "text": "func (initCmd *initCommand) RunInitCommand(_ *cobra.Command, args []string) error {\n\t// Handle reinitialization case\n\toverwrite := false\n\tconfigFile := initCmd.viperCfg.ConfigFileUsed()\n\t// NOTE: On first launch with no config file, Viper returns \"\"\n\t// because no config file was resolved. There's probably a cleaner solution...\n\tif configFile == \"\" {\n\t\tconfigFile = initCmd.DefaultConfigFile()\n\t}\n\tif _, err := os.Stat(configFile); !os.IsNotExist(err) && !initCmd.confirmed {\n\t\tinitCmd.Println(\"Using config from:\", configFile)\n\t\tinitCmd.PrettyPrintYAMLObject(initCmd.GetAllSettings())\n\n\t\tprompt := &survey.Confirm{\n\t\t\tMessage: fmt.Sprintf(\"Existing config found. Overwrite %s?\", configFile),\n\t\t}\n\t\terr := initCmd.AskOne(prompt, &overwrite)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !overwrite {\n\t\t\treturn terminal.InterruptErr\n\t\t}\n\t}\n\n\tprofile := Profile{\n\t\tName: \"default\",\n\t\tOptimizer: initCmd.Optimizer(),\n\t\tToken: initCmd.AccessToken(),\n\t\tBaseURL: initCmd.BaseURL(),\n\t}\n\twhiteBold := ansi.ColorCode(\"white+b\")\n\n\tif overwrite || profile.Optimizer == \"\" {\n\t\terr := initCmd.AskOne(&survey.Input{\n\t\t\tMessage: \"Opsani optimizer (e.g. domain.com/app):\",\n\t\t\tDefault: profile.Optimizer,\n\t\t}, &profile.Optimizer, survey.WithValidator(survey.Required))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tinitCmd.Printf(\"%si %sApp: %s%s%s%s\\n\", ansi.Blue, whiteBold, ansi.Reset, ansi.LightCyan, profile.Optimizer, ansi.Reset)\n\t}\n\n\tif overwrite || profile.Token == \"\" {\n\t\terr := initCmd.AskOne(&survey.Input{\n\t\t\tMessage: \"API Token:\",\n\t\t\tDefault: profile.Token,\n\t\t}, &profile.Token, survey.WithValidator(survey.Required))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tinitCmd.Printf(\"%si %sAPI Token: %s%s%s%s\\n\", ansi.Blue, whiteBold, ansi.Reset, ansi.LightCyan, profile.Token, ansi.Reset)\n\t}\n\n\t// Confirm that the user wants to write this config\n\tif registry, err := NewProfileRegistry(initCmd.viperCfg); err != nil {\n\t\treturn err\n\t} else {\n\t\tregistry.AddProfile(profile)\n\t}\n\n\tinitCmd.Printf(\"\\nOpsani config initialized:\\n\")\n\tinitCmd.PrettyPrintYAMLObject(initCmd.GetAllSettings())\n\tif !initCmd.confirmed {\n\t\tprompt := &survey.Confirm{\n\t\t\tMessage: fmt.Sprintf(\"Write to %s?\", configFile),\n\t\t}\n\t\tinitCmd.AskOne(prompt, &initCmd.confirmed)\n\t}\n\tif initCmd.confirmed {\n\t\tconfigDir := filepath.Dir(configFile)\n\t\tif _, err := os.Stat(configDir); os.IsNotExist(err) {\n\t\t\terr = os.Mkdir(configDir, 0755)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err := initCmd.viperCfg.WriteConfigAs(configFile); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tinitCmd.Println(\"\\nOpsani CLI initialized\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "045712e024564c2e43fdc23519c910c7", "score": "0.58698654", "text": "func InitClientCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Initialize light client\",\n\t\tRunE: todoNotImplemented,\n\t}\n\tcmd.Flags().StringP(client.FlagChainID, \"c\", \"\", \"ID of chain we connect to\")\n\tcmd.Flags().StringP(client.FlagNode, \"n\", \"tcp://localhost:26657\", \"Node to connect to\")\n\tcmd.Flags().String(flagGenesis, \"\", \"Genesis file to verify header validity\")\n\tcmd.Flags().String(flagCommit, \"\", \"File with trusted and signed header\")\n\tcmd.Flags().String(flagValHash, \"\", \"Hash of trusted validator set (hex-encoded)\")\n\tviper.BindPFlag(client.FlagChainID, cmd.Flags().Lookup(client.FlagChainID))\n\tviper.BindPFlag(client.FlagNode, cmd.Flags().Lookup(client.FlagNode))\n\n\treturn cmd\n}", "title": "" }, { "docid": "63e2310a1e62ff119bd2553c8ef48c72", "score": "0.5866368", "text": "func (t *RandomCommand) Init() {\n\tt.Command.Flags().IntVarP(&t.num, \"num\", \"n\", 5, \"number of random characters to print\")\n}", "title": "" }, { "docid": "6bc90e8e4773c712e58995e08aebde18", "score": "0.5822717", "text": "func (g *GPSD) CmdInit() {\n\tif g.name == \"\" {\n\t\tg.name = GPSD_PROCESSNAME\n\t}\n\tg.cmdLine = fmt.Sprintf(\"/usr/local/sbin/%s -p -n -S 2947 -G -N %s\", g.Name(), g.SerialPort())\n}", "title": "" }, { "docid": "aac5f872b86a3ceffce96cca260ee641", "score": "0.58143157", "text": "func Init() (*cobra.Command, error) {\n\tairlockCmd.PersistentFlags().StringVarP(&configPath, \"config\", \"c\", \"/etc/airlock/config.toml\", \"path to configuration file\")\n\tairlockCmd.PersistentFlags().CountVarP(&verbosity, \"verbose\", \"v\", \"increase verbosity level\")\n\n\tcmdGet.AddCommand(cmdGetSlots)\n\tcmdEx.AddCommand(cmdGet)\n\tairlockCmd.AddCommand(cmdServe, cmdEx)\n\n\treturn airlockCmd, nil\n}", "title": "" }, { "docid": "631304a6c5ce5dd7302d9a8a101abcda", "score": "0.581349", "text": "func Init() (*cobra.Command, error) {\n\tlocalExporterCmd.PersistentFlags().CountVarP(&verbosity, \"verbose\", \"v\", \"increase verbosity level\")\n\n\tlocalExporterCmd.AddCommand(cmdServe)\n\n\treturn localExporterCmd, nil\n}", "title": "" }, { "docid": "092141f935b4ccb41000cdf66b2ad43b", "score": "0.58113164", "text": "func NewKmsInit(c *kingpin.CmdClause, keyCloudformationTemplate string) shared.Command {\n\tparams := &kmsInit{keyCloudformationTemplate: keyCloudformationTemplate}\n\tparams.regions = regionsFlag(c)\n\tparams.label = labelFlag(c)\n\tparams.createMissingKeys = c.Flag(\"create-missing-keys\",\n\t\t\"Provision regions that are not already configured for the speccified label.\").Bool()\n\tparams.createSimpleRoles = c.Flag(\"create-simple-roles\",\n\t\t\"Create simplified roles that are a allowed full encrypt or decrypt privileges under the created keys\"+\n\t\t\t\". Note that this requires sufficient IAM privileges to call iam:CreateRole.\").Bool()\n\tparams.administratorArns = c.Flag(\"administrators\",\n\t\t\"Comma-delimited list of IAM users, IAM roles, and AWS services ARNs that will \"+\n\t\t\t\"have administration privileges in the key policy attached to the new keys. \"+\n\t\t\tarnDetailsMessage).\n\t\tShort('d').\n\t\tPlaceHolder(\"ARN\").\n\t\tString()\n\tparams.userArns = c.Flag(\"users\",\n\t\t\"Comma-delimited list of IAM users, IAM roles, and AWS services ARNs that will have \"+\n\t\t\t\"user privileges in the key policy attached to the new keys. \"+arnDetailsMessage).\n\t\tShort('u').\n\t\tPlaceHolder(\"ARN\").\n\t\tString()\n\tparams.disableIam = c.Flag(\"disable-iam-policies\",\n\t\t\"Create KMS keys that will not evaluate IAM policies. If disabled, only the Key Policy document will \"+\n\t\t\t\"be evaluated when KMS authorizes API calls. Note that using this setting will prevent the \"+\n\t\t\t\"root account from accessing this key, and can require contacting AWS support for resolving \"+\n\t\t\t\"configuration problems.\").\n\t\tBool()\n\tparams.cloudformationTemplateURL = c.Flag(\"cloudformation-template-url\",\n\t\t\"Full URL to the CloudFormation template to use. This overrides the built-in template.\").\n\t\tPlaceHolder(\"URL\").\n\t\tString()\n\tparams.filename = shared.FilenameFlag(c)\n\tparams.algorithm = shared.AlgorithmFlag(c)\n\treturn params\n}", "title": "" }, { "docid": "72fbb7d6888fab662c4ff7293fd34d78", "score": "0.57934165", "text": "func (c *Server) Init() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"start\",\n\t\tShort: \"Start the api server\",\n\t\tRun: c.startServer,\n\t}\n\n\tcmd.PersistentFlags().IntVarP(&config.port, \"port\", \"p\", 8080, \"The port to listen on.\")\n\tcmd.PersistentFlags().StringVarP(&config.natsURL, \"nats-url\", \"n\", nats.DefaultURL, \"The NATS server URLs (separated by comma).\")\n\tcmd.PersistentFlags().StringVarP(&config.natsUserCreds, \"nats-creds\", \"c\", \"\", \"NATS User Credentials File.\")\n\tcmd.PersistentFlags().StringVarP(&config.natsKeyFile, \"nats-nkey\", \"k\", \"\", \"NATS NKey Seed File.\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "9ae87c0db4f1062ac40c27e5f2c65187", "score": "0.57765657", "text": "func (stats *StatsCommand) Init(c *Cli) {\n\tstats.cli = c\n\tstats.cmd = &cobra.Command{\n\t\tUse: \"stats [OPTIONS] CONTAINER [CONTAINER...]\",\n\t\tShort: \"Display a live stream of container(s) resource usage statistics\",\n\t\tLong: statsDescription,\n\t\tArgs: cobra.MinimumNArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn stats.runStats(args)\n\t\t},\n\t\tExample: statsExample(),\n\t}\n\tstats.addFlags()\n}", "title": "" }, { "docid": "d9f22b624bd170b17ab38abee753d25b", "score": "0.57575876", "text": "func (c *Command) New(name string) *Command {\n\tif c.subCommands == nil {\n\t\tc.subCommands = make(map[string]*Command)\n\t}\n\n\tnewCommand := &Command{}\n\tc.subCommands[name] = newCommand\n\treturn newCommand\n}", "title": "" }, { "docid": "ec2caa2e908d54cbe638fc889319472d", "score": "0.5745828", "text": "func BuildInitCommand() *cobra.Command {\n\tvar dbFile string\n\tvar force bool\n\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Initializes the database with the Exploit Database CSV file.\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\n\t\t\tif force == true {\n\t\t\t\tfmt.Printf(\"Force removing %s\\n\", dbFile)\n\t\t\t\tos.RemoveAll(dbFile)\n\t\t\t}\n\n\t\t\tfmt.Println(\"Initializing database. Downloading complete CSV file from github.\")\n\n\t\t\terr := os.MkdirAll(defaultBaseDir(), 0777)\n\t\t\tcheck(err)\n\n\t\t\tindex, err := bleve.Open(dbFile)\n\t\t\tif err == bleve.ErrorIndexPathDoesNotExist {\n\t\t\t\tmapping := bleve.NewIndexMapping()\n\t\t\t\tindex, err = bleve.New(dbFile, mapping)\n\t\t\t}\n\n\t\t\tfmt.Printf(\"Processing %s ... \", initialFeed)\n\t\t\tresp, err := http.Get(initialFeed)\n\t\t\tcheck(err)\n\n\t\t\treader := resp.Body\n\t\t\tdefer reader.Close()\n\n\t\t\tlines, err := csv.NewReader(reader).ReadAll()\n\t\t\ttotal := len(lines)\n\n\t\t\tbatch := index.NewBatch()\n\t\t\tcount := 0\n\t\t\tfor _, row := range lines {\n\n\t\t\t\tvar result models.Exploit\n\n\t\t\t\tresult.ID = row[0]\n\t\t\t\tresult.File = row[1]\n\t\t\t\tresult.Description = row[2]\n\t\t\t\tresult.Date, _ = time.Parse(\"2006-01-02\", row[3])\n\t\t\t\tresult.Author = row[4]\n\t\t\t\tresult.Platform = row[5]\n\t\t\t\tresult.Type = row[6]\n\t\t\t\tresult.Port = row[7]\n\n\t\t\t\tbatch.Index(result.ID, result)\n\t\t\t\tcount++\n\n\t\t\t\tif count%1000 == 0 {\n\t\t\t\t\tindex.Batch(batch)\n\t\t\t\t\tbatch = index.NewBatch()\n\t\t\t\t}\n\n\t\t\t\tif count%(total/10) == 0 {\n\t\t\t\t\tfmt.Printf(\"#\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tindex.Batch(batch)\n\n\t\t\tfmt.Printf(\"finished processing %d entries\\n\", count)\n\t\t},\n\t}\n\n\tcmd.Flags().StringVarP(&dbFile, \"db-file\", \"d\", defaultDbFile(), \"exploit db file to build\")\n\tcmd.Flags().BoolVarP(&force, \"force\", \"f\", false, \"overwrite existing exploit db\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "1b6aaf02aa350450c1e3db7bf96f5a42", "score": "0.57436854", "text": "func (s Manifest_Action) NewCommand() (Manifest_Command, error) {\n\tss, err := NewManifest_Command(capnp.Struct(s).Segment())\n\tif err != nil {\n\t\treturn Manifest_Command{}, err\n\t}\n\terr = capnp.Struct(s).SetPtr(1, capnp.Struct(ss).ToPtr())\n\treturn ss, err\n}", "title": "" }, { "docid": "567480d5dbaad759958bbe1995259a01", "score": "0.5737927", "text": "func NewImportCommand() *cobra.Command {\n\tvar (\n\t\tclientConfig clientcmd.ClientConfig\n\t)\n\tvar command = cobra.Command{\n\t\tUse: \"import SOURCE\",\n\t\tShort: \"Import Argo CD data from stdin (specify `-') or a file\",\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\tc.HelpFunc()(c, args)\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\n\t\t\tvar (\n\t\t\t\tinput []byte\n\t\t\t\terr error\n\t\t\t\tnewSettings *settings.ArgoCDSettings\n\t\t\t\tnewRepos []*v1alpha1.Repository\n\t\t\t\tnewClusters []*v1alpha1.Cluster\n\t\t\t\tnewApps []*v1alpha1.Application\n\t\t\t\tnewRBACCM *apiv1.ConfigMap\n\t\t\t)\n\n\t\t\tif in := args[0]; in == \"-\" {\n\t\t\t\tinput, err = ioutil.ReadAll(os.Stdin)\n\t\t\t\terrors.CheckError(err)\n\t\t\t} else {\n\t\t\t\tinput, err = ioutil.ReadFile(in)\n\t\t\t\terrors.CheckError(err)\n\t\t\t}\n\t\t\tinputStrings := strings.Split(string(input), yamlSeparator)\n\n\t\t\terr = yaml.Unmarshal([]byte(inputStrings[0]), &newSettings)\n\t\t\terrors.CheckError(err)\n\n\t\t\terr = yaml.Unmarshal([]byte(inputStrings[1]), &newRepos)\n\t\t\terrors.CheckError(err)\n\n\t\t\terr = yaml.Unmarshal([]byte(inputStrings[2]), &newClusters)\n\t\t\terrors.CheckError(err)\n\n\t\t\terr = yaml.Unmarshal([]byte(inputStrings[3]), &newApps)\n\t\t\terrors.CheckError(err)\n\n\t\t\terr = yaml.Unmarshal([]byte(inputStrings[4]), &newRBACCM)\n\t\t\terrors.CheckError(err)\n\n\t\t\tconfig, err := clientConfig.ClientConfig()\n\t\t\terrors.CheckError(err)\n\t\t\tnamespace, _, err := clientConfig.Namespace()\n\t\t\terrors.CheckError(err)\n\t\t\tkubeClientset := kubernetes.NewForConfigOrDie(config)\n\n\t\t\tsettingsMgr := settings.NewSettingsManager(context.Background(), kubeClientset, namespace)\n\t\t\terr = settingsMgr.SaveSettings(newSettings)\n\t\t\terrors.CheckError(err)\n\t\t\tdb := db.NewDB(namespace, settingsMgr, kubeClientset)\n\n\t\t\t_, err = kubeClientset.CoreV1().ConfigMaps(namespace).Create(newRBACCM)\n\t\t\terrors.CheckError(err)\n\n\t\t\tfor _, repo := range newRepos {\n\t\t\t\t_, err := db.CreateRepository(context.Background(), repo)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Warn(err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor _, cluster := range newClusters {\n\t\t\t\t_, err := db.CreateCluster(context.Background(), cluster)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Warn(err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tappClientset := appclientset.NewForConfigOrDie(config)\n\t\t\tfor _, app := range newApps {\n\t\t\t\tout, err := appClientset.ArgoprojV1alpha1().Applications(namespace).Create(app)\n\t\t\t\terrors.CheckError(err)\n\t\t\t\tlog.Println(out)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tclientConfig = cli.AddKubectlFlagsToCmd(&command)\n\n\treturn &command\n}", "title": "" }, { "docid": "0f67f86026e95b5175f271eb14548eea", "score": "0.5722766", "text": "func New(iaas iaas.Name, ops ...Option) (*CLI, error) {\n\tcli := &CLI{\n\t\texecCmd: exec.Command,\n\t\tPath: \"terraform\",\n\t\tiaas: iaas,\n\t}\n\tfor _, op := range ops {\n\t\tif err := op(cli); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn cli, nil\n}", "title": "" }, { "docid": "6fb818e49d7b16def7798fe0566d8f86", "score": "0.5719216", "text": "func NewCommand(ctx api.Context) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"config\",\n\t\tShort: \"Manage the DC/OS configuration file\",\n\t}\n\tcmd.AddCommand(\n\t\tnewCmdConfigSet(ctx),\n\t\tnewCmdConfigShow(ctx),\n\t\tnewCmdConfigUnset(ctx),\n\t)\n\treturn cmd\n}", "title": "" }, { "docid": "e0309c59d6ca7b829462c0333f7e6123", "score": "0.5717809", "text": "func NewCommand(name string, description string, app *Cli, parentCommandPath string) *Command {\n\tresult := &Command{\n\t\tName: name,\n\t\tShortdescription: description,\n\t\tSubCommandsMap: make(map[string]*Command),\n\t\tApp: app,\n\t\tlog: NewLogger(),\n\t\thidden: false,\n\t}\n\n\t// Set up command path\n\tif parentCommandPath != \"\" {\n\t\tresult.CommandPath += parentCommandPath + \" \"\n\t}\n\tresult.CommandPath += name\n\n\t// Set up flag set\n\tresult.Flags = flag.NewFlagSet(result.CommandPath, flag.ContinueOnError)\n\tresult.BoolFlag(\"help\", \"Get help on the '\"+result.CommandPath+\"' command.\", &result.helpFlag)\n\n\t// result.Flags.Usage = result.PrintHelp\n\n\treturn result\n}", "title": "" }, { "docid": "f40b36c4a20305ae6ebce5ca0fb126d1", "score": "0.57001495", "text": "func init() {\n\trootCmd.AddCommand(instanceCmd)\n\tinstanceCmd.AddCommand(instanceListCmd)\n\tinstanceCmd.AddCommand(instanceShowCmd)\n\tinstanceCmd.AddCommand(instanceUpdateCmd)\n\tinstanceCmd.AddCommand(instanceRemoveCmd)\n\tinstanceCmd.AddCommand(instanceRebootCmd)\n\tinstanceCmd.AddCommand(instanceSoftRebootCmd)\n\tinstanceCmd.AddCommand(instanceConsoleCmd)\n\tinstanceCmd.AddCommand(instanceStopCmd)\n\tinstanceCmd.AddCommand(instanceStartCmd)\n\tinstanceCmd.AddCommand(instanceUpgradeCmd)\n\tinstanceCmd.AddCommand(instanceMoveIPCmd)\n\tinstanceCmd.AddCommand(instanceSetFirewallCmd)\n\tinstanceCmd.AddCommand(instancePublicIPCmd)\n\tinstanceCmd.AddCommand(instancePasswordCmd)\n\n\tinstanceCmd.AddCommand(instanceTagCmd)\n\tinstanceUpdateCmd.Flags().StringVarP(&notes, \"notes\", \"n\", \"\", \"notes stored against the instance\")\n\tinstanceUpdateCmd.Flags().StringVarP(&reverseDNS, \"reverse-dns\", \"r\", \"\", \"the reverse DNS entry for the instance\")\n\tinstanceUpdateCmd.Flags().StringVarP(&hostname, \"hostname\", \"h\", \"\", \"the instance's hostname\")\n}", "title": "" }, { "docid": "35d5c296228b69c2967a8deee274c13e", "score": "0.5692821", "text": "func NewCommand(\n\tname string,\n\tbuilder appflag.Builder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse: name + \" --module=<buf.build/owner/repository[:ref]> --plugin=<buf.build/owner/plugin[:version]>\",\n\t\tShort: bufcli.PackageVersionShortDescription(registryName),\n\t\tLong: bufcli.PackageVersionLongDescription(registryName, name, \"buf.build/bufbuild/connect-kotlin\"),\n\t\tArgs: cobra.NoArgs,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appflag.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t\tbufcli.NewErrorInterceptor(),\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}", "title": "" }, { "docid": "53ba4b120ec4be4cc8aa3754ce802770", "score": "0.56806743", "text": "func NewCommand(config *cli.Config) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tArgs: cobra.ExactArgs(1),\n\t\tUse: \"hcl [PATH]\",\n\t\tShort: \"Generate HCL format of terraform.tfvars of inputs\",\n\t\tAnnotations: cli.Annotations(\"tfvars hcl\"),\n\t\tPreRunE: cli.PreRunEFunc(config),\n\t\tRunE: cli.RunEFunc(config),\n\t}\n\treturn cmd\n}", "title": "" }, { "docid": "4fbc18d4bfebf8161bee4591e27622da", "score": "0.5675083", "text": "func (hub *Hub) InitProject(config models.Config) cli.Command {\n\treturn cli.Command{\n\t\tName: \"init\",\n\t\tAliases: []string{\"i\"},\n\t\tUsage: \"Initializes an empty git repo with a sample kubekutr config file.\",\n\t\tAction: hub.init,\n\t}\n}", "title": "" }, { "docid": "bd3e2e98f51b6b251077f4519e5d1e3b", "score": "0.5669895", "text": "func New(settings *environment.Settings) *cobra.Command {\n\treturn newCmd(settings, nil)\n}", "title": "" }, { "docid": "62e7d0472c47bc87c943e8f3efa98452", "score": "0.56620115", "text": "func (gm *GitMock) Init(args ...string) (string, string, error) {\n\targ := append([]string{\"init\"}, args...)\n\treturn gm.Do(arg...)\n}", "title": "" }, { "docid": "6cc79c923b847b57954d6f76fb87e838", "score": "0.56611216", "text": "func init() {\n\tcommandManager.Commands = commands\n}", "title": "" }, { "docid": "0a2caf69f90946ad41f240ebd16d7410", "score": "0.56610435", "text": "func initCmd() error {\n\tviper.SetEnvKeyReplacer(strings.NewReplacer(\"-\", \"_\"))\n\tviper.AutomaticEnv()\n\n\tviper.SetDefault(otlpExporterEndpoint, \"localhost\")\n\tflag.String(otlpExporterEndpoint, \"\", \"OTL Exporter endpoint\")\n\n\tviper.SetDefault(flagJaegerServiceName, \"jaeger-service\")\n\tflag.String(flagJaegerServiceName, \"\", \"Jaeger service name\")\n\n\tviper.SetDefault(flagReportingProtocol, \"http\")\n\tflag.String(flagReportingProtocol, \"\", \"Protocol to report traces (http|grpc)\")\n\n\tviper.SetDefault(flagVerbose, false)\n\tflag.Bool(flagVerbose, false, \"Enable verbosity\")\n\n\tviper.SetDefault(flagJaegerOperationName, \"jaeger-operation\")\n\tflag.String(flagJaegerOperationName, \"\", \"Jaeger operation name\")\n\n\tpflag.CommandLine.AddGoFlagSet(flag.CommandLine)\n\tpflag.Parse()\n\n\terr := viper.BindPFlags(pflag.CommandLine)\n\treturn err\n}", "title": "" }, { "docid": "904d22ce767969abe3ede282e8c3ffa5", "score": "0.56309396", "text": "func (c *Cli) NewCommand(n string) *Command {\n\tcmd := &Command{\n\t\tname: n,\n\t\tcobra: &cobra.Command{Use: n},\n\t}\n\tc.cmds[n] = cmd\n\n\tcmd.setPreRun(func(c *cobra.Command, args []string) {\n\t\t// PreRun function is optional\n\t\tif cmd.RunTask.init != nil {\n\t\t\tcmd.RunTask.init(cmd.RunTask, args)\n\t\t}\n\t})\n\tcmd.setRun(func(c *cobra.Command, args []string) {\n\t\tcmd.RunTask.f(cmd.RunTask, args)\n\t})\n\tc.cobra.AddCommand(cmd.cobra)\n\treturn cmd\n}", "title": "" }, { "docid": "9834b2c2e66bc1c75ebb8afac35d267e", "score": "0.56276846", "text": "func initCommand(options *Options) *cobra.Command {\n\tvar s artifact.Spec\n\tvar users []string\n\n\tcommand := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"\",\n\t\tLong: \"\",\n\t\tPersistentPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(users) == 0 {\n\t\t\t\tuserMappingString := os.Getenv(\"USER_MAPPINGS\")\n\t\t\t\tusers = strings.Split(userMappingString, \",\")\n\t\t\t}\n\t\t\tvar err error\n\t\t\toptions.UserMappings, err = intslack.ParseUserMappings(users)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tisCompanyEmail := func(email string) bool {\n\t\t\t\treturn strings.HasSuffix(email, options.EmailSuffix)\n\t\t\t}\n\t\t\tif !isCompanyEmail(s.Application.AuthorEmail) {\n\t\t\t\tcompanyEmail, ok := options.UserMappings[s.Application.AuthorEmail]\n\t\t\t\tif !ok {\n\t\t\t\t\t// Don't break, just continue and use the provided email\n\t\t\t\t\tfmt.Printf(\"user mappings for %s not found\", s.Application.AuthorEmail)\n\t\t\t\t} else {\n\t\t\t\t\ts.Application.AuthorEmail = companyEmail\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !isCompanyEmail(s.Application.CommitterEmail) {\n\t\t\t\tcompanyEmail, ok := options.UserMappings[s.Application.CommitterEmail]\n\t\t\t\tif !ok {\n\t\t\t\t\t// Don't break, just continue and use the provided email\n\t\t\t\t\tfmt.Printf(\"user mappings for %s not found\", s.Application.CommitterEmail)\n\t\t\t\t} else {\n\t\t\t\t\ts.Application.CommitterEmail = companyEmail\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t// Record when this job started\n\t\t\ts.CI.Start = time.Now()\n\n\t\t\t// Persist the spec to disk\n\t\t\tfilePath := path.Join(options.RootPath, options.FileName)\n\t\t\terr := artifact.Persist(filePath, s)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.WithMessagef(err, \"persist to file '%s'\", filePath)\n\t\t\t}\n\n\t\t\t// If we have an email to use for slack, lets inform\n\t\t\tif s.Application.AuthorEmail != \"\" {\n\t\t\t\t// Setup Slack client\n\t\t\t\tclient, err := intslack.NewClient(slack.New(options.SlackToken), options.UserMappings, options.EmailSuffix)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"Error creating Slack client\")\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\t// create and post the initial slack message\n\t\t\t\ttitle := \":jenkins: Jenkins :sonic-running:\"\n\t\t\t\ttitleLink := s.CI.JobURL\n\t\t\t\ttext := fmt.Sprintf(\"Build for: %s\\nBranch: <%s|*%s*>\\n\", s.Application.Name, s.Application.URL, s.Application.Branch)\n\t\t\t\tcolor := intslack.MsgColorYellow\n\t\t\t\trespChan, timestamp, err := client.PostSlackBuildStarted(s.Application.AuthorEmail, title, titleLink, text, color)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\t// Persist the Slack message to disk for later retrieval and updates\n\t\t\t\tmessageFilePath := path.Join(options.RootPath, options.MessageFileName)\n\t\t\t\terr = intslack.Persist(messageFilePath, intslack.Message{\n\t\t\t\t\tTitle: title,\n\t\t\t\t\tTitleLink: titleLink,\n\t\t\t\t\tText: text,\n\t\t\t\t\tChannel: respChan,\n\t\t\t\t\tTimestamp: timestamp,\n\t\t\t\t\tColor: color,\n\t\t\t\t\tService: s.Application.Name,\n\t\t\t\t})\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"Error persisting slack message to file\")\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcommand.Flags().StringVar(&s.ID, \"artifact-id\", \"\", \"the id of the artifact\")\n\tcommand.Flags().StringVar(&s.Service, \"service\", \"\", \"the service name\")\n\tcommand.Flags().StringVar(&s.Namespace, \"namespace\", \"\", \"the namespace to deploy the service to\")\n\n\t// Init git data\n\tcommand.Flags().StringVar(&s.Application.AuthorName, \"git-author-name\", \"\", \"the commit author name\")\n\tcommand.Flags().StringVar(&s.Application.AuthorEmail, \"git-author-email\", \"\", \"the commit author email\")\n\tcommand.Flags().StringVar(&s.Application.Message, \"git-message\", \"\", \"the commit message\")\n\tcommand.Flags().StringVar(&s.Application.CommitterName, \"git-committer-name\", \"\", \"the commit committer name\")\n\tcommand.Flags().StringVar(&s.Application.CommitterEmail, \"git-committer-email\", \"\", \"the commit committer email\")\n\tcommand.Flags().StringVar(&s.Application.SHA, \"git-sha\", \"\", \"the commit sha\")\n\tcommand.Flags().StringVar(&s.Application.Branch, \"git-branch\", \"\", \"the branch of the repository\")\n\tcommand.Flags().StringVar(&s.Application.Provider, \"provider\", \"\", \"the name of the repository provider\")\n\tcommand.Flags().StringVar(&s.Application.URL, \"url\", \"\", \"the url to the repository commit\")\n\tcommand.Flags().StringVar(&s.Application.Name, \"name\", \"\", \"the name of the repository\")\n\tcommand.Flags().StringVar(&s.Shuttle.Plan.SHA, \"shuttle-plan-sha\", \"\", \"the commit sha of the shuttle plan\")\n\tcommand.Flags().StringVar(&s.Shuttle.Plan.URL, \"shuttle-plan-url\", \"\", \"the url to the shuttle plan commit\")\n\tcommand.Flags().StringVar(&s.Shuttle.Plan.Message, \"shuttle-plan-message\", \"\", \"the shuttle plan commit message\")\n\tcommand.Flags().StringVar(&s.Shuttle.Plan.Branch, \"shuttle-plan-branch\", \"\", \"the shuttle plan branch name\")\n\tcommand.Flags().StringSliceVar(&users, \"user-mappings\", []string{}, \"user mappings between emails used by Git and Slack, key-value pair: <email>=<slack-email>\")\n\n\t// errors are skipped here as the only case they can occour are if thee flag\n\t// does not exist on the command.\n\t//nolint:errcheck\n\tcommand.MarkFlagRequired(\"artifact-id\")\n\t//nolint:errcheck\n\tcommand.MarkFlagRequired(\"service\")\n\t//nolint:errcheck\n\tcommand.MarkFlagRequired(\"git-author-name\")\n\t//nolint:errcheck\n\tcommand.MarkFlagRequired(\"git-author-email\")\n\t//nolint:errcheck\n\tcommand.MarkFlagRequired(\"git-message\")\n\t//nolint:errcheck\n\tcommand.MarkFlagRequired(\"git-committer-name\")\n\t//nolint:errcheck\n\tcommand.MarkFlagRequired(\"git-committer-email\")\n\t//nolint:errcheck\n\tcommand.MarkFlagRequired(\"git-sha\")\n\t//nolint:errcheck\n\tcommand.MarkFlagRequired(\"git-branch\")\n\n\t// Init ci data\n\tcommand.Flags().StringVar(&s.CI.JobURL, \"ci-job-url\", \"\", \"the URL of the Job in CI\")\n\n\treturn command\n}", "title": "" }, { "docid": "d86435babf254da1f3ef47b53ae78b35", "score": "0.56258255", "text": "func (pc *PyCommand) Init() {\n\tpc.Cmd = \"python\"\n\tpc.Arguments = []string{pc.FilePath}\n\n\tif len(pc.RunArgs) > 0 {\n\t\tfor _, ra := range pc.RunArgs {\n\t\t\tpc.Arguments = append(pc.Arguments, ra)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3be595800d11e2b638726a04b0799d15", "score": "0.56248087", "text": "func New(ctx context.Context) *cobra.Command {\n\tcobra.EnableCommandSorting = false\n\n\tcheckNewVersion(ctx)\n\n\tc := &cobra.Command{\n\t\tUse: \"starport\",\n\t\tShort: \"Starport offers everything you need to scaffold, test, build, and launch your blockchain\",\n\t\tLong: `Starport is a tool for creating sovereign blockchains built with Cosmos SDK, the world’s\nmost popular modular blockchain framework. Starport offers everything you need to scaffold,\ntest, build, and launch your blockchain.\n\nTo get started, create a blockchain:\n\nstarport scaffold chain github.com/cosmonaut/mars`,\n\t\tSilenceUsage: true,\n\t\tSilenceErrors: true,\n\t\tPersistentPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn goenv.ConfigurePath()\n\t\t},\n\t}\n\n\tc.AddCommand(NewScaffold())\n\tc.AddCommand(NewChain())\n\tc.AddCommand(NewGenerate())\n\tc.AddCommand(NewNetwork())\n\tc.AddCommand(NewAccount())\n\tc.AddCommand(NewRelayer())\n\tc.AddCommand(NewTools())\n\tc.AddCommand(NewDocs())\n\tc.AddCommand(NewVersion())\n\tc.AddCommand(deprecated()...)\n\n\treturn c\n}", "title": "" }, { "docid": "001d2a7c16426d8b4557bad4ec30f3f1", "score": "0.5619336", "text": "func New() *HelpCommand {\n\treturn &HelpCommand{\n\t\tsections: make([]*section, 0, 10),\n\t}\n}", "title": "" }, { "docid": "ebc4f3d2d4f0e565057dc8a809441bb2", "score": "0.5612002", "text": "func (sc *SignurlCommand) Init(args []string, options OptionMapType) error {\n\treturn sc.command.Init(args, options, sc)\n}", "title": "" }, { "docid": "04b7e40494620a04cae00e35d915a8a3", "score": "0.56068486", "text": "func NewCommand(agentName string, propertyName string, propertyValue string) *Command {\n instance := new(Command)\n instance.agentName = agentName\n instance.propertyName = propertyName\n instance.propertyValue = propertyValue\n return instance\n}", "title": "" }, { "docid": "3989f9d50f99c9e4897ea3863331ab44", "score": "0.56056774", "text": "func init() {\n\tui := &cli.BasicUi{Writer: os.Stdout}\n\tCommands = map[string]cli.CommandFactory{\n\t\t\"index\": func() (cli.Command, error) {\n\t\t\treturn &command.IndexCommand{\n\t\t\t\tUI: ui,\n\t\t\t}, nil\n\t\t},\n\t\t\"version\": func() (cli.Command, error) {\n\t\t\treturn &command.VersionCommand{\n\t\t\t\tName: app.Name,\n\t\t\t\tRevision: GitCommit,\n\t\t\t\tVersion: Version,\n\t\t\t\tVersionPrerelease: VersionPrerelease,\n\t\t\t\tUI: ui,\n\t\t\t}, nil\n\t\t},\n\t}\n}", "title": "" }, { "docid": "511959bf610c3d7464f89d1a8b3f12a1", "score": "0.5596991", "text": "func BuildAppInitCmd() *cobra.Command {\n\topts := &InitAppOpts{\n\t\tGlobalOpts: NewGlobalOpts(),\n\t}\n\tcmd := &cobra.Command{\n\t\tUse: \"init\",\n\t\tShort: \"Creates a new application in a project.\",\n\t\tLong: `Creates a new application in a project.\nThis command is also run as part of \"dw_run.sh init\".`,\n\t\tExample: `\n Create a \"frontend\" web application.\n /code $ dw_run.sh app init --name frontend --app-type \"Load Balanced Web App\" --dockerfile ./frontend/Dockerfile`,\n\t\tPreRunE: runCmdE(func(cmd *cobra.Command, args []string) error {\n\t\t\topts.fs = &afero.Afero{Fs: afero.NewOsFs()}\n\n\t\t\tstore, err := store.New()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"couldn't connect to project datastore: %w\", err)\n\t\t\t}\n\t\t\topts.appStore = store\n\t\t\topts.projGetter = store\n\n\t\t\tws, err := workspace.New()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"workspace cannot be created: %w\", err)\n\t\t\t}\n\t\t\topts.manifestWriter = ws\n\n\t\t\tp := session.NewProvider()\n\t\t\tsess, err := p.Default()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts.projDeployer = cloudformation.New(sess)\n\n\t\t\topts.prog = termprogress.NewSpinner()\n\t\t\treturn nil\n\t\t}),\n\t\tRunE: runCmdE(func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := opts.Validate(); err != nil { // validate flags\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlog.Warningln(\"It's best to run this command in the root of your workspace.\")\n\t\t\tif err := opts.Ask(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := opts.Execute(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlog.Infoln(\"Recommended follow-up actions:\")\n\t\t\tfor _, followup := range opts.RecommendedActions() {\n\t\t\t\tlog.Infof(\"- %s\\n\", followup)\n\t\t\t}\n\t\t\treturn nil\n\t\t}),\n\t}\n\tcmd.Flags().StringVarP(&opts.AppType, appTypeFlag, appTypeFlagShort, \"\" /* default */, appTypeFlagDescription)\n\tcmd.Flags().StringVarP(&opts.AppName, nameFlag, nameFlagShort, \"\" /* default */, appFlagDescription)\n\tcmd.Flags().StringVarP(&opts.DockerfilePath, dockerFileFlag, dockerFileFlagShort, \"\" /* default */, dockerFileFlagDescription)\n\treturn cmd\n}", "title": "" }, { "docid": "f4d4cb0ef0599026553c897f5fce703f", "score": "0.5596475", "text": "func init() {\n\t// Append all child commands to the application command\n\tAppCmd.AddCommand(VersionCmd)\n\tAppCmd.AddCommand(server.ServerCmd)\n\tAppCmd.AddCommand(client.ClientCmd)\n}", "title": "" }, { "docid": "66bc2e24eebebde1bb600558ff319d4b", "score": "0.5592375", "text": "func (c *StopCommand) Init(args []string) error {\n\treturn c.fs.Parse(args)\n}", "title": "" }, { "docid": "130d79f8c378f37c212b440933e691be", "score": "0.5590559", "text": "func New() *Cmd {\n\troot := cobra.Command{\n\t\tUse: \"git-profile\",\n\t\tShort: \"Allows you to switch between multiple user profiles in git repositories\",\n\t\tLong: multiline(\n\t\t\t\"Git Profile allows you to add and switch between multiple\",\n\t\t\t\"user profiles in your git repositories.\",\n\t\t),\n\t}\n\n\treturn &Cmd{\n\t\tCommand: root,\n\t\tVersion: \"0.0.0-unknown\",\n\t\tCommitHash: \"Unknown\",\n\t\tCompileDate: \"Unknown\",\n\t\tconfig: config.New(),\n\t\tgit: &git.Git{},\n\t}\n}", "title": "" }, { "docid": "4b4abda4ad49214d7161ceef9610396e", "score": "0.5586352", "text": "func NewCommand(action int, service string, needResponse bool) (cmd *KickitCommand) {\n\tcmd = new(KickitCommand)\n\tcmd.Action = action\n\tcmd.Service = service\n\tcmd.Args = make(map[string] string)\n\n\tif needResponse {\n\t\tcmd.Response = make(chan *KickitResponse)\n\t}\n\n\treturn cmd\n}", "title": "" }, { "docid": "5e1e0b674cd19f15610762690f05de66", "score": "0.55797124", "text": "func NewCommand(operation Opr, argument int) Command {\n\treturn Command{opcode: operation, argument: argument}\n}", "title": "" }, { "docid": "8c075789976545818f694c2eeac5874c", "score": "0.5570603", "text": "func init() {\n\tcontribCmd.AddCommand(contribCreateCmd)\n\tcontribCreateCmd.Flags().StringVarP(&genType, \"type\", \"t\", \"\", \"The type of contribution you want to generate (\\\"action\\\"|\\\"activity\\\"|\\\"flowmodel\\\"|\\\"trigger\\\") (required)\")\n\tcontribCreateCmd.Flags().StringVarP(&genName, \"name\", \"n\", \"\", \"The name you want to give your contribution (required)\")\n\tcontribCreateCmd.MarkFlagRequired(\"type\")\n\tcontribCreateCmd.MarkFlagRequired(\"name\")\n}", "title": "" }, { "docid": "79236e3c435ecd4b893b6c66d71a070d", "score": "0.55606276", "text": "func NewInitControlPlane(input *ControlPlaneInput) ([]byte, error) {\n\tinput.Header = cloudConfigHeader\n\tinput.WriteFiles = input.Certificates.AsFiles()\n\tinput.WriteFiles = append(input.WriteFiles, input.AdditionalFiles...)\n\tinput.SentinelFileCommand = sentinelFileCommand\n\tuserData, err := generate(\"InitControlplane\", controlPlaneCloudInit, input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn userData, nil\n}", "title": "" } ]
e83b50dd0ec2550604bcd478a3ae0f80
ToDeleteRequestInformation delete navigation property defaultUserRoleOverrides for policies
[ { "docid": "01d028db33172621c042ad5652532a20", "score": "0.69165504", "text": "func (m *AuthorizationPolicyItemDefaultUserRoleOverridesDefaultUserRoleOverrideItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *AuthorizationPolicyItemDefaultUserRoleOverridesDefaultUserRoleOverrideItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" } ]
[ { "docid": "83937c52785f4b95a5dc62cb830e2f21", "score": "0.70084333", "text": "func (m *AuthorizationPolicyItemDefaultUserRoleOverridesDefaultUserRoleOverrideItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *AuthorizationPolicyItemDefaultUserRoleOverridesDefaultUserRoleOverrideItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "dc28d198929f85a88558091979a98597", "score": "0.6082245", "text": "func (m *DirectoryRoleAccessReviewPolicyRequestBuilder) Delete(ctx context.Context, requestConfiguration *DirectoryRoleAccessReviewPolicyRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "5661c0f81376553b44f50b5c28a341b7", "score": "0.58784413", "text": "func (m *DomainSecurityProfilesDomainSecurityProfileItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *DomainSecurityProfilesDomainSecurityProfileItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "509f24919fbf389e078458016cabe5fd", "score": "0.5859081", "text": "func (r *InformationProtectionPolicyRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "4cd9677311ef50f4fdf731b3348288f1", "score": "0.5837885", "text": "func (m *RoleManagementPolicyAssignmentsUnifiedRoleManagementPolicyAssignmentItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *RoleManagementPolicyAssignmentsUnifiedRoleManagementPolicyAssignmentItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "5d7d5f7643d55ee2102b43e2f4f1c913", "score": "0.5794504", "text": "func (m *DirectoryRoleAccessReviewPolicyRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DirectoryRoleAccessReviewPolicyRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "0c73ef7a103a588ef14297a72c95c8a5", "score": "0.57870275", "text": "func (r *FeatureRolloutPolicyRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "4159d8edfcd107eabd6cdbf82f525bf9", "score": "0.5782406", "text": "func (m *OutboundSharedUserProfilesItemTenantsTenantReferenceTenantItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *OutboundSharedUserProfilesItemTenantsTenantReferenceTenantItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "1e1c7b7df7350d3e4d424ec1190dccd5", "score": "0.57680047", "text": "func (m *RoleManagementPolicyAssignmentsUnifiedRoleManagementPolicyAssignmentItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *RoleManagementPolicyAssignmentsUnifiedRoleManagementPolicyAssignmentItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "98108e5adcec0815172faf9973fa3f8b", "score": "0.5734083", "text": "func (m *DirectoryRoleAssignmentApprovalsApprovalItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *DirectoryRoleAssignmentApprovalsApprovalItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "cdbfa0cb53e5e0f38da4467d7cd7a642", "score": "0.57245857", "text": "func (m *ItemResourcesItemRoleAssignmentsGovernanceRoleAssignmentItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemResourcesItemRoleAssignmentsGovernanceRoleAssignmentItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "ee4dc2efee7fe4a8cb1860e3cb09cd08", "score": "0.5682558", "text": "func (m *ItemInformationProtectionRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemInformationProtectionRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "21f6b10d2263f171fa0df6432e6762dc", "score": "0.5682176", "text": "func (m *EnterpriseAppsItemRoleAssignmentApprovalsApprovalItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EnterpriseAppsItemRoleAssignmentApprovalsApprovalItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "071378a6eccc69457607a0558ba2e268", "score": "0.56650376", "text": "func (m *EntitlementManagementResourceNamespacesItemResourceActionsUnifiedRbacResourceActionItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EntitlementManagementResourceNamespacesItemResourceActionsUnifiedRbacResourceActionItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "4783288fd7b9fbf157c1343e1e496387", "score": "0.5660632", "text": "func (m *EnterpriseAppsItemRoleAssignmentApprovalsApprovalItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EnterpriseAppsItemRoleAssignmentApprovalsApprovalItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "0b628da3c865901442361a9591de6b6f", "score": "0.56437016", "text": "func (m *ResourceSpecificPermissionGrantItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourceSpecificPermissionGrantItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "f0af162da3dfbaf9ffbadce970ece2ac", "score": "0.56404716", "text": "func (r *PolicyRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "2b3a36d912d8076e116eb060b52feca6", "score": "0.56241477", "text": "func (m *DomainSecurityProfilesDomainSecurityProfileItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DomainSecurityProfilesDomainSecurityProfileItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "b3cad5b58643f9fd418d570bf7c06270", "score": "0.56224793", "text": "func (m *DirectoryRoleAssignmentApprovalsApprovalItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DirectoryRoleAssignmentApprovalsApprovalItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "a247c2c273af5fbfe131b66f3a4b8db0", "score": "0.55910945", "text": "func (m *ItemScopedRoleMemberOfScopedRoleMembershipItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemScopedRoleMemberOfScopedRoleMembershipItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "d560c00b4ab86f676890514b98c2e7f0", "score": "0.55699795", "text": "func (m *EntitlementManagementRoleDefinitionsUnifiedRoleDefinitionItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementRoleDefinitionsUnifiedRoleDefinitionItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "2098dc022ac329f99fd0719b8539503d", "score": "0.55650085", "text": "func (m *EntitlementManagementAccessPackageCatalogsItemAccessPackageResourceRolesItemAccessPackageResourceAccessPackageResourceScopesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageCatalogsItemAccessPackageResourceRolesItemAccessPackageResourceAccessPackageResourceScopesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "16d94fac7cde3e2575259bae553c68ea", "score": "0.5553812", "text": "func (m *EntitlementManagementResourceNamespacesItemResourceActionsUnifiedRbacResourceActionItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementResourceNamespacesItemResourceActionsUnifiedRbacResourceActionItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "37972ed3276fa33c1e44a35fc99088a1", "score": "0.5552963", "text": "func (m *ItemResourcesItemRoleAssignmentRequestsItemRoleDefinitionRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemResourcesItemRoleAssignmentRequestsItemRoleDefinitionRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "a4a1903e14cee1831b1264eaf20c16be", "score": "0.5547444", "text": "func (m *EntitlementManagementAccessPackagesItemAssignmentPoliciesItemCustomExtensionStageSettingsCustomExtensionStageSettingItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackagesItemAssignmentPoliciesItemCustomExtensionStageSettingsCustomExtensionStageSettingItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "9b2087f486e26571903668b10a0ec6eb", "score": "0.5545885", "text": "func (m *WindowsUpdatesUpdatePoliciesItemAudienceExclusionsUpdatableAssetItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *WindowsUpdatesUpdatePoliciesItemAudienceExclusionsUpdatableAssetItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "c2e7b94cd9a050adcb25584022425ea6", "score": "0.55414075", "text": "func (m *EntitlementManagementAccessPackageCatalogsItemAccessPackageResourceRolesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageCatalogsItemAccessPackageResourceRolesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "2a9350fafca3878f33f0bfd11c37f5ba", "score": "0.55406684", "text": "func (m *VirtualEndpointProvisioningPoliciesItemAssignmentsCloudPcProvisioningPolicyAssignmentItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *VirtualEndpointProvisioningPoliciesItemAssignmentsCloudPcProvisioningPolicyAssignmentItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "7ed3a822b4910ab47c65f743973c839d", "score": "0.5538766", "text": "func (m *EntitlementManagementAccessPackageAssignmentResourceRolesItemAccessPackageResourceRoleAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageAssignmentResourceRolesItemAccessPackageResourceRoleAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "d321bed83f2a1b29f7d2fef1f805abb8", "score": "0.5534467", "text": "func (m *EntitlementManagementAccessPackageAssignmentResourceRolesAccessPackageAssignmentResourceRoleItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageAssignmentResourceRolesAccessPackageAssignmentResourceRoleItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "6f378ad5a1c447d5dffe98dd7b2b60dc", "score": "0.5534186", "text": "func (m *ForwardingProfilesForwardingProfileItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ForwardingProfilesForwardingProfileItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "3e6e6844595e94e23e3da678d0d4bfda", "score": "0.55319554", "text": "func (m *UserItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *UserItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "3de39b2a5aa7579dfbbc41dfc39d39b8", "score": "0.5530881", "text": "func (m *UserExperienceAnalyticsBaselinesUserExperienceAnalyticsBaselineItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsBaselinesUserExperienceAnalyticsBaselineItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "641904fda77b532bc25ce675800de37f", "score": "0.5527952", "text": "func (m *PermissionGrantPoliciesItemExcludesPermissionGrantConditionSetItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *PermissionGrantPoliciesItemExcludesPermissionGrantConditionSetItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "36c4bc728d44594d3d7afb50d8a4cb35", "score": "0.5526863", "text": "func (m *ItemResourcesItemRoleAssignmentsGovernanceRoleAssignmentItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemResourcesItemRoleAssignmentsGovernanceRoleAssignmentItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "78e10ef6e8d35b64d8404981095bfdc0", "score": "0.55246294", "text": "func (m *OutboundSharedUserProfilesItemTenantsTenantReferenceTenantItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *OutboundSharedUserProfilesItemTenantsTenantReferenceTenantItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "816c5b1ca75a5aec6f04cfb3a0c0705d", "score": "0.55245364", "text": "func (m *ItemMyDecisionsAccessReviewDecisionItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemMyDecisionsAccessReviewDecisionItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "1a2d467c67bf67ecba4203968f9dcf85", "score": "0.55180115", "text": "func (r *IdentityGovernanceRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "cfca9b120d98e3ca0cd44fc6659b4b0a", "score": "0.5510407", "text": "func (m *UnifiedRoleAssignmentItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *UnifiedRoleAssignmentItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.requestAdapter.SendNoContentAsync(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "e75b6b81f8732bf4c28774a438524a08", "score": "0.5509248", "text": "func (m *ItemResourcesItemRoleAssignmentRequestsItemRoleDefinitionRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemResourcesItemRoleAssignmentRequestsItemRoleDefinitionRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "3971c1f614d52c56f312e80abb935f46", "score": "0.55089957", "text": "func (m *ItemMyDecisionsAccessReviewDecisionItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemMyDecisionsAccessReviewDecisionItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "4ace893cb758a86f766a71f105a0cee9", "score": "0.55058193", "text": "func (m *EntitlementManagementResourceRoleScopesAccessPackageResourceRoleScopeItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementResourceRoleScopesAccessPackageResourceRoleScopeItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "d0af3f4143e11acdab3ef2a9a989067a", "score": "0.5501663", "text": "func (m *EntitlementManagementCatalogsItemResourceScopesItemResourceRolesItemResourceRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementCatalogsItemResourceScopesItemResourceRolesItemResourceRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "1d68c968a5feffc0906a1871f72acef0", "score": "0.54954195", "text": "func (m *SecurityRequestBuilder) Delete(ctx context.Context, requestConfiguration *SecurityRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.requestAdapter.SendNoContentAsync(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "427995d0c4130c7c191a8faeee004cc2", "score": "0.54939765", "text": "func (m *ItemPartnerInformationRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPartnerInformationRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "152d66c4381cf6d6f2f59b71bebb3e57", "score": "0.5492382", "text": "func (m *AccessReviewsDefinitionsItemInstancesItemStagesAccessReviewStageItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *AccessReviewsDefinitionsItemInstancesItemStagesAccessReviewStageItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "914df60ba9c2c936460f0a7966981ea1", "score": "0.54882073", "text": "func (m *AndroidForWorkEnrollmentProfilesAndroidForWorkEnrollmentProfileItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *AndroidForWorkEnrollmentProfilesAndroidForWorkEnrollmentProfileItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "8debd1381339b008a8f250b706a53f27", "score": "0.54818994", "text": "func (m *WindowsUpdatesUpdatePoliciesItemAudienceExclusionsUpdatableAssetItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *WindowsUpdatesUpdatePoliciesItemAudienceExclusionsUpdatableAssetItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "bca777bde7f40f0d1fa393ca594c7be8", "score": "0.54793626", "text": "func (m *EntitlementManagementRoleDefinitionsUnifiedRoleDefinitionItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EntitlementManagementRoleDefinitionsUnifiedRoleDefinitionItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "8de3ac03d304cc23e684a40b25098010", "score": "0.54661465", "text": "func (m *EntitlementManagementAccessPackagesItemAssignmentPoliciesItemCustomExtensionStageSettingsCustomExtensionStageSettingItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackagesItemAssignmentPoliciesItemCustomExtensionStageSettingsCustomExtensionStageSettingItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "081000c653afaae6379a4581e23ef49f", "score": "0.54612184", "text": "func (m *ManagedTenantsWindowsProtectionStatesWindowsProtectionStateItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ManagedTenantsWindowsProtectionStatesWindowsProtectionStateItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "fba0e4f9ca240d0e328824905fe47b5d", "score": "0.5457369", "text": "func (m *VirtualEndpointProvisioningPoliciesItemAssignmentsCloudPcProvisioningPolicyAssignmentItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *VirtualEndpointProvisioningPoliciesItemAssignmentsCloudPcProvisioningPolicyAssignmentItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "8f0cbe95d82743441499ecabd5c03296", "score": "0.54530406", "text": "func (m *ItemProfileWebsitesPersonWebsiteItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemProfileWebsitesPersonWebsiteItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "069802748ce0f75b438680b1a40519c4", "score": "0.5451878", "text": "func (r *InformationProtectionRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "1d762cf94db2e6aaa6593198cbb714e3", "score": "0.54378766", "text": "func (r *DataLossPreventionPolicyRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "c0bed974d213b005eaab011e3ddf9970", "score": "0.5435878", "text": "func (m *AccessReviewsDefinitionsItemInstancesItemStagesItemDecisionsItemInstanceDecisionsItemInsightsGovernanceInsightItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *AccessReviewsDefinitionsItemInstancesItemStagesItemDecisionsItemInstanceDecisionsItemInsightsGovernanceInsightItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "daf62fa486f054714af5583c12d75ce5", "score": "0.54341274", "text": "func (m *ExchangeResourceNamespacesUnifiedRbacResourceNamespaceItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ExchangeResourceNamespacesUnifiedRbacResourceNamespaceItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "3afc949225d77d16192ff64668c8391e", "score": "0.5429005", "text": "func (m *ResourceSpecificPermissionGrantItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourceSpecificPermissionGrantItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "20edd21a1695f282a16b52c3883a134f", "score": "0.54279554", "text": "func (m *UserExperienceAnalyticsBaselinesUserExperienceAnalyticsBaselineItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *UserExperienceAnalyticsBaselinesUserExperienceAnalyticsBaselineItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "9e184fcbd3a4757b66d4cace02498659", "score": "0.5415921", "text": "func (m *EntitlementManagementAccessPackageAssignmentResourceRolesItemAccessPackageResourceRoleAccessPackageResourceRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageAssignmentResourceRolesItemAccessPackageResourceRoleAccessPackageResourceRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "47a095e37c54e166d504c8a225f90b2d", "score": "0.5414141", "text": "func (m *ItemProfileWebsitesPersonWebsiteItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemProfileWebsitesPersonWebsiteItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "2e0f199a3dd6c75a66cc5f548014b12a", "score": "0.5409243", "text": "func (m *SensitivityPolicySettingsRequestBuilder) Delete(ctx context.Context, requestConfiguration *SensitivityPolicySettingsRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "85954d992edcb24e19b60c9f28f7a0b5", "score": "0.5399665", "text": "func (m *EntitlementManagementAccessPackageAssignmentApprovalsApprovalItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageAssignmentApprovalsApprovalItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "5f3d64a3e5e4359a200c04a811b02c30", "score": "0.53964794", "text": "func (m *ItemTokenIssuancePoliciesItemRefRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTokenIssuancePoliciesItemRefRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n if requestConfiguration.QueryParameters != nil {\n requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters))\n }\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "f8001b1314e4d27c9c7801924fbf7f9c", "score": "0.53961277", "text": "func (m *WindowsQualityUpdateProfilesItemAssignmentsWindowsQualityUpdateProfileAssignmentItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *WindowsQualityUpdateProfilesItemAssignmentsWindowsQualityUpdateProfileAssignmentItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "47a0b111ca42481dd16a7d81aa878075", "score": "0.5382169", "text": "func (m *EmailThreatSubmissionPoliciesEmailThreatSubmissionPolicyItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EmailThreatSubmissionPoliciesEmailThreatSubmissionPolicyItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "eb9855fca9163564d6b78f5471b48576", "score": "0.53784055", "text": "func (m *AccessReviewsDecisionsAccessReviewInstanceDecisionItemItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *AccessReviewsDecisionsAccessReviewInstanceDecisionItemItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "b0e1fbab23adcd8043e3ad608006ea89", "score": "0.53779453", "text": "func (m *AndroidForWorkEnrollmentProfilesAndroidForWorkEnrollmentProfileItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *AndroidForWorkEnrollmentProfilesAndroidForWorkEnrollmentProfileItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "14028415df7d6b7f56eed44515e3f76d", "score": "0.5371869", "text": "func (m *ManagedTenantsWindowsProtectionStatesWindowsProtectionStateItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ManagedTenantsWindowsProtectionStatesWindowsProtectionStateItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "3bcbc47a2de7f7326232e2da747e65d5", "score": "0.5360418", "text": "func (m *DeviceCustomAttributeShellScriptsDeviceCustomAttributeShellScriptItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DeviceCustomAttributeShellScriptsDeviceCustomAttributeShellScriptItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "7022342bdd65c1314271d1d7397a9752", "score": "0.5357381", "text": "func (m *WindowsUpdatesDeploymentAudiencesDeploymentAudienceItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *WindowsUpdatesDeploymentAudiencesDeploymentAudienceItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "a451d355373f7f0887fa4b5f4fb52704", "score": "0.53502274", "text": "func (m *EntitlementManagementAccessPackageAssignmentApprovalsApprovalItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageAssignmentApprovalsApprovalItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "a661abf59cb549384fca314e981f8f74", "score": "0.5344786", "text": "func (m *UserExperienceAnalyticsImpactingProcessUserExperienceAnalyticsImpactingProcessItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsImpactingProcessUserExperienceAnalyticsImpactingProcessItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "36a526f734726a6b2e4488b9091e4f0a", "score": "0.533607", "text": "func (m *ForwardingProfilesForwardingProfileItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ForwardingProfilesForwardingProfileItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "dc8b0e40a7390f9cd621d0716e7f4789", "score": "0.5328688", "text": "func (m *EntitlementManagementAccessPackageAssignmentResourceRolesItemAccessPackageResourceRoleAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageAssignmentResourceRolesItemAccessPackageResourceRoleAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "24ce2d41392ef387881540ace8908947", "score": "0.53216875", "text": "func (m *ItemResourcesGovernanceResourceItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemResourcesGovernanceResourceItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "0abeaa500852f4cabdbc476247e34ef6", "score": "0.5320055", "text": "func (m *EnterpriseAppsItemRoleEligibilityScheduleRequestsUnifiedRoleEligibilityScheduleRequestItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EnterpriseAppsItemRoleEligibilityScheduleRequestsUnifiedRoleEligibilityScheduleRequestItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "e63e11f5074c4a777315668d90aa2ed9", "score": "0.53193647", "text": "func (r *PrivilegedRoleRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "ca8b3e8160d8d2abf6233df757cec254", "score": "0.5318122", "text": "func (m *WindowsQualityUpdateProfilesItemAssignmentsWindowsQualityUpdateProfileAssignmentItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *WindowsQualityUpdateProfilesItemAssignmentsWindowsQualityUpdateProfileAssignmentItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "92de97ddb8f10089574222ecbbfd703e", "score": "0.5316774", "text": "func (m *ServiceAnnouncementHealthOverviewsServiceHealthItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ServiceAnnouncementHealthOverviewsServiceHealthItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "5e4fed069c7281da1acc7817e2f0964a", "score": "0.5303686", "text": "func (m *UserExperienceAnalyticsRemoteConnectionUserExperienceAnalyticsRemoteConnectionItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsRemoteConnectionUserExperienceAnalyticsRemoteConnectionItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "d7fc0a44425a5fdc0a92ee43af57fe7f", "score": "0.5302905", "text": "func (a *Agent) deletePolicy(input interface{}, ctx common.RestContext) (interface{}, error) {\n\t//\tpolicyId := ctx.PathVariables[\"policyID\"]\n\treturn nil, nil\n}", "title": "" }, { "docid": "3039f9361253c9662eda1eeac2b370a5", "score": "0.52991426", "text": "func (m *EmailThreatSubmissionPoliciesEmailThreatSubmissionPolicyItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EmailThreatSubmissionPoliciesEmailThreatSubmissionPolicyItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "c265e958d677b203ffd8601c96e56a4e", "score": "0.5297624", "text": "func (m *EntitlementManagementResourceRequestsItemCatalogResourceScopesItemResourceRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementResourceRequestsItemCatalogResourceScopesItemResourceRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "226a72915bdbcaa59b5d9e9233993d8d", "score": "0.52902484", "text": "func (m *DeviceManagementResourceNamespacesItemResourceActionsItemResourceScopeRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DeviceManagementResourceNamespacesItemResourceActionsItemResourceScopeRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "4e1588fda11694d75625b8e433933341", "score": "0.5288762", "text": "func (r *IntuneBrandingProfileAssignmentRequest) Delete(ctx context.Context) error {\n\treturn r.JSONRequest(ctx, \"DELETE\", \"\", nil, nil)\n}", "title": "" }, { "docid": "d7c96887fa3031aacb1a6ab4ce5cf5bf", "score": "0.5288557", "text": "func (m *EntitlementManagementResourceRequestsItemCatalogResourceScopesItemResourceRequestBuilder) Delete(ctx context.Context, requestConfiguration *EntitlementManagementResourceRequestsItemCatalogResourceScopesItemResourceRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "3ae21e34528e08fe0e0918d7f46d4c54", "score": "0.5287486", "text": "func (m *PermissionGrantPoliciesItemExcludesPermissionGrantConditionSetItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *PermissionGrantPoliciesItemExcludesPermissionGrantConditionSetItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "712095736fcfcc9454b4af64d51beaf3", "score": "0.5282308", "text": "func (m *ItemTokenIssuancePoliciesItemRefRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemTokenIssuancePoliciesItemRefRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "250f1599ad8455be9e7d66e48cee639e", "score": "0.52804285", "text": "func (m *ManagedTenantsManagementIntentsManagementIntentItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ManagedTenantsManagementIntentsManagementIntentItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "df82fa953a51c6119f1d0f3455c8227d", "score": "0.5280231", "text": "func (m *ItemScopedRoleMemberOfScopedRoleMembershipItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemScopedRoleMemberOfScopedRoleMembershipItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "9d03afd4191901f31cb30a1fc2c000c4", "score": "0.528006", "text": "func (m *AccessReviewsDefinitionsItemInstancesItemStagesItemDecisionsItemInstanceDecisionsItemInsightsGovernanceInsightItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *AccessReviewsDefinitionsItemInstancesItemStagesItemDecisionsItemInstanceDecisionsItemInsightsGovernanceInsightItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "aae43be6e200430d7a0001592e665ca5", "score": "0.52682155", "text": "func (m *DeviceCustomAttributeShellScriptsDeviceCustomAttributeShellScriptItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *DeviceCustomAttributeShellScriptsDeviceCustomAttributeShellScriptItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "4955c067abcd39d3e2af2c3af3c62c4a", "score": "0.5264723", "text": "func (m *EnterpriseAppsItemRoleEligibilityScheduleRequestsUnifiedRoleEligibilityScheduleRequestItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EnterpriseAppsItemRoleEligibilityScheduleRequestsUnifiedRoleEligibilityScheduleRequestItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "2cf80cc016a537ee0832963b22309964", "score": "0.5264282", "text": "func (m *EntitlementManagementAccessPackageAssignmentsItemAccessPackageAssignmentResourceRolesItemAccessPackageResourceScopeAccessPackageResourceAccessPackageResourceRolesItemAccessPackageResourceRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageAssignmentsItemAccessPackageAssignmentResourceRolesItemAccessPackageResourceScopeAccessPackageResourceAccessPackageResourceRolesItemAccessPackageResourceRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "63dfa2e72c29d350d0c6aa43f5325545", "score": "0.5260445", "text": "func (m *DirectoryRoleItemRequestBuilder) CreateDeleteRequestInformation(ctx context.Context, requestConfiguration *DirectoryRoleItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE\n if requestConfiguration != nil {\n requestInfo.AddRequestHeaders(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "226b3b38184ca58d4844426bb43447f4", "score": "0.5258297", "text": "func (m *WindowsUpdatesDeploymentAudiencesDeploymentAudienceItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *WindowsUpdatesDeploymentAudiencesDeploymentAudienceItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "05464727adeaa3bd5ae8a774b2609cc8", "score": "0.52521276", "text": "func (m *DirectoryRoleItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *DirectoryRoleItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.requestAdapter.SendNoContentAsync(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "eb0cbcec46ec569c8d23e0b95f611430", "score": "0.5246314", "text": "func (m *EntitlementManagementAccessPackageCatalogsItemAccessPackageResourceRolesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageCatalogsItemAccessPackageResourceRolesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "86948033557ec25c0d4c509a4c2e57eb", "score": "0.52449876", "text": "func (m *EntitlementManagementAccessPackageCatalogsItemAccessPackageResourceRolesItemAccessPackageResourceAccessPackageResourceScopesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageCatalogsItemAccessPackageResourceRolesItemAccessPackageResourceAccessPackageResourceScopesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" } ]
896aff33c72dd819a46cedcd609e4786
Deprecated: Do not use.
[ { "docid": "ac1c1b46c46a405c45233414ff48460c", "score": "0.0", "text": "func (m *Values) GetNodeagent() *NodeAgentConfig {\n\tif m != nil {\n\t\treturn m.Nodeagent\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "96059a39986d18e0489344b39c14820f", "score": "0.5307445", "text": "func (g *GenericVersioner) Deprecated() bool { return g.deprecated }", "title": "" }, { "docid": "13735f239a9647a06d9e04af75abab8d", "score": "0.5294432", "text": "func fn2() { // want fn2:`Deprecated: Don't use this\\.`\n}", "title": "" }, { "docid": "cd23a79484d5e707cb981c14979bd1a7", "score": "0.4940295", "text": "func unused(value interface{}) {\n\t// TODO remove this method\n}", "title": "" }, { "docid": "cd23a79484d5e707cb981c14979bd1a7", "score": "0.4940295", "text": "func unused(value interface{}) {\n\t// TODO remove this method\n}", "title": "" }, { "docid": "cd23a79484d5e707cb981c14979bd1a7", "score": "0.4940295", "text": "func unused(value interface{}) {\n\t// TODO remove this method\n}", "title": "" }, { "docid": "cd23a79484d5e707cb981c14979bd1a7", "score": "0.4940295", "text": "func unused(value interface{}) {\n\t// TODO remove this method\n}", "title": "" }, { "docid": "cd23a79484d5e707cb981c14979bd1a7", "score": "0.4940295", "text": "func unused(value interface{}) {\n\t// TODO remove this method\n}", "title": "" }, { "docid": "cd23a79484d5e707cb981c14979bd1a7", "score": "0.4940295", "text": "func unused(value interface{}) {\n\t// TODO remove this method\n}", "title": "" }, { "docid": "cd23a79484d5e707cb981c14979bd1a7", "score": "0.4940295", "text": "func unused(value interface{}) {\n\t// TODO remove this method\n}", "title": "" }, { "docid": "008c02da0f522e6ca5ff746e21f9d026", "score": "0.4927844", "text": "func (typenameMetaField) Deprecation() *Deprecation {\n\treturn nil\n}", "title": "" }, { "docid": "277ef9e8e083345e1fb784108bdf37de", "score": "0.48982847", "text": "func registerDeprecated(global *flag.FlagSet, local *pflag.FlagSet, globalName, deprecated string) {\n\tregister(global, local, globalName)\n\tlocal.Lookup(normalize(globalName)).Deprecated = deprecated\n}", "title": "" }, { "docid": "09736ca4aeb063fc475ec63557215d27", "score": "0.4884708", "text": "func Noop() {}", "title": "" }, { "docid": "c9c266aff5b94ff0a5cb49f5fc2a534d", "score": "0.47831842", "text": "func (typeMetaField) Deprecation() *Deprecation {\n\treturn nil\n}", "title": "" }, { "docid": "9a01b23cc156f963ea392589c9f28d36", "score": "0.47672948", "text": "func Example() {}", "title": "" }, { "docid": "9a01b23cc156f963ea392589c9f28d36", "score": "0.47672948", "text": "func Example() {}", "title": "" }, { "docid": "99874fc54c46a02b518d6bcf5649ea3e", "score": "0.47458085", "text": "func (in *Scale) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 2\n}", "title": "" }, { "docid": "5627f53e6cef6116a05a8c47efb95dab", "score": "0.4702748", "text": "func (ec *executionContext) dir_deprecated_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {\n\tvar err error\n\targs := map[string]interface{}{}\n\tvar arg0 *string\n\tif tmp, ok := rawArgs[\"reason\"]; ok {\n\t\targ0, err = ec.unmarshalOString2ᚖstring(ctx, tmp)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\targs[\"reason\"] = arg0\n\treturn args, nil\n}", "title": "" }, { "docid": "ae40f5cf6ad2eee6d7f2c21d1f8ab24a", "score": "0.46950856", "text": "func ShowUsage() {\n}", "title": "" }, { "docid": "884e85c3a916f58de0efdbd15ce60cc2", "score": "0.4678352", "text": "func (schemaMetaField) Deprecation() *Deprecation {\n\treturn nil\n}", "title": "" }, { "docid": "7d9d4c35bd9dff981cc65e1e1b7244c7", "score": "0.4676367", "text": "func (in *NetworkPolicy) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 9\n}", "title": "" }, { "docid": "74e644e09d3f2331740bdd2c8115e1a8", "score": "0.46054447", "text": "func (in *Ingress) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 14\n}", "title": "" }, { "docid": "d977ffb97560ca81dc2cef5f0824e6ad", "score": "0.46008715", "text": "func xx() {\n\tpanic(\"Operation not supported\")\n}", "title": "" }, { "docid": "68e3ac73a9459a6dfa21ec7c384a86e4", "score": "0.45960057", "text": "func (in *ReplicaSet) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 8\n}", "title": "" }, { "docid": "b234065d7669ca9722f72d514edaeff0", "score": "0.4566184", "text": "func (f feature) Deprecated() (bool, string) {\n\treturn len(f.deprecated) > 0, f.deprecated\n}", "title": "" }, { "docid": "516242bdca13856c10f888eaf871051b", "score": "0.45576042", "text": "func (in *NetworkPolicyList) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 9\n}", "title": "" }, { "docid": "0cd76780a8022142f6b7fe7e5a8f52a5", "score": "0.45560902", "text": "func (in *DeploymentConfig) APILifecycleDeprecated() (major, minor int) {\n\treturn 4, 14\n}", "title": "" }, { "docid": "b5213bcb1d4e71c6574176d4cc05bec7", "score": "0.45517164", "text": "func (in *Deployment) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 8\n}", "title": "" }, { "docid": "ca1ab0725cfba925186e17701da55656", "score": "0.45423895", "text": "func (in *DaemonSet) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 8\n}", "title": "" }, { "docid": "a5fe4107ac32db490807cb97f66ffd29", "score": "0.453638", "text": "func (in *DeploymentLogOptions) APILifecycleDeprecated() (major, minor int) {\n\treturn 4, 14\n}", "title": "" }, { "docid": "1dca339e1b353d8bda352f43ac4813df", "score": "0.45227325", "text": "func init() {}", "title": "" }, { "docid": "1dca339e1b353d8bda352f43ac4813df", "score": "0.45227325", "text": "func init() {}", "title": "" }, { "docid": "1dca339e1b353d8bda352f43ac4813df", "score": "0.45227325", "text": "func init() {}", "title": "" }, { "docid": "26952ce10b464e3800194bcf9fc45acd", "score": "0.4516106", "text": "func checkRemoved(name string) error {\n\tswitch name {\n\tcase \"aufs\", \"devicemapper\", \"overlay\":\n\t\treturn NotSupportedError(fmt.Sprintf(\"[graphdriver] ERROR: the %s storage-driver has been deprecated and removed; visit https://docs.docker.com/go/storage-driver/ for more information\", name))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "facca92a423409afa80edf7988d03a67", "score": "0.4516052", "text": "func (n *nullDevice) DeprecatedPreadv(ctx context.Context, dst usermem.IOSequence, offset int64) (int64, error) {\n\treturn 0, io.EOF\n}", "title": "" }, { "docid": "10c2de064d0750b53d06cdd010773dcb", "score": "0.45136473", "text": "func use(interface{}) {}", "title": "" }, { "docid": "2c825630c9817429f24e09126539abf5", "score": "0.45124787", "text": "func (in *DeploymentConfigList) APILifecycleDeprecated() (major, minor int) {\n\treturn 4, 14\n}", "title": "" }, { "docid": "26b65d7ce8336427b3f21b5b4c380d18", "score": "0.45115623", "text": "func (in *ReplicaSetList) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 8\n}", "title": "" }, { "docid": "34216de80ff1e87d62d34d591e0a9efe", "score": "0.45076466", "text": "func (err *InvalidArgument) InvalidArgument() {}", "title": "" }, { "docid": "cbfb45f569c492b7d77fef6287880526", "score": "0.45036754", "text": "func BadUsage(msg string) error { return badUsageError{msg} }", "title": "" }, { "docid": "cd14dc00c0c43711a058e6ea84f4ea7b", "score": "0.44912022", "text": "func (*UsedStruct) UsedInPackageMethod() {}", "title": "" }, { "docid": "c4e1525b14624b7c05b739b3cc1d4e61", "score": "0.44873768", "text": "func mustMarkDeprecated(name string, usageMessage string) {\n\terr := pflag.CommandLine.MarkDeprecated(name, usageMessage)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"error marking flag %q as deprecated: %v\", name, err))\n\t}\n}", "title": "" }, { "docid": "ca963b08265722bcb891a73df5dbc85f", "score": "0.4487207", "text": "func (in *DeploymentLog) APILifecycleDeprecated() (major, minor int) {\n\treturn 4, 14\n}", "title": "" }, { "docid": "64f9703e5514ef774a03dc3f0fe0d96a", "score": "0.44809633", "text": "func (*ValueSetDeprecated) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r5_core_extensions_proto_rawDescGZIP(), []int{385}\n}", "title": "" }, { "docid": "db9c2cd127ed288303de14d7cf4cbb2a", "score": "0.44800887", "text": "func pflagRegisterDeprecated(global, local *pflag.FlagSet, globalName, deprecated string) {\n\tpflagRegister(global, local, globalName)\n\tlocal.Lookup(normalize(globalName)).Deprecated = deprecated\n}", "title": "" }, { "docid": "f9727db6f92da2615d9c9c80d5df5a9d", "score": "0.4479835", "text": "func MarkDeprecated(fs *pflag.FlagSet, name, message string) {\n\tfs.MarkDeprecated(name, message) //nolint: errcheck\n}", "title": "" }, { "docid": "18e3317a7f2130d6b12757c563f201bb", "score": "0.44690475", "text": "func getg0() interface{}", "title": "" }, { "docid": "54e906ca5385895939f9788e5e3edc5b", "score": "0.4466178", "text": "func (*MySQLService) sealedService() {}", "title": "" }, { "docid": "0db2a289b053888f48d8d437b526750e", "score": "0.44645905", "text": "func (in *IngressList) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 14\n}", "title": "" }, { "docid": "cad7771ba83cff42e27f48c5923e8de6", "score": "0.44632298", "text": "func (*ValueSetDeprecated) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r4_core_extensions_proto_rawDescGZIP(), []int{365}\n}", "title": "" }, { "docid": "ba8f41cc90875a4e1b10479367f03f2c", "score": "0.44552404", "text": "func deprecateSnakeCase(cmd *cobra.Command, args []string) {\n\tif strings.Contains(cmd.CalledAs(), \"_\") {\n\t\tfmt.Println(\"Deprecated: snake_case commands will be replaced by hyphen-case commands in the next major release\")\n\t}\n}", "title": "" }, { "docid": "44a822e0931c9578155fb495dbb4838a", "score": "0.44540176", "text": "func parseDeprecatedEnvironment() {\n\tcheckDepricatedStatsD()\n\tcheckDepricatedNomadHTTP()\n\tcheckDepricatedNomadAddr()\n\tcheckDepricatedConsulAddr()\n\tcheckDepricatedNomadRegion()\n\tcheckDepricatedLoggerLevel()\n\tcheckDepricatedLoggerFormat()\n\tcheckDepricatedLoggerOutput()\n}", "title": "" }, { "docid": "fdb36b13bb2b5c8f7160ecc0c081fad3", "score": "0.4450313", "text": "func (s *Scrapper) foo() {}", "title": "" }, { "docid": "f4506d034921c07de48f25a2c19b4647", "score": "0.4449736", "text": "func newUnsupportChartType(chartType string) error {\n\treturn fmt.Errorf(\"unsupported chart type %s\", chartType)\n}", "title": "" }, { "docid": "f5760b5b3838eb3af4ef33fade597666", "score": "0.4442708", "text": "func (in *DaemonSetList) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 8\n}", "title": "" }, { "docid": "99ed5a1b29a94738b6976e16a7ff8a00", "score": "0.44407964", "text": "func (in *DeploymentList) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 8\n}", "title": "" }, { "docid": "98c74ecb169665b1be0d1571c95b90b2", "score": "0.44392997", "text": "func (*Session) BuiltinFunctionUsageInc(_ string) {\n}", "title": "" }, { "docid": "643372b477255f2cd1ff1997fe5e0ab3", "score": "0.44280803", "text": "func main() {\n\td := duration{42}\n\td.pretty()\n\n\t// ./listing46.go:17: cannot call pointer method on duration(42)\n\t// ./listing46.go:17: cannot take the address of duration(42)\n}", "title": "" }, { "docid": "2988b3d13da126532211152a64aad105", "score": "0.4420763", "text": "func DeprecatedFlag(f *flag.FlagSet, name, message string) {\n\tf.Var(deprecatedFlag{name}, name, message)\n}", "title": "" }, { "docid": "a7a2bbc932dbb752147472e53b769e02", "score": "0.44147632", "text": "func (loadset *LoadSet) get_load_vector() {\n\n}", "title": "" }, { "docid": "0461f607390da2469030461a01383fb1", "score": "0.4413072", "text": "func parseDeprecation(block *LineBlock, line *Line) string {\n\ttext := parseDirectiveComment(block, line)\n\tm := deprecatedRE.FindStringSubmatch(text)\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\treturn m[1]\n}", "title": "" }, { "docid": "11fc0879812c708ac1bfe6d11b9c0dc7", "score": "0.44084096", "text": "func (in *DeploymentConfigRollback) APILifecycleDeprecated() (major, minor int) {\n\treturn 4, 14\n}", "title": "" }, { "docid": "c38a5149f656c3cf44bcef5f6797169b", "score": "0.4396656", "text": "func usage() {\n\tfmt.Fprint(os.Stderr, USAGE)\n}", "title": "" }, { "docid": "038dd7f29f4a053c9cd3d896ec4014a4", "score": "0.43938047", "text": "func addMetadataDeprecated(client *Client, typedValue, key, value, requestUri string) (Task, error) {\n\tnewMetadata := &types.MetadataValue{\n\t\tXmlns: types.XMLNamespaceVCloud,\n\t\tXsi: types.XMLNamespaceXSI,\n\t\tTypedValue: &types.MetadataTypedValue{\n\t\t\tXsiType: typedValue,\n\t\t\tValue: value,\n\t\t},\n\t}\n\n\tapiEndpoint := urlParseRequestURI(requestUri)\n\tapiEndpoint.Path += \"/metadata/\" + key\n\n\t// Return the task\n\treturn client.ExecuteTaskRequest(apiEndpoint.String(), http.MethodPut,\n\t\ttypes.MimeMetaDataValue, \"error adding metadata: %s\", newMetadata)\n}", "title": "" }, { "docid": "87d234d599f098eff995d451aeb46502", "score": "0.43925098", "text": "func (in *DeploymentRequest) APILifecycleDeprecated() (major, minor int) {\n\treturn 4, 14\n}", "title": "" }, { "docid": "c683e635ffc3763051d721242e8c62b8", "score": "0.43923432", "text": "func TestProviderControlService_GetListInProgress(t *testing.T) {\n\n}", "title": "" }, { "docid": "85f3224f68a25798b755e08579bdb0fd", "score": "0.43734246", "text": "func newTooShortParseLineError(s string) error {\n\treturn errors.New(fmt.Sprintf(\"%s: Parsed line too short.\", s))\n}", "title": "" }, { "docid": "159b761f16f9629805fc2c9b94ee1d2e", "score": "0.4371957", "text": "func (gsp *Gossiper) newForwardedMessage(msg *message.SimpleMessage) *message.SimpleMessage {\n\tmsg = message.NewSimpleMessage(msg.Contents, msg.OriginalName, gsp.PeersSocket.Address())\n\treturn msg\n}", "title": "" }, { "docid": "17d7b5b54a5d03ef7c9f627883a732a9", "score": "0.43712184", "text": "func init() {\r\n}", "title": "" }, { "docid": "41081dfe386fc5ea46595c289931f495", "score": "0.43617854", "text": "func (*Listener_DeprecatedV1) Descriptor() ([]byte, []int) {\n\treturn file_envoy_config_listener_v4alpha_listener_proto_rawDescGZIP(), []int{1, 0}\n}", "title": "" }, { "docid": "eb1d98a47728d83c3cbc103690f85f5d", "score": "0.43576473", "text": "func (s S1) use_v() {\n\tfmt.Println(\"S1.use_v()\")\n}", "title": "" }, { "docid": "cb3e88bbdf18fad3bc52c60ae0640921", "score": "0.43569762", "text": "func _() int {\n\t{\n\t\treturn 2\n\t}\n}", "title": "" }, { "docid": "ddf97c40a205dba2694ca526a204fb54", "score": "0.4354603", "text": "func (in *DeploymentRollback) APILifecycleDeprecated() (major, minor int) {\n\treturn 1, 8\n}", "title": "" }, { "docid": "2be088965f73bfd7443f076d435af63d", "score": "0.43496394", "text": "func (self *MSPointer) PointerMoveCallback() interface{}{\n return self.Object.Get(\"pointerMoveCallback\")\n}", "title": "" }, { "docid": "6b115b7d2c372a3a787caa44c5a1bbcf", "score": "0.43483272", "text": "func New() {\n\n}", "title": "" }, { "docid": "36ac6cf9d4b030237a0681d36e1d516d", "score": "0.43432274", "text": "func DeprecatedDiagnostics(ctx ResolveContext) []protocol.Diagnostic {\n\tdefer util.TimeTrack(time.Now(), \"DeprecatedDiagnostics\")\n\tdoc := ctx.document\n\tq := ctx.query\n\tcreate := func(r protocol.Range, message string) protocol.Diagnostic {\n\t\treturn protocol.Diagnostic{\n\t\t\tRange: r,\n\t\t\tMessage: message,\n\t\t\tSource: source,\n\t\t\tSeverity: protocol.SeverityHint,\n\t\t\tTags: []protocol.DiagnosticTag{protocol.Deprecated},\n\t\t}\n\t}\n\tdiagnostics := []protocol.Diagnostic{}\n\tTraverseDocument(doc, func(s Symbol) {\n\t\tswitch v := s.(type) {\n\t\tcase *FunctionCall:\n\t\t\tt := NewTypeString(v.Name)\n\t\t\tfqn := doc.ImportTableAtPos(v.Location.Range.Start).GetFunctionReferenceFQN(ctx.query, t)\n\t\t\tfor _, f := range q.GetFunctions(fqn) {\n\t\t\t\tif f.deprecatedTag != nil {\n\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\tdeprecatedDescription(v.Name+\" is deprecated\", f.deprecatedTag),\n\t\t\t\t\t))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\tcase *ClassTypeDesignator:\n\t\t\tv.Resolve(ctx)\n\t\tLClassTypeDesignator:\n\t\t\tfor _, t := range v.GetTypes().Resolve() {\n\t\t\t\tfor _, c := range q.GetClasses(t.GetFQN()) {\n\t\t\t\t\tif c.deprecatedTag != nil {\n\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\tdeprecatedDescription(v.Name+\" is deprecated\", c.deprecatedTag),\n\t\t\t\t\t\t))\n\t\t\t\t\t\tbreak LClassTypeDesignator\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase *TypeDeclaration:\n\t\t\tv.Resolve(ctx)\n\t\tLTypeDecl:\n\t\t\tfor _, t := range v.GetTypes().Resolve() {\n\t\t\t\tfor _, c := range q.GetClasses(t.GetFQN()) {\n\t\t\t\t\tif c.deprecatedTag != nil {\n\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\tdeprecatedDescription(v.Name+\" is deprecated\", c.deprecatedTag),\n\t\t\t\t\t\t))\n\t\t\t\t\t\tbreak LTypeDecl\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor _, i := range q.GetInterfaces(t.GetFQN()) {\n\t\t\t\t\tif i.deprecatedTag != nil {\n\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\tdeprecatedDescription(v.Name+\" is deprecated\", i.deprecatedTag),\n\t\t\t\t\t\t))\n\t\t\t\t\t\tbreak LTypeDecl\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase *ClassAccess:\n\t\t\tv.Resolve(ctx)\n\t\tLClass:\n\t\t\tfor _, t := range v.GetTypes().Resolve() {\n\t\t\t\tfor _, c := range q.GetClasses(t.GetFQN()) {\n\t\t\t\t\tif c.deprecatedTag != nil {\n\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\tdeprecatedDescription(v.Name+\" is deprecated\", c.deprecatedTag),\n\t\t\t\t\t\t))\n\t\t\t\t\t\tbreak LClass\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor _, i := range q.GetInterfaces(t.GetFQN()) {\n\t\t\t\t\tif i.deprecatedTag != nil {\n\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\tdeprecatedDescription(v.Name+\" is deprecated\", i.deprecatedTag),\n\t\t\t\t\t\t))\n\t\t\t\t\t\tbreak LClass\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase *InterfaceAccess:\n\t\t\tv.Resolve(ctx)\n\t\tLInterface:\n\t\t\tfor _, t := range v.GetTypes().Resolve() {\n\t\t\t\tfor _, i := range q.GetInterfaces(t.GetFQN()) {\n\t\t\t\t\tif i.deprecatedTag != nil {\n\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\tdeprecatedDescription(v.Name+\" is deprecated\", i.deprecatedTag),\n\t\t\t\t\t\t))\n\t\t\t\t\t\tbreak LInterface\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase *ConstantAccess:\n\t\t\tv.Resolve(ctx)\n\t\t\tname := NewTypeString(v.Name)\n\t\t\tfqn := doc.ImportTableAtPos(v.Location.Range.Start).GetConstReferenceFQN(q, name)\n\t\t\tvar shouldStop bool\n\t\t\tfor _, c := range q.GetConsts(fqn) {\n\t\t\t\tif c.deprecatedTag != nil {\n\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\tdeprecatedDescription(v.Name+\" is deprecated\", c.deprecatedTag),\n\t\t\t\t\t))\n\t\t\t\t\tshouldStop = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif shouldStop {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfor _, c := range q.GetDefines(fqn) {\n\t\t\t\tif c.deprecatedTag != nil {\n\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\tdeprecatedDescription(v.Name+\" is deprecated\", c.deprecatedTag),\n\t\t\t\t\t))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\tcase *ScopedConstantAccess:\n\t\tLScopedConstant:\n\t\t\tfor _, scopeType := range v.ResolveAndGetScope(ctx).Resolve() {\n\t\t\t\tfor _, c := range q.GetClassConsts(scopeType.GetFQN(), v.Name) {\n\t\t\t\t\tif c.deprecatedTag != nil {\n\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\tdeprecatedDescription(c.ReferenceFQN()+\" is deprecated\", c.deprecatedTag),\n\t\t\t\t\t\t))\n\t\t\t\t\t\tbreak LScopedConstant\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase *ScopedMethodAccess:\n\t\t\tcurrentClass := ctx.document.GetClassScopeAtSymbol(v)\n\t\tLScopedMethod:\n\t\t\tfor _, scopeType := range v.ResolveAndGetScope(ctx).Resolve() {\n\t\t\t\tfor _, class := range q.GetClasses(scopeType.GetFQN()) {\n\t\t\t\t\tfor _, m := range q.GetClassMethods(class, v.Name, nil).ReduceStatic(currentClass, v) {\n\t\t\t\t\t\tif m.Method == nil {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif m.Method.deprecatedTag != nil {\n\t\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\t\tdeprecatedDescription(m.Method.ReferenceFQN()+\" is deprecated\", m.Method.deprecatedTag),\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\tbreak LScopedMethod\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase *ScopedPropertyAccess:\n\t\t\tcurrentClass := ctx.document.GetClassScopeAtSymbol(v)\n\t\tLScopedProp:\n\t\t\tfor _, scopeType := range v.ResolveAndGetScope(ctx).Resolve() {\n\t\t\t\tfor _, class := range q.GetClasses(scopeType.GetFQN()) {\n\t\t\t\t\tfor _, p := range q.GetClassProps(class, v.Name, nil).ReduceStatic(currentClass, v) {\n\t\t\t\t\t\tif p.Prop.deprecatedTag != nil {\n\t\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\t\tdeprecatedDescription(p.Prop.ReferenceFQN()+\" is deprecated\", p.Prop.deprecatedTag),\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\tbreak LScopedProp\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase *PropertyAccess:\n\t\t\tcurrentClass := ctx.document.GetClassScopeAtSymbol(v)\n\t\tLProp:\n\t\t\tfor _, scopeType := range v.ResolveAndGetScope(ctx).Resolve() {\n\t\t\t\tfor _, class := range q.GetClasses(scopeType.GetFQN()) {\n\t\t\t\t\tfor _, p := range q.GetClassProps(class, \"$\"+v.Name, nil).ReduceAccess(currentClass, v) {\n\t\t\t\t\t\tif p.Prop.deprecatedTag != nil {\n\t\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\t\tdeprecatedDescription(p.Prop.ReferenceFQN()+\" is deprecated\", p.Prop.deprecatedTag),\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\tbreak LProp\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase *MethodAccess:\n\t\t\tcurrentClass := ctx.document.GetClassScopeAtSymbol(v)\n\t\tLMethod:\n\t\t\tfor _, scopeType := range v.ResolveAndGetScope(ctx).Resolve() {\n\t\t\t\tfor _, class := range q.GetClasses(scopeType.GetFQN()) {\n\t\t\t\t\tfor _, m := range q.GetClassMethods(class, v.Name, nil).ReduceAccess(currentClass, v) {\n\t\t\t\t\t\tmethod := m.Method\n\t\t\t\t\t\tif method == nil {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif method.deprecatedTag != nil {\n\t\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\t\tdeprecatedDescription(method.ReferenceFQN()+\" is deprecated\", method.deprecatedTag),\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\tbreak LMethod\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor _, theInterface := range q.GetInterfaces(scopeType.GetFQN()) {\n\t\t\t\t\tfor _, m := range q.GetInterfaceMethods(theInterface, v.Name, nil).ReduceAccess(currentClass, v) {\n\t\t\t\t\t\tmethod := m.Method\n\t\t\t\t\t\tif method == nil {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif method.deprecatedTag != nil {\n\t\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\t\tdeprecatedDescription(method.ReferenceFQN()+\" is deprecated\", method.deprecatedTag),\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\tbreak LMethod\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor _, trait := range q.GetTraits(scopeType.GetFQN()) {\n\t\t\t\t\tfor _, m := range q.GetTraitMethods(trait, v.Name).ReduceAccess(currentClass, v) {\n\t\t\t\t\t\tmethod := m.Method\n\t\t\t\t\t\tif method == nil {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif method.deprecatedTag != nil {\n\t\t\t\t\t\t\tdiagnostics = append(diagnostics, create(\n\t\t\t\t\t\t\t\tv.Location.Range,\n\t\t\t\t\t\t\t\tdeprecatedDescription(method.ReferenceFQN()+\" is deprecated\", method.deprecatedTag),\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\tbreak LMethod\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, nil)\n\treturn diagnostics\n}", "title": "" }, { "docid": "8896499f275215adf8df584511e9b952", "score": "0.43382946", "text": "func SupportV1(strgObject storage.IStorage, cfg *types.Config) {\n strg = strgObject\n config = cfg\n}", "title": "" }, { "docid": "1f2068eb1d21cff55665638c8a537836", "score": "0.43358812", "text": "func DeprecatedChannel(cb func(p Position, channel uint8)) func(r *Reader) {\n\treturn func(r *Reader) {\n\t\tr.message.Meta.Deprecated.Channel = cb\n\t}\n}", "title": "" }, { "docid": "2129285fd98dfa5863f69406c8b38a5a", "score": "0.43326676", "text": "func usageErr(err error) {\n\tusage()\n\tfmt.Fprintf(os.Stderr, \"Error: %v\\n\\n\", err)\n}", "title": "" }, { "docid": "0596f27be72c2459373f06fad36df414", "score": "0.43260357", "text": "func (vm *Vm) getspecial() {}", "title": "" }, { "docid": "8b236f4440ad22c48d3fbd8b20c3d6f5", "score": "0.43223923", "text": "func Version() string { return version }", "title": "" }, { "docid": "58ee5410d112cd81ed8455df864b99b9", "score": "0.43114126", "text": "func (s PathStepElementKeyInt) unexported() {}", "title": "" }, { "docid": "03d3c37b39592139b88fc69c91bd74b8", "score": "0.4306979", "text": "func (*GroupOld_G) Descriptor() ([]byte, []int) {\n\treturn file_proto2_proto_test_proto_rawDescGZIP(), []int{24, 0}\n}", "title": "" }, { "docid": "3bbf2a8da89f96460c3c22bf770da160", "score": "0.43054333", "text": "func deprecateBackend(b backend.Backend, message string) backend.Backend {\n\t// Since a Backend wrapped by deprecatedBackendShim can no longer be\n\t// asserted as an Enhanced or Local backend, disallow those types here\n\t// entirely. If something other than a basic backend.Backend needs to be\n\t// deprecated, we can add that functionality to schema.Backend or the\n\t// backend itself.\n\tif _, ok := b.(backend.Enhanced); ok {\n\t\tpanic(\"cannot use DeprecateBackend on an Enhanced Backend\")\n\t}\n\n\tif _, ok := b.(backend.Local); ok {\n\t\tpanic(\"cannot use DeprecateBackend on a Local Backend\")\n\t}\n\n\treturn deprecatedBackendShim{\n\t\tBackend: b,\n\t\tMessage: message,\n\t}\n}", "title": "" }, { "docid": "3bbf2a8da89f96460c3c22bf770da160", "score": "0.43054333", "text": "func deprecateBackend(b backend.Backend, message string) backend.Backend {\n\t// Since a Backend wrapped by deprecatedBackendShim can no longer be\n\t// asserted as an Enhanced or Local backend, disallow those types here\n\t// entirely. If something other than a basic backend.Backend needs to be\n\t// deprecated, we can add that functionality to schema.Backend or the\n\t// backend itself.\n\tif _, ok := b.(backend.Enhanced); ok {\n\t\tpanic(\"cannot use DeprecateBackend on an Enhanced Backend\")\n\t}\n\n\tif _, ok := b.(backend.Local); ok {\n\t\tpanic(\"cannot use DeprecateBackend on a Local Backend\")\n\t}\n\n\treturn deprecatedBackendShim{\n\t\tBackend: b,\n\t\tMessage: message,\n\t}\n}", "title": "" }, { "docid": "74842b8a3389ef53cd07b26848b8aa4c", "score": "0.43044475", "text": "func DeprecatedInThreePointOh(deprecationMessage string) string {\n\tif !ThreePointOh() {\n\t\treturn \"\"\n\t}\n\n\treturn deprecationMessage\n}", "title": "" }, { "docid": "425b17b98eb7c6335e3b3a36d9201c98", "score": "0.4301402", "text": "func throw(_ string)", "title": "" }, { "docid": "f743bd173c18932cb22c600d23a12a2f", "score": "0.43013328", "text": "func (s S0) use_v() {\n\tfmt.Println(\"S0.use_v()\")\n}", "title": "" }, { "docid": "6735847df02f27e29ca4faeade741027", "score": "0.42989153", "text": "func init() {\r\n\r\n}", "title": "" }, { "docid": "bcd432504a4db0ffbc17196630ac1491", "score": "0.42921108", "text": "func setErr0(frame *rtda.Frame) {\n\terrObj := frame.LocalVars().GetRef(0)\n\tsysClass := frame.GetMethod().GetOwner()\n\tsysClass.SetStaticFieldRef(\"err\", \"Ljava/io/PrintStream;\", errObj)\n}", "title": "" }, { "docid": "f08004e0a3f1e742d53a92e508806fa3", "score": "0.42899463", "text": "func newWrongTypeComplainer(dependencyName string) WrongTypeComplainer {\n\terr := internalWrongTypeComplainer{\n\t\tdependencyName:dependencyName,\n\t}\n\n\treturn &err\n}", "title": "" }, { "docid": "e719adc8a8dd3731c081d38fb4515330", "score": "0.42888063", "text": "func newUUID() string {\n\treturn uuid.Must(uuid.NewV4()).String()\n}", "title": "" }, { "docid": "f4c96c93a8b06c12b3b9a3c057291ea3", "score": "0.4287999", "text": "func ExampleWrite() {}", "title": "" }, { "docid": "720f216bd06741e3109a335b7d1beb08", "score": "0.42848593", "text": "func (self *MSPointer) Enabled() bool{\n return self.Object.Get(\"enabled\").Bool()\n}", "title": "" }, { "docid": "8143c55ed6ee324d0ce9d1b76f3f8120", "score": "0.42825598", "text": "func ExpErr() error { // ok\n return nil\n}", "title": "" }, { "docid": "ae6d9e9dd6a03f0acc987d42cd1b5ef5", "score": "0.42763168", "text": "func libfuse_rename(src *C.char, dst *C.char, flags C.uint) C.int {\n\tsrcPath := trimFusePath(src)\n\tsrcPath = common.NormalizeObjectName(srcPath)\n\tdstPath := trimFusePath(dst)\n\tdstPath = common.NormalizeObjectName(dstPath)\n\tlog.Trace(\"Libfuse::libfuse_rename : %s -> %s\", srcPath, dstPath)\n\t// Note: When running other commands from the command line, a lot of them seemed to handle some cases like ENOENT themselves.\n\t// Rename did not, so we manually check here.\n\n\t// TODO: Support for RENAME_EXCHANGE\n\tif flags&C.RENAME_EXCHANGE != 0 {\n\t\treturn -C.ENOTSUP\n\t}\n\n\t// ENOENT. Not covered: a directory component in dst does not exist\n\tif srcPath == \"\" || dstPath == \"\" {\n\t\tlog.Err(\"Libfuse::libfuse_rename : src: [%s] or dst: [%s] is an empty string\", srcPath, dstPath)\n\t\treturn -C.ENOENT\n\t}\n\n\tsrcAttr, srcErr := fuseFS.NextComponent().GetAttr(internal.GetAttrOptions{Name: srcPath})\n\tif os.IsNotExist(srcErr) {\n\t\tlog.Err(\"Libfuse::libfuse_rename : Failed to get attributes of %s [%s]\", srcPath, srcErr.Error())\n\t\treturn -C.ENOENT\n\t}\n\tdstAttr, dstErr := fuseFS.NextComponent().GetAttr(internal.GetAttrOptions{Name: dstPath})\n\n\t// EEXIST\n\tif flags&C.RENAME_NOREPLACE != 0 && (dstErr == nil || os.IsExist(dstErr)) {\n\t\treturn -C.EEXIST\n\t}\n\n\t// EISDIR\n\tif (dstErr == nil || os.IsExist(dstErr)) && dstAttr.IsDir() && !srcAttr.IsDir() {\n\t\tlog.Err(\"Libfuse::libfuse_rename : dst [%s] is an existing directory but src [%s] is not a directory\", dstPath, srcPath)\n\t\treturn -C.EISDIR\n\t}\n\n\t// ENOTDIR\n\tif (dstErr == nil || os.IsExist(dstErr)) && !dstAttr.IsDir() && srcAttr.IsDir() {\n\t\tlog.Err(\"Libfuse::libfuse_rename : dst [%s] is an existing file but src [%s] is a directory\", dstPath, srcPath)\n\t\treturn -C.ENOTDIR\n\t}\n\n\tif srcAttr.IsDir() {\n\t\t// ENOTEMPTY\n\t\tif dstErr == nil || os.IsExist(dstErr) {\n\t\t\tempty := fuseFS.NextComponent().IsDirEmpty(internal.IsDirEmptyOptions{Name: dstPath})\n\t\t\tif !empty {\n\t\t\t\treturn -C.ENOTEMPTY\n\t\t\t}\n\t\t}\n\n\t\terr := fuseFS.NextComponent().RenameDir(internal.RenameDirOptions{Src: srcPath, Dst: dstPath})\n\t\tif err != nil {\n\t\t\tlog.Err(\"Libfuse::libfuse_rename : error renaming directory %s -> %s [%s]\", srcPath, dstPath, err.Error())\n\t\t\treturn -C.EIO\n\t\t}\n\n\t\tlibfuseStatsCollector.PushEvents(renameDir, srcPath, map[string]interface{}{source: srcPath, dest: dstPath})\n\t\tlibfuseStatsCollector.UpdateStats(stats_manager.Increment, renameDir, (int64)(1))\n\n\t} else {\n\t\terr := fuseFS.NextComponent().RenameFile(internal.RenameFileOptions{Src: srcPath, Dst: dstPath})\n\t\tif err != nil {\n\t\t\tlog.Err(\"Libfuse::libfuse_rename : error renaming file %s -> %s [%s]\", srcPath, dstPath, err.Error())\n\t\t\treturn -C.EIO\n\t\t}\n\n\t\tlibfuseStatsCollector.PushEvents(renameFile, srcPath, map[string]interface{}{source: srcPath, dest: dstPath})\n\t\tlibfuseStatsCollector.UpdateStats(stats_manager.Increment, renameFile, (int64)(1))\n\n\t}\n\n\treturn 0\n}", "title": "" }, { "docid": "1c70deb30fbdc8297b8d15ac87510de3", "score": "0.42762962", "text": "func useMappedValue() {\n\t// TODO: implement\n}", "title": "" }, { "docid": "fb09d80467a2e2eb1a35fb7243db3aed", "score": "0.42727822", "text": "func (self *UtilsDebug) CurrentAlpha() int{\n return self.Object.Get(\"currentAlpha\").Int()\n}", "title": "" }, { "docid": "320e737ed6fd84e5ada50199774a6a19", "score": "0.4271352", "text": "func Fail(_ interface{}) {}", "title": "" }, { "docid": "7b8bd1462cbdadaefc7f8b173c19b0cb", "score": "0.4269854", "text": "func main() {\n\nmystructvar := mystruct {\"helloo\" }\n\nmystructvar.mymethod()\t\t// <<<<< rename,17,13,17,13,main,fail\n\n\n}", "title": "" }, { "docid": "8cb10aa70857e2ca04254d840b60cdf9", "score": "0.42691153", "text": "func (*SousQueryGDM) Help() string { return sousQueryGDMHelp }", "title": "" }, { "docid": "a69d53c7d75e9a67cce50df240fb364a", "score": "0.42688504", "text": "func (*GroupOld) Descriptor() ([]byte, []int) {\n\treturn file_proto2_proto_test_proto_rawDescGZIP(), []int{24}\n}", "title": "" } ]
f54e48dd1cf026c53caa717e312a06ff
ProtoToWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum converts a WorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum enum from its proto representation.
[ { "docid": "c4bc2b8369f446b9e0c3befccd023b71", "score": "0.8664299", "text": "func ProtoToIamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum(e iampb.IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum) *iam.WorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := iampb.IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum_name[int32(e)]; ok {\n\t\te := iam.WorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum(n[len(\"IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "535f04225e499d290cdcc91d9c7a80ff", "score": "0.84322065", "text": "func IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnumToProto(e *iam.WorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum) iampb.IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum {\n\tif e == nil {\n\t\treturn iampb.IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum(0)\n\t}\n\tif v, ok := iampb.IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum_value[\"WorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum\"+string(*e)]; ok {\n\t\treturn iampb.IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum(v)\n\t}\n\treturn iampb.IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum(0)\n}", "title": "" }, { "docid": "82633fa51628a343c3102c85ff6b4072", "score": "0.6511148", "text": "func ProtoToIamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum(e iampb.IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum) *iam.WorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := iampb.IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum_name[int32(e)]; ok {\n\t\te := iam.WorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum(n[len(\"IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6e54f54df0b7c745d6385e662a41ac57", "score": "0.64826", "text": "func IamWorkforcePoolProviderOidcWebSsoConfigToProto(o *iam.WorkforcePoolProviderOidcWebSsoConfig) *iampb.IamWorkforcePoolProviderOidcWebSsoConfig {\n\tif o == nil {\n\t\treturn nil\n\t}\n\tp := &iampb.IamWorkforcePoolProviderOidcWebSsoConfig{}\n\tp.SetResponseType(IamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnumToProto(o.ResponseType))\n\tp.SetAssertionClaimsBehavior(IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnumToProto(o.AssertionClaimsBehavior))\n\tsAdditionalScopes := make([]string, len(o.AdditionalScopes))\n\tfor i, r := range o.AdditionalScopes {\n\t\tsAdditionalScopes[i] = r\n\t}\n\tp.SetAdditionalScopes(sAdditionalScopes)\n\treturn p\n}", "title": "" }, { "docid": "713e2e0861f16ce9605788d4dfaff1df", "score": "0.6368187", "text": "func IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnumToProto(e *iam.WorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum) iampb.IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum {\n\tif e == nil {\n\t\treturn iampb.IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum(0)\n\t}\n\tif v, ok := iampb.IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum_value[\"WorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum\"+string(*e)]; ok {\n\t\treturn iampb.IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum(v)\n\t}\n\treturn iampb.IamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum(0)\n}", "title": "" }, { "docid": "57ba8e6487486243fe82c874201f88f2", "score": "0.6363599", "text": "func ProtoToIamWorkforcePoolProviderOidcWebSsoConfig(p *iampb.IamWorkforcePoolProviderOidcWebSsoConfig) *iam.WorkforcePoolProviderOidcWebSsoConfig {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tobj := &iam.WorkforcePoolProviderOidcWebSsoConfig{\n\t\tResponseType: ProtoToIamWorkforcePoolProviderOidcWebSsoConfigResponseTypeEnum(p.GetResponseType()),\n\t\tAssertionClaimsBehavior: ProtoToIamWorkforcePoolProviderOidcWebSsoConfigAssertionClaimsBehaviorEnum(p.GetAssertionClaimsBehavior()),\n\t}\n\tfor _, r := range p.GetAdditionalScopes() {\n\t\tobj.AdditionalScopes = append(obj.AdditionalScopes, r)\n\t}\n\treturn obj\n}", "title": "" }, { "docid": "245a69ce319e85039d264946db4d924f", "score": "0.5805941", "text": "func IdentitytoolkitOAuthIdpConfigResponseTypeToProto(o *identitytoolkit.OAuthIdpConfigResponseType) *identitytoolkitpb.IdentitytoolkitOAuthIdpConfigResponseType {\n\tif o == nil {\n\t\treturn nil\n\t}\n\tp := &identitytoolkitpb.IdentitytoolkitOAuthIdpConfigResponseType{}\n\tp.SetIdToken(dcl.ValueOrEmptyBool(o.IdToken))\n\tp.SetCode(dcl.ValueOrEmptyBool(o.Code))\n\tp.SetToken(dcl.ValueOrEmptyBool(o.Token))\n\treturn p\n}", "title": "" }, { "docid": "7fcf041db95875c57c94aab53152ec9c", "score": "0.558894", "text": "func ProtoToIamWorkforcePoolProviderStateEnum(e iampb.IamWorkforcePoolProviderStateEnum) *iam.WorkforcePoolProviderStateEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := iampb.IamWorkforcePoolProviderStateEnum_name[int32(e)]; ok {\n\t\te := iam.WorkforcePoolProviderStateEnum(n[len(\"IamWorkforcePoolProviderStateEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d6889f6d59a05437220095a51344dd8f", "score": "0.54970366", "text": "func ProtoToIdentitytoolkitOAuthIdpConfigResponseType(p *identitytoolkitpb.IdentitytoolkitOAuthIdpConfigResponseType) *identitytoolkit.OAuthIdpConfigResponseType {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tobj := &identitytoolkit.OAuthIdpConfigResponseType{\n\t\tIdToken: dcl.Bool(p.GetIdToken()),\n\t\tCode: dcl.Bool(p.GetCode()),\n\t\tToken: dcl.Bool(p.GetToken()),\n\t}\n\treturn obj\n}", "title": "" }, { "docid": "80c2795317e5d49fa0ea6f0e58292a68", "score": "0.52645653", "text": "func IamWorkforcePoolProviderStateEnumToProto(e *iam.WorkforcePoolProviderStateEnum) iampb.IamWorkforcePoolProviderStateEnum {\n\tif e == nil {\n\t\treturn iampb.IamWorkforcePoolProviderStateEnum(0)\n\t}\n\tif v, ok := iampb.IamWorkforcePoolProviderStateEnum_value[\"WorkforcePoolProviderStateEnum\"+string(*e)]; ok {\n\t\treturn iampb.IamWorkforcePoolProviderStateEnum(v)\n\t}\n\treturn iampb.IamWorkforcePoolProviderStateEnum(0)\n}", "title": "" }, { "docid": "40ca6de03c50f6e7b6c98296b1394cf1", "score": "0.51666844", "text": "func OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnumToProto(e *beta.OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum) betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum {\n\tif e == nil {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum(0)\n\t}\n\tif v, ok := betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum_value[\"OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum\"+string(*e)]; ok {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum(v)\n\t}\n\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum(0)\n}", "title": "" }, { "docid": "e5088b11e6a5a8acc1453ef20c994752", "score": "0.5078871", "text": "func OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnumToProto(e *beta.OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum) betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum {\n\tif e == nil {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum(0)\n\t}\n\tif v, ok := betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum_value[\"OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum\"+string(*e)]; ok {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum(v)\n\t}\n\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum(0)\n}", "title": "" }, { "docid": "102daadc8a41184f1e47f2f755c3fcc6", "score": "0.49552304", "text": "func NetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnumToProto(e *beta.HttpRouteRulesActionRedirectResponseCodeEnum) betapb.NetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnum {\n\tif e == nil {\n\t\treturn betapb.NetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnum(0)\n\t}\n\tif v, ok := betapb.NetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnum_value[\"HttpRouteRulesActionRedirectResponseCodeEnum\"+string(*e)]; ok {\n\t\treturn betapb.NetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnum(v)\n\t}\n\treturn betapb.NetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnum(0)\n}", "title": "" }, { "docid": "59355ec366e8cebb2824eafecd7f2b00", "score": "0.48880857", "text": "func OsconfigBetaOSPolicyAssignmentOSPoliciesModeEnumToProto(e *beta.OSPolicyAssignmentOSPoliciesModeEnum) betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesModeEnum {\n\tif e == nil {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesModeEnum(0)\n\t}\n\tif v, ok := betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesModeEnum_value[\"OSPolicyAssignmentOSPoliciesModeEnum\"+string(*e)]; ok {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesModeEnum(v)\n\t}\n\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesModeEnum(0)\n}", "title": "" }, { "docid": "78776c0b7d5372a4ad02acc5719badff", "score": "0.4768755", "text": "func ProtoToIamWorkforcePoolProviderOidcClientSecretValue(p *iampb.IamWorkforcePoolProviderOidcClientSecretValue) *iam.WorkforcePoolProviderOidcClientSecretValue {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tobj := &iam.WorkforcePoolProviderOidcClientSecretValue{\n\t\tPlainText: dcl.StringOrNil(p.GetPlainText()),\n\t\tThumbprint: dcl.StringOrNil(p.GetThumbprint()),\n\t}\n\treturn obj\n}", "title": "" }, { "docid": "b42b177b74d9ceefede3a6208f5fb598", "score": "0.47532997", "text": "func ApigeeOrganizationSubscriptionTypeEnumToProto(e *apigee.OrganizationSubscriptionTypeEnum) apigeepb.ApigeeOrganizationSubscriptionTypeEnum {\n\tif e == nil {\n\t\treturn apigeepb.ApigeeOrganizationSubscriptionTypeEnum(0)\n\t}\n\tif v, ok := apigeepb.ApigeeOrganizationSubscriptionTypeEnum_value[\"OrganizationSubscriptionTypeEnum\"+string(*e)]; ok {\n\t\treturn apigeepb.ApigeeOrganizationSubscriptionTypeEnum(v)\n\t}\n\treturn apigeepb.ApigeeOrganizationSubscriptionTypeEnum(0)\n}", "title": "" }, { "docid": "b2b28242ebeb5bf6211a3f9166ec4797", "score": "0.47267196", "text": "func ProtoToTier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "955a5837022a67eaad041a67677ec833", "score": "0.47126734", "text": "func ProtoToNetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnum(e betapb.NetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnum) *beta.HttpRouteRulesActionRedirectResponseCodeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := betapb.NetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnum_name[int32(e)]; ok {\n\t\te := beta.HttpRouteRulesActionRedirectResponseCodeEnum(n[len(\"NetworkservicesBetaHttpRouteRulesActionRedirectResponseCodeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "39b38c73753af86195131b1f881fac91", "score": "0.47021282", "text": "func OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptArchiveTypeEnumToProto(e *beta.OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptArchiveTypeEnum) betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptArchiveTypeEnum {\n\tif e == nil {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptArchiveTypeEnum(0)\n\t}\n\tif v, ok := betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptArchiveTypeEnum_value[\"OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptArchiveTypeEnum\"+string(*e)]; ok {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptArchiveTypeEnum(v)\n\t}\n\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptArchiveTypeEnum(0)\n}", "title": "" }, { "docid": "42303da612ddb28dd17e16e92a1b7eb4", "score": "0.46888262", "text": "func Tier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "4770d3a231c23c907411e921b6cadb77", "score": "0.4679435", "text": "func Tier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "8c4ff71aa4f028be243befa4ec65c74b", "score": "0.46759585", "text": "func Tier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "c709bceec3614a8817867b6e0eb2ea36", "score": "0.465993", "text": "func Tier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "b290c1a66b311c44b8e412d0e11bcf29", "score": "0.46540838", "text": "func ProtoToApigeeOrganizationSubscriptionTypeEnum(e apigeepb.ApigeeOrganizationSubscriptionTypeEnum) *apigee.OrganizationSubscriptionTypeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := apigeepb.ApigeeOrganizationSubscriptionTypeEnum_name[int32(e)]; ok {\n\t\te := apigee.OrganizationSubscriptionTypeEnum(n[len(\"ApigeeOrganizationSubscriptionTypeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96aea8e23d1306f6cb3cb9a9adb2b8a4", "score": "0.46529937", "text": "func Tier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "600ebac61c8ff76278996efca8e3f601", "score": "0.46516562", "text": "func Tier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "1e32f23d887e8bad26b800c532da906f", "score": "0.4645775", "text": "func JobTriggerInspectJobActionsSaveFindingsOutputConfigOutputSchemaEnumRef(s string) *JobTriggerInspectJobActionsSaveFindingsOutputConfigOutputSchemaEnum {\n\tv := JobTriggerInspectJobActionsSaveFindingsOutputConfigOutputSchemaEnum(s)\n\treturn &v\n}", "title": "" }, { "docid": "cf941e8b8ed3be13f65b9bbdadcd841b", "score": "0.46348563", "text": "func Tier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "4883871f2e6ee05aac575f64983d79d2", "score": "0.4632513", "text": "func OsconfigBetaOSPolicyAssignmentRolloutStateEnumToProto(e *beta.OSPolicyAssignmentRolloutStateEnum) betapb.OsconfigBetaOSPolicyAssignmentRolloutStateEnum {\n\tif e == nil {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentRolloutStateEnum(0)\n\t}\n\tif v, ok := betapb.OsconfigBetaOSPolicyAssignmentRolloutStateEnum_value[\"OSPolicyAssignmentRolloutStateEnum\"+string(*e)]; ok {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentRolloutStateEnum(v)\n\t}\n\treturn betapb.OsconfigBetaOSPolicyAssignmentRolloutStateEnum(0)\n}", "title": "" }, { "docid": "f1ef4d3f41646c36763d213e67cf4281", "score": "0.46239817", "text": "func ProtoToTier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7f4481f4d35d887f2adf890df13c9e33", "score": "0.46129256", "text": "func Tier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessGetRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "308ae7020d67128c5164932d721b1d2d", "score": "0.46108443", "text": "func ProtoToTier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d6ce2b9151b78afecb9b49ca525ce16c", "score": "0.4608891", "text": "func ProtoToTier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessCreateRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a5d06648a1db27cd6b7c12a13ce3deb1", "score": "0.4604178", "text": "func ProtoToTier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessResetRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6610b1b88cc46e28472e229b7e99a73b", "score": "0.46001354", "text": "func Tier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "af395a2120bce4e9982f6c9523767cc8", "score": "0.4590497", "text": "func ProtoToTier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "965bbe242d51a2d39bd1b72d565c279e", "score": "0.45830888", "text": "func Tier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "cb026821e05f6f55809ff514fc9a5335", "score": "0.45652646", "text": "func Tier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "f8e654f3351cd8ef903bd06d6c917f4e", "score": "0.4562548", "text": "func ProtoToTier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessRepairRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "216f5be950e38744abe854acd3fd9466", "score": "0.45600605", "text": "func Tier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "0580cc7560f6afb7501a1c9db4b1e398", "score": "0.4558633", "text": "func ProtoToOsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum(e betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum) *beta.OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum_name[int32(e)]; ok {\n\t\te := beta.OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum(n[len(\"OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceInterpreterEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2e1e142f15a1126dbc515ddade23b235", "score": "0.45502287", "text": "func ProtoToOsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum(e betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum) *beta.OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum_name[int32(e)]; ok {\n\t\te := beta.OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum(n[len(\"OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateInterpreterEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3ad9bc8cb546e9e4ba765e2937ce4e28", "score": "0.45496994", "text": "func Tier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "472d73f4035e4240f5f1054cfc47c672", "score": "0.454429", "text": "func ProtoToTier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceReportInstanceHealthRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "388be4819b823cf6cb8c26121f88961e", "score": "0.4518074", "text": "func ProtoToTier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "05e01b8a97b35a2bfbb226ced4815765", "score": "0.45148432", "text": "func Tier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "6b50055d80a5522d88da752acbafa4bd", "score": "0.45108578", "text": "func ProtoToIamWorkforcePoolProviderOidc(p *iampb.IamWorkforcePoolProviderOidc) *iam.WorkforcePoolProviderOidc {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tobj := &iam.WorkforcePoolProviderOidc{\n\t\tIssuerUri: dcl.StringOrNil(p.GetIssuerUri()),\n\t\tClientId: dcl.StringOrNil(p.GetClientId()),\n\t\tJwksJson: dcl.StringOrNil(p.GetJwksJson()),\n\t\tWebSsoConfig: ProtoToIamWorkforcePoolProviderOidcWebSsoConfig(p.GetWebSsoConfig()),\n\t\tClientSecret: ProtoToIamWorkforcePoolProviderOidcClientSecret(p.GetClientSecret()),\n\t}\n\treturn obj\n}", "title": "" }, { "docid": "84e852a2120429196929d674de06a548", "score": "0.45086914", "text": "func ProtoToFileBetaInstanceFileSharesNfsExportOptionsSquashModeEnum(e betapb.FileBetaInstanceFileSharesNfsExportOptionsSquashModeEnum) *beta.InstanceFileSharesNfsExportOptionsSquashModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := betapb.FileBetaInstanceFileSharesNfsExportOptionsSquashModeEnum_name[int32(e)]; ok {\n\t\te := beta.InstanceFileSharesNfsExportOptionsSquashModeEnum(n[len(\"FileBetaInstanceFileSharesNfsExportOptionsSquashModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c144e7e227c63c7719eb2aa7d08a0e38", "score": "0.44961372", "text": "func ProtoToTier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6d7e5ad6094bce4f1a07a9a7378a4846", "score": "0.4493535", "text": "func ProtoToTier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "86eaae2337c02aef77719d812fe3a05f", "score": "0.4469511", "text": "func Tier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "7cb2a2a42f0f540d4e30846fb5c954ed", "score": "0.44650954", "text": "func ProtoToTier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f50602faf79c8bb2d04cbd26b3abe952", "score": "0.446075", "text": "func Tier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "a81be37256d75651f1a13685c1764ebf", "score": "0.44443625", "text": "func FileBetaInstanceFileSharesNfsExportOptionsSquashModeEnumToProto(e *beta.InstanceFileSharesNfsExportOptionsSquashModeEnum) betapb.FileBetaInstanceFileSharesNfsExportOptionsSquashModeEnum {\n\tif e == nil {\n\t\treturn betapb.FileBetaInstanceFileSharesNfsExportOptionsSquashModeEnum(0)\n\t}\n\tif v, ok := betapb.FileBetaInstanceFileSharesNfsExportOptionsSquashModeEnum_value[\"InstanceFileSharesNfsExportOptionsSquashModeEnum\"+string(*e)]; ok {\n\t\treturn betapb.FileBetaInstanceFileSharesNfsExportOptionsSquashModeEnum(v)\n\t}\n\treturn betapb.FileBetaInstanceFileSharesNfsExportOptionsSquashModeEnum(0)\n}", "title": "" }, { "docid": "985377070852dc5297e6f8d3db94b5b1", "score": "0.44341317", "text": "func Tier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceNotifyKeyUnavailableRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "a9ce73afce12e014e5434cf6b925823a", "score": "0.4431337", "text": "func OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileStateEnumToProto(e *beta.OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileStateEnum) betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileStateEnum {\n\tif e == nil {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileStateEnum(0)\n\t}\n\tif v, ok := betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileStateEnum_value[\"OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileStateEnum\"+string(*e)]; ok {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileStateEnum(v)\n\t}\n\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileStateEnum(0)\n}", "title": "" }, { "docid": "e24f1ca60f074f979793bd8f87c63a2b", "score": "0.4423265", "text": "func Tier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "b57713e196e63e5ad160cab4c163ac26", "score": "0.4416917", "text": "func ProtoToTier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceRepairRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f4e67a6d5e426afbf91838163f3791ae", "score": "0.4407772", "text": "func ProtoToOsconfigBetaOSPolicyAssignmentOSPoliciesModeEnum(e betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesModeEnum) *beta.OSPolicyAssignmentOSPoliciesModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesModeEnum_name[int32(e)]; ok {\n\t\te := beta.OSPolicyAssignmentOSPoliciesModeEnum(n[len(\"OsconfigBetaOSPolicyAssignmentOSPoliciesModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "233e05261b11a3efd8f9b0029359e7b8", "score": "0.44015646", "text": "func IamWorkforcePoolProviderOidcClientSecretValueToProto(o *iam.WorkforcePoolProviderOidcClientSecretValue) *iampb.IamWorkforcePoolProviderOidcClientSecretValue {\n\tif o == nil {\n\t\treturn nil\n\t}\n\tp := &iampb.IamWorkforcePoolProviderOidcClientSecretValue{}\n\tp.SetPlainText(dcl.ValueOrEmptyString(o.PlainText))\n\tp.SetThumbprint(dcl.ValueOrEmptyString(o.Thumbprint))\n\treturn p\n}", "title": "" }, { "docid": "cb5fec4dbd9dd68be2c24290ba44e9bc", "score": "0.43983257", "text": "func ProtoToTier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceResetRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "de8e8a6d849c140c5007a808c39d8298", "score": "0.4390287", "text": "func ProtoToMonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(e alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum) *alpha.DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(n[len(\"MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d28177d79d499474aaf258b6ae604abe", "score": "0.43862948", "text": "func ProtoToMonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(e alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum) *alpha.DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(n[len(\"MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "61e78672d836620090d4b26730256a58", "score": "0.43852213", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum) *alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "85efe9608c367b2a9890bd1a3ac980d9", "score": "0.4381504", "text": "func ProtoToTier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceUpdateRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24a701f27cb7e05f92a1aa7e1d35c255", "score": "0.4379105", "text": "func ProtoToTier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceReconcileRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "19e807e7c98096f88a0fce4ef71a8305", "score": "0.43746153", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum) *alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7631e33fb3370d4e633976111c272a50", "score": "0.4372379", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum) *alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4fafc4bdae882c1bf5390d71c39d0538", "score": "0.43640935", "text": "func Tier2AlphaInstanceReadonlyRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceReadonlyRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceReadonlyRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceReadonlyRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceReadonlyRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceReadonlyRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceReadonlyRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceReadonlyRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "6f117821e81d94ff8b0c4df9fdd268c1", "score": "0.43627885", "text": "func ProtoToMonitoringAlphaDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(e alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum) *alpha.DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(n[len(\"MonitoringAlphaDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5898d47aecefdf4d8e26f424379ae6cf", "score": "0.4362606", "text": "func Tier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "68e7b3556771bef48521d825cd2145a5", "score": "0.43592465", "text": "func ProtoToMonitoringAlphaDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(e alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum) *alpha.DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(n[len(\"MonitoringAlphaDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ac882fe1f9c40fa967063db12ab2ae27", "score": "0.43553647", "text": "func ProtoToTier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceCreateRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4b075e1b4002fdf2d9ee983810727b3c", "score": "0.43471563", "text": "func Tier2AlphaInstanceDeleteRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceDeleteRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "7782fd13ec86e7b45b143d16fc465a61", "score": "0.43420148", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum) *alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9dcdaa499c0931a3177be1a9ce2d157d", "score": "0.43173075", "text": "func OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDesiredStateEnumToProto(e *beta.OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDesiredStateEnum) betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDesiredStateEnum {\n\tif e == nil {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDesiredStateEnum(0)\n\t}\n\tif v, ok := betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDesiredStateEnum_value[\"OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDesiredStateEnum\"+string(*e)]; ok {\n\t\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDesiredStateEnum(v)\n\t}\n\treturn betapb.OsconfigBetaOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDesiredStateEnum(0)\n}", "title": "" }, { "docid": "1591dee745940eb32cb494c4e5eda387", "score": "0.43164945", "text": "func ComputeNetworkFirewallPolicyRuleMatchSrcSecureTagsStateEnumToProto(e *compute.NetworkFirewallPolicyRuleMatchSrcSecureTagsStateEnum) computepb.ComputeNetworkFirewallPolicyRuleMatchSrcSecureTagsStateEnum {\n\tif e == nil {\n\t\treturn computepb.ComputeNetworkFirewallPolicyRuleMatchSrcSecureTagsStateEnum(0)\n\t}\n\tif v, ok := computepb.ComputeNetworkFirewallPolicyRuleMatchSrcSecureTagsStateEnum_value[\"NetworkFirewallPolicyRuleMatchSrcSecureTagsStateEnum\"+string(*e)]; ok {\n\t\treturn computepb.ComputeNetworkFirewallPolicyRuleMatchSrcSecureTagsStateEnum(v)\n\t}\n\treturn computepb.ComputeNetworkFirewallPolicyRuleMatchSrcSecureTagsStateEnum(0)\n}", "title": "" }, { "docid": "61df0d78c9f3a11d207b2d71608986ba", "score": "0.42922172", "text": "func MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumToProto(e *alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum) alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\tif e == nil {\n\t\treturn alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(0)\n\t}\n\tif v, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum_value[\"DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum\"+string(*e)]; ok {\n\t\treturn alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(v)\n\t}\n\treturn alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(0)\n}", "title": "" }, { "docid": "525977d63e8bed87001ef8efaf573781", "score": "0.4292149", "text": "func ProtoToTier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8c71f7030a921c8602249ba84ed3ebc2", "score": "0.429035", "text": "func ApigeeOrganizationRuntimeTypeEnumToProto(e *apigee.OrganizationRuntimeTypeEnum) apigeepb.ApigeeOrganizationRuntimeTypeEnum {\n\tif e == nil {\n\t\treturn apigeepb.ApigeeOrganizationRuntimeTypeEnum(0)\n\t}\n\tif v, ok := apigeepb.ApigeeOrganizationRuntimeTypeEnum_value[\"OrganizationRuntimeTypeEnum\"+string(*e)]; ok {\n\t\treturn apigeepb.ApigeeOrganizationRuntimeTypeEnum(v)\n\t}\n\treturn apigeepb.ApigeeOrganizationRuntimeTypeEnum(0)\n}", "title": "" }, { "docid": "64a5813c1ff51f29719a5c7199d748d8", "score": "0.4286239", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum) *alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8e63d6143b0ee7da8cb3ce28300bcc4e", "score": "0.4279312", "text": "func GetWorkRequestOperationTypeEnumValues() []WorkRequestOperationTypeEnum {\n\tvalues := make([]WorkRequestOperationTypeEnum, 0)\n\tfor _, v := range mappingWorkRequestOperationTypeEnum {\n\t\tvalues = append(values, v)\n\t}\n\treturn values\n}", "title": "" }, { "docid": "a1871c00d45e10126c57a61c2015fd50", "score": "0.42679018", "text": "func ProtoToTier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceUnfreezeRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c91cda1f61c47ee5bb176ed319462f75", "score": "0.42651537", "text": "func Tier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstanceNotifyKeyAvailableRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "4fa96e52c16c7631551924fc896917a9", "score": "0.4259129", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum) *alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "585c334e3411aa2ac482f0b9f73dd370", "score": "0.42579484", "text": "func ProtoToOsconfigBetaOSPolicyAssignmentRolloutStateEnum(e betapb.OsconfigBetaOSPolicyAssignmentRolloutStateEnum) *beta.OSPolicyAssignmentRolloutStateEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := betapb.OsconfigBetaOSPolicyAssignmentRolloutStateEnum_name[int32(e)]; ok {\n\t\te := beta.OSPolicyAssignmentRolloutStateEnum(n[len(\"OsconfigBetaOSPolicyAssignmentRolloutStateEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "73f4d4fc57e64c3b16a9e218ec443969", "score": "0.42503747", "text": "func ProtoToTier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstanceFreezeRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dd015645d474d93afda13cf2e6c42784", "score": "0.42495513", "text": "func ComputeImageGuestOSFeatureTypeEnumToProto(e *compute.ImageGuestOSFeatureTypeEnum) computepb.ComputeImageGuestOSFeatureTypeEnum {\n\tif e == nil {\n\t\treturn computepb.ComputeImageGuestOSFeatureTypeEnum(0)\n\t}\n\tif v, ok := computepb.ComputeImageGuestOSFeatureTypeEnum_value[\"ImageGuestOSFeatureTypeEnum\"+string(*e)]; ok {\n\t\treturn computepb.ComputeImageGuestOSFeatureTypeEnum(v)\n\t}\n\treturn computepb.ComputeImageGuestOSFeatureTypeEnum(0)\n}", "title": "" }, { "docid": "1b63e0d97e59d98320070995f55b8f44", "score": "0.4245261", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum) *alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6e3863e39f5ee5db3687e03e28523f22", "score": "0.42440003", "text": "func ProtoToTier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum(e alphapb.Tier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum) *alpha.InstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.Tier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum_name[int32(e)]; ok {\n\t\te := alpha.InstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum(n[len(\"Tier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "22f6b175f0a5902fc994212eefcd85a5", "score": "0.4243114", "text": "func Tier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnumToProto(e *alpha.InstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum) alphapb.Tier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum {\n\tif e == nil {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n\t}\n\tif v, ok := alphapb.Tier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum_value[\"InstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum\"+string(*e)]; ok {\n\t\treturn alphapb.Tier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum(v)\n\t}\n\treturn alphapb.Tier2AlphaInstancePreprocessPassthroughRecipeStepsPermissionsInfoPolicyNameModeEnum(0)\n}", "title": "" }, { "docid": "7fef249262135fd4b6ca7241b0e821db", "score": "0.42361727", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum) *alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "548d069de627cd09705c3bd5e9729728", "score": "0.422809", "text": "func MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumToProto(e *alpha.DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum) alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\tif e == nil {\n\t\treturn alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(0)\n\t}\n\tif v, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum_value[\"DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum\"+string(*e)]; ok {\n\t\treturn alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(v)\n\t}\n\treturn alphapb.MonitoringAlphaDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(0)\n}", "title": "" }, { "docid": "d1b06cc98d038195fdf3624d8cf978c9", "score": "0.42246303", "text": "func IamWorkforcePoolProviderOidcToProto(o *iam.WorkforcePoolProviderOidc) *iampb.IamWorkforcePoolProviderOidc {\n\tif o == nil {\n\t\treturn nil\n\t}\n\tp := &iampb.IamWorkforcePoolProviderOidc{}\n\tp.SetIssuerUri(dcl.ValueOrEmptyString(o.IssuerUri))\n\tp.SetClientId(dcl.ValueOrEmptyString(o.ClientId))\n\tp.SetJwksJson(dcl.ValueOrEmptyString(o.JwksJson))\n\tp.SetWebSsoConfig(IamWorkforcePoolProviderOidcWebSsoConfigToProto(o.WebSsoConfig))\n\tp.SetClientSecret(IamWorkforcePoolProviderOidcClientSecretToProto(o.ClientSecret))\n\treturn p\n}", "title": "" }, { "docid": "70df615f49fc1f069c227354a699d695", "score": "0.42109674", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum) *alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a1fa3f658fc33faa0fb17e1e35c76cc1", "score": "0.42071632", "text": "func MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumToProto(e *alpha.DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum) alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\tif e == nil {\n\t\treturn alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(0)\n\t}\n\tif v, ok := alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum_value[\"DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum\"+string(*e)]; ok {\n\t\treturn alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(v)\n\t}\n\treturn alphapb.MonitoringAlphaDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(0)\n}", "title": "" }, { "docid": "ac580c27af62f108da4f7802b17cffcd", "score": "0.4204101", "text": "func ProtoToApigeeOrganizationRuntimeTypeEnum(e apigeepb.ApigeeOrganizationRuntimeTypeEnum) *apigee.OrganizationRuntimeTypeEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := apigeepb.ApigeeOrganizationRuntimeTypeEnum_name[int32(e)]; ok {\n\t\te := apigee.OrganizationRuntimeTypeEnum(n[len(\"ApigeeOrganizationRuntimeTypeEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "67014c157ce93974653dffb3f093c794", "score": "0.41979718", "text": "func MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumToProto(e *alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum) alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\tif e == nil {\n\t\treturn alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(0)\n\t}\n\tif v, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum_value[\"DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum\"+string(*e)]; ok {\n\t\treturn alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(v)\n\t}\n\treturn alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(0)\n}", "title": "" }, { "docid": "67888c05eeee31e273273ee1ab3e4afa", "score": "0.41954544", "text": "func ProtoToIamWorkforcePoolProviderOidcClientSecret(p *iampb.IamWorkforcePoolProviderOidcClientSecret) *iam.WorkforcePoolProviderOidcClientSecret {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tobj := &iam.WorkforcePoolProviderOidcClientSecret{\n\t\tValue: ProtoToIamWorkforcePoolProviderOidcClientSecretValue(p.GetValue()),\n\t}\n\treturn obj\n}", "title": "" }, { "docid": "4568678b264778835788b9b2c0320fb4", "score": "0.41952747", "text": "func ApigeeOrganizationStateEnumToProto(e *apigee.OrganizationStateEnum) apigeepb.ApigeeOrganizationStateEnum {\n\tif e == nil {\n\t\treturn apigeepb.ApigeeOrganizationStateEnum(0)\n\t}\n\tif v, ok := apigeepb.ApigeeOrganizationStateEnum_value[\"OrganizationStateEnum\"+string(*e)]; ok {\n\t\treturn apigeepb.ApigeeOrganizationStateEnum(v)\n\t}\n\treturn apigeepb.ApigeeOrganizationStateEnum(0)\n}", "title": "" }, { "docid": "fb8a877f37edd4117551a5a7163c0e60", "score": "0.41938648", "text": "func ProtoToMonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum(e alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum) *alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum {\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif n, ok := alphapb.MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum_name[int32(e)]; ok {\n\t\te := alpha.DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum(n[len(\"MonitoringAlphaDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum\"):])\n\t\treturn &e\n\t}\n\treturn nil\n}", "title": "" } ]
6b05745d85482d57952a588f4612c1ce
AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. Check the length with: len(mockedRoleInterface.AddClusterScopedFeatureHandlerCalls())
[ { "docid": "28fef0cdfa447bb2550cef4a93e02c45", "score": "0.85447145", "text": "func (mock *RoleInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v11.RoleHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v11.RoleHandlerFunc\n\t}\n\tlockRoleInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockRoleInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" } ]
[ { "docid": "b7984c64fe9b0fdb3239187aa557aa0b", "score": "0.847096", "text": "func (mock *RoleControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v11.RoleHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v11.RoleHandlerFunc\n\t}\n\tlockRoleControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockRoleControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "3903f3189495c0774c6065057f3cc683", "score": "0.84073406", "text": "func (mock *UserInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v31.UserHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.UserHandlerFunc\n\t}\n\tlockUserInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockUserInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "4a8155a601e99ac7bf096d19f11e0500", "score": "0.8398226", "text": "func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v3.CisBenchmarkVersionHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v3.CisBenchmarkVersionHandlerFunc\n\t}\n\tlockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "7785bf7bc226cd8a39b61f51c75ce8bb", "score": "0.8376372", "text": "func (mock *RoleTemplateInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v31.RoleTemplateHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.RoleTemplateHandlerFunc\n\t}\n\tlockRoleTemplateInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockRoleTemplateInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "1f07f640afd6361bc1cd8bb826f7a7cf", "score": "0.8368177", "text": "func (mock *UserControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v31.UserHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.UserHandlerFunc\n\t}\n\tlockUserControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockUserControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "a0e4e0ab77e0ce447fc9ae23a9b1e042", "score": "0.83615255", "text": "func (mock *SecretInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v11.SecretHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v11.SecretHandlerFunc\n\t}\n\tlockSecretInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockSecretInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "0a23d2092fec7e00b760c8c40c4a1662", "score": "0.83608335", "text": "func (mock *CisBenchmarkVersionControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v3.CisBenchmarkVersionHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v3.CisBenchmarkVersionHandlerFunc\n\t}\n\tlockCisBenchmarkVersionControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockCisBenchmarkVersionControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "e4503214216a72f74ffe595bd8557f77", "score": "0.83449984", "text": "func (mock *HarborTagInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v3.HarborTagHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v3.HarborTagHandlerFunc\n\t}\n\tlockHarborTagInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockHarborTagInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "497c77eb5ec5df183507f1254f49829a", "score": "0.83358973", "text": "func (mock *TokenInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v31.TokenHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.TokenHandlerFunc\n\t}\n\tlockTokenInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockTokenInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "3b2c454c103a98e3a30d65479a40c60c", "score": "0.83131766", "text": "func (mock *RancherUserNotificationInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v31.RancherUserNotificationHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.RancherUserNotificationHandlerFunc\n\t}\n\tlockRancherUserNotificationInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockRancherUserNotificationInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "1ae9bfd52adccf80aa362f2c16095757", "score": "0.83120984", "text": "func (mock *RoleTemplateControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v31.RoleTemplateHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.RoleTemplateHandlerFunc\n\t}\n\tlockRoleTemplateControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockRoleTemplateControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "3978d00fbfb02154d3bcce5e37f0388f", "score": "0.83036697", "text": "func (mock *SecretControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v11.SecretHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v11.SecretHandlerFunc\n\t}\n\tlockSecretControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockSecretControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "00c8d4df85a9ee27403650a61da41ffd", "score": "0.83002055", "text": "func (mock *HarborTagControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v3.HarborTagHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v3.HarborTagHandlerFunc\n\t}\n\tlockHarborTagControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockHarborTagControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "ecacd3d4a333565a6fa77364b97512ac", "score": "0.82972175", "text": "func (mock *RancherUserNotificationControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v31.RancherUserNotificationHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.RancherUserNotificationHandlerFunc\n\t}\n\tlockRancherUserNotificationControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockRancherUserNotificationControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "03a2f2a2f4bb02c2a875c015a3823fa3", "score": "0.8279508", "text": "func (mock *EventInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v11.EventHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v11.EventHandlerFunc\n\t}\n\tlockEventInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockEventInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "de848afcf3c9def14734fb314aab5ead", "score": "0.8272156", "text": "func (mock *ProjectCatalogInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v31.ProjectCatalogHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.ProjectCatalogHandlerFunc\n\t}\n\tlockProjectCatalogInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockProjectCatalogInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "8fab1aee239d19369bfb685427dc6c7a", "score": "0.8264839", "text": "func (mock *TokenControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v31.TokenHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.TokenHandlerFunc\n\t}\n\tlockTokenControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockTokenControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "81caf3f5137542494820aeff1202d2a1", "score": "0.8251125", "text": "func (mock *ProjectNetworkPolicyInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v31.ProjectNetworkPolicyHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.ProjectNetworkPolicyHandlerFunc\n\t}\n\tlockProjectNetworkPolicyInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockProjectNetworkPolicyInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "1c2495ed85185a349c04a998c986c7b7", "score": "0.8245649", "text": "func (mock *ProjectCatalogControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v31.ProjectCatalogHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.ProjectCatalogHandlerFunc\n\t}\n\tlockProjectCatalogControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockProjectCatalogControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "4632136699c7e7d138c3bee32dba8eed", "score": "0.82451695", "text": "func (mock *EventControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v11.EventHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v11.EventHandlerFunc\n\t}\n\tlockEventControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockEventControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "803dd769da19d59c3127fceb814d064d", "score": "0.82123125", "text": "func (mock *ProjectNetworkPolicyControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v31.ProjectNetworkPolicyHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.ProjectNetworkPolicyHandlerFunc\n\t}\n\tlockProjectNetworkPolicyControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockProjectNetworkPolicyControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "64f639153a3d10535c67c1ea1dc79632", "score": "0.81486475", "text": "func (mock *DynamicSchemaInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v31.DynamicSchemaHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.DynamicSchemaHandlerFunc\n\t}\n\tlockDynamicSchemaInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockDynamicSchemaInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "401fcfcffbc95d204a2900b734f33c30", "score": "0.81316054", "text": "func (mock *GlobalDnsInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v31.GlobalDnsHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.GlobalDnsHandlerFunc\n\t}\n\tlockGlobalDnsInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockGlobalDnsInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "c6d09e789903c553160f3465ea909093", "score": "0.810122", "text": "func (mock *DynamicSchemaControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v31.DynamicSchemaHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.DynamicSchemaHandlerFunc\n\t}\n\tlockDynamicSchemaControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockDynamicSchemaControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "57b9b96d5fa61389a513e43de00f972c", "score": "0.8080887", "text": "func (mock *PrometheusInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v11.PrometheusHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v11.PrometheusHandlerFunc\n\t}\n\tlockPrometheusInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockPrometheusInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "6d9d50e4ab8e6d39609fa37fe4338a06", "score": "0.80702406", "text": "func (mock *GlobalDnsControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v31.GlobalDnsHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.GlobalDnsHandlerFunc\n\t}\n\tlockGlobalDnsControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockGlobalDnsControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "cab1a38d5249476879c5ad07a94fd804", "score": "0.8050859", "text": "func (mock *ClusterAlertGroupInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tSync v31.ClusterAlertGroupHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.ClusterAlertGroupHandlerFunc\n\t}\n\tlockClusterAlertGroupInterfaceMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockClusterAlertGroupInterfaceMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "9e5bbe4640ed2bc3c9c871320ee41fe7", "score": "0.80332065", "text": "func (mock *ClusterAlertGroupControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v31.ClusterAlertGroupHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.ClusterAlertGroupHandlerFunc\n\t}\n\tlockClusterAlertGroupControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockClusterAlertGroupControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "cd0045ce058265cf7584cd4d6164fe96", "score": "0.8023026", "text": "func (mock *PrometheusControllerMock) AddClusterScopedFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tHandler v11.PrometheusHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tHandler v11.PrometheusHandlerFunc\n\t}\n\tlockPrometheusControllerMockAddClusterScopedFeatureHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureHandler\n\tlockPrometheusControllerMockAddClusterScopedFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "8a50f134fdaa15b9e2423e9fe3815797", "score": "0.7888938", "text": "func (mock *RoleInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v11.RoleHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v11.RoleHandlerFunc\n\t}\n\tlockRoleInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockRoleInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "29aae10d5a49d02852f36a03a467d65f", "score": "0.776416", "text": "func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v3.CisBenchmarkVersionHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v3.CisBenchmarkVersionHandlerFunc\n\t}\n\tlockCisBenchmarkVersionInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockCisBenchmarkVersionInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "bb4d43946a9ffbaf76fc920bf0aff1eb", "score": "0.77463627", "text": "func (mock *UserInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v31.UserHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.UserHandlerFunc\n\t}\n\tlockUserInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockUserInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "bb64e3ab04d7a0a514697a3ee0216a8f", "score": "0.7743912", "text": "func (mock *RoleControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v11.RoleHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v11.RoleHandlerFunc\n\t}\n\tlockRoleControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockRoleControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "3e48dbc5ce3c79d8f6d1a49e7483ae24", "score": "0.7720249", "text": "func (mock *TokenInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v31.TokenHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.TokenHandlerFunc\n\t}\n\tlockTokenInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockTokenInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "f718fc1ac136eca6e306a41e019dbf67", "score": "0.7697072", "text": "func (mock *CisBenchmarkVersionControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v3.CisBenchmarkVersionHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v3.CisBenchmarkVersionHandlerFunc\n\t}\n\tlockCisBenchmarkVersionControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockCisBenchmarkVersionControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "f020c459958d70db179d535da166dd8f", "score": "0.766942", "text": "func (mock *RoleTemplateInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v31.RoleTemplateHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.RoleTemplateHandlerFunc\n\t}\n\tlockRoleTemplateInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockRoleTemplateInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "dfb0e330db6d02e8eab3eb8027ead0a5", "score": "0.7612614", "text": "func (mock *HarborTagInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v3.HarborTagHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v3.HarborTagHandlerFunc\n\t}\n\tlockHarborTagInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockHarborTagInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "250f7cb9244ec67a7346a32fd16e8504", "score": "0.75939286", "text": "func (mock *SecretInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v11.SecretHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v11.SecretHandlerFunc\n\t}\n\tlockSecretInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockSecretInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "ed17e824266e193566b919c14a321b10", "score": "0.7592721", "text": "func (mock *TokenControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v31.TokenHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.TokenHandlerFunc\n\t}\n\tlockTokenControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockTokenControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "48d2948e8a0509b87fa29e9824767d17", "score": "0.75668186", "text": "func (mock *UserControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v31.UserHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.UserHandlerFunc\n\t}\n\tlockUserControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockUserControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "f78c6c81ee74e251e0277546ec452c55", "score": "0.75526214", "text": "func (mock *RoleTemplateControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v31.RoleTemplateHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.RoleTemplateHandlerFunc\n\t}\n\tlockRoleTemplateControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockRoleTemplateControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "a7a31ffd3a750f2a59c762be55ce1ab1", "score": "0.75498563", "text": "func (mock *ProjectCatalogInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v31.ProjectCatalogHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.ProjectCatalogHandlerFunc\n\t}\n\tlockProjectCatalogInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockProjectCatalogInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "b6bd39c6a07d96cd974d46f97739281b", "score": "0.7540201", "text": "func (mock *RancherUserNotificationInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v31.RancherUserNotificationHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.RancherUserNotificationHandlerFunc\n\t}\n\tlockRancherUserNotificationInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockRancherUserNotificationInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "535b99cef9c14006db648ab145c24a7e", "score": "0.75386465", "text": "func (mock *HarborTagControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v3.HarborTagHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v3.HarborTagHandlerFunc\n\t}\n\tlockHarborTagControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockHarborTagControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "61e3f040d44055d4e9841a96c19cb905", "score": "0.7535161", "text": "func (mock *RoleInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v11.RoleLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v11.RoleLifecycle\n\t}\n\tlockRoleInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockRoleInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "8a6dbb89f29a2a8348d6ee668524f85f", "score": "0.7532705", "text": "func (mock *HarborTagInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v3.HarborTagLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v3.HarborTagLifecycle\n\t}\n\tlockHarborTagInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockHarborTagInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "93b63ddc6cb6e18d65cc45e7c695d966", "score": "0.75210315", "text": "func (mock *RancherUserNotificationControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v31.RancherUserNotificationHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.RancherUserNotificationHandlerFunc\n\t}\n\tlockRancherUserNotificationControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockRancherUserNotificationControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "8520eb51a3f7857675f4dd1e9edb1c10", "score": "0.7511765", "text": "func (mock *RoleTemplateInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v31.RoleTemplateLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v31.RoleTemplateLifecycle\n\t}\n\tlockRoleTemplateInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockRoleTemplateInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "8fa0e320891edda3a883a7cbff921fa9", "score": "0.7511168", "text": "func (mock *EventInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v11.EventHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v11.EventHandlerFunc\n\t}\n\tlockEventInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockEventInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "51628c07be4ad1bbebcb94915afead59", "score": "0.7502462", "text": "func (mock *SecretInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v11.SecretLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v11.SecretLifecycle\n\t}\n\tlockSecretInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockSecretInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "562694102dcbec4964fdb54c311a85f6", "score": "0.7501399", "text": "func (mock *SecretControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v11.SecretHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v11.SecretHandlerFunc\n\t}\n\tlockSecretControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockSecretControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "01e1c774154edf73e37810a952141f67", "score": "0.7494655", "text": "func (mock *ProjectCatalogControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v31.ProjectCatalogHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.ProjectCatalogHandlerFunc\n\t}\n\tlockProjectCatalogControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockProjectCatalogControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "f2501a0f3d7c21b357972c465bd9f252", "score": "0.74852335", "text": "func (mock *UserInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v31.UserLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v31.UserLifecycle\n\t}\n\tlockUserInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockUserInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "3b8b3c1e0ae79e983a7ab940da690b2a", "score": "0.7475311", "text": "func (mock *TokenInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v31.TokenLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v31.TokenLifecycle\n\t}\n\tlockTokenInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockTokenInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "7f47973b34b2d4e2c0bc331723c65747", "score": "0.7447756", "text": "func (mock *ProjectNetworkPolicyInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v31.ProjectNetworkPolicyHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.ProjectNetworkPolicyHandlerFunc\n\t}\n\tlockProjectNetworkPolicyInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockProjectNetworkPolicyInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "965ca2dda72dbaa14459a8dd1afa56d2", "score": "0.7429258", "text": "func (mock *CisBenchmarkVersionInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v3.CisBenchmarkVersionLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v3.CisBenchmarkVersionLifecycle\n\t}\n\tlockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockCisBenchmarkVersionInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "32c0f300bdde54d4fee247fe61781c3a", "score": "0.7424135", "text": "func (mock *EventControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v11.EventHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v11.EventHandlerFunc\n\t}\n\tlockEventControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockEventControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "494b49942f27db32a9d33e02192e8da5", "score": "0.74101996", "text": "func (mock *RancherUserNotificationInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v31.RancherUserNotificationLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v31.RancherUserNotificationLifecycle\n\t}\n\tlockRancherUserNotificationInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockRancherUserNotificationInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "255b311d9986e26ada5e0d0993130b75", "score": "0.7406048", "text": "func (mock *DynamicSchemaInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v31.DynamicSchemaHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.DynamicSchemaHandlerFunc\n\t}\n\tlockDynamicSchemaInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockDynamicSchemaInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "425644d3b11d95063f5614c91f2cb06a", "score": "0.74032104", "text": "func (mock *EventInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v11.EventLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v11.EventLifecycle\n\t}\n\tlockEventInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockEventInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "4e2eb0d67eb3d402c02d1682c4eee586", "score": "0.7391217", "text": "func (mock *ProjectNetworkPolicyInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v31.ProjectNetworkPolicyLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v31.ProjectNetworkPolicyLifecycle\n\t}\n\tlockProjectNetworkPolicyInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockProjectNetworkPolicyInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "b59ad1925db23233421b5402b516fd57", "score": "0.73723686", "text": "func (mock *ProjectNetworkPolicyControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v31.ProjectNetworkPolicyHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.ProjectNetworkPolicyHandlerFunc\n\t}\n\tlockProjectNetworkPolicyControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockProjectNetworkPolicyControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "7a9e9446fa67622c7cc9d9bfaf019d1a", "score": "0.7358059", "text": "func (mock *DynamicSchemaInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v31.DynamicSchemaLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v31.DynamicSchemaLifecycle\n\t}\n\tlockDynamicSchemaInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockDynamicSchemaInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "b106ae3c41e8ca5bc0db1561a9c12a68", "score": "0.73330134", "text": "func (mock *DynamicSchemaControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v31.DynamicSchemaHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.DynamicSchemaHandlerFunc\n\t}\n\tlockDynamicSchemaControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockDynamicSchemaControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "133a69948ccdc4cb51ef4ed92eb1a603", "score": "0.7328135", "text": "func (mock *ProjectCatalogInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v31.ProjectCatalogLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v31.ProjectCatalogLifecycle\n\t}\n\tlockProjectCatalogInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockProjectCatalogInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "51181d0cc2adee88967d1d59ae8cefc3", "score": "0.7310186", "text": "func (mock *ClusterAlertGroupInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v31.ClusterAlertGroupLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v31.ClusterAlertGroupLifecycle\n\t}\n\tlockClusterAlertGroupInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockClusterAlertGroupInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "bbb5cd821ada26b84d1a3bb268ed65f3", "score": "0.72759515", "text": "func (mock *ClusterAlertGroupInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.ClusterAlertGroupHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.ClusterAlertGroupHandlerFunc\n\t}\n\tlockClusterAlertGroupInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockClusterAlertGroupInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "b2d63c20de0f8788db7ae1257edc5429", "score": "0.7251441", "text": "func (mock *GlobalDnsInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v31.GlobalDnsLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v31.GlobalDnsLifecycle\n\t}\n\tlockGlobalDnsInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockGlobalDnsInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "ac19a34e4918bcaac23530261890ff78", "score": "0.7244974", "text": "func (mock *GlobalDnsInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v31.GlobalDnsHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.GlobalDnsHandlerFunc\n\t}\n\tlockGlobalDnsInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockGlobalDnsInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "c6adafb43b3f14cec5e429b84bd77eb4", "score": "0.7244667", "text": "func (mock *ClusterAlertGroupControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.ClusterAlertGroupHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.ClusterAlertGroupHandlerFunc\n\t}\n\tlockClusterAlertGroupControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockClusterAlertGroupControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "311870c9fc460abc63b3b511a44a9f2f", "score": "0.72340614", "text": "func (mock *PrometheusInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v11.PrometheusHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v11.PrometheusHandlerFunc\n\t}\n\tlockPrometheusInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockPrometheusInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "a56de5ae7f85c9da5a841ed3a0f2a808", "score": "0.7220232", "text": "func (mock *RoleInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v11.RoleHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v11.RoleHandlerFunc\n\t}\n\tlockRoleInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockRoleInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "b846225d7a87ecec2000503fa4f9ab9e", "score": "0.72047615", "text": "func (mock *PrometheusInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tClusterName string\n\tLifecycle v11.PrometheusLifecycle\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tClusterName string\n\t\tLifecycle v11.PrometheusLifecycle\n\t}\n\tlockPrometheusInterfaceMockAddClusterScopedFeatureLifecycle.RLock()\n\tcalls = mock.calls.AddClusterScopedFeatureLifecycle\n\tlockPrometheusInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "77664cc4d44ed41b279175dea0d1e9eb", "score": "0.72042966", "text": "func (mock *CisBenchmarkVersionInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v3.CisBenchmarkVersionHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v3.CisBenchmarkVersionHandlerFunc\n\t}\n\tlockCisBenchmarkVersionInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockCisBenchmarkVersionInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "fee3e8f98817399e8e582df5c7235235", "score": "0.7198342", "text": "func (mock *RoleControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v11.RoleHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v11.RoleHandlerFunc\n\t}\n\tlockRoleControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockRoleControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "c8879d8cea07039fd4f740be91cefe7a", "score": "0.717977", "text": "func (mock *CisBenchmarkVersionControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v3.CisBenchmarkVersionHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v3.CisBenchmarkVersionHandlerFunc\n\t}\n\tlockCisBenchmarkVersionControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockCisBenchmarkVersionControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "e16d30eda9319327611af0e9baad860a", "score": "0.7170222", "text": "func (mock *ClusterAlertGroupInterfaceMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tSync v31.ClusterAlertGroupHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tSync v31.ClusterAlertGroupHandlerFunc\n\t}\n\tlockClusterAlertGroupInterfaceMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockClusterAlertGroupInterfaceMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "47f151f141163a42fddfa549159257eb", "score": "0.7156741", "text": "func (mock *GlobalDnsControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v31.GlobalDnsHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.GlobalDnsHandlerFunc\n\t}\n\tlockGlobalDnsControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockGlobalDnsControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "c27e56e94f90b2b3e3411468a33ae8d7", "score": "0.7144039", "text": "func (mock *PrometheusControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v11.PrometheusHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v11.PrometheusHandlerFunc\n\t}\n\tlockPrometheusControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockPrometheusControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "a2a1e1cc7629727a743524c9faa1bf06", "score": "0.7136323", "text": "func (mock *ClusterAlertGroupControllerMock) AddClusterScopedHandlerCalls() []struct {\n\tCtx context.Context\n\tName string\n\tClusterName string\n\tHandler v31.ClusterAlertGroupHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tName string\n\t\tClusterName string\n\t\tHandler v31.ClusterAlertGroupHandlerFunc\n\t}\n\tlockClusterAlertGroupControllerMockAddClusterScopedHandler.RLock()\n\tcalls = mock.calls.AddClusterScopedHandler\n\tlockClusterAlertGroupControllerMockAddClusterScopedHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "81f86b547e716c01fb408e3da95152af", "score": "0.70602125", "text": "func (mock *RoleTemplateInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.RoleTemplateHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.RoleTemplateHandlerFunc\n\t}\n\tlockRoleTemplateInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockRoleTemplateInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "4564fe2aa19168b4311d4c7c2eeea110", "score": "0.7056178", "text": "func (mock *RancherUserNotificationInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.RancherUserNotificationHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.RancherUserNotificationHandlerFunc\n\t}\n\tlockRancherUserNotificationInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockRancherUserNotificationInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "2b510c451c981519b135eed64a31a730", "score": "0.7047191", "text": "func (mock *ProjectCatalogInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.ProjectCatalogHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.ProjectCatalogHandlerFunc\n\t}\n\tlockProjectCatalogInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockProjectCatalogInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "e966d983babdd787a9975d4c0b86882a", "score": "0.7038103", "text": "func (mock *RoleTemplateControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.RoleTemplateHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.RoleTemplateHandlerFunc\n\t}\n\tlockRoleTemplateControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockRoleTemplateControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "7f4397b8ae94932f88b23cdd7c121ff5", "score": "0.7027655", "text": "func (mock *RancherUserNotificationControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.RancherUserNotificationHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.RancherUserNotificationHandlerFunc\n\t}\n\tlockRancherUserNotificationControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockRancherUserNotificationControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "4f8f632e874b875c4e5c3841df8f160e", "score": "0.70238423", "text": "func (mock *UserControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.UserHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.UserHandlerFunc\n\t}\n\tlockUserControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockUserControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "9cf1339f1e3c71842c9e22327ee1a880", "score": "0.7018212", "text": "func (mock *ProjectCatalogControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.ProjectCatalogHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.ProjectCatalogHandlerFunc\n\t}\n\tlockProjectCatalogControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockProjectCatalogControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "8d1b89c5369dbd8b4be3dd279b70a744", "score": "0.70040065", "text": "func (mock *UserInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.UserHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.UserHandlerFunc\n\t}\n\tlockUserInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockUserInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "4180bdad66bbbb3802278d26ce0251c7", "score": "0.6966027", "text": "func (mock *TokenInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.TokenHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.TokenHandlerFunc\n\t}\n\tlockTokenInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockTokenInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "820e11e9cd8693b4f55261d1becc2a45", "score": "0.69659895", "text": "func (mock *SecretInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v11.SecretHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v11.SecretHandlerFunc\n\t}\n\tlockSecretInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockSecretInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "da5a7f70f5e6bdd3a98113fcfe0a3c3c", "score": "0.6944639", "text": "func (mock *SecretControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v11.SecretHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v11.SecretHandlerFunc\n\t}\n\tlockSecretControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockSecretControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "a9f2351597e5435695b8520ba56f6310", "score": "0.69331914", "text": "func (mock *TokenControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.TokenHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.TokenHandlerFunc\n\t}\n\tlockTokenControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockTokenControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "6ef415c86b33f8f383ad46a80671eacd", "score": "0.69233274", "text": "func (mock *ProjectNetworkPolicyInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.ProjectNetworkPolicyHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.ProjectNetworkPolicyHandlerFunc\n\t}\n\tlockProjectNetworkPolicyInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockProjectNetworkPolicyInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "7e39b1b274cfdc82912c68dc0a528871", "score": "0.6897455", "text": "func (mock *ProjectNetworkPolicyControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.ProjectNetworkPolicyHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.ProjectNetworkPolicyHandlerFunc\n\t}\n\tlockProjectNetworkPolicyControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockProjectNetworkPolicyControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "ce77c24b6dca5448a99cb1348d200f1c", "score": "0.6890399", "text": "func (mock *GlobalDnsInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.GlobalDnsHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.GlobalDnsHandlerFunc\n\t}\n\tlockGlobalDnsInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockGlobalDnsInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "12761750db2ee4fab8665aa9d1fb202e", "score": "0.686703", "text": "func (mock *HarborTagControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v3.HarborTagHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v3.HarborTagHandlerFunc\n\t}\n\tlockHarborTagControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockHarborTagControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "48b90330332b6313ce0ede85ddbed6ab", "score": "0.6862643", "text": "func (mock *HarborTagInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v3.HarborTagHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v3.HarborTagHandlerFunc\n\t}\n\tlockHarborTagInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockHarborTagInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "f4b3c46926224eed135d9d7aa3312c20", "score": "0.6858764", "text": "func (mock *DynamicSchemaInterfaceMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.DynamicSchemaHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.DynamicSchemaHandlerFunc\n\t}\n\tlockDynamicSchemaInterfaceMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockDynamicSchemaInterfaceMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "52efaf0364a3fd5a19ae3f8950f6850c", "score": "0.68525076", "text": "func (mock *GlobalDnsControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.GlobalDnsHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.GlobalDnsHandlerFunc\n\t}\n\tlockGlobalDnsControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockGlobalDnsControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "da609e6187203ab6f40b241e78e2f08f", "score": "0.68475884", "text": "func (mock *DynamicSchemaControllerMock) AddFeatureHandlerCalls() []struct {\n\tCtx context.Context\n\tEnabled func() bool\n\tName string\n\tSync v31.DynamicSchemaHandlerFunc\n} {\n\tvar calls []struct {\n\t\tCtx context.Context\n\t\tEnabled func() bool\n\t\tName string\n\t\tSync v31.DynamicSchemaHandlerFunc\n\t}\n\tlockDynamicSchemaControllerMockAddFeatureHandler.RLock()\n\tcalls = mock.calls.AddFeatureHandler\n\tlockDynamicSchemaControllerMockAddFeatureHandler.RUnlock()\n\treturn calls\n}", "title": "" } ]
5cc438ed5fe1a668900683abd39e8ee8
Offset adds an offset step to the query.
[ { "docid": "a46b7bc6bf847b67a4b1d1a58eb25bff", "score": "0.70324963", "text": "func (sq *ShoppingQuery) Offset(offset int) *ShoppingQuery {\n\tsq.offset = &offset\n\treturn sq\n}", "title": "" } ]
[ { "docid": "e907ebff0fa2d3cc5327936c5e9bed72", "score": "0.72114515", "text": "func (epq *EntryPointQuery) Offset(offset int) *EntryPointQuery {\n\tepq.offset = &offset\n\treturn epq\n}", "title": "" }, { "docid": "e03bd21396c1df428946eff21ec18fed", "score": "0.718752", "text": "func (aq *AdultQuery) Offset(offset int) *AdultQuery {\n\taq.offset = &offset\n\treturn aq\n}", "title": "" }, { "docid": "8aa5ff28259da6ef07f8d426c07777e4", "score": "0.71021074", "text": "func (trsq *TravelRestrictionSnapshotQuery) Offset(offset int) *TravelRestrictionSnapshotQuery {\n\ttrsq.offset = &offset\n\treturn trsq\n}", "title": "" }, { "docid": "36ffb538e7b9a7e83e584f25431bbd30", "score": "0.70615023", "text": "func (tpq *TourProductQuery) Offset(offset int) *TourProductQuery {\n\ttpq.offset = &offset\n\treturn tpq\n}", "title": "" }, { "docid": "5e74e81d5cf7e35706b36d81fd2212f7", "score": "0.70360917", "text": "func (lq *LanguageQuery) Offset(offset int) *LanguageQuery {\n\tlq.offset = &offset\n\treturn lq\n}", "title": "" }, { "docid": "89ac325521cdbbfc8aad55adf8258ea8", "score": "0.70021087", "text": "func (rq *RoomdetailQuery) Offset(offset int) *RoomdetailQuery {\n\trq.offset = &offset\n\treturn rq\n}", "title": "" }, { "docid": "f6a62be73ab6d37f1558a156e0f10b40", "score": "0.6994332", "text": "func (ec *ExpresionChain) Offset(offset int64) *ExpresionChain {\n\tec.setOffset(\n\t\t&querySegmentAtom{\n\t\t\tsegment: sqlOffset,\n\t\t\texpresion: fmt.Sprintf(\"%d\", offset),\n\t\t\targuments: nil,\n\t\t\tsqlBool: SQLNothing,\n\t\t})\n\treturn ec\n}", "title": "" }, { "docid": "06e5c6f1a066eb7174fbda9dffc58f81", "score": "0.6984332", "text": "func (dq *DecisionQuery) Offset(offset int) *DecisionQuery {\n\tdq.offset = &offset\n\treturn dq\n}", "title": "" }, { "docid": "753439e0c61265a2de113fc5a4bd4b2e", "score": "0.6979974", "text": "func (dosq *DependsOnSkippedQuery) Offset(offset int) *DependsOnSkippedQuery {\n\tdosq.offset = &offset\n\treturn dosq\n}", "title": "" }, { "docid": "d67e20036ef77144e168156a30dfc47a", "score": "0.69353366", "text": "func (cliq *CheckListItemQuery) Offset(offset int) *CheckListItemQuery {\n\tcliq.offset = &offset\n\treturn cliq\n}", "title": "" }, { "docid": "f5af561559884e258d4fd4b4e4fd0d0a", "score": "0.69247895", "text": "func (vq *VlanQuery) Offset(offset int) *VlanQuery {\n\tvq.offset = &offset\n\treturn vq\n}", "title": "" }, { "docid": "d5fd3b6cf7a51d6608e78d0577f47bda", "score": "0.69161206", "text": "func (q *Query) Offset(offset int) *Query {\n\tq = q.clone()\n\tq.offset = int32(offset)\n\tq.queryDs = q.queryDs.Offset(offset)\n\treturn q\n}", "title": "" }, { "docid": "98058f8166ea83da145373f5bb9a2096", "score": "0.69154024", "text": "func (aq *APIQuery) Offset(offset int) *APIQuery {\n\taq.ctx.Offset = &offset\n\treturn aq\n}", "title": "" }, { "docid": "23cb0e8acc90ac993d198586ff3510a1", "score": "0.6908161", "text": "func (vq *VehicleQuery) Offset(offset int) *VehicleQuery {\n\tvq.offset = &offset\n\treturn vq\n}", "title": "" }, { "docid": "33735ebbfb2d5c17610d419e04c4d959", "score": "0.6867426", "text": "func (ofq *OrderFieldQuery) Offset(offset int) *OrderFieldQuery {\n\tofq.offset = &offset\n\treturn ofq\n}", "title": "" }, { "docid": "99feb72055895590e8e2641ae7b682e8", "score": "0.68527216", "text": "func (q *Query) Offset(n int) *Query {\n\tq.offset = n\n\tq.offsetCounter = n\n\treturn q\n}", "title": "" }, { "docid": "8f1acca1478a37d2a0a10d2584a736cc", "score": "0.684682", "text": "func (pq *ProductQuery) Offset(offset int) *ProductQuery {\n\tpq.offset = &offset\n\treturn pq\n}", "title": "" }, { "docid": "35d35debb3720c8f7aaae2bb19cee9cb", "score": "0.6841887", "text": "func (vq *VocaQuery) Offset(offset int) *VocaQuery {\n\tvq.offset = &offset\n\treturn vq\n}", "title": "" }, { "docid": "6e0efc4cf9c881b70f68d785c21c9996", "score": "0.684088", "text": "func (dpq *DeathPlaceQuery) Offset(offset int) *DeathPlaceQuery {\n\tdpq.offset = &offset\n\treturn dpq\n}", "title": "" }, { "docid": "839df47f1df93de543f4eba4bdea24d5", "score": "0.6837483", "text": "func (lbq *LoadBalanceQuery) Offset(offset int) *LoadBalanceQuery {\n\tlbq.offset = &offset\n\treturn lbq\n}", "title": "" }, { "docid": "286db9025ae56875cd7a4485854f3853", "score": "0.68371123", "text": "func (pq *ParticipationQuery) Offset(offset int) *ParticipationQuery {\n\tpq.offset = &offset\n\treturn pq\n}", "title": "" }, { "docid": "4257530202f4f87117323cc582fc6bf7", "score": "0.6825839", "text": "func (plan *QueryPlan) Offset(offset int64) interfaces.SelectQuery {\n\tplan.offset = offset\n\treturn plan\n}", "title": "" }, { "docid": "87ca61a2ef680393e5d6869813905957", "score": "0.6818442", "text": "func (sq *SystemQuery) Offset(offset int) *SystemQuery {\n\tsq.offset = &offset\n\treturn sq\n}", "title": "" }, { "docid": "8436649e543bb306a0cd18f2abd04611", "score": "0.6813691", "text": "func (uq *UserQuery) Offset(offset int) *UserQuery {\n\tuq.ctx.Offset = &offset\n\treturn uq\n}", "title": "" }, { "docid": "8436649e543bb306a0cd18f2abd04611", "score": "0.6813691", "text": "func (uq *UserQuery) Offset(offset int) *UserQuery {\n\tuq.ctx.Offset = &offset\n\treturn uq\n}", "title": "" }, { "docid": "35eb5367ac9d3443a78e26680d3d3e03", "score": "0.68113697", "text": "func (o *QueryAccountsParams) SetOffset(offset *int64) {\n\to.Offset = offset\n}", "title": "" }, { "docid": "63e1df05cf66404ddcc8e58181011033", "score": "0.6810875", "text": "func (pq *PatientofphysicianQuery) Offset(offset int) *PatientofphysicianQuery {\n\tpq.offset = &offset\n\treturn pq\n}", "title": "" }, { "docid": "546e74302d7cc5c07d8f3189a8fd1c73", "score": "0.6804523", "text": "func (rq *RelationshipQuery) Offset(offset int) *RelationshipQuery {\n\trq.ctx.Offset = &offset\n\treturn rq\n}", "title": "" }, { "docid": "52d919cbb89de16395d6f85476606125", "score": "0.67711544", "text": "func (ftq *FurnitureTypeQuery) Offset(offset int) *FurnitureTypeQuery {\n\tftq.offset = &offset\n\treturn ftq\n}", "title": "" }, { "docid": "eb3d6f87288de1c956b755203a510e8d", "score": "0.675741", "text": "func (wq *WatchlistQuery) Offset(offset int) *WatchlistQuery {\n\twq.offset = &offset\n\treturn wq\n}", "title": "" }, { "docid": "e95fb105609c5fd2b1bd9cbae90bccf9", "score": "0.6728687", "text": "func (mq *MetadataQuery) Offset(offset int) *MetadataQuery {\n\tmq.ctx.Offset = &offset\n\treturn mq\n}", "title": "" }, { "docid": "7b36134ec22923f73a7c6557c6f524be", "score": "0.6726616", "text": "func (builder *QueryBuilder) Offset(offset string) *QueryBuilder {\n\tbuilder.appendClause(OFFSET, offset)\n\n\treturn builder\n}", "title": "" }, { "docid": "c2f1a6e2ed96ac31589cb46b8153515a", "score": "0.6710929", "text": "func (dsq *DataSourceQuery) Offset(offset int) *DataSourceQuery {\n\tdsq.offset = &offset\n\treturn dsq\n}", "title": "" }, { "docid": "289235b107f5da079299fee97d5f2742", "score": "0.6710245", "text": "func (iq *InquiryQuery) Offset(offset int) *InquiryQuery {\n\tiq.offset = &offset\n\treturn iq\n}", "title": "" }, { "docid": "0efe5c57ba102f17cac0eb8a458306e5", "score": "0.6709156", "text": "func (tq *TaskQuery) Offset(offset int) *TaskQuery {\n\ttq.ctx.Offset = &offset\n\treturn tq\n}", "title": "" }, { "docid": "f3e64194eab1b264b558dfb015e41008", "score": "0.66991186", "text": "func (bpq *BlogPostQuery) Offset(offset int) *BlogPostQuery {\n\tbpq.offset = &offset\n\treturn bpq\n}", "title": "" }, { "docid": "5b8712ee9ef0270c2540c7eebccde82b", "score": "0.66862607", "text": "func (dtq *DrugTypeQuery) Offset(offset int) *DrugTypeQuery {\n\tdtq.offset = &offset\n\treturn dtq\n}", "title": "" }, { "docid": "04331e536594fa20a6904deaa0b1cc2d", "score": "0.6664522", "text": "func (pq *ProcesQuery) Offset(offset int) *ProcesQuery {\n\tpq.offset = &offset\n\treturn pq\n}", "title": "" }, { "docid": "c0c3137fd55a5272389ac46895565f58", "score": "0.6664029", "text": "func (mtq *MetricTypeQuery) Offset(offset int) *MetricTypeQuery {\n\tmtq.offset = &offset\n\treturn mtq\n}", "title": "" }, { "docid": "93e6e7227e2d551a55392b7e2b913177", "score": "0.6656847", "text": "func (osq *OutboundShippingQuery) Offset(offset int) *OutboundShippingQuery {\n\tosq.offset = &offset\n\treturn osq\n}", "title": "" }, { "docid": "628d089bd8c2a331fb03d8c243e0e39a", "score": "0.66540986", "text": "func (uaq *UserAccountQuery) Offset(offset int) *UserAccountQuery {\n\tuaq.offset = &offset\n\treturn uaq\n}", "title": "" }, { "docid": "09ec6c0ef88d1307bd4de008a115458c", "score": "0.66343933", "text": "func (oq *OAuth2ClientQuery) Offset(offset int) *OAuth2ClientQuery {\n\toq.ctx.Offset = &offset\n\treturn oq\n}", "title": "" }, { "docid": "5c303182a15820dda68d19d8fa695983", "score": "0.6633984", "text": "func (gq *GoodsQuery) Offset(offset int) *GoodsQuery {\n\tgq.ctx.Offset = &offset\n\treturn gq\n}", "title": "" }, { "docid": "b4344747b72f46951c4822ccf569c98d", "score": "0.66222715", "text": "func (ttrq *TemplateTagRelationQuery) Offset(offset int) *TemplateTagRelationQuery {\n\tttrq.offset = &offset\n\treturn ttrq\n}", "title": "" }, { "docid": "3c481bb06264db242c5616f0400331c3", "score": "0.6618586", "text": "func (sq *SpecQuery) Offset(offset int) *SpecQuery {\n\tsq.ctx.Offset = &offset\n\treturn sq\n}", "title": "" }, { "docid": "960d94687c20e9e498bb84b2afd35cf9", "score": "0.6597795", "text": "func (f *Fluent) Offset(offset int) QueryMapper {\n\tf.query.builder(setOffset(offset))\n\treturn f\n}", "title": "" }, { "docid": "9addb116d932cc8232f52b928d3ecad6", "score": "0.65963906", "text": "func (o *QueryChangesParams) SetOffset(offset *int32) {\n\to.Offset = offset\n}", "title": "" }, { "docid": "34a8489f416d21752bb9e430f4d3ce56", "score": "0.6572909", "text": "func (upaq *UnsavedPostAttachmentQuery) Offset(offset int) *UnsavedPostAttachmentQuery {\n\tupaq.offset = &offset\n\treturn upaq\n}", "title": "" }, { "docid": "63110fd894fadec2d64df26496a0e56b", "score": "0.65705585", "text": "func (bldr *SampleQueryBuilder) Offset(offset int) *SampleQueryBuilder {\n\tbldr.q = bldr.q.Offset(offset)\n\tif bldr.plugin != nil {\n\t\tbldr.plugin.Offset(offset)\n\t}\n\treturn bldr\n}", "title": "" }, { "docid": "14b87e05131819e493fa1c6c7e28a71a", "score": "0.65642536", "text": "func (dq *DeviceQuery) Offset(offset int) *DeviceQuery {\n\tdq.offset = &offset\n\treturn dq\n}", "title": "" }, { "docid": "92545b2b2b1879c134b615442013ceea", "score": "0.6551774", "text": "func (esmq *ExplicitSkippedMessageQuery) Offset(offset int) *ExplicitSkippedMessageQuery {\n\tesmq.offset = &offset\n\treturn esmq\n}", "title": "" }, { "docid": "350f29933d54d65634b0e4935048e353", "score": "0.6546217", "text": "func (a *accountsQueryBuilder) Offset(offset int64) *accountsQueryBuilder {\n\tif a.err != nil {\n\t\treturn a\n\t}\n\ta.builder.Offset(offset)\n\treturn a\n}", "title": "" }, { "docid": "41a6156071de05cb0755c752c945ac0a", "score": "0.6543704", "text": "func (r *Result) Offset(n int) db.Result {\n\tr.offset = n\n\treturn r\n}", "title": "" }, { "docid": "51fb88c7461150c20f6231e67b06ca42", "score": "0.6534415", "text": "func Offset(offset int) OptFn {\n\treturn func(db *gorm.DB) *gorm.DB {\n\t\treturn db.Offset(offset)\n\t}\n}", "title": "" }, { "docid": "b7f11627be73b53d2c2e996af92df0f0", "score": "0.6527337", "text": "func (iq *InfoQuery) Offset(offset int) *InfoQuery {\n\tiq.ctx.Offset = &offset\n\treturn iq\n}", "title": "" }, { "docid": "94f253c084136221718ba6a7235c1527", "score": "0.6525726", "text": "func (rsq *RequestStatusQuery) Offset(offset int) *RequestStatusQuery {\n\trsq.ctx.Offset = &offset\n\treturn rsq\n}", "title": "" }, { "docid": "b578f15f41255adcf858351a32a04319", "score": "0.6509972", "text": "func (crq *ClinicalResultsQuery) Offset(offset int) *ClinicalResultsQuery {\n\tcrq.offset = &offset\n\treturn crq\n}", "title": "" }, { "docid": "f5c10863c2d78ce6ec870f309feef33c", "score": "0.6494814", "text": "func (akq *AccountKeyQuery) Offset(offset int) *AccountKeyQuery {\n\takq.offset = &offset\n\treturn akq\n}", "title": "" }, { "docid": "4e9c7a395ec80a2315cdb5970b5521c9", "score": "0.64941305", "text": "func (qs ArticleQuerySet) Offset(offset int) ArticleQuerySet {\n\treturn qs.w(qs.db.Offset(offset))\n}", "title": "" }, { "docid": "a1af28d9f934a855a31d812909395d2f", "score": "0.64885354", "text": "func (ewq *EventsWaitQuery) Offset(offset int) *EventsWaitQuery {\n\tewq.offset = &offset\n\treturn ewq\n}", "title": "" }, { "docid": "2357bf1b8576e83f63af556b196943e8", "score": "0.6473812", "text": "func (csq *CounterStaffQuery) Offset(offset int) *CounterStaffQuery {\n\tcsq.offset = &offset\n\treturn csq\n}", "title": "" }, { "docid": "77719a5b93174441b4548f3803d08794", "score": "0.6471612", "text": "func (o *FdrschemaQueriesEventGetParams) SetOffset(offset *int64) {\n\to.Offset = offset\n}", "title": "" }, { "docid": "12652a2ef2a1c8a592858324c18d01d5", "score": "0.6452985", "text": "func (gsq *GoodsSpecsQuery) Offset(offset int) *GoodsSpecsQuery {\n\tgsq.offset = &offset\n\treturn gsq\n}", "title": "" }, { "docid": "9b4057a140e9e79611d60794560145cf", "score": "0.64523137", "text": "func (sebq *StatementEndingBalancQuery) Offset(offset int) *StatementEndingBalancQuery {\n\tsebq.offset = &offset\n\treturn sebq\n}", "title": "" }, { "docid": "ffc055440671aa01abb16a6c0c472856", "score": "0.6436622", "text": "func (qb *MySQLQueryBuilder) Offset(offset int) QueryBuilder {\n\treturn (*orm.MySQLQueryBuilder)(qb).Offset(offset)\n}", "title": "" }, { "docid": "c156eed32dd57d818e29b1aec679e438", "score": "0.6435739", "text": "func (biq *BlockInstanceQuery) Offset(offset int) *BlockInstanceQuery {\n\tbiq.offset = &offset\n\treturn biq\n}", "title": "" }, { "docid": "1b125e0290126bd5aecc746db12ef351", "score": "0.64330107", "text": "func (koq *K8sObjectQuery) Offset(offset int) *K8sObjectQuery {\n\tkoq.offset = &offset\n\treturn koq\n}", "title": "" }, { "docid": "5038545e844f6f0b7648f8384c1d4ec2", "score": "0.6419112", "text": "func (bbq *BookBorrowQuery) Offset(offset int) *BookBorrowQuery {\n\tbbq.offset = &offset\n\treturn bbq\n}", "title": "" }, { "docid": "0a64e483491bb4a7c9302e2fa04d8db6", "score": "0.6413039", "text": "func (stmt SelectStmt) Offset(offset int) SelectStmt {\n\tstmt.offset = offset\n\treturn stmt\n}", "title": "" }, { "docid": "3be547345846fc1f4e62942ac4ee6ce2", "score": "0.63927865", "text": "func (pvq *PostVideoQuery) Offset(offset int) *PostVideoQuery {\n\tpvq.offset = &offset\n\treturn pvq\n}", "title": "" }, { "docid": "fd47c3f9271fc91fdb30e4599f14d2a2", "score": "0.6389611", "text": "func (b *selectBuilder) Offset(n uint64) SelectBuilder {\n\tb.selectStmt.Offset(n)\n\treturn b\n}", "title": "" }, { "docid": "5ddfc08c712b84c8e60a9f5244c2498d", "score": "0.6375362", "text": "func (ooq *OrganizationOwnershipQuery) Offset(offset int) *OrganizationOwnershipQuery {\n\tooq.offset = &offset\n\treturn ooq\n}", "title": "" }, { "docid": "11d6fe522f13a77838cfdc224c9bbcff", "score": "0.637163", "text": "func (qs AccountQuerySet) Offset(offset int) AccountQuerySet {\n\treturn qs.w(qs.db.Offset(offset))\n}", "title": "" }, { "docid": "2cc51075b1c9256924b59b4c36477a40", "score": "0.63708544", "text": "func (bmq *BaselineMeasureQuery) Offset(offset int) *BaselineMeasureQuery {\n\tbmq.offset = &offset\n\treturn bmq\n}", "title": "" }, { "docid": "42ffd5933448dd442de240a20e54f945", "score": "0.6359313", "text": "func (d *DB) Offset(offset int) *DB {\r\n\td.offset = offset\r\n\treturn d\r\n}", "title": "" }, { "docid": "60f53298c8a00001f559d12637716971", "score": "0.63533956", "text": "func (in *ActionAuthTokenIndexInput) SetOffset(value int64) *ActionAuthTokenIndexInput {\n\tin.Offset = value\n\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tin._selectedParameters[\"Offset\"] = nil\n\treturn in\n}", "title": "" }, { "docid": "3229718ef4f0bf325e339fb6db85e390", "score": "0.6339973", "text": "func (r *DB) Offset(off int64) *DB {\n\tr.Builder.offset = off\n\treturn r\n}", "title": "" }, { "docid": "5c7b1b483a14a5b592d6de9aa7005f23", "score": "0.63391656", "text": "func (in *ActionUserPaymentIndexInput) SetOffset(value int64) *ActionUserPaymentIndexInput {\n\tin.Offset = value\n\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tin._selectedParameters[\"Offset\"] = nil\n\treturn in\n}", "title": "" }, { "docid": "5271d08494ddc8716313499380904983", "score": "0.63332075", "text": "func (wnfq *WithNilFieldsQuery) Offset(offset int) *WithNilFieldsQuery {\n\twnfq.offset = &offset\n\treturn wnfq\n}", "title": "" }, { "docid": "f29451cb9ad7f39495a5ad194903d3ee", "score": "0.6323802", "text": "func (qs TaskQuerySet) Offset(offset int) TaskQuerySet {\n\treturn qs.w(qs.db.Offset(offset))\n}", "title": "" }, { "docid": "626808f77883c86c19b97b718c3806ca", "score": "0.63155776", "text": "func (o *ListCustomRulesParams) SetOffset(offset *int64) {\n\to.Offset = offset\n}", "title": "" }, { "docid": "23fef5b221611a78c0ba39e736875c68", "score": "0.62962705", "text": "func (cq *CourseclassQuery) Offset(offset int) *CourseclassQuery {\n\tcq.offset = &offset\n\treturn cq\n}", "title": "" }, { "docid": "97ab6b8e3d6d79a34a19960a03964a77", "score": "0.6295761", "text": "func (cq *ConfigoccupationQuery) Offset(offset int) *ConfigoccupationQuery {\n\tcq.offset = &offset\n\treturn cq\n}", "title": "" }, { "docid": "83a53bb4507868762745a481322906de", "score": "0.62840664", "text": "func (tcq *TimerClientQuery) Offset(offset int) *TimerClientQuery {\n\ttcq.offset = &offset\n\treturn tcq\n}", "title": "" }, { "docid": "4523a3c150acb2eaf9fd5dc00c2e66a7", "score": "0.62529016", "text": "func (dba *Database) Offset(offset int) *Database {\n\tdba.offset = offset\n\treturn dba\n}", "title": "" }, { "docid": "220f3972ddcfd408ee41c07d6593467d", "score": "0.62519825", "text": "func (in *ActionUserEnvironmentConfigIndexInput) SetOffset(value int64) *ActionUserEnvironmentConfigIndexInput {\n\tin.Offset = value\n\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tin._selectedParameters[\"Offset\"] = nil\n\treturn in\n}", "title": "" }, { "docid": "70d27cebcc3c2e3dab7585f9031f5f19", "score": "0.625182", "text": "func (r *Reader) Offset(i int) builder.Reader {\n\tr.sql.WriteString(fmt.Sprintf(\" OFFSET %s\", strconv.Itoa(i)))\n\treturn r\n}", "title": "" }, { "docid": "8d1b30449e2b3940e6b2e48c5b897d98", "score": "0.6247749", "text": "func (upvq *UnsavedPostVideoQuery) Offset(offset int) *UnsavedPostVideoQuery {\n\tupvq.offset = &offset\n\treturn upvq\n}", "title": "" }, { "docid": "9c060420fd80507c1086a54e3f04f200", "score": "0.6239759", "text": "func (o *QueryUncategorizedItemsParams) SetOffset(offset *int32) {\n\to.Offset = offset\n}", "title": "" }, { "docid": "c97a9403d1474c1e80a1d45c143b42a0", "score": "0.6235817", "text": "func (o *AdminSearchUserV3Params) SetOffset(offset *int64) {\n\to.Offset = offset\n}", "title": "" }, { "docid": "6a7efb7c6e0b735f3db83cc1bbcd1abb", "score": "0.6234202", "text": "func (b *LeadsGetUsersBuilder) Offset(v int) *LeadsGetUsersBuilder {\n\tb.Params[\"offset\"] = v\n\treturn b\n}", "title": "" }, { "docid": "95d9423a699e7ba86af45f5f4cd1fbe1", "score": "0.6227928", "text": "func (evsq *ExValueScanQuery) Offset(offset int) *ExValueScanQuery {\n\tevsq.ctx.Offset = &offset\n\treturn evsq\n}", "title": "" }, { "docid": "41c12c4aeb8646a5cf4f29eb27246178", "score": "0.62215906", "text": "func (s Measurements) AddOffset(offset int64) {\n\tfor measurementIdx := range s {\n\t\tif s[measurementIdx] == nil {\n\t\t\tcontinue\n\t\t}\n\t\tfor dataIdx := range s[measurementIdx].Data {\n\t\t\tdata := &s[measurementIdx].Data[dataIdx]\n\t\t\tif data.Range.Length == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdata.Range.Offset = uint64(int64(data.Range.Offset) + offset)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b1f574ad8dca579f750aa75b41b1c94e", "score": "0.62001705", "text": "func (o *TriggerInvoiceGenerationForParkedAccountsParams) SetOffset(offset *int64) {\n\to.Offset = offset\n}", "title": "" }, { "docid": "bc6576fa19cd3d21056a72bbf4f21a75", "score": "0.6199483", "text": "func (in *ActionUserMailRoleRecipientIndexInput) SetOffset(value int64) *ActionUserMailRoleRecipientIndexInput {\n\tin.Offset = value\n\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tin._selectedParameters[\"Offset\"] = nil\n\treturn in\n}", "title": "" }, { "docid": "43e83b72154717d4894c5777726231b0", "score": "0.61955774", "text": "func (in *ActionOomReportUsageIndexInput) SetOffset(value int64) *ActionOomReportUsageIndexInput {\n\tin.Offset = value\n\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tin._selectedParameters[\"Offset\"] = nil\n\treturn in\n}", "title": "" }, { "docid": "6aa175a7b8317202e66da91d9eb75f01", "score": "0.6185192", "text": "func (ktfq *KqiTemporalFrequencyQuery) Offset(offset int) *KqiTemporalFrequencyQuery {\n\tktfq.offset = &offset\n\treturn ktfq\n}", "title": "" }, { "docid": "ed992cedd4680da4d8707ca5c5e39ad7", "score": "0.61818737", "text": "func (_options *ListResourceRecordsOptions) SetOffset(offset int64) *ListResourceRecordsOptions {\n\t_options.Offset = core.Int64Ptr(offset)\n\treturn _options\n}", "title": "" }, { "docid": "522161c53036d32c5bc8ce50502aa8ab", "score": "0.6157315", "text": "func WithOffset(v int64) Pair {\n\treturn Pair{\n\t\tKey: \"offset\",\n\t\tValue: v,\n\t}\n}", "title": "" }, { "docid": "f276ec65ca2151b1b7d7f0ea44a73e26", "score": "0.6152037", "text": "func (o *ListOrganizationChangeLogParams) SetOffset(offset *int32) {\n\to.Offset = offset\n}", "title": "" } ]
e7a5cbf7530b1bae8c51c813712a4de4
WithRelativeTypes is a user input (uinput) device option to set the device relative event types.
[ { "docid": "32b2a22ef816c8fbb59d417c93265db1", "score": "0.7165272", "text": "func WithRelativeTypes(types map[RelativeType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" } ]
[ { "docid": "94528014a2cb05969f181790c26b9570", "score": "0.61522454", "text": "func WithTypesFromDev(d *Evdev) UserInputOption {\n\treturn func(u *UserInput) {\n\t\tWithTypes(\n\t\t\td.EventTypes(),\n\t\t\td.SyncTypes(),\n\t\t\td.KeyTypes(),\n\t\t\td.RelativeTypes(),\n\t\t\td.AbsoluteTypes(),\n\t\t\td.MiscTypes(),\n\t\t\td.SwitchTypes(),\n\t\t\td.LEDTypes(),\n\t\t\t//d.RepeatTypes(),\n\t\t\td.SoundTypes(),\n\t\t\td.EffectTypes(),\n\t\t\td.PowerTypes(),\n\t\t\td.EffectStatusTypes(),\n\t\t)(u)\n\t}\n}", "title": "" }, { "docid": "a527d285348eb6c3ba0dfcb1c7a52441", "score": "0.6135439", "text": "func WithEventTypes(events map[EventType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t\t/*var err error\n\t\tfor _, typ := range types {\n\t\t\terr = ioctl(u.fd.Fd(), uiSetEvBit, typ)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}*/\n\t\tu.events = events\n\t}\n}", "title": "" }, { "docid": "0189e66ff616aac694e8f87937515978", "score": "0.5925889", "text": "func WithAbsoluteTypes(types map[AbsoluteType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "0d21be2c98810ba3331e0ea09c62815d", "score": "0.5464527", "text": "func WithTypes(types ...interface{}) UserInputOption {\n\treturn func(u *UserInput) {\n\t\tfor _, typ := range types {\n\t\t\tswitch typs := typ.(type) {\n\t\t\tcase map[EventType]bool:\n\t\t\t\tWithEventTypes(typs)(u)\n\t\t\tcase map[SyncType]bool:\n\t\t\t\tWithSyncTypes(typs)(u)\n\t\t\tcase map[KeyType]bool:\n\t\t\t\tWithKeyTypes(typs)(u)\n\t\t\tcase map[RelativeType]bool:\n\t\t\t\tWithRelativeTypes(typs)(u)\n\t\t\tcase map[AbsoluteType]bool:\n\t\t\t\tWithAbsoluteTypes(typs)(u)\n\t\t\tcase map[MiscType]bool:\n\t\t\t\tWithMiscTypes(typs)(u)\n\t\t\tcase map[SwitchType]bool:\n\t\t\t\tWithSwitchTypes(typs)(u)\n\t\t\tcase map[LEDType]bool:\n\t\t\t\tWithLEDTypes(typs)(u)\n\t\t\tcase map[RepeatType]bool:\n\t\t\t\tWithRepeatTypes(typs)(u)\n\t\t\tcase map[EffectType]bool:\n\t\t\t\tWithEffectTypes(typs)(u)\n\t\t\tcase map[PowerType]bool:\n\t\t\t\tWithPowerTypes(typs)(u)\n\t\t\tcase map[EffectStatusType]bool:\n\t\t\t\tWithEffectStatusTypes(typs)(u)\n\t\t\tcase map[PropertyType]bool:\n\t\t\t\tWithPropertyTypes(typs)(u)\n\t\t\tdefault:\n\t\t\t\tpanic(fmt.Sprintf(\"invalid type %T\", typ))\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "25782bcb9fd4062c12786c7e553efe52", "score": "0.528314", "text": "func WithSoundTypes(types map[SoundType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "3317a1ee78fe3edaf87f5f4f65435aac", "score": "0.5047153", "text": "func WithPowerTypes(types map[PowerType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "8767f0698fd1f9b03701b7bb2f212e13", "score": "0.4962465", "text": "func WithSyncTypes(types map[SyncType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "0fcb2c2874f5a56c119c7466932f3287", "score": "0.47624892", "text": "func WithKeyTypes(types map[KeyType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "3c6b3280724ebb5060f73b49a18a275e", "score": "0.47587854", "text": "func WithPropertyTypes(types map[PropertyType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "917ffd31998baa0a9abf1d7813da47ff", "score": "0.4738671", "text": "func WithRepeatTypes(types map[RepeatType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "c644479b524de39d9140fcecc69b39d5", "score": "0.47134432", "text": "func WithEffectTypes(types map[EffectType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "74b0e839e98ebc08aee44999ab18aecd", "score": "0.46226418", "text": "func (dtc *DeviceTypeCreate) AddTypes(d ...*Device) *DeviceTypeCreate {\n\tids := make([]int, len(d))\n\tfor i := range d {\n\t\tids[i] = d[i].ID\n\t}\n\treturn dtc.AddTypeIDs(ids...)\n}", "title": "" }, { "docid": "76ed40ea5b62190e3e7487489e46a717", "score": "0.4534148", "text": "func WithSwitchTypes(types map[SwitchType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "a5bab9dba0be1408f313b61f94400f60", "score": "0.45268437", "text": "func Types(addTypes ...any) EnvOption {\n\treturn func(e *Env) (*Env, error) {\n\t\treg, isReg := e.provider.(ref.TypeRegistry)\n\t\tif !isReg {\n\t\t\treturn nil, fmt.Errorf(\"custom types not supported by provider: %T\", e.provider)\n\t\t}\n\t\tfor _, t := range addTypes {\n\t\t\tswitch v := t.(type) {\n\t\t\tcase proto.Message:\n\t\t\t\tfdMap := pb.CollectFileDescriptorSet(v)\n\t\t\t\tfor _, fd := range fdMap {\n\t\t\t\t\terr := reg.RegisterDescriptor(fd)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase ref.Type:\n\t\t\t\terr := reg.RegisterType(v)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"unsupported type: %T\", t)\n\t\t\t}\n\t\t}\n\t\treturn e, nil\n\t}\n}", "title": "" }, { "docid": "bd037f4fad32dd63b320f7180df27e42", "score": "0.4472075", "text": "func WithEffectStatusTypes(types map[EffectStatusType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "75501629c64f50cafc7e044b12b3f90c", "score": "0.43826032", "text": "func (s *BasealefListener) EnterTypespec(ctx *TypespecContext) {}", "title": "" }, { "docid": "ad24484f227ed1690789b1d141de3730", "score": "0.4351986", "text": "func (s *BasealefListener) EnterTypecast(ctx *TypecastContext) {}", "title": "" }, { "docid": "cf152f843f57692891f07745c5e2efdf", "score": "0.4328263", "text": "func WithLEDTypes(types map[LEDType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "592580b903be2417bcd0648cc57981a3", "score": "0.4313841", "text": "func WithMiscTypes(types map[MiscType]bool) UserInputOption {\n\treturn func(u *UserInput) {\n\t}\n}", "title": "" }, { "docid": "45649e93f6ed26fac0bf800a39218f63", "score": "0.42674592", "text": "func WithTypes(types ...TypeFunc) OptionFunc {\n\treturn func(c *Cast) {\n\t\tfor _, pack := range types {\n\t\t\ttypeOf, convert := pack()\n\t\t\tc.convertToType[typeOf] = convert\n\t\t}\n\t}\n}", "title": "" }, { "docid": "72c03b2a0bb8fe5c3841c2fcb2a8da03", "score": "0.42521375", "text": "func (self Music) SetRelativeToListener(relative bool) { \n C.sfMusic_setRelativeToListener(self.Cref, Bool(relative));\n}", "title": "" }, { "docid": "efa311693859c36457e2ffb940ba8abf", "score": "0.4235521", "text": "func (scope *Scope) ConfigureTypes(path string, line int) error {\n\tscope.path = path\n\tscope.line = line\n\tscope.fset = token.NewFileSet() // positions are relative to fset\n\tscope.config = &types.Config{\n\t\tFakeImportC: true,\n\t\tImporter: getImporter(),\n\t}\n\n\t// Parse the file containing this very example\n\t// but stop after processing the imports.\n\tf, err := scope.parseDir()\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"parser.ParseDir %q\", scope.path)\n\t}\n\n\tfor name, file := range f {\n\t\tscope.Files[name] = file\n\t}\n\n\t_, errs := scope.TypeCheck()\n\tif len(errs) > 0 {\n\t\treturn errors.Wrap(errs[0], \"failed to TypeCheck\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d2abf2c20969897b5505ab34ee457f1b", "score": "0.42204365", "text": "func (source *ApplicationSource) ExplicitType() (*ApplicationSourceType, error) {\n\tvar appTypes []ApplicationSourceType\n\tif source.Kustomize != nil {\n\t\tappTypes = append(appTypes, ApplicationSourceTypeKustomize)\n\t}\n\tif source.Helm != nil {\n\t\tappTypes = append(appTypes, ApplicationSourceTypeHelm)\n\t}\n\tif source.Directory != nil {\n\t\tappTypes = append(appTypes, ApplicationSourceTypeDirectory)\n\t}\n\tif source.Plugin != nil {\n\t\tappTypes = append(appTypes, ApplicationSourceTypePlugin)\n\t}\n\tif len(appTypes) == 0 {\n\t\treturn nil, nil\n\t}\n\tif len(appTypes) > 1 {\n\t\ttypeNames := make([]string, len(appTypes))\n\t\tfor i := range appTypes {\n\t\t\ttypeNames[i] = string(appTypes[i])\n\t\t}\n\t\treturn nil, fmt.Errorf(\"multiple application sources defined: %s\", strings.Join(typeNames, \",\"))\n\t}\n\tappType := appTypes[0]\n\treturn &appType, nil\n}", "title": "" }, { "docid": "dbc7504871da69c00d306c2bdaee5bd4", "score": "0.42012066", "text": "func SetupInterpreterTypes(interp *fast.Interp) {\n\tinterp.ImportPackage(\"fmt\", \"fmt\")\n\tinterp.ImportPackage(\"time\", \"time\")\n\n\t// Interfaces\n\tinterp.DeclType(interp.TypeOf((*OwnerI)(nil)).Elem())\n\tinterp.DeclType(interp.TypeOf((*ObjectI)(nil)).Elem())\n\tinterp.DeclType(interp.TypeOf((*EventI)(nil)).Elem())\n\tinterp.DeclType(interp.TypeOf((*ActionI)(nil)).Elem())\n\n\t// Concrete Types\n\tinterp.DeclType(interp.TypeOf(EventAdvance{}))\n\tinterp.DeclType(interp.TypeOf(EventAttacked{}))\n\tinterp.DeclType(interp.TypeOf(EventAttacking{}))\n\tinterp.DeclType(interp.TypeOf(EventAttack{}))\n\tinterp.DeclType(interp.TypeOf(EventBirth{}))\n\tinterp.DeclType(interp.TypeOf(EventDestroy{}))\n\tinterp.DeclType(interp.TypeOf(EventFall{}))\n\tinterp.DeclType(interp.TypeOf(EventFell{}))\n\tinterp.DeclType(interp.TypeOf(EventExit{}))\n\n\tinterp.DeclType(interp.TypeOf(OwnerPlayer{}))\n\tinterp.DeclType(interp.TypeOf(OwnerSimpleAI{}))\n\n\tinterp.DeclType(interp.TypeOf(Object{}))\n\tinterp.DeclType(interp.TypeOf(ObjectEquipable{}))\n\tinterp.DeclType(interp.TypeOf(ObjectAudio{}))\n\tinterp.DeclType(interp.TypeOf(ObjectBlock{}))\n\tinterp.DeclType(interp.TypeOf(ObjectCharacter{}))\n\tinterp.DeclType(interp.TypeOf(ObjectExit{}))\n\tinterp.DeclType(interp.TypeOf(ObjectFlora{}))\n\tinterp.DeclType(interp.TypeOf(ObjectFood{}))\n\tinterp.DeclType(interp.TypeOf(ObjectGeneric{}))\n\tinterp.DeclType(interp.TypeOf(ObjectItem{}))\n\tinterp.DeclType(interp.TypeOf(ObjectSkill{}))\n\tinterp.DeclType(interp.TypeOf(ObjectTile{}))\n\n\tinterp.DeclType(interp.TypeOf(ActionMove{}))\n\tinterp.DeclType(interp.TypeOf(ActionAttack{}))\n\tinterp.DeclType(interp.TypeOf(ActionSpawn{}))\n\tinterp.DeclType(interp.TypeOf(ActionStatus{}))\n\n\tinterp.DeclType(interp.TypeOf(data.Duration{}))\n\n\tinterp.DeclType(interp.TypeOf(Map{}))\n\tinterp.DeclType(interp.TypeOf(Tile{}))\n}", "title": "" }, { "docid": "db7d93657dc59be5da204fae31ebea9f", "score": "0.41870767", "text": "func PeekWithWantConnectorType(want bool) PeekOption {\n\treturn PeekOption{\n\t\tset: func(opts *peekOptions) {\n\t\t\topts.wantConnectorType = want\n\t\t},\n\t}\n}", "title": "" }, { "docid": "227fb8dd7afd34ba85a1b63cd6b08964", "score": "0.41802794", "text": "func InputEvent(event cloudevents.Event) EventsHubOption {\n\tencodedEvent, err := json.Marshal(event)\n\tif err != nil {\n\t\treturn func(ctx context.Context, envs map[string]string) error {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn envOption(\"INPUT_EVENT\", string(encodedEvent))\n}", "title": "" }, { "docid": "b1d47205c0a8370ee3814cc6e1594d5a", "score": "0.4180196", "text": "func mountTypesRc(_ context.Context, in rc.Params) (out rc.Params, err error) {\n\tvar mountTypes = []string{}\n\tmountMu.Lock()\n\tdefer mountMu.Unlock()\n\tfor mountType := range mountFns {\n\t\tmountTypes = append(mountTypes, mountType)\n\t}\n\tsort.Strings(mountTypes)\n\treturn rc.Params{\n\t\t\"mountTypes\": mountTypes,\n\t}, nil\n}", "title": "" }, { "docid": "7ba91ec97cc71bfada160310c49d7c1e", "score": "0.41106287", "text": "func handleType(c *client) {\n\tif len(c.input) < 2 {\n\t\tsendMessage(c, 500)\n\t\treturn\n\t}\n\targ := rune(c.input[1][0])\n\t// Only supporting one mode currently.\n\tif arg == 'A' {\n\t\tc.ftype = arg\n\t\tsendMessage(c, 200)\n\t} else {\n\t\tsendMessage(c, 504)\n\t}\n}", "title": "" }, { "docid": "8f6f7b57aa2339c498403f6cd792ea25", "score": "0.40823403", "text": "func (d *Data) AddTypes(name string, types []byte) error", "title": "" }, { "docid": "1e20c202e4c6d79db5627648791410d5", "score": "0.40796605", "text": "func (s *BaseDZListener) EnterTypeSpec(ctx *TypeSpecContext) {}", "title": "" }, { "docid": "9e072df68d314365e41f80f12b2e2949", "score": "0.4078886", "text": "func PointerUpEvent(mods ...string) JSONEvent {\n\treturn JSONEvent{Name: strcase.ToKebab(\"pointerup\"), Targets: mods}\n}", "title": "" }, { "docid": "7807b1b5d79924114edf6b91a85a66a4", "score": "0.40581682", "text": "func (d *Data) AddTypes(name string, types []byte) error {}", "title": "" }, { "docid": "64dda7ac5d32836257a5023674f61fba", "score": "0.405693", "text": "func (l *Lexer) SetTypeSystemInput(input []byte) error {\n\n\tif len(input) > uint16Max {\n\t\treturn fmt.Errorf(\"SetTypeSystemInput: input size must not be > %d, got: %d\", uint16Max, len(input))\n\t}\n\n\tl.input = l._storage[:0]\n\tl.input = append(l.input, input...)\n\n\tl.inputPosition = 0\n\tl.textPosition.LineStart = 1\n\tl.textPosition.CharStart = 1\n\tl.typeSystemEndPosition = len(input)\n\n\treturn nil\n}", "title": "" }, { "docid": "ae731b4081fb0bffff9a9f9de75cb24d", "score": "0.40313572", "text": "func (a *DispatchMouseEventArgs) SetPointerType(pointerType string) *DispatchMouseEventArgs {\n\ta.PointerType = &pointerType\n\treturn a\n}", "title": "" }, { "docid": "fb2d2fb3505908208ec1e70aeadb4837", "score": "0.4025387", "text": "func InputType_Values() []string {\n\treturn []string{\n\t\tInputTypeUdpPush,\n\t\tInputTypeRtpPush,\n\t\tInputTypeRtmpPush,\n\t\tInputTypeRtmpPull,\n\t\tInputTypeUrlPull,\n\t\tInputTypeMp4File,\n\t\tInputTypeMediaconnect,\n\t\tInputTypeInputDevice,\n\t\tInputTypeAwsCdi,\n\t\tInputTypeTsFile,\n\t}\n}", "title": "" }, { "docid": "eb994b97d91be42ac2f7aa47ae182f23", "score": "0.40142444", "text": "func WithType(eventType string) Option {\n\treturn func(c *CloudEvent) {\n\t\tc.Type = eventType\n\t}\n}", "title": "" }, { "docid": "ea425fc3dba63d9b7ff972a2c52a9866", "score": "0.39933217", "text": "func AddTypes(c Context, types ...Type) {\n\tl := c.DefiningLoader()\n\trts := make([]ResolvableType, 0, len(types))\n\ttss := make([]TypeSet, 0, 4)\n\tfor _, t := range types {\n\t\t// A TypeSet should not be added until it is resolved since it uses its own\n\t\t// loader for the resolution.\n\t\tif ts, ok := t.(TypeSet); ok {\n\t\t\ttss = append(tss, ts)\n\t\t} else {\n\t\t\tl.SetEntry(NewTypedName(NsType, t.Name()), NewLoaderEntry(t, nil))\n\t\t}\n\t\tif rt, ok := t.(ResolvableType); ok {\n\t\t\trts = append(rts, rt)\n\t\t}\n\t}\n\tResolveTypes(c, rts...)\n\tfor _, ts := range tss {\n\t\tl.SetEntry(NewTypedName(NsType, ts.Name()), NewLoaderEntry(ts, nil))\n\t}\n}", "title": "" }, { "docid": "b3b9f8d495b15579c0fca69a2732ad54", "score": "0.39849272", "text": "func InputMethod(method string) EventsHubOption {\n\treturn envOption(\"INPUT_METHOD\", method)\n}", "title": "" }, { "docid": "240e8beb0678fbcbec29a6c62e62ecc5", "score": "0.39709625", "text": "func (s *BasepikeListener) EnterType_(ctx *Type_Context) {}", "title": "" }, { "docid": "9086dbcf1f65410a6601d5be6a9f35e5", "score": "0.39648357", "text": "func (o *ExtendedFlowSpecificationOption) SetHint(hint uint8) { o.TypeHint = 0x06&0x7F | hint&0x01<<7 }", "title": "" }, { "docid": "952633e8cebca8c4590583708e37489d", "score": "0.39615262", "text": "func (attrs InputJSONPathAttrs) InputType() string {\n\treturn InputTypeJSONPath\n}", "title": "" }, { "docid": "13963ff451a4e11d079da4b24ddc1a7a", "score": "0.3954536", "text": "func LoadSensorTypes() {\n\tUltrasonic.port = UltrasonicPort\n\tUltrasonic.device = UltrasonicDevice\n}", "title": "" }, { "docid": "944ba0814b18046a3b5654d3a5cfe5fa", "score": "0.39539093", "text": "func (s *BaseJavaListener) EnterTypeArgument(ctx *TypeArgumentContext) {}", "title": "" }, { "docid": "58d03f4840736b61bd19cb9d264e2566", "score": "0.39439857", "text": "func (s *BaseDZListener) EnterBasicTypeSpec(ctx *BasicTypeSpecContext) {}", "title": "" }, { "docid": "fed3547c7983e75fbe335ef18bda3a0b", "score": "0.39326948", "text": "func WindowsStartMenuModeTypePUserDefined() *WindowsStartMenuModeType {\n\tv := WindowsStartMenuModeTypeVUserDefined\n\treturn &v\n}", "title": "" }, { "docid": "04c55f4952f896e9c4e1dded55e978fe", "score": "0.39184156", "text": "func WithOSType() Option {\n\treturn WithDetectors(osTypeDetector{})\n}", "title": "" }, { "docid": "69ecaf4e60ae8c59a7b4dcc2f5bf7dfe", "score": "0.3903816", "text": "func (s *BaseJavaListener) EnterNonWildcardTypeArguments(ctx *NonWildcardTypeArgumentsContext) {}", "title": "" }, { "docid": "0a903e2417199e84a6cbf9744be3de5a", "score": "0.38989922", "text": "func addEnumValues(n string, p *pdl.Type, parent *pdl.Type, d *pdl.Domain) {\n\t// find type\n\tvar typ *pdl.Type\n\tfor _, t := range d.Types {\n\t\tif t.RawName == n {\n\t\t\ttyp = t\n\t\t\tbreak\n\t\t}\n\t}\n\tif typ == nil {\n\t\tseeType := \"type\"\n\t\tswitch {\n\t\tcase parent.RawType == \"command\":\n\t\t\tseeType = \"method\"\n\t\tcase parent.RawType == \"event\":\n\t\t\tseeType = \"event\"\n\t\t}\n\n\t\ttyp = &pdl.Type{\n\t\t\tRawSee: \"https://chromedevtools.github.io/devtools-protocol/tot/\" + strings.Replace(parent.RawName, \".\", \"#\"+seeType+\"-\", -1),\n\t\t\tRawType: p.RawType,\n\t\t\tRawName: n,\n\t\t\tIsCircularDep: p.IsCircularDep,\n\t\t\tName: strings.TrimPrefix(n, d.Domain.String()+\".\"),\n\t\t\tType: pdl.TypeString,\n\t\t\tDescription: p.Description,\n\t\t\tOptional: p.Optional,\n\t\t\tAlwaysEmit: p.AlwaysEmit,\n\t\t}\n\t\td.Types = append(d.Types, typ)\n\t}\n\n\t// combine typ.Enum and vals\n\tv := make(map[string]bool)\n\tall := append(typ.Enum, p.Enum...)\n\tfor _, z := range all {\n\t\tv[z] = false\n\t}\n\n\tvar i int\n\ttyp.Enum = make([]string, len(v))\n\tfor _, z := range all {\n\t\tif !v[z] {\n\t\t\ttyp.Enum[i] = z\n\t\t\ti++\n\t\t}\n\t\tv[z] = true\n\t}\n}", "title": "" }, { "docid": "c481a9d3ce0275c19bc4fce327cc959d", "score": "0.38968912", "text": "func TestEventTypes(t *testing.T) {\n\tperformEventTypeStringTest(t, KafkaChannelReconciled, \"KafkaChannelReconciled\")\n\tperformEventTypeStringTest(t, KafkaChannelFinalized, \"KafkaChannelFinalized\")\n\tperformEventTypeStringTest(t, ClusterChannelProvisionerReconciliationFailed, \"ClusterChannelProvisionerReconciliationFailed\")\n\tperformEventTypeStringTest(t, ClusterChannelProvisionerUpdateStatusFailed, \"ClusterChannelProvisionerUpdateStatusFailed\")\n\tperformEventTypeStringTest(t, KafkaChannelServiceReconciliationFailed, \"KafkaChannelServiceReconciliationFailed\")\n\tperformEventTypeStringTest(t, ChannelUpdateFailed, \"ChannelUpdateFailed\")\n\tperformEventTypeStringTest(t, ChannelServiceReconciliationFailed, \"ChannelServiceReconciliationFailed\")\n\tperformEventTypeStringTest(t, ChannelServiceReconciliationFailed, \"ChannelServiceReconciliationFailed\")\n\tperformEventTypeStringTest(t, ChannelDeploymentReconciliationFailed, \"ChannelDeploymentReconciliationFailed\")\n\tperformEventTypeStringTest(t, KafkaTopicReconciliationFailed, \"KafkaTopicReconciliationFailed\")\n\tperformEventTypeStringTest(t, DispatcherServiceReconciliationFailed, \"DispatcherServiceReconciliationFailed\")\n\tperformEventTypeStringTest(t, DispatcherDeploymentReconciliationFailed, \"DispatcherDeploymentReconciliationFailed\")\n\tperformEventTypeStringTest(t, KafkaSecretReconciled, \"KafkaSecretReconciled\")\n\tperformEventTypeStringTest(t, KafkaSecretFinalized, \"KafkaSecretFinalized\")\n}", "title": "" }, { "docid": "c449c13dd904a5ef5b8b526bbcdde680", "score": "0.3881465", "text": "func InputEventWithEncoding(event cloudevents.Event, encoding cloudevents.Encoding) EventsHubOption {\n\tencodedEvent, err := json.Marshal(event)\n\tif err != nil {\n\t\treturn func(ctx context.Context, envs map[string]string) error {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn compose(\n\t\tenvOption(\"INPUT_EVENT\", string(encodedEvent)),\n\t\tenvOption(\"EVENT_ENCODING\", encoding.String()),\n\t)\n}", "title": "" }, { "docid": "68629600b5b9bc5ef2017a8d9dd94398", "score": "0.38786504", "text": "func (me TxsdColorProfileTypeRenderingIntent) IsRelativeColorimetric() bool {\r\n\treturn me == \"relative-colorimetric\"\r\n}", "title": "" }, { "docid": "03eb748c95ae0c3dd4140f04544bd275", "score": "0.38747963", "text": "func (self *TraitWindow) SetDeviceEvents(device IsDevice, event_mask C.GdkEventMask) {\n\tC.gdk_window_set_device_events(self.CPointer, device.GetDevicePointer(), event_mask)\n\treturn\n}", "title": "" }, { "docid": "c43b368233422d6695cba48273826a05", "score": "0.38688424", "text": "func TypeDescs(descs ...any) EnvOption {\n\treturn func(e *Env) (*Env, error) {\n\t\treg, isReg := e.provider.(ref.TypeRegistry)\n\t\tif !isReg {\n\t\t\treturn nil, fmt.Errorf(\"custom types not supported by provider: %T\", e.provider)\n\t\t}\n\t\t// Scan the input descriptors for FileDescriptorProto messages and accumulate them into a\n\t\t// synthetic FileDescriptorSet as the FileDescriptorProto messages may refer to each other\n\t\t// and will not resolve properly unless they are part of the same set.\n\t\tvar fds *descpb.FileDescriptorSet\n\t\tfor _, d := range descs {\n\t\t\tswitch f := d.(type) {\n\t\t\tcase *descpb.FileDescriptorProto:\n\t\t\t\tif fds == nil {\n\t\t\t\t\tfds = &descpb.FileDescriptorSet{\n\t\t\t\t\t\tFile: []*descpb.FileDescriptorProto{},\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfds.File = append(fds.File, f)\n\t\t\t}\n\t\t}\n\t\tif fds != nil {\n\t\t\tif err := registerFileSet(reg, fds); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tfor _, d := range descs {\n\t\t\tswitch f := d.(type) {\n\t\t\tcase *protoregistry.Files:\n\t\t\t\tif err := registerFiles(reg, f); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\tcase protoreflect.FileDescriptor:\n\t\t\t\tif err := reg.RegisterDescriptor(f); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\tcase *descpb.FileDescriptorSet:\n\t\t\t\tif err := registerFileSet(reg, f); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\tcase *descpb.FileDescriptorProto:\n\t\t\t\t// skip, handled as a synthetic file descriptor set.\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"unsupported type descriptor: %T\", d)\n\t\t\t}\n\t\t}\n\t\treturn e, nil\n\t}\n}", "title": "" }, { "docid": "cf21a2256abf764a4f941d4059caf235", "score": "0.38667065", "text": "func InputEvent(mods ...string) JSONEvent {\n\treturn JSONEvent{Name: strcase.ToKebab(\"input\"), Targets: mods}\n}", "title": "" }, { "docid": "c42144cc8bc2a6b2c61895941e99e0b2", "score": "0.38615862", "text": "func (s *BaseCQLListener) EnterUintType(ctx *UintTypeContext) {}", "title": "" }, { "docid": "74d881af7e2ca1dbe256e3be6876ebce", "score": "0.3859135", "text": "func convert(e interface{}) interface{} {\n\tswitch e := e.(type) {\n\tcase mouse.Event:\n\t\tte := touch.Event{\n\t\t\tX: e.X,\n\t\t\tY: e.Y,\n\t\t}\n\t\tswitch e.Direction {\n\t\tcase mouse.DirNone:\n\t\t\tte.Type = touch.TypeMove\n\t\tcase mouse.DirPress:\n\t\t\tte.Type = touch.TypeBegin\n\t\tcase mouse.DirRelease:\n\t\t\tte.Type = touch.TypeEnd\n\t\t}\n\n\t\treturn te\n\t}\n\treturn e\n}", "title": "" }, { "docid": "2c0f5ff4d2f668292858aedf3b4d49b8", "score": "0.38573864", "text": "func (q *Query) SetStartRelative(val int64, unit TimeUnit) *Query {\n q.startRelative = &RelativeTime{val, unit}\n return q\n}", "title": "" }, { "docid": "e0205a65aea6489bce6149cc5f50b341", "score": "0.3847364", "text": "func registerTypes() {\n utility.Register(&Update{})\n utility.Register(&ChangeMode{})\n utility.Register(&pOM{})\n utility.Register(&faultySet{})\n utility.Register(&aCK{})\n utility.Register(&nack{})\n //\tutility.Register(&iVouchForThis{})\n utility.Register(&cDL{})\n}", "title": "" }, { "docid": "970a7b2cbded65dcf7ba2fcbf5a3017e", "score": "0.38419366", "text": "func (s *Sound) AddSyncPoint(offset C.uint, offsettype C.FMOD_TIMEUNIT, name *C.char, point **C.FMOD_SYNCPOINT) error {\n\t//FMOD_RESULT F_API FMOD_Sound_AddSyncPoint (FMOD_SOUND *sound, unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);\n\treturn ErrNoImpl\n}", "title": "" }, { "docid": "7717e57d7ba71df54fe181889810d3b2", "score": "0.38291496", "text": "func (u API) Types(t ...string) API {\n\tq := u.u.Query()\n\tq.Add(\"types\", strings.Join(t, \",\"))\n\tu.u.RawQuery = q.Encode()\n\treturn u\n}", "title": "" }, { "docid": "9b26253e024b00c166b5979012da468c", "score": "0.38270086", "text": "func (o *TimeseriesQueryMessage) SetRelativeTime(v string) {\n\to.RelativeTime = &v\n}", "title": "" }, { "docid": "013204583474b5fa884493fab7b63a82", "score": "0.3826238", "text": "func WithType(_type string) func(event *v2.Event) error {\n\treturn func(e *v2.Event) error {\n\t\te.SetType(_type)\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "2e3d8115bce2072ea4755013b5789ed5", "score": "0.38204983", "text": "func InputType(name string) graphql.Input {\n\treturn &mockType{name}\n}", "title": "" }, { "docid": "6dbfa0670d9a1399e9abe25e159fa1e4", "score": "0.38198814", "text": "func TypeString(str string) error {\n\tif len(str) == 0 {\n\t\treturn errors.New(\"The string cannot be empty\")\n\t}\n\n\tinputs := []Input{}\n\n\tfor _, s := range str {\n\t\tinputs = append(inputs, GetInputByRune(s, KeyDown))\n\t\tinputs = append(inputs, GetInputByRune(s, KeyUp))\n\t}\n\n\treturn SendInput(inputs)\n}", "title": "" }, { "docid": "293c24cac4aba5acb586a587c234a262", "score": "0.38017723", "text": "func (me TxsdPresentationAttributesGraphicsPointerEvents) IsInherit() bool { return me == \"inherit\" }", "title": "" }, { "docid": "1d1d4123d84cca1f3e67576f05b6dbb2", "score": "0.3799413", "text": "func (attrs InputUnknownAttrs) InputType() string {\n\treturn attrs.inputType\n}", "title": "" }, { "docid": "d93e4cc1581358070b124f7d14a6877a", "score": "0.37947434", "text": "func InputType(t Type) Type {\n\tif t == DynamicType || t == NoneType {\n\t\treturn t\n\t}\n\tif input, ok := inputTypes[t]; ok {\n\t\treturn input\n\t}\n\n\tvar src Type\n\tswitch t := t.(type) {\n\tcase *OutputType:\n\t\treturn t\n\tcase *PromiseType:\n\t\tsrc = NewPromiseType(InputType(t.ElementType))\n\tcase *MapType:\n\t\tsrc = NewMapType(InputType(t.ElementType))\n\tcase *ListType:\n\t\tsrc = NewListType(InputType(t.ElementType))\n\tcase *UnionType:\n\t\telementTypes := make([]Type, len(t.ElementTypes))\n\t\tfor i, t := range t.ElementTypes {\n\t\t\telementTypes[i] = InputType(t)\n\t\t}\n\t\tsrc = NewUnionType(elementTypes...)\n\tcase *ObjectType:\n\t\tproperties := map[string]Type{}\n\t\tfor k, t := range t.Properties {\n\t\t\tproperties[k] = InputType(t)\n\t\t}\n\t\tsrc = NewObjectType(properties)\n\tdefault:\n\t\tsrc = t\n\t}\n\n\tinput := NewUnionType(src, NewOutputType(src))\n\tinputTypes[t] = input\n\treturn input\n}", "title": "" }, { "docid": "1ddad015b9717b19418f98dc81265e10", "score": "0.37932292", "text": "func (o RecorderRecordingGroupPtrOutput) IncludeGlobalResourceTypes() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v RecorderRecordingGroup) *bool { return v.IncludeGlobalResourceTypes }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "1c7ada04e8a4019ca69a93e4845af401", "score": "0.37881902", "text": "func (c *Input) DispatchTouchEvent(theType string, touchPoints *InputTouchPoint, modifiers int, timestamp float64) (*gcdmessage.ChromeResponse, error) {\n\tparamRequest := make(map[string]interface{}, 4)\n\tparamRequest[\"type\"] = theType\n\tparamRequest[\"touchPoints\"] = touchPoints\n\tparamRequest[\"modifiers\"] = modifiers\n\tparamRequest[\"timestamp\"] = timestamp\n\treturn gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: \"Input.dispatchTouchEvent\", Params: paramRequest})\n}", "title": "" }, { "docid": "8d22eaa843679c23bb4b9c02d1d9bcbd", "score": "0.37758327", "text": "func (obj ChangeValueRelativeChangeValue) MarshalJSON() ([]byte, error) {\n\ttype Alias ChangeValueRelativeChangeValue\n\treturn json.Marshal(struct {\n\t\tAction string `json:\"type\"`\n\t\t*Alias\n\t}{Action: \"relative\", Alias: (*Alias)(&obj)})\n}", "title": "" }, { "docid": "9e94de940f465c9c3457dae082607107", "score": "0.37656263", "text": "func (attrs InputCEFKafkaAttrs) InputType() string {\n\treturn InputTypeCEFKafka\n}", "title": "" }, { "docid": "b30aca8cf7979c0e603fb95d2605f825", "score": "0.37648493", "text": "func (self *TraitWindow) SetTypeHint(hint C.GdkWindowTypeHint) {\n\tC.gdk_window_set_type_hint(self.CPointer, hint)\n\treturn\n}", "title": "" }, { "docid": "de3e8131520cdbdf4e79e0a6339d9892", "score": "0.37621832", "text": "func (s *BasemodelicaListener) EnterType_prefix(ctx *Type_prefixContext) {}", "title": "" }, { "docid": "1affe9bb8688289c4406cca657098bb9", "score": "0.37621173", "text": "func (s *BasepowerbuilderListener) EnterData_type_name(ctx *Data_type_nameContext) {}", "title": "" }, { "docid": "cb6a26976802437dd8dbf2f92c405a53", "score": "0.37600395", "text": "func (self *TraitWindow) SetUrgencyHint(urgent bool) {\n\t__cgo__urgent := C.gboolean(0)\n\tif urgent {\n\t\t__cgo__urgent = C.gboolean(1)\n\t}\n\tC.gdk_window_set_urgency_hint(self.CPointer, __cgo__urgent)\n\treturn\n}", "title": "" }, { "docid": "82c5b0a7fa6b90f58125846ff02f4fdc", "score": "0.37588874", "text": "func (c *Client) MoveRelative(\n\t_posx, _posy, _spd, _acc, _add, _mmt, _ref interface{},\n) (err error) {\n\tposx, spd, acc, add, mmt, ref, err := parseRelArgs(_posx, _spd, _acc, _add, _mmt, _ref)\n\tif err != nil {\n\t\treturn err\n\t}\n\tposy, ok := _posy.(float64)\n\tif !ok {\n\t\treturn fmt.Errorf(\"failed to convert posy %v\", _posy)\n\t}\n\tlog.If(\"moving by (%v,%v)...\", posx, posy)\n\tif err = tml.SelectAxis(c.axisXID); err != nil {\n\t\treturn err\n\t}\n\tif err = tml.MoveRelative(\n\t\ttml.CalcPosition(c.axisXID, posx),\n\t\ttml.CalcSpeed(c.axisXID, spd),\n\t\ttml.CalcAccel(c.axisXID, acc),\n\t\tadd,\n\t\tmmt,\n\t\tref,\n\t); err != nil {\n\t\treturn err\n\t}\n\tif err = tml.SetEventOnMotionComplete(false, false); err != nil {\n\t\treturn err\n\t}\n\tif err = tml.SelectAxis(c.axisYID); err != nil {\n\t\treturn err\n\t}\n\tif err = tml.MoveRelative(\n\t\ttml.CalcPosition(c.axisYID, posy),\n\t\ttml.CalcSpeed(c.axisYID, spd),\n\t\ttml.CalcAccel(c.axisYID, acc),\n\t\tadd,\n\t\tmmt,\n\t\tref,\n\t); err != nil {\n\t\treturn err\n\t}\n\tif err = tml.SetEventOnMotionComplete(true, false); err != nil {\n\t\treturn err\n\t}\n\tfor xc, tc := false, time.After(_MTIMEOUT); !xc; {\n\t\tif _MDELAY != 0 {\n\t\t\t<-time.After(_MDELAY)\n\t\t}\n\t\tselect {\n\t\tcase <-tc:\n\t\t\txc = true\n\t\t\treturn fmt.Errorf(\"Aoztech timeout\")\n\t\tdefault:\n\t\t\tif err = tml.SelectAxis(c.axisXID); err != nil {\n\t\t\t\tlog.E(err)\n\t\t\t}\n\t\t\ttml.CheckEvent(&xc)\n\t\t}\n\t}\n\tlog.D(\"done\")\n\treturn nil\n}", "title": "" }, { "docid": "6d7e309f715aa169eab735839c9762c9", "score": "0.37551245", "text": "func (o RecorderRecordingGroupOutput) IncludeGlobalResourceTypes() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v RecorderRecordingGroup) *bool { return v.IncludeGlobalResourceTypes }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "7fcb8bc64f24f6544315985b142fe9ae", "score": "0.37467974", "text": "func UpdateRPEventType(ctx iris.Context) {\n\tvar req rpEventTypeResp\n\tif err := ctx.ReadJSON(&req.R); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Modification de type d'événement RP, décodage : \" + err.Error()})\n\t\treturn\n\t}\n\tif err := req.R.Validate(); err != nil {\n\t\tctx.StatusCode(http.StatusBadRequest)\n\t\tctx.JSON(jsonError{\"Modification de type d'événement RP : \" + err.Error()})\n\t\treturn\n\t}\n\tdb := ctx.Values().Get(\"db\").(*sql.DB)\n\tif err := req.R.Update(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Modification de type d'événement RP, requête : \" + err.Error()})\n\t\treturn\n\t}\n\tctx.StatusCode(http.StatusOK)\n\tctx.JSON(req)\n}", "title": "" }, { "docid": "06cd8a8c0a0f119574158368edd943c3", "score": "0.37443316", "text": "func (u *GithubEventUpsert) UpdateEventType() *GithubEventUpsert {\n\tu.SetExcluded(githubevent.FieldEventType)\n\treturn u\n}", "title": "" }, { "docid": "8544a69ec0917ab431fef490683c8a88", "score": "0.37429866", "text": "func AddResourceType(message *MessageAttributes) {\n\t// add resource_type by the resource_protocol\n\t// we have resource_type to allow for several types per one protocol.\n\t//\n\tmessage.ContextType = \"\"\n\tswitch message.ContextProtocol { // these are the only protocols we currently support\n\tcase \"HTTP\", \"http\":\n\t\tmessage.ContextType = \"path\"\n\tcase \"TCP\", \"tcp\":\n\t\tmessage.ContextType = \"port\"\n\t}\n}", "title": "" }, { "docid": "839159359ae649b48ab8e6d2feb9dd63", "score": "0.37424204", "text": "func AndroidDeviceOwnerVirtualHomeButtonTypePSwipeUp() *AndroidDeviceOwnerVirtualHomeButtonType {\n\tv := AndroidDeviceOwnerVirtualHomeButtonTypeVSwipeUp\n\treturn &v\n}", "title": "" }, { "docid": "81ac8f232cae2fdd2f90169e2f1c348e", "score": "0.37405148", "text": "func InputDeviceType_Values() []string {\n\treturn []string{\n\t\tInputDeviceTypeHd,\n\t\tInputDeviceTypeUhd,\n\t}\n}", "title": "" }, { "docid": "ea88b28d25128e61a1a9e6021d06ad48", "score": "0.37380317", "text": "func WithGlobalPosition(position int) EventOption {\n\tmd := map[string]interface{}{\n\t\t\"position\": position,\n\t}\n\n\treturn WithMetadata(md)\n}", "title": "" }, { "docid": "32b5bb831100594f53cd575b88f17939", "score": "0.37362373", "text": "func TypesMap() map[uint32]string {\n\treturn map[uint32]string{\n\t\t0xbc799737: \"boolFalse#bc799737\",\n\t\t0x997275b5: \"boolTrue#997275b5\",\n\t\t0x3fedd339: \"true#3fedd339\",\n\t\t0xc4b9f9bb: \"error#c4b9f9bb\",\n\t\t0x56730bcc: \"null#56730bcc\",\n\t\t0x7f3b18ea: \"inputPeerEmpty#7f3b18ea\",\n\t\t0x7da07ec9: \"inputPeerSelf#7da07ec9\",\n\t\t0x179be863: \"inputPeerChat#179be863\",\n\t\t0x7b8e7de6: \"inputPeerUser#7b8e7de6\",\n\t\t0x20adaef8: \"inputPeerChannel#20adaef8\",\n\t\t0x17bae2e6: \"inputPeerUserFromMessage#17bae2e6\",\n\t\t0x9c95f7bb: \"inputPeerChannelFromMessage#9c95f7bb\",\n\t\t0xb98886cf: \"inputUserEmpty#b98886cf\",\n\t\t0xf7c1b13f: \"inputUserSelf#f7c1b13f\",\n\t\t0xd8292816: \"inputUser#d8292816\",\n\t\t0x2d117597: \"inputUserFromMessage#2d117597\",\n\t\t0xf392b7f4: \"inputPhoneContact#f392b7f4\",\n\t\t0xf52ff27f: \"inputFile#f52ff27f\",\n\t\t0xfa4f0bb5: \"inputFileBig#fa4f0bb5\",\n\t\t0x9664f57f: \"inputMediaEmpty#9664f57f\",\n\t\t0x1e287d04: \"inputMediaUploadedPhoto#1e287d04\",\n\t\t0xb3ba0635: \"inputMediaPhoto#b3ba0635\",\n\t\t0xf9c44144: \"inputMediaGeoPoint#f9c44144\",\n\t\t0xf8ab7dfb: \"inputMediaContact#f8ab7dfb\",\n\t\t0x5b38c6c1: \"inputMediaUploadedDocument#5b38c6c1\",\n\t\t0x33473058: \"inputMediaDocument#33473058\",\n\t\t0xc13d1c11: \"inputMediaVenue#c13d1c11\",\n\t\t0xe5bbfe1a: \"inputMediaPhotoExternal#e5bbfe1a\",\n\t\t0xfb52dc99: \"inputMediaDocumentExternal#fb52dc99\",\n\t\t0xd33f43f3: \"inputMediaGame#d33f43f3\",\n\t\t0xf4e096c3: \"inputMediaInvoice#f4e096c3\",\n\t\t0x971fa843: \"inputMediaGeoLive#971fa843\",\n\t\t0xf94e5f1: \"inputMediaPoll#f94e5f1\",\n\t\t0xe66fbf7b: \"inputMediaDice#e66fbf7b\",\n\t\t0x1ca48f57: \"inputChatPhotoEmpty#1ca48f57\",\n\t\t0xc642724e: \"inputChatUploadedPhoto#c642724e\",\n\t\t0x8953ad37: \"inputChatPhoto#8953ad37\",\n\t\t0xe4c123d6: \"inputGeoPointEmpty#e4c123d6\",\n\t\t0x48222faf: \"inputGeoPoint#48222faf\",\n\t\t0x1cd7bf0d: \"inputPhotoEmpty#1cd7bf0d\",\n\t\t0x3bb3b94a: \"inputPhoto#3bb3b94a\",\n\t\t0xdfdaabe1: \"inputFileLocation#dfdaabe1\",\n\t\t0xf5235d55: \"inputEncryptedFileLocation#f5235d55\",\n\t\t0xbad07584: \"inputDocumentFileLocation#bad07584\",\n\t\t0xcbc7ee28: \"inputSecureFileLocation#cbc7ee28\",\n\t\t0x29be5899: \"inputTakeoutFileLocation#29be5899\",\n\t\t0x40181ffe: \"inputPhotoFileLocation#40181ffe\",\n\t\t0xd83466f3: \"inputPhotoLegacyFileLocation#d83466f3\",\n\t\t0x27d69997: \"inputPeerPhotoFileLocation#27d69997\",\n\t\t0xdbaeae9: \"inputStickerSetThumb#dbaeae9\",\n\t\t0x9db1bc6d: \"peerUser#9db1bc6d\",\n\t\t0xbad0e5bb: \"peerChat#bad0e5bb\",\n\t\t0xbddde532: \"peerChannel#bddde532\",\n\t\t0xaa963b05: \"storage.fileUnknown#aa963b05\",\n\t\t0x40bc6f52: \"storage.filePartial#40bc6f52\",\n\t\t0x7efe0e: \"storage.fileJpeg#7efe0e\",\n\t\t0xcae1aadf: \"storage.fileGif#cae1aadf\",\n\t\t0xa4f63c0: \"storage.filePng#a4f63c0\",\n\t\t0xae1e508d: \"storage.filePdf#ae1e508d\",\n\t\t0x528a0677: \"storage.fileMp3#528a0677\",\n\t\t0x4b09ebbc: \"storage.fileMov#4b09ebbc\",\n\t\t0xb3cea0e4: \"storage.fileMp4#b3cea0e4\",\n\t\t0x1081464c: \"storage.fileWebp#1081464c\",\n\t\t0x200250ba: \"userEmpty#200250ba\",\n\t\t0x938458c1: \"user#938458c1\",\n\t\t0x4f11bae1: \"userProfilePhotoEmpty#4f11bae1\",\n\t\t0x69d3ab26: \"userProfilePhoto#69d3ab26\",\n\t\t0x9d05049: \"userStatusEmpty#9d05049\",\n\t\t0xedb93949: \"userStatusOnline#edb93949\",\n\t\t0x8c703f: \"userStatusOffline#8c703f\",\n\t\t0xe26f42f1: \"userStatusRecently#e26f42f1\",\n\t\t0x7bf09fc: \"userStatusLastWeek#7bf09fc\",\n\t\t0x77ebc742: \"userStatusLastMonth#77ebc742\",\n\t\t0x9ba2d800: \"chatEmpty#9ba2d800\",\n\t\t0x3bda1bde: \"chat#3bda1bde\",\n\t\t0x7328bdb: \"chatForbidden#7328bdb\",\n\t\t0xd31a961e: \"channel#d31a961e\",\n\t\t0x289da732: \"channelForbidden#289da732\",\n\t\t0xdc8c181: \"chatFull#dc8c181\",\n\t\t0xef3a6acd: \"channelFull#ef3a6acd\",\n\t\t0xc8d7493e: \"chatParticipant#c8d7493e\",\n\t\t0xda13538a: \"chatParticipantCreator#da13538a\",\n\t\t0xe2d6e436: \"chatParticipantAdmin#e2d6e436\",\n\t\t0xfc900c2b: \"chatParticipantsForbidden#fc900c2b\",\n\t\t0x3f460fed: \"chatParticipants#3f460fed\",\n\t\t0x37c1011c: \"chatPhotoEmpty#37c1011c\",\n\t\t0xd20b9f3c: \"chatPhoto#d20b9f3c\",\n\t\t0x83e5de54: \"messageEmpty#83e5de54\",\n\t\t0x58ae39c9: \"message#58ae39c9\",\n\t\t0x286fa604: \"messageService#286fa604\",\n\t\t0x3ded6320: \"messageMediaEmpty#3ded6320\",\n\t\t0x695150d7: \"messageMediaPhoto#695150d7\",\n\t\t0x56e0d474: \"messageMediaGeo#56e0d474\",\n\t\t0xcbf24940: \"messageMediaContact#cbf24940\",\n\t\t0x9f84f49e: \"messageMediaUnsupported#9f84f49e\",\n\t\t0x9cb070d7: \"messageMediaDocument#9cb070d7\",\n\t\t0xa32dd600: \"messageMediaWebPage#a32dd600\",\n\t\t0x2ec0533f: \"messageMediaVenue#2ec0533f\",\n\t\t0xfdb19008: \"messageMediaGame#fdb19008\",\n\t\t0x84551347: \"messageMediaInvoice#84551347\",\n\t\t0xb940c666: \"messageMediaGeoLive#b940c666\",\n\t\t0x4bd6e798: \"messageMediaPoll#4bd6e798\",\n\t\t0x3f7ee58b: \"messageMediaDice#3f7ee58b\",\n\t\t0xb6aef7b0: \"messageActionEmpty#b6aef7b0\",\n\t\t0xa6638b9a: \"messageActionChatCreate#a6638b9a\",\n\t\t0xb5a1ce5a: \"messageActionChatEditTitle#b5a1ce5a\",\n\t\t0x7fcb13a8: \"messageActionChatEditPhoto#7fcb13a8\",\n\t\t0x95e3fbef: \"messageActionChatDeletePhoto#95e3fbef\",\n\t\t0x488a7337: \"messageActionChatAddUser#488a7337\",\n\t\t0xb2ae9b0c: \"messageActionChatDeleteUser#b2ae9b0c\",\n\t\t0xf89cf5e8: \"messageActionChatJoinedByLink#f89cf5e8\",\n\t\t0x95d2ac92: \"messageActionChannelCreate#95d2ac92\",\n\t\t0x51bdb021: \"messageActionChatMigrateTo#51bdb021\",\n\t\t0xb055eaee: \"messageActionChannelMigrateFrom#b055eaee\",\n\t\t0x94bd38ed: \"messageActionPinMessage#94bd38ed\",\n\t\t0x9fbab604: \"messageActionHistoryClear#9fbab604\",\n\t\t0x92a72876: \"messageActionGameScore#92a72876\",\n\t\t0x8f31b327: \"messageActionPaymentSentMe#8f31b327\",\n\t\t0x40699cd0: \"messageActionPaymentSent#40699cd0\",\n\t\t0x80e11a7f: \"messageActionPhoneCall#80e11a7f\",\n\t\t0x4792929b: \"messageActionScreenshotTaken#4792929b\",\n\t\t0xfae69f56: \"messageActionCustomAction#fae69f56\",\n\t\t0xabe9affe: \"messageActionBotAllowed#abe9affe\",\n\t\t0x1b287353: \"messageActionSecureValuesSentMe#1b287353\",\n\t\t0xd95c6154: \"messageActionSecureValuesSent#d95c6154\",\n\t\t0xf3f25f76: \"messageActionContactSignUp#f3f25f76\",\n\t\t0x98e0d697: \"messageActionGeoProximityReached#98e0d697\",\n\t\t0x7a0d7f42: \"messageActionGroupCall#7a0d7f42\",\n\t\t0x76b9f11a: \"messageActionInviteToGroupCall#76b9f11a\",\n\t\t0x2c171f72: \"dialog#2c171f72\",\n\t\t0x71bd134c: \"dialogFolder#71bd134c\",\n\t\t0x2331b22d: \"photoEmpty#2331b22d\",\n\t\t0xfb197a65: \"photo#fb197a65\",\n\t\t0xe17e23c: \"photoSizeEmpty#e17e23c\",\n\t\t0x77bfb61b: \"photoSize#77bfb61b\",\n\t\t0xe9a734fa: \"photoCachedSize#e9a734fa\",\n\t\t0xe0b0bc2e: \"photoStrippedSize#e0b0bc2e\",\n\t\t0x5aa86a51: \"photoSizeProgressive#5aa86a51\",\n\t\t0xd8214d41: \"photoPathSize#d8214d41\",\n\t\t0x1117dd5f: \"geoPointEmpty#1117dd5f\",\n\t\t0xb2a2f663: \"geoPoint#b2a2f663\",\n\t\t0x5e002502: \"auth.sentCode#5e002502\",\n\t\t0xcd050916: \"auth.authorization#cd050916\",\n\t\t0x44747e9a: \"auth.authorizationSignUpRequired#44747e9a\",\n\t\t0xdf969c2d: \"auth.exportedAuthorization#df969c2d\",\n\t\t0xb8bc5b0c: \"inputNotifyPeer#b8bc5b0c\",\n\t\t0x193b4417: \"inputNotifyUsers#193b4417\",\n\t\t0x4a95e84e: \"inputNotifyChats#4a95e84e\",\n\t\t0xb1db7c7e: \"inputNotifyBroadcasts#b1db7c7e\",\n\t\t0x9c3d198e: \"inputPeerNotifySettings#9c3d198e\",\n\t\t0xaf509d20: \"peerNotifySettings#af509d20\",\n\t\t0x733f2961: \"peerSettings#733f2961\",\n\t\t0xa437c3ed: \"wallPaper#a437c3ed\",\n\t\t0x8af40b25: \"wallPaperNoFile#8af40b25\",\n\t\t0x58dbcab8: \"inputReportReasonSpam#58dbcab8\",\n\t\t0x1e22c78d: \"inputReportReasonViolence#1e22c78d\",\n\t\t0x2e59d922: \"inputReportReasonPornography#2e59d922\",\n\t\t0xadf44ee3: \"inputReportReasonChildAbuse#adf44ee3\",\n\t\t0xe1746d0a: \"inputReportReasonOther#e1746d0a\",\n\t\t0x9b89f93a: \"inputReportReasonCopyright#9b89f93a\",\n\t\t0xdbd4feed: \"inputReportReasonGeoIrrelevant#dbd4feed\",\n\t\t0xedf17c12: \"userFull#edf17c12\",\n\t\t0xf911c994: \"contact#f911c994\",\n\t\t0xd0028438: \"importedContact#d0028438\",\n\t\t0xd3680c61: \"contactStatus#d3680c61\",\n\t\t0xb74ba9d2: \"contacts.contactsNotModified#b74ba9d2\",\n\t\t0xeae87e42: \"contacts.contacts#eae87e42\",\n\t\t0x77d01c3b: \"contacts.importedContacts#77d01c3b\",\n\t\t0xade1591: \"contacts.blocked#ade1591\",\n\t\t0xe1664194: \"contacts.blockedSlice#e1664194\",\n\t\t0x15ba6c40: \"messages.dialogs#15ba6c40\",\n\t\t0x71e094f3: \"messages.dialogsSlice#71e094f3\",\n\t\t0xf0e3e596: \"messages.dialogsNotModified#f0e3e596\",\n\t\t0x8c718e87: \"messages.messages#8c718e87\",\n\t\t0x3a54685e: \"messages.messagesSlice#3a54685e\",\n\t\t0x64479808: \"messages.channelMessages#64479808\",\n\t\t0x74535f21: \"messages.messagesNotModified#74535f21\",\n\t\t0x64ff9fd5: \"messages.chats#64ff9fd5\",\n\t\t0x9cd81144: \"messages.chatsSlice#9cd81144\",\n\t\t0xe5d7d19c: \"messages.chatFull#e5d7d19c\",\n\t\t0xb45c69d1: \"messages.affectedHistory#b45c69d1\",\n\t\t0x57e2f66c: \"inputMessagesFilterEmpty#57e2f66c\",\n\t\t0x9609a51c: \"inputMessagesFilterPhotos#9609a51c\",\n\t\t0x9fc00e65: \"inputMessagesFilterVideo#9fc00e65\",\n\t\t0x56e9f0e4: \"inputMessagesFilterPhotoVideo#56e9f0e4\",\n\t\t0x9eddf188: \"inputMessagesFilterDocument#9eddf188\",\n\t\t0x7ef0dd87: \"inputMessagesFilterUrl#7ef0dd87\",\n\t\t0xffc86587: \"inputMessagesFilterGif#ffc86587\",\n\t\t0x50f5c392: \"inputMessagesFilterVoice#50f5c392\",\n\t\t0x3751b49e: \"inputMessagesFilterMusic#3751b49e\",\n\t\t0x3a20ecb8: \"inputMessagesFilterChatPhotos#3a20ecb8\",\n\t\t0x80c99768: \"inputMessagesFilterPhoneCalls#80c99768\",\n\t\t0x7a7c17a4: \"inputMessagesFilterRoundVoice#7a7c17a4\",\n\t\t0xb549da53: \"inputMessagesFilterRoundVideo#b549da53\",\n\t\t0xc1f8e69a: \"inputMessagesFilterMyMentions#c1f8e69a\",\n\t\t0xe7026d0d: \"inputMessagesFilterGeo#e7026d0d\",\n\t\t0xe062db83: \"inputMessagesFilterContacts#e062db83\",\n\t\t0x1bb00451: \"inputMessagesFilterPinned#1bb00451\",\n\t\t0x1f2b0afd: \"updateNewMessage#1f2b0afd\",\n\t\t0x4e90bfd6: \"updateMessageID#4e90bfd6\",\n\t\t0xa20db0e5: \"updateDeleteMessages#a20db0e5\",\n\t\t0x5c486927: \"updateUserTyping#5c486927\",\n\t\t0x9a65ea1f: \"updateChatUserTyping#9a65ea1f\",\n\t\t0x7761198: \"updateChatParticipants#7761198\",\n\t\t0x1bfbd823: \"updateUserStatus#1bfbd823\",\n\t\t0xa7332b73: \"updateUserName#a7332b73\",\n\t\t0x95313b0c: \"updateUserPhoto#95313b0c\",\n\t\t0x12bcbd9a: \"updateNewEncryptedMessage#12bcbd9a\",\n\t\t0x1710f156: \"updateEncryptedChatTyping#1710f156\",\n\t\t0xb4a2e88d: \"updateEncryption#b4a2e88d\",\n\t\t0x38fe25b7: \"updateEncryptedMessagesRead#38fe25b7\",\n\t\t0xea4b0e5c: \"updateChatParticipantAdd#ea4b0e5c\",\n\t\t0x6e5f8c22: \"updateChatParticipantDelete#6e5f8c22\",\n\t\t0x8e5e9873: \"updateDcOptions#8e5e9873\",\n\t\t0xbec268ef: \"updateNotifySettings#bec268ef\",\n\t\t0xebe46819: \"updateServiceNotification#ebe46819\",\n\t\t0xee3b272a: \"updatePrivacy#ee3b272a\",\n\t\t0x12b9417b: \"updateUserPhone#12b9417b\",\n\t\t0x9c974fdf: \"updateReadHistoryInbox#9c974fdf\",\n\t\t0x2f2f21bf: \"updateReadHistoryOutbox#2f2f21bf\",\n\t\t0x7f891213: \"updateWebPage#7f891213\",\n\t\t0x68c13933: \"updateReadMessagesContents#68c13933\",\n\t\t0xeb0467fb: \"updateChannelTooLong#eb0467fb\",\n\t\t0xb6d45656: \"updateChannel#b6d45656\",\n\t\t0x62ba04d9: \"updateNewChannelMessage#62ba04d9\",\n\t\t0x330b5424: \"updateReadChannelInbox#330b5424\",\n\t\t0xc37521c9: \"updateDeleteChannelMessages#c37521c9\",\n\t\t0x98a12b4b: \"updateChannelMessageViews#98a12b4b\",\n\t\t0xb6901959: \"updateChatParticipantAdmin#b6901959\",\n\t\t0x688a30aa: \"updateNewStickerSet#688a30aa\",\n\t\t0xbb2d201: \"updateStickerSetsOrder#bb2d201\",\n\t\t0x43ae3dec: \"updateStickerSets#43ae3dec\",\n\t\t0x9375341e: \"updateSavedGifs#9375341e\",\n\t\t0x3f2038db: \"updateBotInlineQuery#3f2038db\",\n\t\t0xe48f964: \"updateBotInlineSend#e48f964\",\n\t\t0x1b3f4df7: \"updateEditChannelMessage#1b3f4df7\",\n\t\t0xe73547e1: \"updateBotCallbackQuery#e73547e1\",\n\t\t0xe40370a3: \"updateEditMessage#e40370a3\",\n\t\t0xf9d27a5a: \"updateInlineBotCallbackQuery#f9d27a5a\",\n\t\t0x25d6c9c7: \"updateReadChannelOutbox#25d6c9c7\",\n\t\t0xee2bb969: \"updateDraftMessage#ee2bb969\",\n\t\t0x571d2742: \"updateReadFeaturedStickers#571d2742\",\n\t\t0x9a422c20: \"updateRecentStickers#9a422c20\",\n\t\t0xa229dd06: \"updateConfig#a229dd06\",\n\t\t0x3354678f: \"updatePtsChanged#3354678f\",\n\t\t0x40771900: \"updateChannelWebPage#40771900\",\n\t\t0x6e6fe51c: \"updateDialogPinned#6e6fe51c\",\n\t\t0xfa0f3ca2: \"updatePinnedDialogs#fa0f3ca2\",\n\t\t0x8317c0c3: \"updateBotWebhookJSON#8317c0c3\",\n\t\t0x9b9240a6: \"updateBotWebhookJSONQuery#9b9240a6\",\n\t\t0xe0cdc940: \"updateBotShippingQuery#e0cdc940\",\n\t\t0x5d2f3aa9: \"updateBotPrecheckoutQuery#5d2f3aa9\",\n\t\t0xab0f6b1e: \"updatePhoneCall#ab0f6b1e\",\n\t\t0x46560264: \"updateLangPackTooLong#46560264\",\n\t\t0x56022f4d: \"updateLangPack#56022f4d\",\n\t\t0xe511996d: \"updateFavedStickers#e511996d\",\n\t\t0x89893b45: \"updateChannelReadMessagesContents#89893b45\",\n\t\t0x7084a7be: \"updateContactsReset#7084a7be\",\n\t\t0x70db6837: \"updateChannelAvailableMessages#70db6837\",\n\t\t0xe16459c3: \"updateDialogUnreadMark#e16459c3\",\n\t\t0xaca1657b: \"updateMessagePoll#aca1657b\",\n\t\t0x54c01850: \"updateChatDefaultBannedRights#54c01850\",\n\t\t0x19360dc0: \"updateFolderPeers#19360dc0\",\n\t\t0x6a7e7366: \"updatePeerSettings#6a7e7366\",\n\t\t0xb4afcfb0: \"updatePeerLocated#b4afcfb0\",\n\t\t0x39a51dfb: \"updateNewScheduledMessage#39a51dfb\",\n\t\t0x90866cee: \"updateDeleteScheduledMessages#90866cee\",\n\t\t0x8216fba3: \"updateTheme#8216fba3\",\n\t\t0x871fb939: \"updateGeoLiveViewed#871fb939\",\n\t\t0x564fe691: \"updateLoginToken#564fe691\",\n\t\t0x42f88f2c: \"updateMessagePollVote#42f88f2c\",\n\t\t0x26ffde7d: \"updateDialogFilter#26ffde7d\",\n\t\t0xa5d72105: \"updateDialogFilterOrder#a5d72105\",\n\t\t0x3504914f: \"updateDialogFilters#3504914f\",\n\t\t0x2661bf09: \"updatePhoneCallSignalingData#2661bf09\",\n\t\t0x65d2b464: \"updateChannelParticipant#65d2b464\",\n\t\t0x6e8a84df: \"updateChannelMessageForwards#6e8a84df\",\n\t\t0x1cc7de54: \"updateReadChannelDiscussionInbox#1cc7de54\",\n\t\t0x4638a26c: \"updateReadChannelDiscussionOutbox#4638a26c\",\n\t\t0x246a4b22: \"updatePeerBlocked#246a4b22\",\n\t\t0xff2abe9f: \"updateChannelUserTyping#ff2abe9f\",\n\t\t0xed85eab5: \"updatePinnedMessages#ed85eab5\",\n\t\t0x8588878b: \"updatePinnedChannelMessages#8588878b\",\n\t\t0x1330a196: \"updateChat#1330a196\",\n\t\t0xf2ebdb4e: \"updateGroupCallParticipants#f2ebdb4e\",\n\t\t0xa45eb99b: \"updateGroupCall#a45eb99b\",\n\t\t0xa56c2a3e: \"updates.state#a56c2a3e\",\n\t\t0x5d75a138: \"updates.differenceEmpty#5d75a138\",\n\t\t0xf49ca0: \"updates.difference#f49ca0\",\n\t\t0xa8fb1981: \"updates.differenceSlice#a8fb1981\",\n\t\t0x4afe8f6d: \"updates.differenceTooLong#4afe8f6d\",\n\t\t0xe317af7e: \"updatesTooLong#e317af7e\",\n\t\t0x2296d2c8: \"updateShortMessage#2296d2c8\",\n\t\t0x402d5dbb: \"updateShortChatMessage#402d5dbb\",\n\t\t0x78d4dec1: \"updateShort#78d4dec1\",\n\t\t0x725b04c3: \"updatesCombined#725b04c3\",\n\t\t0x74ae4240: \"updates#74ae4240\",\n\t\t0x11f1331c: \"updateShortSentMessage#11f1331c\",\n\t\t0x8dca6aa5: \"photos.photos#8dca6aa5\",\n\t\t0x15051f54: \"photos.photosSlice#15051f54\",\n\t\t0x20212ca8: \"photos.photo#20212ca8\",\n\t\t0x96a18d5: \"upload.file#96a18d5\",\n\t\t0xf18cda44: \"upload.fileCdnRedirect#f18cda44\",\n\t\t0x18b7a10d: \"dcOption#18b7a10d\",\n\t\t0x330b4067: \"config#330b4067\",\n\t\t0x8e1a1775: \"nearestDc#8e1a1775\",\n\t\t0x1da7158f: \"help.appUpdate#1da7158f\",\n\t\t0xc45a6536: \"help.noAppUpdate#c45a6536\",\n\t\t0x18cb9f78: \"help.inviteText#18cb9f78\",\n\t\t0xab7ec0a0: \"encryptedChatEmpty#ab7ec0a0\",\n\t\t0x3bf703dc: \"encryptedChatWaiting#3bf703dc\",\n\t\t0x62718a82: \"encryptedChatRequested#62718a82\",\n\t\t0xfa56ce36: \"encryptedChat#fa56ce36\",\n\t\t0x13d6dd27: \"encryptedChatDiscarded#13d6dd27\",\n\t\t0xf141b5e1: \"inputEncryptedChat#f141b5e1\",\n\t\t0xc21f497e: \"encryptedFileEmpty#c21f497e\",\n\t\t0x4a70994c: \"encryptedFile#4a70994c\",\n\t\t0x1837c364: \"inputEncryptedFileEmpty#1837c364\",\n\t\t0x64bd0306: \"inputEncryptedFileUploaded#64bd0306\",\n\t\t0x5a17b5e5: \"inputEncryptedFile#5a17b5e5\",\n\t\t0x2dc173c8: \"inputEncryptedFileBigUploaded#2dc173c8\",\n\t\t0xed18c118: \"encryptedMessage#ed18c118\",\n\t\t0x23734b06: \"encryptedMessageService#23734b06\",\n\t\t0xc0e24635: \"messages.dhConfigNotModified#c0e24635\",\n\t\t0x2c221edd: \"messages.dhConfig#2c221edd\",\n\t\t0x560f8935: \"messages.sentEncryptedMessage#560f8935\",\n\t\t0x9493ff32: \"messages.sentEncryptedFile#9493ff32\",\n\t\t0x72f0eaae: \"inputDocumentEmpty#72f0eaae\",\n\t\t0x1abfb575: \"inputDocument#1abfb575\",\n\t\t0x36f8c871: \"documentEmpty#36f8c871\",\n\t\t0x1e87342b: \"document#1e87342b\",\n\t\t0x17c6b5f6: \"help.support#17c6b5f6\",\n\t\t0x9fd40bd8: \"notifyPeer#9fd40bd8\",\n\t\t0xb4c83b4c: \"notifyUsers#b4c83b4c\",\n\t\t0xc007cec3: \"notifyChats#c007cec3\",\n\t\t0xd612e8ef: \"notifyBroadcasts#d612e8ef\",\n\t\t0x16bf744e: \"sendMessageTypingAction#16bf744e\",\n\t\t0xfd5ec8f5: \"sendMessageCancelAction#fd5ec8f5\",\n\t\t0xa187d66f: \"sendMessageRecordVideoAction#a187d66f\",\n\t\t0xe9763aec: \"sendMessageUploadVideoAction#e9763aec\",\n\t\t0xd52f73f7: \"sendMessageRecordAudioAction#d52f73f7\",\n\t\t0xf351d7ab: \"sendMessageUploadAudioAction#f351d7ab\",\n\t\t0xd1d34a26: \"sendMessageUploadPhotoAction#d1d34a26\",\n\t\t0xaa0cd9e4: \"sendMessageUploadDocumentAction#aa0cd9e4\",\n\t\t0x176f8ba1: \"sendMessageGeoLocationAction#176f8ba1\",\n\t\t0x628cbc6f: \"sendMessageChooseContactAction#628cbc6f\",\n\t\t0xdd6a8f48: \"sendMessageGamePlayAction#dd6a8f48\",\n\t\t0x88f27fbc: \"sendMessageRecordRoundAction#88f27fbc\",\n\t\t0x243e1c66: \"sendMessageUploadRoundAction#243e1c66\",\n\t\t0xd92c2285: \"speakingInGroupCallAction#d92c2285\",\n\t\t0xb3134d9d: \"contacts.found#b3134d9d\",\n\t\t0x4f96cb18: \"inputPrivacyKeyStatusTimestamp#4f96cb18\",\n\t\t0xbdfb0426: \"inputPrivacyKeyChatInvite#bdfb0426\",\n\t\t0xfabadc5f: \"inputPrivacyKeyPhoneCall#fabadc5f\",\n\t\t0xdb9e70d2: \"inputPrivacyKeyPhoneP2P#db9e70d2\",\n\t\t0xa4dd4c08: \"inputPrivacyKeyForwards#a4dd4c08\",\n\t\t0x5719bacc: \"inputPrivacyKeyProfilePhoto#5719bacc\",\n\t\t0x352dafa: \"inputPrivacyKeyPhoneNumber#352dafa\",\n\t\t0xd1219bdd: \"inputPrivacyKeyAddedByPhone#d1219bdd\",\n\t\t0xbc2eab30: \"privacyKeyStatusTimestamp#bc2eab30\",\n\t\t0x500e6dfa: \"privacyKeyChatInvite#500e6dfa\",\n\t\t0x3d662b7b: \"privacyKeyPhoneCall#3d662b7b\",\n\t\t0x39491cc8: \"privacyKeyPhoneP2P#39491cc8\",\n\t\t0x69ec56a3: \"privacyKeyForwards#69ec56a3\",\n\t\t0x96151fed: \"privacyKeyProfilePhoto#96151fed\",\n\t\t0xd19ae46d: \"privacyKeyPhoneNumber#d19ae46d\",\n\t\t0x42ffd42b: \"privacyKeyAddedByPhone#42ffd42b\",\n\t\t0xd09e07b: \"inputPrivacyValueAllowContacts#d09e07b\",\n\t\t0x184b35ce: \"inputPrivacyValueAllowAll#184b35ce\",\n\t\t0x131cc67f: \"inputPrivacyValueAllowUsers#131cc67f\",\n\t\t0xba52007: \"inputPrivacyValueDisallowContacts#ba52007\",\n\t\t0xd66b66c9: \"inputPrivacyValueDisallowAll#d66b66c9\",\n\t\t0x90110467: \"inputPrivacyValueDisallowUsers#90110467\",\n\t\t0x4c81c1ba: \"inputPrivacyValueAllowChatParticipants#4c81c1ba\",\n\t\t0xd82363af: \"inputPrivacyValueDisallowChatParticipants#d82363af\",\n\t\t0xfffe1bac: \"privacyValueAllowContacts#fffe1bac\",\n\t\t0x65427b82: \"privacyValueAllowAll#65427b82\",\n\t\t0x4d5bbe0c: \"privacyValueAllowUsers#4d5bbe0c\",\n\t\t0xf888fa1a: \"privacyValueDisallowContacts#f888fa1a\",\n\t\t0x8b73e763: \"privacyValueDisallowAll#8b73e763\",\n\t\t0xc7f49b7: \"privacyValueDisallowUsers#c7f49b7\",\n\t\t0x18be796b: \"privacyValueAllowChatParticipants#18be796b\",\n\t\t0xacae0690: \"privacyValueDisallowChatParticipants#acae0690\",\n\t\t0x50a04e45: \"account.privacyRules#50a04e45\",\n\t\t0xb8d0afdf: \"accountDaysTTL#b8d0afdf\",\n\t\t0x6c37c15c: \"documentAttributeImageSize#6c37c15c\",\n\t\t0x11b58939: \"documentAttributeAnimated#11b58939\",\n\t\t0x6319d612: \"documentAttributeSticker#6319d612\",\n\t\t0xef02ce6: \"documentAttributeVideo#ef02ce6\",\n\t\t0x9852f9c6: \"documentAttributeAudio#9852f9c6\",\n\t\t0x15590068: \"documentAttributeFilename#15590068\",\n\t\t0x9801d2f7: \"documentAttributeHasStickers#9801d2f7\",\n\t\t0xf1749a22: \"messages.stickersNotModified#f1749a22\",\n\t\t0xe4599bbd: \"messages.stickers#e4599bbd\",\n\t\t0x12b299d4: \"stickerPack#12b299d4\",\n\t\t0xe86602c3: \"messages.allStickersNotModified#e86602c3\",\n\t\t0xedfd405f: \"messages.allStickers#edfd405f\",\n\t\t0x84d19185: \"messages.affectedMessages#84d19185\",\n\t\t0xeb1477e8: \"webPageEmpty#eb1477e8\",\n\t\t0xc586da1c: \"webPagePending#c586da1c\",\n\t\t0xe89c45b2: \"webPage#e89c45b2\",\n\t\t0x7311ca11: \"webPageNotModified#7311ca11\",\n\t\t0xad01d61d: \"authorization#ad01d61d\",\n\t\t0x1250abde: \"account.authorizations#1250abde\",\n\t\t0xad2641f8: \"account.password#ad2641f8\",\n\t\t0x9a5c33e5: \"account.passwordSettings#9a5c33e5\",\n\t\t0xc23727c9: \"account.passwordInputSettings#c23727c9\",\n\t\t0x137948a5: \"auth.passwordRecovery#137948a5\",\n\t\t0xa384b779: \"receivedNotifyMessage#a384b779\",\n\t\t0x69df3769: \"chatInviteEmpty#69df3769\",\n\t\t0xfc2e05bc: \"chatInviteExported#fc2e05bc\",\n\t\t0x5a686d7c: \"chatInviteAlready#5a686d7c\",\n\t\t0xdfc2f58e: \"chatInvite#dfc2f58e\",\n\t\t0x61695cb0: \"chatInvitePeek#61695cb0\",\n\t\t0xffb62b95: \"inputStickerSetEmpty#ffb62b95\",\n\t\t0x9de7a269: \"inputStickerSetID#9de7a269\",\n\t\t0x861cc8a0: \"inputStickerSetShortName#861cc8a0\",\n\t\t0x28703c8: \"inputStickerSetAnimatedEmoji#28703c8\",\n\t\t0xe67f520e: \"inputStickerSetDice#e67f520e\",\n\t\t0x40e237a8: \"stickerSet#40e237a8\",\n\t\t0xb60a24a6: \"messages.stickerSet#b60a24a6\",\n\t\t0xc27ac8c7: \"botCommand#c27ac8c7\",\n\t\t0x98e81d3a: \"botInfo#98e81d3a\",\n\t\t0xa2fa4880: \"keyboardButton#a2fa4880\",\n\t\t0x258aff05: \"keyboardButtonUrl#258aff05\",\n\t\t0x35bbdb6b: \"keyboardButtonCallback#35bbdb6b\",\n\t\t0xb16a6c29: \"keyboardButtonRequestPhone#b16a6c29\",\n\t\t0xfc796b3f: \"keyboardButtonRequestGeoLocation#fc796b3f\",\n\t\t0x568a748: \"keyboardButtonSwitchInline#568a748\",\n\t\t0x50f41ccf: \"keyboardButtonGame#50f41ccf\",\n\t\t0xafd93fbb: \"keyboardButtonBuy#afd93fbb\",\n\t\t0x10b78d29: \"keyboardButtonUrlAuth#10b78d29\",\n\t\t0xd02e7fd4: \"inputKeyboardButtonUrlAuth#d02e7fd4\",\n\t\t0xbbc7515d: \"keyboardButtonRequestPoll#bbc7515d\",\n\t\t0x77608b83: \"keyboardButtonRow#77608b83\",\n\t\t0xa03e5b85: \"replyKeyboardHide#a03e5b85\",\n\t\t0xf4108aa0: \"replyKeyboardForceReply#f4108aa0\",\n\t\t0x3502758c: \"replyKeyboardMarkup#3502758c\",\n\t\t0x48a30254: \"replyInlineMarkup#48a30254\",\n\t\t0xbb92ba95: \"messageEntityUnknown#bb92ba95\",\n\t\t0xfa04579d: \"messageEntityMention#fa04579d\",\n\t\t0x6f635b0d: \"messageEntityHashtag#6f635b0d\",\n\t\t0x6cef8ac7: \"messageEntityBotCommand#6cef8ac7\",\n\t\t0x6ed02538: \"messageEntityUrl#6ed02538\",\n\t\t0x64e475c2: \"messageEntityEmail#64e475c2\",\n\t\t0xbd610bc9: \"messageEntityBold#bd610bc9\",\n\t\t0x826f8b60: \"messageEntityItalic#826f8b60\",\n\t\t0x28a20571: \"messageEntityCode#28a20571\",\n\t\t0x73924be0: \"messageEntityPre#73924be0\",\n\t\t0x76a6d327: \"messageEntityTextUrl#76a6d327\",\n\t\t0x352dca58: \"messageEntityMentionName#352dca58\",\n\t\t0x208e68c9: \"inputMessageEntityMentionName#208e68c9\",\n\t\t0x9b69e34b: \"messageEntityPhone#9b69e34b\",\n\t\t0x4c4e743f: \"messageEntityCashtag#4c4e743f\",\n\t\t0x9c4e7e8b: \"messageEntityUnderline#9c4e7e8b\",\n\t\t0xbf0693d4: \"messageEntityStrike#bf0693d4\",\n\t\t0x20df5d0: \"messageEntityBlockquote#20df5d0\",\n\t\t0x761e6af4: \"messageEntityBankCard#761e6af4\",\n\t\t0xee8c1e86: \"inputChannelEmpty#ee8c1e86\",\n\t\t0xafeb712e: \"inputChannel#afeb712e\",\n\t\t0x2a286531: \"inputChannelFromMessage#2a286531\",\n\t\t0x7f077ad9: \"contacts.resolvedPeer#7f077ad9\",\n\t\t0xae30253: \"messageRange#ae30253\",\n\t\t0x3e11affb: \"updates.channelDifferenceEmpty#3e11affb\",\n\t\t0xa4bcc6fe: \"updates.channelDifferenceTooLong#a4bcc6fe\",\n\t\t0x2064674e: \"updates.channelDifference#2064674e\",\n\t\t0x94d42ee7: \"channelMessagesFilterEmpty#94d42ee7\",\n\t\t0xcd77d957: \"channelMessagesFilter#cd77d957\",\n\t\t0x15ebac1d: \"channelParticipant#15ebac1d\",\n\t\t0xa3289a6d: \"channelParticipantSelf#a3289a6d\",\n\t\t0x447dca4b: \"channelParticipantCreator#447dca4b\",\n\t\t0xccbebbaf: \"channelParticipantAdmin#ccbebbaf\",\n\t\t0x1c0facaf: \"channelParticipantBanned#1c0facaf\",\n\t\t0xc3c6796b: \"channelParticipantLeft#c3c6796b\",\n\t\t0xde3f3c79: \"channelParticipantsRecent#de3f3c79\",\n\t\t0xb4608969: \"channelParticipantsAdmins#b4608969\",\n\t\t0xa3b54985: \"channelParticipantsKicked#a3b54985\",\n\t\t0xb0d1865b: \"channelParticipantsBots#b0d1865b\",\n\t\t0x1427a5e1: \"channelParticipantsBanned#1427a5e1\",\n\t\t0x656ac4b: \"channelParticipantsSearch#656ac4b\",\n\t\t0xbb6ae88d: \"channelParticipantsContacts#bb6ae88d\",\n\t\t0xe04b5ceb: \"channelParticipantsMentions#e04b5ceb\",\n\t\t0xf56ee2a8: \"channels.channelParticipants#f56ee2a8\",\n\t\t0xf0173fe9: \"channels.channelParticipantsNotModified#f0173fe9\",\n\t\t0xd0d9b163: \"channels.channelParticipant#d0d9b163\",\n\t\t0x780a0310: \"help.termsOfService#780a0310\",\n\t\t0xe8025ca2: \"messages.savedGifsNotModified#e8025ca2\",\n\t\t0x2e0709a5: \"messages.savedGifs#2e0709a5\",\n\t\t0x3380c786: \"inputBotInlineMessageMediaAuto#3380c786\",\n\t\t0x3dcd7a87: \"inputBotInlineMessageText#3dcd7a87\",\n\t\t0x96929a85: \"inputBotInlineMessageMediaGeo#96929a85\",\n\t\t0x417bbf11: \"inputBotInlineMessageMediaVenue#417bbf11\",\n\t\t0xa6edbffd: \"inputBotInlineMessageMediaContact#a6edbffd\",\n\t\t0x4b425864: \"inputBotInlineMessageGame#4b425864\",\n\t\t0x88bf9319: \"inputBotInlineResult#88bf9319\",\n\t\t0xa8d864a7: \"inputBotInlineResultPhoto#a8d864a7\",\n\t\t0xfff8fdc4: \"inputBotInlineResultDocument#fff8fdc4\",\n\t\t0x4fa417f2: \"inputBotInlineResultGame#4fa417f2\",\n\t\t0x764cf810: \"botInlineMessageMediaAuto#764cf810\",\n\t\t0x8c7f65e2: \"botInlineMessageText#8c7f65e2\",\n\t\t0x51846fd: \"botInlineMessageMediaGeo#51846fd\",\n\t\t0x8a86659c: \"botInlineMessageMediaVenue#8a86659c\",\n\t\t0x18d1cdc2: \"botInlineMessageMediaContact#18d1cdc2\",\n\t\t0x11965f3a: \"botInlineResult#11965f3a\",\n\t\t0x17db940b: \"botInlineMediaResult#17db940b\",\n\t\t0x947ca848: \"messages.botResults#947ca848\",\n\t\t0x5dab1af4: \"exportedMessageLink#5dab1af4\",\n\t\t0x5f777dce: \"messageFwdHeader#5f777dce\",\n\t\t0x72a3158c: \"auth.codeTypeSms#72a3158c\",\n\t\t0x741cd3e3: \"auth.codeTypeCall#741cd3e3\",\n\t\t0x226ccefb: \"auth.codeTypeFlashCall#226ccefb\",\n\t\t0x3dbb5986: \"auth.sentCodeTypeApp#3dbb5986\",\n\t\t0xc000bba2: \"auth.sentCodeTypeSms#c000bba2\",\n\t\t0x5353e5a7: \"auth.sentCodeTypeCall#5353e5a7\",\n\t\t0xab03c6d9: \"auth.sentCodeTypeFlashCall#ab03c6d9\",\n\t\t0x36585ea4: \"messages.botCallbackAnswer#36585ea4\",\n\t\t0x26b5dde6: \"messages.messageEditData#26b5dde6\",\n\t\t0x890c3d89: \"inputBotInlineMessageID#890c3d89\",\n\t\t0x3c20629f: \"inlineBotSwitchPM#3c20629f\",\n\t\t0x3371c354: \"messages.peerDialogs#3371c354\",\n\t\t0xedcdc05b: \"topPeer#edcdc05b\",\n\t\t0xab661b5b: \"topPeerCategoryBotsPM#ab661b5b\",\n\t\t0x148677e2: \"topPeerCategoryBotsInline#148677e2\",\n\t\t0x637b7ed: \"topPeerCategoryCorrespondents#637b7ed\",\n\t\t0xbd17a14a: \"topPeerCategoryGroups#bd17a14a\",\n\t\t0x161d9628: \"topPeerCategoryChannels#161d9628\",\n\t\t0x1e76a78c: \"topPeerCategoryPhoneCalls#1e76a78c\",\n\t\t0xa8406ca9: \"topPeerCategoryForwardUsers#a8406ca9\",\n\t\t0xfbeec0f0: \"topPeerCategoryForwardChats#fbeec0f0\",\n\t\t0xfb834291: \"topPeerCategoryPeers#fb834291\",\n\t\t0xde266ef5: \"contacts.topPeersNotModified#de266ef5\",\n\t\t0x70b772a8: \"contacts.topPeers#70b772a8\",\n\t\t0xb52c939d: \"contacts.topPeersDisabled#b52c939d\",\n\t\t0x1b0c841a: \"draftMessageEmpty#1b0c841a\",\n\t\t0xfd8e711f: \"draftMessage#fd8e711f\",\n\t\t0xc6dc0c66: \"messages.featuredStickersNotModified#c6dc0c66\",\n\t\t0xb6abc341: \"messages.featuredStickers#b6abc341\",\n\t\t0xb17f890: \"messages.recentStickersNotModified#b17f890\",\n\t\t0x22f3afb3: \"messages.recentStickers#22f3afb3\",\n\t\t0x4fcba9c8: \"messages.archivedStickers#4fcba9c8\",\n\t\t0x38641628: \"messages.stickerSetInstallResultSuccess#38641628\",\n\t\t0x35e410a8: \"messages.stickerSetInstallResultArchive#35e410a8\",\n\t\t0x6410a5d2: \"stickerSetCovered#6410a5d2\",\n\t\t0x3407e51b: \"stickerSetMultiCovered#3407e51b\",\n\t\t0xaed6dbb2: \"maskCoords#aed6dbb2\",\n\t\t0x4a992157: \"inputStickeredMediaPhoto#4a992157\",\n\t\t0x438865b: \"inputStickeredMediaDocument#438865b\",\n\t\t0xbdf9653b: \"game#bdf9653b\",\n\t\t0x32c3e77: \"inputGameID#32c3e77\",\n\t\t0xc331e80a: \"inputGameShortName#c331e80a\",\n\t\t0x58fffcd0: \"highScore#58fffcd0\",\n\t\t0x9a3bfd99: \"messages.highScores#9a3bfd99\",\n\t\t0xdc3d824f: \"textEmpty#dc3d824f\",\n\t\t0x744694e0: \"textPlain#744694e0\",\n\t\t0x6724abc4: \"textBold#6724abc4\",\n\t\t0xd912a59c: \"textItalic#d912a59c\",\n\t\t0xc12622c4: \"textUnderline#c12622c4\",\n\t\t0x9bf8bb95: \"textStrike#9bf8bb95\",\n\t\t0x6c3f19b9: \"textFixed#6c3f19b9\",\n\t\t0x3c2884c1: \"textUrl#3c2884c1\",\n\t\t0xde5a0dd6: \"textEmail#de5a0dd6\",\n\t\t0x7e6260d7: \"textConcat#7e6260d7\",\n\t\t0xed6a8504: \"textSubscript#ed6a8504\",\n\t\t0xc7fb5e01: \"textSuperscript#c7fb5e01\",\n\t\t0x34b8621: \"textMarked#34b8621\",\n\t\t0x1ccb966a: \"textPhone#1ccb966a\",\n\t\t0x81ccf4f: \"textImage#81ccf4f\",\n\t\t0x35553762: \"textAnchor#35553762\",\n\t\t0x13567e8a: \"pageBlockUnsupported#13567e8a\",\n\t\t0x70abc3fd: \"pageBlockTitle#70abc3fd\",\n\t\t0x8ffa9a1f: \"pageBlockSubtitle#8ffa9a1f\",\n\t\t0xbaafe5e0: \"pageBlockAuthorDate#baafe5e0\",\n\t\t0xbfd064ec: \"pageBlockHeader#bfd064ec\",\n\t\t0xf12bb6e1: \"pageBlockSubheader#f12bb6e1\",\n\t\t0x467a0766: \"pageBlockParagraph#467a0766\",\n\t\t0xc070d93e: \"pageBlockPreformatted#c070d93e\",\n\t\t0x48870999: \"pageBlockFooter#48870999\",\n\t\t0xdb20b188: \"pageBlockDivider#db20b188\",\n\t\t0xce0d37b0: \"pageBlockAnchor#ce0d37b0\",\n\t\t0xe4e88011: \"pageBlockList#e4e88011\",\n\t\t0x263d7c26: \"pageBlockBlockquote#263d7c26\",\n\t\t0x4f4456d3: \"pageBlockPullquote#4f4456d3\",\n\t\t0x1759c560: \"pageBlockPhoto#1759c560\",\n\t\t0x7c8fe7b6: \"pageBlockVideo#7c8fe7b6\",\n\t\t0x39f23300: \"pageBlockCover#39f23300\",\n\t\t0xa8718dc5: \"pageBlockEmbed#a8718dc5\",\n\t\t0xf259a80b: \"pageBlockEmbedPost#f259a80b\",\n\t\t0x65a0fa4d: \"pageBlockCollage#65a0fa4d\",\n\t\t0x31f9590: \"pageBlockSlideshow#31f9590\",\n\t\t0xef1751b5: \"pageBlockChannel#ef1751b5\",\n\t\t0x804361ea: \"pageBlockAudio#804361ea\",\n\t\t0x1e148390: \"pageBlockKicker#1e148390\",\n\t\t0xbf4dea82: \"pageBlockTable#bf4dea82\",\n\t\t0x9a8ae1e1: \"pageBlockOrderedList#9a8ae1e1\",\n\t\t0x76768bed: \"pageBlockDetails#76768bed\",\n\t\t0x16115a96: \"pageBlockRelatedArticles#16115a96\",\n\t\t0xa44f3ef6: \"pageBlockMap#a44f3ef6\",\n\t\t0x85e42301: \"phoneCallDiscardReasonMissed#85e42301\",\n\t\t0xe095c1a0: \"phoneCallDiscardReasonDisconnect#e095c1a0\",\n\t\t0x57adc690: \"phoneCallDiscardReasonHangup#57adc690\",\n\t\t0xfaf7e8c9: \"phoneCallDiscardReasonBusy#faf7e8c9\",\n\t\t0x7d748d04: \"dataJSON#7d748d04\",\n\t\t0xcb296bf8: \"labeledPrice#cb296bf8\",\n\t\t0xc30aa358: \"invoice#c30aa358\",\n\t\t0xea02c27e: \"paymentCharge#ea02c27e\",\n\t\t0x1e8caaeb: \"postAddress#1e8caaeb\",\n\t\t0x909c3f94: \"paymentRequestedInfo#909c3f94\",\n\t\t0xcdc27a1f: \"paymentSavedCredentialsCard#cdc27a1f\",\n\t\t0x1c570ed1: \"webDocument#1c570ed1\",\n\t\t0xf9c8bcc6: \"webDocumentNoProxy#f9c8bcc6\",\n\t\t0x9bed434d: \"inputWebDocument#9bed434d\",\n\t\t0xc239d686: \"inputWebFileLocation#c239d686\",\n\t\t0x9f2221c9: \"inputWebFileGeoPointLocation#9f2221c9\",\n\t\t0x21e753bc: \"upload.webFile#21e753bc\",\n\t\t0x3f56aea3: \"payments.paymentForm#3f56aea3\",\n\t\t0xd1451883: \"payments.validatedRequestedInfo#d1451883\",\n\t\t0x4e5f810d: \"payments.paymentResult#4e5f810d\",\n\t\t0xd8411139: \"payments.paymentVerificationNeeded#d8411139\",\n\t\t0x500911e1: \"payments.paymentReceipt#500911e1\",\n\t\t0xfb8fe43c: \"payments.savedInfo#fb8fe43c\",\n\t\t0xc10eb2cf: \"inputPaymentCredentialsSaved#c10eb2cf\",\n\t\t0x3417d728: \"inputPaymentCredentials#3417d728\",\n\t\t0xaa1c39f: \"inputPaymentCredentialsApplePay#aa1c39f\",\n\t\t0xca05d50e: \"inputPaymentCredentialsAndroidPay#ca05d50e\",\n\t\t0xdb64fd34: \"account.tmpPassword#db64fd34\",\n\t\t0xb6213cdf: \"shippingOption#b6213cdf\",\n\t\t0xffa0a496: \"inputStickerSetItem#ffa0a496\",\n\t\t0x1e36fded: \"inputPhoneCall#1e36fded\",\n\t\t0x5366c915: \"phoneCallEmpty#5366c915\",\n\t\t0x1b8f4ad1: \"phoneCallWaiting#1b8f4ad1\",\n\t\t0x87eabb53: \"phoneCallRequested#87eabb53\",\n\t\t0x997c454a: \"phoneCallAccepted#997c454a\",\n\t\t0x8742ae7f: \"phoneCall#8742ae7f\",\n\t\t0x50ca4de1: \"phoneCallDiscarded#50ca4de1\",\n\t\t0x9d4c17c0: \"phoneConnection#9d4c17c0\",\n\t\t0x635fe375: \"phoneConnectionWebrtc#635fe375\",\n\t\t0xfc878fc8: \"phoneCallProtocol#fc878fc8\",\n\t\t0xec82e140: \"phone.phoneCall#ec82e140\",\n\t\t0xeea8e46e: \"upload.cdnFileReuploadNeeded#eea8e46e\",\n\t\t0xa99fca4f: \"upload.cdnFile#a99fca4f\",\n\t\t0xc982eaba: \"cdnPublicKey#c982eaba\",\n\t\t0x5725e40a: \"cdnConfig#5725e40a\",\n\t\t0xcad181f6: \"langPackString#cad181f6\",\n\t\t0x6c47ac9f: \"langPackStringPluralized#6c47ac9f\",\n\t\t0x2979eeb2: \"langPackStringDeleted#2979eeb2\",\n\t\t0xf385c1f6: \"langPackDifference#f385c1f6\",\n\t\t0xeeca5ce3: \"langPackLanguage#eeca5ce3\",\n\t\t0xe6dfb825: \"channelAdminLogEventActionChangeTitle#e6dfb825\",\n\t\t0x55188a2e: \"channelAdminLogEventActionChangeAbout#55188a2e\",\n\t\t0x6a4afc38: \"channelAdminLogEventActionChangeUsername#6a4afc38\",\n\t\t0x434bd2af: \"channelAdminLogEventActionChangePhoto#434bd2af\",\n\t\t0x1b7907ae: \"channelAdminLogEventActionToggleInvites#1b7907ae\",\n\t\t0x26ae0971: \"channelAdminLogEventActionToggleSignatures#26ae0971\",\n\t\t0xe9e82c18: \"channelAdminLogEventActionUpdatePinned#e9e82c18\",\n\t\t0x709b2405: \"channelAdminLogEventActionEditMessage#709b2405\",\n\t\t0x42e047bb: \"channelAdminLogEventActionDeleteMessage#42e047bb\",\n\t\t0x183040d3: \"channelAdminLogEventActionParticipantJoin#183040d3\",\n\t\t0xf89777f2: \"channelAdminLogEventActionParticipantLeave#f89777f2\",\n\t\t0xe31c34d8: \"channelAdminLogEventActionParticipantInvite#e31c34d8\",\n\t\t0xe6d83d7e: \"channelAdminLogEventActionParticipantToggleBan#e6d83d7e\",\n\t\t0xd5676710: \"channelAdminLogEventActionParticipantToggleAdmin#d5676710\",\n\t\t0xb1c3caa7: \"channelAdminLogEventActionChangeStickerSet#b1c3caa7\",\n\t\t0x5f5c95f1: \"channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1\",\n\t\t0x2df5fc0a: \"channelAdminLogEventActionDefaultBannedRights#2df5fc0a\",\n\t\t0x8f079643: \"channelAdminLogEventActionStopPoll#8f079643\",\n\t\t0xa26f881b: \"channelAdminLogEventActionChangeLinkedChat#a26f881b\",\n\t\t0xe6b76ae: \"channelAdminLogEventActionChangeLocation#e6b76ae\",\n\t\t0x53909779: \"channelAdminLogEventActionToggleSlowMode#53909779\",\n\t\t0x23209745: \"channelAdminLogEventActionStartGroupCall#23209745\",\n\t\t0xdb9f9140: \"channelAdminLogEventActionDiscardGroupCall#db9f9140\",\n\t\t0xf92424d2: \"channelAdminLogEventActionParticipantMute#f92424d2\",\n\t\t0xe64429c0: \"channelAdminLogEventActionParticipantUnmute#e64429c0\",\n\t\t0x56d6a247: \"channelAdminLogEventActionToggleGroupCallSetting#56d6a247\",\n\t\t0x3b5a3e40: \"channelAdminLogEvent#3b5a3e40\",\n\t\t0xed8af74d: \"channels.adminLogResults#ed8af74d\",\n\t\t0xea107ae4: \"channelAdminLogEventsFilter#ea107ae4\",\n\t\t0x5ce14175: \"popularContact#5ce14175\",\n\t\t0x9e8fa6d3: \"messages.favedStickersNotModified#9e8fa6d3\",\n\t\t0xf37f2f16: \"messages.favedStickers#f37f2f16\",\n\t\t0x46e1d13d: \"recentMeUrlUnknown#46e1d13d\",\n\t\t0x8dbc3336: \"recentMeUrlUser#8dbc3336\",\n\t\t0xa01b22f9: \"recentMeUrlChat#a01b22f9\",\n\t\t0xeb49081d: \"recentMeUrlChatInvite#eb49081d\",\n\t\t0xbc0a57dc: \"recentMeUrlStickerSet#bc0a57dc\",\n\t\t0xe0310d7: \"help.recentMeUrls#e0310d7\",\n\t\t0x1cc6e91f: \"inputSingleMedia#1cc6e91f\",\n\t\t0xcac943f2: \"webAuthorization#cac943f2\",\n\t\t0xed56c9fc: \"account.webAuthorizations#ed56c9fc\",\n\t\t0xa676a322: \"inputMessageID#a676a322\",\n\t\t0xbad88395: \"inputMessageReplyTo#bad88395\",\n\t\t0x86872538: \"inputMessagePinned#86872538\",\n\t\t0xacfa1a7e: \"inputMessageCallbackQuery#acfa1a7e\",\n\t\t0xfcaafeb7: \"inputDialogPeer#fcaafeb7\",\n\t\t0x64600527: \"inputDialogPeerFolder#64600527\",\n\t\t0xe56dbf05: \"dialogPeer#e56dbf05\",\n\t\t0x514519e2: \"dialogPeerFolder#514519e2\",\n\t\t0xd54b65d: \"messages.foundStickerSetsNotModified#d54b65d\",\n\t\t0x5108d648: \"messages.foundStickerSets#5108d648\",\n\t\t0x6242c773: \"fileHash#6242c773\",\n\t\t0x75588b3f: \"inputClientProxy#75588b3f\",\n\t\t0xe3309f7f: \"help.termsOfServiceUpdateEmpty#e3309f7f\",\n\t\t0x28ecf961: \"help.termsOfServiceUpdate#28ecf961\",\n\t\t0x3334b0f0: \"inputSecureFileUploaded#3334b0f0\",\n\t\t0x5367e5be: \"inputSecureFile#5367e5be\",\n\t\t0x64199744: \"secureFileEmpty#64199744\",\n\t\t0xe0277a62: \"secureFile#e0277a62\",\n\t\t0x8aeabec3: \"secureData#8aeabec3\",\n\t\t0x7d6099dd: \"securePlainPhone#7d6099dd\",\n\t\t0x21ec5a5f: \"securePlainEmail#21ec5a5f\",\n\t\t0x9d2a81e3: \"secureValueTypePersonalDetails#9d2a81e3\",\n\t\t0x3dac6a00: \"secureValueTypePassport#3dac6a00\",\n\t\t0x6e425c4: \"secureValueTypeDriverLicense#6e425c4\",\n\t\t0xa0d0744b: \"secureValueTypeIdentityCard#a0d0744b\",\n\t\t0x99a48f23: \"secureValueTypeInternalPassport#99a48f23\",\n\t\t0xcbe31e26: \"secureValueTypeAddress#cbe31e26\",\n\t\t0xfc36954e: \"secureValueTypeUtilityBill#fc36954e\",\n\t\t0x89137c0d: \"secureValueTypeBankStatement#89137c0d\",\n\t\t0x8b883488: \"secureValueTypeRentalAgreement#8b883488\",\n\t\t0x99e3806a: \"secureValueTypePassportRegistration#99e3806a\",\n\t\t0xea02ec33: \"secureValueTypeTemporaryRegistration#ea02ec33\",\n\t\t0xb320aadb: \"secureValueTypePhone#b320aadb\",\n\t\t0x8e3ca7ee: \"secureValueTypeEmail#8e3ca7ee\",\n\t\t0x187fa0ca: \"secureValue#187fa0ca\",\n\t\t0xdb21d0a7: \"inputSecureValue#db21d0a7\",\n\t\t0xed1ecdb0: \"secureValueHash#ed1ecdb0\",\n\t\t0xe8a40bd9: \"secureValueErrorData#e8a40bd9\",\n\t\t0xbe3dfa: \"secureValueErrorFrontSide#be3dfa\",\n\t\t0x868a2aa5: \"secureValueErrorReverseSide#868a2aa5\",\n\t\t0xe537ced6: \"secureValueErrorSelfie#e537ced6\",\n\t\t0x7a700873: \"secureValueErrorFile#7a700873\",\n\t\t0x666220e9: \"secureValueErrorFiles#666220e9\",\n\t\t0x869d758f: \"secureValueError#869d758f\",\n\t\t0xa1144770: \"secureValueErrorTranslationFile#a1144770\",\n\t\t0x34636dd8: \"secureValueErrorTranslationFiles#34636dd8\",\n\t\t0x33f0ea47: \"secureCredentialsEncrypted#33f0ea47\",\n\t\t0xad2e1cd8: \"account.authorizationForm#ad2e1cd8\",\n\t\t0x811f854f: \"account.sentEmailCode#811f854f\",\n\t\t0x66afa166: \"help.deepLinkInfoEmpty#66afa166\",\n\t\t0x6a4ee832: \"help.deepLinkInfo#6a4ee832\",\n\t\t0x1142bd56: \"savedPhoneContact#1142bd56\",\n\t\t0x4dba4501: \"account.takeout#4dba4501\",\n\t\t0xd45ab096: \"passwordKdfAlgoUnknown#d45ab096\",\n\t\t0x3a912d4a: \"passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a\",\n\t\t0x4a8537: \"securePasswordKdfAlgoUnknown#4a8537\",\n\t\t0xbbf2dda0: \"securePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0\",\n\t\t0x86471d92: \"securePasswordKdfAlgoSHA512#86471d92\",\n\t\t0x1527bcac: \"secureSecretSettings#1527bcac\",\n\t\t0x9880f658: \"inputCheckPasswordEmpty#9880f658\",\n\t\t0xd27ff082: \"inputCheckPasswordSRP#d27ff082\",\n\t\t0x829d99da: \"secureRequiredType#829d99da\",\n\t\t0x27477b4: \"secureRequiredTypeOneOf#27477b4\",\n\t\t0xbfb9f457: \"help.passportConfigNotModified#bfb9f457\",\n\t\t0xa098d6af: \"help.passportConfig#a098d6af\",\n\t\t0x1d1b1245: \"inputAppEvent#1d1b1245\",\n\t\t0xc0de1bd9: \"jsonObjectValue#c0de1bd9\",\n\t\t0x3f6d7b68: \"jsonNull#3f6d7b68\",\n\t\t0xc7345e6a: \"jsonBool#c7345e6a\",\n\t\t0x2be0dfa4: \"jsonNumber#2be0dfa4\",\n\t\t0xb71e767a: \"jsonString#b71e767a\",\n\t\t0xf7444763: \"jsonArray#f7444763\",\n\t\t0x99c1d49d: \"jsonObject#99c1d49d\",\n\t\t0x34566b6a: \"pageTableCell#34566b6a\",\n\t\t0xe0c0c5e5: \"pageTableRow#e0c0c5e5\",\n\t\t0x6f747657: \"pageCaption#6f747657\",\n\t\t0xb92fb6cd: \"pageListItemText#b92fb6cd\",\n\t\t0x25e073fc: \"pageListItemBlocks#25e073fc\",\n\t\t0x5e068047: \"pageListOrderedItemText#5e068047\",\n\t\t0x98dd8936: \"pageListOrderedItemBlocks#98dd8936\",\n\t\t0xb390dc08: \"pageRelatedArticle#b390dc08\",\n\t\t0x98657f0d: \"page#98657f0d\",\n\t\t0x8c05f1c9: \"help.supportName#8c05f1c9\",\n\t\t0xf3ae2eed: \"help.userInfoEmpty#f3ae2eed\",\n\t\t0x1eb3758: \"help.userInfo#1eb3758\",\n\t\t0x6ca9c2e9: \"pollAnswer#6ca9c2e9\",\n\t\t0x86e18161: \"poll#86e18161\",\n\t\t0x3b6ddad2: \"pollAnswerVoters#3b6ddad2\",\n\t\t0xbadcc1a3: \"pollResults#badcc1a3\",\n\t\t0xf041e250: \"chatOnlines#f041e250\",\n\t\t0x47a971e0: \"statsURL#47a971e0\",\n\t\t0x5fb224d5: \"chatAdminRights#5fb224d5\",\n\t\t0x9f120418: \"chatBannedRights#9f120418\",\n\t\t0xe630b979: \"inputWallPaper#e630b979\",\n\t\t0x72091c80: \"inputWallPaperSlug#72091c80\",\n\t\t0x8427bbac: \"inputWallPaperNoFile#8427bbac\",\n\t\t0x1c199183: \"account.wallPapersNotModified#1c199183\",\n\t\t0x702b65a9: \"account.wallPapers#702b65a9\",\n\t\t0xdebebe83: \"codeSettings#debebe83\",\n\t\t0x5086cf8: \"wallPaperSettings#5086cf8\",\n\t\t0xe04232f3: \"autoDownloadSettings#e04232f3\",\n\t\t0x63cacf26: \"account.autoDownloadSettings#63cacf26\",\n\t\t0xd5b3b9f9: \"emojiKeyword#d5b3b9f9\",\n\t\t0x236df622: \"emojiKeywordDeleted#236df622\",\n\t\t0x5cc761bd: \"emojiKeywordsDifference#5cc761bd\",\n\t\t0xa575739d: \"emojiURL#a575739d\",\n\t\t0xb3fb5361: \"emojiLanguage#b3fb5361\",\n\t\t0xbc7fc6cd: \"fileLocationToBeDeprecated#bc7fc6cd\",\n\t\t0xff544e65: \"folder#ff544e65\",\n\t\t0xfbd2c296: \"inputFolderPeer#fbd2c296\",\n\t\t0xe9baa668: \"folderPeer#e9baa668\",\n\t\t0xe844ebff: \"messages.searchCounter#e844ebff\",\n\t\t0x92d33a0e: \"urlAuthResultRequest#92d33a0e\",\n\t\t0x8f8c0e4e: \"urlAuthResultAccepted#8f8c0e4e\",\n\t\t0xa9d6db1f: \"urlAuthResultDefault#a9d6db1f\",\n\t\t0xbfb5ad8b: \"channelLocationEmpty#bfb5ad8b\",\n\t\t0x209b82db: \"channelLocation#209b82db\",\n\t\t0xca461b5d: \"peerLocated#ca461b5d\",\n\t\t0xf8ec284b: \"peerSelfLocated#f8ec284b\",\n\t\t0xd072acb4: \"restrictionReason#d072acb4\",\n\t\t0x3c5693e9: \"inputTheme#3c5693e9\",\n\t\t0xf5890df1: \"inputThemeSlug#f5890df1\",\n\t\t0x28f1114: \"theme#28f1114\",\n\t\t0xf41eb622: \"account.themesNotModified#f41eb622\",\n\t\t0x7f676421: \"account.themes#7f676421\",\n\t\t0x629f1980: \"auth.loginToken#629f1980\",\n\t\t0x68e9916: \"auth.loginTokenMigrateTo#68e9916\",\n\t\t0x390d5c5e: \"auth.loginTokenSuccess#390d5c5e\",\n\t\t0x57e28221: \"account.contentSettings#57e28221\",\n\t\t0xa927fec5: \"messages.inactiveChats#a927fec5\",\n\t\t0xc3a12462: \"baseThemeClassic#c3a12462\",\n\t\t0xfbd81688: \"baseThemeDay#fbd81688\",\n\t\t0xb7b31ea8: \"baseThemeNight#b7b31ea8\",\n\t\t0x6d5f77ee: \"baseThemeTinted#6d5f77ee\",\n\t\t0x5b11125a: \"baseThemeArctic#5b11125a\",\n\t\t0xbd507cd1: \"inputThemeSettings#bd507cd1\",\n\t\t0x9c14984a: \"themeSettings#9c14984a\",\n\t\t0x54b56617: \"webPageAttributeTheme#54b56617\",\n\t\t0xa28e5559: \"messageUserVote#a28e5559\",\n\t\t0x36377430: \"messageUserVoteInputOption#36377430\",\n\t\t0xe8fe0de: \"messageUserVoteMultiple#e8fe0de\",\n\t\t0x823f649: \"messages.votesList#823f649\",\n\t\t0xf568028a: \"bankCardOpenUrl#f568028a\",\n\t\t0x3e24e573: \"payments.bankCardData#3e24e573\",\n\t\t0x7438f7e8: \"dialogFilter#7438f7e8\",\n\t\t0x77744d4a: \"dialogFilterSuggested#77744d4a\",\n\t\t0xb637edaf: \"statsDateRangeDays#b637edaf\",\n\t\t0xcb43acde: \"statsAbsValueAndPrev#cb43acde\",\n\t\t0xcbce2fe0: \"statsPercentValue#cbce2fe0\",\n\t\t0x4a27eb2d: \"statsGraphAsync#4a27eb2d\",\n\t\t0xbedc9822: \"statsGraphError#bedc9822\",\n\t\t0x8ea464b6: \"statsGraph#8ea464b6\",\n\t\t0xad4fc9bd: \"messageInteractionCounters#ad4fc9bd\",\n\t\t0xbdf78394: \"stats.broadcastStats#bdf78394\",\n\t\t0x98f6ac75: \"help.promoDataEmpty#98f6ac75\",\n\t\t0x8c39793f: \"help.promoData#8c39793f\",\n\t\t0xe831c556: \"videoSize#e831c556\",\n\t\t0x18f3d0f7: \"statsGroupTopPoster#18f3d0f7\",\n\t\t0x6014f412: \"statsGroupTopAdmin#6014f412\",\n\t\t0x31962a4c: \"statsGroupTopInviter#31962a4c\",\n\t\t0xef7ff916: \"stats.megagroupStats#ef7ff916\",\n\t\t0xbea2f424: \"globalPrivacySettings#bea2f424\",\n\t\t0x4203c5ef: \"help.countryCode#4203c5ef\",\n\t\t0xc3878e23: \"help.country#c3878e23\",\n\t\t0x93cc1f32: \"help.countriesListNotModified#93cc1f32\",\n\t\t0x87d0759e: \"help.countriesList#87d0759e\",\n\t\t0x455b853d: \"messageViews#455b853d\",\n\t\t0xb6c4f543: \"messages.messageViews#b6c4f543\",\n\t\t0xf5dd8f9d: \"messages.discussionMessage#f5dd8f9d\",\n\t\t0xa6d57763: \"messageReplyHeader#a6d57763\",\n\t\t0x4128faac: \"messageReplies#4128faac\",\n\t\t0xe8fd8014: \"peerBlocked#e8fd8014\",\n\t\t0x8999f295: \"stats.messageStats#8999f295\",\n\t\t0x7780bcb4: \"groupCallDiscarded#7780bcb4\",\n\t\t0x55903081: \"groupCall#55903081\",\n\t\t0xd8aa840f: \"inputGroupCall#d8aa840f\",\n\t\t0x56b087c9: \"groupCallParticipant#56b087c9\",\n\t\t0x66ab0bfc: \"phone.groupCall#66ab0bfc\",\n\t\t0x9cfeb92d: \"phone.groupParticipants#9cfeb92d\",\n\t\t0x3081ed9d: \"inlineQueryPeerTypeSameBotPM#3081ed9d\",\n\t\t0x833c0fac: \"inlineQueryPeerTypePM#833c0fac\",\n\t\t0xd766c50a: \"inlineQueryPeerTypeChat#d766c50a\",\n\t\t0x5ec4be43: \"inlineQueryPeerTypeMegagroup#5ec4be43\",\n\t\t0x6334ee9a: \"inlineQueryPeerTypeBroadcast#6334ee9a\",\n\t\t0xa677244f: \"auth.sendCode#a677244f\",\n\t\t0x80eee427: \"auth.signUp#80eee427\",\n\t\t0xbcd51581: \"auth.signIn#bcd51581\",\n\t\t0x5717da40: \"auth.logOut#5717da40\",\n\t\t0x9fab0d1a: \"auth.resetAuthorizations#9fab0d1a\",\n\t\t0xe5bfffcd: \"auth.exportAuthorization#e5bfffcd\",\n\t\t0xe3ef9613: \"auth.importAuthorization#e3ef9613\",\n\t\t0xcdd42a05: \"auth.bindTempAuthKey#cdd42a05\",\n\t\t0x67a3ff2c: \"auth.importBotAuthorization#67a3ff2c\",\n\t\t0xd18b4d16: \"auth.checkPassword#d18b4d16\",\n\t\t0xd897bc66: \"auth.requestPasswordRecovery#d897bc66\",\n\t\t0x4ea56e92: \"auth.recoverPassword#4ea56e92\",\n\t\t0x3ef1a9bf: \"auth.resendCode#3ef1a9bf\",\n\t\t0x1f040578: \"auth.cancelCode#1f040578\",\n\t\t0x8e48a188: \"auth.dropTempAuthKeys#8e48a188\",\n\t\t0xb1b41517: \"auth.exportLoginToken#b1b41517\",\n\t\t0x95ac5ce4: \"auth.importLoginToken#95ac5ce4\",\n\t\t0xe894ad4d: \"auth.acceptLoginToken#e894ad4d\",\n\t\t0x68976c6f: \"account.registerDevice#68976c6f\",\n\t\t0x3076c4bf: \"account.unregisterDevice#3076c4bf\",\n\t\t0x84be5b93: \"account.updateNotifySettings#84be5b93\",\n\t\t0x12b3ad31: \"account.getNotifySettings#12b3ad31\",\n\t\t0xdb7e1747: \"account.resetNotifySettings#db7e1747\",\n\t\t0x78515775: \"account.updateProfile#78515775\",\n\t\t0x6628562c: \"account.updateStatus#6628562c\",\n\t\t0xaabb1763: \"account.getWallPapers#aabb1763\",\n\t\t0xae189d5f: \"account.reportPeer#ae189d5f\",\n\t\t0x2714d86c: \"account.checkUsername#2714d86c\",\n\t\t0x3e0bdd7c: \"account.updateUsername#3e0bdd7c\",\n\t\t0xdadbc950: \"account.getPrivacy#dadbc950\",\n\t\t0xc9f81ce8: \"account.setPrivacy#c9f81ce8\",\n\t\t0x418d4e0b: \"account.deleteAccount#418d4e0b\",\n\t\t0x8fc711d: \"account.getAccountTTL#8fc711d\",\n\t\t0x2442485e: \"account.setAccountTTL#2442485e\",\n\t\t0x82574ae5: \"account.sendChangePhoneCode#82574ae5\",\n\t\t0x70c32edb: \"account.changePhone#70c32edb\",\n\t\t0x38df3532: \"account.updateDeviceLocked#38df3532\",\n\t\t0xe320c158: \"account.getAuthorizations#e320c158\",\n\t\t0xdf77f3bc: \"account.resetAuthorization#df77f3bc\",\n\t\t0x548a30f5: \"account.getPassword#548a30f5\",\n\t\t0x9cd4eaf9: \"account.getPasswordSettings#9cd4eaf9\",\n\t\t0xa59b102f: \"account.updatePasswordSettings#a59b102f\",\n\t\t0x1b3faa88: \"account.sendConfirmPhoneCode#1b3faa88\",\n\t\t0x5f2178c3: \"account.confirmPhone#5f2178c3\",\n\t\t0x449e0b51: \"account.getTmpPassword#449e0b51\",\n\t\t0x182e6d6f: \"account.getWebAuthorizations#182e6d6f\",\n\t\t0x2d01b9ef: \"account.resetWebAuthorization#2d01b9ef\",\n\t\t0x682d2594: \"account.resetWebAuthorizations#682d2594\",\n\t\t0xb288bc7d: \"account.getAllSecureValues#b288bc7d\",\n\t\t0x73665bc2: \"account.getSecureValue#73665bc2\",\n\t\t0x899fe31d: \"account.saveSecureValue#899fe31d\",\n\t\t0xb880bc4b: \"account.deleteSecureValue#b880bc4b\",\n\t\t0xb86ba8e1: \"account.getAuthorizationForm#b86ba8e1\",\n\t\t0xe7027c94: \"account.acceptAuthorization#e7027c94\",\n\t\t0xa5a356f9: \"account.sendVerifyPhoneCode#a5a356f9\",\n\t\t0x4dd3a7f6: \"account.verifyPhone#4dd3a7f6\",\n\t\t0x7011509f: \"account.sendVerifyEmailCode#7011509f\",\n\t\t0xecba39db: \"account.verifyEmail#ecba39db\",\n\t\t0xf05b4804: \"account.initTakeoutSession#f05b4804\",\n\t\t0x1d2652ee: \"account.finishTakeoutSession#1d2652ee\",\n\t\t0x8fdf1920: \"account.confirmPasswordEmail#8fdf1920\",\n\t\t0x7a7f2a15: \"account.resendPasswordEmail#7a7f2a15\",\n\t\t0xc1cbd5b6: \"account.cancelPasswordEmail#c1cbd5b6\",\n\t\t0x9f07c728: \"account.getContactSignUpNotification#9f07c728\",\n\t\t0xcff43f61: \"account.setContactSignUpNotification#cff43f61\",\n\t\t0x53577479: \"account.getNotifyExceptions#53577479\",\n\t\t0xfc8ddbea: \"account.getWallPaper#fc8ddbea\",\n\t\t0xdd853661: \"account.uploadWallPaper#dd853661\",\n\t\t0x6c5a5b37: \"account.saveWallPaper#6c5a5b37\",\n\t\t0xfeed5769: \"account.installWallPaper#feed5769\",\n\t\t0xbb3b9804: \"account.resetWallPapers#bb3b9804\",\n\t\t0x56da0b3f: \"account.getAutoDownloadSettings#56da0b3f\",\n\t\t0x76f36233: \"account.saveAutoDownloadSettings#76f36233\",\n\t\t0x1c3db333: \"account.uploadTheme#1c3db333\",\n\t\t0x8432c21f: \"account.createTheme#8432c21f\",\n\t\t0x5cb367d5: \"account.updateTheme#5cb367d5\",\n\t\t0xf257106c: \"account.saveTheme#f257106c\",\n\t\t0x7ae43737: \"account.installTheme#7ae43737\",\n\t\t0x8d9d742b: \"account.getTheme#8d9d742b\",\n\t\t0x285946f8: \"account.getThemes#285946f8\",\n\t\t0xb574b16b: \"account.setContentSettings#b574b16b\",\n\t\t0x8b9b4dae: \"account.getContentSettings#8b9b4dae\",\n\t\t0x65ad71dc: \"account.getMultiWallPapers#65ad71dc\",\n\t\t0xeb2b4cf6: \"account.getGlobalPrivacySettings#eb2b4cf6\",\n\t\t0x1edaaac2: \"account.setGlobalPrivacySettings#1edaaac2\",\n\t\t0xd91a548: \"users.getUsers#d91a548\",\n\t\t0xca30a5b1: \"users.getFullUser#ca30a5b1\",\n\t\t0x90c894b5: \"users.setSecureValueErrors#90c894b5\",\n\t\t0x2caa4a42: \"contacts.getContactIDs#2caa4a42\",\n\t\t0xc4a353ee: \"contacts.getStatuses#c4a353ee\",\n\t\t0xc023849f: \"contacts.getContacts#c023849f\",\n\t\t0x2c800be5: \"contacts.importContacts#2c800be5\",\n\t\t0x96a0e00: \"contacts.deleteContacts#96a0e00\",\n\t\t0x1013fd9e: \"contacts.deleteByPhones#1013fd9e\",\n\t\t0x68cc1411: \"contacts.block#68cc1411\",\n\t\t0xbea65d50: \"contacts.unblock#bea65d50\",\n\t\t0xf57c350f: \"contacts.getBlocked#f57c350f\",\n\t\t0x11f812d8: \"contacts.search#11f812d8\",\n\t\t0xf93ccba3: \"contacts.resolveUsername#f93ccba3\",\n\t\t0xd4982db5: \"contacts.getTopPeers#d4982db5\",\n\t\t0x1ae373ac: \"contacts.resetTopPeerRating#1ae373ac\",\n\t\t0x879537f1: \"contacts.resetSaved#879537f1\",\n\t\t0x82f1e39f: \"contacts.getSaved#82f1e39f\",\n\t\t0x8514bdda: \"contacts.toggleTopPeers#8514bdda\",\n\t\t0xe8f463d0: \"contacts.addContact#e8f463d0\",\n\t\t0xf831a20f: \"contacts.acceptContact#f831a20f\",\n\t\t0xd348bc44: \"contacts.getLocated#d348bc44\",\n\t\t0x29a8962c: \"contacts.blockFromReplies#29a8962c\",\n\t\t0x63c66506: \"messages.getMessages#63c66506\",\n\t\t0xa0ee3b73: \"messages.getDialogs#a0ee3b73\",\n\t\t0xdcbb8260: \"messages.getHistory#dcbb8260\",\n\t\t0xc352eec: \"messages.search#c352eec\",\n\t\t0xe306d3a: \"messages.readHistory#e306d3a\",\n\t\t0x1c015b09: \"messages.deleteHistory#1c015b09\",\n\t\t0xe58e95d2: \"messages.deleteMessages#e58e95d2\",\n\t\t0x5a954c0: \"messages.receivedMessages#5a954c0\",\n\t\t0x58943ee2: \"messages.setTyping#58943ee2\",\n\t\t0x520c3870: \"messages.sendMessage#520c3870\",\n\t\t0x3491eba9: \"messages.sendMedia#3491eba9\",\n\t\t0xd9fee60e: \"messages.forwardMessages#d9fee60e\",\n\t\t0xcf1592db: \"messages.reportSpam#cf1592db\",\n\t\t0x3672e09c: \"messages.getPeerSettings#3672e09c\",\n\t\t0xbd82b658: \"messages.report#bd82b658\",\n\t\t0x3c6aa187: \"messages.getChats#3c6aa187\",\n\t\t0x3b831c66: \"messages.getFullChat#3b831c66\",\n\t\t0xdc452855: \"messages.editChatTitle#dc452855\",\n\t\t0xca4c79d8: \"messages.editChatPhoto#ca4c79d8\",\n\t\t0xf9a0aa09: \"messages.addChatUser#f9a0aa09\",\n\t\t0xe0611f16: \"messages.deleteChatUser#e0611f16\",\n\t\t0x9cb126e: \"messages.createChat#9cb126e\",\n\t\t0x26cf8950: \"messages.getDhConfig#26cf8950\",\n\t\t0xf64daf43: \"messages.requestEncryption#f64daf43\",\n\t\t0x3dbc0415: \"messages.acceptEncryption#3dbc0415\",\n\t\t0xedd923c5: \"messages.discardEncryption#edd923c5\",\n\t\t0x791451ed: \"messages.setEncryptedTyping#791451ed\",\n\t\t0x7f4b690a: \"messages.readEncryptedHistory#7f4b690a\",\n\t\t0x44fa7a15: \"messages.sendEncrypted#44fa7a15\",\n\t\t0x5559481d: \"messages.sendEncryptedFile#5559481d\",\n\t\t0x32d439a4: \"messages.sendEncryptedService#32d439a4\",\n\t\t0x55a5bb66: \"messages.receivedQueue#55a5bb66\",\n\t\t0x4b0c8c0f: \"messages.reportEncryptedSpam#4b0c8c0f\",\n\t\t0x36a73f77: \"messages.readMessageContents#36a73f77\",\n\t\t0x43d4f2c: \"messages.getStickers#43d4f2c\",\n\t\t0x1c9618b1: \"messages.getAllStickers#1c9618b1\",\n\t\t0x8b68b0cc: \"messages.getWebPagePreview#8b68b0cc\",\n\t\t0xdf7534c: \"messages.exportChatInvite#df7534c\",\n\t\t0x3eadb1bb: \"messages.checkChatInvite#3eadb1bb\",\n\t\t0x6c50051c: \"messages.importChatInvite#6c50051c\",\n\t\t0x2619a90e: \"messages.getStickerSet#2619a90e\",\n\t\t0xc78fe460: \"messages.installStickerSet#c78fe460\",\n\t\t0xf96e55de: \"messages.uninstallStickerSet#f96e55de\",\n\t\t0xe6df7378: \"messages.startBot#e6df7378\",\n\t\t0x5784d3e1: \"messages.getMessagesViews#5784d3e1\",\n\t\t0xa9e69f2e: \"messages.editChatAdmin#a9e69f2e\",\n\t\t0x15a3b8e3: \"messages.migrateChat#15a3b8e3\",\n\t\t0x4bc6589a: \"messages.searchGlobal#4bc6589a\",\n\t\t0x78337739: \"messages.reorderStickerSets#78337739\",\n\t\t0x338e2464: \"messages.getDocumentByHash#338e2464\",\n\t\t0x83bf3d52: \"messages.getSavedGifs#83bf3d52\",\n\t\t0x327a30cb: \"messages.saveGif#327a30cb\",\n\t\t0x514e999d: \"messages.getInlineBotResults#514e999d\",\n\t\t0xeb5ea206: \"messages.setInlineBotResults#eb5ea206\",\n\t\t0x220815b0: \"messages.sendInlineBotResult#220815b0\",\n\t\t0xfda68d36: \"messages.getMessageEditData#fda68d36\",\n\t\t0x48f71778: \"messages.editMessage#48f71778\",\n\t\t0x83557dba: \"messages.editInlineBotMessage#83557dba\",\n\t\t0x9342ca07: \"messages.getBotCallbackAnswer#9342ca07\",\n\t\t0xd58f130a: \"messages.setBotCallbackAnswer#d58f130a\",\n\t\t0xe470bcfd: \"messages.getPeerDialogs#e470bcfd\",\n\t\t0xbc39e14b: \"messages.saveDraft#bc39e14b\",\n\t\t0x6a3f8d65: \"messages.getAllDrafts#6a3f8d65\",\n\t\t0x2dacca4f: \"messages.getFeaturedStickers#2dacca4f\",\n\t\t0x5b118126: \"messages.readFeaturedStickers#5b118126\",\n\t\t0x5ea192c9: \"messages.getRecentStickers#5ea192c9\",\n\t\t0x392718f8: \"messages.saveRecentSticker#392718f8\",\n\t\t0x8999602d: \"messages.clearRecentStickers#8999602d\",\n\t\t0x57f17692: \"messages.getArchivedStickers#57f17692\",\n\t\t0x65b8c79f: \"messages.getMaskStickers#65b8c79f\",\n\t\t0xcc5b67cc: \"messages.getAttachedStickers#cc5b67cc\",\n\t\t0x8ef8ecc0: \"messages.setGameScore#8ef8ecc0\",\n\t\t0x15ad9f64: \"messages.setInlineGameScore#15ad9f64\",\n\t\t0xe822649d: \"messages.getGameHighScores#e822649d\",\n\t\t0xf635e1b: \"messages.getInlineGameHighScores#f635e1b\",\n\t\t0xd0a48c4: \"messages.getCommonChats#d0a48c4\",\n\t\t0xeba80ff0: \"messages.getAllChats#eba80ff0\",\n\t\t0x32ca8f91: \"messages.getWebPage#32ca8f91\",\n\t\t0xa731e257: \"messages.toggleDialogPin#a731e257\",\n\t\t0x3b1adf37: \"messages.reorderPinnedDialogs#3b1adf37\",\n\t\t0xd6b94df2: \"messages.getPinnedDialogs#d6b94df2\",\n\t\t0xe5f672fa: \"messages.setBotShippingResults#e5f672fa\",\n\t\t0x9c2dd95: \"messages.setBotPrecheckoutResults#9c2dd95\",\n\t\t0x519bc2b1: \"messages.uploadMedia#519bc2b1\",\n\t\t0xc97df020: \"messages.sendScreenshotNotification#c97df020\",\n\t\t0x21ce0b0e: \"messages.getFavedStickers#21ce0b0e\",\n\t\t0xb9ffc55b: \"messages.faveSticker#b9ffc55b\",\n\t\t0x46578472: \"messages.getUnreadMentions#46578472\",\n\t\t0xf0189d3: \"messages.readMentions#f0189d3\",\n\t\t0xbbc45b09: \"messages.getRecentLocations#bbc45b09\",\n\t\t0xcc0110cb: \"messages.sendMultiMedia#cc0110cb\",\n\t\t0x5057c497: \"messages.uploadEncryptedFile#5057c497\",\n\t\t0xc2b7d08b: \"messages.searchStickerSets#c2b7d08b\",\n\t\t0x1cff7e08: \"messages.getSplitRanges#1cff7e08\",\n\t\t0xc286d98f: \"messages.markDialogUnread#c286d98f\",\n\t\t0x22e24e22: \"messages.getDialogUnreadMarks#22e24e22\",\n\t\t0x7e58ee9c: \"messages.clearAllDrafts#7e58ee9c\",\n\t\t0xd2aaf7ec: \"messages.updatePinnedMessage#d2aaf7ec\",\n\t\t0x10ea6184: \"messages.sendVote#10ea6184\",\n\t\t0x73bb643b: \"messages.getPollResults#73bb643b\",\n\t\t0x6e2be050: \"messages.getOnlines#6e2be050\",\n\t\t0x812c2ae6: \"messages.getStatsURL#812c2ae6\",\n\t\t0xdef60797: \"messages.editChatAbout#def60797\",\n\t\t0xa5866b41: \"messages.editChatDefaultBannedRights#a5866b41\",\n\t\t0x35a0e062: \"messages.getEmojiKeywords#35a0e062\",\n\t\t0x1508b6af: \"messages.getEmojiKeywordsDifference#1508b6af\",\n\t\t0x4e9963b2: \"messages.getEmojiKeywordsLanguages#4e9963b2\",\n\t\t0xd5b10c26: \"messages.getEmojiURL#d5b10c26\",\n\t\t0x732eef00: \"messages.getSearchCounters#732eef00\",\n\t\t0xe33f5613: \"messages.requestUrlAuth#e33f5613\",\n\t\t0xf729ea98: \"messages.acceptUrlAuth#f729ea98\",\n\t\t0x4facb138: \"messages.hidePeerSettingsBar#4facb138\",\n\t\t0xe2c2685b: \"messages.getScheduledHistory#e2c2685b\",\n\t\t0xbdbb0464: \"messages.getScheduledMessages#bdbb0464\",\n\t\t0xbd38850a: \"messages.sendScheduledMessages#bd38850a\",\n\t\t0x59ae2b16: \"messages.deleteScheduledMessages#59ae2b16\",\n\t\t0xb86e380e: \"messages.getPollVotes#b86e380e\",\n\t\t0xb5052fea: \"messages.toggleStickerSets#b5052fea\",\n\t\t0xf19ed96d: \"messages.getDialogFilters#f19ed96d\",\n\t\t0xa29cd42c: \"messages.getSuggestedDialogFilters#a29cd42c\",\n\t\t0x1ad4a04a: \"messages.updateDialogFilter#1ad4a04a\",\n\t\t0xc563c1e4: \"messages.updateDialogFiltersOrder#c563c1e4\",\n\t\t0x5fe7025b: \"messages.getOldFeaturedStickers#5fe7025b\",\n\t\t0x24b581ba: \"messages.getReplies#24b581ba\",\n\t\t0x446972fd: \"messages.getDiscussionMessage#446972fd\",\n\t\t0xf731a9f4: \"messages.readDiscussion#f731a9f4\",\n\t\t0xf025bc8b: \"messages.unpinAllMessages#f025bc8b\",\n\t\t0xedd4882a: \"updates.getState#edd4882a\",\n\t\t0x25939651: \"updates.getDifference#25939651\",\n\t\t0x3173d78: \"updates.getChannelDifference#3173d78\",\n\t\t0x72d4742c: \"photos.updateProfilePhoto#72d4742c\",\n\t\t0x89f30f69: \"photos.uploadProfilePhoto#89f30f69\",\n\t\t0x87cf7f2f: \"photos.deletePhotos#87cf7f2f\",\n\t\t0x91cd32a8: \"photos.getUserPhotos#91cd32a8\",\n\t\t0xb304a621: \"upload.saveFilePart#b304a621\",\n\t\t0xb15a9afc: \"upload.getFile#b15a9afc\",\n\t\t0xde7b673d: \"upload.saveBigFilePart#de7b673d\",\n\t\t0x24e6818d: \"upload.getWebFile#24e6818d\",\n\t\t0x2000bcc3: \"upload.getCdnFile#2000bcc3\",\n\t\t0x9b2754a8: \"upload.reuploadCdnFile#9b2754a8\",\n\t\t0x4da54231: \"upload.getCdnFileHashes#4da54231\",\n\t\t0xc7025931: \"upload.getFileHashes#c7025931\",\n\t\t0xc4f9186b: \"help.getConfig#c4f9186b\",\n\t\t0x1fb33026: \"help.getNearestDc#1fb33026\",\n\t\t0x522d5a7d: \"help.getAppUpdate#522d5a7d\",\n\t\t0x4d392343: \"help.getInviteText#4d392343\",\n\t\t0x9cdf08cd: \"help.getSupport#9cdf08cd\",\n\t\t0x9010ef6f: \"help.getAppChangelog#9010ef6f\",\n\t\t0xec22cfcd: \"help.setBotUpdatesStatus#ec22cfcd\",\n\t\t0x52029342: \"help.getCdnConfig#52029342\",\n\t\t0x3dc0f114: \"help.getRecentMeUrls#3dc0f114\",\n\t\t0x2ca51fd1: \"help.getTermsOfServiceUpdate#2ca51fd1\",\n\t\t0xee72f79a: \"help.acceptTermsOfService#ee72f79a\",\n\t\t0x3fedc75f: \"help.getDeepLinkInfo#3fedc75f\",\n\t\t0x98914110: \"help.getAppConfig#98914110\",\n\t\t0x6f02f748: \"help.saveAppLog#6f02f748\",\n\t\t0xc661ad08: \"help.getPassportConfig#c661ad08\",\n\t\t0xd360e72c: \"help.getSupportName#d360e72c\",\n\t\t0x38a08d3: \"help.getUserInfo#38a08d3\",\n\t\t0x66b91b70: \"help.editUserInfo#66b91b70\",\n\t\t0xc0977421: \"help.getPromoData#c0977421\",\n\t\t0x1e251c95: \"help.hidePromoData#1e251c95\",\n\t\t0x77fa99f: \"help.dismissSuggestion#77fa99f\",\n\t\t0x735787a8: \"help.getCountriesList#735787a8\",\n\t\t0xcc104937: \"channels.readHistory#cc104937\",\n\t\t0x84c1fd4e: \"channels.deleteMessages#84c1fd4e\",\n\t\t0xd10dd71b: \"channels.deleteUserHistory#d10dd71b\",\n\t\t0xfe087810: \"channels.reportSpam#fe087810\",\n\t\t0xad8c9a23: \"channels.getMessages#ad8c9a23\",\n\t\t0x123e05e9: \"channels.getParticipants#123e05e9\",\n\t\t0x546dd7a6: \"channels.getParticipant#546dd7a6\",\n\t\t0xa7f6bbb: \"channels.getChannels#a7f6bbb\",\n\t\t0x8736a09: \"channels.getFullChannel#8736a09\",\n\t\t0x3d5fb10f: \"channels.createChannel#3d5fb10f\",\n\t\t0xd33c8902: \"channels.editAdmin#d33c8902\",\n\t\t0x566decd0: \"channels.editTitle#566decd0\",\n\t\t0xf12e57c9: \"channels.editPhoto#f12e57c9\",\n\t\t0x10e6bd2c: \"channels.checkUsername#10e6bd2c\",\n\t\t0x3514b3de: \"channels.updateUsername#3514b3de\",\n\t\t0x24b524c5: \"channels.joinChannel#24b524c5\",\n\t\t0xf836aa95: \"channels.leaveChannel#f836aa95\",\n\t\t0x199f3a6c: \"channels.inviteToChannel#199f3a6c\",\n\t\t0xc0111fe3: \"channels.deleteChannel#c0111fe3\",\n\t\t0xe63fadeb: \"channels.exportMessageLink#e63fadeb\",\n\t\t0x1f69b606: \"channels.toggleSignatures#1f69b606\",\n\t\t0xf8b036af: \"channels.getAdminedPublicChannels#f8b036af\",\n\t\t0x72796912: \"channels.editBanned#72796912\",\n\t\t0x33ddf480: \"channels.getAdminLog#33ddf480\",\n\t\t0xea8ca4f9: \"channels.setStickers#ea8ca4f9\",\n\t\t0xeab5dc38: \"channels.readMessageContents#eab5dc38\",\n\t\t0xaf369d42: \"channels.deleteHistory#af369d42\",\n\t\t0xeabbb94c: \"channels.togglePreHistoryHidden#eabbb94c\",\n\t\t0x8341ecc0: \"channels.getLeftChannels#8341ecc0\",\n\t\t0xf5dad378: \"channels.getGroupsForDiscussion#f5dad378\",\n\t\t0x40582bb2: \"channels.setDiscussionGroup#40582bb2\",\n\t\t0x8f38cd1f: \"channels.editCreator#8f38cd1f\",\n\t\t0x58e63f6d: \"channels.editLocation#58e63f6d\",\n\t\t0xedd49ef0: \"channels.toggleSlowMode#edd49ef0\",\n\t\t0x11e831ee: \"channels.getInactiveChannels#11e831ee\",\n\t\t0xaa2769ed: \"bots.sendCustomRequest#aa2769ed\",\n\t\t0xe6213f4d: \"bots.answerWebhookJSONQuery#e6213f4d\",\n\t\t0x805d46f6: \"bots.setBotCommands#805d46f6\",\n\t\t0x99f09745: \"payments.getPaymentForm#99f09745\",\n\t\t0xa092a980: \"payments.getPaymentReceipt#a092a980\",\n\t\t0x770a8e74: \"payments.validateRequestedInfo#770a8e74\",\n\t\t0x2b8879b3: \"payments.sendPaymentForm#2b8879b3\",\n\t\t0x227d824b: \"payments.getSavedInfo#227d824b\",\n\t\t0xd83d70c1: \"payments.clearSavedInfo#d83d70c1\",\n\t\t0x2e79d779: \"payments.getBankCardData#2e79d779\",\n\t\t0xf1036780: \"stickers.createStickerSet#f1036780\",\n\t\t0xf7760f51: \"stickers.removeStickerFromSet#f7760f51\",\n\t\t0xffb6d4ca: \"stickers.changeStickerPosition#ffb6d4ca\",\n\t\t0x8653febe: \"stickers.addStickerToSet#8653febe\",\n\t\t0x9a364e30: \"stickers.setStickerSetThumb#9a364e30\",\n\t\t0x55451fa9: \"phone.getCallConfig#55451fa9\",\n\t\t0x42ff96ed: \"phone.requestCall#42ff96ed\",\n\t\t0x3bd2b4a0: \"phone.acceptCall#3bd2b4a0\",\n\t\t0x2efe1722: \"phone.confirmCall#2efe1722\",\n\t\t0x17d54f61: \"phone.receivedCall#17d54f61\",\n\t\t0xb2cbc1c0: \"phone.discardCall#b2cbc1c0\",\n\t\t0x59ead627: \"phone.setCallRating#59ead627\",\n\t\t0x277add7e: \"phone.saveCallDebug#277add7e\",\n\t\t0xff7a9383: \"phone.sendSignalingData#ff7a9383\",\n\t\t0xbd3dabe0: \"phone.createGroupCall#bd3dabe0\",\n\t\t0x5f9c8e62: \"phone.joinGroupCall#5f9c8e62\",\n\t\t0x500377f9: \"phone.leaveGroupCall#500377f9\",\n\t\t0x63146ae4: \"phone.editGroupCallMember#63146ae4\",\n\t\t0x7b393160: \"phone.inviteToGroupCall#7b393160\",\n\t\t0x7a777135: \"phone.discardGroupCall#7a777135\",\n\t\t0x74bbb43d: \"phone.toggleGroupCallSettings#74bbb43d\",\n\t\t0xc7cb017: \"phone.getGroupCall#c7cb017\",\n\t\t0xc9f1d285: \"phone.getGroupParticipants#c9f1d285\",\n\t\t0xb74a7bea: \"phone.checkGroupCall#b74a7bea\",\n\t\t0xf2f2330a: \"langpack.getLangPack#f2f2330a\",\n\t\t0xefea3803: \"langpack.getStrings#efea3803\",\n\t\t0xcd984aa5: \"langpack.getDifference#cd984aa5\",\n\t\t0x42c6978f: \"langpack.getLanguages#42c6978f\",\n\t\t0x6a596502: \"langpack.getLanguage#6a596502\",\n\t\t0x6847d0ab: \"folders.editPeerFolders#6847d0ab\",\n\t\t0x1c295881: \"folders.deleteFolder#1c295881\",\n\t\t0xab42441a: \"stats.getBroadcastStats#ab42441a\",\n\t\t0x621d5fa0: \"stats.loadAsyncGraph#621d5fa0\",\n\t\t0xdcdf8607: \"stats.getMegagroupStats#dcdf8607\",\n\t\t0x5630281b: \"stats.getMessagePublicForwards#5630281b\",\n\t\t0xb6e0a3f5: \"stats.getMessageStats#b6e0a3f5\",\n\t}\n}", "title": "" }, { "docid": "9716e6e2ce63c7c4cba9b14b7603d182", "score": "0.37331122", "text": "func prepareInputDialog(dialogSession *userDialogInputSessionInfo) events.UpdateViewEvent {\n\tanswer := dialogSession.inputAnswer\n\tif dialogSession.inputAnswerMasked {\n\t\tanswerLen := utf8.RuneCountInString(dialogSession.inputAnswer)\n\t\tanswer = strings.Repeat(\"*\", answerLen)\n\t}\n\n\treturn events.UpdateViewEvent{\n\t\tType: events.UpdateViewShowQuestionDialog,\n\t\tDialogQuestion: dialogSession.inputQuestion,\n\t\tDialogAnswer: answer,\n\t\tDialogAnswerCursorIdx: dialogSession.inputAnswerCursorIdx}\n}", "title": "" }, { "docid": "b24e7ee0442ac47e7ade84900d191f67", "score": "0.37278244", "text": "func (o *ExtendedFlowSpecificationOption) Hint() uint8 { return optionHintFromTypeHint(o.TypeHint) }", "title": "" }, { "docid": "b74c8fbc498271a94b0c26f2e214d568", "score": "0.3724956", "text": "func UseSignal(signal Signals) ActorOption {\n\treturn func(ac *Prop) {\n\t\tac.Signals = signal\n\t}\n}", "title": "" }, { "docid": "8ba589bc90bf0741675eb08ad2996f6e", "score": "0.3723782", "text": "func (s *BaseJavaListener) EnterTypeArguments(ctx *TypeArgumentsContext) {}", "title": "" }, { "docid": "aeaeca96d3a7e025bf19f5a4a7d5684d", "score": "0.37167755", "text": "func (app *App) AddTypeScriptDevelopmentPath(path string) {\n\tapp.development.typeScript = append(app.development.typeScript, path)\n}", "title": "" }, { "docid": "f1dbc85d72b0841452cc496584739a03", "score": "0.36985138", "text": "func ReceiveWithWantConnectorType(want bool) ReceiveOption {\n\treturn ReceiveOption{\n\t\tset: func(opts *receiveOptions) {\n\t\t\topts.wantConnectorType = want\n\t\t},\n\t}\n}", "title": "" }, { "docid": "f5d103522013870607ddbf66187e6951", "score": "0.3697574", "text": "func TypeString(ev Event) string {\n\tif ev, ok := ev.(TypeStringer); ok {\n\t\treturn ev.TypeString()\n\t}\n\treturn ev.Type().String()\n}", "title": "" }, { "docid": "27fa338d2cfd218fa980bbe250cc39a4", "score": "0.3688392", "text": "func UseDeviceFlow() bool {\n\treturn UseDevice_Flow\n}", "title": "" }, { "docid": "1fe99a1e0e7b1eeca3df67d8d22c3c3b", "score": "0.3684979", "text": "func (uw *UnitWriter) SetupAppIO(p *stage1commontypes.Pod, ra *schema.RuntimeApp, binPath string, opts ...*unit.UnitOption) []*unit.UnitOption {\n\tif uw.err != nil {\n\t\treturn opts\n\t}\n\n\tif p.Interactive {\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardInput\", \"tty\"))\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardOutput\", \"tty\"))\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardError\", \"tty\"))\n\t\treturn opts\n\t}\n\n\tflavor, systemdVersion, err := GetFlavor(uw.p)\n\tif err != nil {\n\t\tuw.err = err\n\t\treturn opts\n\t}\n\n\tstdin, _ := ra.Annotations.Get(stage1commontypes.AppStdinMode)\n\tstdout, _ := ra.Annotations.Get(stage1commontypes.AppStdoutMode)\n\tstderr, _ := ra.Annotations.Get(stage1commontypes.AppStderrMode)\n\n\t// Attach needs https://github.com/systemd/systemd/pull/4179, ie. systemd v232 or a backport\n\tif ((flavor == \"src\" || flavor == \"host\") && systemdVersion < 232) ||\n\t\t((flavor == \"coreos\" || flavor == \"kvm\") && systemdVersion < 231) {\n\t\t// Explicit error if systemd is too old for attaching\n\t\tif stdin != \"\" || stdout != \"\" || stderr != \"\" {\n\t\t\tuw.err = fmt.Errorf(\"stage1 systemd %q does not support attachable I/O\", systemdVersion)\n\t\t\treturn opts\n\t\t}\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardInput\", \"null\"))\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardOutput\", \"journal+console\"))\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardError\", \"journal+console\"))\n\t\treturn opts\n\t}\n\n\tvar iottymuxEnvFlags []string\n\tneedsIOMux := false\n\tneedsTTYMux := false\n\n\tswitch stdin {\n\tcase \"stream\":\n\t\tneedsIOMux = true\n\t\tuw.AppSocketUnit(ra.Name, binPath, \"stdin\")\n\t\tiottymuxEnvFlags = append(iottymuxEnvFlags, \"STAGE2_STDIN=true\")\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardInput\", \"fd\"))\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"Sockets\", fmt.Sprintf(\"%s-%s.socket\", ra.Name, \"stdin\")))\n\tcase \"tty\":\n\t\tneedsTTYMux = true\n\t\tiottymuxEnvFlags = append(iottymuxEnvFlags, \"STAGE2_STDIN=true\")\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardInput\", \"tty-force\"))\n\tcase \"interactive\":\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardInput\", \"tty\"))\n\tdefault:\n\t\t// null mode\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardInput\", \"null\"))\n\t}\n\n\tswitch stdout {\n\tcase \"stream\":\n\t\tneedsIOMux = true\n\t\tuw.AppSocketUnit(ra.Name, binPath, \"stdout\")\n\t\tiottymuxEnvFlags = append(iottymuxEnvFlags, \"STAGE2_STDOUT=true\")\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardOutput\", \"fd\"))\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"Sockets\", fmt.Sprintf(\"%s-%s.socket\", ra.Name, \"stdout\")))\n\tcase \"tty\":\n\t\tneedsTTYMux = true\n\t\tiottymuxEnvFlags = append(iottymuxEnvFlags, \"STAGE2_STDOUT=true\")\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardOutput\", \"tty\"))\n\tcase \"interactive\":\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardOutput\", \"tty\"))\n\tcase \"null\":\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardOutput\", \"null\"))\n\tdefault:\n\t\t// log mode\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardOutput\", \"journal+console\"))\n\t}\n\n\tswitch stderr {\n\tcase \"stream\":\n\t\tneedsIOMux = true\n\t\tuw.AppSocketUnit(ra.Name, binPath, \"stderr\")\n\t\tiottymuxEnvFlags = append(iottymuxEnvFlags, \"STAGE2_STDERR=true\")\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardError\", \"fd\"))\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"Sockets\", fmt.Sprintf(\"%s-%s.socket\", ra.Name, \"stderr\")))\n\tcase \"tty\":\n\t\tneedsTTYMux = true\n\t\tiottymuxEnvFlags = append(iottymuxEnvFlags, \"STAGE2_STDERR=true\")\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardError\", \"tty\"))\n\tcase \"interactive\":\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardError\", \"tty\"))\n\tcase \"null\":\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardError\", \"null\"))\n\tdefault:\n\t\t// log mode\n\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"StandardError\", \"journal+console\"))\n\t}\n\n\t// if at least one stream requires I/O muxing, an appropriate iottymux dependency needs to be setup\n\tif needsIOMux || needsTTYMux {\n\t\t// an env file is written here for iottymux, containing service configuration.\n\t\tappIODir := IOMuxDir(p.Root, ra.Name)\n\t\tos.MkdirAll(appIODir, 0644)\n\t\tfile, err := os.OpenFile(filepath.Join(appIODir, \"env\"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)\n\t\tif err != nil {\n\t\t\tuw.err = err\n\t\t\treturn nil\n\t\t}\n\t\tdefer file.Close()\n\n\t\t// env file specifies: debug verbosity, which streams to mux and whether a dedicated TTY is needed.\n\t\tfile.WriteString(fmt.Sprintf(\"STAGE2_TTY=%t\\n\", needsTTYMux))\n\t\tfile.WriteString(fmt.Sprintf(\"STAGE1_DEBUG=%t\\n\", p.Debug))\n\t\tfor _, l := range iottymuxEnvFlags {\n\t\t\tfile.WriteString(l + \"\\n\")\n\t\t}\n\n\t\tif needsIOMux {\n\t\t\t// streaming mode brings in a `iomux@.service` before-dependency\n\t\t\topts = append(opts, unit.NewUnitOption(\"Unit\", \"Requires\", fmt.Sprintf(\"iomux@%s.service\", ra.Name)))\n\t\t\topts = append(opts, unit.NewUnitOption(\"Unit\", \"Before\", fmt.Sprintf(\"iomux@%s.service\", ra.Name)))\n\t\t\tlogMode, ok := p.Manifest.Annotations.Get(\"coreos.com/rkt/experiment/logmode\")\n\t\t\tif ok {\n\t\t\t\tfile.WriteString(fmt.Sprintf(\"STAGE1_LOGMODE=%s\\n\", logMode))\n\t\t\t}\n\t\t} else if needsTTYMux {\n\t\t\t// tty mode brings in a `ttymux@.service` after-dependency (it needs to create the TTY first)\n\t\t\topts = append(opts, unit.NewUnitOption(\"Service\", \"TTYPath\", filepath.Join(\"/rkt/iottymux\", ra.Name.String(), \"stage2-pts\")))\n\t\t\topts = append(opts, unit.NewUnitOption(\"Unit\", \"Requires\", fmt.Sprintf(\"ttymux@%s.service\", ra.Name)))\n\t\t\topts = append(opts, unit.NewUnitOption(\"Unit\", \"After\", fmt.Sprintf(\"ttymux@%s.service\", ra.Name)))\n\t\t}\n\t}\n\treturn opts\n}", "title": "" }, { "docid": "93c4403388d48a7440b3af9dfa0bd2c7", "score": "0.36820203", "text": "func (eptuo *EquipmentPortTypeUpdateOne) AddPropertyTypes(p ...*PropertyType) *EquipmentPortTypeUpdateOne {\n\tids := make([]string, len(p))\n\tfor i := range p {\n\t\tids[i] = p[i].ID\n\t}\n\treturn eptuo.AddPropertyTypeIDs(ids...)\n}", "title": "" }, { "docid": "558b59016a2d93454b577e94b7903d03", "score": "0.3681022", "text": "func (s *BasepowerbuilderListener) EnterDatatype_decl(ctx *Datatype_declContext) {}", "title": "" }, { "docid": "b48533816971e5a896f2945e2c00e933", "score": "0.3675058", "text": "func (a *ActionDefinition) UserTypes() map[string]*UserTypeDefinition {\n\ttypes := make(map[string]*UserTypeDefinition)\n\tallp := a.AllParams().Type.ToObject()\n\tif a.Payload != nil {\n\t\tallp[\"__payload__\"] = &AttributeDefinition{Type: a.Payload}\n\t}\n\tfor n, ut := range UserTypes(allp) {\n\t\ttypes[n] = ut\n\t}\n\tfor _, r := range a.Responses {\n\t\tif mt := Design.MediaTypeWithIdentifier(r.MediaType); mt != nil {\n\t\t\ttypes[mt.TypeName] = mt.UserTypeDefinition\n\t\t\tfor n, ut := range UserTypes(mt.UserTypeDefinition) {\n\t\t\t\ttypes[n] = ut\n\t\t\t}\n\t\t}\n\t}\n\tif len(types) == 0 {\n\t\treturn nil\n\t}\n\treturn types\n}", "title": "" }, { "docid": "43e46d6449b3d91f53df96d1517e8042", "score": "0.36611634", "text": "func (s *SubscriptionStatus) InitializeEventTypes() {\n\ts.Types = []EventType{}\n}", "title": "" }, { "docid": "501918214b73d44ad4d6e9a4866a2c9c", "score": "0.36603642", "text": "func (eptu *EquipmentPortTypeUpdate) AddPropertyTypes(p ...*PropertyType) *EquipmentPortTypeUpdate {\n\tids := make([]string, len(p))\n\tfor i := range p {\n\t\tids[i] = p[i].ID\n\t}\n\treturn eptu.AddPropertyTypeIDs(ids...)\n}", "title": "" }, { "docid": "7a414afa117197fa397e831fd5c6c740", "score": "0.36567777", "text": "func Relative(absolute uint64, fncode *FnCode) (uint64, error) {\n\tswitch {\n\tcase absolute >= 0 && absolute <= 65535:\n\t\t*fncode = RDCO\n\t\treturn absolute, nil\n\tcase absolute >= 100000 && absolute <= 165535:\n\t\t*fncode = RDDI\n\t\treturn absolute - 100000, nil\n\tcase absolute >= 300000 && absolute <= 365535:\n\t\t*fncode = RDIR\n\t\treturn absolute - 300000, nil\n\tcase absolute >= 400000 && absolute <= 465535:\n\t\t*fncode = RDHR\n\t\treturn absolute - 400000, nil\n\tdefault:\n\t\t*fncode = FERR\n\t\treturn absolute, fmt.Errorf(\"Unable to convert address to relative: %v\", absolute)\n\t}\n}", "title": "" }, { "docid": "c3d6f9bdfd6b889a2f626be6a79f48ea", "score": "0.36536047", "text": "func (s *BasealefListener) EnterTypename(ctx *TypenameContext) {}", "title": "" } ]
9a6bef28afa9502c1e91cd07ad54b513
Bool returns a single bool from groupby. It is only allowed when querying groupby with one field.
[ { "docid": "5f72a7772346979a400d70228576bb2c", "score": "0.6715478", "text": "func (fdgb *FurnitureDetailGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = fdgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{furnituredetail.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: FurnitureDetailGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" } ]
[ { "docid": "2a4fe646e2568ee9fb88b85fa2efc022", "score": "0.70322996", "text": "func (wfgb *WithFieldsGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = wfgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{withfields.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: WithFieldsGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "6a876ed97c3edd81924dbdb2e8e39785", "score": "0.68730205", "text": "func (hgb *HarborGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = hgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{harbor.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: HarborGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "6f2331d0a396bcba28b704a2ced9237c", "score": "0.6705686", "text": "func (lugb *LastUpdatedGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = lugb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{lastupdated.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: LastUpdatedGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "56d6a123b6835312e387c5d4a32be6a4", "score": "0.6688538", "text": "func (iggb *ItemGroupGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = iggb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{itemgroup.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: ItemGroupGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "7e23b5b8dcb35659b67ae9277204966d", "score": "0.6683914", "text": "func (goagb *GroupOfAgeGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = goagb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{groupofage.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: GroupOfAgeGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "f4d8fc5ee2be33099445452ccfe7d9bb", "score": "0.6664186", "text": "func (egb *EntityGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = egb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{entity.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: EntityGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "eff31ce601a44d278b5c973b79522178", "score": "0.6530092", "text": "func (pggb *PlayGroupGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = pggb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{playgroup.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: PlayGroupGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "129b0db9129c25620e0e14c13c7648ab", "score": "0.65172565", "text": "func (upgb *UnsavedPostGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = upgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{unsavedpost.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: UnsavedPostGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "678e45ce14d9fcdc5a63352824817564", "score": "0.64984417", "text": "func (wgb *WidgetGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = wgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{widget.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: WidgetGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "411e003c74e4c6336047a0e3a417bc13", "score": "0.649019", "text": "func (sigb *SubItemGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = sigb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{subitem.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: SubItemGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "9d054d199f0c8220236708808abf9709", "score": "0.64785904", "text": "func (rogb *RestaurantOwnerGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = rogb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{restaurantowner.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: RestaurantOwnerGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "1ed975360d53c3a3003b87ae93a8f90d", "score": "0.64623934", "text": "func (pgb *ParticipantGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = pgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{participant.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: ParticipantGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "a09ccf0af80d992068ae10d24720f115", "score": "0.6439234", "text": "func (rgb *RemedyGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = rgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{remedy.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: RemedyGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "12034a0b279b9b7c1763f830cecf7877", "score": "0.64342153", "text": "func (rgb *RentGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = rgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{rent.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: RentGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "c54728e1359f7f3ef221260be929daa6", "score": "0.6431437", "text": "func (degb *DentalExpenseGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = degb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{dentalexpense.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: DentalExpenseGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "c6ddd12d12f6634043846c06cca53a04", "score": "0.64066344", "text": "func (ggb *GoodsGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = ggb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{goods.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: GoodsGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "0c5eeea466bcaabd3cb2471a339f6db4", "score": "0.6400767", "text": "func (sgb *ServerGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = sgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{server.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: ServerGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "6980d63efe5f506203cd69fbb096a784", "score": "0.63743407", "text": "func (dagb *DrugAllergyGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = dagb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{drugallergy.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: DrugAllergyGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "ecf72228c0e0c29508dd39cb33b3580b", "score": "0.6364106", "text": "func (ougb *OrgUnitGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = ougb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{orgunit.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: OrgUnitGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "094b88c3762626c10a4c73603d705c28", "score": "0.634468", "text": "func (ulgb *UserLogGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = ulgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{userlog.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: UserLogGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "75c4aee9df419a990a5999b7105299da", "score": "0.6281484", "text": "func (oupgb *OrgUnitPositionGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = oupgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{orgunitposition.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: OrgUnitPositionGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "4c11a42d49846d1110eb881b80f3d05a", "score": "0.62618095", "text": "func (rgb *ReceiptGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = rgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{receipt.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: ReceiptGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "088b54ee0917c1e9b892cfd2226fd1ba", "score": "0.6241095", "text": "func (ecpgb *EntityContactPointGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = ecpgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{entitycontactpoint.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: EntityContactPointGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "060635cc696f06805e2508e44943838a", "score": "0.62379926", "text": "func (vgb *VehicleGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = vgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{vehicle.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: VehicleGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "d1ed8238b7c8a911bcda245670d3d406", "score": "0.62331784", "text": "func (wgb *WorkflowGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = wgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{workflow.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: WorkflowGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "486d4d657dc5b65e79a98032c913c54d", "score": "0.6219848", "text": "func (ksgb *KqiSourceGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = ksgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{kqisource.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: KqiSourceGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "91420b4c01f5b6753ce53c7abd8cec54", "score": "0.6210285", "text": "func (fgb *ForumGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = fgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{forum.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: ForumGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "57293fc64137a8e8ac913ac9a68618e1", "score": "0.615534", "text": "func (lbgb *LatestBlockGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = lbgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{latestblock.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: LatestBlockGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "aba533a5a1bcc4f5ff4e83216b407bde", "score": "0.61331487", "text": "func (bgb *BrowserGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = bgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{browser.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: BrowserGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "b150671f3a68e6689876c7e5a951fa24", "score": "0.6125588", "text": "func (wfgb *WithFieldsGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := wfgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "b463e24059030608349164f3152a7757", "score": "0.60989314", "text": "func (esgb *EventSeverityGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = esgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{eventseverity.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: EventSeverityGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "6d38f2e10f5e3f6564ae1c2f1a007b87", "score": "0.6073402", "text": "func (klgb *K8sLabelGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = klgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{k8slabel.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: K8sLabelGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "1c7824f639f6ddcdaf2dc85b2a756053", "score": "0.6069167", "text": "func (urgb *UserRoleGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = urgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{userrole.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: UserRoleGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "921f4c68621ce76cedce64b7fb57b69e", "score": "0.6067611", "text": "func (rlgb *RuleLimitGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = rlgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{rulelimit.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: RuleLimitGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "4eaea931a4a46bf39feb47d65538fa79", "score": "0.6065319", "text": "func (o *EventsScalarQuery) HasGroupBy() bool {\n\treturn o != nil && o.GroupBy != nil\n}", "title": "" }, { "docid": "5552e5284f3682861a4c575528bf736b", "score": "0.6051785", "text": "func (hgb *HarborGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := hgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "f424f48388a7ce6a3e1def00e99e70f9", "score": "0.60465705", "text": "func (irgb *InstanceRuntimeGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = irgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{instanceruntime.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: InstanceRuntimeGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "14a3ff0ae7d7aa50d005e01236418133", "score": "0.6013685", "text": "func (egb *EntityGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := egb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "14486a9b89ae5487e9c7d04d9c3a1ad2", "score": "0.60013515", "text": "func (igs *ItemGroupSelect) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = igs.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{itemgroup.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: ItemGroupSelect.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "251e8f3f3e4c1063fe35baca4ddef499", "score": "0.59939086", "text": "func (goas *GroupOfAgeSelect) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = goas.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{groupofage.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: GroupOfAgeSelect.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "42dc3c329975c5fdc580a83caaca35b1", "score": "0.5974991", "text": "func (rrgb *ReserveRoomGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = rrgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{reserveroom.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: ReserveRoomGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "38724c9a6ec7d50be052bfa30cd258a2", "score": "0.59696835", "text": "func (wgb *WordGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = wgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{word.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: WordGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "91b7fd6b4c4b3c4092e117bf1d82641b", "score": "0.59571064", "text": "func (cgb *ConfirmationGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = cgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{confirmation.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: ConfirmationGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "7e8f1c7231c183c5d641db5a6f2d1e8a", "score": "0.59544116", "text": "func (lugb *LastUpdatedGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := lugb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "b02df9320346322e2234bbfae665f365", "score": "0.59451795", "text": "func (fdgb *FurnitureDetailGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := fdgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "5d0505fd9e31e7f9aad8c651776dd861", "score": "0.59317774", "text": "func (wtgb *WorkerTypeGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = wtgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{workertype.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: WorkerTypeGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "228ffcd2ead5644cf9399079c21bdb0c", "score": "0.5878395", "text": "func (nsgb *NamespaceSecretGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = nsgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{namespacesecret.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: NamespaceSecretGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "515c618b57d005b8fa850dfcad5c14c7", "score": "0.58537316", "text": "func (sigb *SubItemGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := sigb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "6f86157d9f4fdc730a1f93f561338748", "score": "0.5846444", "text": "func (r Record) Bool(key string) bool {\n\tif r.dropped {\n\t\tlog.Fatalf(\"Int called on dropped record\")\n\t}\n\n\tval, ok := r.values[key]\n\tif !ok {\n\t\treturn false\n\t}\n\n\tswitch val := val.(type) {\n\tcase nil:\n\t\treturn false\n\tcase string:\n\t\treturn val == \"true\"\n\tcase int64:\n\t\treturn val != 0\n\tcase float64:\n\t\treturn val != 0.0\n\tcase bool:\n\t\treturn val\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ee95cbd8d94db9c4616b024642e840c1", "score": "0.58324546", "text": "func (iggb *ItemGroupGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := iggb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "0e1a7ae42d8f7c53d621a4d596ead419", "score": "0.58178747", "text": "func (wewgb *WorkflowEventsWaitGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = wewgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{workfloweventswait.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: WorkflowEventsWaitGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "be4b29ce70433ca26d4eb3049ff541e1", "score": "0.5770783", "text": "func (pgb *ParticipantGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := pgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "c6872c3f49b394b4e6a4c60ed51e30c9", "score": "0.574468", "text": "func (ggb *GoodsGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := ggb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "eedb6d3d827a6e97a24212dd20418272", "score": "0.5731895", "text": "func (goagb *GroupOfAgeGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := goagb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "a2e3cc9f43cebab18e9f353b7c4dc2df", "score": "0.5731069", "text": "func (wgb *WidgetGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := wgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "38c9451966ee0c156969135ce04baf53", "score": "0.5713588", "text": "func (pggb *PlayGroupGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := pggb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "1d1af8b319ca11a272c372bb6cddadc4", "score": "0.569269", "text": "func (sgb *ServerGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := sgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "2dcb9ea684fe007a57db7cd35496becb", "score": "0.56672496", "text": "func (rogb *RestaurantOwnerGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := rogb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "451822e9407dd3dbe8b47525b5dc6074", "score": "0.5663201", "text": "func Boolean() Scalar {\n\treturn booleanTypeInstance\n}", "title": "" }, { "docid": "a9134ee4282062a7a1eb24c9b4a41e05", "score": "0.5650019", "text": "func (upgb *UnsavedPostGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := upgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "43ca58920fcf5aeec8e8db861f3709cf", "score": "0.56495947", "text": "func (pgs *PlayGroupSelect) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = pgs.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{playgroup.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: PlayGroupSelect.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "8004bc6844b8b88a7a51eeba4423b1f4", "score": "0.5645362", "text": "func Bool(key string, val bool) Field {\n\tvar ival int64\n\tif val {\n\t\tival = 1\n\t}\n\treturn Field{Key: key, Type: core.BoolType, Integer: ival}\n}", "title": "" }, { "docid": "8a0bd1a9bdf7ea01a6a2c6afb4a88cbe", "score": "0.5640609", "text": "func (ougb *OrgUnitGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := ougb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "a6ef0c5931d843ae6b3fca0b26bb5484", "score": "0.561999", "text": "func (rgb *RemedyGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := rgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "c1d1dd44f8e48eaf5fcbca8317935a27", "score": "0.56117016", "text": "func (v Value) Bool() bool {\n\treturn v.Integer() != 0\n}", "title": "" }, { "docid": "4f9b24ba2867fec04056ed29fe343ff7", "score": "0.55884355", "text": "func (degb *DentalExpenseGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := degb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "18eded07aa89a6c9e07479205e0aff64", "score": "0.55838984", "text": "func (v *Value) Bool() bool {\n return Util.ToBool(v.data)\n}", "title": "" }, { "docid": "32b0bb09f64f7a13abaa0374783054cb", "score": "0.55824226", "text": "func (ksgb *KqiSourceGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := ksgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "4b98889fa3bf1a4cd9c2fd6ae5fd9db1", "score": "0.5575875", "text": "func (m *Value) Bool() bool { return m.BoolMock() }", "title": "" }, { "docid": "4e0a372ffaa13d661e6e265cfcf74fe0", "score": "0.5569497", "text": "func (wgb *WifiGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = wgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{wifi.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: WifiGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "0ac0c489f7f0a074c974460f03beeb67", "score": "0.554953", "text": "func (dagb *DrugAllergyGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := dagb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "9f88caa5e2e557eb074cefe04fc43673", "score": "0.55265594", "text": "func (ulgb *UserLogGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := ulgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "7a91f619429d7a526cfe5cc4902ab261", "score": "0.5524644", "text": "func (lbgb *LatestBlockGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := lbgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "7c0cb9c21fb778e373d0aa4f0c36e02e", "score": "0.5524631", "text": "func Bool(b bool) BooleanField {\n\treturn BooleanField{\n\t\tvalue: &b,\n\t}\n}", "title": "" }, { "docid": "95d174abb7ddea86309df2695abbc4ea", "score": "0.5497484", "text": "func (nimgb *NetInterfaceModeGroupBy) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = nimgb.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{netinterfacemode.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: NetInterfaceModeGroupBy.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "ffc8ef4ea583994d9f63e5b7a41e96e7", "score": "0.5490053", "text": "func (wgb *WorkflowGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := wgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "c7de2b9756f95dac30c8934ed8c13334", "score": "0.54796726", "text": "func (r Result) ByFunc() bool {\n\treturn r.flags&reportByFunc != 0\n}", "title": "" }, { "docid": "70dc5157dce5d501457801732e3a35da", "score": "0.5478824", "text": "func (ecpgb *EntityContactPointGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := ecpgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "1b11979ba8b3f4781d522ad31d84dc6d", "score": "0.5478707", "text": "func (f *Fields) Bool(key string) (bool, error) {\n\tif v, ok := f.raw[key].(map[string]interface{}); ok {\n\t\treturn v[\"booleanValue\"].(bool), nil\n\t}\n\treturn false, errors.New(\"could not extract as bool\")\n}", "title": "" }, { "docid": "eabfbd265acc8f88c823f87d75950f87", "score": "0.5477593", "text": "func (oupgb *OrgUnitPositionGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := oupgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "ffcb6e691faa6f715ab7c7c024dec2cb", "score": "0.5475828", "text": "func (fgb *ForumGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := fgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "7aaf0522ed9f182e9274cd753f530545", "score": "0.5475267", "text": "func (o *FakeObject) Bool() bool { return o.Value.(bool) }", "title": "" }, { "docid": "b78001b09e3f9171afb78c4f2fba2592", "score": "0.54656875", "text": "func (nsgb *NamespaceSecretGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := nsgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "3e388bf04ecd428b6f024d5b39870ee7", "score": "0.54506165", "text": "func (rgb *RentGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := rgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "be731ec5485b4b1637cf5175bca4885a", "score": "0.54443115", "text": "func (bgb *BrowserGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := bgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "b433f425fc1800666524f65972bc6c96", "score": "0.5439387", "text": "func (klgb *K8sLabelGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := klgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "d49c249e873f15f10685f7ba7a861190", "score": "0.54264045", "text": "func (i *IE) IsGrouped() bool {\n\t_, ok := groupedMap[i.Type]\n\treturn ok\n}", "title": "" }, { "docid": "017f174c74bab0262a23544881539318", "score": "0.5425071", "text": "func (urgb *UserRoleGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := urgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "5d7d56686a3b3686bd9f317bcfa80e66", "score": "0.54079396", "text": "func (r *GetAttrsResult) Bool() bool {\n\tif !r.ok {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "14fe2275ffac532ee6a8c7f76da98254", "score": "0.54040843", "text": "func (v Value) Bool() bool {\n\treturn v.v.Bool()\n}", "title": "" }, { "docid": "905bc004fb1c9790b1336f22bc5cba5d", "score": "0.53948843", "text": "func (wgb *WordGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := wgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "a9fd94cab797f173eeb7f3a9955e9859", "score": "0.5380387", "text": "func (vgb *VehicleGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := vgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "71b6dcd198752c8bfc861375749286d8", "score": "0.53754956", "text": "func (lus *LastUpdatedSelect) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = lus.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{lastupdated.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: LastUpdatedSelect.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "028891f33059bb4d980cedb9b49bd07a", "score": "0.5356973", "text": "func (rgb *ReceiptGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := rgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "9114e7120e4f2659851c909971a1b3d8", "score": "0.5348527", "text": "func parseBool(content []byte, aggErr *AggregateError) bool {\n result, err := strconv.ParseBool(string(content))\n if err != nil {\n aggErr.Append(err)\n }\n return result\n}", "title": "" }, { "docid": "56a5db7f685d7c76943e16ad78fe8fed", "score": "0.53415084", "text": "func (s *selector) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = s.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{s.label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "396a18a53b02671e576a2630f4dbc274", "score": "0.5334585", "text": "func (rs *RentSelect) Bool(ctx context.Context) (_ bool, err error) {\n\tvar v []bool\n\tif v, err = rs.Bools(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{rent.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: RentSelect.Bools returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "53db15535b038c7cb5fd222782aaf5e3", "score": "0.53273976", "text": "func (s *Smpval) Bool() bool {\n\treturn s.b\n}", "title": "" }, { "docid": "6e525486f456b9706201a03382beb867", "score": "0.53237665", "text": "func (wtgb *WorkerTypeGroupBy) BoolX(ctx context.Context) bool {\n\tv, err := wtgb.Bool(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "8414771401428e68636163d4350a54f2", "score": "0.53165525", "text": "func (g *GroupBy) Resolved() bool {\n\treturn g.UnaryNode.Child.Resolved() &&\n\t\texpressionsResolved(g.SelectedExprs...) &&\n\t\texpressionsResolved(g.GroupByExprs...)\n}", "title": "" } ]
865bfea05d9e3637971cb584112c2386
Query performs a search against the repository
[ { "docid": "21654399e719a7c22ca3ed1e87369e8b", "score": "0.0", "text": "func (r *Elasticsearch) Query(collections []string, term string, bbox []float64, timeVal []time.Time, from int, size int, sr *search.Results) error {\n\tvar mr metadata.Record\n\t//\tvar query elastic.Query\n\tctx := context.Background()\n\n\tquery := elastic.NewBoolQuery()\n\n\tif term == \"\" {\n\t\tquery = query.Must(elastic.NewMatchAllQuery())\n\t} else {\n\t\tquery = query.Must(elastic.NewQueryStringQuery(term))\n\t}\n\tif len(timeVal) > 0 {\n\t\tif len(timeVal) == 1 { // exact match\n\t\t\tquery = query.Must(elastic.NewTermQuery(\"properties.product_info.acquisition_date\", timeVal[0]))\n\t\t} else if len(timeVal) == 2 { // range\n\t\t\trangeQuery := elastic.NewRangeQuery(\"properties.product_info.acquisition_date\").\n\t\t\t\tFrom(timeVal[0]).\n\t\t\t\tTo(timeVal[1])\n\t\t\tquery = query.Must(rangeQuery)\n\t\t}\n\t}\n\tif len(bbox) == 4 {\n\t\t// workaround for issuing a RawStringQuery until\n\t\t// GeoShape queries are supported (https://github.com/olivere/elastic/pull/276)\n\t\tvar tpl bytes.Buffer\n\t\tvars := map[string]interface{}{\n\t\t\t\"bbox\": bbox,\n\t\t\t\"field\": \"geometry\",\n\t\t}\n\t\trawStringQueryTemplate, _ := template.New(\"geo_shape_query\").Parse(`{ \n \"geo_shape\": {\n \"{{ .field }}\": {\n \"shape\": {\n \"type\": \"envelope\",\n \"coordinates\": [\n [ \n {{ index .bbox 0 }}, \n {{ index .bbox 1 }}\n ], \n [ \n {{ index .bbox 2 }}, \n {{ index .bbox 3 }}\n ] \n ]\n },\n \"relation\": \"within\"\n } \n } \n }`)\n\t\trawStringQueryTemplate.Execute(&tpl, vars)\n\n\t\tquery = query.Must(elastic.NewRawStringQuery(tpl.String()))\n\t}\n\tif len(collections) > 0 {\n\t\tc := make([]interface{}, len(collections))\n\t\tfor i, s := range collections {\n\t\t\tc[i] = s\n\t\t}\n\t\tquery = query.Must(elastic.NewTermsQuery(\"properties.product_info.collection\", c...))\n\t}\n\n\t//src, err := query.Source()\n\t//data, err := json.Marshal(src)\n\t//fmt.Println(string(data))\n\n\tsearchResult, err := r.Index.Search().\n\t\tIndex(r.IndexName).\n\t\tType(r.TypeName).\n\t\tFrom(from).\n\t\tSize(size).\n\t\tQuery(query).Do(ctx)\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tfmt.Println(\"JJJJ\")\n\t\treturn err\n\t}\n\n\tsr.ElapsedTime = int(searchResult.TookInMillis)\n\tsr.Matches = int(searchResult.TotalHits())\n\tsr.Returned = size\n\tsr.NextRecord = size + 1\n\n\tif sr.Matches < size {\n\t\tsr.Returned = sr.Matches\n\t\tsr.NextRecord = 0\n\t}\n\n\tfor _, item := range searchResult.Each(reflect.TypeOf(mr)) {\n\t\tif t, ok := item.(metadata.Record); ok {\n\t\t\tsr.Records = append(sr.Records, t)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "b42caa86310147631fcce4c1f096ddfd", "score": "0.6868039", "text": "func (s *RepositoryService) Query(rs app.RequestScope, offset, limit int) ([]*models.Repository, error) {\n\treturn s.dao.Query(rs.DB(), offset, limit)\n}", "title": "" }, { "docid": "c11a72c86da4f1e7652ddde7348886b7", "score": "0.6681561", "text": "func (pr *SearchRepository) Search(userID uint64, query string) (SearchVM, error) {\n\tvm := SearchVM{}\n\n\tif len(strings.TrimSpace(query)) == 0 {\n\t\treturn SearchVM{}, fmt.Errorf(\"Query string is empty\")\n\t}\n\terr := db.Where(\"user_id = ?\", userID).\n\t\tWhere(\"to_tsvector(name) @@ to_tsquery(?)\", fmt.Sprintf(\"%s:*\", query)).\n\t\tOrder(\"id asc\").Find(&vm.Categories).Error\n\tif err != nil {\n\t\treturn SearchVM{}, err\n\t}\n\n\terr = db.Preload(\"Tasks\").Preload(\"Category\").Where(\"user_id = ?\", userID).\n\t\tWhere(\"to_tsvector(name || ' ' || description) @@ to_tsquery(?)\", fmt.Sprintf(\"%s:*\", query)).\n\t\tOrder(\"archived asc, created_at asc\").Find(&vm.Projects).Error\n\tif err != nil {\n\t\treturn SearchVM{}, err\n\t}\n\n\tq := db.Where(\"user_id = ?\", userID).\n\t\tWhere(\"to_tsvector(name || ' ' || description) @@ to_tsquery(?)\", fmt.Sprintf(\"%s:*\", query)).\n\t\tPreload(\"Project\").Preload(\"Comments\").Preload(\"Category\")\n\tq = q.Preload(\"TaskLogs\", func(db *gorm.DB) *gorm.DB {\n\t\treturn db.Where(\"session_id = 0 and minutes > 0\")\n\t})\n\terr = q.Order(\"tasks.completed asc, tasks.created_at asc\").Find(&vm.Tasks).Error\n\tif err != nil {\n\t\treturn SearchVM{}, err\n\t}\n\n\terr = db.Where(\"user_id = ?\", userID).\n\t\tWhere(\"to_tsvector(contents) @@ to_tsquery(?)\", fmt.Sprintf(\"%s:*\", query)).\n\t\tOrder(\"id\").Find(&vm.Comments).Error\n\n\treturn vm, err\n}", "title": "" }, { "docid": "723802bc82e39c7804265a7fd6632e15", "score": "0.65389526", "text": "func (r *repo) Search(query string) ([]dbmodels.Repository, error) {\n\trc := r.db.Database().Collection(viper.GetString(\"db.repository_collection\"))\n\tctx, cancel := context.WithTimeout(\n\t\tcontext.Background(),\n\t\ttime.Duration(viper.GetInt(\"db.query_timeout_in_sec\"))*time.Second,\n\t)\n\tdefer cancel()\n\n\tfilter := bson.D{\n\t\t{\"$or\", []interface{}{\n\t\t\tbson.D{{\"name\", primitive.Regex{Pattern: query, Options: \"i\"}}},\n\t\t\tbson.D{{\"full_name\", primitive.Regex{Pattern: query, Options: \"i\"}}},\n\t\t}},\n\t}\n\n\tfilterCursor, err := rc.Find(ctx, filter)\n\tif err != nil {\n\t\treturn []dbmodels.Repository{}, fmt.Errorf(\"Failed to search repos with error %v\", err)\n\t}\n\n\tvar repos []dbmodels.Repository\n\tif err = filterCursor.All(ctx, &repos); err != nil {\n\t\treturn []dbmodels.Repository{}, fmt.Errorf(\"Failed to search repos with error %v\", err)\n\t}\n\n\treturn repos, nil\n}", "title": "" }, { "docid": "35607ec7f6e81f8248401c55f4686341", "score": "0.6258765", "text": "func (a *AllRepositories) Query() loaders.QueryRepository {\n\treturn a.query\n}", "title": "" }, { "docid": "be8b290fd623e448fa0d66fef9e3773e", "score": "0.6202645", "text": "func search(cl *lib.Client, r string, c, m, d int) ([]byte, []extAQLFileInfo, error) {\n\t// construct AQL query request\n\tvar request lib.Request\n\trequest.Verb = \"POST\"\n\trequest.Path = \"/api/search/aql\"\n\taqlString := fmt.Sprintf(`items.find(\n\t\t{\n\t\t\t\"$and\": [\n\t\t\t\t{\"repo\":\"%s\"},\n\t\t\t\t{\"created\": {\"$before\": \"%dmo\"}},\n\t\t\t\t{\"modified\": {\"$before\": \"%dmo\"}},\n\t\t\t\t{\"stat.downloaded\":{\"$before\": \"%dmo\"}}\n\t\t\t\t]\n\t\t\t}\n\t\t\t).include(\"updated\",\"created_by\",\"repo\",\"type\",\"size\",\"name\",\"modified_by\",\"path\",\"modified\",\"id\",\"actual_sha1\",\"created\",\"stat.downloaded\")`, r, c, m, d)\n\trequest.Body = bytes.NewReader([]byte(aqlString))\n\trequest.ContentType = \"text/plain\"\n\n\t// make request\n\tresp, err := cl.HTTPRequest(request)\n\tif err != nil {\n\t\texitErrorf(\"could not query Artifactory API: \", err)\n\t}\n\n\t// decode response bytes into json\n\tvar res extAQLResults\n\terr = json.Unmarshal(resp, &res)\n\tif err != nil {\n\t\texitErrorf(\"could not decode Artifactory response: \", err)\n\t}\n\tlist := res.ExtResults\n\n\treturn resp, list, nil\n}", "title": "" }, { "docid": "ea222b5aa9d03664d3c1e5c39c16bcf1", "score": "0.6139895", "text": "func (p *pgSerDe) Search(query SearchQuery) (SearchResult, error) {\n\n\tvar (\n\t\tsql = `SELECT id, ident FROM %[1]sds ds`\n\t\twhere string\n\t\targs []interface{}\n\t)\n\n\tif where, args = buildSearchWhere(query); len(args) > 0 {\n\t\tsql += fmt.Sprintf(\" WHERE %s\", where)\n\t}\n\n\trows, err := p.dbConn.Query(fmt.Sprintf(sql, p.prefix), args...)\n\tif err != nil {\n\t\tlog.Printf(\"Search(): error querying database: %v\", err)\n\t\treturn nil, err\n\t}\n\n\treturn &pgSearchResult{rows: rows}, nil\n}", "title": "" }, { "docid": "30daefbee43905ceaa061a88532bf29b", "score": "0.61338663", "text": "func (t *evidence_management) Query(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\n\tqueryString := args[1]\n\n\tqueryResults, err := getQueryResultForQueryString(stub, queryString)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\treturn shim.Success(queryResults)\n}", "title": "" }, { "docid": "13462598069a63189555f5993a8a80f1", "score": "0.6095032", "text": "func (s searcher) Search(ctx context.Context, query SearchQuery) (\n\tresp *SearchResult, err error) {\n\n\tsw := stopwatch.New()\n\tsw.Start(\"total\")\n\n\tvar (\n\t\trepo *Repo\n\t\tshards []string\n\t\tirepo interface{}\n\t\twaitingFor int\n\t\tch chan *SearchResult\n\t)\n\tresp = NewSearchResult()\n\n\t// If the repo is not found or is not available to search,\n\t// exit with a RepoUnavailable error. Ignore repo being\n\t// indexed currently.\n\trepokey := query.firstKey()\n\tlog.Info(\"search [%s] [path %s] local repo=%v\", query.Re, query.PathRe, repokey)\n\n\tif repokey == \"\" {\n\t\tresp.Error = kRepoKeyEmptyError.Error()\n\t\tlog.Debug(\"search backend error %v\", resp.Error)\n\t\tgoto done\n\t}\n\tirepo = s.repos.Get(repokey)\n\tif irepo == nil {\n\t\tresp.Errors[repokey] = kRepoUnavailableError\n\t\tgoto done\n\t}\n\trepo = irepo.(*Repo)\n\tresp.Repos[repokey] = repo\n\n\tif repo.State == INDEXING {\n\t\t// The repo is (con)currently indexing\n\t\tgoto done\n\t} else if repo.State != OK {\n\t\t// The repo is currently in error, exit early\n\t\t// and potentially delete the offending repo.\n\t\tresp.Errors[repokey] = kRepoUnavailableError\n\t\tif s.cfg.DeleteRepoOnError {\n\t\t\t_ = s.repos.Delete(repokey)\n\t\t}\n\t\tgoto done\n\t}\n\n\tshards = repo.Shards()\n\twaitingFor = len(shards)\n\tch = make(chan *SearchResult, waitingFor+1)\n\tdefer close(ch)\n\n\tfor _, shard := range shards {\n\t\tgo func(r *Repo, fname string) {\n\t\t\tsr, e := searchLocal(ctx, query, r, fname)\n\t\t\tsr.Repos[r.Key] = r\n\t\t\tif e != nil {\n\t\t\t\t// Report the error, possibly marking the repo as unavailable\n\t\t\t\t// and if so, potentially deleting it if configured to do so.\n\t\t\t\tif os.IsNotExist(e) || os.IsPermission(e) {\n\t\t\t\t\tlog.Warning(\"repo [%s] not available error: %v\", r.Key, e)\n\t\t\t\t\tr.State = ERROR\n\t\t\t\t\tsr.Errors[r.Key] = errs.NewStructError(\n\t\t\t\t\t\terrs.NewRepoUnavailableError())\n\n\t\t\t\t\tif s.cfg.DeleteRepoOnError {\n\t\t\t\t\t\t_ = s.repos.Delete(r.Key)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_ = s.repos.Set(r.Key, r)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsr.Errors[r.Key] = errs.NewStructError(e)\n\t\t\t\t}\n\t\t\t}\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\t// Report the timeout\n\t\t\t\tresp.Errors[repokey] = kSearchTimeoutError\n\t\t\tdefault:\n\t\t\t\tch <- sr\n\t\t\t}\n\n\t\t}(repo, shard)\n\t}\n\n\t// Await goroutine completion either in error or otherwise\n\tfor waitingFor > 0 {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tbreak\n\t\tcase in := <-ch:\n\t\t\tlog.Debug(\"got one %q\", in)\n\t\t\tresp.Update(in)\n\t\t\twaitingFor--\n\t\t}\n\t}\ndone:\n\tresp.Durations.Search = sw.Stop(\"total\")\n\tlog.Info(\"search [%s] [path %s] local done %d matches errors=%v (%v)\",\n\t\tquery.Re, query.PathRe, resp.NumMatches, resp.Errors, resp.Durations.Search)\n\treturn\n}", "title": "" }, { "docid": "07129092c5bb0068b7822529775691a6", "score": "0.6084305", "text": "func (engine *SearchEngine) Query(q string) (interface{}, ledgerError.ApplicationError) {\n\trawQuery, aerr := NewSearchRawQuery(q)\n\tif aerr != nil {\n\t\treturn nil, aerr\n\t}\n\n\tsqlQuery := rawQuery.ToSQLQuery(engine.namespace)\n\trows, err := engine.db.Query(sqlQuery.sql, sqlQuery.args...)\n\tif err != nil {\n\t\treturn nil, DBError(err)\n\t}\n\tdefer rows.Close()\n\n\tswitch engine.namespace {\n\tcase SearchNamespaceAccounts:\n\t\taccounts := make([]*AccountResult, 0)\n\t\tfor rows.Next() {\n\t\t\tacc := &AccountResult{}\n\t\t\tif err := rows.Scan(&acc.ID, &acc.Balance, &acc.Data); err != nil {\n\t\t\t\treturn nil, DBError(err)\n\t\t\t}\n\t\t\taccounts = append(accounts, acc)\n\t\t}\n\t\treturn accounts, nil\n\n\tcase SearchNamespaceTransactions:\n\t\ttransactions := make([]*TransactionResult, 0)\n\t\tfor rows.Next() {\n\t\t\ttxn := &TransactionResult{}\n\t\t\tvar rawAccounts, rawDelta string\n\t\t\tif err := rows.Scan(&txn.ID, &txn.Timestamp, &txn.Data, &rawAccounts, &rawDelta); err != nil {\n\t\t\t\treturn nil, DBError(err)\n\t\t\t}\n\n\t\t\tvar accounts []string\n\t\t\tvar delta []int\n\t\t\tjson.Unmarshal([]byte(rawAccounts), &accounts)\n\t\t\tjson.Unmarshal([]byte(rawDelta), &delta)\n\t\t\tvar lines []*TransactionLineResult\n\t\t\tfor i, acc := range accounts {\n\t\t\t\tl := &TransactionLineResult{}\n\t\t\t\tl.AccountID = acc\n\t\t\t\tl.Delta = delta[i]\n\t\t\t\tlines = append(lines, l)\n\t\t\t}\n\t\t\ttxn.Lines = lines\n\t\t\ttransactions = append(transactions, txn)\n\t\t}\n\t\treturn transactions, nil\n\tdefault:\n\t\treturn nil, SearchNamespaceInvalidError(engine.namespace)\n\t}\n}", "title": "" }, { "docid": "6b18dc96dd178aaa9d810db009fb3069", "score": "0.60341936", "text": "func (c *Core) Query(ctx context.Context, filter QueryFilter, orderBy order.By, pageNumber int, rowsPerPage int) ([]Summary, error) {\n\tusers, err := c.storer.Query(ctx, filter, orderBy, pageNumber, rowsPerPage)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"query: %w\", err)\n\t}\n\n\treturn users, nil\n}", "title": "" }, { "docid": "98016267adf249642a1f933d35c4a26a", "score": "0.60338354", "text": "func (r *artistResource) query(c *gin.Context) {\n\tcount, err := r.service.Count(c)\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err})\n\t\treturn\n\t}\n\tpaginatedList := helper.GetPaginatedListFromRequest(c, count)\n\titems, err := r.service.Query(c, paginatedList.Offset(), paginatedList.Limit())\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err})\n\t\treturn\n\t}\n\tpaginatedList.Items = items\n\tc.JSON(http.StatusFound, gin.H{\n\t\t\"id\": \"\",\n\t\t\"error\": \"\",\n\t\t\"message\": paginatedList,\n\t})\n}", "title": "" }, { "docid": "60a3d312c30d040f9313634ce2aa5f31", "score": "0.6002875", "text": "func (g *GithubFetcher) Query(ctx context.Context, q interface{}, variables map[string]interface{}) error {\n\tif t := reflect.TypeOf(q); t.Kind() != reflect.Ptr {\n\t\treturn errors.New(\"incoming query is not a pointer\")\n\t}\n\n\tif g.Cache != nil {\n\t\tif itemFromCache, err := g.Cache.ReadQuery(q, variables); err == nil {\n\t\t\tq = itemFromCache\n\t\t\treturn nil\n\t\t}\n\t}\n\n\terr := g.Client.Query(ctx, q, variables)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif g.Cache != nil {\n\t\tg.Cache.WriteQuery(q, variables)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "56c061afbc3aac5f856e1c5ab0dc2db2", "score": "0.59880203", "text": "func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tvar dni string // Entities\n\tvar err error\n\tfmt.Println(\"Metodo consultar\")\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting name of the person to query\")\n\t}\n\n\tdni = args[0]\n\n\t// Get the state from the ledger\n\tstoredValue, err := stub.GetState(dni)\n\tif err != nil {\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Failed to get state for \" + dni + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\n\treturn shim.Success(storedValue)\n}", "title": "" }, { "docid": "f9afdb5b12d7ff40bb140fab24102ce1", "score": "0.5974492", "text": "func TestQuery(t *testing.T) {\n\n\tresults, err := FindAll(Published())\n\tif err != nil {\n\t\tt.Fatalf(\"pages: error getting pages :%s\", err)\n\t}\n\tif len(results) == 0 {\n\t\tt.Fatalf(\"pages: published pages not found :%s\", err)\n\t}\n\n\tresults, err = FindAll(Query().Where(\"id>=? AND id <=?\", 0, 100))\n\tif err != nil || len(results) == 0 {\n\t\tt.Fatalf(\"pages: no page found :%s\", err)\n\t}\n\tif len(results) > 1 {\n\t\tt.Fatalf(\"pages: more than one page found for where :%s\", err)\n\t}\n\n}", "title": "" }, { "docid": "6f4af6dfc40db3233c58234e1fc2b36b", "score": "0.59732354", "text": "func (dao *ArticleDAO) Query(rs app.RequestScope, offset, limit, categoryId int, sorting, filter string) ([]models.Article, error) {\n\tarticles := []models.Article{}\n\tq := rs.Tx().Select().OrderBy(\"id\")\n\tif categoryId != 0 {\n\t\tq.Where(dbx.HashExp{\"category_id\": categoryId})\n\t}\n\tif filter != \"\" {\n\t\tq.AndWhere(dbx.Like(\"title\", filter))\n\t}\n\tif sorting == \"asc\" {\n\t\tq.OrderBy(\"id ASC\")\n\t} else {\n\t\tq.OrderBy(\"id DESC\")\n\t}\n\terr := q.Offset(int64(offset)).Limit(int64(limit)).All(&articles)\n\treturn articles, err\n}", "title": "" }, { "docid": "7f69ce68d71b269a41b1bb76a070c0e7", "score": "0.59693104", "text": "func Query(ctx context.Context, id int64) {\n\tctx, cancel := context.WithTimeout(ctx, 5*time.Second)\n\tdefer cancel()\n\n\tvar name string\n\terr := pool.QueryRowContext(ctx, \"select p.name from people as p where p.id = :id;\", sql.Named(\"id\", id)).Scan(&name)\n\tif err != nil {\n\t\tlog.Fatal(\"unable to execute search query\", err)\n\t}\n\tlog.Println(\"name=\", name)\n}", "title": "" }, { "docid": "55f5fd1dd1c7d16bfecfd46ea0a67173", "score": "0.5958085", "text": "func (db DB) Query(entities interface{}, options QueryOptions) *Query {\n\tq := db.newQuery(entities, options.First)\n\n\t// Overwrite limit if this is not a first-only search\n\tif !options.First {\n\t\tq.limit = options.Limit\n\t}\n\n\tif options.Offset > 0 {\n\t\tq.Offset(options.Offset)\n\t}\n\n\t// Apply reverse if speficied\n\t// Default is false, so can be left off\n\tq.reverse = options.Reverse\n\n\t// Apply date range if specified\n\tif !options.From.IsZero() {\n\t\tq.From(options.From)\n\t}\n\n\tif !options.To.IsZero() {\n\t\tq.To(options.To)\n\t}\n\n\t// Apply index if required\n\t// Use 'match' for 1 param, 'range' for 2\n\tif options.IndexName != \"\" {\n\t\tif len(options.IndexParams) == 1 {\n\t\t\tq.Match(options.IndexName, options.IndexParams[0])\n\t\t} else if len(options.IndexParams) == 2 {\n\t\t\tq.Range(options.IndexName, options.IndexParams[0], options.IndexParams[1])\n\t\t}\n\t}\n\n\treturn q\n}", "title": "" }, { "docid": "58413ac71609ad0a0601ebbec0e364dd", "score": "0.59416443", "text": "func (repository Users) Search(userQuery string) ([]models.User, error) {\n\tuserQuery = fmt.Sprintf(\"%%%s%%\", userQuery) // %% serve para o escape de caracteres\n\n\tlines, error := repository.db.Query(\"SELECT id, name, nick, email, createdAt FROM users WHERE name LIKE ? OR nick LIKE ?\",\n\t\tuserQuery, userQuery)\n\n\tif error != nil {\n\t\treturn nil, error\n\t}\n\n\tdefer lines.Close()\n\n\tvar users []models.User\n\n\tfor lines.Next() {\n\t\tvar user models.User\n\n\t\tif error = lines.Scan(\n\t\t\t&user.ID,\n\t\t\t&user.Name,\n\t\t\t&user.Email,\n\t\t\t&user.Nick,\n\t\t\t&user.CreatedAt,\n\t\t); error != nil {\n\t\t\treturn nil, error\n\t\t}\n\n\t\tusers = append(users, user)\n\t}\n\n\treturn users, nil\n}", "title": "" }, { "docid": "3ede54a3e0bf880009eefa081a2a739e", "score": "0.5924125", "text": "func (e Es) Query(index string, doc string, query string) (*SearchResult, error) {\n\tif doc != \"\" {\n\t\tdoc = \"/\" + doc\n\t}\n\tbody, err := e.getJSONWithBody(fmt.Sprintf(\"%s%s/_search\", index, doc), query)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = checkError(body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tallhits, ok := body[\"hits\"].(map[string]interface{})\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"Failed to retrieve hits from response\")\n\t}\n\n\ttotal := int(allhits[\"total\"].(float64))\n\thits := allhits[\"hits\"].([]interface{})\n\n\tresult := make([]string, len(hits))\n\ti := 0\n\tfor _, hit := range hits {\n\t\trecord, err := utils.MapToYaml(hit)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult[i] = record\n\t\ti++\n\t}\n\n\treturn &SearchResult{\n\t\tTotal: total,\n\t\tHits: result,\n\t}, nil\n}", "title": "" }, { "docid": "645a812f5cc4402d16b4b281de7d4560", "score": "0.59162974", "text": "func (m *Command) Query(t testing.TB, index, rawQuery, query string) (string, error) {\n\tresp := Do(t, \"POST\", fmt.Sprintf(\"%s/index/%s/query?%s\", m.URL(), index, rawQuery), query)\n\tif resp.StatusCode != gohttp.StatusOK {\n\t\treturn \"\", fmt.Errorf(\"invalid status: %d, body=%s\", resp.StatusCode, resp.Body)\n\t}\n\treturn resp.Body, nil\n}", "title": "" }, { "docid": "7aa10b0b41b6c174a28213610d7d9af2", "score": "0.59122115", "text": "func (s *Service) Search(r *http.Request, args *SearchEntryArgs, result *SearchResponse) error {\n\t// TODO: add metadata searching\n\t// TODO: add fuzzy tags searching\n\tif args.UserID == \"\" {\n\t\tresult.Error = uidMissing\n\t\tresult.Entries = []Entry{}\n\t\tresult.Count = 0\n\t\treturn nil\n\t}\n\tvar searchClauses []bson.M\n\tvar searchQuery bson.M\n\tvar entries []Entry\n\tentryTypes := []string{EntryTypePim, EntryTypeBookmark, EntryTypeOrg}\n\tif len(args.Types) > 0 {\n\t\tentryTypes = args.Types\n\t}\n\tvar entryTypesClauses []bson.M\n\tfor _, entryType := range entryTypes {\n\t\tentryTypesClauses = append(entryTypesClauses, bson.M{\"type\": entryType})\n\t}\n\tsearchClauses = append(searchClauses, bson.M{\"$or\": entryTypesClauses})\n\tif args.Content != \"\" {\n\t\tvar entryContentClauses []bson.M\n\t\tentryContentClauses = append(entryContentClauses, bson.M{\"content\": bson.M{\"$regex\": args.Content, \"$options\": \"i\"}})\n\t\tentryContentClauses = append(entryContentClauses, bson.M{\"metadata.description\": bson.M{\"$regex\": args.Content, \"$options\": \"i\"}})\n\t\tsearchClauses = append(searchClauses, bson.M{\"$or\": entryContentClauses})\n\t}\n\tif len(args.Tags) > 0 {\n\t\tvar regexTags []bson.RegEx\n\t\tfor _, tag := range args.Tags {\n\t\t\tregexTags = append(regexTags, bson.RegEx{tag, \"i\"})\n\t\t}\n\t\tsearchClauses = append(searchClauses, bson.M{\"tags\": bson.M{\"$in\": regexTags}})\n\t}\n\tif len(args.Priority) > 0 {\n\t\tsearchClauses = append(searchClauses, bson.M{\"priority\": bson.M{\"$in\": args.Priority}})\n\t}\n\tcoll := s.Session.DB(MentatDatabase).C(args.UserID)\n\tif len(searchClauses) > 0 {\n\t\tsearchQuery = bson.M{\"$and\": searchClauses}\n\t}\n\tmgoErr := coll.Find(searchQuery).All(&entries)\n\tif mgoErr != nil {\n\t\tif mgoErr.Error() == MongoNotFound {\n\t\t\tresult.Entries = []Entry{}\n\t\t\tresult.Count = 0\n\t\t\treturn nil\n\t\t}\n\t\ts.Log.Infof(\"mgo error: %s\", mgoErr)\n\t\tresult.Error = fmt.Sprintf(\"mgo error: %s\", mgoErr)\n\t\tresult.Entries = []Entry{}\n\t\tresult.Count = 0\n\t\treturn nil\n\t}\n\tresult.Entries = entries\n\tresult.Count = len(entries)\n\treturn nil\n}", "title": "" }, { "docid": "6f63a581d3f4a0622b2a27d647dd865d", "score": "0.59052867", "text": "func (sq *MysqlDB) Search(q SearchQuery) (SearchResults, error) {\n\titems, err := sq.FindAllRange(q.Start, q.NumRows)\n\treturn SearchResults{Items: items}, err\n}", "title": "" }, { "docid": "65ede26153ff0ec60daebc0979ae117e", "score": "0.5894693", "text": "func (r *TaskRepository) Search(db db.DB, request *requests.SearchTaskRequest) (*[]entities.Task, error) {\n\tTasks := &[]entities.Task{}\n\tsqStmt := sq.StatementBuilder.PlaceholderFormat(sq.Dollar)\n\n\tbuilder := sqStmt.Select(\"*\").From(\"tasks\")\n\n\tif request.Status != nil {\n\t\tbuilder = builder.Where(\"status=?\", request.Status)\n\t}\n\n\tif request.Title != nil {\n\t\tbuilder = builder.Where(\"title=?\", request.Title)\n\t}\n\n\tsql, args, err := builder.ToSql()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error query sql: %w\", err)\n\t}\n\n\terr = db.Select(Tasks, sql, args...)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error selecting task from db: %w\", err)\n\t}\n\treturn Tasks, nil\n}", "title": "" }, { "docid": "b68c96952ec73eb7a0afe10349a813ff", "score": "0.5881635", "text": "func (client *esClient) Query(index, typeName string, queryStrings ...string) (*elastic.SearchResult, error) {\n\tvar queryString string\n\tif len(queryStrings) > 0 {\n\t\tqueryString = queryStrings[0]\n\t}\n\t// 根据名字查询\n\tquery := elastic.NewQueryStringQuery(queryString)\n\tresult, err := client.Search().Index(index).Type(typeName).Query(query).Do(client.ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif result.Hits.TotalHits > 0 {\n\t\treturn result, nil\n\t}\n\treturn nil, errors.New(\"query the result is null\")\n}", "title": "" }, { "docid": "3c10beef7bd9afdd2f10c2a68215d8e2", "score": "0.5878824", "text": "func (c *Client) Query(ctx context.Context, q interface{}, variables map[string]interface{}) error {\n\treturn c.gql.Query(ctx, q, variables)\n}", "title": "" }, { "docid": "2b718b608da2fcc6dc67b30bef1ad552", "score": "0.5877048", "text": "func (r ProductRepository) Query(ctx context.Context, offset, limit uint) ([]product.Product, error) {\n\tvar items []product.Product\n\n\terr := r.dbWithContext(ctx, r.dbWithDefaults()).Find(&items).Error\n\tif err != nil {\n\t\tif err == gorm.ErrRecordNotFound {\n\t\t\treturn items, apperror.ErrNotFound\n\t\t}\n\t}\n\treturn items, err\n}", "title": "" }, { "docid": "54e910b80777e324be2fa46483d392fa", "score": "0.5873192", "text": "func (r repository) Query(ctx context.Context, offset, limit int) ([]entity.Link, error) {\n\tvar links []entity.Link\n\terr := r.db.With(ctx).\n\t\tSelect().\n\t\tOrderBy(\"id\").\n\t\tOffset(int64(offset)).\n\t\tLimit(int64(limit)).\n\t\tAll(&links)\n\treturn links, err\n}", "title": "" }, { "docid": "6b767c4b202566c0734ea85a588347c4", "score": "0.58483064", "text": "func search() {\n\tr := *repo\n\ti := *issue\n\trepos := setRepositories()\n\n\tfor key, value := range repos {\n\t\tif repos[key].name == r {\n\t\t\tclient := &http.Client{}\n\t\t\trepoName := value\n\t\t\treq, err := http.NewRequest(\"GET\", \"https://api.github.com/search/issues\", nil)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"[ERROR] Some issue with request.\")\n\t\t\t}\n\t\t\tq := req.URL.Query()\n\t\t\tq.Add(\"q\", fmt.Sprintf(\"%s+repo:%s\", i, repoName.repo))\n\t\t\treq.URL.RawQuery = q.Encode()\n\t\t\tresp, _ := client.Do(req)\n\t\t\tbody, err := ioutil.ReadAll(resp.Body)\n\t\t\tdefer resp.Body.Close()\n\t\t\tprintResults(body)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dcab53b839392738c54db4760176c561", "score": "0.5838562", "text": "func query(res http.ResponseWriter, req *http.Request){\n\tvar result Account\n\tparams := url_parser(req.URL.String())\n\taccount := params[\"account\"]\n\tfilter := bson.D{{\"identifier\", clean_string(account)}}\n\tcollection := client.Database(Database).Collection(Collection)\n\terr := collection.FindOne(context.TODO(), filter).Decode(&result)\n\tif err != nil{\n\t\tfmt.Println(err)\n\t}\n\tfmt.Println(result)\n}", "title": "" }, { "docid": "d3704d0670ce8e2cdd91e66a2b402690", "score": "0.583785", "text": "func Query(srv *drive.Service, driveID string, q string) (foundFile *drive.File, err error) {\n var pageToken string\n\n for searching := true; searching; {\n filesCall := srv.Files.List();\n if driveID != \"\" {\n filesCall = filesCall.\n IncludeItemsFromAllDrives(true).\n SupportsAllDrives(true).\n Corpora(\"teamDrive\").\n DriveId(driveID)\n }\n pageOfFiles, err := filesCall.Q(q).PageToken(pageToken).Do()\n if err != nil {\n return nil, err\n }\n\n pageToken = pageOfFiles.NextPageToken\n for _, file := range pageOfFiles.Files {\n if file.Trashed {\n continue\n }\n return file, nil\n }\n if pageToken == \"\" {\n searching = false\n }\n }\n return nil, nil\n}", "title": "" }, { "docid": "d480ece9bba22b7a8314a8b95667c9da", "score": "0.58144456", "text": "func (c Client) Search(repo, q, filter, dist string, perPage int) ([]Package, error) {\n\tendpoint := fmt.Sprintf(\"%s/repos/%s/search.json?q=%s&filter=%s&dist=%s&per_page=%d\", ServiceURL, repo, q, filter, dist, perPage)\n\n\treq, err := http.NewRequest(\"GET\", endpoint, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.SetBasicAuth(c.token, \"\")\n\treq.Header.Add(\"User-Agent\", UserAgent)\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tvar packages []Package\n\terr = decodeResponse(resp, &packages)\n\treturn packages, err\n}", "title": "" }, { "docid": "2b02f1beea796055cbd9490009da76cc", "score": "0.58024234", "text": "func (c *CouchDBStore) Query(findQuery string) (storage.ResultsIterator, error) {\n\tresultRows, err := c.db.Find(context.Background(), findQuery)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &couchDBResultsIterator{store: c, resultRows: resultRows}, nil\n}", "title": "" }, { "docid": "016edbd2f56dec5efa80e079b5ebaf0b", "score": "0.5798556", "text": "func (m *FeedDAO) Search(keyword string, limit int) ([]searchResult, error)", "title": "" }, { "docid": "4cffdf78b520ad681b201bc108cf62bf", "score": "0.5788833", "text": "func (r *Resolver) Query() exec.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "bb8f6616c670657de30d477bd474f56f", "score": "0.5776369", "text": "func (db *DB) Query(query dna.String, args ...interface{}) (*Rows, error) {\n\trows, err := db.DB.Query(query.String(), args...)\n\treturn &Rows{rows}, err\n}", "title": "" }, { "docid": "26e36a74f2c244d39fcb7c92f422efaa", "score": "0.5766845", "text": "func (c *Client) Search(query SearchQuery) (*Search, error) {\n\tparams := url.Values{}\n\n\tif len(query.Q) != 0 {\n\t\tparams.Add(\"q\", strings.Join(query.Q, \" \"))\n\t}\n\n\tif query.Limit != 0 {\n\t\tparams.Add(\"limit\", strconv.Itoa(query.Limit))\n\t} else {\n\t\tparams.Add(\"limit\", strconv.Itoa(c.Limit))\n\t}\n\n\tif query.Offset != 0 {\n\t\tparams.Add(\"offset\", strconv.Itoa(query.Offset))\n\t}\n\n\tif query.Rating != \"\" {\n\t\tparams.Add(\"rating\", query.Rating)\n\t}\n\n\tif query.Lang != \"\" {\n\t\tparams.Add(\"lang\", query.Lang)\n\t}\n\n\tif query.RandomID != \"\" {\n\t\tparams.Add(\"random_id\", query.RandomID)\n\t}\n\n\tu, err := url.Parse(\"/gifs/search\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tu.RawQuery = params.Encode()\n\n\tpath := u.String()\n\treq, err := c.NewRequest(path)\n\tif err != nil {\n\t\treturn &Search{}, err\n\t}\n\n\tvar search Search\n\tif _, err = c.Do(req, &search); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &search, nil\n}", "title": "" }, { "docid": "15b4ecd91db85d15b188afcb031edf81", "score": "0.5755633", "text": "func (c *RentalstatusClient) Query() *RentalstatusQuery {\n\treturn &RentalstatusQuery{config: c.config}\n}", "title": "" }, { "docid": "aa7f2ae229bad64cf2ffacb650d2afa9", "score": "0.5753295", "text": "func (m *remote) Search(ctx context.Context, query *search.Query, handler Handler) error {\n\tstream, err := m.client.Search(ctx, query)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn event.Feed(ctx, event.AsHandler(ctx, handler), grpcutil.ToProducer(stream))\n}", "title": "" }, { "docid": "1a226a375aec28afb6ae8ab533b297ef", "score": "0.575296", "text": "func (m Model) Search(query string) []Result {\n\tvar results []Result\n\n\twords := Tokenize(query)\n\tif len(words) == 0 {\n\t\treturn results\n\t}\n\n\t// main search query\n\tif err := m.PG.Model(&Occurence{}).\n\t\tColumnExpr(\"(SELECT name FROM files WHERE id = occurence.file_id) as file_name\").\n\t\tColumnExpr(\"SUM(occurence.count) as sum\").\n\t\tColumnExpr(\"array_agg(occurence.word_id) as words\").\n\t\tJoin(\"JOIN words on occurence.word_id = words.id\").\n\t\tWhere(\"words.word in (?)\", pg.In(words)).\n\t\tGroup(\"occurence.file_id\").\n\t\tOrder(\"sum DESC\").\n\t\tSelect(&results); err != nil {\n\t\tlog.Println(err.Error())\n\t}\n\n\treturn results\n}", "title": "" }, { "docid": "675aed3076c5d16d29a236f278fe34c1", "score": "0.5745729", "text": "func (s *stmt) Query(args []driver.Value) (driver.Rows, error) {\n\treturn s.c.Query(s.query, args)\n}", "title": "" }, { "docid": "3e383244107568568b144a185c6a2a0e", "score": "0.574474", "text": "func (repo *Repo) Search(query string) ([]Codepoint, error) {\n\tquery = repo.prepareQuery(query)\n\tvar (\n\t\tcps []Codepoint\n\t\tq = `\n\t\t\tSELECT\n\t\t\t\tc.hex, c.dec, c.category, c.name, c.aliases, c.entity,\n\t\t\t\ts.rank\n\t\t\tFROM codepoints AS c\n\t\t\tINNER JOIN (\n\t\t\t\tSELECT\n\t\t\t\t\trowid,\n\t\t\t\t\tbm25(search) AS rank\n\t\t\t\tFROM search\n\t\t\t\tWHERE search MATCH ?\n\t\t\t) AS s\n\t\t\tON c.rowid = s.rowid\n\t\t\tORDER BY s.rank\n\t\t\tLIMIT 200`\n\t\t// search for a single character\n\t\tq2 = `\n\t\t\tSELECT\n\t\t\t\tc.hex, c.dec, c.category, c.name, c.aliases, c.entity\n\t\t\tFROM codepoints AS c\n\t\t\tWHERE c.dec = ?\n\t\t`\n\t\terr error\n\t)\n\tif runes := []rune(query); len(runes) == 1 {\n\t\terr = repo.db.Select(&cps, q2, runes[0])\n\t} else {\n\t\terr = repo.db.Select(&cps, q, query)\n\t}\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"SQL query failed: %w\", err)\n\t}\n\n\tlog.Printf(\"[repo] %d result(s) for %q\", len(cps), query)\n\treturn cps, nil\n}", "title": "" }, { "docid": "15f3c96e844f8474a4b87a947bb665dc", "score": "0.57440484", "text": "func (a *arangodb) Query(ctx context.Context, cfg dbquery.Config, dbCfg dbquery.DatabaseConfig, deps dbquery.QueryDependencies) error {\n\t// Prepare logger\n\tlog := deps.Log.With().\n\t\tStr(\"address\", dbCfg.Address).\n\t\tStr(\"database\", dbCfg.Database).\n\t\tLogger()\n\n\t// Prepare publish function\n\tpublish := func(ctx context.Context, doc interface{}) error {\n\t\t// Encode document as JSON\n\t\tencoded, err := json.Marshal(doc)\n\t\tif err != nil {\n\t\t\tlog.Error().Err(err).Msg(\"Failed to marshal document into JSON\")\n\t\t\treturn maskAny(err)\n\t\t}\n\t\t// Prepare data URI\n\t\tdataURI := dataurl.New(encoded, \"text/json\")\n\t\tannValID, err := deps.OutputReady(ctx, dataURI.String(), cfg.OutputName)\n\t\tif err != nil {\n\t\t\tlog.Error().Err(err).Msg(\"Failed to notify output readiness\")\n\t\t\treturn maskAny(err)\n\t\t}\n\t\tlog.Debug().Str(\"id\", annValID).Msg(\"Published document\")\n\t\treturn nil\n\t}\n\n\t// Apply authentication (if needed)\n\tvar auth driver.Authentication\n\tif s := deps.AuthenticationSecret; s != nil {\n\t\tusername := string(s.Data[\"username\"])\n\t\tpassword := string(s.Data[\"password\"])\n\t\tauth = driver.BasicAuthentication(username, password)\n\t\tlog.Debug().Str(\"username\", username).Msg(\"Using authentication\")\n\t}\n\n\t// Connect to the database an keep running the query\n\tlastKey := \"\"\n\tif err := a.connectAndQuery(ctx, log, cfg, &lastKey, dbCfg, auth, publish); err != nil {\n\t\tlog.Debug().Err(err).Msg(\"connectAndQuery failed\")\n\t\treturn maskAny(err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "85e9b89b2c3cd5e95bdd615666004821", "score": "0.5741277", "text": "func (d *Datastore) Query(q query.Query) (query.Results, error) {\n\tvar entries []query.Entry\n\tif err := d.db.View(func(tx *bbolt.Tx) error {\n\t\tcursor := tx.Bucket(d.bucket).Cursor()\n\t\tif q.Prefix == \"\" {\n\t\t\tfor k, v := cursor.First(); k != nil; k, v = cursor.Next() {\n\t\t\t\tvar entry query.Entry\n\t\t\t\tentry.Key = string(k)\n\t\t\t\tif !q.KeysOnly {\n\t\t\t\t\tentry.Value = v\n\t\t\t\t\tentry.Size = int(len(entry.Value))\n\t\t\t\t}\n\t\t\t\tentries = append(entries, entry)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\tpref := []byte(q.Prefix)\n\t\tfor k, v := cursor.Seek(pref); k != nil && bytes.HasPrefix(k, pref); k, v = cursor.Next() {\n\t\t\tvar entry query.Entry\n\t\t\tentry.Key = string(k)\n\t\t\tif !q.KeysOnly {\n\t\t\t\tentry.Value = v\n\t\t\t}\n\t\t\tentries = append(entries, entry)\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\tresults := query.ResultsWithEntries(q, entries)\n\t// close the result builder since we are done using it\n\treturn results, nil\n}", "title": "" }, { "docid": "b1d8c6d09075ee6a995d18506dc0f158", "score": "0.5734703", "text": "func Query(ctx context.Context, search *Search) ([]Result, error) {\n\t// Get fake user agent\n\tfakeUserAgent := browser.Chrome()\n\n\tif search.Num == 0 {\n\t\tsearch.Num = 10\n\t}\n\n\t// Build request\n\turlString := fmt.Sprintf(baseURL, url.QueryEscape(search.Q), search.Num, search.Start)\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", urlString, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"User-Agent\", fakeUserAgent)\n\tvar resp *http.Response\n\n\t// Do request\n\tif search.TryHard {\n\t\t// Use a proxy if default method fails\n\t\tif p == nil {\n\t\t\tp = proxier.New()\n\t\t\tp.TryNoProxyFirst = true\n\t\t}\n\t\tresp, err = p.DoRequest(ctx, req)\n\t} else {\n\t\tresp, err = http.DefaultClient.Do(req)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"invalid response code: %d\", resp.StatusCode)\n\t}\n\n\treturn parse(resp.Body)\n}", "title": "" }, { "docid": "e59fa056908bf3ef532fcde63f02257c", "score": "0.57260406", "text": "func (c *client) Search(query string, max int, objectType models.ObjectType) (models.SearchResults, error) {\n\tresults := make(models.SearchResults, 0)\n\tpath := \"/api/v1/servers/localhost/search-data\"\n\terr := c.httpClient.Get(\n\t\tpath,\n\t\t&results,\n\t\tpdnshttp.WithQueryValue(\"q\", models.DeCanonicalize(query)),\n\t\tpdnshttp.WithQueryValue(\"max\", fmt.Sprintf(\"%d\", max)),\n\t\tpdnshttp.WithQueryValue(\"object_type\", objectType.String()),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn results, nil\n}", "title": "" }, { "docid": "8c3b19f026f8329bf8c60c08dbbdf52e", "score": "0.5719891", "text": "func (s *Service) Search(term string, authConfig *AuthConfig, headers map[string][]string) (*SearchResults, error) {\n\trepoInfo, err := s.ResolveRepository(term)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// *TODO: Search multiple indexes.\n\tendpoint, err := repoInfo.GetEndpoint()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr, err := NewSession(authConfig, HTTPRequestFactory(headers), endpoint, true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r.SearchRepositories(repoInfo.GetSearchTerm())\n}", "title": "" }, { "docid": "b69cb18c87cbf91e3e42768a870148a2", "score": "0.571964", "text": "func (s *NewsService) Query(rs app.RequestScope, offset, limit int) ([]models.News, error) {\n\treturn s.dao.Query(rs, offset, limit)\n}", "title": "" }, { "docid": "2c241fbfb51e5778be2099632d6c8760", "score": "0.569307", "text": "func (c *Client) Query(q interface{}, variables map[string]interface{}) error {\n\tctx := context.Background()\n\treturn c.client(ctx).Query(ctx, q, variables)\n}", "title": "" }, { "docid": "b306927433aff989f0ad53ef7636584b", "score": "0.5683021", "text": "func (s *HttpServer) Search(w http.ResponseWriter, r *http.Request) {\n\tvar limit int64 = 201\n\tctx := r.Context()\n\tid := r.URL.Query().Get(\"id\")\n\n\tif id == \"\" {\n\t\tid = \"0\"\n\t}\n\tid64, err := strconv.ParseInt(id, 10, 64)\n\tif err != nil {\n\t\thttp.Error(w, exceptions.IntegerRequired.Error(), 500)\n\t\treturn\n\t}\n\n\tdirection := r.URL.Query().Get(\"direction\")\n\n\tquery := r.FormValue(\"query\")\n\tusers, err := s.UserService.FindByNameUC(ctx, query, id64, limit, direction)\n\tvar firstID, lastID int64\n\n\tdata := map[string]interface{}{\n\t\t\"Users\": users,\n\t\t\"Errors\": \"\",\n\t\t\"Query\": query,\n\t\t\"Next\" : false,\n\t}\n\tif err != nil {\n\t\tdata[\"Errors\"] = err.Error()\n\t\ts.RenderTemplate(ctx, w, \"index\", data)\n\t\treturn\n\t}\n\tcount := int64(len(users))\n\tif count > 0 {\n\t\tlastID = users[count-1].ID\n\t\tfirstID = users[0].ID\n\t\tdata[\"Users\"]=users[:count-1]\n\t}\n\tdata[\"FirstID\"] = firstID\n\tdata[\"LastID\"] = lastID\n\tif count > limit-1 {\n\t\tdata[\"Next\"] = true\n\t}\n\ts.RenderTemplate(ctx, w, \"index\", data)\n}", "title": "" }, { "docid": "0d3a13dd12858371bcf95cdd17c1b78e", "score": "0.567836", "text": "func (d *GormRecipesStore) Search(query string, offset, limit uint64) ([]*Recipe, error) {\n\tvar recipes []*Recipe\n\terr := d.db.\n\t\tOffset(offset).\n\t\tLimit(limit).\n\t\tWhere(\"name LIKE ?\", fmt.Sprintf(\"%%%s%%\", query)).\n\t\tFind(&recipes).Error\n\treturn recipes, errors.WithStack(err)\n}", "title": "" }, { "docid": "0694e7f315ed2661faa65a00ed38bcb1", "score": "0.5673458", "text": "func Search(cmd *cobra.Command, args []string) {\n\t//*TODO* Update with the new serializer option\n\tlog.Debug(\"Search subcommand run with log level: \", Verbose, \"\\n\")\n\n\tif len(args) > 0 {\n\t\tif args[0] != \"\" {\n\t\t\tsearchTerm = args[0]\n\t\t}\n\t}\n\tif len(args) > 1 {\n\t\tif args[1] != \"\" {\n\t\t\tgobFile = args[1]\n\t\t}\n\t}\n\n\tnp := persister.NewPersistor(persister.GOB)\n\terr := np.Load(gobFile, &data)\n\tif err != nil {\n\t\tlog.Errorf(\"error loading gob file: %v\", err)\n\t}\n\n\tfilters, urls, names := data.F, data.U, data.N\n\n\tvar found []interface{}\n\t// iterate through the filters and return indices of matches\n\tfor i, v := range filters {\n\t\tfilter, _ := cuckoo.Decode(v)\n\t\tif filter.Lookup([]byte(searchTerm)) {\n\t\t\tif len(found) >= rslts {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfound = append(found, Result{\n\t\t\t\tName: names[i],\n\t\t\t\tURL: urls[i],\n\t\t\t})\n\t\t}\n\t}\n\n\tif !nostd {\n\t\t// ** PRETTY OUTPUT FOR USE AT COMMAND LINE **\n\t\tfoundJSON, err := json.MarshalIndent(found, \"\", \" \")\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"error in marshalling the found results: %v\", err)\n\t\t}\n\t\tfmt.Printf(\"Search Results:\\n %s\\n\", string(foundJSON))\n\t}\n\n}", "title": "" }, { "docid": "e5b690fffbcc2526cf74c84a70caac8b", "score": "0.56661636", "text": "func (a *ArchiveToday) Query(domain, sub string) []string {\n\tif sub == \"\" {\n\t\treturn []string{}\n\t}\n\n\tnames, err := a.crawl(a.baseURL, domain, sub)\n\tif err != nil {\n\t\ta.Service.Config().Log.Printf(\"%v\", err)\n\t}\n\treturn names\n}", "title": "" }, { "docid": "f3b436000f7c97c6229ce846e64a1a35", "score": "0.56599045", "text": "func (b *bot) query(query string, args ...interface{}) (*sql.Rows, error) {\n\treturn b.DB.client.Query(query, args...)\n}", "title": "" }, { "docid": "a1980878e99fd8cad402253c715d8768", "score": "0.56597745", "text": "func (s *SmartContract) Query(ctx contractapi.TransactionContextInterface, args []string) error {\n\n\tvar serl string // Entities\n\tvar err error\n\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"Incorrect number of arguments. Expecting name of the person to query\")\n\t}\n\n\tserl = args[0]\n\n\t// Get the state from the ledger\n\tAvalbytes, err := ctx.GetStub().GetState(serl)\n\tif err != nil {\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Failed to get state for \" + serl + \"\\\"}\"\n\t\treturn fmt.Errorf(jsonResp)\n\t}\n\n\tif Avalbytes == nil {\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Nil amount for \" + serl + \"\\\"}\"\n\t\treturn fmt.Errorf(jsonResp)\n\t}\n\n\t//\tjsonResp := \"{\\\"Name\\\":\\\"\" + A + \"\\\",\\\"Amount\\\":\\\"\" + string(Avalbytes) + \"\\\"}\"\n\t//\tlogger.Infof(\"Query Response:%s\\n\", jsonResp)\n\treturn ctx.GetStub().PutState(args[0], Avalbytes)\n\n}", "title": "" }, { "docid": "a771c8cf1d87346c50ce9f640b7eb557", "score": "0.56559366", "text": "func (i *Index) Search(q query.Query) (docs []index.Document, total int, err error) {\n\tconn := i.getConn()\n\tdefer conn.Close()\n\n\targs := redis.Args{i.name, q.Term, \"LIMIT\", q.Paging.Offset, q.Paging.Num, \"WITHSCORES\"}\n\t//if q.Flags&query.QueryVerbatim != 0 {\n\targs = append(args, \"VERBATIM\")\n\t//}\n\tif q.Flags&query.QueryNoContent != 0 {\n\t\targs = append(args, \"NOCONTENT\")\n\t}\n\n\tif q.HighlightOpts != nil {\n\t\targs = args.Add(\"HIGHLIGHT\")\n\t\tif q.HighlightOpts.Fields != nil && len(q.HighlightOpts.Fields) > 0 {\n\t\t\targs = args.Add(\"FIELDS\", len(q.HighlightOpts.Fields))\n\t\t\targs = args.AddFlat(q.HighlightOpts.Fields)\n\t\t}\n\t\targs = args.Add(\"TAGS\", q.HighlightOpts.Tags[0], q.HighlightOpts.Tags[1])\n\t}\n\n\tif q.SummarizeOpts != nil {\n\t\targs = args.Add(\"SUMMARIZE\")\n\t\tif q.SummarizeOpts.Fields != nil && len(q.SummarizeOpts.Fields) > 0 {\n\t\t\targs = args.Add(\"FIELDS\", len(q.SummarizeOpts.Fields))\n\t\t\targs = args.AddFlat(q.SummarizeOpts.Fields)\n\t\t}\n\t\tif q.SummarizeOpts.FragmentLen > 0 {\n\t\t\targs = args.Add(\"LEN\", q.SummarizeOpts.FragmentLen)\n\t\t}\n\t\tif q.SummarizeOpts.NumFragments > 0 {\n\t\t\targs = args.Add(\"FRAGS\", q.SummarizeOpts.NumFragments)\n\t\t}\n\t\tif q.SummarizeOpts.Separator != \"\" {\n\t\t\targs = args.Add(\"SEPARATOR\", q.SummarizeOpts.Separator)\n\t\t}\n\t}\n\n\tif err := conn.Send(i.commandPrefix+\".SEARCH\", args...); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := conn.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif _, err := conn.Receive(); err != nil {\n\t\tpanic(err)\n\t}\n\n\tres, err := redis.Values(conn.Do(i.commandPrefix+\".SEARCH\", args...))\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\tif total, err = redis.Int(res[0], nil); err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\tdocs = make([]index.Document, 0, len(res)-1)\n\n\tif len(res) > 2 {\n\t\tfor i := 1; i < len(res); i += 2 {\n\n\t\t\tvar fields interface{} = []interface{}{}\n\t\t\tif q.Flags&query.QueryNoContent == 0 {\n\t\t\t\tfields = res[i+2]\n\n\t\t\t}\n\t\t\tif d, e := loadDocument(res[i], res[i+1], fields); e == nil {\n\t\t\t\tdocs = append(docs, d)\n\t\t\t}\n\t\t\tif q.Flags&query.QueryNoContent == 0 {\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\t}\n\treturn docs, len(docs), nil\n}", "title": "" }, { "docid": "a586bafb5f6e080581c485a32851be84", "score": "0.5638595", "text": "func (p *MyServiceChannelClient) Query(ctx context.Context, s *module0.MyStruct, i *includes1.Included) (err error) {\n args := MyServiceQueryArgs{\n S : s,\n I : i,\n }\n var __result MyServiceQueryResult\n err = p.RequestChannel.Call(ctx, \"query\", &args, &__result)\n if err != nil { return }\n\n return nil\n}", "title": "" }, { "docid": "0fab8063c26719420be4b6072d95efb4", "score": "0.5628932", "text": "func (r *Resolver) Query() gqlhandler.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "e58098264bdc61ee7f3e0f20f1a2c545", "score": "0.56267124", "text": "func Search(query string) ([]Place, error) {\n\treturn DefaultClient.Search(query)\n}", "title": "" }, { "docid": "8c8323867394e5fa70046cc65c79c3b0", "score": "0.5624633", "text": "func (r *BookMySQL) Search(query string) ([]*entity.Book, error) {\n\trows, err := r.db.Query(`SELECT id, title, author, isbn, pages, quantity, created_at FROM book WHERE title LIKE ? AND deleted_at IS NULL`, query)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tvar books []*entity.Book\n\tfor rows.Next() {\n\t\tvar book entity.Book\n\t\terr = rows.Scan(&book.ID, &book.Title, &book.Author, &book.ISBN, &book.Pages, &book.Quantity, &book.CreatedAt)\n\t\tbooks = append(books, &book)\n\t}\n\n\treturn books, nil\n}", "title": "" }, { "docid": "770dcb23ecc9f1d4ede0e05cc0ac7f34", "score": "0.56207496", "text": "func (b *Indexer) Search(ctx context.Context, keyword string, repoIDs []int64, limit, start int) (*internal.SearchResult, error) {\n\tvar repoQueriesP []*query.NumericRangeQuery\n\tfor _, repoID := range repoIDs {\n\t\trepoQueriesP = append(repoQueriesP, numericEqualityQuery(repoID, \"RepoID\"))\n\t}\n\trepoQueries := make([]query.Query, len(repoQueriesP))\n\tfor i, v := range repoQueriesP {\n\t\trepoQueries[i] = query.Query(v)\n\t}\n\n\tindexerQuery := bleve.NewConjunctionQuery(\n\t\tbleve.NewDisjunctionQuery(repoQueries...),\n\t\tbleve.NewDisjunctionQuery(\n\t\t\tnewMatchPhraseQuery(keyword, \"Title\", issueIndexerAnalyzer),\n\t\t\tnewMatchPhraseQuery(keyword, \"Content\", issueIndexerAnalyzer),\n\t\t\tnewMatchPhraseQuery(keyword, \"Comments\", issueIndexerAnalyzer),\n\t\t))\n\tsearch := bleve.NewSearchRequestOptions(indexerQuery, limit, start, false)\n\tsearch.SortBy([]string{\"-_score\"})\n\n\tresult, err := b.inner.Indexer.SearchInContext(ctx, search)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tret := internal.SearchResult{\n\t\tHits: make([]internal.Match, 0, len(result.Hits)),\n\t}\n\tfor _, hit := range result.Hits {\n\t\tid, err := indexer_internal.ParseBase36(hit.ID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tret.Hits = append(ret.Hits, internal.Match{\n\t\t\tID: id,\n\t\t})\n\t}\n\treturn &ret, nil\n}", "title": "" }, { "docid": "4da78b289866be372037f49b319914a9", "score": "0.562061", "text": "func (c *CommittedQuerier) Query() error {\n\tif c.Command != nil {\n\t\t// Parsing of the command line is done so silence cmd usage\n\t\tc.Command.SilenceUsage = true\n\t}\n\n\terr := c.validateInput()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproposal, err := c.createProposal()\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to create proposal\")\n\t}\n\n\tsignedProposal, err := signProposal(proposal, c.Signer)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to create signed proposal\")\n\t}\n\n\tproposalResponse, err := c.EndorserClient.ProcessProposal(context.Background(), signedProposal)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to endorse proposal\")\n\t}\n\n\tif proposalResponse == nil {\n\t\treturn errors.New(\"received nil proposal response\")\n\t}\n\n\tif proposalResponse.Response == nil {\n\t\treturn errors.New(\"received proposal response with nil response\")\n\t}\n\n\tif proposalResponse.Response.Status != int32(cb.Status_SUCCESS) {\n\t\treturn errors.Errorf(\"query failed with status: %d - %s\", proposalResponse.Response.Status, proposalResponse.Response.Message)\n\t}\n\n\treturn c.printResponse(proposalResponse)\n}", "title": "" }, { "docid": "300209ca52401bba2417091ec7a91530", "score": "0.5615255", "text": "func queryForParams(params SearchParams) string {\n\tif len(params.RawQuery) > 0 {\n\t\treturn params.RawQuery\n\t}\n\n\tbuilder := jiraquery.AndBuilder()\n\n\tif len(params.Project) > 0 {\n\t\tbuilder.Project(params.Project)\n\t}\n\n\tif len(params.IssueType) > 0 {\n\t\tbuilder.IssueType(params.IssueType)\n\t}\n\n\tif len(params.Status) > 0 {\n\t\tbuilder.Eq(jiraquery.Word(\"status\"), jiraquery.Word(params.Status))\n\t}\n\n\tif len(params.StatusCategory) > 0 {\n\t\tbuilder.Eq(\n\t\t\tjiraquery.Word(\"statusCategory\"),\n\t\t\tjiraquery.Word(fmt.Sprintf(\"%q\", params.StatusCategory)))\n\t}\n\n\tif len(params.Labels) > 0 {\n\t\tif len(params.Labels) == 1 {\n\t\t\tbuilder.Eq(jiraquery.Word(\"labels\"), jiraquery.Word(params.Labels[0]))\n\t\t} else {\n\t\t\tbuilder.In(jiraquery.Word(\"labels\"), jiraquery.List(params.Labels...))\n\t\t}\n\t}\n\n\tif len(params.Components) > 0 {\n\t\tif len(params.Components) == 1 {\n\t\t\tbuilder.Eq(\n\t\t\t\tjiraquery.Word(\"component\"),\n\t\t\t\tjiraquery.Word(fmt.Sprintf(\"%q\", params.Components[0])))\n\t\t} else {\n\t\t\tbuilder.In(jiraquery.Word(\"component\"), jiraquery.List(params.Components...))\n\t\t}\n\t}\n\n\tif params.CreatedAfter != nil {\n\t\tbuilder.GreaterThan(\n\t\t\tjiraquery.Word(\"created\"),\n\t\t\tjiraquery.Word(fmt.Sprintf(\"%q\", params.CreatedAfter.Format(\"2006-1-2 04:05\"))))\n\t}\n\n\tif params.CreatedBefore != nil {\n\t\tbuilder.LessThan(\n\t\t\tjiraquery.Word(\"created\"),\n\t\t\tjiraquery.Word(fmt.Sprintf(\"%q\", params.CreatedBefore.Format(\"2006-1-2 04:05\"))))\n\t}\n\n\treturn builder.Value().String()\n}", "title": "" }, { "docid": "62b2a062ffa21c4b5ea53c7ac0e4ac89", "score": "0.56141925", "text": "func Search(c *gin.Context) {\n\tvar (\n\t\tp searchEnvironments\n\t)\n\tif err := c.ShouldBind(&p); err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\tp.StartLimit, p.EndLimit = tools.GetPagination(p.Page, 0, commons.GetRangeLimit(), commons.GetRangeLimit())\n\n\tresult, err := p.search()\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Error occured while performing db query\")\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": \"Internal Server Error\"})\n\t\treturn\n\t}\n\n\tif len(result) == 0 {\n\t\tc.AbortWithStatus(204)\n\t} else {\n\t\tc.JSON(http.StatusOK, result)\n\t}\n}", "title": "" }, { "docid": "9b906e8e1f444576a4746242656f78b4", "score": "0.56137484", "text": "func SearchRepo(terms []string) (*RepoSearchResult, error) {\n\tq := url.QueryEscape(strings.Join(terms, \" \"))\n\tif q != \"\" {\n\t\tq = \"?q=topic:\" + q\n\t}\n\tresp, err := http.Get(RepoURL + q)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t//check the status code\n\tif resp.StatusCode != http.StatusOK {\n\t\tresp.Body.Close()\n\t\treturn nil, fmt.Errorf(\"search query Faild %s\", resp.Status)\n\t}\n\tvar result RepoSearchResult\n\tif err := json.NewDecoder(resp.Body).Decode(&result); err != nil {\n\t\tresp.Body.Close()\n\t\treturn nil, err\n\t}\n\tresp.Body.Close()\n\treturn &result, nil\n}", "title": "" }, { "docid": "aa2417f7d1f4248b8cb442fd8bbf1f3f", "score": "0.56112117", "text": "func (cl *Client) Query(query string, indexes ...string) (*QueryResult, error) {\n\tindex := \"*\"\n\n\tif len(indexes) > 0 {\n\t\tindex = indexes[0]\n\t}\n\n\tres, err := cl.RunQuery(NewSearch(query, index, \"\"))\n\n\tif res == nil {\n\t\treturn nil, err\n\t}\n\n\tif err == nil && res.Status != StatusError {\n\t\treturn res, nil\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "bfe6f24ada5f20df1811115d24bb027f", "score": "0.5609898", "text": "func (s *Server) Search(ctx context.Context, req *querypb.SearchRequest) (*internalpb.SearchResults, error) {\n\treturn s.querynode.Search(ctx, req)\n}", "title": "" }, { "docid": "1e9576e7f363f29ac0400dcee5d39572", "score": "0.5601764", "text": "func (c *StatusRClient) Query() *StatusRQuery {\n\treturn &StatusRQuery{config: c.config}\n}", "title": "" }, { "docid": "543ac3ac0534de5c1e77833c9743ff5a", "score": "0.55874807", "text": "func (s *stmt) Query(args []driver.Value) (driver.Rows, error) {\n\tlist := driverValueToNamedValue(args)\n\treturn s.query(context.Background(), list)\n}", "title": "" }, { "docid": "4d0bcbac5fea70945724aad84ddc67a3", "score": "0.5584613", "text": "func search(w http.ResponseWriter, r *http.Request) {\n\n\t// Get the form content\n\tr.ParseForm()\n\tlanguage := strings.Join(r.Form[\"Search\"], \"\")\n\n\t// Start the query on github\n\tts := oauth2.StaticTokenSource(\n\t\t&oauth2.Token{AccessToken: \"b1abf4e31f153ad21e19cf70dabce2310a731b1c\"},\n\t)\n\ttc := oauth2.NewClient(oauth2.NoContext, ts)\n\n\tclient := github.NewClient(tc)\n\n\t// Get the last id\n\topts:= &github.SearchOptions{Order: \"desc\"}\n\trepo, _, _ :=client.Search.Repositories(\">=2017-02-13\",opts)\n\tid:=*repo.Repositories[0].ID\n\n\t// Get the 100 last repositories\n\topt := &github.RepositoryListAllOptions{\n\t\tSince:id-100,\n\t\tListOptions: github.ListOptions{PerPage: 100},\n\t}\n\n\t// Get all pages of results\n\tvar allRepos []*github.Repository\n\trepos, _, err := client.Repositories.ListAll(opt)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tallRepos = append(allRepos, repos...)\n\treposChan := make(chan repos_hash, len(allRepos))\n\n\t// Get the languages information->by goroutine\n\tfor _, repo := range allRepos {\n\t\tgo gather(repo, client, reposChan)\n\t}\n\n\t// Gather the information->by channel\n\tresult := make([]repos_hash, len(allRepos))\n\n\tfor i := 0; i < len(allRepos); i++ {\n\t\tresult[i] = <-reposChan\n\t}\n\n\t// Find the total of lines\n\ttotal :=0\n\tprintres := make(map[int]string)\n\tfor _,elmt:=range result {\n\t\tif (elmt.hashtable[language]>0){\n\t\t\ttotal += elmt.hashtable[language]\n\t\t\t/*fmt.Printf(\"url :%s, number :%d\\n\",elmt.url,elmt.hashtable[language])*/\n\t\t\tnumber := elmt.hashtable[language]\n\t\t\turl := elmt.url\n\t\t\tprintres[number] = url\n\t\t}\n\t}\n\n\n\n\t// Print the page\n\n\tt, _ := template.ParseFiles(\"head.html\")\n\theadContent := map[string]string{\n\t\t\"Title\" : \"Result\",\n\t\t\"Language\" : language,\n\t\t\"result\": \" total : \"+strconv.Itoa(total)+\" lines\",\n\t}\n\tt.Execute(w, headContent)\n\n\t// Sort data\n\tvar keys []int\n\tfor k := range printres {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(keys)))\n\n/*\tvar script = \"[\"*/\n\n\tfor _, k := range keys {\n\t\tt, _ := template.ParseFiles(\"data.html\")\n\t\tdataContent := map[string]string{\n\t\t\t\"url\": printres[k],\n\t\t\t\"name\":\"link of the github : \"+printres[k],\n\t\t\t\"number\": strconv.Itoa(k)+\" lines\",\n\t\t}\n\t\tt.Execute(w, dataContent)\n\t\t// Gather information for script use\n/*\t\tscript+=\"{name:'\"+printres[k]+\"',y:\"+strconv.FormatFloat(float64(100*k/total), 'f', 2, 64)+\"},\"*/\n\t\t/*fmt.Println(\"Key:\", k, \"Value:\", printres[k])*/\n\t}\n\n\t\tu, _ := template.ParseFiles(\"footer.html\")\n\n\t\t// Script for pie print\n/*\t\tscript=script[:len(script)-1]\n\t\tscript+=\"]\"*/\n\n/*\t\tscriptContent := map[string]template.JS{\"script\":template.JS(script)}*/\n\t\tu.Execute(w, nil)//switch with scriptContent but the script doesn't work\n\t\t/*fmt.Println(\"Key:\", k, \"Value:\", printres[k])*/\n\n\n\n\n}", "title": "" }, { "docid": "04f735cac8963383de541059733d944e", "score": "0.5569692", "text": "func (c *Collection) Search(indexName string, query query.Query) (*SearchResult, error) {\n\tsearchRequest := bleve.NewSearchRequest(query)\n\n\treturn c.SearchWithOptions(indexName, searchRequest)\n}", "title": "" }, { "docid": "39b9553f2056b85f10bd2f97cd59fb60", "score": "0.5563495", "text": "func (c *BuildingClient) Query() *BuildingQuery {\n\treturn &BuildingQuery{config: c.config}\n}", "title": "" }, { "docid": "bc661068dbfbc666b5ef9e89cd83db52", "score": "0.556349", "text": "func (tx *Tx) Query(q string, vals ...interface{}) (*Rows, error) {\n\trows, err := tx.Tx.Query(q, vals...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trs := new(Rows)\n\trs.Rows = rows\n\treturn rs, nil\n}", "title": "" }, { "docid": "37d435a8813a9dc2be479cb08bb21fa6", "score": "0.5561629", "text": "func (n *Nrdb) Query(accountID int, query Nrql) (*NrdbResultContainer, error) {\n\trespBody := NrdbResultContainer{}\n\n\tvars := map[string]interface{}{\n\t\t\"accountId\": accountID,\n\t\t\"query\": query,\n\t}\n\n\tif err := n.client.NerdGraphQuery(gqlNrqlQuery, vars, &respBody); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &respBody, nil\n}", "title": "" }, { "docid": "6a3eb789c9097eef756f974c896140fc", "score": "0.5557374", "text": "func (d *Datastore) Query(q dsq.Query) (dsq.Results, error) {\n\td.l.Infow(\"executing query\", \"query\", q)\n\tif q.Orders != nil || q.Filters != nil {\n\t\treturn nil, fmt.Errorf(\"storj: filters or orders are not supported\")\n\t}\n\n\tlimit := q.Limit + q.Offset\n\t// disabling this makes tests fail, so we should\n\t// investigate what exactly disabling this does\n\tif limit == 0 || limit > listMax {\n\t\tlimit = listMax\n\t}\n\tresp, err := d.S3.ListObjectsV2(&s3.ListObjectsV2Input{\n\t\tBucket: aws.String(d.Bucket),\n\t\tPrefix: aws.String(d.s3Path(q.Prefix)),\n\t\tMaxKeys: aws.Int64(int64(limit)),\n\t})\n\tif err != nil {\n\t\td.l.Errorw(\"failed to list objects while running query\", \"error\", err)\n\t\treturn nil, err\n\t}\n\n\tindex := q.Offset\n\tnextValue := func() (dsq.Result, bool) {\n\t\tfor index >= len(resp.Contents) {\n\t\t\tif !*resp.IsTruncated {\n\t\t\t\treturn dsq.Result{}, false\n\t\t\t}\n\n\t\t\tindex -= len(resp.Contents)\n\n\t\t\tresp, err = d.S3.ListObjectsV2(&s3.ListObjectsV2Input{\n\t\t\t\tBucket: aws.String(d.Bucket),\n\t\t\t\tPrefix: aws.String(d.s3Path(q.Prefix)),\n\t\t\t\tDelimiter: aws.String(\"/\"),\n\t\t\t\tMaxKeys: aws.Int64(listMax),\n\t\t\t\tContinuationToken: resp.NextContinuationToken,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\td.l.Errorw(\"failed to list objects while running query\", \"error\", err)\n\t\t\t\treturn dsq.Result{Error: err}, false\n\t\t\t}\n\t\t}\n\n\t\tentry := dsq.Entry{\n\t\t\tKey: ds.NewKey(*resp.Contents[index].Key).String(),\n\t\t}\n\t\tif !q.KeysOnly {\n\t\t\tvalue, err := d.Get(ds.NewKey(entry.Key))\n\t\t\tif err != nil {\n\t\t\t\td.l.Errorw(\"failed to get objects while running query\", \"error\", err)\n\t\t\t\treturn dsq.Result{Error: err}, false\n\t\t\t}\n\t\t\tentry.Value = value\n\t\t}\n\n\t\tindex++\n\t\treturn dsq.Result{Entry: entry}, true\n\t}\n\n\treturn dsq.ResultsFromIterator(q, dsq.Iterator{\n\t\tClose: func() error {\n\t\t\treturn nil\n\t\t},\n\t\tNext: nextValue,\n\t}), nil\n}", "title": "" }, { "docid": "650f0b5317dd716c37c8f5f7d067a9cd", "score": "0.5556218", "text": "func (m *Main) Query(index, rawQuery, query string) (string, error) {\n\tresp := MustDo(\"POST\", m.URL()+fmt.Sprintf(\"/index/%s/query?\", index)+rawQuery, query)\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", fmt.Errorf(\"invalid status: %d, body=%s\", resp.StatusCode, resp.Body)\n\t}\n\treturn resp.Body, nil\n}", "title": "" }, { "docid": "729ecec76f45cfeba1d83a568f0f45ad", "score": "0.5548017", "text": "func Search(w http.ResponseWriter, r *http.Request) {\n\tid := identity.CurrentSession(r)\n\tq := r.URL.Query()\n\n\tquery := q.Get(\"query\")\n\tlog.Debug(\"Looking for nodes with query \", query)\n\tif strings.Contains(query, \"/\") {\n\t\tresponse := []SearchResult{}\n\t\tw.WriteHeader(http.StatusOK)\n\t\tjson.NewEncoder(w).Encode(&response)\n\t\treturn\n\t}\n\n\tnodes, err := db.SearchNodesByName(query, id.Username, id.Organizations)\n\tif err != nil {\n\t\tlog.Error(\"Failed to search for nodes: \", err)\n\t\thttp.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tresponse := make([]SearchResult, len(nodes))\n\tfor i, node := range nodes {\n\t\tisShared := node.Path[:strings.Index(node.Path, \"/\")] == id.Username\n\t\tnodeInfo, err := os.Stat(db.GetSetting(db.DAV_ROOT) + node.Path)\n\t\tif err != nil {\n\t\t\tlog.Error(\"Could not get node info: \", err)\n\t\t\tcontinue\n\t\t}\n\t\tvar shareNode *db.Share\n\t\tif isShared {\n\t\t\tfor _, target := range append(id.Organizations, id.Username) {\n\t\t\t\tshareNode, err = db.GetNodeShareToTarget(node.ID, target)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Errorf(\"Failed to get share on node %v to target %v\", node.ID, target)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif shareNode != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpermissionString := \"27\"\n\t\tif node.Isdir {\n\t\t\tpermissionString = \"31\"\n\t\t}\n\t\tif shareNode != nil {\n\t\t\tpermissionString = strconv.Itoa(shareNode.Permissions)\n\t\t}\n\t\ttypeString := \"file\"\n\t\tif node.Isdir {\n\t\t\ttypeString = \"folder\"\n\t\t}\n\t\tnodePath := node.Path[strings.Index(node.Path, \"/\")+1:]\n\t\tnodePath = nodePath[strings.Index(nodePath, \"/\")+1:]\n\n\t\tvar linkDir string\n\t\tif strings.Contains(nodePath, \"/\") {\n\t\t\tlinkDir = nodePath[:strings.LastIndex(nodePath, \"/\")]\n\t\t}\n\t\tlink := fmt.Sprintf(\"/index.php/apps/files/?dir=/%v&scrollto=%v\", linkDir, node.Path[strings.LastIndex(node.Path, \"/\")+1:])\n\n\t\tsr := SearchResult{\n\t\t\tId: strconv.FormatFloat(node.ID, 'e', -1, 64),\n\t\t\tLink: link,\n\t\t\tMime: node.MimeType,\n\t\t\tModified: strconv.Itoa(int(nodeInfo.ModTime().Unix())),\n\t\t\tName: nodeInfo.Name(),\n\t\t\tPath: nodePath,\n\t\t\tPermissions: permissionString,\n\t\t\tSize: strconv.Itoa(int(nodeInfo.Size())),\n\t\t\tType: typeString,\n\t\t}\n\t\tresponse[i] = sr\n\t}\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(&response)\n}", "title": "" }, { "docid": "75239da627bb4600c0dda7ab7b6f62ff", "score": "0.55389583", "text": "func buildESXiClusterSearchQuery(tx *gorm.DB, criteria *models.ESXiClusterFilterCriteria) *gorm.DB {\n\tdefaultLog.Trace(\"postgres/esxi_cluster_store:buildESXiClusterSearchQuery() Entering\")\n\tdefer defaultLog.Trace(\"postgres/esxi_cluster_store:buildESXiClusterSearchQuery() Leaving\")\n\n\tif tx == nil {\n\t\treturn nil\n\t}\n\n\ttx = tx.Model(&esxiCluster{})\n\tif criteria == nil {\n\t\treturn tx\n\t}\n\n\tif criteria.Id != uuid.Nil {\n\t\ttx = tx.Where(\"id = ?\", criteria.Id)\n\t} else if criteria.ClusterName != \"\" {\n\t\ttx = tx.Where(\"cluster_name = ?\", criteria.ClusterName)\n\t}\n\n\treturn tx\n}", "title": "" }, { "docid": "af9a08b03390c46454674d0d9fb9d400", "score": "0.5531259", "text": "func (c *conn) Query(query string, args []driver.Value) (driver.Rows, error) {\n\treturn c.query(context.Background(), query, args)\n}", "title": "" }, { "docid": "7e100280be7ae0f8d3f3ca963ec474d6", "score": "0.5504675", "text": "func (c *conn) Query(query string, args []driver.Value) (driver.Rows, error) {\n\treturn c.query(context.Background(), query, toNamedValues(args))\n}", "title": "" }, { "docid": "22c0c60dfadbfaaeed2775b9d6d30fba", "score": "0.5501441", "text": "func (tsr *TextSearchRequest) Query(qrfj *QueryResult) (string, error) {\n\n\t// Get data\n\tres, err := http.Get(tsr.Url) // post\n\n\tif err != nil {\n\t\treturn \"ERROR: \", err\n\t}\n\n\t// Check resposne code\n\tif res.StatusCode != 200 {\n\t\treturn \"ERROR: \", errors.New(res.Status)\n\t}\n\n\t//DEBUG\n\t// // Output response headers\n\t// for key, ele := range res.Header {\n\t// \tfmt.Print(key + \": \\n\")\n\t// \tfor key1, ele1 := range ele {\n\t// \t\tfmt.Print(\" \" + string(key1) + \":\" + ele1 + \"\\n\")\n\t// \t}\n\t// }\n\t//DEBUG^^^\n\n\t// Store data in it's type\n\tbody, err := ioutil.ReadAll(res.Body)\n\n\tif tsr.ResponseType == \"json\" {\n\t\tjson.Unmarshal(body, qrfj)\n\t} else if tsr.ResponseType == \"xml\" {\n\t\txml.Unmarshal(body, qrfj)\n\t}\n\tres.Body.Close()\n\tif err != nil {\n\t\treturn string(body), err\n\t}\n\n\t// store placaes in memory\t\n\n\t// return json\n\treturn string(body), nil\n\n}", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" }, { "docid": "de5dd008f864a460cbca2a551fedf1e8", "score": "0.5498347", "text": "func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }", "title": "" } ]
f91edb7f84fb8f00d7bb73cfed151285
Validate validates this consistency group consistency groups items0 luns items0 lun maps items0 igroup initiators items0
[ { "docid": "808802ac5c4ae7d741f1fca05af7bde2", "score": "0.6869505", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0LunMapsItems0IgroupInitiatorsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "19e8398e060e6ef2fb9c2b04dc9a666d", "score": "0.7567784", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0Space) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateGuarantee(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSize(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0b8c4f22ae33f5d99addce7fcab6af15", "score": "0.7556358", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateClone(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreateTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLunMaps(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateOsType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProvisioningOptions(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateQos(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSerialNumber(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSpace(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "10d4444712d293dbd11b9ac132cbfe7f", "score": "0.7453698", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0LunMapsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateIgroup(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "092e547fa47e8235036b80f5c310f977", "score": "0.74484706", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0LunMapsItems0Igroup) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateIgroups(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateInitiators(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateOsType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProtocol(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cce568c69c218ce9c4d47ba5deff1444", "score": "0.7331981", "text": "func (m *ConsistencyGroupLunsItems0LunMapsItems0Igroup) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateIgroups(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateInitiators(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateOsType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProtocol(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f7a418e9d4a289ac68d2b1a6aa8ff75d", "score": "0.73288524", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0LunMapsItems0IgroupIgroupsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f90ce622df7a82aa7a10ff3e0dd8f541", "score": "0.7259145", "text": "func (m *ConsistencyGroupLunsItems0LunMapsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateIgroup(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "46628df1d8466798916d0af455314a17", "score": "0.72380143", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0NamespacesItems0Space) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateBlockSize(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateGuarantee(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSize(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "430d2dc9306428241b0b7a2045109f3a", "score": "0.72210467", "text": "func (m *ConsistencyGroupLunsItems0LunMapsItems0IgroupIgroupsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b4b7bfc202377eea1f556f21641ed7b4", "score": "0.71738243", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0NamespacesItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreateTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateOsType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProvisioningOptions(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSpace(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSubsystemMap(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2f8b4cce07783b8a0bead3a3de86d9c5", "score": "0.7042071", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0Space) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "55a8a0eebab5fbd03863e517fd25a423", "score": "0.69523954", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0NamespacesItems0Status) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateContainerState(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateState(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aeb40eb60aa69fb8b82d11cb34404d94", "score": "0.6948498", "text": "func (m *AllocationItems0Group) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLong(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateShort(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f8576bfb9d0df46b577aeed7eceb7a84", "score": "0.69233704", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0NamespacesItems0SpaceGuarantee) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "c8bf6f39f14c7cf2cc83182964377746", "score": "0.6891992", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0SpaceGuarantee) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "7a125aefc32088b124a0575215c39fbc", "score": "0.6871893", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLanguage(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateNas(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProvisioningOptions(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateQos(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSnapshotPolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSpace(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTiering(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bb579509f76463685c6811f8e2e8e7e8", "score": "0.6752788", "text": "func (m *ConsistencyGroupInlineConsistencyGroupsInlineArrayItemInlineSpace) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "f1b53dd8058afed04a88482cb0bd9691", "score": "0.67113143", "text": "func (m *ConsistencyGroupInlineLunsInlineArrayItemInlineSpace) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateGuarantee(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSize(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c6d0a9b637d2a80aaeb5cb026c8965ea", "score": "0.67049116", "text": "func (m *ConsistencyGroupLunsItems0LunMapsItems0IgroupInitiatorsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e8a64b146514ddf2b760a8ff4c554236", "score": "0.66979474", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0NamespacesItems0SubsystemMap) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSubsystem(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fbd0b83c5df58658998993e9038ab85f", "score": "0.66560423", "text": "func (m *ConsistencyGroupInlineConsistencyGroupsInlineArrayItem) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateApplication(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLuns(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateNamespaces(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateParentConsistencyGroup(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProvisioningOptions(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateQos(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateRestoreTo(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSnapshotPolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSpace(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSvm(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTiering(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateVolumes(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "557fd40f4fccf5c0820e233acc4339ea", "score": "0.6648737", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0TieringObjectStoresItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "1603b7371fcb66be260da540dd94987a", "score": "0.6621742", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0TieringObjectStoresItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "86ed089a74fad191f8ca3d243b951fd6", "score": "0.66039926", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0Qos) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ed3e3a7534ae70cf185a27f3b33710b8", "score": "0.659478", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0Nas) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateCifs(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateExportPolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateJunctionParent(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSecurityStyle(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08e57fb4bf64690d7ef2870151b9c5da", "score": "0.6586519", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateClone(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateCreateTime(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLunMaps(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateProvisioningOptions(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateQos(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSerialNumber(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSpace(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateUUID(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3e13787c99b73293491a8d933463d269", "score": "0.6509249", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0LunMapsItems0Igroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateIgroups(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateInitiators(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateUUID(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4fb1ced5545d3ca22e60094a5aea087b", "score": "0.65053064", "text": "func (m *AllocationItems0GroupLong) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "2bb67fe56ff68272802574cb9aa34cf0", "score": "0.6490485", "text": "func (m *ConsistencyGroupInlineNamespacesInlineArrayItemInlineSpace) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateBlockSize(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateGuarantee(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSize(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d3f88cce84122e4f149ad5d3b8bca77b", "score": "0.64713466", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0Clone) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateSource(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aa2a783237185c47a1422082f2eae09b", "score": "0.6455724", "text": "func (m *AllocationItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAssetClass(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateGroup(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSector(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a8250e1cd6b91c78458afce88fb97fa5", "score": "0.64074725", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0LunMapsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateIgroup(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "be30dd342940f9b77cba09d17c157ca2", "score": "0.63925076", "text": "func (m *AllocationItems0GroupShort) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "a05eb173afd708843619b0174e343368", "score": "0.63786006", "text": "func (m *ConsistencyGroupLunsItems0LunMapsItems0Igroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateIgroups(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateInitiators(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateUUID(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a28a7710c1a726a6c6739c667def59f9", "score": "0.63586974", "text": "func (m *ConsistencyGroupInlineLunsInlineArrayItem) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateClone(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreateTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLunMaps(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateOsType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProvisioningOptions(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateQos(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSerialNumber(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSpace(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a95b1fc1cd7d9990049b552b3b3cb597", "score": "0.63178855", "text": "func (m *ConsistencyGroupInlineConsistencyGroupsInlineArrayItemInlineSvm) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "296daaeeb5d47feca975562b446b2499", "score": "0.62864834", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0Tiering) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateControl(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateObjectStores(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validatePolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1abea414803ce911434fbf8dbec91120", "score": "0.62845016", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0NamespacesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateCreateTime(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateEnabled(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateProvisioningOptions(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSpace(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateStatus(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSubsystemMap(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateUUID(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8a0370c5237adccf787f070ab65baada", "score": "0.6279498", "text": "func (m *AggregateBlockStorageHybridCacheSimulatedRaidGroupsItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "0aa339d0d78524281071e31a9efbab36", "score": "0.6255359", "text": "func (m *ConsistencyGroupLunsItems0LunMapsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateIgroup(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3b484312cf529da7c432fa4bb981a06e", "score": "0.6253207", "text": "func (m *ConsistencyGroupTieringObjectStoresItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "33e527265e78237b2768c9ec621521ef", "score": "0.6212026", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0ProvisioningOptions) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAction(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "07c6e96c4b539455939cf86a4a1d5621", "score": "0.620324", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0Space) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateGuarantee(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d7fda9f1b7bcdac1f14db33c8352529c", "score": "0.6176439", "text": "func (m *ConsistencyGroupInlineVolumesInlineArrayItemInlineSpace) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "010186888902bea9bbd839128feb2ecf", "score": "0.616275", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0NasCifs) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateShares(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6791dbd2407d7e186f074e53e30fefba", "score": "0.615048", "text": "func (m *ConsistencyGroupVolumesItems0TieringObjectStoresItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "a7e37f83ebe1a76ab00abd80ba91b544", "score": "0.6149014", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0QosPolicy) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1cc17ae3ccf28be0872cc397b6bebbca", "score": "0.6145225", "text": "func (m *ConsistencyGroupInlineNamespacesInlineArrayItemInlineSubsystemMap) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSubsystem(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "897824c543a3ae14a289873467ddde2f", "score": "0.61402035", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0LunMapsItems0IgroupInitiatorsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "bd1ad6247676c545fba23948468a884a", "score": "0.61094356", "text": "func (m *ConsistencyGroupInlineNamespacesInlineArrayItem) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreateTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateOsType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProvisioningOptions(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSpace(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSubsystemMap(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b7196826e96398bb75272cd073efcf68", "score": "0.6108309", "text": "func (o *ClustersItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := o.validateHref(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := o.validateMasterURL(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := o.validateMasterWebURL(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := o.validateName(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := o.validateStatus(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := o.validateWorkerCount(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d77ae3b691a763d24a09d617fe041ac8", "score": "0.6104282", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0NamespacesItems0ProvisioningOptions) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAction(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "04b2e18e52fde4e22b89d09c93d2ab6a", "score": "0.610055", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0LunMapsItems0IgroupIgroupsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "839407015f5cc7de83a112e3adbbc9eb", "score": "0.6073947", "text": "func (m *AggregateBlockStoragePrimarySimulatedRaidGroupsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateRaidType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "495cc40642e2712e663e095334833221", "score": "0.6070165", "text": "func (m *ConsistencyGroup) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateApplication(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateClone(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateConsistencyGroupInlineConsistencyGroups(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateConsistencyGroupInlineLuns(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateConsistencyGroupInlineNamespaces(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateConsistencyGroupInlineVolumes(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateParentConsistencyGroup(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProvisioningOptions(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateQos(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateRestoreTo(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSnapshotPolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSpace(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSvm(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTiering(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "84f3ee491db141476c15be34c3b7eec2", "score": "0.60651755", "text": "func (m *ConsistencyGroupLunsItems0LunMapsItems0IgroupIgroupsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "95a4626cb781db787d47a0b6a4727dd3", "score": "0.60185313", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0Qos) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6a730e99d663e58c2b2f9c6a566cf5a5", "score": "0.6015527", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateNas(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateProvisioningOptions(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateQos(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSnapshotPolicy(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSpace(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateTiering(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateUUID(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8dd066470e5ffbb0041c73a71420a14b", "score": "0.5990589", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0CloneSource) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "250a28b3cd74129b7c114e7e4f1f01e4", "score": "0.5988745", "text": "func (m *ConsistencyGroupLunsItems0LunMapsItems0IgroupInitiatorsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "f1465ceb949685a730e4acac750cebb5", "score": "0.59784615", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0NamespacesItems0Space) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateGuarantee(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "963b736bc0348de9b388a635e216710f", "score": "0.5968443", "text": "func (m *ConsistencyGroupInlineSpace) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "42a86c8ada741aab69c63ec52cc4e5c2", "score": "0.5950877", "text": "func (m *LunInlineLunMapsInlineArrayItemInlineIgroup) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ac45ba3cb5b962bf8e1fc947ebad5fb0", "score": "0.5944451", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0NamespacesItems0SubsystemMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateAnagrpid(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateNsid(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSubsystem(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "07b453698b7c7c2d6ed6c26832b463a3", "score": "0.5912209", "text": "func (o *GetFamiliesFamilyCodeVariantsCodeOKBodyVariantAttributeSetsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := o.validateAxes(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := o.validateLevel(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1cb1458de9777bad53234cc53b615503", "score": "0.5904227", "text": "func (m *ConsistencyGroupInlineConsistencyGroupsInlineArrayItemInlineQos) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "13a5ce592cd4467d8bb10e5b46f18bec", "score": "0.5902127", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0ProvisioningOptions) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAction(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStorageService(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2a03df0a1f752a9c71f287a338f71762", "score": "0.58855647", "text": "func (g *FailureGroup) Valid() error {\n\t// All of the component slices must be valid.\n\tif !g.brokeIn.Valid() {\n\t\treturn fmt.Errorf(\"FailureGroup: brokeIn is invalid: %v\", g.brokeIn)\n\t}\n\tif !g.failing.Valid() {\n\t\treturn fmt.Errorf(\"FailureGroup: failing is invalid: %v\", g.failing)\n\t}\n\tif !g.fixedIn.Valid() {\n\t\treturn fmt.Errorf(\"FailureGroup: fixedIn is invalid: %v\", g.fixedIn)\n\t}\n\t// brokeIn must be a subslice of failing.\n\tif g.brokeIn.Overlap(g.failing).Len() != g.brokeIn.Len() {\n\t\treturn fmt.Errorf(\"FailureGroup: brokeIn is not a subslice of failing: %v and %v\", g.brokeIn, g.failing)\n\t}\n\t// brokeIn and fixedIn can't overlap.\n\tif g.brokeIn.Overlap(g.fixedIn).Len() != 0 {\n\t\treturn fmt.Errorf(\"FailureGroup: brokeIn overlaps fixedIn: %v and %v\", g.brokeIn, g.fixedIn)\n\t}\n\t// failing and fixedIn can't overlap.\n\tif g.failing.Overlap(g.fixedIn).Len() != 0 {\n\t\treturn fmt.Errorf(\"FailureGroup: failing overlaps fixedIn: %v and %v\", g.failing, g.fixedIn)\n\t}\n\t// Must have at least one ID.\n\tif len(g.Ids) < 1 {\n\t\treturn fmt.Errorf(\"FailureGroup: no IDs\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0dff00eac0a8c0d43f9a0d84300fc9d7", "score": "0.5877046", "text": "func (m *ConsistencyGroupInlineConsistencyGroupsInlineArrayItemInlineApplication) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateComponentType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fd288972bb7e89d9108b365f7de98910", "score": "0.5875159", "text": "func (o *DataItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := o.validateErrors(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := o.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\t// validation for a type composition with models.MessageObject\n\tif err := o.MessageObject.Validate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "39c6080053461bd1fcad5b6a92dd03de", "score": "0.58511066", "text": "func (m *OrderShipmentItemsItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "76cb83ddb13ac846bedf8a58f7a78eab", "score": "0.5845224", "text": "func (m *ConsistencyGroupInlineLunsInlineArrayItemInlineSpaceInlineGuarantee) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "ad68349e42c2a2d6a89c836d3e641320", "score": "0.5837473", "text": "func (m *ItemPhysicalOptionsItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "2650f7461cb320e57215e9328f5a1990", "score": "0.58267", "text": "func (m *ConsistencyGroupInlineNamespacesInlineArrayItemInlineSpaceInlineGuarantee) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "775b470073a21f48ff865e484778c51a", "score": "0.58210075", "text": "func (m *ConsistencyGroupInlineConsistencyGroupsInlineArrayItemInlineParentConsistencyGroup) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "67cb8b2d067423bae827c4d3efa832c4", "score": "0.58142316", "text": "func (m *ConsistencyGroupInlineConsistencyGroupsInlineArrayItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateApplication(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLuns(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateNamespaces(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateParentConsistencyGroup(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateProvisioningOptions(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateQos(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRestoreTo(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSnapshotPolicy(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSpace(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSvm(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateTiering(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateVolumes(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "060fff62e739ce73d9ad738d05954a56", "score": "0.5804238", "text": "func (m *LunInlineConsistencyGroup) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cd63b1294b2b6e6446ecb13a17de5f11", "score": "0.57973635", "text": "func (m *ConsistencyGroupInlineNamespacesInlineArrayItemInlineStatus) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateContainerState(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateState(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ade4ae6cf775f11da4bb28201a11c7cf", "score": "0.5778151", "text": "func (o *LabelsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e84492a3c86e19fdf6a41ffa2ef7eddf", "score": "0.5774859", "text": "func (m *ConsistencyGroupInlineVolumesInlineArrayItem) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateComment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLanguage(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateNas(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProvisioningOptions(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateQos(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSnapshotPolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSpace(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTiering(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d3e36ee82227ce3ea59d49d16bc04cbc", "score": "0.5754542", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0Nas) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateCifs(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateExportPolicy(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateJunctionParent(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0d119c05d32669254104f49addd6a352", "score": "0.57526565", "text": "func (o *DataItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with models.ClientParams\n\tif err := o.ClientParams.Validate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "47bb3757abaae5d6bc267a6e5d3c68f5", "score": "0.5746023", "text": "func (m *AllocationItems0Sector) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLong(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateShort(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "709fd2af6d5031fda79578bb8d511f25", "score": "0.5742195", "text": "func (m *ConsistencyGroupInlineConsistencyGroupsInlineArrayItemInlineSvmInlineLinks) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateSelf(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6d14dc5b1aafdac3f2f6106cebe0d3aa", "score": "0.574044", "text": "func (m *ConsistencyGroupInlineLunsInlineArrayItemInlineQos) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7a1253031d7a2db3b17a97d07ce291de", "score": "0.573341", "text": "func (m *MergesSuccessfulParentsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "63b168647efb67ffbdcd7c89fc2627d5", "score": "0.5727505", "text": "func (m *ConsistencyGroupInlineConsistencyGroupsInlineArrayItemInlineTiering) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateControl(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateObjectStores(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validatePolicy(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "70c48f01059fc5b124c1456923dffdf1", "score": "0.5726193", "text": "func (m *CommitParentsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "34fd5462343dfbb73a1f91d71d15b6f4", "score": "0.56988114", "text": "func (m *RingStatisticItemAllOf1) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateValue(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "45a79296e88eaf94b35cf7ac47fe0692", "score": "0.56903183", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0NasJunctionParent) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d92bf24dba3c44cac698035b591aa91b", "score": "0.5689512", "text": "func (o *GetCorporationsCorporationIDStructuresOKBodyItems0ServicesItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := o.validateName(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := o.validateState(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "56cd69f16857b7431a544f572ad7993c", "score": "0.56582874", "text": "func (o *DataItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with models.MainData\n\tif err := o.MainData.Validate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\t// validation for a type composition with models.ExtendedData\n\tif err := o.ExtendedData.Validate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\t// validation for a type composition with models.PatientObject\n\tif err := o.PatientObject.Validate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "258f88de31e54c3af19345782bd66264", "score": "0.5648949", "text": "func (m *ExchangeTypeOfDataItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "b64015a16577fc2b17c4142dbfe0acf3", "score": "0.56466633", "text": "func (o *UpdateACartCreatedBodyLineItemsItems0PhysicalItemsItems0DiscountsItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "4ed8c204d134d68b184576d6a90348aa", "score": "0.5631667", "text": "func (o *GetUserDocumentgroupsOKBodyDocumentGroupsItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := o.validateDocuments(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2e48a4f3b3d112b79bd7987e8d4281a0", "score": "0.56128883", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0LunsItems0Qos) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidatePolicy(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "248d36bb9d44ff15b6c17b4ab548d820", "score": "0.56123096", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0QosPolicy) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b92c4fecac7f772a38acde37a90efecd", "score": "0.5606526", "text": "func (m *ConsistencyGroupConsistencyGroupsItems0VolumesItems0ProvisioningOptionsStorageService) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9182f35493a9f8fea8aacf5b91a110f4", "score": "0.56035215", "text": "func (m *LunInlineLunMapsInlineArrayItem) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateIgroup(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "18e1b97ae3e21e899453a993df55cb01", "score": "0.5602553", "text": "func (m *AllocationItems0SectorLong) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" } ]
ca64f04e6b8b57710ad2e7f350c65bd6
TypeOf returns varType of identifier by name
[ { "docid": "f93104a6c9415ad7b32b6a0400b3bc39", "score": "0.7117588", "text": "func (table *SymbolTable) TypeOf(name string) string {\n\tif val, ok := table.classTable[name]; ok {\n\t\treturn val.varType\n\t}\n\tif val, ok := table.subroutineTable[name]; ok {\n\t\treturn val.varType\n\t}\n\treturn \"\"\n}", "title": "" } ]
[ { "docid": "7553d7d4c8bc52cb9c361ab16bdd98be", "score": "0.6312934", "text": "func getType(id string) string {\n return typeMap[id]\n}", "title": "" }, { "docid": "3aaa73cc248f586459d16dd806e6da52", "score": "0.6305854", "text": "func typeVariable(mem *Memo, e opt.ScalarExpr) *types.T {\n\tvariable := e.(*VariableExpr)\n\ttyp := mem.Metadata().ColumnMeta(variable.Col).Type\n\tif typ == nil {\n\t\tpanic(errors.AssertionFailedf(\"column %d does not have type\", log.Safe(variable.Col)))\n\t}\n\treturn typ\n}", "title": "" }, { "docid": "56f358ebc5ad04667e0446fdd3fa2fc5", "score": "0.62520206", "text": "func typeVariable(ev ExprView) types.T {\n\tcolID := ev.Private().(opt.ColumnID)\n\ttyp := ev.Metadata().ColumnType(colID)\n\tif typ == nil {\n\t\tpanic(fmt.Sprintf(\"column %d does not have type\", colID))\n\t}\n\treturn typ\n}", "title": "" }, { "docid": "c519fba566d6ddc5544c54e0bfabd12a", "score": "0.6128712", "text": "func (g *pepperGen) typeName(str string) string {\n return g.gen.TypeName(g.objectNamed(str))\n}", "title": "" }, { "docid": "f2bb1b5737cf8501981214ccc5cedc69", "score": "0.6101789", "text": "func (data *goData) DefineTypeOfVars() string {\n\tidToType := data.idToTypeOfs()\n\tif len(idToType) == 0 {\n\t\treturn \"\"\n\t}\n\ts := `\n// Initialize type definitions.`\n\tfor id := 1; id <= len(idToType); id++ {\n\t\t// We need to generate a Go expression of type *vdl.Type that represents the\n\t\t// type. Since the rest of our logic can already generate the Go code for\n\t\t// any value, we just wrap it in vdl.TypeOf to produce the final result.\n\t\t//\n\t\t// This may seem like a strange roundtrip, but results in less generator and\n\t\t// generated code.\n\t\t//\n\t\t// There's no need to convert the value to its native representation, since\n\t\t// it'll just be converted back in vdl.TypeOf.\n\t\ttt := idToType[id]\n\t\ttypeOf := data.InitializationExpression(tt)\n\t\ts += fmt.Sprintf(`\n\t%[1]s = %[2]s`, typeOfVarName(tt, id), typeOf)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "cf79d68752d9b6185e946b583d5797ef", "score": "0.6001948", "text": "func (c *identifier) Type() typeof.Type {\n\treturn typeof.String\n}", "title": "" }, { "docid": "9fc6f964f02733b957a100be4efc130c", "score": "0.59926236", "text": "func guessType(name string) VarType {\n\tname = strings.ToUpper(name)\n\tif strings.Contains(name, \"PATH\") || strings.Contains(name, \"DIRS\") {\n\t\treturn VarList\n\t}\n\treturn VarScalar\n}", "title": "" }, { "docid": "6df6eec969dc512e62599b84e6b86b27", "score": "0.59811854", "text": "func Ast_SymGetType(ident string) (s string, ok bool){\n\n // A very odd hack, because oberon allows internal DT to declared again\n\n switch ident {\n case \"_#INTEGER\" :\n return \"_#INTEGER\", true\n case \"_#BOOLEAN\" :\n return \"_#BOOLEAN\", true\n case \"_#CHAR\" :\n return \"_#CHAR\", true\n case \"_ARRAY_#CHAR\" :\n return \"_ARRAY_#CHAR\", true\n case \"_ARRAY_#INTEGER\" :\n return \"_ARRAY_#INTEGER\", true\n case \"_ARRAY_#BOOLEAN\" :\n return \"_ARRAY_#BOOLEAN\", true\n }\n\n ele, ok := Ast_SymCheckIdent(ident)\n\n // This call should ideally never fail\n if !ok {\n return \"\", ok\n }\n\n if ident == s {\n return s, true\n }\n\n //s, ok = Ast_SymGetType(s)\n\n if ele.GetNtype() != \"_#INTEGER\" && ele.GetNtype() != \"_#BOOLEAN\" && ele.GetNtype() != \"_#CHAR\" && \n ele.GetSize() >= 0 {\n s = \"_ARRAY_\"+ele.GetNtype()\n } else {\n s = ele.GetNtype()\n }\n\n return s, ok\n}", "title": "" }, { "docid": "08e612b41e47c370d1198951460bc5a5", "score": "0.5973994", "text": "func TypeByName(n string) Type {\n\tt, ok := g_types[n]\n\tif ok {\n\t\treturn t\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d81e349167b6b935903a26b51f070b53", "score": "0.5939889", "text": "func (o VariableOutput) VariableType() VariableTypePtrOutput {\n\treturn o.ApplyT(func(v *Variable) VariableTypePtrOutput { return v.VariableType }).(VariableTypePtrOutput)\n}", "title": "" }, { "docid": "a98abe55e781d22e71ed902d0cda1d34", "score": "0.59310037", "text": "func TypeOf(i interface{}) reflect.Type", "title": "" }, { "docid": "06724bc118dc214dfddee84b23456e1f", "score": "0.5879978", "text": "func (a *Api) nameAndType(w http.ResponseWriter, r *http.Request) (string, scrap.Type, bool) {\n\tname := chi.URLParam(r, nameVar)\n\tt, ok := a.getType(w, r)\n\treturn name, t, ok\n}", "title": "" }, { "docid": "d093ca6bad5db8f31fd20800f5a65264", "score": "0.5868959", "text": "func (lv *LocalVariable) Type() model.Type {\n\treturn lv.VariableType\n}", "title": "" }, { "docid": "14d0a8e45c5a6c1b5fd4db99a1b08fe0", "score": "0.5863879", "text": "func GetIdentType(ident string) Type {\n\tif tokType, ok := keywords[ident]; ok {\n\t\treturn tokType\n\t}\n\treturn IDENT\n}", "title": "" }, { "docid": "d49d2ba0ba6d0796f44b0b60782f811b", "score": "0.5843156", "text": "func (table *SymbolTable) KindOf(name string) string {\n\tkind := \"\"\n\tif val, ok := table.classTable[name]; ok {\n\t\tkind = val.kind\n\t}\n\tif val, ok := table.subroutineTable[name]; ok {\n\t\tkind = val.kind\n\t}\n\tif kind == mapping.IdentifierTypeField {\n\t\tkind = \"this\"\n\t}\n\treturn kind\n}", "title": "" }, { "docid": "886858efe06f68dafdc364b539b7b159", "score": "0.58191836", "text": "func (g *grpcserial) typeName(str string) string {\n return g.gen.TypeName(g.objectNamed(str))\n}", "title": "" }, { "docid": "24fa3cd511a8a1b8ad776e86995d5338", "score": "0.5807197", "text": "func (q *qr) typeName(str string) string {\n\treturn q.gen.TypeName(q.objectNamed(str))\n}", "title": "" }, { "docid": "bc0cb4ea354c5eb734d52fec04fa4bc7", "score": "0.5787844", "text": "func (g *carno) typeName(str string) string {\n\treturn g.gen.TypeName(g.objectNamed(str))\n}", "title": "" }, { "docid": "d59d5cea55e5caa46a06daf0a6c1e8a8", "score": "0.57725054", "text": "func Ast_SymGetType(ident string) (s string, ok bool){\n\n\t// A very odd hack, because oberon allows internal DT to declared again\n\n\tswitch ident {\n\t\tcase \"_#INTEGER\" :\n\t\t\treturn \"_#INTEGER\", true\n\t\tcase \"_#BOOLEAN\" :\n\t\t\treturn \"_#BOOLEAN\", true\n\t\tcase \"_#CHAR\" :\n\t\t\treturn \"_#CHAR\", true\n\t\tcase \"_ARRAY_#CHAR\" :\n\t\t\treturn \"_ARRAY_#CHAR\", true\n\t\tcase \"_ARRAY_#INTEGER\" :\n\t\t\treturn \"_ARRAY_#INTEGER\", true\n\t\tcase \"_ARRAY_#BOOLEAN\" :\n\t\t\treturn \"_ARRAY_#BOOLEAN\", true\n\t}\n\n\tele, ok := Ast_SymCheckIdent(ident)\n\n\t// This call should ideally never fail\n\tif !ok {\n\t\treturn \"\", ok\n\t}\n\n\tif ident == s {\n\t\treturn s, true\n\t}\n\n\t//s, ok = Ast_SymGetType(s)\n\n\tif ele.ntype != \"_#INTEGER\" && ele.ntype != \"_#BOOLEAN\" && ele.ntype != \"_#CHAR\" &&\n\t\t\t\t\t\t\tele.size >= 0 {\n\t\ts = \"_ARRAY_\"+ele.ntype\n\t} else {\n\t\ts = ele.ntype\n\t}\n\n\treturn s, ok\n}", "title": "" }, { "docid": "271b4b1042068271c741265f813d1ccf", "score": "0.57557386", "text": "func TypeOf(key string) (ValueType, bool) {\n\td, ok := registry[key]\n\treturn d.Typ, ok\n}", "title": "" }, { "docid": "52f80c5e8e0c84a75e9c5e3cafe03093", "score": "0.57483697", "text": "func (g *micro) typeName(str string) string {\n\treturn g.gen.TypeName(g.objectNamed(str))\n}", "title": "" }, { "docid": "52f80c5e8e0c84a75e9c5e3cafe03093", "score": "0.57483697", "text": "func (g *micro) typeName(str string) string {\n\treturn g.gen.TypeName(g.objectNamed(str))\n}", "title": "" }, { "docid": "f648ec60e47d9a0a6bf039a9bb408836", "score": "0.5741614", "text": "func search_typ(id string, varGlobalList []Variable, varLocalList []Variable) string {\n\tvar typ string = \"error\"\n\tfor i := range varGlobalList {\n\t\tif id == varGlobalList[i].Ident {\n\t\t\ttyp = varGlobalList[i].Type\n\t\t\tbreak\n\t\t}\n\t}\n\tfor i := range varLocalList {\n\t\tif id == varLocalList[i].Ident {\n\t\t\ttyp = varLocalList[i].Type\n\t\t\tbreak\n\t\t}\n\t}\n\tif typ == \"error\" {\n\t\tpanic(\"Variable \\\"\" + id + \"\\\" in reduction clause not previously initialized.\")\n\t}\n\treturn typ\n}", "title": "" }, { "docid": "bbb63a91f3f94d64f6898ee95882d827", "score": "0.57159746", "text": "func TypeOf(pass *analysis.Pass, name string) types.Type {\n\treturn analysisutil.TypeOf(pass, ImportPath, name)\n}", "title": "" }, { "docid": "85027bdfa4c683eb4873bdc2c8cf4176", "score": "0.57028574", "text": "func main(){\n\n\t\t\tfmt.Println(\"Name is : \",name,\" and is type \",reflect.TypeOf(name))\n\t\t\tfmt.Println(\"Module is : \",module,\" and is type : \",reflect.TypeOf(module))\n\t\t\tfmt.Println(\"Number is : \",number,\" and is type : \",reflect.TypeOf(number))\n}", "title": "" }, { "docid": "f54d705dbc9839d9d1a35d43583da2b3", "score": "0.5695477", "text": "func (o *ObjectPtr) TypeName() string {\n\treturn \"<free-var>\"\n}", "title": "" }, { "docid": "7b32b121e7c2635241d98a99a57f8ac7", "score": "0.56722105", "text": "func (o GroupVariableOutput) VariableType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GroupVariable) pulumi.StringPtrOutput { return v.VariableType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f9089fbc5e84d07c3873e2e0574c2b75", "score": "0.566519", "text": "func dbg_gvar_basetype(program string,\n\toffset uintptr) (dwarf.Type, error) {\n\tlegolas, err := elf.Open(program)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error elf.Opening(%s): %v\", program, err)\n\t}\n\tdefer legolas.Close()\n\n\tgimli, err := legolas.DWARF()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"no dwarf info for %s? %v\", program, err)\n\t}\n\n\trdr := gimli.Reader()\n\n\tfor ent, err := rdr.Next(); ent != nil && err != io.EOF; ent, err = rdr.Next() {\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif ent.Tag == dwarf.TagVariable {\n\t\t\tloc, ok := ent.Val(dwarf.AttrLocation).([]uint8)\n\t\t\t// if we can't grab the loc, this is probably a libc symbol, e.g. 'stdin'\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif loc[0] != 0x03 { // this isn't a DW_OP_addr, and thus not a global\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvar addr uint64\n\t\t\tbuf := bytes.NewReader(loc[1:])\n\t\t\tbinary.Read(buf, binary.LittleEndian, &addr)\n\t\t\tif uintptr(addr) == offset {\n\t\t\t\tty, err := dbg_base_type(ent)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif ty.Tag != dwarf.TagBaseType {\n\t\t\t\t\tpanic(\"dbg_base_type is buggy\")\n\t\t\t\t}\n\t\t\t\ttyp, err := gimli.Type(ty.Offset)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn typ, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"offset %v not found\", offset)\n}", "title": "" }, { "docid": "b447e5b73c08ca9a83fb7a45bd129725", "score": "0.56459993", "text": "func getType(t string) string {\n\tif s, ok := M_DataType[t]; ok {\n\t\treturn s\n\t}\n\n\treturn \"string\"\n}", "title": "" }, { "docid": "d4602e94a764601ff4e0f37486c90dd1", "score": "0.5620372", "text": "func (v *Var) SourceType() string {\n\tbits := strings.Fields(v.Source)\n\n\treturn bits[0]\n}", "title": "" }, { "docid": "5af0ad7cdabcdfd7e78ca760aad6ddd9", "score": "0.56045294", "text": "func (l *Literal) typeof(*ExpressionEnv, []*querypb.Field) (sqltypes.Type, typeFlag) {\n\tvar f typeFlag\n\tswitch e := l.inner.(type) {\n\tcase nil:\n\t\treturn sqltypes.Null, flagNull | flagNullable\n\tcase *evalBytes:\n\t\tif e.isBitLiteral {\n\t\t\tf |= flagBit\n\t\t}\n\t\tif e.isHexLiteral {\n\t\t\tf |= flagHex\n\t\t}\n\tcase *evalInt64:\n\t\tif e.i == math.MinInt64 {\n\t\t\tf |= flagIntegerUdf\n\t\t}\n\t\tif e == evalBoolTrue || e == evalBoolFalse {\n\t\t\tf |= flagIsBoolean\n\t\t}\n\tcase *evalUint64:\n\t\tif e.hexLiteral {\n\t\t\tf |= flagHex\n\t\t}\n\t\tif e.u == math.MaxInt64+1 {\n\t\t\tf |= flagIntegerCap\n\t\t}\n\t\tif e.u > math.MaxInt64+1 {\n\t\t\tf |= flagIntegerOvf\n\t\t}\n\t}\n\treturn l.inner.SQLType(), f\n}", "title": "" }, { "docid": "8f983ac71d5bf899378de19e78baaf56", "score": "0.5594849", "text": "func (ig *irpc) typeName(str string) string {\n\treturn ig.gen.TypeName(ig.objectNamed(str))\n}", "title": "" }, { "docid": "efb4bc3e670a3ec11394dbf0400aa61f", "score": "0.55927587", "text": "func (d *disassembler) varName(scope resolver.Scope, index int) string {\n\tswitch scope {\n\tcase resolver.Global:\n\t\treturn d.program.scalarNames[index]\n\tcase resolver.Local:\n\t\treturn d.localName(index)\n\tdefault: // resolver.Special\n\t\treturn ast.SpecialVarName(index)\n\t}\n}", "title": "" }, { "docid": "a78c7f098ae44cf6987ca11099b106a4", "score": "0.5585222", "text": "func LookupIdent(ident string) Type {\n\tif tok, ok := keywords[ident]; ok {\n\t\treturn tok\n\t}\n\tif unicode.IsUpper(bytes.Runes([]byte(ident))[0]) {\n\t\treturn CONST\n\t}\n\treturn IDENT\n}", "title": "" }, { "docid": "ffcb24072356cc495badc5061e79f158", "score": "0.558175", "text": "func (g *chassis) typeName(str string) string {\n\treturn g.gen.TypeName(g.objectNamed(str))\n}", "title": "" }, { "docid": "48b823707820ce57c72aba2308ecd56a", "score": "0.55803335", "text": "func NewVarType(lt *Type) *Type {\n\t// somehow need to guarantee that the shadow type is not `var`\n\treturn &Type{\n\t\tName: \"var\",\n\t\tType: VarType,\n\t\tShadowType: lt,\n\t\t// UpgradesTo: UpgradableTypesMap[lt],\n\t}\n}", "title": "" }, { "docid": "b582a48f33a367af7f04337f87dfe4b9", "score": "0.55786264", "text": "func (l *State) TypeOf(i int) TypeID {\n\treturn typeOf(l.get(i))\n}", "title": "" }, { "docid": "6d10f7e5611d1c0be5d4d3e279f05637", "score": "0.5577257", "text": "func TypeOf(value string) string {\n\tif _, err := strconv.ParseInt(value, 10, 64); err == nil {\n\t\treturn \"int64\"\n\t}\n\tif _, err := strconv.ParseFloat(value, 64); err == nil {\n\t\treturn \"float64\"\n\t}\n\tif _, err := strconv.ParseBool(value); err == nil {\n\t\treturn \"bool\"\n\t}\n\treturn \"string\"\n}", "title": "" }, { "docid": "955d7fac9813e50e25e05bb398fc81bb", "score": "0.55514795", "text": "func TypeString(t macho.Type,) string", "title": "" }, { "docid": "d1992e3a3f05b523a13769e9c4bfb80a", "score": "0.5550885", "text": "func (info *PackageInfo) TypeOf(e ast.Expr) types.Type {\n\tif t, ok := info.Types[e]; ok {\n\t\treturn t.Type\n\t}\n\t// Idents appear only in Defs/Uses, not Types.\n\tif id, ok := e.(*ast.Ident); ok {\n\t\treturn info.ObjectOf(id).Type()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9e73e468ed41c83630ac0c2d1ef4612e", "score": "0.55488557", "text": "func (e *TypeEnv) NewVar(name string) *TypeVariable {\n\tif t := e.Lookup(name); t != nil {\n\t\tpanic(fmt.Sprintf(\"NewVar: redefining type %q\", name))\n\t}\n\n\ttyvar := &TypeVariable{Name: name}\n\te.Types[name] = tyvar\n\treturn tyvar\n}", "title": "" }, { "docid": "ea56a91575bfb3a8db4acc6d5dc87570", "score": "0.5548587", "text": "func (a Cardinality) Name() string { return TypeOf(a).Name() }", "title": "" }, { "docid": "4778b918e5f65d508fd1b61980bcf11e", "score": "0.5539957", "text": "func LookupIdent(ident string) Type {\n\tif tp, ok := keywords[ident]; ok {\n\t\treturn tp\n\t}\n\n\treturn IDENT\n}", "title": "" }, { "docid": "5c7b4d70a53d0b12741470e299f687c0", "score": "0.5528605", "text": "func Type(id string) (result structs.Type, err error) {\n\terr = do(fmt.Sprintf(\"type/%s\", id), &result)\n\treturn result, err\n}", "title": "" }, { "docid": "f93b509447d1616be7f3f7b4b5739bb3", "score": "0.5524299", "text": "func (info *Info) TypeOf(e ast.Expr) Type {\n\tif t, ok := info.Types[e]; ok {\n\t\treturn t.Type\n\t}\n\tif id, _ := e.(*ast.Ident); id != nil {\n\t\tif obj := info.ObjectOf(id); obj != nil {\n\t\t\treturn obj.Type()\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fadbf3b83ccaac0f7f62aa812bbf811d", "score": "0.5524126", "text": "func (t *sanrpc) typeName(str string) string {\n\treturn t.gen.TypeName(t.objectNamed(str))\n}", "title": "" }, { "docid": "3bb7373606ea5f92dbd9f7899a0e77cc", "score": "0.5484456", "text": "func (v Value) Type() (t Type) { t.C = C.LLVMTypeOf(v.C); return }", "title": "" }, { "docid": "a0cda4e3f2cdd8acb3e9ff9cbbbcd5ba", "score": "0.5447581", "text": "func typeof(v interface{}) string {\n\treturn fmt.Sprintf(\"%T\", v)\n}", "title": "" }, { "docid": "c2e3b3b2938566361bc75a5956b16369", "score": "0.5445699", "text": "func (v *variable) Type() JSONType {\n\treturn v.jsonType\n}", "title": "" }, { "docid": "011e61daf374823ec36090d44fe688da", "score": "0.5443595", "text": "func main() {\n\tfmt.Println(\"Value of y: \", y)\n\tfmt.Printf(\"Type of y: %T\\n\", y)\n\n\tfmt.Printf(\"Type of z: %T\\n\", z)\n\t// z = 43 cannot be done since the var with the identifier \"z\" is a string\n\tfmt.Printf(\"Type of h: %T\\n\", h)\n\tfmt.Println(\"Value of h: \", h)\n\n}", "title": "" }, { "docid": "ddc19abb267a8ab7ff67be92ee06efd9", "score": "0.544333", "text": "func LookupIdent(ident string) Type {\n\tif tok, ok := keywords[ident]; ok {\n\t\treturn tok\n\t}\n\treturn IDENT\n}", "title": "" }, { "docid": "ddc19abb267a8ab7ff67be92ee06efd9", "score": "0.544333", "text": "func LookupIdent(ident string) Type {\n\tif tok, ok := keywords[ident]; ok {\n\t\treturn tok\n\t}\n\treturn IDENT\n}", "title": "" }, { "docid": "071d743014d65b462c90ce0bd77b48d4", "score": "0.54431516", "text": "func importvar(pos src.XPos, s *types.Sym, t *types.Type) *ir.Name {\n\treturn importobj(pos, s, ir.ONAME, ir.PEXTERN, t)\n}", "title": "" }, { "docid": "070bb899b7c1dd2d0b92524536981806", "score": "0.5407436", "text": "func (p *Parser) GetTypeByName(name string) *types.Struct {\n\tident := p.getIdentByName(name)\n\tif ident == nil {\n\t\treturn nil\n\t}\n\tdef, ok := p.defs[ident]\n\tif !ok {\n\t\treturn nil\n\t}\n\tstructType, ok := def.Type().Underlying().(*types.Struct)\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn structType\n}", "title": "" }, { "docid": "e89a4ef24e1654d45567423915b2001a", "score": "0.5400477", "text": "func varSpec() *Var {\n\ttokId := consumeToken(TK_IDENT)\n\tif tokId == nil {\n\t\tpanic(fmt.Sprintf(\"expected an identifier but got %#v\\n\", tokId))\n\t}\n\n\ttmp := newNoneType() // Temporary head.\n\tty := readTypePrefix(&tmp)\n\tty = tmp.base\n\n\treturn &Var{tokId.str, 0, true, ty}\n}", "title": "" }, { "docid": "91242b53668374b4c891b5dbcb4ed822", "score": "0.53928816", "text": "func (e *Env) Type(symbol string) (reflect.Type, error) {\n\te.rwMutex.RLock()\n\treflectType, ok := e.types[symbol]\n\te.rwMutex.RUnlock()\n\tif ok {\n\t\treturn reflectType, nil\n\t}\n\n\tif e.externalLookup != nil {\n\t\tvar err error\n\t\treflectType, err = e.externalLookup.Type(symbol)\n\t\tif err == nil {\n\t\t\treturn reflectType, nil\n\t\t}\n\t}\n\n\tif e.parent == nil {\n\t\treflectType, ok = basicTypes[symbol]\n\t\tif ok {\n\t\t\treturn reflectType, nil\n\t\t}\n\t\treturn NilType, fmt.Errorf(\"undefined type '%s'\", symbol)\n\t}\n\n\treturn e.parent.Type(symbol)\n}", "title": "" }, { "docid": "39d1fbe8db81fb8be42ae3a7f2c51802", "score": "0.5390186", "text": "func GetTypeDeclarationName(decl ast.Decl) string {\n\tgd, ok := decl.(*ast.GenDecl)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\n\tif gd.Tok != token.TYPE {\n\t\treturn \"\"\n\t}\n\n\ttypeName := \"\"\n\tfor _, spec := range gd.Specs {\n\t\ttypeSpec, ok := spec.(*ast.TypeSpec)\n\t\tif !ok {\n\t\t\treturn \"\"\n\t\t}\n\t\ttypeName = typeSpec.Name.Name\n\t\tbreak // assuming first value is the good one.\n\t}\n\n\treturn typeName\n}", "title": "" }, { "docid": "45005a37c7e12c98292c884490113801", "score": "0.5389469", "text": "func GetTypeName(obj interface{}) string {\n\tobject := reflect.ValueOf(obj)\n\treturn object.String()\n}", "title": "" }, { "docid": "7595c08513fd1b6635a2a4234c0e3c35", "score": "0.5375527", "text": "func typeName(typ ast.Expr) string {\n\tif p, ok := typ.(*ast.StarExpr); ok {\n\t\ttyp = p.X\n\t}\n\tid, ok := typ.(*ast.Ident)\n\tif ok {\n\t\treturn id.Name\n\t}\n\tsel, ok := typ.(*ast.SelectorExpr)\n\tif ok {\n\t\treturn typeName(sel.X) + \".\" + sel.Sel.Name\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "7595c08513fd1b6635a2a4234c0e3c35", "score": "0.5375527", "text": "func typeName(typ ast.Expr) string {\n\tif p, ok := typ.(*ast.StarExpr); ok {\n\t\ttyp = p.X\n\t}\n\tid, ok := typ.(*ast.Ident)\n\tif ok {\n\t\treturn id.Name\n\t}\n\tsel, ok := typ.(*ast.SelectorExpr)\n\tif ok {\n\t\treturn typeName(sel.X) + \".\" + sel.Sel.Name\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "e1ca46b741ab7b1ded35423e504b042e", "score": "0.53708845", "text": "func GetTypeName(source interface{}) (reflect.Type, string) {\n\trawType := reflect.TypeOf(source)\n\n\t// source is a pointer, convert to its value\n\tif rawType.Kind() == reflect.Ptr {\n\t\trawType = rawType.Elem()\n\t}\n\n\tname := rawType.String()\n\t// we need to extract only the name without the package\n\t// name currently follows the format `package.StructName`\n\tparts := strings.Split(name, \".\")\n\treturn rawType, parts[1]\n}", "title": "" }, { "docid": "fec330da589a7ee6f2bfb165d4856702", "score": "0.5360961", "text": "func _var_name(vm *Vm, i int32) (string, bool) {\n\tcellvars := vm.frame.Code.Cellvars\n\tif int(i) < len(cellvars) {\n\t\treturn cellvars[i], false\n\t}\n\treturn vm.frame.Code.Freevars[int(i)-len(cellvars)], true\n}", "title": "" }, { "docid": "b806647500c4103cd5e68a063092b1e4", "score": "0.5359801", "text": "func typeof(a interface{}) reflect.Type {\n\treturn reflect.TypeOf(a).Elem()\n}", "title": "" }, { "docid": "72c8f2b7c491b2df2f86028019aeff59", "score": "0.5358647", "text": "func TypeOfField(i interface{}, name string) reflect.Type {\n\tr := reflect.ValueOf(i).Elem()\n\treturn r.FieldByName(name).Type()\n}", "title": "" }, { "docid": "2b0d2aee726d46c2a9bf22b66c44a71e", "score": "0.5345997", "text": "func GetType(a interface{}) int {\n\tswitch a.(type) {\n\tcase int:\n\t\treturn 1\n\tcase float64:\n\t\treturn 2\n\tcase string:\n\t\treturn 3\n\tcase bool:\n\t\treturn 4\n\tdefault:\n\t\t// It could be an object or array\n\t\tfmt.Println(\"Don't know what this is\")\n\t\treturn 0\n\t}\n}", "title": "" }, { "docid": "3c71b794c9f1c74bd41cb449c42275e9", "score": "0.53436136", "text": "func (ds *Driver) getTypeByFullName(fqtn, version string) (*Value, error) {\n\tpkgName, typeName := SplitLastDot(fqtn)\n\treturn ds.db.GetTypeByName(pkgName, typeName, version)\n}", "title": "" }, { "docid": "e8830b3f94d55691dc91be02f592f9f2", "score": "0.5341427", "text": "func (m *Machine) StaticEvalTypeOf(last BlockNode, x Expr) Type {\n\tif debug {\n\t\tm.Printf(\"Machine.StaticEvalTypeOf(%v, %v)\\n\", last, x)\n\t}\n\t// X must have been preprocessed.\n\tif x.GetAttribute(ATTR_PREPROCESSED) == nil {\n\t\tpanic(fmt.Sprintf(\n\t\t\t\"Machine.StaticEvalTypeOf(x) expression not yet preprocessed: %s\",\n\t\t\tx.String()))\n\t}\n\t// Temporarily push last to m.Blocks.\n\tm.PushBlock(last.GetStaticBlock().GetBlock())\n\t// Evaluate x.\n\tstart := m.NumValues\n\tm.PushOp(OpHalt)\n\tm.PushOp(OpPopBlock)\n\tm.PushExpr(x)\n\tm.PushOp(OpTypeOf)\n\tm.Run()\n\tres := m.ReapValues(start)\n\tif len(res) != 1 {\n\t\tpanic(\"should not happen\")\n\t}\n\ttv := res[0].V.(TypeValue)\n\treturn tv.Type\n}", "title": "" }, { "docid": "4e4b5a4d01ce048d59cc87ed6168f08a", "score": "0.5341416", "text": "func TypeLookup(typ types.Type) *types.TypeName {\n\tif typ == nil {\n\t\treturn nil\n\t}\n\tfor {\n\t\tswitch t := typ.(type) {\n\t\tcase *types.Named:\n\t\t\treturn t.Obj()\n\t\tcase *types.Map:\n\t\t\treturn nil\n\t\tcase dereferencable:\n\t\t\ttyp = t.Elem()\n\t\tdefault:\n\t\t\treturn nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f624a9c53568a9a9e0670a0b8766f8d8", "score": "0.5337908", "text": "func (o *EnvironmentVariable) GetType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Type\n}", "title": "" }, { "docid": "545166ed82c4a1b3fab907db77bab814", "score": "0.53250104", "text": "func (v *stringVar) Type() JSONType {\n\treturn StringType\n}", "title": "" }, { "docid": "d549423a849d2d9ff93736382cae368c", "score": "0.5316833", "text": "func (s *Scope) GetTypeName(t types.Type) string {\n\treturn \"void\"\n}", "title": "" }, { "docid": "0bc9e9b72889d1e622a56b3630d4cda3", "score": "0.5299891", "text": "func TypeGoString(t macho.Type,) string", "title": "" }, { "docid": "1754297f96138d1c432ab168a1b5c5fa", "score": "0.529793", "text": "func (query *ValidatedQuery) TypeOf(operationName string) OperationType {\n\top := query.doc.FindOperation(operationName)\n\tif op == nil {\n\t\treturn 0\n\t}\n\treturn operationTypeFromAST(op.Type)\n}", "title": "" }, { "docid": "1d690888319d961a5574eb554f143a28", "score": "0.5293555", "text": "func TypeAsIdentifierPart(i interface{}) string {\n\tvar buf bytes.Buffer\n\n\tfullTypeName := reflect.TypeOf(i).String()\n\tlastDot := strings.LastIndex(fullTypeName, \".\")\n\ttypeName := fullTypeName[lastDot+1:]\n\n\tfor i, r := range typeName {\n\t\tif unicode.IsUpper(r) {\n\t\t\tif i > 0 {\n\t\t\t\tbuf.WriteRune('-')\n\t\t\t}\n\t\t}\n\n\t\tbuf.WriteRune(r)\n\t}\n\n\treturn strings.ToLower(buf.String())\n}", "title": "" }, { "docid": "dbb0fefe503f1909beeaa2e965bb2dfd", "score": "0.5292447", "text": "func (t *SymbolTable) FindTypeByIdentifier(identifier string) TypeSymbol {\n\tif compilationType, ok := t.GlobalScope.Types[identifier]; ok {\n\t\treturn compilationType\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7b361ef091216b27f22a660cd8b76458", "score": "0.52840096", "text": "func GetName(data interface{}) (name string) {\n\n\ttyp, err := GetType(data)\n\tif err == nil {\n\t\tname = typ.Name()\n\t}\n\treturn\n}", "title": "" }, { "docid": "135a87baae43a73e8f98cda2ee104889", "score": "0.5274504", "text": "func (s *state) variable(name *Node, t ssa.Type) *ssa.Value {\n\tv := s.vars[name]\n\tif v == nil {\n\t\t// TODO: get type? Take Sym as arg?\n\t\tv = s.newValue0A(ssa.OpFwdRef, t, name)\n\t\ts.vars[name] = v\n\t}\n\treturn v\n}", "title": "" }, { "docid": "a6e73bf343ed8fe3792bfbaa82f8fe34", "score": "0.5269391", "text": "func buildVar(detectedName string) (*types.Var, error) {\n\t// Note:\n\t// $(Ingress.name.metadata.annotations['ingress.auth-secretkubernetes.io/auth-secret'])\n\t// will be split in s in a strange way, but the fieldpath is rebuilt\n\t// properly a few line further.\n\ts := strings.Split(detectedName, Dot)\n\n\tif len(s) < 3 {\n\t\treturn nil, fmt.Errorf(\"var %s does not match expected \"+\n\t\t\t\"pattern $(Kind.name.path)\", detectedName)\n\t}\n\n\tkind := s[0]\n\tname := s[1]\n\tfieldPath := strings.Join(s[2:], Dot)\n\n\tif _, ok := KindRegistry[kind]; !ok {\n\t\t// We don't have a entry for that kind.\n\t\treturn nil, fmt.Errorf(\"var $(%s) referencing an unknown \"+\n\t\t\t\"or conflicting Kind %s\", detectedName, kind)\n\t}\n\n\tgroup := KindRegistry[kind].Group\n\tversion := KindRegistry[kind].Version\n\tobjref := types.Target{\n\t\tGvk: resid.Gvk{\n\t\t\tGroup: group,\n\t\t\tVersion: version,\n\t\t\tKind: kind,\n\t\t},\n\t\tAPIVersion: group + Slash + version,\n\t\tName: name,\n\t}\n\tfieldref := types.FieldSelector{\n\t\tFieldPath: fieldPath,\n\t}\n\ttVar := &types.Var{\n\t\tName: detectedName,\n\t\tObjRef: objref,\n\t\tFieldRef: fieldref,\n\t}\n\n\treturn tVar, nil\n}", "title": "" }, { "docid": "ff340e6375a1c0aaa4a5a12167ded132", "score": "0.5269324", "text": "func GetTypeName(structure interface{}) string {\n\treturn reflect.TypeOf(structure).Name()\n}", "title": "" }, { "docid": "5bd188488bd369c9703a8009945efc35", "score": "0.52632993", "text": "func Type(v Value) string {\n\tswitch {\n\tcase v == Null:\n\t\treturn \"null\"\n\tcase v.IsBool():\n\t\treturn \"bool\"\n\tcase v.IsFloat() || v.IsInt():\n\t\treturn \"number\"\n\tcase v.IsFunction():\n\t\treturn \"function\"\n\tcase v.IsString():\n\t\treturn \"string\"\n\t}\n\tif t, haveTyper := unref(v).(typer); haveTyper {\n\t\treturn t.Type()\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "971f9ea45d5463179ff5636929e518d2", "score": "0.52594924", "text": "func typeOfScript(pops []parsedOpcode) ScriptClass {\n\tswitch {\n\tcase isPayToPubkey(pops):\n\t\treturn PubKeyTy\n\tcase isPayToPubkeyECDSA(pops):\n\t\treturn PubKeyECDSATy\n\tcase isScriptHash(pops):\n\t\treturn ScriptHashTy\n\t}\n\treturn NonStandardTy\n}", "title": "" }, { "docid": "9863a69d1e5a631bf2d520db7e336e83", "score": "0.52292305", "text": "func (sf *ServiceFile) DefinesVariable(name string) string {\n\tfor _, ui := range sf.UserInputs {\n\t\tif ui.Name == name && ui.Type != \"\" {\n\t\t\treturn ui.Type\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "9863a69d1e5a631bf2d520db7e336e83", "score": "0.52292305", "text": "func (sf *ServiceFile) DefinesVariable(name string) string {\n\tfor _, ui := range sf.UserInputs {\n\t\tif ui.Name == name && ui.Type != \"\" {\n\t\t\treturn ui.Type\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "e75c7d204da771bdd62c38bf4261bdff", "score": "0.5223125", "text": "func GetType(methodName string) reflect.Type {\n\treturn types[methodName]\n}", "title": "" }, { "docid": "772bccf714062fe4af9cf29c0337daf8", "score": "0.5216525", "text": "func (s *BaseVerilogParserListener) EnterVariable_type(ctx *Variable_typeContext) {}", "title": "" }, { "docid": "a6507bdcea902811788b0d0aed9188d3", "score": "0.5211637", "text": "func TypeOf[T any]() string {\n\tvar inst T\n\tvar prefix string\n\n\t// get a reflect.Type of a variable with type T\n\tt := reflect.TypeOf(inst)\n\n\t// pointer types do not carry the adequate type information, so we need to extract the\n\t// underlying types until we reach the non-pointer type, we prepend a * each depth\n\tfor t != nil && t.Kind() == reflect.Pointer {\n\t\tprefix += \"*\"\n\t\tt = t.Elem()\n\t}\n\n\t// this should not be possible, but in the event that it does, we want to be loud about it\n\tif t == nil {\n\t\tpanic(fmt.Sprintf(\"Unable to generate a key for type: %+v\", reflect.TypeOf(inst)))\n\t}\n\n\t// combine the prefix, package path, and the type name\n\treturn fmt.Sprintf(\"%s%s/%s\", prefix, t.PkgPath(), t.Name())\n}", "title": "" }, { "docid": "1d38607073213145b2da230d8fba6744", "score": "0.52075243", "text": "func (p *Program) FindType(fullname string) Type {\n\treturn p.typeCache.nameCache[fullname]\n}", "title": "" }, { "docid": "750ea97759f6125acdb2d0cdb01f65d7", "score": "0.5198834", "text": "func (UUIDScriptObject) TypeName() string {\n\treturn typeName\n}", "title": "" }, { "docid": "d0a991b9d2bf95e02270c67b6d5d64f1", "score": "0.51885504", "text": "func (this *RegistryStore) GetVarName(id VarId) string {\n\treturn this.idToName[id]\n}", "title": "" }, { "docid": "5be36d9ada0666444071eb1b9441ed8d", "score": "0.5177889", "text": "func (ts *Types) TypeByName(name string) (t reflect.Type, ok bool) {\n\tts.lk.RLock()\n\tt, ok = ts.tm[name]\n\tts.lk.RUnlock()\n\treturn\n}", "title": "" }, { "docid": "67a7a35273aa3c0a0515da5cc53f4053", "score": "0.51767397", "text": "func GetType(id uint16) (Type, error) {\n\tt, ok := types[id]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown type %v\", id)\n\t}\n\n\tval := reflect.New(t)\n\tm := val.Interface().(Type)\n\treturn m, nil\n}", "title": "" }, { "docid": "58e616e3b5f9ca89416705a44861973c", "score": "0.5172462", "text": "func (t *Const) TypeName() string { return t.Name }", "title": "" }, { "docid": "a336cbe75c4af5db0704c0ce468175c5", "score": "0.5171041", "text": "func (a *Api) getType(w http.ResponseWriter, r *http.Request) (scrap.Type, bool) {\n\tt := scrap.ToType(chi.URLParam(r, typeVar))\n\tif t == scrap.UnknownType {\n\t\thttputils.ReportError(w, errUnknownType, \"Unknown type.\", http.StatusBadRequest)\n\t\treturn scrap.UnknownType, false\n\t}\n\treturn t, true\n}", "title": "" }, { "docid": "e2b79585f0bef290e0fb9e916ac7873b", "score": "0.516857", "text": "func Type(v string) *Attribute { return &Attribute{Name: \"type\", Val: v} }", "title": "" }, { "docid": "7551341e7661ae5540b49888f75ca725", "score": "0.516559", "text": "func (l *LikeExpr) typeof(env *ExpressionEnv) (sqltypes.Type, typeFlag) {\n\t_, f1 := l.Left.typeof(env)\n\t_, f2 := l.Right.typeof(env)\n\treturn sqltypes.Int64, f1 | f2\n}", "title": "" }, { "docid": "05d7de0d157e4e2070afe1648f4ed4a2", "score": "0.51639515", "text": "func (v *Value) Type() Type { return v.ty }", "title": "" }, { "docid": "0b48a115562ad71e83688c3d019a53f5", "score": "0.51621455", "text": "func TypeFromString(s string) Type {\n\tfor t, n := range typeNameMap {\n\t\tif strings.ToUpper(s) == n {\n\t\t\treturn t\n\t\t}\n\t}\n\treturn INVALID\n}", "title": "" }, { "docid": "cb4924279e62c9c692344c749f413cbc", "score": "0.51524365", "text": "func (p *parser) identifierName(v *expr.Variable) string {\n\tswitch v.VarName.(type) {\n\tcase *node.Identifier:\n\t\tn := v.VarName.(*node.Identifier).Value\n\t\treturn p.translator.Translate(n)\n\n\tdefault:\n\t\tpanic(`Variable name is not defined as a simple string.`)\n\t}\n}", "title": "" }, { "docid": "f1541a4206a827ff337185c6ea392460", "score": "0.51498747", "text": "func (sy *TraceSyn) VarByName(varNm string) float32 {\n\tswitch varNm {\n\tcase \"NTr\":\n\t\treturn sy.NTr\n\tcase \"Tr\":\n\t\treturn sy.Tr\n\t}\n\treturn mat32.NaN()\n}", "title": "" }, { "docid": "24ea214f0aa1e7b088669f709e4a1eec", "score": "0.5141701", "text": "func (ts *Types) NameByType(t reflect.Type) (name string, ok bool) {\n\tts.lk.RLock()\n\tname, ok = ts.tn[t]\n\tts.lk.RUnlock()\n\treturn\n}", "title": "" } ]
3a2dd9fd0a9a4187ff65d8966328ceac
Merge merges two lists of services and returns a new copy
[ { "docid": "75be38b015006eb524104b0b2bd05243", "score": "0.77304024", "text": "func Merge(olist []*registry.Service, nlist []*registry.Service) []*registry.Service {\n\tvar srv []*registry.Service\n\n\tfor _, n := range nlist {\n\t\tvar seen bool\n\t\tfor _, o := range olist {\n\t\t\tif o.Version == n.Version {\n\t\t\t\tsp := new(registry.Service)\n\t\t\t\t// make copy\n\t\t\t\t*sp = *o\n\t\t\t\t// set nodes\n\t\t\t\tsp.Nodes = addNodes(o.Nodes, n.Nodes)\n\n\t\t\t\t// mark as seen\n\t\t\t\tseen = true\n\t\t\t\tsrv = append(srv, sp)\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tsp := new(registry.Service)\n\t\t\t\t// make copy\n\t\t\t\t*sp = *o\n\t\t\t\tsrv = append(srv, sp)\n\t\t\t}\n\t\t}\n\t\tif !seen {\n\t\t\tsrv = append(srv, Copy([]*registry.Service{n})...)\n\t\t}\n\t}\n\treturn srv\n}", "title": "" } ]
[ { "docid": "7541c36abf281cf08f42cb01daf1e408", "score": "0.79140705", "text": "func unionMerge(a []*api.CatalogService, b []*api.CatalogService) []*api.CatalogService {\n\tres := make(CatalogServiceList, 0, len(a)+len(b))\n\tfor _, x := range a {\n\t\tres = append(res, x)\n\t}\n\tfor _, x := range b {\n\t\tif !res.Contains(x) {\n\t\t\tres = append(res, x)\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "fe26b2635b6852d3bb00fb974c520ccd", "score": "0.708704", "text": "func (state *ServicesState) Merge(otherState *ServicesState) {\n\tfor _, server := range otherState.Servers {\n\t\tfor _, svc := range server.Services {\n\t\t\tstate.UpdateService(*svc)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6895507c304571e4b25407959f48b6f5", "score": "0.63055605", "text": "func (i *Infrastructure) MergeService(name string, s Service) {\n\ti.Lock.Lock()\n\tif _, ok := i.Services[name]; ok {\n\t\ti.Services[name].Addresses = append(i.Services[name].Addresses, s.Addresses...)\n\t\ti.Lock.Unlock()\n\t\treturn\n\t}\n\ti.Services[name] = &s\n\ti.Lock.Unlock()\n}", "title": "" }, { "docid": "b9c0423d4ffd0634677f8c72779c49b9", "score": "0.61050797", "text": "func Merge(epss ...[]*Endpoint) (eps []*Endpoint) {\n\teps = make([]*Endpoint, 0, 100)\n\tfor _, es := range epss {\n\t\teps = append(eps, es...)\n\t}\n\treturn eps\n}", "title": "" }, { "docid": "b9c0423d4ffd0634677f8c72779c49b9", "score": "0.61050797", "text": "func Merge(epss ...[]*Endpoint) (eps []*Endpoint) {\n\teps = make([]*Endpoint, 0, 100)\n\tfor _, es := range epss {\n\t\teps = append(eps, es...)\n\t}\n\treturn eps\n}", "title": "" }, { "docid": "b519d7e4b47a856cbc587aa3df903e8f", "score": "0.6081547", "text": "func Combine(service ...core.AdmissionService) core.AdmissionService {\n\treturn &combined{services: service}\n}", "title": "" }, { "docid": "02dc9fd67910f9b91c49da538bb48148", "score": "0.6023468", "text": "func (rep *Services) Append(one Service) {\n\tif !rep.Has(one) {\n\t\tone.Id = uuid.NewV4()\n\t\trep.List = append(rep.List, one)\n\t}\n}", "title": "" }, { "docid": "e57e666a6091035fda05cab18b1d7371", "score": "0.6010648", "text": "func Merge(first, second []net.IP) []net.IP {\n\tresult := make([]net.IP, len(first))\n\tcopy(result, first)\n\tfor _, fromSecond := range second {\n\t\tif !ContainsIP(result, fromSecond) {\n\t\t\tresult = append(result, fromSecond)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "733163278cc237e61e79cadb464340bb", "score": "0.60099244", "text": "func (opts ListServicesOptions) Extend(other ListServicesOptions) ListServicesOptions {\n\tvar out ListServicesOptions\n\tout = append(out, opts...)\n\tout = append(out, other...)\n\treturn out\n}", "title": "" }, { "docid": "21b54c40c7f61cb62f9b2c1ae4465e75", "score": "0.6009022", "text": "func mergeSlice(a []interface{}, b []interface{}) []interface{} {\n\ta = append(a, b...)\n\treturn a\n}", "title": "" }, { "docid": "5624610b79e02ef370464312c7b4dd93", "score": "0.59795535", "text": "func merge(s1, s2 types.Splice) types.Splice {\n\treturn s1\n}", "title": "" }, { "docid": "2fec7ee8b2ceb8cccfcb5d9481cd0cd6", "score": "0.59269196", "text": "func (d *DockerCompose) Merge(objs ...*DockerCompose) *DockerCompose {\n\tresult := NewDockerCompose()\n\tfor _, obj := range append(objs, d) {\n\t\tresult.Services = result.Services.Merge(obj.Services)\n\t\tfor key, val := range obj.Volumes {\n\t\t\tresult.Volumes[key] = val\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "4bcf8885f09f50d9edd4485fb8afa04b", "score": "0.58847433", "text": "func mergeCredentials(a []config.CredentialConfig, b []config.CredentialConfig) []config.CredentialConfig {\n\tvar found bool\n\tfor i, addition := range b {\n\t\tfound = false\n\t\tfor j, base := range a {\n\t\t\tif base.Name == addition.Name {\n\t\t\t\tfound = true\n\t\t\t\ta[j] = b[i]\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\ta = append(a, addition)\n\t\t}\n\t}\n\n\treturn a\n}", "title": "" }, { "docid": "6b5692e466e63627a6c6d31e5f310145", "score": "0.58274555", "text": "func mergeBrokerLists(dst, src []*kafkametrics.Broker) []*kafkametrics.Broker {\n\t// Build a map of Broker.ID to []*kafkametrics.Broker index for the\n\t// dst list.\n\tm := map[string]int{}\n\tfor i, b := range dst {\n\t\tm[b.Host] = i\n\t}\n\n\t// For each broker in the src list, add/update in the dst list.\n\tfor _, b := range src {\n\t\tif i, exists := m[b.Host]; exists {\n\t\t\t// Update.\n\t\t\tupdateBroker(dst[i], b)\n\t\t} else {\n\t\t\t// Add.\n\t\t\tdst = append(dst, b)\n\t\t\tm[b.Host] = len(dst) - 1\n\t\t}\n\t}\n\n\treturn dst\n}", "title": "" }, { "docid": "5ffed7e4d260c06d6140273c3981f245", "score": "0.58119833", "text": "func (a pgids) merge(b pgids) pgids {\n\t// Return the opposite slice if one is nil.\n\tif len(a) == 0 {\n\t\treturn b\n\t}\n\tif len(b) == 0 {\n\t\treturn a\n\t}\n\tmerged := make(pgids, len(a)+len(b))\n\tmergepgids(merged, a, b)\n\treturn merged\n}", "title": "" }, { "docid": "c15ed4b5b495b172b989a051d09a1aa5", "score": "0.58034426", "text": "func (array Array) Append(ss ...Service) Array {\n\treturn append(array, Array(ss)...)\n}", "title": "" }, { "docid": "95e6404e92a9b7f351f87085fcbc6fb1", "score": "0.57765615", "text": "func (c *Config) UpdateServices(t tool.Tool) {\n\tidx := c.SearchServiceIndex(t.Name)\n\tif t.Values != nil && idx == -1 {\n\t\tc.Services = append(c.Services, t)\n\t} else if t.Values != nil && idx != -1 {\n\t\tc.Services[idx].Values = append(c.Services[idx].Values, t.Values...)\n\t}\n\t\n}", "title": "" }, { "docid": "1d3e193b89e78e0d885c6d16fb6be7b4", "score": "0.57701176", "text": "func merge(appliabels ...[]appliable) []appliable {\n\tall := []appliable{}\n\n\tfor _, appl := range appliabels {\n\t\tall = append(all, appl...)\n\t}\n\n\treturn all\n}", "title": "" }, { "docid": "3ccce7cf0f36c8c92d75781d3dbee5fa", "score": "0.5755719", "text": "func mergeSliceIface(a []interface{}, b []interface{}) []interface{} {\n\ta = append(a, b...)\n\treturn a\n}", "title": "" }, { "docid": "728706eb837a70548da16dec8f60cc48", "score": "0.5743561", "text": "func (m1 *ServiceLatency) merge(m2 *ServiceLatency) {\n\trtt := time.Duration(0)\n\tif m2.Responder != nil {\n\t\trtt = m2.Responder.RTT\n\t}\n\tm1.SystemLatency = m1.ServiceLatency - (m2.ServiceLatency + rtt)\n\tm1.ServiceLatency = m2.ServiceLatency\n\tm1.Responder = m2.Responder\n\tsanitizeLatencyMetric(m1)\n}", "title": "" }, { "docid": "ff86d3d2d0adaaaee75d59c836f52578", "score": "0.573883", "text": "func MergeServicesV1(existingServices *ServiceConfigs, environmentLookup EnvironmentLookup, resourceLookup ResourceLookup, file string, bytes []byte) (map[string]*ServiceConfigV1, error) {\n\tdatas := make(RawServiceMap)\n\tif err := yaml.Unmarshal(bytes, &datas); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := Interpolate(environmentLookup, &datas); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := validate(datas, \"v1\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor name, data := range datas {\n\t\tdata, err := parseV1(resourceLookup, environmentLookup, file, data, datas)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"Failed to parse service %s: %v\", name, err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif serviceConfig, ok := existingServices.Get(name); ok {\n\t\t\tvar rawExistingService RawService\n\t\t\tif err := utils.Convert(serviceConfig, &rawExistingService); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tdata = mergeConfig(rawExistingService, data)\n\t\t}\n\n\t\tdatas[name] = data\n\t}\n\n\tfor name, data := range datas {\n\t\terr := validateServiceConstraints(data, name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tserviceConfigs := make(map[string]*ServiceConfigV1)\n\tif err := utils.Convert(datas, &serviceConfigs); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn serviceConfigs, nil\n}", "title": "" }, { "docid": "78520266548fb8ccb52a4622390fee0c", "score": "0.5732144", "text": "func mergeTags(a []model.Tag, b []model.Tag) []model.Tag {\n\tresult := make([]model.Tag, len(a))\n\tcopy(result, a)\nouter:\n\tfor _, tag := range b {\n\t\tfor _, t := range a {\n\t\t\tif *t.Scope == *tag.Scope {\n\t\t\t\tcontinue outer\n\t\t\t}\n\t\t}\n\t\tresult = append(result, tag)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "3f6446e76816d95bf4f5325abf1dc165", "score": "0.57082033", "text": "func (this *StringList) merge(other *StringList) {\n\tif this.Empty() || other.Empty() {\n\t\tthis.InsertBackList(other)\n\t\treturn\n\t}\n\n\tp, po := this.Front(), other.Front()\n\tfor p != nil && po != nil {\n\t\tif gStringListGbl.cmp.F(po.string, p.string) {\n\t\t\tn := other.RemoveFront()\n\t\t\tpo = other.Front()\n\t\t\tthis.InsertBefore(n, p)\n\t\t} else {\n\t\t\tif p = p.next; p == this.Front() {\n\t\t\t\tp = nil\n\t\t\t}\n\t\t}\n\t}\n\tif po != nil {\n\t\tthis.InsertBackList(other)\n\t}\n}", "title": "" }, { "docid": "bfe0daf09f1769e109112eb28d238ffc", "score": "0.5656735", "text": "func reconcileServices(tx *sql.Tx, fromTime time.Time) error {\n\tservices, err := getUpdatedServies(fromTime, tx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor i, svc := range services {\n\t\tfmt.Printf(\"%d. - %v\\n\", i, svc)\n\t\terr = stopService(svc, tx)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t\terr = startService(svc)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tcontinue\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6023f03e0eb30b1696c6eecee46974af", "score": "0.56406355", "text": "func merge(s1, s2 []string) []string {\n\tdedupe := map[string]struct{}{}\n\tmerged := []string{}\n\n\tfor _, elem := range append(s1, s2...) {\n\t\tif _, seen := dedupe[elem]; !seen {\n\t\t\tmerged = append(merged, elem)\n\t\t}\n\n\t\tdedupe[elem] = struct{}{}\n\t}\n\n\treturn merged\n}", "title": "" }, { "docid": "5884d9eed1df74b99db9ece36c09db31", "score": "0.56256586", "text": "func mergeConfigs(a, b *Config) *Config {\n\t// merge variables\n\tfor k, v := range b.Variables {\n\t\ta.Variables[k] = v\n\t}\n\n\t// merge templates\n\tfor _, v := range b.Templates {\n\t\tfound := false\n\t\tfor j, v2 := range a.Templates {\n\t\t\tif v.Name == v2.Name {\n\t\t\t\ta.Templates[j] = v2\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\ta.Templates = append(a.Templates, v)\n\t\t}\n\t}\n\n\treturn a\n}", "title": "" }, { "docid": "28465ab3b0caf5ea0610fa04d317c679", "score": "0.56211394", "text": "func mergeRules(originalRules, latestRules []*Rule) []*Rule {\n\tfor _, latest := range latestRules {\n\t\tfoundRoute := false\n\t\tfor _, original := range originalRules {\n\t\t\tif reflect.DeepEqual(latest.Route, original.Route) {\n\t\t\t\tfoundRoute = true\n\t\t\t\toriginal.AllowedServiceAccounts = original.AllowedServiceAccounts.Union(latest.AllowedServiceAccounts)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !foundRoute {\n\t\t\toriginalRules = append(originalRules, latest)\n\t\t}\n\t}\n\treturn originalRules\n}", "title": "" }, { "docid": "6b2a5e50e492ef527dfb9a9488e50b2b", "score": "0.56117135", "text": "func (s *stateSkel) mergeServiceAccount(updated, current *unstructured.Unstructured) error {\n\tcurSecrets, ok, err := unstructured.NestedSlice(current.Object, \"secrets\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif ok {\n\t\tif err := unstructured.SetNestedField(updated.Object, curSecrets, \"secrets\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tcurImagePullSecrets, ok, err := unstructured.NestedSlice(current.Object, \"imagePullSecrets\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif ok {\n\t\tif err := unstructured.SetNestedField(updated.Object, curImagePullSecrets, \"imagePullSecrets\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f2e93bc97bdb53cf714f3cd6b15f4bb1", "score": "0.55983305", "text": "func (fic *FakeInventoryClient) Merge(_ InventoryInfo, objs object.ObjMetadataSet, _ common.DryRunStrategy) (object.ObjMetadataSet, error) {\n\tif fic.Err != nil {\n\t\treturn object.ObjMetadataSet{}, fic.Err\n\t}\n\tdiffObjs := fic.Objs.Diff(objs)\n\tfic.Objs = fic.Objs.Union(objs)\n\treturn diffObjs, nil\n}", "title": "" }, { "docid": "94d19b35458fc09bf1ac4c0eeb8b9573", "score": "0.55957425", "text": "func (r Registry) Merge(in Registry) error {\n\tfor name, factory := range in {\n\t\tif err := r.Register(name, factory); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c0aa27983f87051485cf473ac7085681", "score": "0.55956036", "text": "func merge(styles []Style) *Style {\n\tvar base Style\n\n\tfor _, style := range styles {\n\t\tif err := mergo.Merge(&base, style, mergo.WithOverride); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\treturn &base\n}", "title": "" }, { "docid": "8d559347b40aaeb20faa2a5a9c83a649", "score": "0.5579832", "text": "func Merge(subs ...Subscription) Subscription {\n\t// STOPMERGESIG OMIT\n\tm := &merge{\n\t\tsubs: subs,\n\t\tupdates: make(chan Item),\n\t\tquit: make(chan struct{}),\n\t\terrs: make(chan error),\n\t}\n\t// STARTMERGE OMIT\n\tfor _, sub := range subs {\n\t\tgo func(s Subscription) {\n\t\t\tfor {\n\t\t\t\tvar it Item\n\t\t\t\tselect {\n\t\t\t\tcase it = <-s.Updates():\n\t\t\t\tcase <-m.quit: // HL\n\t\t\t\t\tm.errs <- s.Close() // HL\n\t\t\t\t\treturn // HL\n\t\t\t\t}\n\t\t\t\tselect {\n\t\t\t\tcase m.updates <- it:\n\t\t\t\tcase <-m.quit: // HL\n\t\t\t\t\tm.errs <- s.Close() // HL\n\t\t\t\t\treturn // HL\n\t\t\t\t}\n\t\t\t}\n\t\t}(sub)\n\t}\n\t// STOPMERGE OMIT\n\treturn m\n}", "title": "" }, { "docid": "13176b6c5c6faa96a8692025d5d8ad38", "score": "0.55788994", "text": "func mergeCRDs(s1, s2 []*apiextensionsv1.CustomResourceDefinition) []*apiextensionsv1.CustomResourceDefinition {\n\tm := make(map[string]*apiextensionsv1.CustomResourceDefinition)\n\tfor _, obj := range s1 {\n\t\tm[obj.GetName()] = obj\n\t}\n\tfor _, obj := range s2 {\n\t\tm[obj.GetName()] = obj\n\t}\n\tmerged := make([]*apiextensionsv1.CustomResourceDefinition, len(m))\n\ti := 0\n\tfor _, obj := range m {\n\t\tmerged[i] = obj.DeepCopy()\n\t\ti++\n\t}\n\treturn merged\n}", "title": "" }, { "docid": "87671d8262753276c967f5cd706ca7a4", "score": "0.55500335", "text": "func (g *DefaultGenerator) mergeAddresses(addrs []string, clientAddrs []string) (out []string) {\n\tunique := make(map[string]bool, len(addrs)+len(clientAddrs))\n\tfor _, a := range addrs {\n\t\tunique[a] = true\n\t}\n\tfor _, a := range clientAddrs {\n\t\tunique[a] = true\n\t}\n\tfor key := range unique {\n\t\tout = append(out, key)\n\t}\n\treturn out\n}", "title": "" }, { "docid": "44b3fe117838c6705c21435fd67a4072", "score": "0.5533177", "text": "func mergeRes(s1 []*hismodel.Resource, s2 []*hismodel.Resource) []*hismodel.Resource {\n\tslice := make([]*hismodel.Resource, len(s1)+len(s2))\n\tcopy(slice, s1)\n\tcopy(slice[len(s1):], s2)\n\treturn slice\n}", "title": "" }, { "docid": "ed3693e9442afab5bcf970d9286c86de", "score": "0.5529786", "text": "func (meshData *MeshData) Merge(inData *MeshData) {\n\tfor _, site := range inData.Sites {\n\t\tmeshData.AddSite(site)\n\t}\n\n\tfor _, serviceType := range inData.ServiceTypes {\n\t\tmeshData.AddServiceType(serviceType)\n\t}\n}", "title": "" }, { "docid": "0a3a0dd6b14ef71d71810cc3d290aebb", "score": "0.551085", "text": "func mergeCRDs(s1, s2 []*apiextensionsv1beta1.CustomResourceDefinition) []*apiextensionsv1beta1.CustomResourceDefinition {\n\tm := make(map[string]*apiextensionsv1beta1.CustomResourceDefinition)\n\tfor _, crd := range s1 {\n\t\tm[crd.Name] = crd\n\t}\n\tfor _, crd := range s2 {\n\t\tm[crd.Name] = crd\n\t}\n\tmerged := make([]*apiextensionsv1beta1.CustomResourceDefinition, len(m))\n\ti := 0\n\tfor _, crd := range m {\n\t\tmerged[i] = crd\n\t\ti++\n\t}\n\treturn merged\n}", "title": "" }, { "docid": "feabffa05f355975443141a6c3bcd9dc", "score": "0.55022603", "text": "func merge(left, right []job.Job) []job.Job {\n\tsize, i, j := len(left)+len(right), 0, 0\n\tslice := make([]job.Job, size, size)\n\tfor k := 0; k < size; k++ {\n\t\tif i > len(left)-1 && j <= len(right)-1 {\n\t\t\tslice[k] = right[j]\n\t\t\tj++\n\t\t} else if j > len(right)-1 && i <= len(left)-1 {\n\t\t\tslice[k] = left[i]\n\t\t\ti++\n\t\t} else if len(left[i].GetExecs()) > len(right[j].GetExecs()) {\n\t\t\tslice[k] = left[i]\n\t\t\ti++\n\t\t} else {\n\t\t\tslice[k] = right[j]\n\t\t\tj++\n\t\t}\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "8700742583f6a035d7903e7d49629345", "score": "0.549163", "text": "func (m Deployments) Merge(other Deployments) Deployments {\n\treturn NewDeploymentsFromMap(m.Snapshot(), other.Snapshot())\n}", "title": "" }, { "docid": "3e57122a1f045efe5b06d468e00cc2a4", "score": "0.54864687", "text": "func (agent *Agent) mergeStats(statsSlice []*client.Stats) (map[string]*internal.FeedData, error) {\n\tif len(statsSlice) == 0 {\n\t\treturn nil, fmt.Errorf(\"error merging data: no data to merge, empty response\")\n\t}\n\n\tswitch agent.services.Method {\n\tcase globalMethod:\n\t\treturn getGlobalConnectionsData(statsSlice), nil\n\tcase upstreamGroupsMethod:\n\t\treturn getUpstreamConnectionsData(statsSlice, agent.services.SamplingType, agent.namedServices, int(agent.services.Threshold)), nil\n\tcase statusZonesMethod:\n\t\treturn getStatusZonesConnectionsData(statsSlice, agent.namedServices), nil\n\t}\n\n\treturn nil, fmt.Errorf(\"error processing the data from NGINX Plus instance(s): %v is not a valid NGINX Plus type\", agent.services.Method)\n}", "title": "" }, { "docid": "4f636254a0f08a0c2481a041594b837b", "score": "0.54778445", "text": "func (p *probeManager) AddAndUpdateServices(in []*v1.Service) error {\n\tfor _, i := range in {\n\t\texist := false\n\t\tfor index, svc := range p.services {\n\t\t\tif svc.Name == i.Name {\n\t\t\t\t(p.services)[index] = i\n\t\t\t\texist = true\n\t\t\t}\n\t\t}\n\t\tif !exist {\n\t\t\tp.services = append(p.services, i)\n\t\t}\n\t}\n\tp.services = append(p.services, in...)\n\tp.updateAllServicesProbe()\n\treturn nil\n}", "title": "" }, { "docid": "1ba81566ae7707c88361c2b6a9b1ef6b", "score": "0.5471935", "text": "func (ps1 metadata) append(ps2 metadata) metadata {\n\tn1 := len(ps1)\n\tn2 := len(ps2)\n\tn := n1 + n2\n\tmerged := make(metadata, n)\n\tcopy(merged[:n1], ps1)\n\tcopy(merged[n1:], ps2)\n\n\tfor i := 0; i < n; i++ {\n\t\tmerged[i].item = i\n\t}\n\n\treturn merged\n}", "title": "" }, { "docid": "343ae51ca21a945a44217b6bd387bf06", "score": "0.5447453", "text": "func (l *list) merge(a *list) {\n\tl.Lock()\n\tfor k, v := range a.entry {\n\t\tl.entry[k] = v\n\t}\n\tl.Unlock()\n}", "title": "" }, { "docid": "cad28da47a608648a881d8a792e8634a", "score": "0.54417026", "text": "func (clusters Clusters) merge() Individuals {\n\tvar indis Individuals\n\tfor _, s := range clusters {\n\t\tindis = append(indis, s...)\n\t}\n\treturn indis\n}", "title": "" }, { "docid": "11d535e21bb15a7db0a9289d50816bc0", "score": "0.54289806", "text": "func (s *List) Merge(l *List) *List {\n\ts.lock.Lock()\n\tdefer s.lock.Unlock()\n\ts.data = append(s.data, l.data...)\n\treturn s\n}", "title": "" }, { "docid": "6cb97f8f6d039c2f4df5111c0c5e3d4f", "score": "0.54241854", "text": "func (opts GetServiceOptions) Extend(other GetServiceOptions) GetServiceOptions {\n\tvar out GetServiceOptions\n\tout = append(out, opts...)\n\tout = append(out, other...)\n\treturn out\n}", "title": "" }, { "docid": "d6251a3e9706be81756545618192d1cc", "score": "0.5394347", "text": "func mergeDates(res []campwiz.Result) []campwiz.Result {\n\tklog.V(1).Infof(\"Merging %d results ...\", len(res))\n\tm := make(map[string]campwiz.Result)\n\tfor _, r := range res {\n\t\tkey := r.ResURL + r.ResID // Merge campwiz.Availability metadata.\n\t\tif val, exists := m[key]; exists {\n\t\t\tklog.V(1).Infof(\"%s: Appending Availability: %+v (previous: %+v)\", key, r.Availability, val.Availability)\n\t\t\tval.Availability = append(val.Availability, r.Availability...)\n\t\t\t// map items are immutable.\n\t\t\tm[key] = val\n\t\t\tklog.V(1).Infof(\"%s campwiz.Availability now: %+v\", key, m[key].Availability)\n\t\t} else {\n\t\t\tklog.V(1).Infof(\"%s: Not yet seen: %+v\", key, r)\n\t\t\tm[key] = r\n\t\t}\n\t}\n\n\tvar merged []campwiz.Result\n\tfor k, v := range m {\n\t\tklog.V(1).Infof(\"%s: %+v\", k, v)\n\t\tmerged = append(merged, v)\n\t}\n\treturn merged\n}", "title": "" }, { "docid": "b59858533d922ee0437a793b9e4562c5", "score": "0.53934205", "text": "func merge(l, r CompanyList, comp compareFunc) CompanyList {\n\t// Temporary (and garbaged collected) CL slice to store\n\t// the newly merged entries.\n\tmerged := make(CompanyList, 0, len(l)+len(r))\n\n\t// Loop until one of the two lists are empty\n\tfor len(l) > 0 || len(r) > 0 {\n\t\tswitch {\n\t\t// Left is empty, add right to the end and return\n\t\tcase len(l) == 0:\n\t\t\treturn append(merged, r...)\n\n\t\t// Right is empty, add left to the end and return\n\t\tcase len(r) == 0:\n\t\t\treturn append(merged, l...)\n\n\t\t// Compare the two, this is basically\n\t\t// l[0] < r[0] based on whatever comp is comparing.\n\t\t// Append the first element of l and remove it from l.\n\t\tcase comp(l[0], r[0]):\n\t\t\tmerged = append(merged, l[0])\n\t\t\tl = l[1:]\n\n\t\t// Basically l[0] >= r[0]\n\t\t// Append the first element of r and remove it from r.\n\t\tdefault:\n\t\t\tmerged = append(merged, r[0])\n\t\t\tr = r[1:]\n\t\t}\n\t}\n\n\t// return the newly merged list!\n\treturn merged\n}", "title": "" }, { "docid": "1eabf9d7c74edf56d5c35d298a83d9eb", "score": "0.5380288", "text": "func (r DNSRecords) Merge(other DNSRecords) DNSRecords {\n\tif len(other) > len(r) {\n\t\tr, other = other, r\n\t}\n\tcp := r.Copy()\n\tfor k, v := range other {\n\t\tif v2, ok := cp[k]; ok {\n\t\t\tfMerged, fUnchanged := v.Forward.Merge(v2.Forward)\n\t\t\trMerged, rUnchanged := v.Reverse.Merge(v2.Reverse)\n\t\t\tif fUnchanged && rUnchanged {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcp[k] = DNSRecord{Forward: fMerged, Reverse: rMerged}\n\t\t} else {\n\t\t\tcp[k] = v\n\t\t}\n\t}\n\treturn cp\n}", "title": "" }, { "docid": "c07ecafea2f19e9cd544416e5612d643", "score": "0.5351298", "text": "func MergeLists(cwFrom *CustomerWatchLists, listIdFrom string, cwInto *CustomerWatchLists, listIdInto string) error {\n\t// Find lists\n\tvar listFrom *WatchList\n\tfor _, list := range cwFrom.Lists {\n\t\tif list.Id == listIdFrom {\n\t\t\tlistFrom = list\n\t\t}\n\t}\n\tif listFrom == nil {\n\t\treturn errors.New(\"Could not find list with id\" + listIdFrom)\n\t}\n\n\t// Merge\n\tfor _, item := range listFrom.Items {\n\t\terr := cwInto.ListAddItem(listIdInto, item.Id, item.Quantity)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn cwInto.Upsert()\n}", "title": "" }, { "docid": "ea3c6357aea561e6668bdf43d7f71f50", "score": "0.53452104", "text": "func (o ServicePublicationsList) Append(objects ...elemental.Identifiable) elemental.Identifiables {\n\n\tout := append(ServicePublicationsList{}, o...)\n\tfor _, obj := range objects {\n\t\tout = append(out, obj.(*ServicePublication))\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "b92055993f8e7918ab3b55a9aef31673", "score": "0.53408366", "text": "func (p1 PortNameMap) Union(p2 PortNameMap) PortNameMap {\n\tresult := make(PortNameMap)\n\tfor svcPort, targetPort := range p1 {\n\t\tresult[svcPort] = targetPort\n\t}\n\n\tfor svcPort, targetPort := range p2 {\n\t\tresult[svcPort] = targetPort\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "fa8b6e9610ebce849bf99a9f1f182c42", "score": "0.53405756", "text": "func (p uint64Slice) merge(other []uint64) []uint64 {\n\tret := make([]uint64, 0, len(p))\n\n\ti, j := 0, 0\n\tfor i < len(p) && j < len(other) {\n\t\ta, b := p[i], other[j]\n\t\tif a == b {\n\t\t\tret = append(ret, a)\n\t\t\ti, j = i+1, j+1\n\t\t} else if a < b {\n\t\t\tret = append(ret, a)\n\t\t\ti++\n\t\t} else {\n\t\t\tret = append(ret, b)\n\t\t\tj++\n\t\t}\n\t}\n\n\tif i < len(p) {\n\t\tret = append(ret, p[i:]...)\n\t} else if j < len(other) {\n\t\tret = append(ret, other[j:]...)\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "af7d3ba54f9dae789e70a344f1ab2236", "score": "0.5333783", "text": "func Merge(x, y interface{}) interface{} {\n\txx := reflect.ValueOf(x)\n\tif xx.Kind() != reflect.Slice {\n\t\tpanic(\"xslice: x expected to be a slice\")\n\t}\n\n\tyy := reflect.ValueOf(y)\n\tif yy.Kind() != reflect.Slice {\n\t\tpanic(\"xslice: y expected to be a slice\")\n\t}\n\n\th := make(map[interface{}]bool)\n\tfor i := 0; i < xx.Len(); i++ {\n\t\th[hashValue(xx.Index(i).Interface())] = true\n\t}\n\n\tr := xx.Slice(0, xx.Len())\n\tfor i := 0; i < yy.Len(); i++ {\n\t\tif _, ok := h[hashValue(yy.Index(i).Interface())]; !ok {\n\t\t\tr = reflect.Append(r, yy.Index(i))\n\t\t}\n\t}\n\n\treturn r.Interface()\n}", "title": "" }, { "docid": "e6f91b0b0971e0caecbed85e13f65d15", "score": "0.53328556", "text": "func (r *Registry) Merge(in Registry) {\n\t*r = append(*r, in...)\n}", "title": "" }, { "docid": "9ace93341836928c4c22626a9a26b393", "score": "0.5325679", "text": "func Merge(outlets ...streams.Flow) streams.Flow {\n\tmerged := NewPassThrough()\n\tvar wg sync.WaitGroup\n\twg.Add(len(outlets))\n\n\tfor _, out := range outlets {\n\t\tgo func(outlet streams.Outlet) {\n\t\t\tfor elem := range outlet.Out() {\n\t\t\t\tmerged.In() <- elem\n\t\t\t}\n\t\t\twg.Done()\n\t\t}(out)\n\t}\n\n\t// close merged.In() on the last outlet close.\n\tgo func(wg *sync.WaitGroup) {\n\t\twg.Wait()\n\t\tclose(merged.In())\n\t}(&wg)\n\n\treturn merged\n}", "title": "" }, { "docid": "a025ae29f24c548c0509636c96ab61af", "score": "0.53197175", "text": "func (rf Refs) Merge(b Refs) Refs {\n\tfor key, value := range b {\n\t\t_, ok := rf[key]\n\t\tif ok {\n\t\t\trf[key] = append(rf[key], value...)\n\t\t} else {\n\t\t\trf[key] = value\n\t\t}\n\t}\n\treturn rf\n}", "title": "" }, { "docid": "0c2fdcb5cc956aab4b563f9fe5d71164", "score": "0.53090185", "text": "func (d Deps) Merge(other Deps) {\n\tfor typ := range other {\n\t\tif _, ok := d[typ]; !ok {\n\t\t\td[typ] = reflect.Value{}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0627ccfdfdad23c97433b57182a06ed7", "score": "0.53073823", "text": "func GetMerged(input []string) (map[string]string, error) {\n\tresult := make(map[string]string)\n\n\t// construct the url\n\tgetURL, err := getQryString(\"http://www.sudoc.fr/services/merged\", input)\n\tif err != nil {\n\t\treturn result, err\n\t}\n\n\t// call Sudoc & put the response into a []byte\n\tb, err := callSudoc(getURL)\n\n\t// unmarshall the xml response into a struct\n\tvar parsedResp MergedData\n\tif xml.Unmarshal(b, &parsedResp); err != nil {\n\t\treturn result, err\n\t}\n\n\tif parsedResp.Err != \"\" {\n\t\tErrNoResult := errors.New(\"No result\")\n\t\treturn result, ErrNoResult\n\t}\n\n\tfor _, v := range parsedResp.Pairs {\n\t\tresult[v.Queried] = v.Merged\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "cf1adbde189200de72a169216d31da6d", "score": "0.5293352", "text": "func serviceList(w http.ResponseWriter, r *http.Request, t auth.Token) error {\n\tctx := r.Context()\n\tcontexts := permission.ContextsForPermission(t, permission.PermServiceRead)\n\tservices, err := provisionReadableServices(ctx, t, contexts)\n\tif err != nil {\n\t\treturn err\n\t}\n\tsInstances, err := service.GetServiceInstancesByServices(services)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresults := make([]service.ServiceModel, len(services))\n\tfor i, s := range services {\n\t\tresults[i].Service = s.Name\n\t\tfor _, si := range sInstances {\n\t\t\tif si.ServiceName == s.Name {\n\t\t\t\tresults[i].Instances = append(results[i].Instances, si.Name)\n\t\t\t\tresults[i].ServiceInstances = append(results[i].ServiceInstances, si)\n\t\t\t}\n\t\t}\n\t}\n\tif len(results) == 0 {\n\t\tw.WriteHeader(http.StatusNoContent)\n\t\treturn nil\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\treturn json.NewEncoder(w).Encode(results)\n}", "title": "" }, { "docid": "a8fdb630aa808bddebea50ee265ce7fb", "score": "0.52900016", "text": "func mergeConfigurations(confs ...Configuration) (Configuration, error) {\n\tvar merged Configuration\n\n\tfor _, conf := range confs {\n\t\tif err := mergo.Merge(&merged, conf); err != nil {\n\t\t\treturn merged, err\n\t\t}\n\t}\n\n\treturn merged, nil\n}", "title": "" }, { "docid": "005567f6fd792a6b77b01e81266c254e", "score": "0.5283522", "text": "func combine(v1, v2 any, fn func(_, _ any) any) (r []any) {\n\ts1 := reflect.ValueOf(v1)\n\ts2 := reflect.ValueOf(v2)\n\tfor i := 0; i < s1.Len(); i++ {\n\t\tfor j := 0; j < s2.Len(); j++ {\n\t\t\t// Combine using the given function.\n\t\t\tr = append(r, fn(s1.Index(i).Interface(), s2.Index(j).Interface()))\n\t\t}\n\t}\n\treturn r\n}", "title": "" }, { "docid": "62523b2cef1bcdffd00d2da37704ae54", "score": "0.52786076", "text": "func mergeApps(appPrimary data.App, appSecondary data.App) data.App {\n\tapp := appPrimary\n\n\tif app.Region == \"\" && appSecondary.Region != \"\" {\n\t\tapp.Region = appSecondary.Region\n\t}\n\n\tif app.SerialCode == \"\" && appSecondary.SerialCode != \"\" {\n\t\tapp.SerialCode = appSecondary.SerialCode\n\t}\n\n\tif app.Title == \"\" && appSecondary.Title != \"\" {\n\t\tapp.Title = appSecondary.Title\n\t}\n\n\tif app.Title != appSecondary.Title {\n\t\t// Add the other title as a variation\n\t\tapp.TitleVariations = append(app.TitleVariations, appSecondary.Title)\n\t}\n\n\tif app.NumberOfDiscs == 0 && appSecondary.NumberOfDiscs != 0 {\n\t\tapp.NumberOfDiscs = appSecondary.NumberOfDiscs\n\t}\n\n\tif app.FeatureSupport.AnalogSupport == data.AnalogSupportUnknown &&\n\t\tappSecondary.FeatureSupport.AnalogSupport != data.AnalogSupportUnknown {\n\t\tapp.FeatureSupport.AnalogSupport = appSecondary.FeatureSupport.AnalogSupport\n\t}\n\n\tif app.FeatureSupport.RumbleSupport == data.RumbleSupportUnknown &&\n\t\tappSecondary.FeatureSupport.RumbleSupport != data.RumbleSupportUnknown {\n\t\tapp.FeatureSupport.RumbleSupport = appSecondary.FeatureSupport.RumbleSupport\n\t}\n\n\tapp.TitleVariations = append(app.TitleVariations, appSecondary.TitleVariations...)\n\tapp.DiscNames = append(app.DiscNames, appSecondary.DiscNames...)\n\n\t// Normalize the app data before returning\n\tapp.Normalize()\n\n\treturn app\n}", "title": "" }, { "docid": "d8a6f4dd2eba04d5feb94726e0fa98b1", "score": "0.5272404", "text": "func (local *ORSet) Merge(remote *ORSet) {\n\n\tfor key, r := range remote.addMap {\n\t\tl, ok := local.addMap[key]\n\t\tif ok {\n\t\t\tfor timestamp, val := range r {\n\t\t\t\tl[timestamp] = val\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\t// write the remote to local\n\t\tlocal.addMap[key] = r\n\t}\n\n\tfor key, r := range remote.removeMap {\n\t\tl, ok := local.removeMap[key]\n\t\tif ok {\n\t\t\tfor timestamp, val := range r {\n\t\t\t\tl[timestamp] = val\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tlocal.removeMap[key] = r\n\t}\n}", "title": "" }, { "docid": "55ddd164226d416b4c6aedf842232971", "score": "0.52696", "text": "func MergeSlice(s1 []byte, s2 []byte) []byte {\n\tslice := make([]byte, len(s1)+len(s2))\n\tcopy(slice, s1)\n\tcopy(slice[len(s1):], s2)\n\treturn slice\n}", "title": "" }, { "docid": "314a02a974891eeca0e732faf087bfd2", "score": "0.5260182", "text": "func (usl *UnionServiceLister) List(selector labels.Selector) (ret []*v1.Service, err error) {\n\tusl.serviceLock.RLock()\n\tdefer usl.serviceLock.RUnlock()\n\n\tset := make(map[types.UID]*v1.Service)\n\tfor _, sl := range usl.serviceListers {\n\t\tservices, err := sl.List(selector)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, service := range services {\n\t\t\tset[service.GetUID()] = service\n\t\t}\n\t}\n\n\tfor _, service := range set {\n\t\tret = append(ret, service)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "fb733d2a6a982884b3b2f9580ab6de60", "score": "0.52584094", "text": "func main() {\n\tnums1 := []int{1, 2, 3, 0, 0, 0}\n\tm := 3\n\tnums2 := []int{2, 5, 6}\n\tn := 3\n\n\tmerge(nums1, m, nums2, n)\n\n\tfmt.Println(nums1)\n\n}", "title": "" }, { "docid": "624cdcc316eb02fba569575670b164ae", "score": "0.52563673", "text": "func merge(first, second map[string]map[string]string, strategy Strategy) (map[string]map[string]string, error) {\n\tfLen, sLen := uint32(len(first)), uint32(len(second))\n\n\t// Quickly resolving edge cases.\n\tif fLen == 0 {\n\t\treturn second, nil\n\t}\n\tif sLen == 0 {\n\t\treturn first, nil\n\t}\n\n\tlongest := fLen\n\tif sLen > fLen {\n\t\tlongest = sLen\n\t}\n\tres := make(map[string]map[string]string, longest)\n\n\t// Copy \"first\" into the new pool.\n\tfor sec, params := range first {\n\t\tres[sec] = make(map[string]string, len(params))\n\t\tfor field, val := range params {\n\t\t\tres[sec][field] = val\n\t\t}\n\t}\n\n\t// Merge \"second\" into the new pool.\n\tfor sec, params := range second {\n\t\tif _, secOK := res[sec]; secOK {\n\t\t\t// Params exists. Mind the merge strategy.\n\t\t\tfor key, val := range params {\n\t\t\t\tif _, fieldOK := res[sec][key]; fieldOK {\n\t\t\t\t\tswitch strategy {\n\t\t\t\t\tcase Report:\n\t\t\t\t\t\treturn res, fmt.Errorf(\"section %q, key %q already exists\", sec, key)\n\t\t\t\t\tcase Keep:\n\t\t\t\t\t\tcontinue\n\t\t\t\t\tcase Overwrite:\n\t\t\t\t\t\tres[sec][key] = val\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tres[sec][key] = val\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Params does not exist, or the Overwrite strategy is being used.\n\t\t\t// So we just copy values one by one.\n\t\t\tres[sec] = make(map[string]string)\n\t\t\tfor field, val := range params {\n\t\t\t\tres[sec][field] = val\n\t\t\t}\n\t\t}\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "624cdcc316eb02fba569575670b164ae", "score": "0.52563673", "text": "func merge(first, second map[string]map[string]string, strategy Strategy) (map[string]map[string]string, error) {\n\tfLen, sLen := uint32(len(first)), uint32(len(second))\n\n\t// Quickly resolving edge cases.\n\tif fLen == 0 {\n\t\treturn second, nil\n\t}\n\tif sLen == 0 {\n\t\treturn first, nil\n\t}\n\n\tlongest := fLen\n\tif sLen > fLen {\n\t\tlongest = sLen\n\t}\n\tres := make(map[string]map[string]string, longest)\n\n\t// Copy \"first\" into the new pool.\n\tfor sec, params := range first {\n\t\tres[sec] = make(map[string]string, len(params))\n\t\tfor field, val := range params {\n\t\t\tres[sec][field] = val\n\t\t}\n\t}\n\n\t// Merge \"second\" into the new pool.\n\tfor sec, params := range second {\n\t\tif _, secOK := res[sec]; secOK {\n\t\t\t// Params exists. Mind the merge strategy.\n\t\t\tfor key, val := range params {\n\t\t\t\tif _, fieldOK := res[sec][key]; fieldOK {\n\t\t\t\t\tswitch strategy {\n\t\t\t\t\tcase Report:\n\t\t\t\t\t\treturn res, fmt.Errorf(\"section %q, key %q already exists\", sec, key)\n\t\t\t\t\tcase Keep:\n\t\t\t\t\t\tcontinue\n\t\t\t\t\tcase Overwrite:\n\t\t\t\t\t\tres[sec][key] = val\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tres[sec][key] = val\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Params does not exist, or the Overwrite strategy is being used.\n\t\t\t// So we just copy values one by one.\n\t\t\tres[sec] = make(map[string]string)\n\t\t\tfor field, val := range params {\n\t\t\t\tres[sec][field] = val\n\t\t\t}\n\t\t}\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "5883f7a97a7f33c6bb5cea38fd24b948", "score": "0.5241656", "text": "func (cuo *CustomerUpdateOne) AddServices(s ...*Service) *CustomerUpdateOne {\n\tids := make([]string, len(s))\n\tfor i := range s {\n\t\tids[i] = s[i].ID\n\t}\n\treturn cuo.AddServiceIDs(ids...)\n}", "title": "" }, { "docid": "c4d2c39bea561265eb95dc1688b08104", "score": "0.5241218", "text": "func (v *Vault) Merge(otherVault *Vault) error {\n\totherLocations, err := otherVault.Locations()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, loc := range otherLocations {\n\t\t_, err := v.Get(loc)\n\t\tif err == nil {\n\t\t\treturn fmt.Errorf(\"merge conflict: %v already exists in vault\", loc)\n\t\t}\n\t\totherCred, err := otherVault.Get(loc)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = v.Add(loc, *otherCred)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ab4e1f1fdd7a963b33af2b734f612b83", "score": "0.52401435", "text": "func merge(x interface{}) interface{} {\n\txval := reflect.ValueOf(x)\n\tm := xval.Len()\n\tif m == 0 {\n\t\treturn nil\n\t}\n\n\tp := xval.Index(0).Len()\n\ty := reflect.MakeSlice(xval.Type().Elem(), 0, m*p)\n\tfor j := 0; j < p; j++ {\n\t\tfor i := 0; i < m; i++ {\n\t\t\txi := xval.Index(i)\n\t\t\tif j >= xi.Len() {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ty = reflect.Append(y, xi.Index(j))\n\t\t}\n\t}\n\treturn y.Interface()\n}", "title": "" }, { "docid": "ab4e1f1fdd7a963b33af2b734f612b83", "score": "0.52401435", "text": "func merge(x interface{}) interface{} {\n\txval := reflect.ValueOf(x)\n\tm := xval.Len()\n\tif m == 0 {\n\t\treturn nil\n\t}\n\n\tp := xval.Index(0).Len()\n\ty := reflect.MakeSlice(xval.Type().Elem(), 0, m*p)\n\tfor j := 0; j < p; j++ {\n\t\tfor i := 0; i < m; i++ {\n\t\t\txi := xval.Index(i)\n\t\t\tif j >= xi.Len() {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ty = reflect.Append(y, xi.Index(j))\n\t\t}\n\t}\n\treturn y.Interface()\n}", "title": "" }, { "docid": "3b360dccece69da9df113ee3176e1b92", "score": "0.52384835", "text": "func (f *FixturesBuilder) AddServices(objs ...*corev1.Service) *FixturesBuilder {\n\tfor _, v := range objs {\n\t\terr := f.servicesIndexer.Add(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tf.kClientSet = append(f.kClientSet, v)\n\t}\n\treturn f\n}", "title": "" }, { "docid": "4d8ce607c0621ea5f3fe70021fa63cc9", "score": "0.52342486", "text": "func (opts CreateServiceOptions) Extend(other CreateServiceOptions) CreateServiceOptions {\n\tvar out CreateServiceOptions\n\tout = append(out, opts...)\n\tout = append(out, other...)\n\treturn out\n}", "title": "" }, { "docid": "4d8ce607c0621ea5f3fe70021fa63cc9", "score": "0.52342486", "text": "func (opts CreateServiceOptions) Extend(other CreateServiceOptions) CreateServiceOptions {\n\tvar out CreateServiceOptions\n\tout = append(out, opts...)\n\tout = append(out, other...)\n\treturn out\n}", "title": "" }, { "docid": "7fb54c04cadfa50c3cfcd7846919ba61", "score": "0.5230383", "text": "func (dst *listOrEpochLoads) mergeFrom(src listOrEpochLoads) {\n\tfor _, srcs := range []struct {\n\t\tm offsetLoadMap\n\t\tloadType listOrEpochLoadType\n\t}{\n\t\t{src.list, loadTypeList},\n\t\t{src.epoch, loadTypeEpoch},\n\t} {\n\t\tfor t, ps := range srcs.m {\n\t\t\tfor p, load := range ps {\n\t\t\t\tdst.addLoad(t, p, srcs.loadType, load)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "42bef54c3d3cc3d997a7bf9ee87853a1", "score": "0.52256507", "text": "func (sc *ServiceController) reconcileServices(services []servicescm.Service) error {\n\texistingSvcs, err := sc.getExistingServices()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"could not determine existing Windows services\")\n\t}\n\tfor _, service := range services {\n\t\tvar winSvcObj winsvc.Service\n\t\tif _, present := existingSvcs[service.Name]; !present {\n\t\t\t// create a service placeholder\n\t\t\twinSvcObj, err = sc.CreateService(service.Name, \"\", mgr.Config{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tklog.Infof(\"created service %s\", service.Name)\n\t\t} else {\n\t\t\t// open the service\n\t\t\twinSvcObj, err = sc.OpenService(service.Name)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tklog.Infof(\"reconciling existing service %s\", service.Name)\n\t\t}\n\t\tif err := sc.reconcileService(winSvcObj, service); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tklog.Infof(\"successfully reconciled service %s\", service.Name)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e485c79b1df4331638214e230ad80c94", "score": "0.522552", "text": "func mergeConfigs(_urls conf.UrlConfig, _nets conf.NetworkConfig) conf.UrlConfig {\n\t// Go over sources\n\tfor u, _url := range _urls {\n\t\t// Go over networks\n\t\tfor _, _net := range _nets {\n\t\t\t// Go over sets\n\t\t\tfor _, set := range _net.Sets {\n\t\t\t\tif _url.Set == set {\n\t\t\t\t\t_url.Networks = append(_url.Networks, _net.Network)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_urls[u] = _url\n\t}\n\treturn _urls\n}", "title": "" }, { "docid": "92644bead47c6d0813d9733af1661412", "score": "0.5207275", "text": "func (apt *AptConfig) Merge(apt2 AptConfig) {\n\n\tif apt2.Packages != nil {\n\t\tif apt.Packages == nil {\n\t\t\tapt.Packages = make(map[string][]string)\n\t\t}\n\n\t\tfor key, pkgs := range apt2.Packages {\n\t\t\tapt.Packages[key] = append(apt.Packages[key], pkgs...)\n\t\t}\n\t}\n\n\tif apt2.Proxies != nil {\n\t\tapt.Proxies = append(apt.Proxies, apt2.Proxies...)\n\t}\n\n\tif apt2.Sources != nil {\n\t\tapt.Sources = append(apt.Sources, apt2.Sources...)\n\t}\n}", "title": "" }, { "docid": "ba3c7df4889b523ea0e4157c7df2b32f", "score": "0.5193209", "text": "func (as *addressSpace) merge(newas *addressSpace) {\n\t// The new epoch after the merge.\n\t// epoch is essentially the count of invocations\n\t// used to ensure if certain addresses refreshed from the source\n\t// are still relevant\n\tas.epoch++\n\n\t// Add new pools and addresses.\n\tfor pk, pv := range newas.Pools {\n\t\tap := as.Pools[pk]\n\n\t\tif ap == nil {\n\t\t\t// This is a new address pool.\n\t\t\t// Merge it to the existing address space.\n\t\t\tas.Pools[pk] = pv\n\t\t\tpv.as = as\n\t\t\tpv.epoch = as.epoch\n\t\t} else {\n\t\t\t// This pool already exists.\n\t\t\t// Compare address records one by one.\n\t\t\tfor ak, av := range pv.Addresses {\n\t\t\t\tar := ap.Addresses[ak]\n\n\t\t\t\tif ar == nil {\n\t\t\t\t\t// This is a new address record.\n\t\t\t\t\t// Merge it to the existing address pool.\n\t\t\t\t\tap.Addresses[ak] = av\n\t\t\t\t\tav.epoch = as.epoch\n\t\t\t\t} else {\n\t\t\t\t\t// This address record already exists.\n\t\t\t\t\tar.epoch = as.epoch\n\t\t\t\t\tar.unhealthy = false\n\t\t\t\t}\n\n\t\t\t\tdelete(pv.Addresses, ak)\n\t\t\t}\n\n\t\t\tpv.as = nil\n\t\t}\n\n\t\tdelete(newas.Pools, pk)\n\t}\n\n\t// Cleanup stale pools and addresses from the old epoch.\n\t// Those currently in use will be deleted after they are released.\n\tfor pk, pv := range as.Pools {\n\t\tif pv.epoch < as.epoch {\n\t\t\t// This pool may have stale addresses.\n\t\t\tfor ak, av := range pv.Addresses {\n\t\t\t\tif av.epoch == as.epoch {\n\t\t\t\t\t// Pool has at least one valid or in-use address.\n\t\t\t\t\tpv.epoch = as.epoch\n\t\t\t\t} else if av.InUse {\n\t\t\t\t\t// Address is no longer valid, but still in use.\n\t\t\t\t\tpv.epoch = as.epoch\n\t\t\t\t\tav.unhealthy = true\n\t\t\t\t} else {\n\t\t\t\t\t// This address is no longer available.\n\t\t\t\t\tdelete(pv.Addresses, ak)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Delete the pool if it has no addresses left.\n\t\t\tif pv.epoch < as.epoch && !pv.isInUse() {\n\t\t\t\tpv.as = nil\n\t\t\t\tdelete(as.Pools, pk)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d04f8cb122d890bbc5590eb6e3362b7b", "score": "0.51918656", "text": "func (list TypeList) Merge(from TypeList) {\n\tif list != nil {\n\t\tfor k, v := range from {\n\t\t\tlist[k] = v\n\t\t}\n\t}\n}", "title": "" }, { "docid": "057613fe5b170130beb0a9855e0ff4fa", "score": "0.5177341", "text": "func mergeResourceLists(resourceLists ...corev1.ResourceList) corev1.ResourceList {\n\tresult := corev1.ResourceList{}\n\tfor _, rl := range resourceLists {\n\t\tfor resource, quantity := range rl {\n\t\t\tresult[resource] = quantity\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "7fd5dd756a87cb29a13c1f8694aebf3c", "score": "0.51751465", "text": "func testMultipleServicesEndpoints(t *testing.T) {\n\tt.Parallel()\n\n\tfor _, tc := range []struct {\n\t\ttitle string\n\t\ttargetNamespace string\n\t\tannotationFilter string\n\t\tsvcNamespace string\n\t\tsvcName string\n\t\tsvcType v1.ServiceType\n\t\tcompatibility string\n\t\tfqdnTemplate string\n\t\tcombineFQDNAndAnnotation bool\n\t\tignoreHostnameAnnotation bool\n\t\tlabels map[string]string\n\t\tclusterIP string\n\t\tservices map[string]map[string]string\n\t\tserviceTypesFilter []string\n\t\texpected []*endpoint.Endpoint\n\t\texpectError bool\n\t}{\n\t\t{\n\t\t\t\"test service returns a correct end point\",\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"testing\",\n\t\t\t\"foo\",\n\t\t\tv1.ServiceTypeLoadBalancer,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tmap[string]string{},\n\t\t\t\"\",\n\t\t\tmap[string]map[string]string{\n\t\t\t\t\"1.2.3.4\": {hostnameAnnotationKey: \"foo.example.org\"},\n\t\t\t},\n\t\t\t[]string{},\n\t\t\t[]*endpoint.Endpoint{\n\t\t\t\t{DNSName: \"foo.example.org\", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{\"1.2.3.4\"}, Labels: map[string]string{endpoint.ResourceLabelKey: \"service/testing/foo1.2.3.4\"}},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\t\"multiple services that share same DNS should be merged into one endpoint\",\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"testing\",\n\t\t\t\"foo\",\n\t\t\tv1.ServiceTypeLoadBalancer,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tmap[string]string{},\n\t\t\t\"\",\n\t\t\tmap[string]map[string]string{\n\t\t\t\t\"1.2.3.4\": {hostnameAnnotationKey: \"foo.example.org\"},\n\t\t\t\t\"1.2.3.5\": {hostnameAnnotationKey: \"foo.example.org\"},\n\t\t\t\t\"1.2.3.6\": {hostnameAnnotationKey: \"foo.example.org\"},\n\t\t\t},\n\t\t\t[]string{},\n\t\t\t[]*endpoint.Endpoint{\n\t\t\t\t{DNSName: \"foo.example.org\", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{\"1.2.3.4\", \"1.2.3.5\", \"1.2.3.6\"}, Labels: map[string]string{endpoint.ResourceLabelKey: \"service/testing/foo1.2.3.4\"}},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\t\"test that services with different hostnames do not get merged together\",\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"testing\",\n\t\t\t\"foo\",\n\t\t\tv1.ServiceTypeLoadBalancer,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tmap[string]string{},\n\t\t\t\"\",\n\t\t\tmap[string]map[string]string{\n\t\t\t\t\"1.2.3.5\": {hostnameAnnotationKey: \"foo.example.org\"},\n\t\t\t\t\"10.1.1.3\": {hostnameAnnotationKey: \"bar.example.org\"},\n\t\t\t\t\"10.1.1.1\": {hostnameAnnotationKey: \"bar.example.org\"},\n\t\t\t\t\"1.2.3.4\": {hostnameAnnotationKey: \"foo.example.org\"},\n\t\t\t\t\"10.1.1.2\": {hostnameAnnotationKey: \"bar.example.org\"},\n\t\t\t\t\"20.1.1.1\": {hostnameAnnotationKey: \"foobar.example.org\"},\n\t\t\t\t\"1.2.3.6\": {hostnameAnnotationKey: \"foo.example.org\"},\n\t\t\t},\n\t\t\t[]string{},\n\t\t\t[]*endpoint.Endpoint{\n\t\t\t\t{DNSName: \"foo.example.org\", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{\"1.2.3.4\", \"1.2.3.5\", \"1.2.3.6\"}, Labels: map[string]string{endpoint.ResourceLabelKey: \"service/testing/foo1.2.3.4\"}},\n\t\t\t\t{DNSName: \"bar.example.org\", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{\"10.1.1.1\", \"10.1.1.2\", \"10.1.1.3\"}, Labels: map[string]string{endpoint.ResourceLabelKey: \"service/testing/foo10.1.1.1\"}},\n\t\t\t\t{DNSName: \"foobar.example.org\", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{\"20.1.1.1\"}, Labels: map[string]string{endpoint.ResourceLabelKey: \"service/testing/foo20.1.1.1\"}},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\t\"test that services with different set-identifier do not get merged together\",\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"testing\",\n\t\t\t\"foo\",\n\t\t\tv1.ServiceTypeLoadBalancer,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tmap[string]string{},\n\t\t\t\"\",\n\t\t\tmap[string]map[string]string{\n\t\t\t\t\"a.elb.com\": {hostnameAnnotationKey: \"foo.example.org\", SetIdentifierKey: \"a\"},\n\t\t\t\t\"b.elb.com\": {hostnameAnnotationKey: \"foo.example.org\", SetIdentifierKey: \"b\"},\n\t\t\t},\n\t\t\t[]string{},\n\t\t\t[]*endpoint.Endpoint{\n\t\t\t\t{DNSName: \"foo.example.org\", RecordType: endpoint.RecordTypeCNAME, Targets: endpoint.Targets{\"a.elb.com\"}, Labels: map[string]string{endpoint.ResourceLabelKey: \"service/testing/fooa.elb.com\"}, SetIdentifier: \"a\"},\n\t\t\t\t{DNSName: \"foo.example.org\", RecordType: endpoint.RecordTypeCNAME, Targets: endpoint.Targets{\"b.elb.com\"}, Labels: map[string]string{endpoint.ResourceLabelKey: \"service/testing/foob.elb.com\"}, SetIdentifier: \"b\"},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t} {\n\t\ttc := tc\n\t\tt.Run(tc.title, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\t// Create a Kubernetes testing client\n\t\t\tkubernetes := fake.NewSimpleClientset()\n\n\t\t\t// Create services to test against\n\t\t\tfor lb, annotations := range tc.services {\n\t\t\t\tingresses := []v1.LoadBalancerIngress{}\n\t\t\t\tingresses = append(ingresses, v1.LoadBalancerIngress{IP: lb})\n\n\t\t\t\tservice := &v1.Service{\n\t\t\t\t\tSpec: v1.ServiceSpec{\n\t\t\t\t\t\tType: tc.svcType,\n\t\t\t\t\t\tClusterIP: tc.clusterIP,\n\t\t\t\t\t},\n\t\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\t\tNamespace: tc.svcNamespace,\n\t\t\t\t\t\tName: tc.svcName + lb,\n\t\t\t\t\t\tLabels: tc.labels,\n\t\t\t\t\t\tAnnotations: annotations,\n\t\t\t\t\t},\n\t\t\t\t\tStatus: v1.ServiceStatus{\n\t\t\t\t\t\tLoadBalancer: v1.LoadBalancerStatus{\n\t\t\t\t\t\t\tIngress: ingresses,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}\n\n\t\t\t\t_, err := kubernetes.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{})\n\t\t\t\trequire.NoError(t, err)\n\t\t\t}\n\n\t\t\t// Create our object under test and get the endpoints.\n\t\t\tclient, err := NewServiceSource(\n\t\t\t\tcontext.TODO(),\n\t\t\t\tkubernetes,\n\t\t\t\ttc.targetNamespace,\n\t\t\t\ttc.annotationFilter,\n\t\t\t\ttc.fqdnTemplate,\n\t\t\t\ttc.combineFQDNAndAnnotation,\n\t\t\t\ttc.compatibility,\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t\ttc.serviceTypesFilter,\n\t\t\t\ttc.ignoreHostnameAnnotation,\n\t\t\t\tlabels.Everything(),\n\t\t\t\tfalse,\n\t\t\t)\n\t\t\trequire.NoError(t, err)\n\n\t\t\tres, err := client.Endpoints(context.Background())\n\t\t\tif tc.expectError {\n\t\t\t\trequire.Error(t, err)\n\t\t\t} else {\n\t\t\t\trequire.NoError(t, err)\n\t\t\t}\n\n\t\t\t// Validate returned endpoints against desired endpoints.\n\t\t\tvalidateEndpoints(t, res, tc.expected)\n\t\t\t// Test that endpoint resourceLabelKey matches desired endpoint\n\t\t\tsort.SliceStable(res, func(i, j int) bool {\n\t\t\t\treturn strings.Compare(res[i].DNSName, res[j].DNSName) < 0\n\t\t\t})\n\t\t\tsort.SliceStable(tc.expected, func(i, j int) bool {\n\t\t\t\treturn strings.Compare(tc.expected[i].DNSName, tc.expected[j].DNSName) < 0\n\t\t\t})\n\n\t\t\tfor i := range res {\n\t\t\t\tif res[i].Labels[endpoint.ResourceLabelKey] != tc.expected[i].Labels[endpoint.ResourceLabelKey] {\n\t\t\t\t\tt.Errorf(\"expected %s, got %s\", tc.expected[i].Labels[endpoint.ResourceLabelKey], res[i].Labels[endpoint.ResourceLabelKey])\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "f75152d5b7a9a139df94db29770b9095", "score": "0.517036", "text": "func MergeDependencies(ch chan SourceDependenciesItem) chan DependencyItem {\n\tout := make(chan DependencyItem, cli.ChannelBufferSize)\n\tgo func() {\n\t\tdefer close(out)\n\n\t\tfor item := range ch {\n\t\t\tfor _, dep := range item.Dependencies {\n\t\t\t\tout <- DependencyItem(dep)\n\t\t\t}\n\t\t}\n\t}()\n\treturn out\n}", "title": "" }, { "docid": "bb0dff237326ce656f41109da8bc4bba", "score": "0.51595247", "text": "func (msgs *MsgList) Merge(newMsgs MsgList) {\n\tres, rest := msgs.filter(func(msg *Msg) bool {\n\t\treturn msg.msgType == Terminal\n\t})\n\tfor _, x := range rest {\n\t\tif x.state == Activ && newMsgs.Contains(*x) {\n\t\t\tres = append(res, x)\n\t\t\tnewMsgs, _ = newMsgs.filter(func(msg *Msg) bool {\n\t\t\t\treturn !msg.equals(*x)\n\t\t\t})\n\t\t}\n\t}\n\t*msgs = append(res, newMsgs...)\n}", "title": "" }, { "docid": "fa21ab7eb48dbfbd3dee437e84557e37", "score": "0.5155967", "text": "func Merge(s1, s2 []string, withoutThis string) []string {\n\tunique := make(map[string]struct{})\n\tfor _, v := range s1 {\n\t\tif len(v) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif v == withoutThis {\n\t\t\tcontinue\n\t\t}\n\t\tunique[v] = struct{}{}\n\t}\n\tfor _, v := range s2 {\n\t\tif len(v) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif v == withoutThis {\n\t\t\tcontinue\n\t\t}\n\t\tunique[v] = struct{}{}\n\t}\n\tfinal := make([]string, len(unique))\n\ti := 0\n\tfor k := range unique {\n\t\tfinal[i] = k\n\t\ti++\n\t}\n\tsort.Slice(final, func(one, two int) bool { return final[one] < final[two] })\n\treturn final\n}", "title": "" }, { "docid": "25f740db7bb13711391ef7cf2671d284", "score": "0.51523834", "text": "func (c *Manifests) addServices(rawManifests ...[]byte) error {\n\tfor _, rawManifest := range rawManifests {\n\t\ts := corev1.Service{}\n\t\tif err := yaml.Unmarshal(rawManifest, &s); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Services = append(c.Services, s)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7a03acec6932c2b1a92b8319eabecce3", "score": "0.5148592", "text": "func (o ObservableFoo) MergeWith(other ...ObservableFoo) ObservableFoo {\n\tif len(other) == 0 {\n\t\treturn o\n\t}\n\tobservable := func(observe FooObserver, subscribeOn Scheduler, subscriber Subscriber) {\n\t\tvar observers struct {\n\t\t\tsync.Mutex\n\t\t\tdone bool\n\t\t\tlen int\n\t\t}\n\t\tobserver := func(next foo, err error, done bool) {\n\t\t\tobservers.Lock()\n\t\t\tdefer observers.Unlock()\n\t\t\tif !observers.done {\n\t\t\t\tswitch {\n\t\t\t\tcase !done:\n\t\t\t\t\tobserve(next, nil, false)\n\t\t\t\tcase err != nil:\n\t\t\t\t\tobservers.done = true\n\t\t\t\t\tvar zero foo\n\t\t\t\t\tobserve(zero, err, true)\n\t\t\t\tdefault:\n\t\t\t\t\tif observers.len--; observers.len == 0 {\n\t\t\t\t\t\tvar zero foo\n\t\t\t\t\t\tobserve(zero, nil, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsubscribeOn.Schedule(func() {\n\t\t\tif subscriber.Subscribed() {\n\t\t\t\tobservers.len = 1 + len(other)\n\t\t\t\to(observer, subscribeOn, subscriber)\n\t\t\t\tfor _, o := range other {\n\t\t\t\t\tif !subscriber.Subscribed() {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\to(observer, subscribeOn, subscriber)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\treturn observable\n}", "title": "" }, { "docid": "6e67b7bfa103f383d6b82352e4828932", "score": "0.514235", "text": "func merge(ms []chan headerMetadata) chan headerMetadata {\n\tout := make(chan headerMetadata)\n\tvar wg sync.WaitGroup\n\n\toutput := func(c chan headerMetadata) {\n\t\tfor n := range c {\n\t\t\tout <- n\n\t\t}\n\t\twg.Done()\n\t}\n\n\twg.Add(len(ms))\n\n\tfor _, c := range ms {\n\t\tgo output(c)\n\t}\n\n\tgo func() {\n\t\twg.Wait()\n\t\tclose(out)\n\t}()\n\n\treturn out\n}", "title": "" }, { "docid": "7236e857b494c19835067568a1a4b67c", "score": "0.51422894", "text": "func (k *Kademlia) Merge(l []Contact, r []Contact, target ID) []Contact {\n\tret := make([]Contact, 0, len(l)+len(r))\n\tfor len(l) > 0 || len(r) > 0 {\n\t\tif len(l) == 0 {\n\t\t\treturn append(ret, r...)\n\t\t}\n\t\tif len(r) == 0 {\n\t\t\treturn append(ret, l...)\n\t\t}\n\t\tif (159 - l[0].NodeID.Xor(target).PrefixLen()) <= (159 - r[0].NodeID.Xor(target).PrefixLen()) {\n\t\t\tret = append(ret, l[0])\n\t\t\tl = l[1:]\n\t\t} else {\n\t\t\tret = append(ret, r[0])\n\t\t\tr = r[1:]\n\t\t}\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "39100b79a534c8da86aba5c5511a9145", "score": "0.5136738", "text": "func (l *Limits) Merge(o Limits) Limits {\n\tm := *l\n\n\tif o.HTTPSHandshakeTimeout != \"\" {\n\t\tm.HTTPSHandshakeTimeout = o.HTTPSHandshakeTimeout\n\t}\n\tif o.HTTPMaxConnsPerClient != nil {\n\t\tm.HTTPMaxConnsPerClient = pointer.Of(*o.HTTPMaxConnsPerClient)\n\t}\n\tif o.RPCHandshakeTimeout != \"\" {\n\t\tm.RPCHandshakeTimeout = o.RPCHandshakeTimeout\n\t}\n\tif o.RPCMaxConnsPerClient != nil {\n\t\tm.RPCMaxConnsPerClient = pointer.Of(*o.RPCMaxConnsPerClient)\n\t}\n\n\treturn m\n}", "title": "" }, { "docid": "584a0e21a3de07729bd6b6dfe40240b0", "score": "0.51307726", "text": "func (f *Firewall) mergeWith(other Firewall) {\n\tf.VPNInputPorts = gosettings.MergeWithSlice(f.VPNInputPorts, other.VPNInputPorts)\n\tf.InputPorts = gosettings.MergeWithSlice(f.InputPorts, other.InputPorts)\n\tf.OutboundSubnets = gosettings.MergeWithSlice(f.OutboundSubnets, other.OutboundSubnets)\n\tf.Enabled = gosettings.MergeWithPointer(f.Enabled, other.Enabled)\n\tf.Debug = gosettings.MergeWithPointer(f.Debug, other.Debug)\n}", "title": "" }, { "docid": "b8af56e34d5e0efdf4e163c5d3b37c8c", "score": "0.5123523", "text": "func mergeImportMaps(import1, import2 Imports) Imports {\n\tfor imp := range import1 {\n\t\t_, present := import2[imp]\n\t\tif present {\n\t\t\t// since import is already there, we have to look at each call's array\n\t\t\tfor call := range import1[imp] {\n\t\t\t\t_, present := import2[imp][call]\n\t\t\t\tif present {\n\t\t\t\t\t// appending each call to call array\n\t\t\t\t\tfor _, e := range import1[imp][call] {\n\t\t\t\t\t\timport2[imp][call] = append(import2[imp][call], e)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// call not there yet, use whole call array\n\t\t\t\t\timport2[imp][call] = import1[imp][call]\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// import not there yet, use whole import map\n\t\t\timport2[imp] = import1[imp]\n\t\t}\n\t}\n\n\treturn import2\n}", "title": "" }, { "docid": "ad7bd335bce9e393765b873f5111dfd4", "score": "0.5106964", "text": "func (vals *ValidatorSet) applyUpdates(updates []*Validator) {\n\texisting := vals.Validators\n\tsort.Sort(ValidatorsByProTxHashes(existing))\n\n\tmerged := make([]*Validator, len(existing)+len(updates))\n\ti := 0\n\n\tfor len(existing) > 0 && len(updates) > 0 {\n\t\tif bytes.Compare(existing[0].ProTxHash, updates[0].ProTxHash) < 0 { // unchanged validator\n\t\t\tmerged[i] = existing[0]\n\t\t\texisting = existing[1:]\n\t\t} else {\n\t\t\t// Apply add or update.\n\t\t\tmerged[i] = updates[0]\n\t\t\tif bytes.Equal(existing[0].ProTxHash, updates[0].ProTxHash) {\n\t\t\t\t// Validator is present in both, advance existing.\n\t\t\t\texisting = existing[1:]\n\t\t\t}\n\t\t\tupdates = updates[1:]\n\t\t}\n\t\ti++\n\t}\n\n\t// Add the elements which are left.\n\tfor j := 0; j < len(existing); j++ {\n\t\tmerged[i] = existing[j]\n\t\ti++\n\t}\n\t// OR add updates which are left.\n\tfor j := 0; j < len(updates); j++ {\n\t\tmerged[i] = updates[j]\n\t\ti++\n\t}\n\n\tvals.Validators = merged[:i]\n}", "title": "" }, { "docid": "04215f74da5d5a40d5ee8cfd9e6c1dda", "score": "0.50993836", "text": "func (o SparseServicePublicationsList) Append(objects ...elemental.Identifiable) elemental.Identifiables {\n\n\tout := append(SparseServicePublicationsList{}, o...)\n\tfor _, obj := range objects {\n\t\tout = append(out, obj.(*SparseServicePublication))\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "8c037d09b30f6521a6eb9f6aa70250b8", "score": "0.50941455", "text": "func processServiceList(serviceList []*corev1.Service, groupID int32, cfg *config.AgentConfig, clusterName string, clusterID string) ([]model.MessageBody, error) {\n\tstart := time.Now()\n\tserviceMsgs := make([]*model.Service, 0, len(serviceList))\n\n\tfor s := 0; s < len(serviceList); s++ {\n\t\tsvc := serviceList[s]\n\t\tif orchestrator.SkipKubernetesResource(svc.UID, svc.ResourceVersion) {\n\t\t\tcontinue\n\t\t}\n\n\t\tserviceModel := extractService(svc)\n\n\t\t// k8s objects only have json \"omitempty\" annotations\n\t\t// + marshalling is more performant than YAML\n\t\tjsonSvc, err := jsoniter.Marshal(svc)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"Could not marshal service to JSON: %s\", err)\n\t\t\tcontinue\n\t\t}\n\t\tserviceModel.Yaml = jsonSvc\n\n\t\tserviceMsgs = append(serviceMsgs, serviceModel)\n\t}\n\n\tgroupSize := len(serviceMsgs) / cfg.MaxPerMessage\n\tif len(serviceMsgs)%cfg.MaxPerMessage > 0 {\n\t\tgroupSize++\n\t}\n\n\tchunks := chunkServices(serviceMsgs, groupSize, cfg.MaxPerMessage)\n\tmessages := make([]model.MessageBody, 0, groupSize)\n\n\tfor i := 0; i < groupSize; i++ {\n\t\tmessages = append(messages, &model.CollectorService{\n\t\t\tClusterName: clusterName,\n\t\t\tClusterId: clusterID,\n\t\t\tGroupId: groupID,\n\t\t\tGroupSize: int32(groupSize),\n\t\t\tServices: chunks[i],\n\t\t})\n\t}\n\n\tlog.Debugf(\"Collected & enriched %d out of %d services in %s\", len(serviceMsgs), len(serviceList), time.Now().Sub(start))\n\treturn messages, nil\n}", "title": "" }, { "docid": "0ace0571c9263c15b5a83e7c9f2ee9db", "score": "0.50845546", "text": "func Merge(dst, src Set) {\n\tSetIterate(src, dst.Set)\n}", "title": "" }, { "docid": "df4740e8e871aa5eed1790b0a8621734", "score": "0.5080041", "text": "func Merge(lists ...List) List {\n\tn := 0\n\tfor _, l := range lists {\n\t\tn += len(l)\n\t}\n\tmerged := make(List, 0, n)\n\tfor _, l := range lists {\n\t\tmerged = append(merged, l...)\n\t}\n\tout := merged.ReplaceDuplicates(Deduplicate)\n\tout.Sort()\n\treturn out\n}", "title": "" }, { "docid": "f772d26f55104dde572b790622f2dfd7", "score": "0.50786656", "text": "func mergeAppCollections(appCollections ...[]data.App) []data.App {\n\tvar mergedApps []data.App\n\n\tappsBySerialCode := make(map[string]data.App)\n\tvar appsWithoutIndex []data.App\n\n\tfor _, appCollection := range appCollections {\n\t\tfor _, app := range appCollection {\n\t\t\tif app.SerialCode != \"\" {\n\t\t\t\tappBySerialCode, ok := appsBySerialCode[app.SerialCode]\n\n\t\t\t\tif ok {\n\t\t\t\t\tapp = mergeApps(appBySerialCode, app)\n\t\t\t\t}\n\n\t\t\t\tappsBySerialCode[app.SerialCode] = app\n\t\t\t} else {\n\t\t\t\tappsWithoutIndex = append(appsWithoutIndex, app)\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, app := range appsBySerialCode {\n\t\tmergedApps = append(mergedApps, app)\n\t}\n\tfor _, app := range appsWithoutIndex {\n\t\tmergedApps = append(mergedApps, app)\n\t}\n\n\treturn mergedApps\n}", "title": "" } ]
fee8cc3e8315d000f15856ff190618cc
ReadBuild asynchronously downloads the files in build from gcs and convert them into a build.
[ { "docid": "c0d0cafebca12f91f5449883dff23d8f", "score": "0.7581981", "text": "func ReadBuild(build Build) (*Column, error) {\n\tvar wg sync.WaitGroup // Each subtask does wg.Add(1), then we wg.Wait() for them to finish\n\tctx, cancel := context.WithTimeout(build.Context, 30*time.Second) // Allows aborting after first error\n\tbuild.Context = ctx\n\tec := make(chan error) // Receives errors from anyone\n\n\t// Download started.json, send to sc\n\twg.Add(1)\n\tsc := make(chan gcs.Started) // Receives started.json result\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tstarted, err := build.Started()\n\t\tif err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\tcase ec <- err:\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase sc <- *started:\n\t\t}\n\t}()\n\n\t// Download finished.json, send to fc\n\twg.Add(1)\n\tfc := make(chan gcs.Finished) // Receives finished.json result\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tfinished, err := build.Finished()\n\t\tif err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\tcase ec <- err:\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase fc <- *finished:\n\t\t}\n\t}()\n\n\t// List artifacts to the artifacts channel\n\twg.Add(1)\n\tartifacts := make(chan string) // Receives names of arifacts\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tdefer close(artifacts) // No more artifacts\n\t\tif err := build.Artifacts(artifacts); err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\tcase ec <- err:\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Download each artifact, send row map to rc\n\t// With parallelism: 60s without: 220s\n\twg.Add(1)\n\tsuitesChan := make(chan gcs.SuitesMeta)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tdefer close(suitesChan) // No more rows\n\t\tif err := build.Suites(artifacts, suitesChan); err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\tcase ec <- err:\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Append each row into the column\n\trows := map[string][]Row{}\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tfor suitesMeta := range suitesChan {\n\t\t\trowsPart := extractRows(suitesMeta.Suites, suitesMeta.Metadata)\n\t\t\tfor name, results := range rowsPart {\n\t\t\t\trows[name] = append(rows[name], results...)\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Wait for everyone to complete their work\n\tgo func() {\n\t\twg.Wait()\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase ec <- nil:\n\t\t}\n\t}()\n\tvar finished *gcs.Finished\n\tvar started *gcs.Started\n\tfor { // Wait until we receive started and finished and/or an error\n\t\tselect {\n\t\tcase err := <-ec:\n\t\t\tif err != nil {\n\t\t\t\tcancel()\n\t\t\t\treturn nil, fmt.Errorf(\"failed to read %s: %v\", build, err)\n\t\t\t}\n\t\t\tbreak\n\t\tcase s := <-sc:\n\t\t\tstarted = &s\n\t\tcase f := <-fc:\n\t\t\tfinished = &f\n\t\t}\n\t\tif started != nil && finished != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\tbr := Column{\n\t\tID: path.Base(build.Prefix),\n\t\tStarted: started.Timestamp,\n\t}\n\t// Has the build finished?\n\tif finished.Running { // No\n\t\tcancel()\n\t\tbr.Rows = map[string][]Row{\n\t\t\t\"Overall\": {br.Overall()},\n\t\t}\n\t\treturn &br, nil\n\t}\n\tif finished.Timestamp != nil {\n\t\tbr.Finished = *finished.Timestamp\n\t}\n\tbr.Metadata = finished.Metadata.Strings()\n\tif finished.Passed != nil {\n\t\tbr.Passed = *finished.Passed\n\t}\n\tor := br.Overall()\n\tbr.Rows = map[string][]Row{\n\t\t\"Overall\": {or},\n\t}\n\tselect {\n\tcase <-ctx.Done():\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"interrupted reading %s\", build)\n\tcase err := <-ec:\n\t\tif err != nil {\n\t\t\tcancel()\n\t\t\treturn nil, fmt.Errorf(\"failed to read %s: %v\", build, err)\n\t\t}\n\t}\n\n\tfor t, rs := range rows {\n\t\tbr.Rows[t] = append(br.Rows[t], rs...)\n\t}\n\tif or.Result == state.Row_FAIL { // Ensure failing build has a failing row\n\t\tft := false\n\t\tfor n, rs := range br.Rows {\n\t\t\tif n == \"Overall\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, r := range rs {\n\t\t\t\tif r.Result == state.Row_FAIL {\n\t\t\t\t\tft = true // Failing test, huzzah!\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ft {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !ft { // Nope, add the F icon and an explanatory message\n\t\t\tbr.Rows[\"Overall\"][0].Icon = \"F\"\n\t\t\tbr.Rows[\"Overall\"][0].Message = \"Build failed outside of test results\"\n\t\t}\n\t}\n\n\tcancel()\n\treturn &br, nil\n}", "title": "" } ]
[ { "docid": "9f06f34dc181d8077225eb63aaa67636", "score": "0.78348523", "text": "func ReadBuild(inputBuild Build, acc Accumulator) error {\n\tvar wg sync.WaitGroup // Each subtask does wg.Add(1), then we wg.Wait() for them to finish\n\tctx, cancel := context.WithTimeout(inputBuild.Context, 30*time.Second) // Allows aborting after first error\n\tbuild := inputBuild\n\tbuild.Context = ctx\n\tec := make(chan error) // Receives errors from anyone\n\n\t// Download started.json, send to sc\n\twg.Add(1)\n\tsc := make(chan gcs.Started) // Receives started.json result\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tstarted, err := build.Started()\n\t\tif err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\tcase ec <- err:\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase sc <- *started:\n\t\t}\n\t}()\n\n\t// Download finished.json, send to fc\n\twg.Add(1)\n\tfc := make(chan gcs.Finished) // Receives finished.json result\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tfinished, err := build.Finished()\n\t\tif err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\tcase ec <- err:\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase fc <- *finished:\n\t\t}\n\t}()\n\n\t// List artifacts to the artifacts channel\n\twg.Add(1)\n\tartifacts := make(chan *storage.ObjectAttrs) // Receives objects\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tdefer close(artifacts) // No more artifacts\n\t\tif err := build.Artifacts(artifacts); err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\tcase ec <- err:\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Download each artifact\n\twg.Add(1)\n\tsuiteArtifacts := make(chan *storage.ObjectAttrs)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tdefer close(suiteArtifacts)\n\t\tif err := acc.Artifacts(ctx, artifacts, suiteArtifacts); err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\tcase ec <- err:\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Process each suite\n\twg.Add(1)\n\tsuitesChan := make(chan gcs.SuitesMeta)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tdefer close(suitesChan)\n\t\tif err := build.Suites(suiteArtifacts, suitesChan); err != nil {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\tcase ec <- err:\n\t\t\t}\n\t\t}\n\t}()\n\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tfor suitesMeta := range suitesChan {\n\t\t\tacc.AddSuites(ctx, suitesMeta.Suites)\n\t\t}\n\t}()\n\n\t// Wait for everyone to complete their work\n\tgo func() {\n\t\twg.Wait()\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase ec <- nil:\n\t\t}\n\t}()\n\tvar finished *gcs.Finished\n\tvar started *gcs.Started\n\tfor { // Wait until we receive started and finished and/or an error\n\t\tselect {\n\t\tcase err := <-ec:\n\t\t\tif err != nil {\n\t\t\t\tcancel()\n\t\t\t\treturn fmt.Errorf(\"failed to read %s: %v\", build, err)\n\t\t\t}\n\t\t\tbreak\n\t\tcase s := <-sc:\n\t\t\tstarted = &s\n\t\tcase f := <-fc:\n\t\t\tfinished = &f\n\t\t}\n\t\tif started != nil && finished != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ok, err := acc.AddMetadata(ctx, started, finished); !ok || err != nil {\n\t\tcancel()\n\t\treturn err\n\t}\n\n\tselect {\n\tcase <-ctx.Done():\n\t\tcancel()\n\t\treturn fmt.Errorf(\"interrupted reading %s\", build)\n\tcase err := <-ec:\n\t\tif err != nil {\n\t\t\tcancel()\n\t\t\treturn fmt.Errorf(\"failed to read %s: %v\", build, err)\n\t\t}\n\t}\n\n\tacc.Finished(ctx)\n\n\tcancel()\n\treturn nil\n}", "title": "" }, { "docid": "56f9edd868f5c69ab3fbf64fa2f3e432", "score": "0.56522393", "text": "func ReadBuilds(parent context.Context, group config.TestGroup, builds Builds, max int, dur time.Duration, concurrency int) (*state.Grid, error) {\n\t// Spawn build readers\n\tif concurrency == 0 {\n\t\treturn nil, fmt.Errorf(\"zero readers for %s\", group.Name)\n\t}\n\tctx, cancel := context.WithCancel(parent)\n\tvar stop time.Time\n\tif dur != 0 {\n\t\tstop = time.Now().Add(-dur)\n\t}\n\tlb := len(builds)\n\tif lb > max {\n\t\tlog.Printf(\" Truncating %d %s results to %d\", lb, group.Name, max)\n\t\tlb = max\n\t}\n\tcols := make([]*Column, lb)\n\tlog.Printf(\"UPDATE: %s since %s (%d)\", group.Name, stop, stop.Unix())\n\tec := make(chan error)\n\told := make(chan int)\n\tvar wg sync.WaitGroup\n\n\t// Send build indices to readers\n\tindices := make(chan int)\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tdefer close(indices)\n\t\tfor i := range builds[:lb] {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\tcase <-old:\n\t\t\t\treturn\n\t\t\tcase indices <- i:\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Concurrently receive indices and read builds\n\tfor i := 0; i < concurrency; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\treturn\n\t\t\t\tcase i, open := <-indices:\n\t\t\t\t\tif !open {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tb := builds[i]\n\t\t\t\t\tc, err := ReadBuild(b)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tec <- err\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tcols[i] = c\n\t\t\t\t\tif c.Started < stop.Unix() {\n\t\t\t\t\t\tselect {\n\t\t\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t\tcase old <- i:\n\t\t\t\t\t\t\tlog.Printf(\"STOP: %d %s started at %d < %d\", i, b.Prefix, c.Started, stop.Unix())\n\t\t\t\t\t\tdefault: // Someone else may have already reported an old result\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t}\n\n\t// Wait for everyone to finish\n\tgo func() {\n\t\twg.Wait()\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase ec <- nil: // No error\n\t\t}\n\t}()\n\n\t// Determine if we got an error\n\tselect {\n\tcase <-ctx.Done():\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"interrupted reading %s\", group.Name)\n\tcase err := <-ec:\n\t\tif err != nil {\n\t\t\tcancel()\n\t\t\treturn nil, fmt.Errorf(\"error reading %s: %v\", group.Name, err)\n\t\t}\n\t}\n\n\t// Add the columns into a grid message\n\tgrid := &state.Grid{}\n\trows := map[string]*state.Row{} // For fast target => row lookup\n\th := Headers(group)\n\tnc := makeNameConfig(group.TestNameConfig)\n\tfor _, c := range cols {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tcancel()\n\t\t\treturn nil, fmt.Errorf(\"interrupted appending columns to %s\", group.Name)\n\t\tdefault:\n\t\t}\n\t\tif c == nil {\n\t\t\tcontinue\n\t\t}\n\t\tAppendColumn(h, nc, grid, rows, *c)\n\t\tif c.Started < stop.Unix() { // There may be concurrency results < stop.Unix()\n\t\t\tlog.Printf(\" %s#%s before %s, stopping...\", group.Name, c.ID, stop)\n\t\t\tbreak // Just process the first result < stop.Unix()\n\t\t}\n\t}\n\tsort.Stable(Rows(grid.Rows))\n\tcancel()\n\treturn grid, nil\n}", "title": "" }, { "docid": "e1e312eaa4d4e82ac650fe59de1bb96d", "score": "0.55364835", "text": "func (client *Client) Builds() (builds []Build, err error) {\n\ttry := func(loc Location) (builds []Build, err error) {\n\t\tformat, resp, err := client.Get(loc, \"\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer resp.Close()\n\n\t\tswitch format {\n\t\tcase \".json\":\n\t\t\terr = json.NewDecoder(resp).Decode(&builds)\n\t\t\treturn builds, err\n\t\tcase \".txt\":\n\t\t\tb, err := ioutil.ReadAll(resp)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tstream := rbxdhist.Lex(b)\n\t\t\t// Builds after this date are interoperable.\n\t\t\tepoch := time.Date(2018, 8, 7, 0, 0, 0, 0, rbxdhist.ZonePST())\n\t\t\t// Builds after this date use Studio64 instead of Studio.\n\t\t\tepoch64 := time.Date(2023, 6, 1, 0, 0, 0, 0, rbxdhist.ZonePST())\n\t\t\tfor i := 0; i < len(stream); i++ {\n\t\t\t\tswitch job := stream[i].(type) {\n\t\t\t\tcase *rbxdhist.Job:\n\t\t\t\t\t// Only Studio builds.\n\t\t\t\t\tif job.Build != \"Studio\" && job.Build != \"Studio64\" {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif !job.Time.After(epoch) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif job.Build == \"Studio64\" && !job.Time.After(epoch64) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only completed builds.\n\t\t\t\t\tif job.GitHash == \"\" {\n\t\t\t\t\t\t// Jobs that have a git hash are not accompanied by a\n\t\t\t\t\t\t// Status, so just assume that they're Done.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t//TODO: May be better to use another epoch instead.\n\t\t\t\t\t\tif i+1 >= len(stream) {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif status, ok := stream[i+1].(*rbxdhist.Status); !ok || *status != \"Done\" {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbuilds = append(builds, Build{\n\t\t\t\t\t\tHash: job.Hash,\n\t\t\t\t\t\tDate: job.Time,\n\t\t\t\t\t\tVersion: job.Version,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn builds, nil\n\t\t}\n\t\treturn nil, errUnsupportedFormat(format)\n\t}\n\tlocs := client.Config.Builds\n\tfor i, loc := range locs {\n\t\tif builds, err = try(loc); err == nil || i == len(locs)-1 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn builds, err\n}", "title": "" }, { "docid": "1543c9e89578b4cac7d707ece2a80500", "score": "0.5506066", "text": "func (op *CreateBuildOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cloudbuildpb.Build, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp cloudbuildpb.Build\n\tif err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "9534dce1249ad7f9fa8d59dd9f4367fd", "score": "0.5487514", "text": "func (c *Client) waitForBuild(project *Project, logger io.Writer, buildNum int, jobTimeout time.Duration) (*Build, error) {\n\tconst sleepSec = 2\n\tvar (\n\t\tcount int\n\t\tendTime = time.Now().Add(jobTimeout)\n\t)\n\tfor {\n\t\tif time.Now().After(endTime) {\n\t\t\treturn nil, fmt.Errorf(\"job timeout exceeded while waiting for build %s [%d] to finish\", project.Reponame, buildNum)\n\t\t}\n\t\tif count%10 == 0 {\n\t\t\tlogf(logger, \"waiting for build %s [%d] to finish\\n\", project.Reponame, buildNum)\n\t\t}\n\t\ttime.Sleep(sleepSec * time.Second)\n\t\tbuild, err := c.GetBuild(project, logger, buildNum)\n\t\tif err != nil {\n\t\t\t//should we return this error? logging for now - BLA\n\t\t\tlogf(logger, \"failed to get build %s [%d] -> %v\\n\", project.Reponame, buildNum, err)\n\t\t\tcontinue\n\t\t}\n\t\t// Lifecycle options:\n\t\t//:queued, :scheduled, :not_run, :not_running, :running or :finished\n\t\tif build.Lifecycle == lifecycleFinished {\n\t\t\treturn build, nil\n\t\t}\n\t\tcount++\n\t}\n}", "title": "" }, { "docid": "bcd27055fd951a61fe8576a5ebf35008", "score": "0.54597473", "text": "func ReadBuildInfo() (*debug.BuildInfo, bool)", "title": "" }, { "docid": "fb1d20132252f1420acca32812abcf5d", "score": "0.5438579", "text": "func Build() error {\n\tif err := clearDistFolder(); err != nil {\n\t\treturn err\n\t}\n\tdata, err := prepareData()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err := index(data); err != nil {\n\t\treturn err\n\t}\n\tif err := stories(data); err != nil {\n\t\treturn err\n\t}\n\tif _, err := offline(); err != nil {\n\t\treturn err\n\t}\n\tif _, err := favourites(); err != nil {\n\t\treturn err\n\t}\n\tif err := snowpack.RunBuild(); err != nil {\n\t\treturn err\n\t}\n\tif err := saveBuildTimeToDisk(); err != nil {\n\t\treturn err\n\t}\n\tlog.Println(\"Done building!\")\n\treturn nil\n}", "title": "" }, { "docid": "334e7512e5b8968cf0db3e3d31f28ecf", "score": "0.53776026", "text": "func (c *restClient) GetBuild(ctx context.Context, req *cloudbuildpb.GetBuildRequest, opts ...gax.CallOption) (*cloudbuildpb.Build, error) {\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v1/projects/%v/builds/%v\", req.GetProjectId(), req.GetId())\n\n\tparams := url.Values{}\n\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\n\tif req.GetName() != \"\" {\n\t\tparams.Add(\"name\", fmt.Sprintf(\"%v\", req.GetName()))\n\t}\n\n\tbaseUrl.RawQuery = params.Encode()\n\n\t// Build HTTP headers from client and context metadata.\n\tmd := metadata.Pairs(\"x-goog-request-params\", fmt.Sprintf(\"%s=%v&%s=%v&%s=%v\", \"project_id\", url.QueryEscape(req.GetProjectId()), \"id\", url.QueryEscape(req.GetId()), \"name\", url.QueryEscape(req.GetName())))\n\n\theaders := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs(\"Content-Type\", \"application/json\"))\n\topts = append((*c.CallOptions).GetBuild[0:len((*c.CallOptions).GetBuild):len((*c.CallOptions).GetBuild)], opts...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &cloudbuildpb.Build{}\n\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"GET\", baseUrl.String(), nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbuf, err := ioutil.ReadAll(httpRsp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\treturn maybeUnknownEnum(err)\n\t\t}\n\n\t\treturn nil\n\t}, opts...)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "f141a42b58c24fe9bc000fe71c02e8b0", "score": "0.53702927", "text": "func (g *Gitlab) Read() error {\n\treturn g.getProject()\n}", "title": "" }, { "docid": "984b43486cdee07d023086202e534efc", "score": "0.5363982", "text": "func (p *Provider) BuildImport(app string, r io.Reader) (*structs.Build, error) {\n\tlog := Logger.At(\"BuildImport\").Namespace(\"app=%s\", app).Start()\n\n\tvar sourceBuild structs.Build\n\n\t// set up the new build\n\ttargetBuild := structs.NewBuild(app)\n\ttargetBuild.Started = time.Now().UTC()\n\n\tif p.IsTest() {\n\t\ttargetBuild.Id = \"B12345\"\n\t}\n\n\trepo, err := p.appRepository(app)\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn nil, err\n\t}\n\n\tif err := p.dockerLogin(); err != nil {\n\t\tlog.Error(err)\n\t\treturn nil, err\n\t}\n\n\tgz, err := gzip.NewReader(r)\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn nil, err\n\t}\n\n\ttr := tar.NewReader(gz)\n\n\tvar manifest imageManifest\n\n\tfor {\n\t\theader, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Error(err)\n\t\t\treturn nil, err\n\t\t}\n\t\tif header.Typeflag != tar.TypeReg {\n\t\t\tcontinue\n\t\t}\n\n\t\tif header.Name == \"build.json\" {\n\t\t\tvar buf bytes.Buffer\n\t\t\tio.Copy(&buf, tr)\n\n\t\t\tif err := json.Unmarshal(buf.Bytes(), &sourceBuild); err != nil {\n\t\t\t\tlog.Error(err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\ttargetBuild.Id = generateId(\"B\", 10)\n\t\t}\n\n\t\tif strings.HasSuffix(header.Name, \".tar\") {\n\t\t\tlog.Step(\"load\").Logf(\"tar=%q\", header.Name)\n\n\t\t\tcmd := exec.Command(\"docker\", \"load\")\n\n\t\t\tpr, pw := io.Pipe()\n\t\t\ttee := io.TeeReader(tr, pw)\n\t\t\toutb := &bytes.Buffer{}\n\n\t\t\tcmd.Stdin = pr\n\t\t\tcmd.Stdout = outb\n\n\t\t\tif err := cmd.Start(); err != nil {\n\t\t\t\tlog.Error(err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tlog.Step(\"manifest\").Logf(\"tar=%q\", header.Name)\n\t\t\tmanifest, err = extractImageManifest(tee)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif err := pw.Close(); err != nil {\n\t\t\t\tlog.Error(err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif err := cmd.Wait(); err != nil {\n\t\t\t\tout := strings.TrimSpace(outb.String())\n\t\t\t\treturn nil, log.Errorf(\"%s: %s\\n\", out, err.Error())\n\t\t\t}\n\n\t\t\tif len(manifest) == 0 {\n\t\t\t\tlog.Errorf(\"invalid image manifest: no data\")\n\t\t\t\treturn nil, fmt.Errorf(\"invalid image manifest: no data\")\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, tags := range manifest {\n\t\tfor _, image := range tags.RepoTags {\n\t\t\tfps := strings.Split(image, \":\")[1]\n\t\t\tps := strings.Split(fps, \".\")[0]\n\t\t\ttarget := fmt.Sprintf(\"%s:%s.%s\", repo.URI, ps, targetBuild.Id)\n\n\t\t\tlog.Step(\"tag\").Logf(\"from=%q to=%q\", image, target)\n\t\t\tif out, err := exec.Command(\"docker\", \"tag\", image, target).CombinedOutput(); err != nil {\n\t\t\t\treturn nil, log.Error(fmt.Errorf(\"%s: %s\\n\", lastline(out), err.Error()))\n\t\t\t}\n\n\t\t\tlog.Step(\"push\").Logf(\"to=%q\", target)\n\t\t\tif out, err := exec.Command(\"docker\", \"push\", target).CombinedOutput(); err != nil {\n\t\t\t\treturn nil, log.Error(fmt.Errorf(\"%s: %s\\n\", lastline(out), err.Error()))\n\t\t\t}\n\t\t}\n\t}\n\n\ttargetBuild.Description = sourceBuild.Description\n\ttargetBuild.Ended = time.Now().UTC()\n\ttargetBuild.Logs = sourceBuild.Logs\n\ttargetBuild.Manifest = sourceBuild.Manifest\n\n\tif err := p.buildSave(targetBuild); err != nil {\n\t\tlog.Error(err)\n\t\treturn nil, err\n\t}\n\n\trr, err := p.ReleaseCreate(app, structs.ReleaseCreateOptions{Build: options.String(targetBuild.Id)})\n\tif err != nil {\n\t\treturn nil, log.Error(err)\n\t}\n\n\ttargetBuild.Status = \"complete\"\n\ttargetBuild.Release = rr.Id\n\n\tif err := p.buildSave(targetBuild); err != nil {\n\t\tlog.Error(err)\n\t\treturn nil, err\n\t}\n\n\tp.EventSend(\"build:create\", structs.EventSendOptions{Data: map[string]string{\"app\": targetBuild.App, \"id\": targetBuild.Id, \"release_id\": targetBuild.Id}})\n\n\tlog.Successf(\"build=%q release=%q\", targetBuild.Id, rr.Id)\n\n\treturn targetBuild, nil\n}", "title": "" }, { "docid": "b675b43c2595a5e424d966c40302344b", "score": "0.5349185", "text": "func (b *BuildOptions) Build() (*BuildResults, error) {\n\t// We expect to upload to a subdirectory with a version identifier\n\tgcsLocation := b.StageLocation\n\tif !strings.HasSuffix(gcsLocation, \"/\") {\n\t\tgcsLocation += \"/\"\n\t}\n\tcmd := exec.Command(\"make\", \"gcs-publish-ci\")\n\tcmd.SetEnv(\n\t\tfmt.Sprintf(\"HOME=%v\", os.Getenv(\"HOME\")),\n\t\tfmt.Sprintf(\"PATH=%v\", os.Getenv(\"PATH\")),\n\t\tfmt.Sprintf(\"GCS_LOCATION=%v\", gcsLocation),\n\t\tfmt.Sprintf(\"GOPATH=%v\", os.Getenv(\"GOPATH\")),\n\t)\n\tcmd.SetDir(b.KopsRoot)\n\texec.InheritOutput(cmd)\n\tif err := cmd.Run(); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Get the full path (including subdirectory) that we uploaded to\n\t// It is written by gcs-publish-ci to .build/upload/latest-ci.txt\n\tlatestPath := filepath.Join(b.KopsRoot, \".build\", \"upload\", \"latest-ci.txt\")\n\tkopsBaseURL, err := os.ReadFile(latestPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read file %q: %w\", latestPath, err)\n\t}\n\tu, err := url.Parse(strings.TrimSpace(string(kopsBaseURL)))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse url %q from file %q: %w\", string(kopsBaseURL), latestPath, err)\n\t}\n\tu.Path = strings.ReplaceAll(u.Path, \"//\", \"/\")\n\tresults := &BuildResults{\n\t\tKopsBaseURL: u.String(),\n\t}\n\n\t// Write some meta files so that other tooling can know e.g. KOPS_BASE_URL\n\tmetaDir := filepath.Join(b.KopsRoot, \".kubetest2\")\n\tif err := os.MkdirAll(metaDir, 0o755); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to Mkdir(%q): %w\", metaDir, err)\n\t}\n\tp := filepath.Join(metaDir, \"kops-base-url\")\n\tif err := os.WriteFile(p, []byte(results.KopsBaseURL), 0o644); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to WriteFile(%q): %w\", p, err)\n\t}\n\tklog.Infof(\"wrote file %q with %q\", p, results.KopsBaseURL)\n\n\treturn results, nil\n}", "title": "" }, { "docid": "71a882f663343a00ece34179ee8aa010", "score": "0.5344631", "text": "func (op *RunBuildTriggerOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cloudbuildpb.Build, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp cloudbuildpb.Build\n\tif err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "b3501b96dbd2c28c45d91ab41de967fb", "score": "0.53230023", "text": "func (op *RetryBuildOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cloudbuildpb.Build, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp cloudbuildpb.Build\n\tif err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "96b25fd6ec23632f3a0f2419475f37b0", "score": "0.5318433", "text": "func GetBuild(build Build) (string, error) {\n\tresp, err := http.Get(\"https://github.com/CleverRaven/Cataclysm-DDA/releases/download/cdda-experimental-\" + build.Version + \"/cdda-linux-\" + build.Graphic + \"-x64-\" + build.Version + \".tar.gz\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode == 404 {\n\t\treturn \"\", fmt.Errorf(\"this build version does not exists at the moment. Try later or with a different version\")\n\t}\n\n\tfilename := \"cataclysm-\" + build.Graphic + \"-\" + fmt.Sprint(build.Version) + \".tar.gz\"\n\terr = downloadFile(resp, filename)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filename, err\n}", "title": "" }, { "docid": "c71e20311b367e6431ac0d263ede635e", "score": "0.52900636", "text": "func (b *Build) Get() error {\n\tappendum := \"/builds('\" + url.QueryEscape(b.BuildID) + \"')\"\n\tbody, err := b.Connector.Get(appendum)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar jBuild jsonBuild\n\tif err := json.Unmarshal(body, &jBuild); err != nil {\n\t\treturn errors.Wrap(err, \"Unexpected buildFrameWork response: \"+string(body))\n\t}\n\tb.RunState = jBuild.Build.RunState\n\tb.ResultState = jBuild.Build.ResultState\n\tb.Phase = jBuild.Build.Phase\n\tb.Entitytype = jBuild.Build.Entitytype\n\tb.Startedby = jBuild.Build.Startedby\n\tb.StartedAt = jBuild.Build.StartedAt\n\tb.FinishedAt = jBuild.Build.FinishedAt\n\treturn nil\n}", "title": "" }, { "docid": "fd31c379bfe546e8a36131d6cfd4f061", "score": "0.52687687", "text": "func Build(repo utils.Repository, branch string, logger *logrus.Entry) (*Response, error) {\n\tlogger.Infof(\"Running build sequence\")\n\tfeatureName := utils.GetFeatureName(branch)\n\tvar workDir = \"/tmp\"\n\ttargetDir := fmt.Sprintf(\"%s/%d_%s\", workDir, int32(time.Now().Unix()), featureName)\n\tdefer os.RemoveAll(targetDir)\n\tif _, err := clone(repo.CloneURL, targetDir, branch, logger); err != nil {\n\t\treturn nil, err\n\t}\n\tdeployment, err := retrieveDeployment(targetDir, logger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tservice, err := retrieveService(targetDir, logger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdockerImages, err := RunDocker(targetDir, featureName, repo.Name, logger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Response{\n\t\tDeployment: deployment,\n\t\tFeature: featureName,\n\t\tProjectName: repo.Name,\n\t\tImages: dockerImages,\n\t\tService: service,\n\t}, nil\n}", "title": "" }, { "docid": "445038aeee8f47d973da9161db1aa058", "score": "0.52495235", "text": "func Build(buildPath string, tag string) {\n\tcli, err := client.NewClientWithOpts(client.FromEnv)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tbuildContext, err := archive.TarWithOptions(buildPath, &archive.TarOptions{\n\t\t// ExcludePatterns: [],\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tbuildOpts := types.ImageBuildOptions{Tags: []string{tag}}\n\timageBuildResponse, err := cli.ImageBuild(context.Background(), buildContext, buildOpts)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer imageBuildResponse.Body.Close()\n\n\ttype streamMsg struct {\n\t\tStream string\n\t}\n\n\tscanner := bufio.NewScanner(imageBuildResponse.Body)\n\tfor scanner.Scan() {\n\t\tvar msg streamMsg\n\t\tjson.Unmarshal(scanner.Bytes(), &msg)\n\t\tfmt.Print(msg.Stream)\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"reading standard input:\", err)\n\t}\n}", "title": "" }, { "docid": "141f572f399aa0fec349d82de2fe24f2", "score": "0.52330875", "text": "func (c *Client) GetBuild(project *Project, logger io.Writer, buildNum int) (*Build, error) {\n\tvar build Build\n\terr := retrier(retrierIntervalSecs, retrierAttempts, func() error {\n\t\turl := fmt.Sprintf(\"project/%s/%s/%s/%d\", project.Vcs, project.Username, project.Reponame, buildNum)\n\t\terr := c.requester(c, \"GET\", url, nil, nil, &build)\n\t\tif err != nil {\n\t\t\tlogf(logger, \"GetBuild failed, GET /%s -> %v\", url, err)\n\t\t}\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &build, nil\n}", "title": "" }, { "docid": "7bf45241930ea5947ed810f6cf8a56ee", "score": "0.5220332", "text": "func ReadBuildInfo() (info *BuildInfo, ok bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "6674a27f64f5682037e4b2a705a1375a", "score": "0.52032506", "text": "func (op *CreateBuildOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cloudbuildpb.Build, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp cloudbuildpb.Build\n\tif err := op.lro.Poll(ctx, &resp, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\tif !op.Done() {\n\t\treturn nil, nil\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "d96e9c6c8c990a1fb2e89f12f328866f", "score": "0.5149293", "text": "func (r *Routine) getBuild() (build, error) {\n\ttype Response struct {\n\t\tError string `json:\"error_message\"`\n\t\tBuilds []build `json:\"builds\"`\n\t}\n\n\tresp, err := r.client.Do(r.request)\n\tif err != nil {\n\t\treturn build{}, err\n\t}\n\tdefer resp.Body.Close()\n\n\t// Pull out the response data.\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn build{}, err\n\t}\n\n\t// Parse the JSON doc.\n\tresponse := Response{}\n\tif err := json.Unmarshal(body, &response); err != nil {\n\t\treturn build{}, err\n\t}\n\n\tif response.Error != \"\" {\n\t\treturn build{}, fmt.Errorf(response.Error)\n\t}\n\n\tif len(response.Builds) < 1 {\n\t\treturn build{}, fmt.Errorf(\"no builds available\")\n\t}\n\n\t// Return the most recent build.\n\treturn response.Builds[0], nil\n}", "title": "" }, { "docid": "8d3d5fc2e9189c6c2157afe8f3d9b5cd", "score": "0.5130209", "text": "func (d *DeployAgent) Build(overrideBuildConfig *types.BuildConfig) error {\n\t// retrieve current image to use for cache\n\tcurrImageSection := d.Release.Config[\"image\"].(map[string]interface{})\n\tcurrentTag := currImageSection[\"tag\"].(string)\n\n\tif d.tag == \"\" {\n\t\td.tag = currentTag\n\t}\n\n\t// if build is not local, fetch remote source\n\tvar basePath string\n\tvar err error\n\n\tbuildCtx := d.Opts.LocalPath\n\n\tif !d.Opts.Local {\n\t\trepoSplit := strings.Split(d.Release.GitActionConfig.GitRepo, \"/\")\n\n\t\tif len(repoSplit) != 2 {\n\t\t\treturn fmt.Errorf(\"invalid formatting of repo name\")\n\t\t}\n\n\t\tzipResp, err := d.Client.GetRepoZIPDownloadURL(\n\t\t\tcontext.Background(),\n\t\t\td.Opts.ProjectID,\n\t\t\tint64(d.Release.GitActionConfig.GitRepoID),\n\t\t\t\"github\",\n\t\t\trepoSplit[0],\n\t\t\trepoSplit[1],\n\t\t\td.Release.GitActionConfig.GitBranch,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// download the repository from remote source into a temp directory\n\t\tbasePath, err = d.downloadRepoToDir(zipResp.URLString)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif d.tag == \"\" {\n\t\t\tshortRef := fmt.Sprintf(\"%.7s\", zipResp.LatestCommitSHA)\n\t\t\td.tag = shortRef\n\t\t}\n\t} else {\n\t\tbasePath, err = filepath.Abs(\".\")\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tcurrTag, err := d.pullCurrentReleaseImage()\n\n\t// if image is not found, don't return an error\n\tif err != nil && err != docker.PullImageErrNotFound {\n\t\treturn err\n\t}\n\n\tbuildAgent := &BuildAgent{\n\t\tSharedOpts: d.Opts.SharedOpts,\n\t\tAPIClient: d.Client,\n\t\tImageRepo: d.imageRepo,\n\t\tEnv: d.env,\n\t\tImageExists: d.imageExists,\n\t}\n\n\tif d.Opts.Method == DeployBuildTypeDocker {\n\t\treturn buildAgent.BuildDocker(\n\t\t\td.agent,\n\t\t\tbasePath,\n\t\t\tbuildCtx,\n\t\t\td.dockerfilePath,\n\t\t\td.tag,\n\t\t\tcurrentTag,\n\t\t)\n\t}\n\n\tbuildConfig := d.Release.BuildConfig\n\n\tif overrideBuildConfig != nil {\n\t\tbuildConfig = overrideBuildConfig\n\t}\n\n\treturn buildAgent.BuildPack(d.agent, buildCtx, d.tag, currTag, buildConfig)\n}", "title": "" }, { "docid": "245370501ea2ce8379b7a0bff83891d6", "score": "0.51138633", "text": "func GetBuild(settings *playfab.Settings, postData *GetBuildRequestModel, entityToken string) (*GetBuildResponseModel, error) {\r\n if entityToken == \"\" {\n return nil, playfab.NewCustomError(\"entityToken should not be an empty string\", playfab.ErrorGeneric)\n }\r\n b, errMarshal := json.Marshal(postData)\r\n if errMarshal != nil {\r\n return nil, playfab.NewCustomError(errMarshal.Error(), playfab.ErrorMarshal)\r\n }\r\n\r\n sourceMap, err := playfab.Request(settings, b, \"/MultiplayerServer/GetBuild\", \"X-EntityToken\", entityToken)\r\n if err != nil {\r\n return nil, err\r\n }\r\n \r\n result := &GetBuildResponseModel{}\r\n\r\n config := mapstructure.DecoderConfig{\r\n DecodeHook: playfab.StringToDateTimeHook,\r\n Result: result,\r\n }\r\n \r\n decoder, errDecoding := mapstructure.NewDecoder(&config)\r\n if errDecoding != nil {\r\n return nil, playfab.NewCustomError(errDecoding.Error(), playfab.ErrorDecoding)\r\n }\r\n \r\n errDecoding = decoder.Decode(sourceMap)\r\n if errDecoding != nil {\r\n return nil, playfab.NewCustomError(errDecoding.Error(), playfab.ErrorDecoding)\r\n }\r\n\r\n return result, nil\r\n}", "title": "" }, { "docid": "9708cd72de291433beda3bda951d11f1", "score": "0.50908977", "text": "func build(file, name string) {\n\t// Check if the file is specified\n\tif file == \"\" {\n\t\tlog.Errorf(\"You need to specify a file to build.\")\n\t}\n\n\t// Read the given file\n\tbytes, err := ioutil.ReadFile(file)\n\tif err != nil {\n\t\tlog.Errorf(err)\n\t}\n\n\truntime.Run(string(bytes), name)\n}", "title": "" }, { "docid": "3a84d29c8501a1d858a9ef91a691d888", "score": "0.50729877", "text": "func (b *Build) ReadFile(relPath string) ([]byte, error) {\n\treturn client.ReadObject(ctx, BucketName, path.Join(b.StoragePath, relPath))\n}", "title": "" }, { "docid": "46741a46b6f4740040aaee87ec829eb3", "score": "0.5061042", "text": "func (o *GetBuildFileReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetBuildFileOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 401:\n\t\tresult := NewGetBuildFileUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 403:\n\t\tresult := NewGetBuildFileForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 404:\n\t\tresult := NewGetBuildFileNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\tresult := NewGetBuildFileDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "5d62945adc07de86a5249dd78385c866", "score": "0.50607324", "text": "func (op *RunBuildTriggerOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cloudbuildpb.Build, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp cloudbuildpb.Build\n\tif err := op.lro.Poll(ctx, &resp, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\tif !op.Done() {\n\t\treturn nil, nil\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "40f5cbb6498187aef7c61cc2aa7a6589", "score": "0.50562084", "text": "func Build(ctx context.Context, master *messages.MasterLocation, builder string, buildNum int64) (*messages.Build, error) {\n\treturn GetReader(ctx).Build(ctx, master, builder, buildNum)\n}", "title": "" }, { "docid": "c2135a299bb3a3cff7951e230494a24b", "score": "0.5050209", "text": "func (op *ApproveBuildOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cloudbuildpb.Build, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp cloudbuildpb.Build\n\tif err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "a48e832a56c43af629c177f05b148acc", "score": "0.50231993", "text": "func (p *PrintingKubeClient) Build(_ io.Reader, _ bool) (kube.ResourceList, error) {\n\treturn []*resource.Info{}, nil\n}", "title": "" }, { "docid": "b512f1941ecfe5284d096516288ea74a", "score": "0.50204134", "text": "func (b *Backend) Build(ctx context.Context, req *pb.BuildRequest) (*pb.BuildResponse, error) {\n\tb.wg.Add(1)\n\tdefer b.wg.Done()\n\tlogEntry := logrus.WithFields(logrus.Fields{\"BuildType\": req.GetBuildType(), \"BuildID\": req.GetBuildID()})\n\tlogEntry.Info(\"BuildRequest received\")\n\n\tctx = context.WithValue(ctx, util.LogFieldKey(util.LogKeySessionID), req.BuildID)\n\tbuilder, nErr := b.daemon.NewBuilder(ctx, req)\n\tif nErr != nil {\n\t\tlogEntry.Error(nErr)\n\t\treturn &pb.BuildResponse{}, nErr\n\t}\n\n\tdefer func() {\n\t\tif cErr := builder.CleanResources(); cErr != nil {\n\t\t\tlogEntry.Warnf(\"defer builder clean build resources failed: %v\", cErr)\n\t\t}\n\t\tb.daemon.deleteBuilder(req.BuildID)\n\t\tb.deleteStatus(req.BuildID)\n\t}()\n\n\tb.syncBuildStatus(req.BuildID) <- struct{}{}\n\tb.closeStatusChan(req.BuildID)\n\timageID, bErr := builder.Build()\n\tif bErr != nil {\n\t\tlogEntry.Error(bErr)\n\t\treturn &pb.BuildResponse{}, bErr\n\t}\n\n\treturn &pb.BuildResponse{ImageID: imageID}, nil\n}", "title": "" }, { "docid": "d6e312c6b2ceaadd4d60ad0e939fa6f3", "score": "0.50136936", "text": "func (a *RemoteAccessApiService) GetJobLastBuild(ctx context.Context, name string) (FreeStyleBuild, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Get\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue FreeStyleBuild\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/job/{name}/lastBuild/api/json\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"name\"+\"}\", fmt.Sprintf(\"%v\", name), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode < 300 {\n\t\t// If we succeed, return the data, otherwise pass on to decode error.\n\t\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\tif err == nil {\n\t\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t\t}\n\t}\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHttpResponse.Status,\n\t\t}\n\t\tif localVarHttpResponse.StatusCode == 200 {\n\t\t\tvar v FreeStyleBuild\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHttpResponse, nil\n}", "title": "" }, { "docid": "947411f6677a146f97a0467b8ab847cd", "score": "0.5006499", "text": "func (idx *Index) Build() <-chan bool {\n\t// Channel to indicate to the caller when the indexation is done\n\tdone := make(chan bool, 1)\n\n\tgo func() {\n\n\t\trepositories := idx.RegClient.WalkRepositories()\n\n\t\t// Channel to browse all repository images\n\t\timages := make(chan *repoImage, 10)\n\n\t\t// Waitgoup to watch when all repo images have been read and pushed to images channel\n\t\tbrowseImgWg := sync.WaitGroup{}\n\t\tfor repository := range repositories {\n\t\t\tbrowseImgWg.Add(1)\n\t\t\tgo func(repo dim.Repository) {\n\t\t\t\tdefer browseImgWg.Done()\n\t\t\t\tfor img := range repo.WalkImages() {\n\t\t\t\t\timages <- &repoImage{repo.Named().Name(), img}\n\t\t\t\t}\n\t\t\t}(repository)\n\t\t}\n\n\t\t// Channel to push parsed images, erady o be indexed\n\t\ttasks := make(chan *dim.IndexImage, 5)\n\n\t\t// Waitgroup to watch when all image have been parsed and pushed i tasks channel\n\t\tparseImgWg := sync.WaitGroup{}\n\t\tparseImgWg.Add(3)\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tgo func() {\n\t\t\t\tdefer parseImgWg.Done()\n\t\t\t\tfor img := range images {\n\t\t\t\t\tlogrus.WithField(\"reponame\", img.repoName).Infoln(\"Indexing image\")\n\t\t\t\t\ttasks <- Parse(img.repoName, img.image)\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\n\t\tbatch := idx.NewBatch()\n\t\tgo func() {\n\t\t\tfor task := range tasks {\n\t\t\t\tbatch.Index(task.FullName, task)\n\t\t\t}\n\t\t\tif err := idx.Batch(batch); err != nil {\n\t\t\t\tlogrus.WithError(err).Errorln(\"Failed to index initial repository state\")\n\t\t\t}\n\t\t\tclose(done)\n\t\t}()\n\n\t\t// When all images have been pushd to the channel, close it\n\t\tbrowseImgWg.Wait()\n\t\tclose(images)\n\n\t\t// When all images have been parsed and submited to indexation batch channel, close it\n\t\tparseImgWg.Wait()\n\t\tclose(tasks)\n\n\t}()\n\treturn done\n}", "title": "" }, { "docid": "3214d2adcf37868b969a5f40b92a84c8", "score": "0.500555", "text": "func (c *ApiController) GetBuild() {\n\tlog.Info(\"Get build\")\n\n\tbuildId, _ := c.GetInt64(\":buildId\")\n\n\tbuild := models.GetBuildWithId(buildId)\n\n\tc.Data[\"json\"] = build\n\tc.ServeJson()\n}", "title": "" }, { "docid": "aa84e55f6de480eee32b799a94fcc38f", "score": "0.49989626", "text": "func GetBuild(ctx context.Context, authClient *http.Client, opts GetBuildOpts) (*job.Definition, error) {\n\tlogging.Infof(ctx, \"getting build definition\")\n\n\tif opts.RealBuild {\n\t\treturn synthesizeBuildFromTemplate(ctx, authClient, opts)\n\t}\n\n\tbbClient := newBuildbucketClient(authClient, opts.BuildbucketHost)\n\n\tanswer, err := bbClient.GetBuild(ctx, &bbpb.GetBuildRequest{\n\t\tId: opts.BuildID,\n\t\tMask: &bbpb.BuildMask{\n\t\t\tFields: &fieldmaskpb.FieldMask{\n\t\t\t\tPaths: []string{\n\t\t\t\t\t\"builder\",\n\t\t\t\t\t\"infra\",\n\t\t\t\t\t\"input\",\n\t\t\t\t\t\"scheduling_timeout\",\n\t\t\t\t\t\"execution_timeout\",\n\t\t\t\t\t\"grace_period\",\n\t\t\t\t\t\"exe\",\n\t\t\t\t\t\"tags\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif answer.Infra.GetBuildbucket().GetAgent().GetOutput() != nil {\n\t\tanswer.Infra.Buildbucket.Agent.Output = nil\n\t}\n\n\tlogging.Infof(ctx, \"getting build definition: done\")\n\n\tswarmingTaskID := answer.Infra.Swarming.TaskId\n\tswarmingHostname := answer.Infra.Swarming.Hostname\n\n\tif swarmingTaskID == \"\" {\n\t\treturn nil, errors.New(\"unable to find swarming task ID on buildbucket task\")\n\t}\n\tif swarmingHostname == \"\" {\n\t\treturn nil, errors.New(\"unable to find swarming hostname on buildbucket task\")\n\t}\n\n\treturn GetFromSwarmingTask(ctx, authClient, answer, GetFromSwarmingTaskOpts{\n\t\tSwarmingHost: swarmingHostname,\n\t\tTaskID: swarmingTaskID,\n\t\tPinBotID: opts.PinBotID,\n\t\tName: getBuildJobName(opts),\n\t\tPriorityDiff: opts.PriorityDiff,\n\t\tKitchenSupport: opts.KitchenSupport,\n\t})\n}", "title": "" }, { "docid": "2e1748e92ed04a0e063d3185ceee7af0", "score": "0.499381", "text": "func GetBuild(c context.Context, host string, bid buildbucketpb.GetBuildRequest) (*buildbucketpb.Build, error) {\n\tclient, err := buildbucketClient(c, host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn client.GetBuild(c, &bid)\n}", "title": "" }, { "docid": "88924ee24793178601fed371c7cdefe4", "score": "0.49847427", "text": "func (s *JenkinsGetBuild) Run() (int, []byte, error) {\n\tbaseCommand, err := base.NewBaseJenkinsCommand(&base.Args{\n\t\tUsername: s.Username,\n\t\tPassword: s.Password,\n\t\tHost: s.Host,\n\t})\n\tif err != nil {\n\t\treturn step.ExitCodeFailure, nil, err\n\t}\n\n\tjenkins := baseCommand.Client()\n\tctx := context.Background()\n\tbuild, err := jenkins.GetBuild(ctx, s.JobName, int64(s.BuildID))\n\tif err != nil {\n\t\treturn step.ExitCodeFailure, nil, err\n\t}\n\n\tbuildOutput := output{\n\t\tResult: build.GetResult(),\n\t\tDuration: int(build.GetDuration()),\n\t\tName: build.Raw.DisplayName,\n\t\tTimestamp: build.GetTimestamp().Format(time.RFC3339),\n\t\tOutputs: step.Outputs{Object: build.Raw},\n\t}\n\n\toutputJSON, err := json.Marshal(buildOutput)\n\tif err != nil {\n\t\treturn step.ExitCodeFailure, nil, err\n\t}\n\n\t//success\n\treturn step.ExitCodeOK, outputJSON, nil\n}", "title": "" }, { "docid": "c673d0e86fe87373f207a9c2b120c0b8", "score": "0.49841386", "text": "func (s *Service) TriggerBuild(w http.ResponseWriter, req *http.Request) {\n\tdec := json.NewDecoder(req.Body)\n\tbuild := new(qfarm.Build)\n\tif err := dec.Decode(build); err != nil {\n\t\twriteErrJSON(w, err, http.StatusBadRequest)\n\t\treturn\n\t}\n\n\trepo := strings.TrimRight(build.Repo, \"/\")\n\n\tif err := s.r.ListPush(\"test-q-list\", repo); err != nil {\n\t\twriteErrJSON(w, err, http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif err := s.r.Publish(\"test-q-channel\", repo); err != nil {\n\t\twriteErrJSON(w, err, http.StatusInternalServerError)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "c086fe39ab491b664638c938aca30565", "score": "0.49782345", "text": "func RunBuildSynchronously(opts Options) error {\n\tvar logger = logrus.New()\n\tlogger.Level = opts.LogLevel\n\tlog, status, done := RunBuild(opts)\n\tfor {\n\t\tselect {\n\t\tcase e, ok := <-log:\n\t\t\tif !ok {\n\t\t\t\treturn errors.New(\"log channel closed prematurely\")\n\t\t\t}\n\t\t\te.Entry().Logger = logger\n\t\t\tswitch e.Entry().Level {\n\t\t\tcase logrus.PanicLevel:\n\t\t\t\te.Entry().Panicln(e.Entry().Message)\n\t\t\tcase logrus.FatalLevel:\n\t\t\t\te.Entry().Fatalln(e.Entry().Message)\n\t\t\tcase logrus.ErrorLevel:\n\t\t\t\te.Entry().Errorln(e.Entry().Message)\n\t\t\tcase logrus.WarnLevel:\n\t\t\t\te.Entry().Warnln(e.Entry().Message)\n\t\t\tcase logrus.InfoLevel:\n\t\t\t\te.Entry().Infoln(e.Entry().Message)\n\t\t\tdefault:\n\t\t\t\te.Entry().Debugln(e.Entry().Message)\n\t\t\t}\n\t\tcase event, ok := <-status:\n\t\t\tif !ok {\n\t\t\t\treturn errors.New(\"status channel closed prematurely\")\n\t\t\t}\n\t\t\tlogger.WithFields(event.Data()).Debugf(\"status event (type %s)\", event.EventType())\n\t\tcase err, ok := <-done:\n\t\t\tif !ok {\n\t\t\t\treturn errors.New(\"exit channel closed prematurely\")\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f6511f328403d09ac8d6eba5adbec84f", "score": "0.4965395", "text": "func (ws *Workspace) read(elem ...string) ([]byte, error) {\n\tprojectPath, err := ws.projectDirPath()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpathElems := append([]string{projectPath}, elem...)\n\treturn ws.fsUtils.ReadFile(filepath.Join(pathElems...))\n}", "title": "" }, { "docid": "5288f3eb85819a5a50a36ebcd80c72d2", "score": "0.49481118", "text": "func testBuild(t *testing.T, dstname, srcname string, src io.Reader) ([]byte, error) {\n\tif testing.Short() {\n\t\tt.Logf(\"building from %s\\n\", srcname)\n\t}\n\ttestProcess(t, dstname, nil, srcname, src)\n\tdefer os.Remove(dstname)\n\n\t// XXX Isn't there a way to build without having to launch a\n\t// subprocess?\n\tcmd := exec.Command(\"go\", \"build\", dstname)\n\treturn cmd.CombinedOutput()\n}", "title": "" }, { "docid": "f8a0443cc7a6c17c3361d3ac850823d8", "score": "0.494686", "text": "func (op *RetryBuildOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cloudbuildpb.Build, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp cloudbuildpb.Build\n\tif err := op.lro.Poll(ctx, &resp, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\tif !op.Done() {\n\t\treturn nil, nil\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "268368c9c18a371338f165e5bdff11e7", "score": "0.4938302", "text": "func scanBuild(bambooUrl string, buildKey string, buildNumber string, jSessionId string, httpClient *http.Client) ScanResult {\n\tdownloadLogsUrl := bambooUrl + \"/download/\" + buildKey + \"-JOB1/build_logs/\" + buildKey + \"-JOB1-\" + buildNumber + \".log?disposition=attachment\"\n\n\t// Download the logs!\n\treq, err := http.NewRequest(\"GET\", downloadLogsUrl, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Add(\"Cookie\", \"JSESSIONID=\"+jSessionId)\n\tresp, err := httpClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif resp.StatusCode != 200 {\n\t\tfmt.Print(\"Failed to download logs from\", downloadLogsUrl)\n\t\treturn nonMatch()\n\t}\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = resp.Body.Close()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tbodyStr := string(body)\n\n\treturn scanString(bodyStr)\n}", "title": "" }, { "docid": "69e6d1623ded0bab7147450e7c4dbaaf", "score": "0.49343574", "text": "func (i InvertIndex) MakeBuild(path string) {\n\tdefer i.wg.Done()\n\tdata, err := file.ReadFile(path)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\ttokens := PrepareTokens(data)\n\tfor _, token := range tokens {\n\t\ti.dataCh <- []string{token, path}\n\t}\n}", "title": "" }, { "docid": "1c9bf6227424e944658d819c0059d720", "score": "0.49310324", "text": "func ReadBuildloggerToChan(ctx context.Context, taskID string, r io.ReadCloser, lines chan<- LogMessage) {\n\tvar (\n\t\tline string\n\t\terr error\n\t)\n\n\tdefer func() {\n\t\tif err := recovery.HandlePanicWithError(recover(), nil, \"read buildlogger to chan\"); err != nil {\n\t\t\tgrip.Error(message.WrapError(err, message.Fields{\n\t\t\t\t\"task_id\": taskID,\n\t\t\t\t\"message\": \"reading buildlogger log lines to LogMessage channel\",\n\t\t\t}))\n\t\t}\n\t}()\n\n\tdefer close(lines)\n\tif r == nil {\n\t\treturn\n\t}\n\n\treader := bufio.NewReader(r)\n\tfor err == nil {\n\t\tline, err = reader.ReadString('\\n')\n\t\tif err != nil && err != io.EOF {\n\t\t\tgrip.Warning(message.WrapError(err, message.Fields{\n\t\t\t\t\"task_id\": taskID,\n\t\t\t\t\"message\": \"problem reading buildlogger log lines\",\n\t\t\t}))\n\t\t\treturn\n\t\t}\n\n\t\tseverity := int(level.Info)\n\t\tif strings.HasPrefix(line, \"[P: \") {\n\t\t\tseverity, err = strconv.Atoi(strings.TrimSpace(line[3:6]))\n\t\t\tif err != nil {\n\t\t\t\tgrip.Error(message.WrapError(err, message.Fields{\n\t\t\t\t\t\"task_id\": taskID,\n\t\t\t\t\t\"message\": \"problem reading buildlogger log line severity\",\n\t\t\t\t}))\n\t\t\t\terr = nil\n\t\t\t}\n\t\t\tline = line[8:]\n\t\t}\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tgrip.Error(message.WrapError(ctx.Err(), message.Fields{\n\t\t\t\t\"task_id\": taskID,\n\t\t\t\t\"message\": \"context error while reading buildlogger log lines\",\n\t\t\t}))\n\t\tcase lines <- LogMessage{\n\t\t\tMessage: strings.TrimSuffix(line, \"\\n\"),\n\t\t\tSeverity: GetSeverityMapping(severity),\n\t\t}:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0d116967c63ba60475442f437e9680bd", "score": "0.49285388", "text": "func (ts *TestService) waitForBuild() error {\n\tf := wait.ConditionFunc(func() (bool, error) {\n\t\terr := ts.reloadBuild()\n\t\tif err == nil {\n\t\t\tif ts.Build.Status.GetCondition(apis.ConditionSucceeded) != nil && ts.Build.Status.GetCondition(apis.ConditionSucceeded).IsTrue() {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\t\treturn false, nil\n\t})\n\terr := wait.Poll(10*time.Second, 240*time.Second, f)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"build never completed for service: %v. Error: %v\", ts.Name, err.Error())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "eb5caf703f61d72aa54a59fc03744ae7", "score": "0.4910644", "text": "func (s BuildService) Build(ctx context.Context, data []byte) (*Result, error) {\n\taid, err := storage.GetArtifactID(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresult := &Result{FileName: aid.Ext(storage.ExtWasm)}\n\tisCached, err := s.storage.HasItem(aid)\n\tif err != nil {\n\t\ts.log.Errorw(\"failed to check cache\", \"artifact\", aid.String(), \"err\", err)\n\t\treturn nil, err\n\t}\n\n\tif isCached {\n\t\t// Just return precompiled result if data is cached already\n\t\ts.log.Debugw(\"build cached, returning cached file\", \"artifact\", aid.String())\n\t\treturn result, nil\n\t}\n\n\terr = s.storage.CreateLocationAndDo(aid, data, func(wasmLocation, sourceLocation string) error {\n\t\treturn s.buildSource(ctx, wasmLocation, sourceLocation)\n\t})\n\n\treturn result, err\n}", "title": "" }, { "docid": "235765d9d39d14232c4007da92bdf0f3", "score": "0.49070054", "text": "func Build() (int, error) {\n\ttype build struct {\n\t\tbuildID int `json:\"build_id\"`\n\t}\n\tdata, err := fetchJSON(\"v1\", \"build\", \"\")\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tvar res build\n\terr = json.Unmarshal(data, &res)\n\treturn res.buildID, err\n}", "title": "" }, { "docid": "104960659040fae20c70bd7d017e05a7", "score": "0.4903254", "text": "func (c *Client) GetBuild(account, repo string, buildNum int) (*Build, error) {\n\tbuild := &Build{}\n\n\terr := c.request(\"GET\", fmt.Sprintf(\"project/%s/%s/%d\", account, repo, buildNum), build, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn build, nil\n}", "title": "" }, { "docid": "15736fbf54770ce39202be0b45b1159c", "score": "0.48916844", "text": "func NewBuild(ctx context.Context) *Build {\n\t//done := make(chan struct{})\n\treturn &Build{\n\t\tctx: ctx,\n\t\ttasks: make(taskstack),\n\t\tlock: sync.Mutex{},\n\t}\n}", "title": "" }, { "docid": "27c9a8b8341f8a209af471d9572a3912", "score": "0.48865217", "text": "func LookupBuild(ctx *pulumi.Context, args *LookupBuildArgs, opts ...pulumi.InvokeOption) (*LookupBuildResult, error) {\n\tvar rv LookupBuildResult\n\terr := ctx.Invoke(\"google-native:cloudbuild/v1:getBuild\", args, &rv, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &rv, nil\n}", "title": "" }, { "docid": "9dc8650aa212f2f620ffcc09d281b7e9", "score": "0.48553622", "text": "func expandBuildTriggerBuild(c *Client, f *BuildTriggerBuild) (map[string]interface{}, error) {\n\tif dcl.IsEmptyValueIndirect(f) {\n\t\treturn nil, nil\n\t}\n\n\tm := make(map[string]interface{})\n\tif v := f.Tags; !dcl.IsEmptyValueIndirect(v) {\n\t\tm[\"tags\"] = v\n\t}\n\tif v := f.Images; !dcl.IsEmptyValueIndirect(v) {\n\t\tm[\"images\"] = v\n\t}\n\tif v := f.Substitutions; !dcl.IsEmptyValueIndirect(v) {\n\t\tm[\"substitutions\"] = v\n\t}\n\tif v := f.QueueTtl; !dcl.IsEmptyValueIndirect(v) {\n\t\tm[\"queueTtl\"] = v\n\t}\n\tif v := f.LogsBucket; !dcl.IsEmptyValueIndirect(v) {\n\t\tm[\"logsBucket\"] = v\n\t}\n\tif v := f.Timeout; !dcl.IsEmptyValueIndirect(v) {\n\t\tm[\"timeout\"] = v\n\t}\n\tif v, err := expandBuildTriggerBuildSecretsSlice(c, f.Secrets); err != nil {\n\t\treturn nil, fmt.Errorf(\"error expanding Secrets into secrets: %w\", err)\n\t} else if !dcl.IsEmptyValueIndirect(v) {\n\t\tm[\"secrets\"] = v\n\t}\n\tif v, err := expandBuildTriggerBuildStepsSlice(c, f.Steps); err != nil {\n\t\treturn nil, fmt.Errorf(\"error expanding Steps into steps: %w\", err)\n\t} else if !dcl.IsEmptyValueIndirect(v) {\n\t\tm[\"steps\"] = v\n\t}\n\tif v, err := expandBuildTriggerBuildSource(c, f.Source); err != nil {\n\t\treturn nil, fmt.Errorf(\"error expanding Source into source: %w\", err)\n\t} else if !dcl.IsEmptyValueIndirect(v) {\n\t\tm[\"source\"] = v\n\t}\n\n\treturn m, nil\n}", "title": "" }, { "docid": "cd9c64af13b745d476933f6de962c29f", "score": "0.4852217", "text": "func ListBuilds(parent context.Context, lister Lister, gcsPath Path, after *Path) ([]Build, error) {\n\tctx, cancel := context.WithCancel(parent)\n\tdefer cancel()\n\tvar offset string\n\tif after != nil {\n\t\toffset = after.Object()\n\t}\n\toffsetBaseName := hackOffset(&offset)\n\tif !strings.HasSuffix(offset, \"/\") {\n\t\toffset += \"/\"\n\t}\n\tit := lister.Objects(ctx, gcsPath, \"/\", offset)\n\tvar all []Build\n\tfor {\n\t\tobjAttrs, err := it.Next()\n\t\tif errors.Is(err, iterator.Done) {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"list objects: %w\", err)\n\t\t}\n\n\t\t// if this is a link under directory/, resolve the build value\n\t\t// This is used for PR type jobs which we store in a PR specific prefix.\n\t\t// The directory prefix contains a link header to the result\n\t\t// under the PR specific prefix.\n\t\tif link := readLink(objAttrs); link != \"\" {\n\t\t\t// links created by bootstrap.py have a space\n\t\t\tlink = strings.TrimSpace(link)\n\t\t\tu, err := url.Parse(link)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parse %s link: %v\", objAttrs.Name, err)\n\t\t\t}\n\t\t\tif !strings.HasSuffix(u.Path, \"/\") {\n\t\t\t\tu.Path += \"/\"\n\t\t\t}\n\t\t\tvar linkPath Path\n\t\t\tif err := linkPath.SetURL(u); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"bad %s link path %s: %w\", objAttrs.Name, u, err)\n\t\t\t}\n\t\t\tall = append(all, Build{\n\t\t\t\tPath: linkPath,\n\t\t\t\tbaseName: path.Base(objAttrs.Name),\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\n\t\tif objAttrs.Prefix == \"\" {\n\t\t\tcontinue // not a symlink to a directory\n\t\t}\n\n\t\tloc := \"gs://\" + gcsPath.Bucket() + \"/\" + objAttrs.Prefix\n\t\tgcsPath, err := NewPath(loc)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"bad path %q: %w\", loc, err)\n\t\t}\n\n\t\tall = append(all, Build{\n\t\t\tPath: *gcsPath,\n\t\t\tbaseName: path.Base(objAttrs.Prefix),\n\t\t})\n\t}\n\n\tSort(all)\n\n\tif offsetBaseName != \"\" {\n\t\t// GCS will return 200 2000 30 for a prefix of 100\n\t\t// testgrid expects this as 2000 200 (dropping 30)\n\t\tfor i, b := range all {\n\t\t\tif sortorder.NaturalLess(b.baseName, offsetBaseName) || b.baseName == offsetBaseName {\n\t\t\t\treturn all[:i], nil // b <= offsetBaseName, so skip this one\n\t\t\t}\n\t\t}\n\t}\n\treturn all, nil\n}", "title": "" }, { "docid": "d6d21a04ae222c9b5715d38356f7833a", "score": "0.48216808", "text": "func (repo *Repository) Read(path, revision string) (io.ReadCloser, error) {\n\tif revision == \"\" || strings.EqualFold(revision, \"head\") {\n\t\trevision = \"HEAD\"\n\t}\n\n\ttree, err := repo.gr.GetTree(revision)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tblob, err := tree.GetBlobByPath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn blob.DataAsync()\n}", "title": "" }, { "docid": "fd9dedf65992e156c11b26f014889df9", "score": "0.48209712", "text": "func Build() error {\n\treturn build.Build()\n}", "title": "" }, { "docid": "7951a1be5b0fb611411606ccf34fe199", "score": "0.48138195", "text": "func (m *manager) build(event fsnotify.Event) {\n\tm.gil.Do(func() {\n\n\t\tdefer func() {\n\t\t\tm.gil = &sync.Once{}\n\t\t}()\n\n\t\tm.buildTransaction(func() error {\n\t\t\ttime.Sleep(m.BuildDelay * time.Millisecond)\n\n\t\t\tnow := time.Now()\n\t\t\tlogrus.Infof(\"Rebuild on: %s\", event.Name)\n\n\t\t\targs := []string{\"build\", \"-v\"}\n\t\t\targs = append(args, \"-o\", m.FullBuildPath(), m.BuildTargetPath)\n\t\t\tcmd := exec.Command(\"go\", args...)\n\n\t\t\tif err := m.runAndListen(cmd); err != nil {\n\t\t\t\tif strings.Contains(err.Error(), \"no buildable Go source files\") {\n\t\t\t\t\tm.cancelFunc()\n\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\ttt := time.Since(now)\n\t\t\tlogrus.Infof(\"Building Completed (PID: %d) (Time: %s)\", cmd.Process.Pid, tt)\n\t\t\tm.Restart <- true\n\t\t\treturn nil\n\t\t})\n\t})\n}", "title": "" }, { "docid": "73bab6419e303a06b6d8d62b29262544", "score": "0.47973555", "text": "func (r *ReconcileVirtualDatabase) triggerBuild(bc obuildv1.BuildConfig, cr *v1alpha1.VirtualDatabase) error {\n\tlog := log.With(\"kind\", \"BuildConfig\", \"name\", bc.GetName(), \"namespace\", bc.GetNamespace())\n\tbuildConfig, err := r.buildClient.BuildConfigs(bc.Namespace).Get(bc.Name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif buildConfig.Spec.Source.Type == obuildv1.BuildSourceBinary {\n\t\tfiles := map[string]string{}\n\t\t// Create list of files to archive\n\t\tfor _, file := range cr.Spec.Build.SourceFileChanges {\n\t\t\tfiles[file.RelativePath] = file.Contents\n\t\t}\n\t\ttarReader, err := shared.Tar(files)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tisName := buildConfig.Spec.Strategy.SourceStrategy.From.Name\n\t\t_, err = r.imageClient.ImageStreamTags(buildConfig.Namespace).Get(isName, metav1.GetOptions{})\n\t\tif err != nil && errors.IsNotFound(err) {\n\t\t\tlog.Warn(isName, \" ImageStreamTag does not exist yet and is required for this build.\")\n\t\t} else if err != nil {\n\t\t\treturn err\n\t\t} else {\n\t\t\tbinaryBuildRequest := obuildv1.BinaryBuildRequestOptions{ObjectMeta: metav1.ObjectMeta{Name: buildConfig.Name}}\n\t\t\tbinaryBuildRequest.SetGroupVersionKind(obuildv1.SchemeGroupVersion.WithKind(\"BinaryBuildRequestOptions\"))\n\t\t\tlog.Info(\"Triggering binary build \", buildConfig.Name)\n\t\t\terr = r.buildClient.RESTClient().Post().\n\t\t\t\tNamespace(cr.Namespace).\n\t\t\t\tResource(\"buildconfigs\").\n\t\t\t\tName(buildConfig.Name).\n\t\t\t\tSubResource(\"instantiatebinary\").\n\t\t\t\tBody(tarReader).\n\t\t\t\tVersionedParams(&binaryBuildRequest, scheme.ParameterCodec).\n\t\t\t\tDo().\n\t\t\t\tInto(&obuildv1.Build{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbuildRequest := obuildv1.BuildRequest{ObjectMeta: metav1.ObjectMeta{Name: buildConfig.Name}}\n\t\tbuildRequest.SetGroupVersionKind(obuildv1.SchemeGroupVersion.WithKind(\"BuildRequest\"))\n\t\tbuildRequest.TriggeredBy = []obuildv1.BuildTriggerCause{{Message: fmt.Sprintf(\"Triggered by %s operator\", cr.Kind)}}\n\t\tlog.Info(\"Triggering build \", buildConfig.Name)\n\t\t_, err := r.buildClient.BuildConfigs(buildConfig.Namespace).Instantiate(buildConfig.Name, &buildRequest)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1b3d4fa225a80ceeaf75ac645eb2a8d3", "score": "0.4790174", "text": "func Build(name string) {\n\n\t// Build directory structure\n\tDirectories(name);\n\n\t// Populate with basic files.\n\tFiles(name);\n}", "title": "" }, { "docid": "443af03817bc8081e85cea2fb66e0c70", "score": "0.47845906", "text": "func (r *LagoonBuildReconciler) getOrCreateBuildResource(ctx context.Context, build *lagoonv1alpha1.LagoonBuild, ns string) error {\n\tnewBuild := build.DeepCopy()\n\tnewBuild.SetNamespace(ns)\n\tnewBuild.SetResourceVersion(\"\")\n\tnewBuild.SetLabels(\n\t\tmap[string]string{\n\t\t\t\"lagoon.sh/buildStatus\": \"Pending\",\n\t\t\t\"lagoon.sh/controller\": r.ControllerNamespace,\n\t\t},\n\t)\n\terr := r.Get(ctx, types.NamespacedName{\n\t\tNamespace: ns,\n\t\tName: newBuild.ObjectMeta.Name,\n\t}, newBuild)\n\tif err != nil {\n\t\tif err := r.Create(ctx, newBuild); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\terr = r.Delete(ctx, build)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "194326c66573cbb38144747b21dc6afd", "score": "0.47787267", "text": "func RunBuild(buildPath string, settings *config.Site) error {\n\tfiles := make(chan string)\n\tcontentPath := filepath.Join(buildPath, config.ContentDir)\n\n\tgo func() {\n\t\t_ = filesystem.Stream(contentPath, filesystem.MarkdownOnly, files)\n\t}()\n\n\tsite := build.Run(build.Context{\n\t\tBuildPath: buildPath,\n\t\tSettings: settings,\n\t\tParser: parser.NewMarkdown(),\n\t}, files)\n\n\tif err := render.AsWebsite(render.Context{\n\t\tTemplateDir: filepath.Join(buildPath, config.TemplateDir),\n\t\tAssetDir: filepath.Join(buildPath, config.AssetDir),\n\t\tTargetDir: filepath.Join(buildPath, config.TargetDir),\n\t}, site); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1cca240ec791b4a240dd7f73f67d33c3", "score": "0.4777619", "text": "func (b *Build) Download(w io.Writer) error {\n\tresp, err := http.Get(b.URL)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\t_, err = io.Copy(w, resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1ed6335b93fc5cc608c2a8d45018f675", "score": "0.47768143", "text": "func Read(req handler.Request, prevModel *Model, currentModel *Model) (handler.ProgressEvent, error) {\n\t//spew.Dump(currentModel)\n\tclient, err := util.CreateMongoDBClient(*currentModel.ApiKeys.PublicKey, *currentModel.ApiKeys.PrivateKey)\n\tif err != nil {\n\t\t//return handler.ProgressEvent{}, err\n return handler.ProgressEvent{\n Message: err.Error(),\n HandlerErrorCode: cloudformation.HandlerErrorCodeNotFound}, err\n\t}\n\n\tname := *currentModel.Name\n\n\tif len(name) > 0 {\n\t\tproject, _, err := client.Projects.GetOneProjectByName(context.Background(), name)\n\t\tif err != nil {\n return handler.ProgressEvent{\n OperationStatus: handler.Failed,\n Message: \"Resource Not Found\",\n HandlerErrorCode: cloudformation.HandlerErrorCodeNotFound}, nil\n }\n currentModel.Name = &project.Name\n\t\tcurrentModel.OrgId = &project.OrgID\n\t\tcurrentModel.Created = &project.Created\n\t\tcurrentModel.ClusterCount = &project.ClusterCount\n\n\t\tif err == nil {\n\t\t\treturn handler.ProgressEvent{\n\t\t\t\tOperationStatus: handler.Success,\n\t\t\t\tMessage: \"Read Complete\",\n\t\t\t\tResourceModel: currentModel,\n\t\t\t}, nil\n\t\t}\n\t}\n\n\tid := *currentModel.Id\n\tlog.Printf(\"Looking for project: %s\", id)\n\tproject, _, err := client.Projects.GetOneProject(context.Background(), id)\n\tif err != nil {\n\t\t//return handler.ProgressEvent{}, fmt.Errorf(\n log.Printf(\"Read - error reading project with id(%s): %s\", id, err)\n return handler.ProgressEvent{\n OperationStatus: handler.Failed,\n Message: \"Resource Not Found\",\n HandlerErrorCode: cloudformation.HandlerErrorCodeNotFound}, nil\n\t}\n\n\tcurrentModel.Name = &project.Name\n\tcurrentModel.OrgId = &project.OrgID\n\tcurrentModel.Created = &project.Created\n\tcurrentModel.ClusterCount = &project.ClusterCount\n\n\treturn handler.ProgressEvent{\n\t\tOperationStatus: handler.Success,\n\t\tMessage: \"Read Complete\",\n\t\tResourceModel: currentModel,\n\t}, nil\n}", "title": "" }, { "docid": "43c96c7cdc271e27d593c29c97e99f90", "score": "0.47760105", "text": "func Build(builders []Builder) ([]Artifact, error) {\n\tdur, err := time.ParseDuration(\"1s\")\n\tif err != nil {\n\t\treturn nil, utils.FormatError(err)\n\t}\n\n\truntime.GOMAXPROCS(runtime.NumCPU() - 1)\n\n\tvar artifacts []Artifact\n\tch := make(chan *buildResult, len(builders))\n\n\tfor _, b := range builders {\n\t\ttime.Sleep(dur)\n\t\tgo func(b Builder) {\n\t\t\tartifact, err := b.Run()\n\t\t\t// Forwards created artifact to the channel.\n\t\t\tch <- &buildResult{artifact, err}\n\t\t}(b)\n\t}\n\tfor i := 0; i < len(builders); i++ {\n\t\tselect {\n\t\tcase result := <-ch:\n\t\t\tif result.err != nil {\n\t\t\t\t//defer close(ch)\n\t\t\t\treturn nil, utils.FormatError(result.err)\n\t\t\t}\n\t\t\tartifacts = append(artifacts, result.artifact)\n\t\t}\n\t}\n\treturn artifacts, nil\n}", "title": "" }, { "docid": "fd4285eb48740c8b18a1491fb8fdf4dd", "score": "0.4767398", "text": "func (r *Repo) Read(filename string) ([]byte, error) {\n\treturn ioutil.ReadFile(filepath.Join(r.location, filename))\n}", "title": "" }, { "docid": "5b8fdfbe4c02b79bc5fcdde46329d781", "score": "0.47616124", "text": "func ReadBuildloggerToSlice(ctx context.Context, taskID string, r io.ReadCloser) []LogMessage {\n\tlines := []LogMessage{}\n\tlineChan := make(chan LogMessage, 1024)\n\tgo ReadBuildloggerToChan(ctx, taskID, r, lineChan)\n\n\tfor {\n\t\tline, more := <-lineChan\n\t\tif !more {\n\t\t\tbreak\n\t\t}\n\n\t\tlines = append(lines, line)\n\t}\n\n\treturn lines\n}", "title": "" }, { "docid": "00d13c6542d31b2604858c1e2ab6872d", "score": "0.47572395", "text": "func fetchRemoteFile(state *core.BuildState, target *core.BuildTarget) error {\n\thttpClientOnce.Do(func() {\n\t\thttpClient = retryablehttp.NewClient()\n\t\thttpClient.Logger = &cli.HTTPLogWrapper{Log: log}\n\n\t\tif state.Config.Build.HTTPProxy != \"\" {\n\t\t\thttpClient.HTTPClient.Transport = &http.Transport{\n\t\t\t\tProxy: http.ProxyURL(state.Config.Build.HTTPProxy.AsURL()),\n\t\t\t}\n\t\t}\n\n\t\thttpClient.HTTPClient.Timeout = time.Duration(state.Config.Build.Timeout)\n\t\thttpClientLimiter = make(chan struct{}, state.Config.Build.ParallelDownloads)\n\t})\n\n\tif err := prepareDirectory(state.ProcessExecutor, target.OutDir(), false); err != nil {\n\t\treturn err\n\t} else if err := prepareDirectory(state.ProcessExecutor, target.TmpDir(), false); err != nil {\n\t\treturn err\n\t}\n\tvar err error\n\tfor _, src := range target.Sources {\n\t\tif e := fetchOneRemoteFile(state, target, src.String()); e != nil {\n\t\t\terr = multierror.Append(err, e)\n\t\t} else {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "ed83449e0f809edb8e1b3930809cba3e", "score": "0.47384158", "text": "func (c *Client) Build(account, repo, branch string) (*Build, error) {\n\tbuild := &Build{}\n\n\terr := c.request(\"POST\", fmt.Sprintf(\"project/%s/%s/tree/%s\", account, repo, branch), build, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn build, nil\n}", "title": "" }, { "docid": "10ba6a6a911913878fa755593e1b938d", "score": "0.47335562", "text": "func createBuild(build *buildv1alpha1.Build) *buildv1alpha1.Build {\n\tExpect(k8sClient.Create(context.Background(), build)).Should(Succeed())\n\tvar createdBuild buildv1alpha1.Build\n\tEventually(func() error {\n\t\treturn k8sClient.Get(context.Background(), namespacedName(build), &createdBuild)\n\t}, \"5s\", \"100ms\").Should(Succeed())\n\treturn &createdBuild\n}", "title": "" }, { "docid": "c5f94ef060e8985e4708685137b26acf", "score": "0.47286385", "text": "func (jenkins *Jenkins) GetBuild(job Job, number int) (build Build, err error) {\n\terr = jenkins.getUrl(fmt.Sprintf(\"%s%d\", job.Url, number), nil, &build)\n\treturn\n}", "title": "" }, { "docid": "aa55a7ce83815a0bbd4e687afbe43769", "score": "0.47223315", "text": "func (s *Server) TriggerBuild(r *BuildRequest) (*BuildResponse, error) {\n\treq, err := http.NewRequest(\"POST\", fmt.Sprintf(\"%s/job/%s/build\", s.URL, r.BuildID), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tauth := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf(\"%s:%s\", s.User, s.AuthToken)))\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Basic %s\", auth))\n\n\tc := &http.Client{}\n\n\tres, err := c.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"%+v\\n\\n\", res)\n\tdefer res.Body.Close()\n\n\tmsg, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"%+v\\n\\n\", string(msg))\n\n\treturn &BuildResponse{\n\t\tHTTPStatusCode: res.StatusCode,\n\t\tHTTPStatusMessage: res.Status,\n\t\tJenkinsResponse: string(msg),\n\t}, nil\n}", "title": "" }, { "docid": "9cf430b509b4dcc7140495ee3b2e172e", "score": "0.47210935", "text": "func (c *Client) GetBuild(buildId string) (*Build, error) {\n\turl := apiUrl + \"/builds/\" + buildId + \"?alt=json\"\n\tresp, err := c.Get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer util.Close(resp.Body)\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"Request got response %s\", resp.Status)\n\t}\n\tvar result struct {\n\t\tBuild *Build `json:\"build\"`\n\t}\n\tif err := json.NewDecoder(resp.Body).Decode(&result); err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.Build, nil\n}", "title": "" }, { "docid": "3abb9ca975cb82b31729eb9ee572ef45", "score": "0.47127333", "text": "func (h *Handler) ProcessBuild() http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\t\tw.Header().Set(\"Access-Control-Allow-Methods\", \"POST, GET, OPTIONS\")\n\t\tw.Header().Set(\"Access-Control-Allow-Headers\", \"Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization\")\n\t\trequest := &ProcessRequest{\n\t\t\tRecrawl: false,\n\t\t}\n\t\tbody, err := ioutil.ReadAll(io.LimitReader(r.Body, 1048576))\n\t\tif err != nil {\n\t\t\thandleError(err, w, \"unable to read payload\")\n\t\t\treturn\n\t\t}\n\t\terr = json.Unmarshal(body, &request)\n\t\tif err != nil {\n\t\t\thandleError(err, w, \"unable to deserialize payload\")\n\t\t\treturn\n\t\t}\n\t\tif request.BuildURL == \"\" {\n\t\t\thandleError(err, w, \"build_url is required\")\n\t\t\treturn\n\t\t}\n\t\tif request.BuildID == \"\" {\n\t\t\trequest.BuildID = uuid.New().String()\n\t\t}\n\n\t\texists, err := h.database.Has(request.BuildID)\n\t\tif err != nil {\n\t\t\tlogrus.WithError(err).Warn(\"unable to check for existance of database entry\")\n\t\t}\n\t\tif !exists {\n\t\t\tif resp0, err := http.Head(request.BuildURL); err != nil || resp0.StatusCode != http.StatusOK {\n\t\t\t\twriteJSON(http.StatusBadRequest, \"error checking build_url\", w)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\turl := absURL(r, fmt.Sprintf(\"/api/v1/build/%s\", request.BuildID), h.config)\n\t\tresponse := &ProcessResponse{\n\t\t\tLocation: url,\n\t\t}\n\t\tif exists && !request.Recrawl {\n\t\t\twriteJSON(http.StatusFound, response, w)\n\t\t\treturn\n\t\t}\n\t\tif exists && request.Recrawl {\n\t\t\th.database.Remove(request.BuildID)\n\t\t}\n\n\t\tgo func() {\n\t\t\tcrawler := h.crawlerCreator(h.database, h.config)\n\t\t\tcrawler.CrawlJenkins(request.BuildURL, request.BuildID)\n\t\t}()\n\t\twriteJSON(http.StatusCreated, response, w)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "e1e39838166eb0f05781cc751d39c36f", "score": "0.4693868", "text": "func goBuild(name, outputPath, relCodePath string, errChan chan error) {\n\n\t// $ go get\n\n\tgoGetExec := exec.Command(\n\t\t\"go\",\n\t\t\"get\",\n\t\t\"-d\",\n\t\t\"-v\",\n\t\t\"./\"+relCodePath,\n\t)\n\n\terr := goGetExec.Run()\n\n\tif err != nil {\n\t\terrChan <- errors.Wrapf(err, \"could not $ go get %v\", relCodePath)\n\t\treturn\n\t}\n\n\t// $ go build\n\n\tgoBuildExec := exec.Command(\n\t\t\"go\",\n\t\t\"build\",\n\t\t\"-o\",\n\t\toutputPath+\"/\"+name,\n\t\t\"./\"+relCodePath,\n\t)\n\n\toutBytes, err := goBuildExec.CombinedOutput()\n\tif err != nil {\n\t\terrChan <- errors.Wrapf(err, \"could not $ go build %v. \\nOutput: \\n%s\\n\", relCodePath, string(outBytes))\n\t\treturn\n\t}\n\n\terrChan <- nil\n}", "title": "" }, { "docid": "75d3e0c93fa4eb756e6c69ba3e36e013", "score": "0.4691161", "text": "func (c *ApiController) NewBuild() {\n\tlog.Info(\"New build record\")\n\n\tproject := models.Project{}\n\n\tif err := json.Unmarshal(c.Ctx.Input.RequestBody, &project); err != nil {\n\t\tc.Ctx.Output.SetStatus(400)\n\t\tc.Ctx.Output.Body([]byte(\"empty title\"))\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tmodels.AddBuildWithProject(project)\n}", "title": "" }, { "docid": "af3ab0a14de27753883e0b6584d910e9", "score": "0.4679996", "text": "func (cli *MockClient) Build(bld *domain.BuildRequest) (string, error) {\n\tif bld.BoardID == \"error\" {\n\t\treturn \"\", fmt.Errorf(\"MOCK error building image\")\n\t}\n\treturn \"\", nil\n}", "title": "" }, { "docid": "f8af439a4deef10b16be91252f802393", "score": "0.4677677", "text": "func getBuilds(tx *bolt.Tx, ids []BuildID, stop <-chan struct{}) ([]*Build, error) {\n\trv := make([]*Build, 0, len(ids))\n\tfor _, id := range ids {\n\t\tif err := checkInterrupt(stop); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tb, err := getBuild(tx, id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := checkInterrupt(stop); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trv = append(rv, b)\n\t}\n\treturn rv, nil\n}", "title": "" }, { "docid": "46249e31d53ed5aacd39d075fd5b0c87", "score": "0.46761551", "text": "func Read(req handler.Request, prevModel *Model, currentModel *Model) (handler.ProgressEvent, error) {\n\tclient, err := util.CreateMongoDBClient(*currentModel.ApiKeys.PublicKey, *currentModel.ApiKeys.PrivateKey)\n\tif err != nil {\n\t\treturn handler.ProgressEvent{}, err\n\t}\n\n\tprojectId := *currentModel.ProjectId\n\tsnapshotId := *currentModel.Id\n\tsnapshotRequest := &matlasClient.SnapshotReqPathParameters{\n\t\tGroupID: projectId,\n\t\tSnapshotID: snapshotId,\n\t\tClusterName: *currentModel.ClusterName,\n\t}\n\n\tsnapshot, _, err := client.CloudProviderSnapshots.GetOneCloudProviderSnapshot(context.Background(), snapshotRequest)\n\tif err != nil {\n\t\treturn handler.ProgressEvent{}, fmt.Errorf(\"error reading cloud provider snapshot with id(project: %s, snapshot: %s): %s\", projectId, snapshotId, err)\n\t}\n\n\tcurrentModel.Id = &snapshot.ID\n\tcurrentModel.Description = &snapshot.Description\n\tcurrentModel.RetentionInDays = &snapshot.RetentionInDays\n\tcurrentModel.Status = &snapshot.Status\n\tcurrentModel.Type = &snapshot.Type\n\tcurrentModel.CreatedAt = &snapshot.CreatedAt\n\tcurrentModel.MasterKeyUuid = &snapshot.MasterKeyUUID\n\tcurrentModel.MongoVersion = &snapshot.MongodVersion\n\tcurrentModel.StorageSizeBytes = &snapshot.StorageSizeBytes\n\n\treturn handler.ProgressEvent{\n\t\tOperationStatus: handler.Success,\n\t\tMessage: \"Read Complete\",\n\t\tResourceModel: currentModel,\n\t}, nil\n}", "title": "" }, { "docid": "d8d5c83cb40e074c6a592dcd27793662", "score": "0.4671542", "text": "func unmarshalBuildTrigger(b []byte, c *Client) (*BuildTrigger, error) {\n\tvar m map[string]interface{}\n\tif err := json.Unmarshal(b, &m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn unmarshalMapBuildTrigger(m, c)\n}", "title": "" }, { "docid": "cfb380fd1d5db6dade3573924b002c7c", "score": "0.46701875", "text": "func (d *GoogleGCSDownloader) GetFile(job string, buildNumber int, filePath string) (io.ReadCloser, error) {\n\tresponse, err := d.GoogleGCSBucketUtils.GetFileFromJenkinsGoogleBucket(job, buildNumber, filePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn response.Body, nil\n}", "title": "" }, { "docid": "8867c7059277a061cef11f46552f027a", "score": "0.46678028", "text": "func getBuild(tx *bolt.Tx, id BuildID) (*Build, error) {\n\tserialized := tx.Bucket(BUCKET_BUILDS).Get(id)\n\tif serialized == nil {\n\t\treturn nil, fmt.Errorf(\"No such build in DB: %s\", id)\n\t}\n\tvar b Build\n\tif err := gob.NewDecoder(bytes.NewBuffer(serialized)).Decode(&b); err != nil {\n\t\treturn nil, err\n\t}\n\tb.fixup()\n\treturn &b, nil\n}", "title": "" }, { "docid": "6c759b8fe0c091b6a6156f0db355cac7", "score": "0.4650713", "text": "func CreateBuild(job *Job, jobPath string) (*Build, error) {\n\tvar counti int\n\terr := DB.Update(func(tx *bolt.Tx) error {\n\t\tvar err error\n\t\tgb := tx.Bucket([]byte(GlobalBucket))\n\t\tcount := gb.Get([]byte(\"count\"))\n\t\tif count == nil {\n\t\t\tcounti = 1\n\t\t} else {\n\t\t\tcounti, err = ByteToInt(count)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcounti++\n\t\t}\n\t\tgb.Put([]byte(\"count\"), []byte(strconv.Itoa(counti)))\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbuild := Build{\n\t\tJob: job,\n\t\tID: counti,\n\t\tabortedChannel: make(chan string),\n\t\tflushChannel: make(chan bool),\n\t\tParams: job.DefaultParams,\n\t\tETA: GetJobETA(job.Name),\n\t}\n\tbuild.Logger = log.New(os.Stdout, fmt.Sprintf(\"[build #%d] \", build.ID), log.Lmicroseconds|log.Lshortfile)\n\n\t// Create workspace\n\terr = os.MkdirAll(build.GetWorkspaceDir(), os.ModePerm)\n\tif err != nil {\n\t\tbuild.Logger.Println(err)\n\t\treturn nil, err\n\t}\n\tbuild.Logger.Printf(\"Workspace %s has been created\\n\", build.GetWorkspaceDir())\n\n\t// Create wakespace\n\terr = os.MkdirAll(build.GetWakespaceDir(), os.ModePerm)\n\tif err != nil {\n\t\tbuild.Logger.Println(err)\n\t\treturn nil, err\n\t}\n\tbuild.Logger.Printf(\"Wakespace %s has been created\\n\", build.GetWakespaceDir())\n\n\t// Create artifacts dir\n\terr = os.MkdirAll(build.GetArtifactsDir(), os.ModePerm)\n\tif err != nil {\n\t\tbuild.Logger.Println(err)\n\t\treturn nil, err\n\t}\n\n\tinput, err := yaml.Marshal(build.Job)\n\tif err != nil {\n\t\tbuild.Logger.Println(err)\n\t\treturn nil, err\n\t}\n\n\terr = ioutil.WriteFile(build.GetBuildConfigFilename(), input, os.ModePerm)\n\tif err != nil {\n\t\tbuild.Logger.Println(err)\n\t\treturn nil, err\n\t}\n\tbuild.Logger.Printf(\"Build config %s has been created\\n\", build.GetBuildConfigFilename())\n\n\tbuild.SetBuildStatus(StatusPending)\n\treturn &build, nil\n}", "title": "" }, { "docid": "87a6215fb13f83ca561cf3bb6c3e7c75", "score": "0.46476242", "text": "func BuildProgress(c *CommonData, builders []Builder) (artifacts []Artifact, err error) {\n\tif c.Ui == nil {\n\t\treturn Build(builders)\n\t}\n\terrChan := make(chan error)\n\tdefer close(errChan)\n\tgo func() {\n\t\tartifacts, err = Build(builders)\n\t\terrChan <- err\n\t}()\n\n\tprogressBarTitle := \"Building artifacts\"\n\tprogressBarMsg := \"\\n\" + c.VaName + \" installation in progress.Please wait...\"\n\tif err = c.Ui.Progress(progressBarTitle, progressBarMsg, c.Ui.Pb.Sleep(), c.Ui.Pb.Step(), errChan); err != nil {\n\t\terr = utils.FormatError(err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "a0bb3de00139f1922dbc5f192a6c8a26", "score": "0.46447438", "text": "func (m *Manager) Sync() error {\n\n\tif len(m.BuildServers) == 0 {\n\t\treturn errors.New(\"no repositories found\")\n\t}\n\n\tfetcher, enricher, esClientProvider, err := buildServices(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !m.EnrichOnly {\n\t\tlog.Printf(\"Jenkins: Fetching data for %v\\n\", m.BuildServers)\n\t\tdata := make([]elastic.BulkData, 0)\n\t\t// fetch data\n\t\tfor _, buildServer := range m.BuildServers {\n\t\t\tlog.Printf(\"Fetching data for %s project: %s endpoint\", buildServer.Project, buildServer.URL)\n\t\t\tvar raw []BuildsRaw\n\t\t\t// Fetch data for single build\n\t\t\traw, err = fetcher.FetchItem(&Params{\n\t\t\t\tJenkinsURL: buildServer.URL,\n\t\t\t\tUsername: buildServer.Username,\n\t\t\t\tPassword: buildServer.Password,\n\t\t\t\tDepth: Depth,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not fetch data from repository: %s-%s\", buildServer.URL, buildServer.Project)\n\t\t\t}\n\t\t\tfor _, builds := range raw {\n\t\t\t\tdata = append(data, elastic.BulkData{IndexName: fmt.Sprintf(\"%s-raw\", buildServer.Index), ID: builds.UUID, Data: builds})\n\t\t\t}\n\n\t\t\tlog.Printf(\"Successfully fetched %d documents for %s project : %s endpoint\\n\", len(raw), buildServer.Project, buildServer.URL)\n\t\t\t// set mapping and create index if not exists\n\t\t\t_ = fetcher.HandleMapping(fmt.Sprintf(\"%s-raw\", buildServer.Index))\n\t\t}\n\n\t\tif len(data) > 0 {\n\t\t\t// Insert raw data to elasticsearch\n\t\t\t// Process in bulk\n\t\t\tlog.Println(\"Exporting fetched builds to raw indices\")\n\t\t\tfor start := 0; start < len(data); start += m.BulkSize {\n\t\t\t\tend := start + m.BulkSize\n\t\t\t\tif end > len(data) {\n\t\t\t\t\tend = len(data)\n\t\t\t\t}\n\t\t\t\tbatch := data[start:end]\n\t\t\t\t_, err := esClientProvider.BulkInsert(batch)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Println(\"Error while BulkInsert in Jenkins enrich index: \", err)\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tlog.Printf(\"Jenkins: Exported %d documents to raw index\\n\", len(batch))\n\t\t\t}\n\t\t\tlog.Println(\"Completed the export for jenkins raw builds.\")\n\t\t}\n\t}\n\n\tif m.Enrich || m.EnrichOnly {\n\t\tlog.Printf(\"Jenkins: Enriching data for %v\\n\", m.BuildServers)\n\t\tdata := make([]elastic.BulkData, 0)\n\t\tfor _, buildServer := range m.BuildServers {\n\t\t\tlog.Printf(\"Enriching data for %s project: %s endpoint\\n\", buildServer.Project, buildServer.URL)\n\t\t\tvar fromDate *time.Time\n\t\t\tvar lastDate time.Time\n\t\t\tif m.FromDate == nil || (*m.FromDate).IsZero() {\n\t\t\t\tlastDate, err = fetcher.GetLastDate(*buildServer, time.Now())\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Println(\"[GetLastDate] could not get last date\")\n\t\t\t\t\tlastDate = DefaultDateTime\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfromDate = m.FromDate\n\t\t\t}\n\t\t\tesData, err := enricher.GetFetchedDataItem(buildServer, fromDate, &lastDate, m.NoIncremental)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif len(esData.Hits.Hits) > 0 {\n\t\t\t\t// Enrich data for all the builds fetched from raw\n\t\t\t\tfor _, hit := range esData.Hits.Hits {\n\t\t\t\t\tenriched, err := enricher.EnrichItem(*hit.Source, buildServer.Project, time.Now())\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"could not enrich data from repository: %s-%s\", buildServer.Project, buildServer.URL)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tdata = append(data, elastic.BulkData{IndexName: buildServer.Index, ID: enriched.UUID, Data: *enriched})\n\t\t\t\t}\n\t\t\t\t_ = enricher.HandleMapping(buildServer.Index)\n\t\t\t}\n\t\t\tlog.Printf(\"Successfully enriched %d documents for %s project : %s endpoint\\n\", len(data), buildServer.Project, buildServer.URL)\n\t\t}\n\n\t\tif len(data) > 0 {\n\t\t\t// Insert enriched data to elasticsearch\n\t\t\tlog.Println(\"Exporting enriched builds to enriched indices\")\n\n\t\t\t// Process in bulk\n\t\t\tfor start := 0; start < len(data); start += m.BulkSize {\n\t\t\t\tend := start + m.BulkSize\n\t\t\t\tif end > len(data) {\n\t\t\t\t\tend = len(data)\n\t\t\t\t}\n\t\t\t\tbatch := data[start:end]\n\t\t\t\t_, err := esClientProvider.BulkInsert(batch)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Println(\"Error while BulkInsert in Jenkins enrich index: \", err)\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tlog.Printf(\"Exported %d documents\", len(batch))\n\t\t\t}\n\t\t\tlog.Println(\"Completed the export for jenkins enriched builds.\")\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5a701bb0555ce50fcf74b04073df3c4b", "score": "0.46445188", "text": "func (c *Client) BuildFromID(id int) (*Build, error) {\n\tv := &Build{}\n\tif err := c.doRequest(\"GET\", path.Join(buildsPath, locate.ById(strconv.Itoa(id)).String()), \"\", nil, v); err != nil {\n\t\treturn nil, err\n\t}\n\treturn v, nil\n}", "title": "" }, { "docid": "0239a6ba8d31d91d8cf8990213e411cb", "score": "0.46430668", "text": "func (rb *InProgressBuilder) Build() InProgress {\n\treturn *rb.v\n}", "title": "" }, { "docid": "70c37e4bf8068162dfe436a9085ee527", "score": "0.46394083", "text": "func (op *ApproveBuildOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cloudbuildpb.Build, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp cloudbuildpb.Build\n\tif err := op.lro.Poll(ctx, &resp, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\tif !op.Done() {\n\t\treturn nil, nil\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "a3ca978fce55c055c038be74082886b2", "score": "0.46378848", "text": "func ExampleBuildServiceClient_GetBuild() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclientFactory, err := armappplatform.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := clientFactory.NewBuildServiceClient().GetBuild(ctx, \"myResourceGroup\", \"myservice\", \"default\", \"mybuild\", nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\t// You could use response here. We use blank identifier for just demo purposes.\n\t_ = res\n\t// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// res.Build = armappplatform.Build{\n\t// \tName: to.Ptr(\"123\"),\n\t// \tType: to.Ptr(\"Microsoft.AppPlatform/Spring/buildServices/builds/results\"),\n\t// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builds/mybuild/results/123\"),\n\t// \tSystemData: &armappplatform.SystemData{\n\t// \t\tCreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2021-08-11T03:16:03.944Z\"); return t}()),\n\t// \t\tCreatedBy: to.Ptr(\"sample-user\"),\n\t// \t\tCreatedByType: to.Ptr(armappplatform.CreatedByTypeUser),\n\t// \t\tLastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2021-08-11T03:17:03.944Z\"); return t}()),\n\t// \t\tLastModifiedBy: to.Ptr(\"sample-user\"),\n\t// \t\tLastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser),\n\t// \t},\n\t// \tProperties: &armappplatform.BuildProperties{\n\t// \t\tAgentPool: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default\"),\n\t// \t\tBuilder: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default\"),\n\t// \t\tEnv: map[string]*string{\n\t// \t\t\t\"environmentVariable\": to.Ptr(\"test\"),\n\t// \t\t},\n\t// \t\tProvisioningState: to.Ptr(armappplatform.BuildProvisioningStateSucceeded),\n\t// \t\tRelativePath: to.Ptr(\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777\"),\n\t// \t\tResourceRequests: &armappplatform.BuildResourceRequests{\n\t// \t\t\tCPU: to.Ptr(\"1\"),\n\t// \t\t\tMemory: to.Ptr(\"2Gi\"),\n\t// \t\t},\n\t// \t},\n\t// }\n}", "title": "" }, { "docid": "a9b004bee78486a8380fa5283abc6461", "score": "0.4636942", "text": "func (r *Repo) Read() error {\n\tr.Init(r.Name(), r.downloader)\n\n\tyc, err := config.ReadFile(r.repoFilePath() + \"/\" + REPO_FILE_NAME)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.loadSubmoduleConfig(yc); err != nil {\n\t\treturn err\n\t}\n\n\tversMap, err := yc.GetValStringMapString(\"repo.versions\", nil)\n\tutil.OneTimeWarningError(err)\n\n\tfor versStr, commit := range versMap {\n\t\tlog.Debugf(\"Printing version %s for remote repo %s\", versStr, r.name)\n\t\tvers, err := newtutil.ParseRepoVersion(versStr)\n\t\tif err != nil {\n\t\t\treturn util.PreNewtError(err,\n\t\t\t\t\"failure parsing version for repo \\\"%s\\\"\", r.Name())\n\t\t}\n\n\t\t// store commit->version mapping\n\t\tr.vers[vers] = commit\n\t}\n\n\tif err := r.readDepRepos(yc); err != nil {\n\t\treturn err\n\t}\n\n\t// Read the newt version compatibility map.\n\tr.ncMap, err = compat.ReadNcMap(yc)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c26a10f6e587cac1b8e82e3d9059b7bf", "score": "0.4635936", "text": "func (s *ModpackService) GetBuild(slug string, version string) (*Build, error) {\n\trequest, err := s.client.NewRequest(http.MethodGet, \"modpack/\" + slug + \"/\" + version + \"/\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response Build\n\t_, err = s.client.Do(request, &response)\n\treturn &response, err\n}", "title": "" }, { "docid": "6269317c6e948aa02f45aabb61cd2e84", "score": "0.46276686", "text": "func (c *Client) RequestBuild(builder, master, commit, repo, author, swarmingBotId string) (*Build, error) {\n\tp := Parameters{\n\t\tBuilderName: builder,\n\t\tChanges: []*Change{\n\t\t\t{\n\t\t\t\tAuthor: &Author{\n\t\t\t\t\tEmail: author,\n\t\t\t\t},\n\t\t\t\tRepository: repo,\n\t\t\t\tRevision: commit,\n\t\t\t},\n\t\t},\n\t\tProperties: Properties{\n\t\t\tReason: \"Triggered by SkiaScheduler\",\n\t\t},\n\t}\n\tif swarmingBotId != \"\" {\n\t\tp.Swarming = &swarming{\n\t\t\tOverrideBuilderCfg: swarmingOverrides{\n\t\t\t\tDimensions: []string{\n\t\t\t\t\tfmt.Sprintf(\"id:%s\", swarmingBotId),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\tjsonParams, err := json.Marshal(p)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbody := buildBucketRequest{\n\t\tBucket: fmt.Sprintf(\"master.%s\", master),\n\t\tParametersJSON: string(jsonParams),\n\t}\n\tjsonBody, err := json.Marshal(body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\turl := apiUrl + \"/builds\"\n\treq, err := http.NewRequest(\"PUT\", url, bytes.NewReader(jsonBody))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\tresp, err := c.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer util.Close(resp.Body)\n\tif resp.StatusCode != http.StatusOK {\n\t\tb, err := ioutil.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Failed to schedule build (code %s); couldn't read response body: %v\", resp.Status, err)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"Response code is %s. Response body:\\n%s\", resp.Status, string(b))\n\t}\n\tvar res buildBucketResponse\n\tif err := json.NewDecoder(resp.Body).Decode(&res); err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to decode response body: %v\", err)\n\t}\n\tif res.Error != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to schedule build: %s\", res.Error.Message)\n\t}\n\treturn res.Build, nil\n}", "title": "" }, { "docid": "3dfbafba046d187c46a73198c4df2b47", "score": "0.46251646", "text": "func NewBuild() *Build {\n\treturn &Build{\n\t\tfiles: make(map[string]*File),\n\t}\n}", "title": "" }, { "docid": "bf88e5e86d3a790052eb701e16ec0ebc", "score": "0.46213847", "text": "func Build() error {\n\treturn sh.Run(\"go\", \"build\", \"./...\")\n}", "title": "" }, { "docid": "f934c8420968f4fe2abbbce73cb6e0f5", "score": "0.46138152", "text": "func (d *GoogleGCSDownloader) ListFilesInBuild(job string, buildNumber int, prefix string) ([]string, error) {\n\treturn d.GoogleGCSBucketUtils.ListFilesInBuild(job, buildNumber, prefix)\n}", "title": "" }, { "docid": "d76f30441e66674c5727e0c6563ad68f", "score": "0.4613273", "text": "func getBuild(ctx context.Context, id int64) (*model.Build, error) {\n\tbld := &model.Build{ID: id}\n\tswitch err := datastore.Get(ctx, bld); {\n\tcase err == datastore.ErrNoSuchEntity:\n\t\treturn nil, perm.NotFoundErr(ctx)\n\tcase err != nil:\n\t\treturn nil, errors.Annotate(err, \"error fetching build with ID %d\", id).Err()\n\tdefault:\n\t\treturn bld, nil\n\t}\n}", "title": "" }, { "docid": "5806fe01e48c7f251af96a7da1ca5740", "score": "0.46124318", "text": "func RunBuild(nc ImageMapper, drh string, ctx *SourceContext, source, scratch shell.Shell) (*BuildResult, error) {\n\tbuild, err := NewBuildWithShells(nc, drh, ctx, source, scratch)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn build.Start()\n}", "title": "" }, { "docid": "ac3c5f0e04d14de9db45c5dd59a4cf44", "score": "0.46093875", "text": "func readProject(path string) (*apiProject, error) {\n\tfile, err := os.Open(path + \"/api_project.json\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tvar data apiProject\n\terr = json.NewDecoder(file).Decode(&data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &data, nil\n}", "title": "" }, { "docid": "d3488490a3928937dd81dd9cb897dbbb", "score": "0.45968807", "text": "func (p *Project) Build(root string) (*BuildRecord, error) {\n\tlog.Println(\"Build started\")\n\thash := md5.New()\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tlog.Println(\"Build failed: \", r)\n\t\t}\n\t}()\n\trecord := NewBuildRecord(*p)\n\tbuildStart := time.Now()\n\tbuildFailed := false\n\tio.WriteString(hash, \"Components:\\n\")\n\tcomponentNames := make([]string, len(p.Components))\n\ti := 0\n\tfor componentName, _ := range p.Components {\n\t\tcomponentNames[i] = componentName\n\t\ti += 1\n\t}\n\tlog.Println(\"Git Checkout\")\n\tsort.Strings(componentNames)\n\tfor index := range componentNames {\n\t\tcomponent := p.Components[componentNames[index]]\n\t\tstart := time.Now()\n\t\tcommit, err := runGitCheckout(component.Url, component.Name, component.Revision, root)\n\t\tend := time.Now()\n\t\tif err != nil {\n\t\t\tbuildFailed = true\n\t\t\trecord.SetRevision(componentNames[index], commit, end.Sub(start), BuildFailed)\n\t\t} else {\n\t\t\trecord.SetRevision(componentNames[index], commit, end.Sub(start), BuildOk)\n\t\t}\n\t\tio.WriteString(hash, fmt.Sprintf(\"%s %s %s\\n\", component.Url, component.Name, commit))\n\t}\n\tlog.Println(\"Build Steps\")\n\tio.WriteString(hash, \"Steps:\\n\")\n\tfor index, step := range p.Steps {\n\t\tstart := time.Now()\n\t\tif !buildFailed {\n\t\t\tdirectory := fmt.Sprintf(\"%s/%s\", root, step.Directory)\n\t\t\t// Compute the environment to be passed to the command here.\n\t\t\tenvironment := ExpandEnvironment(root, p.Env, step.Env)\n\t\t\terr := runCommand(directory, environment, step.Command[0], step.Command[1:]...)\n\t\t\tend := time.Now()\n\t\t\tif err != nil {\n\t\t\t\tbuildFailed = true\n\t\t\t\trecord.SetStatus(index, BuildFailed, end.Sub(start))\n\t\t\t} else {\n\t\t\t\trecord.SetStatus(index, BuildOk, end.Sub(start))\n\t\t\t}\n\t\t} else {\n\t\t\t// Skip build steps if a failure already occured.\n\t\t\tend := time.Now()\n\t\t\trecord.SetStatus(index, BuildSkipped, end.Sub(start))\n\t\t}\n\t\tio.WriteString(hash, step.Directory)\n\t\tfor i, arg := range step.Command {\n\t\t\tio.WriteString(hash, fmt.Sprintf(\"%d: %s\\n\", i, arg))\n\t\t}\n\t\tio.WriteString(hash, \"\\n\")\n\t}\n\tlog.Printf(\"Hash: %x\\n\", hash.Sum(nil))\n\trecord.Hash = fmt.Sprintf(\"%x\", hash.Sum(nil))\n\tbuildEnd := time.Now()\n\trecord.Duration = buildEnd.Sub(buildStart)\n\treturn record, nil\n}", "title": "" }, { "docid": "8e71d8d42d238bb93ee82e03245918be", "score": "0.4596766", "text": "func flattenBuildTriggerBuild(c *Client, i interface{}) *BuildTriggerBuild {\n\tm, ok := i.(map[string]interface{})\n\tif !ok {\n\t\treturn nil\n\t}\n\n\tr := &BuildTriggerBuild{}\n\tr.Tags = dcl.FlattenStringSlice(m[\"tags\"])\n\tr.Images = dcl.FlattenStringSlice(m[\"images\"])\n\tr.Substitutions = dcl.FlattenKeyValuePairs(m[\"substitutions\"])\n\tr.QueueTtl = dcl.FlattenString(m[\"queueTtl\"])\n\tr.LogsBucket = dcl.FlattenString(m[\"logsBucket\"])\n\tr.Timeout = dcl.FlattenString(m[\"timeout\"])\n\tif dcl.IsEmptyValueIndirect(m[\"timeout\"]) {\n\t\tc.Config.Logger.Info(\"Using default value for timeout.\")\n\t\tr.Timeout = dcl.String(\"600s\")\n\t}\n\tr.Secrets = flattenBuildTriggerBuildSecretsSlice(c, m[\"secrets\"])\n\tr.Steps = flattenBuildTriggerBuildStepsSlice(c, m[\"steps\"])\n\tr.Source = flattenBuildTriggerBuildSource(c, m[\"source\"])\n\n\treturn r\n}", "title": "" }, { "docid": "9d50737efb504543328d019eada327c1", "score": "0.45851308", "text": "func (ds *DeployableStorage) Build() error {\n\tfor _, service := range ds.data.Stage.Services {\n\t\ttoAdd := ds.BuildStorageForServices(service)\n\t\tif toAdd != nil && len(toAdd) > 0 {\n\t\t\tds.pvcs[service.ServiceId] = toAdd\n\t\t}\n\t}\n\tlog.Debug().Interface(\"Storage\", ds.pvcs).Msg(\"Storage have been build and are ready to deploy\")\n\treturn nil\n}", "title": "" }, { "docid": "4fc2ea24c630c87956bdc6524fcb7844", "score": "0.45842323", "text": "func FetchBuildArtifact(ctx context.Context, build Build, fileName string) (Artifact, error) {\n\tif build.IsRunning(ctx) {\n\t\treturn &ArtifactImpl{}, errors.New(\"failed to fetch artifact: Job is still running\")\n\t}\n\tfor _, artifact := range build.GetArtifacts() {\n\t\tif artifact.FileName == fileName {\n\t\t\treturn &ArtifactImpl{artifact: artifact}, nil\n\t\t}\n\t}\n\treturn &ArtifactImpl{}, fmt.Errorf(\"failed to fetch artifact: Artifact '%s' not found\", fileName)\n}", "title": "" } ]
cee2c365d825140f9b4db040deec9e21
NewDigitalOceanManager returns a Digitial Ocean manager
[ { "docid": "31a182dda485892c984eece68af9f627", "score": "0.7221919", "text": "func NewDigitalOceanManager(token string) (*DigitalOceanManager, error) {\n\n\tif token == \"\" {\n\t\treturn nil, errors.New(\"DigitalOcean token is empty\")\n\t}\n\n\ttokenSource := &tokenSource{AccessToken: token}\n\toauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource)\n\tclient := godo.NewClient(oauthClient)\n\n\tm := &DigitalOceanManager{\n\t\tclient: client,\n\t}\n\n\t// generate client and test retrieving account info\n\t_, err := m.GetAccount()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, nil\n}", "title": "" } ]
[ { "docid": "9a101081d862c006a49dac172d72c9cc", "score": "0.6058108", "text": "func newManager(pchstore *Store, pchapi managerAPI) (*Manager, error) {\n\tpm := &Manager{\n\t\tstore: pchstore,\n\t\tsa: &stateAccessor{sm: pchapi},\n\t\tchannels: make(map[string]*channelAccessor),\n\t\tpchapi: pchapi,\n\t}\n\tpm.ctx, pm.shutdown = context.WithCancel(context.Background())\n\treturn pm, pm.Start()\n}", "title": "" }, { "docid": "2cc30eff6d299b0153b9282dc1efc94e", "score": "0.60312396", "text": "func newManager(ops Options) (*Manager, error) {\n\tops.setDefault()\n\n\t// If CertWriter is not set, create a default CertWriter.\n\tif ops.CertWriter == nil {\n\t\tsecretCWOpts := writer.SecretCertWriterOptions{\n\t\t\tClient: ops.Client,\n\t\t\tCertGenerator: &generator.SelfSignedCertGenerator{\n\t\t\t\tValidity: ops.CertValidity,\n\t\t\t},\n\t\t\tSecret: ops.SecretRef,\n\t\t}\n\t\tcw, err := writer.NewSecretCertWriter(secretCWOpts)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tops.CertWriter = cw\n\t}\n\n\tcertManager := &Manager{\n\t\tcertProvisioner: webhookcert.Provisioner{CertWriter: ops.CertWriter},\n\t\tOptions: ops,\n\t}\n\n\treturn certManager, nil\n}", "title": "" }, { "docid": "b9e88870f52a5c947cd3b4ad45ac6058", "score": "0.5982463", "text": "func createManager(restConfig *rest.Config, provisionerConfig *gatewayProvisionerConfig) (manager.Manager, error) {\n\tscheme, err := provisioner.CreateScheme()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating runtime scheme: %w\", err)\n\t}\n\n\tmgr, err := ctrl.NewManager(restConfig, manager.Options{\n\t\tScheme: scheme,\n\t\tLeaderElection: provisionerConfig.leaderElection,\n\t\tLeaderElectionResourceLock: \"leases\",\n\t\tLeaderElectionID: provisionerConfig.leaderElectionID,\n\t\tLeaderElectionNamespace: provisionerConfig.leaderElectionNamespace,\n\t\tLeaderElectionReleaseOnCancel: true,\n\t\tMetricsBindAddress: provisionerConfig.metricsBindAddress,\n\t\tLogger: ctrl.Log.WithName(\"contour-gateway-provisioner\"),\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create manager: %w\", err)\n\t}\n\n\t// Create and register the controllers with the manager.\n\tif _, err := controller.NewGatewayClassController(mgr, provisionerConfig.gatewayControllerName); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create gatewayclass controller: %w\", err)\n\t}\n\tif _, err := controller.NewGatewayController(mgr, provisionerConfig.gatewayControllerName, provisionerConfig.contourImage, provisionerConfig.envoyImage); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create gateway controller: %w\", err)\n\t}\n\treturn mgr, nil\n}", "title": "" }, { "docid": "93bb3560a6baec862aae0c58273b8848", "score": "0.596901", "text": "func New() Manager {\n\treturn &basicManager{}\n}", "title": "" }, { "docid": "5fc248a12a73067b7faeb76e201adee0", "score": "0.59613836", "text": "func newManager() *manager {\n\tvar mgr *manager = &manager{\n\t\ttw: newTimeWheel(),\n\t\tjids: make(map[uint32]*job),\n\t}\n\treturn mgr\n\n}", "title": "" }, { "docid": "6113822767d26c792176504fb361221f", "score": "0.5960691", "text": "func NewManager(c Config) (*Manager, error) {\n\ta, err := api.NewClient(c.API)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tm := &Manager{\n\t\tcfg: c,\n\t\tapi: a,\n\t\tfcs: make(map[string]*Function),\n\t\tlog: logger.WithFields(\"manager\", \"function\"),\n\t}\n\tfor _, fc := range c.Functions {\n\t\tm.fcs[fc.Name] = newFunction(m, fc)\n\t}\n\treturn m, nil\n}", "title": "" }, { "docid": "06e015e177c5da42766621c7285e6e7b", "score": "0.5920221", "text": "func NewManager(appConfig *config.AppConfig) (*Manager, error) {\n\tmgr := &Manager{}\n\tmgr.log = log.NewLogger(&appConfig.Log, \"manager\").WithFields(logrus.Fields{\n\t\tlog.PortField: appConfig.HTTP.Port,\n\t\tlog.UseTLSField: appConfig.HTTP.UseTLS,\n\t\tlog.CertFileField: appConfig.HTTP.CertFile,\n\t\tlog.KeyFileField: appConfig.HTTP.KeyFile,\n\t})\n\tcontextLogger := mgr.log.WithField(log.FuncField, ref.GetFuncName())\n\tcontextLogger.Info(\"creating new manager\")\n\n\tserver, err := createManagerServer(appConfig.HTTP.Port, mgr)\n\tif err != nil {\n\t\tcontextLogger.WithError(err).Error(\"error creating manager\")\n\t\treturn nil, err\n\t}\n\n\tmgr.config = appConfig\n\tmgr.server = wrapper.NewServerOps(server)\n\tmgr.apis = make(map[string]api.IAPI)\n\tmgr.file = &wrapper.FileOps{}\n\tmgr.configManager = config.NewConfigManager()\n\tcontextLogger.Info(\"successfully created new manager\")\n\treturn mgr, nil\n}", "title": "" }, { "docid": "21f4a1b96aaaa4443eb71587d164f149", "score": "0.5898122", "text": "func NewManager(addr, pdAddr string) *Manager {\n\tn := &Manager{\n\t\taddr: addr,\n\t\tpdAddr: pdAddr,\n\t}\n\n\treturn n\n}", "title": "" }, { "docid": "f33335ec769a7c3a150271405a247c08", "score": "0.58931035", "text": "func NewManager(\n\tconfig *etcdconfig.Config,\n\tplanExec executor.Plan,\n) (dlg.Manager, error) {\n\tc, err := clientv3.New(clientv3.Config{\n\t\tEndpoints: config.Endpoints,\n\t\tDialTimeout: config.DialTimeout,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tm := &manager{\n\t\tc: c,\n\t\tplanExec: planExec,\n\t\tstop: make(chan struct{}),\n\t}\n\treturn m, m.start()\n}", "title": "" }, { "docid": "19722e5a80e60b331388a5caef48d150", "score": "0.588984", "text": "func New(namespace, region string) (*Provider, error) {\n\tprvdr, err := newDigitalOcean(namespace, region)\n\tif err != nil {\n\t\treturn prvdr, err\n\t}\n\n\t_, _, err = prvdr.ListDroplets(&godo.ListOptions{})\n\treturn prvdr, err\n}", "title": "" }, { "docid": "66c70432089076009721b3b5937bbd5b", "score": "0.58090305", "text": "func newManager(ctx context.Context, options ...interface{}) (*manager, error) {\n\tm := new(manager).Init(ctx)\n\n\topt := make(map[string]interface{})\n\tfor i, option := range options {\n\t\tif i%2 != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tkey, ok := option.(string)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"options need to be in the format key, value. key is a string\")\n\t\t}\n\n\t\tif i < len(options)-1 {\n\t\t\topt[key] = options[i+1]\n\t\t}\n\t}\n\n\tif option, present := opt[OptFilePath]; present {\n\t\tif file, ok := option.(string); !ok {\n\t\t\treturn nil, fmt.Errorf(\"option value for file should be a string\")\n\t\t} else {\n\t\t\tif err := m.setConfigFile(file); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t} else {\n\t\thome := os.Getenv(\"HOME\")\n\t\tfile := filepath.Join(home, \".config\", defaultConfigDir, defaultConfigFile)\n\t\tif err := m.setConfigFile(file); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn m, nil\n}", "title": "" }, { "docid": "9e90dca3ee65f9b570140d1992b03ded", "score": "0.57888544", "text": "func newMachine(bm *provider.BaseMachine) (provider.Machine, error) {\n\tcred, ok := bm.Credential.(*Credential)\n\tif !ok {\n\t\treturn nil, errors.New(\"not a valid DigitalOcean credential\")\n\t}\n\n\toauthClient := oauth2.NewClient(\n\t\toauth2.NoContext,\n\t\toauth2.StaticTokenSource(&oauth2.Token{AccessToken: cred.AccessToken}),\n\t)\n\n\treturn &Machine{\n\t\tclient: godo.NewClient(oauthClient),\n\t\tBaseMachine: bm,\n\t}, nil\n}", "title": "" }, { "docid": "87d80a2c5c62e63de407b3fc3c664f37", "score": "0.5786386", "text": "func newStackManager(portainerURL, endpointID, edgeID string) (*StackManager, error) {\n\tcli := client.NewPortainerClient(portainerURL, endpointID, edgeID)\n\n\tdockerStackService, err := exec.NewDockerStackService(agent.DockerBinaryPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstackManager := &StackManager{\n\t\tdockerStackService: dockerStackService,\n\t\tstacks: map[edgeStackID]*edgeStack{},\n\t\tstopSignal: nil,\n\t\thttpClient: cli,\n\t}\n\n\treturn stackManager, nil\n}", "title": "" }, { "docid": "632c3eb0e36e164a789a5eedcfc3ed6a", "score": "0.577051", "text": "func NewManager() *Manager {\n\treturn &Manager{\n\t\tsvcs: []Service{},\n\t}\n}", "title": "" }, { "docid": "6fed69053cf7d812c38a2a521d190228", "score": "0.5745249", "text": "func NewManager() *Manager {\n\treturn &Manager{\n\t\tinventory: &actuation.Inventory{},\n\t}\n}", "title": "" }, { "docid": "1b4392f2c088a3062e4ce72e5b25e5fb", "score": "0.5733722", "text": "func New() *Manager {\n\treturn &Manager{\n\t\tports: make(map[int]map[int32]struct{}),\n\t}\n}", "title": "" }, { "docid": "acf2c273ad25e7d1c94acfc37d217064", "score": "0.5731741", "text": "func NewManager(ctx context.Context, options ...interface{}) (configio.ConfigManager, error) {\n\tmanager, err := newManager(ctx, options...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := manager.closeWatch(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn manager, nil\n}", "title": "" }, { "docid": "cca9fd3c92677591a7a41e5dd28dad14", "score": "0.5723822", "text": "func NewManager(root wallelib.Client, addr string) *Manager {\n\treturn &Manager{\n\t\troot: root,\n\t\taddr: addr,\n\t\tclusters: make(map[string]*clusterData),\n\t}\n}", "title": "" }, { "docid": "9095c71a271ca8de0335ab7ac964ba33", "score": "0.5712677", "text": "func NewManager() (Manager, error) {\n\treturn &networkManager{}, nil\n}", "title": "" }, { "docid": "e51361e5eb22bbec54b0f5ab4b72b38c", "score": "0.5709761", "text": "func NewManager(l log.Logger, e *common.Etcd, c *cluster.Cluster) *Manager {\n\tm := &Manager{\n\t\tlogger: l,\n\t\trgt: &common.Registry{Items: make(map[string]common.Worker)},\n\t\tstop: make(chan struct{}),\n\t\tetcdcli: e,\n\t\tcluster: c,\n\t}\n\tm.load()\n\tm.state = model.StateActive\n\treturn m\n}", "title": "" }, { "docid": "67831b678135fe628fd5575c9322eab4", "score": "0.5689182", "text": "func New() Manager {\n\treturn &manager{}\n}", "title": "" }, { "docid": "5263691d762307b5ed8a0acb0708268a", "score": "0.56881684", "text": "func NewManager() *Manager {\n\treturn &Manager{}\n}", "title": "" }, { "docid": "5263691d762307b5ed8a0acb0708268a", "score": "0.56881684", "text": "func NewManager() *Manager {\n\treturn &Manager{}\n}", "title": "" }, { "docid": "016c78b68c4846a2064d717a36da092c", "score": "0.5683051", "text": "func NewManagerCustom(d map[string]Dial, opts ...grpc.DialOption) (*Manager, error) {\n\tif len(d) == 0 {\n\t\treturn nil, errors.New(\"no Dial provided\")\n\t}\n\tfor name, dialer := range d {\n\t\tif dialer == nil {\n\t\t\treturn nil, fmt.Errorf(\"dialer %q is nil\", name)\n\t\t}\n\t}\n\tm := &Manager{}\n\tm.conns = map[string]*connection{}\n\tm.opts = opts\n\tm.d = d\n\treturn m, nil\n}", "title": "" }, { "docid": "9f9c8e8df37181c4b1be2a03df9d4b76", "score": "0.5668356", "text": "func NewManager(namespace string, devicePlugin Scanner) *Manager {\n\treturn &Manager{\n\t\tdevicePlugin: devicePlugin,\n\t\tnamespace: namespace,\n\t\tservers: make(map[string]devicePluginServer),\n\t\tcreateServer: newServer,\n\t}\n}", "title": "" }, { "docid": "c57cb7fdafff7fd2f27e3fc2b840392f", "score": "0.56638", "text": "func newPodManager(host knetwork.Host, multitenant bool, localSubnetCIDR string, netInfo *NetworkInfo, kClient *kclient.Client, vnids *nodeVNIDMap, mtu uint32) (*podManager, error) {\n\tpm := newDefaultPodManager(host)\n\tpm.multitenant = multitenant\n\tpm.kClient = kClient\n\tpm.vnids = vnids\n\tpm.mtu = mtu\n\tpm.hostportHandler = kubehostport.NewHostportHandler()\n\tpm.podHandler = pm\n\n\tvar err error\n\tpm.ipamConfig, err = getIPAMConfig(netInfo.ClusterNetwork, localSubnetCIDR)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn pm, nil\n}", "title": "" }, { "docid": "3d15b4deeb791807a1c4aab64c63c0a0", "score": "0.5656941", "text": "func ConstructManager() (*Manager, error) {\n _, err := os.Stat(\"coldstorage\")\n if err != nil { return nil, err }\n\n newManager := Manager {\n sigint: make(chan os.Signal, 1),\n }\n signal.Notify(newManager.sigint, os.Interrupt)\n go newManager.finalize()\n\n return &newManager, nil\n}", "title": "" }, { "docid": "197e38510a00efe974c840fef6c290b2", "score": "0.5656451", "text": "func NewManager(client *clientv3.Client, target string) (Manager, error) {\n\tif client == nil {\n\t\treturn nil, errors.New(\"invalid etcd client\")\n\t}\n\n\tif target == \"\" {\n\t\treturn nil, errors.New(\"invalid target\")\n\t}\n\n\tem := &endpointManager{\n\t\tclient: client,\n\t\ttarget: target,\n\t}\n\treturn em, nil\n}", "title": "" }, { "docid": "4f354b63b119be097edc06f81311cf9b", "score": "0.5647492", "text": "func NewManager(orgProvider organization.Provider, appProvider application.Provider, devProvider device.Provider, publicHostDomain string) Manager {\n\treturn Manager{orgProvider, appProvider, devProvider, publicHostDomain}\n}", "title": "" }, { "docid": "d7f420df66c5991b3c091ae36d53402e", "score": "0.56436217", "text": "func NewManager() *Manager {\n\tm := &Manager{\n\t\tobjects: make(map[string]*object),\n\t\tid: make([]byte, 20),\n\t}\n\n\tutil.RandomID(m.id)\n\n\treturn m\n}", "title": "" }, { "docid": "97eb649b932281a6aa9f335f229e7bd5", "score": "0.56168175", "text": "func NewLCAManager(ctx context.Context, cfg p2pnode.Config,\n serviceName string, serviceAddress string) (*LCAManager, error) {\n var err error\n\n var node LCAManager\n\n // Set stream handler, protocol ID and create the node\n cfg.StreamHandlers = append(cfg.StreamHandlers, RequestHandler(serviceAddress, &node))\n cfg.HandlerProtocolIDs = append(cfg.HandlerProtocolIDs, LCAManagerRequestProtID)\n node.Host, err = p2pnode.NewNode(ctx, cfg)\n if err != nil {\n return nil, err\n }\n\n // Now that the node is created, it can be used to get the rendezvous\n // without the need to create a separate node for GetService\n if serviceName != \"\" {\n // Set rendezvous to service hash value\n info, err := registry.GetServiceWithHostRouting(node.Host.Ctx,\n node.Host.Host, node.Host.RoutingDiscovery, serviceName)\n if err != nil {\n return nil, err\n }\n node.P2PHash = info.ContentHash\n node.Host.Advertise(node.P2PHash)\n }\n\n return &node, nil\n}", "title": "" }, { "docid": "d64e0231f0f8e70505a401104306eec1", "score": "0.5596703", "text": "func NewManager() *Manager {\n\treturn &Manager{\n\t\tprocesses: gmap.NewIntAnyMap(true),\n\t}\n}", "title": "" }, { "docid": "a19644147704d9a56b0ece198704ede6", "score": "0.5582655", "text": "func NewManager(baseURL url.URL, env adapter.Env) *Manager {\n\tpm := createManager(baseURL, env.Logger())\n\tpm.start(env)\n\treturn pm\n}", "title": "" }, { "docid": "6c746f4c9d4f199bc1205a2c787d4d18", "score": "0.5577295", "text": "func New() *Manager {\n\treturn &Manager{}\n}", "title": "" }, { "docid": "4ca630f04be4e1141196d205a1f01664", "score": "0.5572358", "text": "func NewManager(client *api.Client) (*Manager, error) {\n\tm := new(Manager)\n\tm.client = client\n\tm.pools = make(map[string]*Pool)\n\treturn m, nil\n}", "title": "" }, { "docid": "381ba43d5847739c059cb17b830f1fde", "score": "0.5564031", "text": "func NewManager(logger logrus.FieldLogger, level logrus.Level) Manager {\n\treturn &manager{\n\t\tlogger: (&logrusAdapter{impl: logger, level: level}),\n\t\tclients: make(map[pluginInfo]*plugin.Client),\n\t\tinternalPlugins: map[pluginInfo]interface{}{\n\t\t\t{kind: PluginKindObjectStore, name: \"aws\"}: struct{}{},\n\t\t\t{kind: PluginKindBlockStore, name: \"aws\"}: struct{}{},\n\n\t\t\t{kind: PluginKindObjectStore, name: \"gcp\"}: struct{}{},\n\t\t\t{kind: PluginKindBlockStore, name: \"gcp\"}: struct{}{},\n\n\t\t\t{kind: PluginKindObjectStore, name: \"azure\"}: struct{}{},\n\t\t\t{kind: PluginKindBlockStore, name: \"azure\"}: struct{}{},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "00cf0390f1c629b195f5c5f4e5cec235", "score": "0.5556168", "text": "func NewManager(l *kitlog.Logger) *Manager {\n\tam := &Manager{\n\t\tauthHeaderName: \"\",\n\t\tauthMemMap: make(map[int]map[string]string),\n\t\tlogger: *l,\n\t}\n\treturn am\n}", "title": "" }, { "docid": "6152c75df86fa3ae03ab712fdf2db993", "score": "0.55514836", "text": "func NewManager(\n\tclusterGetter api.ClusterGetter,\n\trepository *ClusterGroupRepository,\n\tlogger logrus.FieldLogger,\n\terrorHandler emperror.Handler,\n) *Manager {\n\tfeatureHandlerMap := make(map[string]api.FeatureHandler, 0)\n\treturn &Manager{\n\t\tclusterGetter: clusterGetter,\n\t\tcgRepo: repository,\n\t\tlogger: logger,\n\t\terrorHandler: errorHandler,\n\t\tfeatureHandlerMap: featureHandlerMap,\n\t}\n}", "title": "" }, { "docid": "6fae930863cc9a5b16d1b49f1978ae03", "score": "0.5551344", "text": "func NewManager(s micro.Service) *Manager {\n\treturn &Manager{\n\t\tBaseHandler: session.NewBaseHandler(),\n\t\tservice: s,\n\t}\n}", "title": "" }, { "docid": "3fdbe1ef82f1a6fca2b1163016112b3f", "score": "0.55507016", "text": "func NewManager(opts ...grpc.DialOption) (*Manager, error) {\n\treturn NewManagerCustom(map[string]Dial{DEFAULT: grpc.DialContext}, opts...)\n}", "title": "" }, { "docid": "0407e96d07eabc803bd7159b943242ca", "score": "0.55339396", "text": "func TestNewManager(t *testing.T) {\n\tg := gomega.NewGomegaWithT(t)\n\tpath := \"path\"\n\tmgr, err := archive.NewManager(path)\n\tg.Expect(err).To(gomega.BeNil())\n\tg.Expect(mgr).ToNot(gomega.BeNil())\n\tmgr, err = archive.NewManager(\"\")\n\tg.Expect(err).ToNot(gomega.BeNil())\n\tg.Expect(mgr).To(gomega.BeNil())\n}", "title": "" }, { "docid": "78f30f8041f3187541952735c6809cb6", "score": "0.5503786", "text": "func NewObjectManager(conf HostConfig, key string, cert string, poolSize int, timeout time.Duration) (*ObjectManager) {\n\tclnt := NewRestClient(conf, key, cert, poolSize, timeout)\n\tobjMgr := &ObjectManager{Client:clnt}\n\treturn objMgr\n}", "title": "" }, { "docid": "152c04181afdc13c8b0b0643d5209ac8", "score": "0.5502802", "text": "func NewManager(parser *configparser.Parser, logger *zap.Logger, buildInfo component.BuildInfo, factories Factories) (*Manager, error) {\n\tconfigSourcesSettings, err := Load(context.Background(), parser, factories)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparams := CreateParams{\n\t\tLogger: logger,\n\t\tBuildInfo: buildInfo,\n\t}\n\tcfgSources, err := Build(context.Background(), configSourcesSettings, params, factories)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn newManager(cfgSources), nil\n}", "title": "" }, { "docid": "963593a226646946c8374fb533f7807d", "score": "0.5496289", "text": "func NewManager() *Manager {\n\treturn &Manager{\n\t\t// defName: driverName,\n\t\tdrivers: make(map[string]Cache),\n\t}\n}", "title": "" }, { "docid": "a213894bee84aeca158d685369016c6b", "score": "0.5479894", "text": "func NewManager() (*Manager, error) {\n\tkeypair, err := simplcrypto.GenerateMasterKeyPair()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to GenerateMasterKeyPair\")\n\t}\n\n\tmanager := &Manager{\n\t\tnodeKeypair: keypair,\n\t}\n\n\treturn manager, nil\n}", "title": "" }, { "docid": "e78f6d1d757bdef81ce17dbba81cfe90", "score": "0.54566616", "text": "func NewManager(mode, configDir string) *Manager {\n\treturn &Manager{\n\t\tclusterMode: mode,\n\t\tconfigDir: configDir,\n\t\tactivePlugins: make([]plugin.Interface, 0),\n\t\tactivePluginNames: make([]string, 0),\n\t\tactiveMesosPlugins: make([]plugin.MesosPlugin, 0),\n\t\tactiveMesosPluginNames: make([]string, 0),\n\t}\n}", "title": "" }, { "docid": "44c478e002e0fb639b34c00247b72f70", "score": "0.5453408", "text": "func NewManager(storage Storager, opts ...ManagerOption) *Manager {\n\tm := &Manager{\n\t\tConfigReader: config.DefaultManager,\n\t\tstorage: storage,\n\t\tmu: sync.RWMutex{},\n\t\twebsiteMap: make(map[uint64]*Website),\n\t\tgroupMap: make(map[uint64]*Group),\n\t\tstoreMap: make(map[uint64]*Store),\n\t\t// HealthJob: utils.HealthJobNoop, @todo\n\t}\n\tfor _, opt := range opts {\n\t\tif opt != nil {\n\t\t\topt(m)\n\t\t}\n\t}\n\treturn m\n}", "title": "" }, { "docid": "2fd661d3a19a145e19d97081f0782743", "score": "0.5453401", "text": "func NewManager(client *rest.Client) *Manager {\n\treturn &Manager{\n\t\tClient: client,\n\t}\n}", "title": "" }, { "docid": "5ba9bffedec86c9a04129c49e364ddf6", "score": "0.54389125", "text": "func New(m map[string]interface{}) (user.Manager, error) {\n\tmgr := &manager{}\n\terr := mgr.Configure(m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn mgr, err\n}", "title": "" }, { "docid": "3488f349f9515b6986d9de69986ac3e9", "score": "0.543577", "text": "func New(c *Config) Manager {\n\treturn newManager(c)\n}", "title": "" }, { "docid": "82eaf45a89a27ccdc0b7774341ab0716", "score": "0.5432326", "text": "func NewManager() *Manager {\n\tm := Manager{}\n\tm.Clear()\n\treturn &m\n}", "title": "" }, { "docid": "0be6f4048f92b86b18e022e15a5d333b", "score": "0.5431946", "text": "func NewManager() *Manager {\n\treturn &Manager{\n\t\tkeys: make([]string, 0),\n\t\tlayers: make(map[string]tl.Drawable),\n\t}\n}", "title": "" }, { "docid": "9d24bc9f5f561a0477ed2c0776062f66", "score": "0.5428746", "text": "func NewManager(cfg managerConfig, clientset k8sClient.Clientset) (CertificateManager, SecretManager) {\n\tm := &manager{\n\t\trootPath: cfg.CertificatesDirectory,\n\t\tk8sClient: clientset,\n\t}\n\n\treturn m, m\n}", "title": "" }, { "docid": "fda13a379a265afd80458c32675c03ed", "score": "0.5422313", "text": "func Manager() *gossip.Manager {\n\tmgrOnce.Do(createManager)\n\treturn mgr\n}", "title": "" }, { "docid": "4ce58b9d751820cfa58bd20e7b993de5", "score": "0.5395656", "text": "func NewDigitalOceanProvider(ctx context.Context, domainFilter endpoint.DomainFilter, dryRun bool, apiPageSize int) (*DigitalOceanProvider, error) {\n\ttoken, ok := os.LookupEnv(\"DO_TOKEN\")\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"no token found\")\n\t}\n\toauthClient := oauth2.NewClient(ctx, oauth2.StaticTokenSource(&oauth2.Token{\n\t\tAccessToken: token,\n\t}))\n\tclient, err := godo.New(oauthClient, godo.SetUserAgent(\"ExternalDNS/\"+externaldns.Version))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp := &DigitalOceanProvider{\n\t\tClient: client.Domains,\n\t\tdomainFilter: domainFilter,\n\t\tapiPageSize: apiPageSize,\n\t\tDryRun: dryRun,\n\t}\n\treturn p, nil\n}", "title": "" }, { "docid": "28ea009b5f8b570465afb0068b02fdfd", "score": "0.53880644", "text": "func NewManager(db store.Store, conf *Config) *Manager {\n\td := &Manager{\n\t\tglobal: conf.Services.Defaults,\n\t\tservices: make(map[string]srvEntry),\n\t\tdb: db,\n\t}\n\tfor name, srv := range conf.Services.Services {\n\t\td.services[name] = srvEntry{\n\t\t\tServiceConfig: *srv,\n\t\t\tChecker: NewChecker(db, name, *srv, &d.global),\n\t\t\tUpdater: NewUpdater(name, *srv, &d.global),\n\t\t}\n\t}\n\treturn d\n}", "title": "" }, { "docid": "a60caefe5446cc8021ffef44f5118704", "score": "0.53867966", "text": "func NewManager(nexus *v1alpha1.Nexus, client client.Client) *Manager {\n\treturn &Manager{\n\t\tnexus: nexus,\n\t\tclient: client,\n\t}\n}", "title": "" }, { "docid": "bc0c4b8bc4230acafeac4f9b6b961100", "score": "0.53814405", "text": "func GetManager(vc *cnsvsphere.VirtualCenter) Manager {\n\tonceForManager.Do(func() {\n\t\tklog.V(1).Infof(\"Initializing volume.volumeManager...\")\n\t\tmanagerInstance = &volumeManager{\n\t\t\tvirtualCenter: vc,\n\t\t}\n\t\tklog.V(1).Infof(\"volume.volumeManager initialized\")\n\t})\n\treturn managerInstance\n}", "title": "" }, { "docid": "29cbcbaf26e6ce1abddb23104a2f3332", "score": "0.5381167", "text": "func NewManager(cfg Config) (*Manager, error) {\n\tid := uuid.New()\n\n\tappStr := func(typ ConnType) string {\n\t\treturn ConnInfo{\n\t\t\tVersion: version.GitVersion(),\n\t\t\tID: id,\n\t\t\tType: typ,\n\t\t}.String()\n\t}\n\n\tmainDB, err := sqldrv.NewDB(cfg.OldDBURL, appStr(ConnTypeMainMgr))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"connect to old db: %w\", err)\n\t}\n\tmainAppDBC, err := sqldrv.NewConnector(cfg.OldDBURL, appStr(ConnTypeMainApp))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"connect to old db: %w\", err)\n\t}\n\tnextDB, err := sqldrv.NewDB(cfg.NewDBURL, appStr(ConnTypeNextMgr))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"connect to new db: %w\", err)\n\t}\n\tnextAppDBC, err := sqldrv.NewConnector(cfg.NewDBURL, appStr(ConnTypeNextApp))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"connect to new db: %w\", err)\n\t}\n\n\tm := &Manager{\n\t\tConfig: cfg,\n\t\tdbApp: sql.OpenDB(NewConnector(mainAppDBC, nextAppDBC)),\n\t\tdbMain: mainDB,\n\t\tdbNext: nextDB,\n\t}\n\n\tctx := cfg.Logger.BackgroundContext()\n\tmessages, err := swomsg.NewLog(ctx, m.dbMain)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = m.withConnFromBoth(ctx, func(ctx context.Context, oldConn, newConn *pgx.Conn) error {\n\t\tvar err error\n\t\tm.MainDBInfo, err = swoinfo.DBInfo(ctx, oldConn)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tm.NextDBInfo, err = swoinfo.DBInfo(ctx, newConn)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"et server version: %w\", err)\n\t}\n\n\tm.taskMgr, err = swogrp.NewTaskMgr(ctx, swogrp.Config{\n\t\tNodeID: id,\n\t\tCanExec: cfg.CanExec,\n\n\t\tLogger: cfg.Logger,\n\t\tMessages: messages,\n\n\t\tOldID: m.MainDBInfo.ID,\n\t\tNewID: m.NextDBInfo.ID,\n\n\t\tExecutor: NewExecutor(m),\n\t\tPauseFunc: func(ctx context.Context) error { return m.pauseResume.Pause(ctx) },\n\t\tResumeFunc: func(ctx context.Context) error { return m.pauseResume.Resume(ctx) },\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"init task manager: %w\", err)\n\t}\n\n\treturn m, nil\n}", "title": "" }, { "docid": "6313a6be028a10d1639a8328aca4e795", "score": "0.5377021", "text": "func NewManager(client *api.Client, cfg config.Configuration) Manager {\n\tlocMgrInitOnce.Do(func() {\n\t\tlocationMgr = &locationManager{cc: client}\n\t\tlocationMgr.hpAdapter = adapter.NewHostsPoolLocationAdapter(client, cfg)\n\t})\n\treturn locationMgr\n}", "title": "" }, { "docid": "d4cfe7e85b3dd1e901803abfcf4e515a", "score": "0.5371511", "text": "func NewManager(leadershipStore leadership.Store, mastershipStore mastership.Store, deviceChangesStore device.Store,\n\tdeviceStateStore state.Store, deviceStore devicestore.Store, deviceCache cache.Cache,\n\tnetworkChangesStore network.Store, networkSnapshotStore networksnap.Store,\n\tdeviceSnapshotStore devicesnap.Store, allowUnvalidatedConfig bool, modelRegistry *modelregistry.ModelRegistry) *Manager {\n\tlog.Info(\"Creating Manager\")\n\n\tmgr = Manager{\n\t\tDeviceChangesStore: deviceChangesStore,\n\t\tDeviceStateStore: deviceStateStore,\n\t\tDeviceStore: deviceStore,\n\t\tDeviceCache: deviceCache,\n\t\tMastershipStore: mastershipStore,\n\t\tNetworkChangesStore: networkChangesStore,\n\t\tNetworkSnapshotStore: networkSnapshotStore,\n\t\tDeviceSnapshotStore: deviceSnapshotStore,\n\t\tnetworkChangeController: networkchangectl.NewController(leadershipStore, deviceStore, networkChangesStore, deviceChangesStore),\n\t\tdeviceChangeController: devicechangectl.NewController(mastershipStore, deviceStore, deviceChangesStore),\n\t\tnetworkSnapshotController: networksnapshotctl.NewController(leadershipStore, networkChangesStore, networkSnapshotStore, deviceSnapshotStore, deviceChangesStore),\n\t\tdeviceSnapshotController: devicesnapshotctl.NewController(mastershipStore, deviceChangesStore, deviceSnapshotStore),\n\t\tTopoChannel: make(chan *topodevice.ListResponse, 10),\n\t\tModelRegistry: modelRegistry,\n\t\tOperationalStateChannel: make(chan events.OperationalStateEvent),\n\t\tSouthboundErrorChan: make(chan events.DeviceResponse),\n\t\tDispatcher: dispatcher.NewDispatcher(),\n\t\tOperationalStateCache: make(map[topodevice.ID]devicechange.TypedValueMap),\n\t\tOperationalStateCacheLock: &sync.RWMutex{},\n\t\tallowUnvalidatedConfig: allowUnvalidatedConfig,\n\t}\n\treturn &mgr\n}", "title": "" }, { "docid": "6320d65278d4b0b8a992b9f782cc6b7b", "score": "0.53614163", "text": "func NewManager(config ManagerConfig) *Manager {\n\tm := &Manager{\n\t\tconfig: config,\n\t\tdevices: make(map[string]Device),\n\t}\n\tm.actions = &sh.SmartHomeActions{Request: m.request}\n\n\treturn m\n}", "title": "" }, { "docid": "27cf5269499d7e5ba7c6973249598f9b", "score": "0.53613144", "text": "func NewManager(startLedgerIdx uint32) *Manager {\n\tm := &Manager{\n\t\tledgers: make(chan *ManagedLedger),\n\t\tunorderedLedgers: make(chan *ManagedLedger),\n\t\tledgerRequests: make(chan uint32, 1),\n\t\tnextLedgerSequence: startLedgerIdx,\n\t}\n\tgo m.run()\n\treturn m\n}", "title": "" }, { "docid": "ab401b9c99f224b6e40ae1ceedbba530", "score": "0.5357747", "text": "func NewManager(config *configs.Cgroup, dirPath string, rootless bool) (cgroups.Manager, error) {\n\tif config == nil {\n\t\tconfig = &configs.Cgroup{}\n\t}\n\tif dirPath != \"\" {\n\t\tif filepath.Clean(dirPath) != dirPath || !filepath.IsAbs(dirPath) {\n\t\t\treturn nil, errors.Errorf(\"invalid dir path %q\", dirPath)\n\t\t}\n\t} else {\n\t\tvar err error\n\t\tdirPath, err = defaultDirPath(config)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tcontrollers, err := detectControllers(dirPath)\n\tif err != nil && !rootless {\n\t\treturn nil, err\n\t}\n\n\tm := &manager{\n\t\tconfig: config,\n\t\tdirPath: dirPath,\n\t\tcontrollers: controllers,\n\t\trootless: rootless,\n\t}\n\treturn m, nil\n}", "title": "" }, { "docid": "29ddd9c4bff4f5780c43aa8a10638ef7", "score": "0.53541577", "text": "func NewGaiaManager(ctx context.Context, conn *zk.Conn) GaiaManager {\n\texist, _, err := conn.Exists(zconst.GaiaRoot)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif !exist {\n\t\t_, err = conn.Create(zconst.GaiaRoot, []byte{}, 0, zk.WorldACL(zk.PermAll))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\treturn GaiaManager{\n\t\tmu: sync.Mutex{},\n\t\tctx: ctx,\n\t\tconn: conn,\n\t\tMonitors: make(map[string]zookeeper.ZKNode),\n\t}\n}", "title": "" }, { "docid": "d827101c312ead0565bfdd3eddce2851", "score": "0.5346736", "text": "func NewManager(nodeAddrs []string, opts ...ManagerOption) (*Manager, error) {\n\tif len(nodeAddrs) == 0 {\n\t\treturn nil, fmt.Errorf(\"could not create manager: no nodes provided\")\n\t}\n\n\tm := &Manager{\n\t\tlookup: make(map[uint32]*Node),\n\t\tconfigs: make(map[uint32]*Configuration),\n\t}\n\n\tfor _, opt := range opts {\n\t\topt(&m.opts)\n\t}\n\n\tfor _, naddr := range nodeAddrs {\n\t\tnode, err2 := m.createNode(naddr)\n\t\tif err2 != nil {\n\t\t\treturn nil, ManagerCreationError(err2)\n\t\t}\n\t\tm.lookup[node.id] = node\n\t\tm.nodes = append(m.nodes, node)\n\t}\n\n\tif m.opts.trace {\n\t\ttitle := strings.Join(nodeAddrs, \",\")\n\t\tm.eventLog = trace.NewEventLog(\"gorums.Manager\", title)\n\t}\n\n\terr := m.connectAll()\n\tif err != nil {\n\t\treturn nil, ManagerCreationError(err)\n\t}\n\n\tif m.opts.logger != nil {\n\t\tm.logger = m.opts.logger\n\t}\n\n\tif m.eventLog != nil {\n\t\tm.eventLog.Printf(\"ready\")\n\t}\n\n\treturn m, nil\n}", "title": "" }, { "docid": "1d1c10554064df654e4471e6f27ae092", "score": "0.53441775", "text": "func New(dir, remote, svcmgr, before, interval string) (*Manager, error) {\n\tif dir == \"\" {\n\t\treturn nil, fmt.Errorf(\"manager: invalid manager configuration (missing spec dir)\")\n\t}\n\n\tif svcmgr == \"\" {\n\t\treturn nil, fmt.Errorf(\"manager: invalid manager configuration (missing service manager)\")\n\t}\n\n\tif before == \"\" {\n\t\treturn nil, fmt.Errorf(\"manager: invalid manager configuration (missing before)\")\n\t}\n\n\tm := &Manager{\n\t\tDir: dir,\n\t\tDefaultRemote: remote,\n\t\tServiceManager: svcmgr,\n\t\tBefore: before,\n\t\tInterval: interval,\n\t}\n\n\treturn setup(m)\n}", "title": "" }, { "docid": "a76e31a6266fa841a28821a1573ef558", "score": "0.53379476", "text": "func NewManager(ctx devspacecontext.Context, configOptions *loader.ConfigOptions) Manager {\n\treturn &manager{\n\t\tresolver: NewResolver(ctx, configOptions),\n\t}\n}", "title": "" }, { "docid": "e1695b6142bcd3825803bcae110dc3d2", "score": "0.5328314", "text": "func NewManager(listname string) *Manager {\n\t//Start the server socket\n\tlog.Infof(\"Listening on '%s'\\n\", listname)\n\tlist, err := net.Listen(\"tcp\", listname)\n\tif err != nil {\n\t\tlog.Error(err)\n\t\tpanic(err)\n\t}\n\tm := new(Manager)\n\tm.getUuid = make(chan int)\n\tm.putUuid = make(chan int)\n\tm.bcMap = make(map[int]*BuilderConnection)\n\tm.sessions = make(map[string]chan interface{})\n\tm.queue = NewBuilderQueue()\n\tm.list = list\n\tm.Incoming = make(chan interface{})\n\tgo m.UUIDGenerator()\n\tgo m.MessageListener()\n\treturn m\n}", "title": "" }, { "docid": "400609bfa086b25f2cbd32602840149d", "score": "0.5325732", "text": "func NewDigitalOceanProvider(domainFilter DomainFilter, dryRun bool) (*DigitalOceanProvider, error) {\n\ttoken, ok := os.LookupEnv(\"DO_TOKEN\")\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"No token found\")\n\t}\n\toauthClient := oauth2.NewClient(oauth2.NoContext, oauth2.StaticTokenSource(&oauth2.Token{\n\t\tAccessToken: token,\n\t}))\n\tclient := godo.NewClient(oauthClient)\n\n\tprovider := &DigitalOceanProvider{\n\t\tClient: client.Domains,\n\t\tdomainFilter: domainFilter,\n\t\tDryRun: dryRun,\n\t}\n\treturn provider, nil\n}", "title": "" }, { "docid": "6582468ed4f41263739744086528ee10", "score": "0.53177464", "text": "func NewManager(ctx context.Context, namespace string, kClient Kubernetes, timeout, interval time.Duration) *Manager {\n\treturn &Manager{\n\t\tkClient: kClient,\n\t\tnamespace: namespace,\n\t\tctx: ctx,\n\t\ttimeout: timeout,\n\t\tinterval: interval,\n\t}\n}", "title": "" }, { "docid": "91b88cb076273463d08934e596738b3c", "score": "0.5313742", "text": "func (self *Creature) Manager() *CreatureManager{\n return &CreatureManager{self.Object.Get(\"manager\")}\n}", "title": "" }, { "docid": "109b0c6c06bc3bc149d4f970433207ca", "score": "0.53041166", "text": "func NewManager(config config.Config) Manager {\n\treturn Manager{\n\t\tConfig: config,\n\t\tPaths: *workflow.NewPaths(config.ComponentsPath, config.BinaryPath, config.TempPath),\n\t\tExecHandler: workflow.GetExecutorHandler(),\n\t\tParser: workflow.NewParser(),\n\t\tInstallRequests: make(map[string]grpc_installer_go.InstallRequest, 0),\n\t\tUninstallRequests: make(map[string]grpc_installer_go.UninstallClusterRequest, 0),\n\t\tOperations: make(map[string]*Operation, 0),\n\t}\n}", "title": "" }, { "docid": "0429a7383e8fd50ba2589a7c98dc03eb", "score": "0.52892333", "text": "func New(\n\tconfig *config.Config,\n\tlogger *simplelogger.SimpleLogger,\n\tclientset *kubernetes.Clientset,\n\tdynClient dynamic.Interface,\n) *Manager {\n\treturn &Manager{\n\t\tconfig,\n\t\tlogger,\n\t\tclientset,\n\t\tdynClient,\n\t}\n}", "title": "" }, { "docid": "b2d745c547cb004dcd7388ef9e354319", "score": "0.5286486", "text": "func (client *CraneDockerClient) ManagerInfo() (types.Info, error) {\n\tvar systemInfo types.Info\n\n\tcontent, err := client.sharedHttpClient.GET(nil, client.swarmManagerHttpEndpoint+\"/info\", nil, nil)\n\tif err != nil {\n\t\treturn systemInfo, cranerror.NewError(CodeGetManagerInfoError, err.Error())\n\t}\n\n\tif err := json.Unmarshal(content, &systemInfo); err != nil {\n\t\treturn systemInfo, cranerror.NewError(CodeGetManagerInfoError, err.Error())\n\t}\n\n\treturn systemInfo, nil\n}", "title": "" }, { "docid": "5775a27846c4dc1bf650ad8da4730c25", "score": "0.5276865", "text": "func New(ctx context.Context, m map[string]interface{}) (auth.Manager, error) {\n\tmanager := &mgr{\n\t\tproviders: make(map[string]*oidc.Provider),\n\t}\n\terr := manager.Configure(m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn manager, nil\n}", "title": "" }, { "docid": "763d19f667fa20366931d842467b5937", "score": "0.5270008", "text": "func New(nodeID, clusterID string, isDev bool, adminUserInfo *config.AdminUser) *Manager {\n\tm := new(Manager)\n\tm.nodeID = nodeID\n\tm.isProd = !isDev // set inverted\n\tm.clusterID = clusterID\n\n\tm.integrations = make(config.Integrations)\n\tm.user = adminUserInfo\n\treturn m\n}", "title": "" }, { "docid": "851a6ff4b4c1a1eb90bc189ced771bfb", "score": "0.5269787", "text": "func NewArgoTunnelManager(config *Config, metricsSetup *MetricsConfig) (Tunnel, error) {\n\n\thaConnections := 1\n\n\tprotocolLogger := log.New()\n\n\ttunnelLogger := log.WithFields(log.Fields{\n\t\t\"service\": config.ServiceName,\n\t}).Logger\n\n\thttpTransport := newHttpTransport()\n\ttlsConfig := &tls.Config{\n\t\tRootCAs: cloudflare.GetCloudflareRootCA(),\n\t\tServerName: \"cftunnel.com\",\n\t}\n\n\ttunnelConfig := origin.TunnelConfig{\n\t\tEdgeAddrs: []string{}, // load default values later, see github.com/cloudflare/cloudflared/blob/master/origin/discovery.go#\n\t\tOriginUrl: \"\",\n\t\tHostname: config.ExternalHostname,\n\t\tOriginCert: config.OriginCert, // []byte{}\n\t\tTlsConfig: tlsConfig,\n\t\tClientTlsConfig: httpTransport.TLSClientConfig, // *tls.Config\n\t\tRetries: 5,\n\t\tHeartbeatInterval: 5 * time.Second,\n\t\tMaxHeartbeats: 5,\n\t\tClientID: utilrand.String(16),\n\t\tBuildInfo: origin.GetBuildInfo(),\n\t\tReportedVersion: version.VERSION,\n\t\tLBPool: config.LBPool,\n\t\tTags: []tunnelpogs.Tag{},\n\t\tHAConnections: haConnections,\n\t\tHTTPTransport: httpTransport,\n\t\tMetrics: metricsSetup.Metrics,\n\t\tMetricsUpdateFreq: metricsSetup.UpdateFrequency,\n\t\tProtocolLogger: protocolLogger,\n\t\tLogger: tunnelLogger,\n\t\tIsAutoupdated: false,\n\t\tGracePeriod: 0, //time.Duration\n\t\tRunFromTerminal: false, // bool\n\n\t}\n\n\tmgr := ArgoTunnelManager{\n\t\tid: utilrand.String(8),\n\t\tconfig: config,\n\t\ttunnelConfig: &tunnelConfig,\n\t\terrCh: make(chan error),\n\t\tstopCh: nil,\n\t}\n\treturn &mgr, nil\n}", "title": "" }, { "docid": "fbc5cb577bfd7cdab751fbcd2ce6d48a", "score": "0.5260748", "text": "func NewManager(plantUMLServerAddr string) (Manager, error) {\n\t// Validate plantUMLServerAddr.\n\t_, err := url.ParseRequestURI(plantUMLServerAddr)\n\tif err != nil {\n\t\treturn nil, newError(ErrInvalidPlantUMLAddress, err)\n\t}\n\n\treturn &manager{serverAddr: plantUMLServerAddr}, nil\n}", "title": "" }, { "docid": "ea4da621f53a73e2ab7092e157a10740", "score": "0.52549875", "text": "func newSimpleConfigManager() configManager {\n\treturn &simpleConfigManager{\n\t\tstore: newStore(),\n\t}\n}", "title": "" }, { "docid": "0e3cb15fd82f76dc294d566645f8b79d", "score": "0.52533877", "text": "func guestOSManager() (pkgOS.Manager, error) {\n\tdist := GetDistribution()\n\tswitch {\n\tcase dist.Name == \"fedora\" && dist.Variant == \"coreos\":\n\t\treturn &pkgOS.OSTree{}, nil\n\tdefault:\n\t\treturn nil, errors.New(\"unsupported OS\")\n\t}\n}", "title": "" }, { "docid": "f4369410fac1b89259c1056ad689483e", "score": "0.5250075", "text": "func GetManager(ctx context.Context, cli client.Client) (*operatorv1.Manager, error) {\n\t// Fetch the manager instance. We only support a single instance named \"tigera-secure\".\n\tinstance := &operatorv1.Manager{}\n\terr := cli.Get(ctx, utils.DefaultTSEEInstanceKey, instance)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif instance.Spec.Auth != nil && instance.Spec.Auth.Type != operatorv1.AuthTypeToken {\n\t\treturn nil, fmt.Errorf(\"auth types other than 'Token' can no longer be configured using the Manager CR, \" +\n\t\t\t\"please use the Authentication CR instead\")\n\t}\n\treturn instance, nil\n}", "title": "" }, { "docid": "9b8c5e0e1c9f2429472c27426e02a3b1", "score": "0.52484673", "text": "func NewManager(r Repository) *manager {\r\n\treturn &manager{\r\n\t\trepo: r,\r\n\t}\r\n}", "title": "" }, { "docid": "d866b63e7b99da83cda4f65a7e02d21e", "score": "0.5246762", "text": "func NewManager() *Manager {\n\treturn &Manager{\n\t\tflags: make(map[Entity]ComponentFlags, 0),\n\t\tcomponents: make(map[Entity][]Component, 0),\n\t}\n}", "title": "" }, { "docid": "d0b8fff08b473518869fe3e6b82312b3", "score": "0.5244115", "text": "func NewManager(configFile string, initialConfig interface{}) *Manager {\n\tupdateQueue := make(chan update, 100)\n\tmanager := &Manager{\n\t\tConfig: initialConfig,\n\t\tconfigFile: configFile,\n\t\tupdateQueue: updateQueue,\n\t}\n\n\t// Single goroutine that updates the Config data and saves the data to the config file.\n\tgo manager.configUpdater(updateQueue)\n\n\treturn manager\n}", "title": "" }, { "docid": "6d5e827068cf48fa350f39b40235c396", "score": "0.522708", "text": "func NewOSManager(opts ManagerOpts) (pkgOS.Manager, error) {\n\t// If a VM name is specified, then we know that we are not inside a\n\t// Podman VM, but rather outside of it.\n\tif machineconfig.IsPodmanMachine() && opts.VMName == \"\" {\n\t\treturn guestOSManager()\n\t}\n\treturn machineOSManager(opts)\n}", "title": "" }, { "docid": "91e82245e45a619007d6701f56c1038c", "score": "0.5222139", "text": "func NewManager(t mockConstructorTestingTNewManager) *Manager {\n\tmock := &Manager{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "91e82245e45a619007d6701f56c1038c", "score": "0.5222139", "text": "func NewManager(t mockConstructorTestingTNewManager) *Manager {\n\tmock := &Manager{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "0a31b73fab167bf69d1862d28fe52010", "score": "0.52215815", "text": "func NewManager(ctx context.Context, etcdURLs []string, certPubPath string, certKeyPath string, txnTimeoutMs time.Duration, group string, slots uint64) (*Manager, error) {\n\ttlsInfo := transport.TLSInfo{\n\t\tCertFile: certPubPath,\n\t\tKeyFile: certKeyPath,\n\t}\n\n\ttlsConfig, err := tlsInfo.ClientConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient, err := clientv3.New(clientv3.Config{\n\t\tEndpoints: etcdURLs,\n\t\tDialTimeout: time.Duration(txnTimeoutMs) * time.Millisecond,\n\t\tTLS: tlsConfig,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tkeyPath := fmt.Sprintf(keyTemplate, url.QueryEscape(group))\n\tmanager := Manager{client, keyPath}\n\n\tif err := manager.ensureInit(ctx, slots); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &manager, nil\n}", "title": "" }, { "docid": "6cb3581d0923767bef996c40a1c5f023", "score": "0.5218524", "text": "func NewManager(ctx context.Context, logger log.Logger, options ...func(*Manager)) *Manager {\n\tif logger == nil {\n\t\tlogger = log.NewNopLogger()\n\t}\n\tmgr := &Manager{\n\t\tlogger: logger,\n\t\tsyncCh: make(chan map[string][]*targetgroup.Group),\n\t\ttargets: make(map[poolKey]map[string]*targetgroup.Group),\n\t\tctx: ctx,\n\t\tupdatert: 5 * time.Second,\n\t\ttriggerSend: make(chan struct{}, 1),\n\t}\n\tfor _, option := range options {\n\t\toption(mgr)\n\t}\n\treturn mgr\n}", "title": "" }, { "docid": "15c6c628903b677ba445cf459d60eed7", "score": "0.5218519", "text": "func NewManager(start, shutdown interface{}, ignore ...func(error) bool) (Manager, error) {\n\tvar err error\n\tvar st, sh func(context.Context) error\n\tif start != nil {\n\t\tst, err = convf(start)\n\t\tif err != nil {\n\t\t\treturn Manager{}, err\n\t\t}\n\t}\n\tif shutdown != nil {\n\t\tsh, err = convf(shutdown)\n\t\tif err != nil {\n\t\t\treturn Manager{}, err\n\t\t}\n\t}\n\treturn Manager{\n\t\tstart: st,\n\t\tshutdown: sh,\n\t\tignore: ignore,\n\t}, nil\n}", "title": "" }, { "docid": "fb6f8e190190a9af1539ff269e89ec54", "score": "0.52166456", "text": "func NewConfigMgr(paramsDir string, logger *logging.Writer) *ConfigMgr {\n\tmgr := new(ConfigMgr)\n\tmgr.logger = logger\n\tmgr.paramsDir = paramsDir\n\n\tmgr.dbHdl = objects.InstantiateDbIf(logger)\n\tif mgr.dbHdl == nil {\n\t\tlogger.Err(\"Error initializing configMgr dbHdl\")\n\t\treturn nil\n\t}\n\n\tmgr.clientMgr = clients.InitializeClientMgr(paramsDir, logger,\n\t\tGetSystemStatus,\n\t\tGetSystemSwVersion,\n\t\tactions.ExecuteConfigurationAction)\n\tif mgr.clientMgr == nil {\n\t\tlogger.Err(\"Error initializing clientMgr\")\n\t\treturn nil\n\t}\n\n\tobjects.CreateObjectMap()\n\tobjectConfigFiles := [...]string{paramsDir + \"/genObjectConfig.json\"}\n\tmgr.objectMgr = objects.InitializeObjectMgr(objectConfigFiles[:], logger,\n\t\tmgr.dbHdl, mgr.clientMgr)\n\tif mgr.objectMgr == nil {\n\t\tlogger.Err(\"Error initializing objectMgr\")\n\t\treturn nil\n\t}\n\n\tactions.CreateActionMap()\n\tactionConfigFiles := [...]string{paramsDir + \"/genObjectAction.json\"}\n\tmgr.actionMgr = actions.InitializeActionMgr(paramsDir, actionConfigFiles[:], logger,\n\t\tmgr.dbHdl, mgr.objectMgr, mgr.clientMgr)\n\tif mgr.actionMgr == nil {\n\t\tlogger.Err(\"Error initializing actionMgr\")\n\t\treturn nil\n\t}\n\n\tmgr.ApiMgr = apis.InitializeApiMgr(paramsDir, logger,\n\t\tmgr.dbHdl, mgr.clientMgr, mgr.objectMgr, mgr.actionMgr)\n\tif mgr.ApiMgr == nil {\n\t\tlogger.Err(\"Error initializing ApiMgr\")\n\t\treturn nil\n\t}\n\n\tmgr.ApiMgr.InitializeRestRoutes()\n\tmgr.ApiMgr.InitializeActionRestRoutes()\n\tmgr.ApiMgr.InitializeEventRestRoutes()\n\tmgr.ApiMgr.InstantiateRestRtr()\n\n\tmgr.bringUpTime = time.Now()\n\t// Initialize channel to receive connected client name.\n\t// When confd connects to a client, it creates autocreate objects owned by that client and\n\t// stores default logging level for that client in DB, if it does not exist.\n\t// Autocreate objects and logging objects can only be updated by user.\n\t// Also, confd discovers all the discoverable objects from that client and stores in DB.\n\tmgr.clientNameCh = make(chan string, 10)\n\tlogger.Info(\"Initialization Done!\")\n\n\tmgr.ReadSystemSwVersion()\n\tgo mgr.AutoCreateConfigObjects()\n\tgo mgr.clientMgr.ListenToClientStateChanges()\n\tgo mgr.clientMgr.ConnectToAllClients(mgr.clientNameCh)\n\tgo mgr.SigHandler()\n\tgConfigMgr = mgr\n\n\treturn mgr\n}", "title": "" }, { "docid": "afcef67635e53e864aaf5e0b7f2c376b", "score": "0.52146566", "text": "func NewManager(name string) (Manager, error) {\n\tqpMu.RLock()\n\tdefer qpMu.RUnlock()\n\n\tf, exists := qpByName[name]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"unknown quota system: %v\", name)\n\t}\n\treturn f()\n}", "title": "" }, { "docid": "27bb1f60732857eac99aaed69db5744b", "score": "0.521002", "text": "func NewManager(generators []Generator, client api.Client) *Manager {\n\treturn &Manager{\n\t\tcollector: newCollector(generators),\n\t\tsender: newSender(client),\n\t}\n}", "title": "" }, { "docid": "27bb1f60732857eac99aaed69db5744b", "score": "0.521002", "text": "func NewManager(generators []Generator, client api.Client) *Manager {\n\treturn &Manager{\n\t\tcollector: newCollector(generators),\n\t\tsender: newSender(client),\n\t}\n}", "title": "" }, { "docid": "f5f2047348af7a5541a897daee370f8a", "score": "0.5203572", "text": "func newTrainerManager(ctx context.Context, host, port string) (*trainerManager, error) {\n\turi := fmt.Sprintf(\"mongodb://%s:%s\", host, port)\n\tclientOptions := options.Client().ApplyURI(uri)\n\n\tclient, err := mongo.Connect(ctx, clientOptions)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error connecting to mongo: %s\", err)\n\t}\n\n\tcollection := client.Database(\"test\").Collection(\"trainers\")\n\n\treturn &trainerManager{\n\t\tclient: client,\n\t\tcollection: collection,\n\t}, nil\n}", "title": "" }, { "docid": "e9b50e874ad6df7c84d31a1522908990", "score": "0.5200699", "text": "func NewManager(db hub.DB) *Manager {\n\treturn &Manager{\n\t\tdb: db,\n\t}\n}", "title": "" }, { "docid": "7cb4f1f36237aeaf14fafe9117a3a9e7", "score": "0.5196146", "text": "func NewManager(mgr manager.Manager, ops Options) error {\n\tcertManager, err := newManager(ops)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// If a manager is provided, add the certificate manager to the manager,\n\t// else start the cert manager immediately.\n\tif mgr != nil {\n\t\treturn mgr.Add(certManager)\n\t}\n\n\treturn certManager.Start(context.Background())\n}", "title": "" }, { "docid": "aec871ebf30de95974c625eb409bc95d", "score": "0.518932", "text": "func newDefaultPodManager(host knetwork.Host) *podManager {\n\treturn &podManager{\n\t\trunningPods: make(map[string]*kubehostport.RunningPod),\n\t\trequests: make(chan *cniserver.PodRequest, 20),\n\t\thost: host,\n\t}\n}", "title": "" }, { "docid": "13a61202d880898125a0ad424968001a", "score": "0.51769245", "text": "func NewManger(nc *natsgo.Conn) *Manager {\n\treturn &Manager{\n\t\tnc: nc,\n\t}\n}", "title": "" } ]
c32d5867b43a6264a4c2e862dec8e2f1
IsEmpty check whether the Tx is empty
[ { "docid": "d9622a757516abbeda26f24e5af27e5b", "score": "0.7809512", "text": "func (tx ObservedTx) IsEmpty() bool {\n\treturn tx.Tx.IsEmpty()\n}", "title": "" } ]
[ { "docid": "3d8eb4d597a37a1c6f1b75d04896f4f0", "score": "0.7466739", "text": "func (q *MemTxQueue) empty() bool {\n\treturn len(q.txs) == 0\n}", "title": "" }, { "docid": "79f6921fc29dcf39f71ba9cfa85342eb", "score": "0.7026862", "text": "func (l *txList) Empty() bool {\n\treturn l.Len() == 0\n}", "title": "" }, { "docid": "5067da2e6d011a11faf7b4b45c6200d5", "score": "0.7010837", "text": "func (q *QueueSPN) Empty() bool { return len(q.data) == 0 }", "title": "" }, { "docid": "b3e1d01b5ff1caceca07c4912dd26311", "score": "0.69916207", "text": "func (atx *addressTxns) isEmpty(tx *dbutil.Tx) (bool, error) {\n\treturn dbutil.IsEmpty(tx, AddressTxnsBkt)\n}", "title": "" }, { "docid": "0d41733104ea9ef32770158af78d4078", "score": "0.6949332", "text": "func (r TxResponse) Empty() bool {\n\treturn r.TxHash == \"\" && r.Logs == nil\n}", "title": "" }, { "docid": "81728af1dc1aca6d28a043b93e9113b5", "score": "0.6947335", "text": "func (gsm GraphSyncMessage) Empty() bool {\n\treturn len(gsm.blocks) == 0 && len(gsm.requests) == 0 && len(gsm.responses) == 0\n}", "title": "" }, { "docid": "3f7a85f90a82b09d2a34c14f7adfe665", "score": "0.69231445", "text": "func (this *MsgQueue) isEmpty() bool {\n\tif this.msgCount == 0 {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "d97220ab1671fd2a2e0a57eb0eaed9f9", "score": "0.691175", "text": "func (stateDB *StateDBAdapter) Empty(evmAddr common.Address) bool {\n\taddr, err := address.FromBytes(evmAddr.Bytes())\n\tif err != nil {\n\t\tlog.L().Error(\"Failed to convert evm address.\", zap.Error(err))\n\t\treturn true\n\t}\n\tlog.L().Debug(\"Check whether the contract is empty.\")\n\ts, err := stateDB.AccountState(addr.String())\n\tif err != nil {\n\t\treturn true\n\t}\n\t// TODO: delete hash.ZeroHash256\n\treturn s.IsNewbieAccount() &&\n\t\ts.Balance.Sign() == 0 &&\n\t\t(len(s.CodeHash) == 0 || bytes.Equal(s.CodeHash, hash.ZeroHash256[:]))\n}", "title": "" }, { "docid": "8a2254678ac2381f44cf134f7cdf48a0", "score": "0.69004697", "text": "func (q *QueueBFSPair) Empty() bool { return len(q.data) == 0 }", "title": "" }, { "docid": "9db45c4d2943e413fe5adfe2a0a9dfd5", "score": "0.6840514", "text": "func (t *TwoThreeTree) Empty() bool { return t.count == 0 }", "title": "" }, { "docid": "3e8387aa58a6d51329cd6ced9bca8f9a", "score": "0.6800888", "text": "func (q *queue) isEmpty() bool {\n\treturn len(q.data) == 0\n}", "title": "" }, { "docid": "1c4e141282c3d8d5285ea73b4f0759fe", "score": "0.6786774", "text": "func (ring *Buffer) Empty() bool {\n\treturn ring.senderCount.Len() == 0\n}", "title": "" }, { "docid": "9079934e2bedf9da74328da843dcc4f3", "score": "0.6764035", "text": "func (this *MyStack) Empty() bool {\n\tif len(this.enqueue) == 0 && len(this.dequeue) == 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "59c49bc9e40594601c69544906a1c042", "score": "0.6725241", "text": "func (this *MyQueue) Empty() bool {\n\tfmt.Println(len(this.s))\n\tif len(this.s) != 0 {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "8cd11457348f09163ecb5b2add148606", "score": "0.6722826", "text": "func (q *queue) isEmpty() bool {\n\treturn len(q.nodes) == 0\n}", "title": "" }, { "docid": "6e373d717bf3787c7172bd00ff729af8", "score": "0.6721202", "text": "func (h *hamtBase) IsEmpty() bool {\n\t//return h.root == nil\n\treturn h.nentries == 0\n}", "title": "" }, { "docid": "f3ac4ce1373c59481560099d0a71d4a1", "score": "0.67171484", "text": "func (avl *AVL[T]) Empty() bool {\n\treturn avl.Root == avl._NIL\n}", "title": "" }, { "docid": "9c6aa4602a3e57ccc99c317f10cac3a0", "score": "0.67007923", "text": "func (this *MyStack) Empty() bool {\n\treturn len(this.q)==0\n}", "title": "" }, { "docid": "8499ea58f4ef0f2e69a4fcaa18a33a58", "score": "0.66926384", "text": "func (mq *MyQueue) Empty() bool {\n\treturn len(mq.stackOut) == 0 && len(mq.stackIn) == 0\n}", "title": "" }, { "docid": "268e66728911db8e0b706453539c21ae", "score": "0.6680761", "text": "func (s *Stack) isEmpty() bool {\n\tif s.count == 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c549f6fc7944653e10b27135ebe0bae8", "score": "0.66783845", "text": "func (this *MyQueue) Empty() bool {\n\treturn this.out.Size() == 0 && this.in.Size() == 0\n}", "title": "" }, { "docid": "4e475e22910b073d664f589e0434a44e", "score": "0.66618335", "text": "func (s shoppingList) isEmpty() bool {\n\treturn !s.needMerkleRefresh && len(s.generations) == 0 && len(s.downPointers) == 0\n}", "title": "" }, { "docid": "27feafea4fd20620052481ebf82ed2f5", "score": "0.6658104", "text": "func (this *MyQueue) Empty() bool {\n\tif len(this.StrackOut) == 0 && len(this.StrackIn) == 0{\n\t\treturn true\n\t}\n\n\treturn false\n\n}", "title": "" }, { "docid": "533a060a9023b784a0fef461d6c23171", "score": "0.66539675", "text": "func (this *MyStack) Empty() bool {\n\treturn len(this.q) == 0\n}", "title": "" }, { "docid": "dffcd73156eca6bbc8414c78eb3628a7", "score": "0.6649858", "text": "func (this *MyQueue) Empty() bool {\n\tif len(this.stackin) == 0 && len(this.stackout) == 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "40970bbb0e957775d8172446c07c1dba", "score": "0.6644794", "text": "func (tree *Tree) Empty() bool {\n\treturn tree.size == 0\n}", "title": "" }, { "docid": "c17693696978d7d244e48e100c821c72", "score": "0.6630646", "text": "func (mrtlr ModernReservationTransactionsListResult) IsEmpty() bool {\n\treturn mrtlr.Value == nil || len(*mrtlr.Value) == 0\n}", "title": "" }, { "docid": "0bcb5a40016118341d64d4610abcd9a2", "score": "0.66276664", "text": "func (this *MyStack) Empty() bool {\n\treturn this.queue.length==0\n}", "title": "" }, { "docid": "7b8c82ad14044aaf941717e7168bfed9", "score": "0.66213673", "text": "func (s *Stack) IsEmpty() bool {\n return s.size == 0\n}", "title": "" }, { "docid": "9861d42fe7c68980b47beb9d039a2ef6", "score": "0.66105175", "text": "func (coins Coins) Empty() bool {\n\treturn len(coins) == 0\n}", "title": "" }, { "docid": "e36b527b50da7e47793a7bcc80efb856", "score": "0.6608823", "text": "func (this *MyStack) Empty() bool {\n if len(this.a)==0 {\n return true\n }\n return false\n}", "title": "" }, { "docid": "beccd966d591af08ce705e38841bcbd6", "score": "0.6604767", "text": "func (s *Stack) Empty() bool {\n\treturn s.length <= 0\n}", "title": "" }, { "docid": "29a9dd223e61e37f163c3fe1f2fcf759", "score": "0.66026", "text": "func (q *QueueInteger) Empty() bool { return len(q.data) == 0 }", "title": "" }, { "docid": "963faef5a50938b09313f18228912b86", "score": "0.65779424", "text": "func (this *MyStack) Empty() bool {\n\treturn this.in.isEmpty() && this.out.isEmpty()\n}", "title": "" }, { "docid": "6536905aed2e399410566dea095ae772", "score": "0.65559876", "text": "func (s *Stack) Empty() bool {\n\tif len(s.data) > 0 {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "514c944c1b3566245bc437f27de70ff2", "score": "0.6550204", "text": "func (s *stateObject) empty() bool {\n\treturn s.data.Nonce == 0 && s.data.Balance.Sign() == 0 && bytes.Equal(s.data.CodeHash, emptyCodeHash)\n}", "title": "" }, { "docid": "7e13c2fc2d924d022e3fbeb108e29365", "score": "0.65487564", "text": "func (s *stack) isEmpty() bool {\n\treturn len(s.nodes) == 0\n}", "title": "" }, { "docid": "8b7b63b8f679dd48d109082b2a339fd5", "score": "0.65450025", "text": "func (this *Stack) Empty() bool {\n\treturn this.Length() == 0\n}", "title": "" }, { "docid": "41db59ad3df4127d6470874d599ed4df", "score": "0.6542368", "text": "func (s *violationStash) Empty() bool {\n\tfor _, data := range s.Stash {\n\t\tif data.Len() > 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "ee2aaf2dd0fbde34671869d2a3a8adc3", "score": "0.6539394", "text": "func (s *Stack[T]) IsEmpty() bool {\n\treturn s.Size() == 0\n}", "title": "" }, { "docid": "07db927c2f506905be0399f0eb79e0d1", "score": "0.65376824", "text": "func (q *Queue) Empty() bool {\n return (q.count == 0)\n}", "title": "" }, { "docid": "64bfbcec54fbefae0bbdf53471f27cee", "score": "0.6537175", "text": "func (q *Stack) Empty() bool {\n\treturn q.Size() == 0\n}", "title": "" }, { "docid": "ac11e25ab508c018a7d43eb6dd8a1680", "score": "0.6527793", "text": "func (this *MyQueue) Empty() bool {\n\treturn this.s1.Len() == 0 && this.s2.Len() == 0\n}", "title": "" }, { "docid": "c19c3a6a90fa3537e498d3795a96db3f", "score": "0.6521194", "text": "func (s *ssStruct) Empty() bool {\n\ts.l.RLock()\n\tdefer s.l.RUnlock()\n\ttruthy := s.indx == 0\n\treturn truthy\n}", "title": "" }, { "docid": "8d44d7200ebd03f98ae4dc9efe0d2964", "score": "0.6521158", "text": "func (kvs KVS) Empty() bool {\n\treturn len(kvs) == 0\n}", "title": "" }, { "docid": "0eaf0153e458c563e0d5b87f863ef401", "score": "0.6518774", "text": "func (sk *Stack) Empty() bool {\n\treturn sk.size == 0\n}", "title": "" }, { "docid": "e9717028d5c8785cf141b31aa6b20a85", "score": "0.65139157", "text": "func (this *MyQueue) Empty() bool {\n\treturn len(this.stack1) == 0\n}", "title": "" }, { "docid": "7af98bbcab2f748e50b12039c8a2f9d4", "score": "0.6512506", "text": "func (c *ConsumedCapacity) Empty() bool {\n\tif c == nil {\n\t\treturn true\n\t}\n\tif ((c.Table == nil) || (c.Table.CapacityUnits == 0)) &&\n\t\tlen(c.LocalSecondaryIndexes) == 0 &&\n\t\tlen(c.GlobalSecondaryIndexes) == 0 &&\n\t\tc.TableName == \"\" &&\n\t\tc.CapacityUnits == 0 {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "4c0f6ef8d377550aad6ff5bb007a617b", "score": "0.65122795", "text": "func (kt *KeyTool) IsEmpty() bool {\n\treturn len(kt.storeBytes) == 0\n}", "title": "" }, { "docid": "9948977248d02034e306f8f57b2287b4", "score": "0.6511853", "text": "func (myQueue *MyQueue) Empty() bool {\n\treturn len(myQueue.inStack)+len(myQueue.outStack) == 0\n}", "title": "" }, { "docid": "048dde946af607459962d86bd52d7dc7", "score": "0.6510627", "text": "func (rtlr ReservationTransactionsListResult) IsEmpty() bool {\n\treturn rtlr.Value == nil || len(*rtlr.Value) == 0\n}", "title": "" }, { "docid": "c198a5f66fab56791650b4f0c8ed3c51", "score": "0.65099967", "text": "func (enc *encoder) Empty() bool {\n\treturn enc.os.Empty()\n}", "title": "" }, { "docid": "886e3930a435faaeb7e006b96f45e68f", "score": "0.6509223", "text": "func (this *MyQueue) Empty() bool {\n\treturn len(this.stack)==0&&len(this.back)==0\n}", "title": "" }, { "docid": "d5088b72ccf36ae18b57c48665d9f13f", "score": "0.65046656", "text": "func (s *stack) IsEmpty() bool {\n\treturn s.size == 0\n}", "title": "" }, { "docid": "3cca4746e5db6301e9dd03427526ecb0", "score": "0.65042496", "text": "func (this *MyQueue) Empty() bool {\n\treturn this.InStack.Empty() && this.OutStatck.Empty()\n}", "title": "" }, { "docid": "a525064c1e83d4d02717bb0bd85f4a30", "score": "0.64946485", "text": "func (set *SetStringThreadSafeNoGC) Empty() bool {\n\treturn set.Size() == 0\n}", "title": "" }, { "docid": "941c329ad7bcc25642f9c6a95dc938a3", "score": "0.6491613", "text": "func (this *MyQueue) Empty() bool {\n\treturn this.size == 0\n}", "title": "" }, { "docid": "cab812685e61957d4507f7a59c0dbdd0", "score": "0.6481334", "text": "func (t *Table) Empty() bool {\n\treturn t.data.Empty()\n}", "title": "" }, { "docid": "30f84c6f7c1dded62e5a03b3a988a2f1", "score": "0.64786726", "text": "func (s *Stack) Empty() bool {\n\treturn s.size == 0\n}", "title": "" }, { "docid": "c616bfbd892837a59ac056e9e0b10e4e", "score": "0.647619", "text": "func (s *MyStack) Empty() bool {\n\treturn s.Q.IsEmpty()\n}", "title": "" }, { "docid": "41e436443fd3dff4a0e40530ceaf9e02", "score": "0.64726055", "text": "func (queue *MyQueue) Empty() bool {\n\treturn queue.Input.isEmpty() && queue.Output.isEmpty()\n}", "title": "" }, { "docid": "c170b1b46601612d8c1a98591956123e", "score": "0.64706314", "text": "func (this *MyStack) Empty() bool {\n\treturn len(this.queue) == 0\n}", "title": "" }, { "docid": "c170b1b46601612d8c1a98591956123e", "score": "0.64706314", "text": "func (this *MyStack) Empty() bool {\n\treturn len(this.queue) == 0\n}", "title": "" }, { "docid": "c170b1b46601612d8c1a98591956123e", "score": "0.64706314", "text": "func (this *MyStack) Empty() bool {\n\treturn len(this.queue) == 0\n}", "title": "" }, { "docid": "28c2ec22ec4532f567762e2f17bb7f0d", "score": "0.6465346", "text": "func (t *Tree) IsEmpty() bool {\n\treturn t.size == 0\n}", "title": "" }, { "docid": "ec70838ebf609e4d39f74a24057c9407", "score": "0.6459144", "text": "func (s *tokenStack) isEmpty() bool {\n\tif len(s.Stack) <= 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7850af1ac44c78ecb2f28259b4a950cc", "score": "0.64548415", "text": "func (l *stack) IsEmpty() bool {\n\tif l.count == 0 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "ab578513c2dd4816f51e937fe8524bfa", "score": "0.64524", "text": "func (q *queue) Empty() bool {\n\treturn q.Len() == 0\n}", "title": "" }, { "docid": "65b033e36cedbad55c4cc81634c01c7c", "score": "0.6449045", "text": "func (s *Stack[T]) IsEmpty() bool {\n\treturn len(*s) == 0\n}", "title": "" }, { "docid": "967cec4e6911303eed9ab9e03b8d95bc", "score": "0.6447494", "text": "func (q *QueueByArray) IsEmpty() bool {\r\n\treturn q.count == 0\r\n}", "title": "" }, { "docid": "a03af3a9a07f15046e84c86c848bf47a", "score": "0.6446518", "text": "func (st *State) Empty(string, common.Address) bool { return true }", "title": "" }, { "docid": "954b4d41ebe155986da9fd82307fbadf", "score": "0.644313", "text": "func (tss *TssKeysignFailVoter) Empty() bool {\n\treturn len(tss.ID) == 0 || tss.Height == 0\n}", "title": "" }, { "docid": "0495b4594268c88a80793a3d8140f897", "score": "0.64427173", "text": "func (this *MyQueue) Empty() bool {\n\treturn len(this.stack) == 0 && len(this.back) == 0\n}", "title": "" }, { "docid": "0495b4594268c88a80793a3d8140f897", "score": "0.64427173", "text": "func (this *MyQueue) Empty() bool {\n\treturn len(this.stack) == 0 && len(this.back) == 0\n}", "title": "" }, { "docid": "fef4712b2ce9462c052a0acac650a9d0", "score": "0.6441186", "text": "func (mq *MyQueue) Empty() bool {\r\n\treturn mq.Data.Empty() && mq.Helper.Empty()\r\n}", "title": "" }, { "docid": "76c9893078497e8c7fcfc0dd62f2651d", "score": "0.6440581", "text": "func (this *MyStack) Empty() bool {\n\tif len(this.Queue) > 0 {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "c38458c1e93507c12b1ad30a8a250417", "score": "0.6435503", "text": "func (t TableTrak) IsEmpty() bool {\n\treturn len(t.Horizontal.Entries)+len(t.Vertical.Entries) == 0\n}", "title": "" }, { "docid": "34ff31b305b8baaf34fb1522f6a3f108", "score": "0.6413033", "text": "func (b *RestoreInputBuilder) Empty() bool {\n\treturn b.buf.Len() == 0\n}", "title": "" }, { "docid": "89077a2fb697c65dc3fee430559a52b1", "score": "0.641256", "text": "func (s *stack) IsEmpty() bool {\n\treturn s.Size() == 0\n}", "title": "" }, { "docid": "725b4945b455a2aa34b5287673e8c685", "score": "0.6410502", "text": "func (queue *MyQueue) Empty() bool {\n\treturn len(queue.popStack) == 0 && len(queue.pushStack) == 0\n}", "title": "" }, { "docid": "e296312fb273170b4231ddaf4baec9b3", "score": "0.64097387", "text": "func (this *MyQueue) Empty() bool {\n\treturn len(this.stack) == 0\n}", "title": "" }, { "docid": "5e6f5c1e9ce9849052359c3c42b81862", "score": "0.6407636", "text": "func (r *RingHash) IsEmpty() bool {\n\tfor itr := r.nodes.Iterator();itr.HasNext(); {\n \t_, node, _ := itr.Next()\n // inactive nodes may still be recorded in system\n if node.(*Node).isAlive(){\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "7fde637b7fe9f215a459fbc9f235ebfc", "score": "0.6404128", "text": "func (f *SyncFilter) Empty() bool {\n\tfor i := 0; i < len(f.b); i++ {\n\t\tfor j := 0; j < blockWords; j++ {\n\t\t\tif atomic.LoadUint32(&f.b[i][j]) != 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "1e57d4ce5c87b8e10920753da9a46987", "score": "0.6402309", "text": "func (this *QueueWithStacks) Empty() bool {\n\treturn this.out_stack.isEmpty() && this.in_stack.isEmpty()\n}", "title": "" }, { "docid": "7a2ae004e595046ee348722532fd0a99", "score": "0.6401778", "text": "func (q *IdQueue) IsEmpty() bool {\n\treturn len(q.items) == 0\n}", "title": "" }, { "docid": "24f98e782320b1b63be8072ecdd9f15e", "score": "0.6401238", "text": "func (this *MyQueue) Empty() bool {\n\treturn len(this.pushStack) == 0 && len(this.popStack) == 0\n}", "title": "" }, { "docid": "87ca43f662c606d50afce0b8775d1c85", "score": "0.63968545", "text": "func (q *arrayQueue[T]) IsEmpty() bool {\n\treturn q.listSize == 0\n}", "title": "" }, { "docid": "7435f8db8fd2a09e05626f3bd3120abe", "score": "0.63966364", "text": "func (q *Queue) Empty() bool {\n\tif q.count == 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6a3df49cef3181b04b5278e024e975aa", "score": "0.63930565", "text": "func (q *SynchronousQueue) IsEmpty() bool {\n\treturn true\n}", "title": "" }, { "docid": "ad923520745d78d9be802ed76d9b7a0b", "score": "0.6384728", "text": "func (s *Stack) IsEmpty() bool{\n\treturn s.len == 0\n}", "title": "" }, { "docid": "deb2ee0ed4f9520131dae8c2f11f22d9", "score": "0.63828564", "text": "func (s *FixedStack) Empty() bool {\n\treturn s.len == 0\n}", "title": "" }, { "docid": "b743d8d23c2baecb56c8ac300d222439", "score": "0.6381186", "text": "func (s *Stack)IsEmpty() bool {\n\treturn s.top == -1\n}", "title": "" }, { "docid": "59e1fd84696b4f6d049df81aebd016c7", "score": "0.6380427", "text": "func (this *MyStack) Empty() bool {\n\tif len(this.queueB) == 0 && len(this.queueA) == 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "8c4fe3fd98e51a6ab8d0f93bacc5d4e9", "score": "0.6380101", "text": "func (s *FixedLengthStack) Empty() bool {\n\treturn s.d == 0\n}", "title": "" }, { "docid": "5ca956ed735b02d87fa0fe0c873a7938", "score": "0.6375374", "text": "func (t *RB[T]) Empty() bool {\n\treturn t.Root == t._NIL\n}", "title": "" }, { "docid": "d4db58d57901316bf5c7cef341dcf7a5", "score": "0.6374209", "text": "func (q *queue) empty() bool {\n\treturn (len(*q) == 0)\n}", "title": "" }, { "docid": "ecd0e38df09f382b479a5a8895fab0f0", "score": "0.637242", "text": "func (is Items) Empty() bool {\n\treturn len(is) == 0\n}", "title": "" }, { "docid": "4acd80513fb6f47e73d4c695d426e316", "score": "0.636687", "text": "func (q *dequeue) isEmpty() bool {\n\treturn q.queue.Empty()\n}", "title": "" }, { "docid": "b2c381bc5880b3bbe68206d0593a33b2", "score": "0.6364618", "text": "func (s *Stack) empty() bool {\n\treturn s.H == 0\n}", "title": "" }, { "docid": "67418804673e5a4111cc47be289690c1", "score": "0.6364432", "text": "func (this *MyQueue) Empty() bool {\n return len(this.stack1) == 0 && len(this.stack2) == 0\n}", "title": "" } ]
4dcfe02579fdfe2c8df2b155e74f7111
SetMetricStatus adds the metricStatus to the iscsi service collection get params
[ { "docid": "eecfbf29d7983c56d909b754cf5222bd", "score": "0.6855307", "text": "func (o *IscsiServiceCollectionGetParams) SetMetricStatus(metricStatus *string) {\n\to.MetricStatus = metricStatus\n}", "title": "" } ]
[ { "docid": "d0e5c9cd629c579a4a1a9befe0ae0fa6", "score": "0.6377677", "text": "func (o *IscsiServiceCollectionGetParams) WithMetricStatus(metricStatus *string) *IscsiServiceCollectionGetParams {\n\to.SetMetricStatus(metricStatus)\n\treturn o\n}", "title": "" }, { "docid": "51438e66312240b98e4508f5a3bcd741", "score": "0.5863146", "text": "func (o *NodesGetParams) SetMetricStatus(metricStatus *string) {\n\to.MetricStatus = metricStatus\n}", "title": "" }, { "docid": "835991b11d763aea0f3a2ff0d7c8b7ee", "score": "0.58601975", "text": "func (c *ClusterService) SetStatus(status int) {\n env.Output.WriteChDebug(\"(ClusterService::SetStatus) Set value\")\n c.Status = status\n}", "title": "" }, { "docid": "5a06fcbaa9955b0cfee80b547cd9c855", "score": "0.5781085", "text": "func (p *Proxy) incStatusMetric(service, path string, status int) {\n\tif _, ok := p.StatusPerServiceAndPath[service]; !ok {\n\t\tp.StatusPerServiceAndPath[service] = make(map[string]map[int]int)\n\t}\n\tif _, ok := p.StatusPerServiceAndPath[service][path]; !ok {\n\t\tp.StatusPerServiceAndPath[service][path] = make(map[int]int)\n\t}\n\tp.StatusPerServiceAndPath[service][path][status]++\n\tif status >= 400 {\n\t\tp.TotalErrors++\n\t}\n}", "title": "" }, { "docid": "21dd57a1d8f5d61a114aeaec039db346", "score": "0.5742274", "text": "func (m *Operation) SetStatus(value *OperationStatus)() {\n m.status = value\n}", "title": "" }, { "docid": "fc96d7d3eef0de36f47e332726e97b2f", "score": "0.5611061", "text": "func (m *ConnectionOperation) SetStatus(value *ConnectionOperationStatus)() {\n m.status = value\n}", "title": "" }, { "docid": "93b36168fd7c736dde80e19bde0fc85f", "score": "0.549937", "text": "func (m *PrivilegedRoleSummary) SetStatus(value *RoleSummaryStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "ea703f88b0b621cdc4280cc54ff86279", "score": "0.5485736", "text": "func (m *DataPolicyOperation) SetStatus(value *DataPolicyOperationStatus)() {\n m.status = value\n}", "title": "" }, { "docid": "f9ba0a16fbf0a1f84b3bb06e1a392b22", "score": "0.5447974", "text": "func (c *wmicommon) setStatus(metrics cgm.Metrics, err error) {\n\tc.Lock()\n\tif err == nil {\n\t\tc.lastError = \"\"\n\t\tc.lastMetrics = metrics\n\t} else {\n\t\tc.lastError = err.Error()\n\t\t// on error, ensure metrics are reset\n\t\t// do not keep returning a stale set of metrics\n\t\tc.lastMetrics = cgm.Metrics{}\n\t}\n\tc.lastEnd = time.Now()\n\tif !c.lastStart.IsZero() {\n\t\tc.lastRunDuration = time.Since(c.lastStart)\n\t}\n\tc.running = false\n\tc.Unlock()\n}", "title": "" }, { "docid": "5a373e1857245bb02353fb77016a999e", "score": "0.5386351", "text": "func (m *ServiceHealthIssue) SetStatus(value *ServiceHealthStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "cdcd21efafbfb262491816b9adced8c5", "score": "0.5369429", "text": "func (m *DeviceScopeActionResult) SetStatus(value *DeviceScopeActionStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "74c1034c60c1b6f09fdeac9a70dac9e6", "score": "0.53434813", "text": "func setStatus(cs v1alpha1.ConsoleStatus, svc *corev1.Service, rt *routev1.Route, cm *corev1.ConfigMap, dep *appsv1.Deployment, oa *oauthv1.OAuthClient, sec *corev1.Secret) {\n\t// TODO: handle custom hosts as well\n\tif rt.Spec.Host != \"\" {\n\t\tcs.DefaultHostName = rt.Spec.Host\n\t\tlogrus.Printf(\"stats.DefaultHostName set to %v\", rt.Spec.Host)\n\t} else {\n\t\tcs.DefaultHostName = \"\"\n\t\tlogrus.Printf(\"stats.DefaultHostName set to %v\", \"\")\n\t}\n\n\tif secretAndOauthMatch(sec, oa) {\n\t\tcs.OAuthSecret = \"valid\"\n\t\tlogrus.Printf(\"status.OAuthSecret is valid\")\n\t} else {\n\t\tcs.OAuthSecret = \"mismatch\"\n\t\tlogrus.Printf(\"status.OAuthSecret is mismatch\")\n\t}\n\n}", "title": "" }, { "docid": "68e1626d31e5472aa0ec9268fea3c5d7", "score": "0.53283113", "text": "func (m *UnifiedRoleScheduleBase) SetStatus(value *string)() {\n m.status = value\n}", "title": "" }, { "docid": "5f9ae5b68c697cbc982cf470c710368f", "score": "0.53127015", "text": "func (m *PrivilegedAccessSchedule) SetStatus(value *string)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e899ee7c0c5bed41b73e8aff496aabcf", "score": "0.52936226", "text": "func (m *GovernanceRoleAssignmentRequest) SetStatus(value GovernanceRoleAssignmentRequestStatusable)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "3a4dff4bc7ff141f95e597c1125c75e9", "score": "0.52775097", "text": "func (r *Reconciler) setMetricsForwarderStatus(logger logr.Logger, agentdeployment *datadoghqv1alpha1.DatadogAgent, newStatus *datadoghqv1alpha1.DatadogAgentStatus) {\n\tif r.options.OperatorMetricsEnabled {\n\t\tif forwarderCondition := r.forwarders.MetricsForwarderStatusForObj(agentdeployment); forwarderCondition != nil {\n\t\t\tcondition.UpdateDatadogAgentStatusConditions(\n\t\t\t\tnewStatus,\n\t\t\t\tforwarderCondition.LastUpdateTime,\n\t\t\t\tdatadoghqv1alpha1.DatadogAgentConditionType(forwarderCondition.ConditionType),\n\t\t\t\tcondition.GetCoreV1ConditionStatus(forwarderCondition.Status),\n\t\t\t\tforwarderCondition.Reason,\n\t\t\t\ttrue,\n\t\t\t)\n\t\t} else {\n\t\t\tlogger.V(1).Info(\"metrics forwarder status condition could not be set\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7402fff075911d4909dffadbbf890be4", "score": "0.5218759", "text": "func (s *RegistryService) SetStatus(ctx context.Context, id string, status dto.ServiceStatus) error {\n\tspan, ctx := opentracing.StartSpanFromContext(ctx, \"RegistryService.SetStatus\")\n\tdefer span.Finish()\n\n\tsvc, err := s.repo.Find(ctx, id)\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\terr = httputil.PreconditionRequiredError(err)\n\t\t}\n\t\tspan.LogFields(tracelog.Bool(\"success\", false), tracelog.Error(err))\n\t\treturn err\n\t}\n\n\tsvc.Status = status\n\t_, err = s.repo.Save(ctx, svc)\n\tif err != nil {\n\t\terr := fmt.Errorf(\"failed to save status update for service(id=%s). %w\", id, err)\n\t\tspan.LogFields(tracelog.Bool(\"success\", false), tracelog.Error(err))\n\t\treturn err\n\t}\n\n\tspan.LogFields(tracelog.Bool(\"success\", true))\n\treturn nil\n}", "title": "" }, { "docid": "997e281559cf327d1b6953991f2802a7", "score": "0.51991934", "text": "func (a *GeneralController) setStatus(gpa *autoscaling.GeneralPodAutoscaler, currentReplicas,\n\tdesiredReplicas int32, metricStatuses []autoscaling.MetricStatus, rescale bool) {\n\tgpa.Status = autoscaling.GeneralPodAutoscalerStatus{\n\t\tCurrentReplicas: currentReplicas,\n\t\tDesiredReplicas: desiredReplicas,\n\t\tLastScaleTime: gpa.Status.LastScaleTime,\n\t\tCurrentMetrics: metricStatuses,\n\t\tConditions: gpa.Status.Conditions,\n\t}\n\tnow := metav1.NewTime(time.Now())\n\tif rescale {\n\t\tif gpa.Spec.TimeMode != nil {\n\t\t\tgpa.Status.LastCronScheduleTime = &now\n\t\t}\n\t\tgpa.Status.LastScaleTime = &now\n\t}\n}", "title": "" }, { "docid": "0b9c48ad3150e9b2607f31df3659c89c", "score": "0.51180464", "text": "func (m *DeviceAppPerformance) SetHealthStatus(value *string)() {\n err := m.GetBackingStore().Set(\"healthStatus\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e14bb291bf2b88a09e751d9064e11c70", "score": "0.5094247", "text": "func (m *Alert) SetStatus(value *AlertStatus)() {\n m.status = value\n}", "title": "" }, { "docid": "343edece08952c72fca4eb0aafe0c546", "score": "0.50639015", "text": "func (setting *MongodbDatabaseCollectionThroughputSetting) SetStatus(status genruntime.ConvertibleStatus) error {\n\t// If we have exactly the right type of status, assign it\n\tif st, ok := status.(*DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS); ok {\n\t\tsetting.Status = *st\n\t\treturn nil\n\t}\n\n\t// Convert status to required version\n\tvar st DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS\n\terr := status.ConvertStatusTo(&st)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to convert status\")\n\t}\n\n\tsetting.Status = st\n\treturn nil\n}", "title": "" }, { "docid": "ffec33b1b4d6743ec4672207abcfb81b", "score": "0.50621855", "text": "func (c Collector) UpdateStatus(asg string, status string, updateFields map[string]interface{}) error {\n\tLogger.Debugf(\"deployment statuses of previous autoscaling groups are started\")\n\tif err := c.MetricClient.DynamoDBService.UpdateRecord(\"deployment_status\", asg, c.MetricConfig.Storage.Name, status, c.MetricConfig.Metrics.BaseTimezone, updateFields); err != nil {\n\t\treturn err\n\t}\n\tLogger.Debugf(\"deployment statuses of previous autoscaling groups are updated\")\n\n\treturn nil\n}", "title": "" }, { "docid": "fa3153dac568695ed17b9af9395d8a34", "score": "0.50351363", "text": "func (r *QueryRefreshTaskRequest) SetTaskStatus(taskStatus string) {\n r.TaskStatus = &taskStatus\n}", "title": "" }, { "docid": "5f1883a0c3825d97b1f1f748cd391fe5", "score": "0.50300664", "text": "func (m *Simulation) SetStatus(value *SimulationStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "b2572cde091482fda02768ab19c43b0a", "score": "0.5019423", "text": "func (a *GeneralController) computeStatusForResourceMetric(currentReplicas int32, metricSpec autoscaling.MetricSpec, gpa *autoscaling.GeneralPodAutoscaler, selector labels.Selector, status *autoscaling.MetricStatus) (replicaCountProposal int32, timestampProposal time.Time, metricNameProposal string, condition autoscaling.GeneralPodAutoscalerCondition, err error) {\n\tif metricSpec.Resource.Target.AverageValue != nil {\n\t\tvar rawProposal int64\n\t\treplicaCountProposal, rawProposal, timestampProposal, err := a.replicaCalc.GetRawResourceReplicas(currentReplicas, metricSpec.Resource.Target.AverageValue.MilliValue(), metricSpec.Resource.Name, gpa.Namespace, selector, \"\")\n\t\tif err != nil {\n\t\t\tcondition = a.getUnableComputeReplicaCountCondition(gpa, \"FailedGetResourceMetric\", err)\n\t\t\treturn 0, time.Time{}, \"\", condition, fmt.Errorf(\"failed to get %s utilization: %v\", metricSpec.Resource.Name, err)\n\t\t}\n\t\tmetricNameProposal = fmt.Sprintf(\"%s resource\", metricSpec.Resource.Name)\n\t\t*status = autoscaling.MetricStatus{\n\t\t\tType: autoscaling.ResourceMetricSourceType,\n\t\t\tResource: &autoscaling.ResourceMetricStatus{\n\t\t\t\tName: metricSpec.Resource.Name,\n\t\t\t\tCurrent: autoscaling.MetricValueStatus{\n\t\t\t\t\tAverageValue: resource.NewMilliQuantity(rawProposal, resource.DecimalSI),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\treturn replicaCountProposal, timestampProposal, metricNameProposal, autoscaling.GeneralPodAutoscalerCondition{}, nil\n\t}\n\tif metricSpec.Resource.Target.AverageUtilization == nil {\n\t\terrMsg := \"invalid resource metric source: neither a utilization target nor a value target was set\"\n\t\terr = fmt.Errorf(errMsg)\n\t\tcondition = a.getUnableComputeReplicaCountCondition(gpa, \"FailedGetResourceMetric\", err)\n\t\treturn 0, time.Time{}, \"\", condition, fmt.Errorf(errMsg)\n\t}\n\tcomputeByLimits := isComputeByLimits(gpa)\n\ttargetUtilization := *metricSpec.Resource.Target.AverageUtilization\n\treplicaCountProposal, percentageProposal, rawProposal, timestampProposal, err := a.replicaCalc.GetResourceReplicas(currentReplicas, targetUtilization, metricSpec.Resource.Name, gpa.Namespace, selector, \"\", computeByLimits)\n\tif err != nil {\n\t\tcondition = a.getUnableComputeReplicaCountCondition(gpa, \"FailedGetResourceMetric\", err)\n\t\treturn 0, time.Time{}, \"\", condition, fmt.Errorf(\"failed to get %s utilization: %v\", metricSpec.Resource.Name, err)\n\t}\n\tcomputeResourceUtilizationRatioBy := \"request\"\n\tif computeByLimits {\n\t\tcomputeResourceUtilizationRatioBy = \"limit\"\n\t}\n\tmetricNameProposal = fmt.Sprintf(\"%s resource utilization (percentage of %s)\", metricSpec.Resource.Name, computeResourceUtilizationRatioBy)\n\t*status = autoscaling.MetricStatus{\n\t\tType: autoscaling.ResourceMetricSourceType,\n\t\tResource: &autoscaling.ResourceMetricStatus{\n\t\t\tName: metricSpec.Resource.Name,\n\t\t\tCurrent: autoscaling.MetricValueStatus{\n\t\t\t\tAverageUtilization: &percentageProposal,\n\t\t\t\tAverageValue: resource.NewMilliQuantity(rawProposal, resource.DecimalSI),\n\t\t\t},\n\t\t},\n\t}\n\treturn replicaCountProposal, timestampProposal, metricNameProposal, autoscaling.GeneralPodAutoscalerCondition{}, nil\n}", "title": "" }, { "docid": "39d1b8fc47c9aade2bee74741afb84ef", "score": "0.5019019", "text": "func (cpi *CachePoolItem) SetStatus(status string) {\n\tcpi.Status = status\n}", "title": "" }, { "docid": "60e20a82e5fe1f698811407ad5b6cf0c", "score": "0.4956096", "text": "func (m *Meta) SetStatus(status int) string { m.status = status; return \"\" }", "title": "" }, { "docid": "a2650947b8910954d4bc6724ad381388", "score": "0.4954775", "text": "func (m *EndUserNotification) SetStatus(value *SimulationContentStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "73ad68704a0a0812f87c698deb35e887", "score": "0.49538872", "text": "func (o *GetIPIPTaskParams) SetStatus(status *string) {\n\to.Status = status\n}", "title": "" }, { "docid": "bddcfc93c988c16f71eda0d6290fbd42", "score": "0.49145216", "text": "func (m *CloudPcOverview) SetTotalCloudPcConnectionStatus(value *int32)() {\n err := m.GetBackingStore().Set(\"totalCloudPcConnectionStatus\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "6c59291ce60da6bd1f962a0d5ab5e573", "score": "0.49143896", "text": "func (m *Monitoring) SetStatus(status int) error {\n\tlog.Debugf(\"Status: %d\", status)\n\tif status > 3 || status < 0 {\n\t\treturn errors.New(\"Status can't be greater than 3\")\n\t}\n\n\tif status > m.status {\n\t\tlog.Debugf(\"New monitoring status is %d\", status)\n\t\tm.status = status\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c2e02be41e0cdfef656daecfaba68be7", "score": "0.49010423", "text": "func (vk *VK) StatusSet(params Params) (response int, err error) {\n\terr = vk.RequestUnmarshal(\"status.set\", &response, params)\n\treturn\n}", "title": "" }, { "docid": "7a13bc9890ed358329f41c75941b0f3a", "score": "0.4885298", "text": "func (fs FeatureService) setStatus (w http.ResponseWriter, r *http.Request) {\n\tvar feature model.Feature\n\tmodel.ReadJsonBody(r, &feature)\n\tfeature.Key = mux.Vars(r)[\"id\"]\n\n\tuser := model.GetUserFromRequest (w, r)\n\tentity, err := fs.getDao().SetStatus (&feature, feature.Status, user)\n\tmodel.CheckErr(err)\n\tmodel.WriteResponse(true, nil, entity, w)\n}", "title": "" }, { "docid": "cc539079887180f9495c87c861e427fa", "score": "0.48550287", "text": "func (m *CaseEscaped) SetStatus(value *CaseStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "ad83a48f1bb6d3929dfbdd65e23c2623", "score": "0.48498037", "text": "func (s Storage) SetStatus(ctx context.Context, lease clientv3.LeaseID, st *ServerStatus) error {\n\tdata, err := json.Marshal(st)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = s.Put(ctx, KeyStatus, string(data), clientv3.WithLease(lease))\n\treturn err\n}", "title": "" }, { "docid": "b906020efc7d8238c7b9acedd4a0173a", "score": "0.4841115", "text": "func (cpu *CPU) SetStatus(state State) {\n\tcpu.AF.Set(state.AF)\n\tcpu.BC.Set(state.BC)\n\tcpu.DE.Set(state.DE)\n\tcpu.HL.Set(state.HL)\n\tcpu.SP.Set(state.SP)\n\tcpu.PC.Set(state.PC)\n\tcpu.imeFlag = state.IME\n}", "title": "" }, { "docid": "1ea4279176d121328d6d57de7d6cac16", "score": "0.48409045", "text": "func (virtualMachineScaleSet *VirtualMachineScaleSet) SetStatus(status genruntime.ConvertibleStatus) error {\n\t// If we have exactly the right type of status, assign it\n\tif st, ok := status.(*VirtualMachineScaleSet_Status); ok {\n\t\tvirtualMachineScaleSet.Status = *st\n\t\treturn nil\n\t}\n\n\t// Convert status to required version\n\tvar st VirtualMachineScaleSet_Status\n\terr := status.ConvertStatusTo(&st)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to convert status\")\n\t}\n\n\tvirtualMachineScaleSet.Status = st\n\treturn nil\n}", "title": "" }, { "docid": "8198c6daf8b218be7a53c3cdab2cb424", "score": "0.4839581", "text": "func (ctx Context) SetStatus(status string) {\n\tresMsg := message.GetResultMessage(nil)\n\tresMsg.TaskId = ctx.Msg.ID\n\tresMsg.Status = status\n\terr := ctx.App.Backend.SetResult(ctx.Msg.ID, resMsg)\n\tif err != nil {\n\t\tctx.App.Log.With(zap.String(\"task_id\", resMsg.TaskId)).Errorf(\"set task status error: %s\", err.Error())\n\t}\n}", "title": "" }, { "docid": "47b0869e31ed2c1c43b7ab2e1319b1d1", "score": "0.48358896", "text": "func (m *VirtualEvent) SetStatus(value *VirtualEventStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "3407533ed2dc127420fe8aa8550bebb8", "score": "0.4833147", "text": "func (m *CloudPcOverview) SetTotalCloudPcStatus(value *int32)() {\n err := m.GetBackingStore().Set(\"totalCloudPcStatus\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e24c86d11e96ccab3fa481a2947aaa7f", "score": "0.4829542", "text": "func (vk *VK) StatusSet(params map[string]string) (response StatusSetResponse, vkErr Error) {\n\tvk.RequestUnmarshal(\"status.set\", params, &response, &vkErr)\n\treturn\n}", "title": "" }, { "docid": "32386d8193fddee56679bc1e2a135bd2", "score": "0.4824065", "text": "func (m *OutlookTask) SetStatus(value *TaskStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "79b9919a52b80ae74cd7c564e183066d", "score": "0.4813262", "text": "func (m *DeviceComplianceUserStatus) SetStatus(value *ComplianceStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "feca95d8c40476d2143984e4aa5254b9", "score": "0.47952834", "text": "func SetStatus(s string) {\n\tbar = s\n}", "title": "" }, { "docid": "2c8b5de05cfc604e51706c413c28c5f0", "score": "0.47890556", "text": "func (m *ImportedWindowsAutopilotDeviceIdentityUpload) SetStatus(value *ImportedWindowsAutopilotDeviceIdentityUploadStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "b45cb6f1cdcf16b77541f807d7a2e824", "score": "0.47602472", "text": "func SetMetricOpID(ctx context.Context, value string) {\n\tif config.Metric().Enabled {\n\t\tv := ctx.Value(contextOpIDKey{}).(*string)\n\t\t*v = value\n\t}\n}", "title": "" }, { "docid": "31d6e67a33900699844b234138a69102", "score": "0.47500595", "text": "func UA_Client_MonitoredItems_setMonitoringMode(client []UA_Client, request UA_SetMonitoringModeRequest) UA_SetMonitoringModeResponse {\n\tvar response UA_SetMonitoringModeResponse\n\t__UA_Client_Service(client, (*[100000000]UA_SetMonitoringModeRequest)(unsafe.Pointer(&request))[:], (*[100000000]UA_DataType)(unsafe.Pointer(&UA_TYPES[128]))[:], (*[100000000]UA_SetMonitoringModeResponse)(unsafe.Pointer(&response))[:], (*[100000000]UA_DataType)(unsafe.Pointer(&UA_TYPES[144]))[:])\n\treturn response\n}", "title": "" }, { "docid": "49c7183cafe6e6d69d0aab05ee00b9d8", "score": "0.4738693", "text": "func (_m *Store) SetWorkloadStatus(ctx context.Context, status *types.StatusMeta, ttl int64) error {\n\tret := _m.Called(ctx, status, ttl)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, *types.StatusMeta, int64) error); ok {\n\t\tr0 = rf(ctx, status, ttl)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "be7fb4e4e33343e6741ef75c90e0c07a", "score": "0.47323343", "text": "func (o *VirtualizationBaseClusterAllOf) SetStatus(v string) {\n\to.Status = &v\n}", "title": "" }, { "docid": "fc28a581753f5879d1d47ecb72735253", "score": "0.47305956", "text": "func (in *Method) SetStatus(status *metav1alpha1.StatusMeta) {\n\tin.Status.StatusMeta = *status\n}", "title": "" }, { "docid": "fc28a581753f5879d1d47ecb72735253", "score": "0.47305956", "text": "func (in *Method) SetStatus(status *metav1alpha1.StatusMeta) {\n\tin.Status.StatusMeta = *status\n}", "title": "" }, { "docid": "67a4e8c77dacaf721a3a94d56fd9ab46", "score": "0.47179535", "text": "func (m *EventPropagationResult) SetStatus(value *EventPropagationStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "511ad41270f31f9698e035710cc55f8d", "score": "0.47129685", "text": "func (a *GeneralController) computeStatusForPodsMetric(currentReplicas int32, metricSpec autoscaling.MetricSpec, gpa *autoscaling.GeneralPodAutoscaler, selector labels.Selector, status *autoscaling.MetricStatus, metricSelector labels.Selector) (replicaCountProposal int32, timestampProposal time.Time, metricNameProposal string, condition autoscaling.GeneralPodAutoscalerCondition, err error) {\n\treplicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetMetricReplicas(currentReplicas, metricSpec.Pods.Target.AverageValue.MilliValue(), metricSpec.Pods.Metric.Name, gpa.Namespace, selector, metricSelector)\n\tif err != nil {\n\t\tcondition = a.getUnableComputeReplicaCountCondition(gpa, \"FailedGetPodsMetric\", err)\n\t\treturn 0, timestampProposal, \"\", condition, err\n\t}\n\t*status = autoscaling.MetricStatus{\n\t\tType: autoscaling.PodsMetricSourceType,\n\t\tPods: &autoscaling.PodsMetricStatus{\n\t\t\tMetric: autoscaling.MetricIdentifier{\n\t\t\t\tName: metricSpec.Pods.Metric.Name,\n\t\t\t\tSelector: metricSpec.Pods.Metric.Selector,\n\t\t\t},\n\t\t\tCurrent: autoscaling.MetricValueStatus{\n\t\t\t\tAverageValue: resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),\n\t\t\t},\n\t\t},\n\t}\n\n\treturn replicaCountProposal, timestampProposal, fmt.Sprintf(\"pods metric %s\", metricSpec.Pods.Metric.Name), autoscaling.GeneralPodAutoscalerCondition{}, nil\n}", "title": "" }, { "docid": "c4a676b5cb2177f139a82c0c83f872e1", "score": "0.47125554", "text": "func RunPropertyAssignmentTestForManagedClusterIdentity_STATUS(subject ManagedClusterIdentity_STATUS) string {\n\t// Copy subject to make sure assignment doesn't modify it\n\tcopied := subject.DeepCopy()\n\n\t// Use AssignPropertiesTo() for the first stage of conversion\n\tvar other v20210501s.ManagedClusterIdentity_STATUS\n\terr := copied.AssignProperties_To_ManagedClusterIdentity_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Use AssignPropertiesFrom() to convert back to our original type\n\tvar actual ManagedClusterIdentity_STATUS\n\terr = actual.AssignProperties_From_ManagedClusterIdentity_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Check for a match\n\tmatch := cmp.Equal(subject, actual, cmpopts.EquateEmpty())\n\tif !match {\n\t\tactualFmt := pretty.Sprint(actual)\n\t\tsubjectFmt := pretty.Sprint(subject)\n\t\tresult := diff.Diff(subjectFmt, actualFmt)\n\t\treturn result\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "69aeecc32f08fe6c1775ca88c019b55f", "score": "0.4708337", "text": "func (op *GetClickwrapsOp) Status(val string) *GetClickwrapsOp {\n\tif op != nil {\n\t\top.QueryOpts.Set(\"status\", val)\n\t}\n\treturn op\n}", "title": "" }, { "docid": "b806d824f4a13f18c6bb01b090826477", "score": "0.47072405", "text": "func RunPropertyAssignmentTestForManagedClusterPodIdentity_STATUS(subject ManagedClusterPodIdentity_STATUS) string {\n\t// Copy subject to make sure assignment doesn't modify it\n\tcopied := subject.DeepCopy()\n\n\t// Use AssignPropertiesTo() for the first stage of conversion\n\tvar other v20210501s.ManagedClusterPodIdentity_STATUS\n\terr := copied.AssignProperties_To_ManagedClusterPodIdentity_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Use AssignPropertiesFrom() to convert back to our original type\n\tvar actual ManagedClusterPodIdentity_STATUS\n\terr = actual.AssignProperties_From_ManagedClusterPodIdentity_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Check for a match\n\tmatch := cmp.Equal(subject, actual, cmpopts.EquateEmpty())\n\tif !match {\n\t\tactualFmt := pretty.Sprint(actual)\n\t\tsubjectFmt := pretty.Sprint(subject)\n\t\tresult := diff.Diff(subjectFmt, actualFmt)\n\t\treturn result\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "22740f86bc7925d756556bf8c7dc55da", "score": "0.47011673", "text": "func (m *Employee) SetStatus(value *string)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "0a328ea1afbdf22baf7a98a520b68b1f", "score": "0.46992758", "text": "func (m *ActivityHistoryItem) SetStatus(value *Status)() {\n m.status = value\n}", "title": "" }, { "docid": "3e1dc28dc544e0f418e24ffcfa11fc8a", "score": "0.46965837", "text": "func (c *GKECluster) SetStatus(status, statusMessage string) error {\n\tif c.model.Cluster.Status == status && c.model.Cluster.StatusMessage == statusMessage {\n\t\treturn nil\n\t}\n\n\tif c.model.Cluster.ID != 0 {\n\t\t// Record status change to history before modifying the actual status.\n\t\t// If setting/saving the actual status doesn't succeed somehow, at least we can reconstruct it from history (i.e. event sourcing).\n\t\tstatusHistory := clustermodel.StatusHistoryModel{\n\t\t\tClusterID: c.model.Cluster.ID,\n\t\t\tClusterName: c.model.Cluster.Name,\n\n\t\t\tFromStatus: c.model.Cluster.Status,\n\t\t\tFromStatusMessage: c.model.Cluster.StatusMessage,\n\t\t\tToStatus: status,\n\t\t\tToStatusMessage: statusMessage,\n\t\t}\n\n\t\tif err := c.repository.SaveStatusHistory(&statusHistory); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to record cluster status change to history\")\n\t\t}\n\t}\n\n\tif c.model.Cluster.Status == pkgCluster.Creating && (status == pkgCluster.Running || status == pkgCluster.Warning) {\n\t\tnow := time.Now()\n\t\tc.model.Cluster.StartedAt = &now\n\t}\n\tc.model.Cluster.Status = status\n\tc.model.Cluster.StatusMessage = statusMessage\n\n\tif err := c.repository.SaveModel(c.model); err != nil {\n\t\treturn errors.Wrap(err, \"failed to update cluster status\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0dae3d48964bf2497d36579089d6c4b2", "score": "0.4688506", "text": "func (m *MockIOHandler) SetStatus(status contracts.ResultStatus) {\n\tm.Called(status)\n}", "title": "" }, { "docid": "c76bece1691d77f4931a214287405058", "score": "0.46824643", "text": "func (h *TaskHandle) SetStatus(ctx context.Context, spec api.TaskStatusSpec) error {\n\tpath := path.Join(\"/api/v3/tasks\", h.id, \"status\")\n\tresp, err := h.client.sendRequest(ctx, http.MethodPut, path, nil, spec)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer safeClose(resp.Body)\n\treturn errorFromResponse(resp)\n}", "title": "" }, { "docid": "dc11112e87ff906d2dab87325c3f1317", "score": "0.4681019", "text": "func (a *GeneralController) computeStatusForExternalMetric(specReplicas, statusReplicas int32, metricSpec autoscaling.MetricSpec, gpa *autoscaling.GeneralPodAutoscaler, selector labels.Selector, status *autoscaling.MetricStatus) (replicaCountProposal int32, timestampProposal time.Time, metricNameProposal string, condition autoscaling.GeneralPodAutoscalerCondition, err error) {\n\tif metricSpec.External.Target.AverageValue != nil {\n\t\treplicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetExternalPerPodMetricReplicas(statusReplicas,\n\t\t\tmetricSpec.External.Target.AverageValue.MilliValue(), metricSpec.External.Metric.Name, gpa.Namespace, metricSpec.External.Metric.Selector)\n\t\tif err != nil {\n\t\t\tcondition = a.getUnableComputeReplicaCountCondition(gpa, \"FailedGetExternalMetric\", err)\n\t\t\treturn 0, time.Time{}, \"\", condition,\n\t\t\t\tfmt.Errorf(\"failed to get %s external metric: %v\", metricSpec.External.Metric.Name, err)\n\t\t}\n\t\t*status = autoscaling.MetricStatus{\n\t\t\tType: autoscaling.ExternalMetricSourceType,\n\t\t\tExternal: &autoscaling.ExternalMetricStatus{\n\t\t\t\tMetric: autoscaling.MetricIdentifier{\n\t\t\t\t\tName: metricSpec.External.Metric.Name,\n\t\t\t\t\tSelector: metricSpec.External.Metric.Selector,\n\t\t\t\t},\n\t\t\t\tCurrent: autoscaling.MetricValueStatus{\n\t\t\t\t\tAverageValue: resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\treturn replicaCountProposal, timestampProposal, fmt.Sprintf(\"external metric %s(%+v)\",\n\t\t\tmetricSpec.External.Metric.Name, metricSpec.External.Metric.Selector), autoscaling.GeneralPodAutoscalerCondition{}, nil\n\t}\n\tif metricSpec.External.Target.Value != nil {\n\t\treplicaCountProposal, utilizationProposal, timestampProposal, err := a.replicaCalc.GetExternalMetricReplicas(specReplicas,\n\t\t\tmetricSpec.External.Target.Value.MilliValue(), metricSpec.External.Metric.Name, gpa.Namespace, metricSpec.External.Metric.Selector, selector)\n\t\tif err != nil {\n\t\t\tcondition = a.getUnableComputeReplicaCountCondition(gpa, \"FailedGetExternalMetric\", err)\n\t\t\treturn 0, time.Time{}, \"\", condition,\n\t\t\t\tfmt.Errorf(\"failed to get external metric %s: %v\", metricSpec.External.Metric.Name, err)\n\t\t}\n\t\t*status = autoscaling.MetricStatus{\n\t\t\tType: autoscaling.ExternalMetricSourceType,\n\t\t\tExternal: &autoscaling.ExternalMetricStatus{\n\t\t\t\tMetric: autoscaling.MetricIdentifier{\n\t\t\t\t\tName: metricSpec.External.Metric.Name,\n\t\t\t\t\tSelector: metricSpec.External.Metric.Selector,\n\t\t\t\t},\n\t\t\t\tCurrent: autoscaling.MetricValueStatus{\n\t\t\t\t\tValue: resource.NewMilliQuantity(utilizationProposal, resource.DecimalSI),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\treturn replicaCountProposal, timestampProposal, fmt.Sprintf(\"external metric %s(%+v)\",\n\t\t\t\tmetricSpec.External.Metric.Name, metricSpec.External.Metric.Selector),\n\t\t\tautoscaling.GeneralPodAutoscalerCondition{}, nil\n\t}\n\terrMsg := \"invalid external metric source: neither a value target nor an average value target was set\"\n\terr = fmt.Errorf(errMsg)\n\tcondition = a.getUnableComputeReplicaCountCondition(gpa, \"FailedGetExternalMetric\", err)\n\treturn 0, time.Time{}, \"\", condition, fmt.Errorf(errMsg)\n}", "title": "" }, { "docid": "d734af8f4888c4d57cf57e41c4c7b4ba", "score": "0.4678887", "text": "func (a *GeneralController) computeStatusForResourceMetricGeneric(currentReplicas int32, target autoscaling.MetricTarget,\n\tresourceName v1.ResourceName, namespace string, container string, selector labels.Selector, computeByLimits bool) (replicaCountProposal int32,\n\tmetricStatus *autoscaling.MetricValueStatus, timestampProposal time.Time, metricNameProposal string,\n\tcondition autoscaling.GeneralPodAutoscalerCondition, err error) {\n\tif target.AverageValue != nil {\n\t\tvar rawProposal int64\n\t\treplicaCountProposal, rawProposal, timestampProposal, err := a.replicaCalc.GetRawResourceReplicas(currentReplicas, target.AverageValue.MilliValue(), resourceName, namespace, selector, container)\n\t\tif err != nil {\n\t\t\treturn 0, nil, time.Time{}, \"\", condition, fmt.Errorf(\"failed to get %s utilization: %v\", resourceName, err)\n\t\t}\n\t\tmetricNameProposal = fmt.Sprintf(\"%s resource\", resourceName.String())\n\t\tstatus := autoscaling.MetricValueStatus{\n\t\t\tAverageValue: resource.NewMilliQuantity(rawProposal, resource.DecimalSI),\n\t\t}\n\t\treturn replicaCountProposal, &status, timestampProposal, metricNameProposal, autoscaling.GeneralPodAutoscalerCondition{}, nil\n\t}\n\n\tif target.AverageUtilization == nil {\n\t\terrMsg := \"invalid resource metric source: neither a utilization target nor a value target was set\"\n\t\treturn 0, nil, time.Time{}, \"\", condition, fmt.Errorf(errMsg)\n\t}\n\n\ttargetUtilization := *target.AverageUtilization\n\treplicaCountProposal, percentageProposal, rawProposal, timestampProposal, err := a.replicaCalc.GetResourceReplicas(currentReplicas, targetUtilization, resourceName, namespace, selector, container, computeByLimits)\n\tif err != nil {\n\t\treturn 0, nil, time.Time{}, \"\", condition, fmt.Errorf(\"failed to get %s utilization: %v\", resourceName, err)\n\t}\n\tcomputeResourceUtilizationRatioBy := \"request\"\n\tif computeByLimits {\n\t\tcomputeResourceUtilizationRatioBy = \"limit\"\n\t}\n\n\tmetricNameProposal = fmt.Sprintf(\"%s resource utilization (percentage of %s)\", resourceName, computeResourceUtilizationRatioBy)\n\tstatus := autoscaling.MetricValueStatus{\n\t\tAverageUtilization: &percentageProposal,\n\t\tAverageValue: resource.NewMilliQuantity(rawProposal, resource.DecimalSI),\n\t}\n\treturn replicaCountProposal, &status, timestampProposal, metricNameProposal, autoscaling.GeneralPodAutoscalerCondition{}, nil\n}", "title": "" }, { "docid": "f59357b91b2d4f9f8a4c4a2afc33dc87", "score": "0.46766433", "text": "func setUserStatus(ctx context.Context, client MinioAdmin, user string, status string) error {\n\tvar setStatus madmin.AccountStatus\n\tswitch status {\n\tcase \"enabled\":\n\t\tsetStatus = madmin.AccountEnabled\n\tcase \"disabled\":\n\t\tsetStatus = madmin.AccountDisabled\n\tdefault:\n\t\treturn errors.New(500, \"status not valid\")\n\t}\n\n\treturn client.setUserStatus(ctx, user, setStatus)\n}", "title": "" }, { "docid": "7ecabdd4c51b11d3dffdac695710eb00", "score": "0.46662033", "text": "func (r *Res) SetStatus(status int) {\n\tr.status = status\n}", "title": "" }, { "docid": "c4c377a2d0963793639f3fd3cbefdebd", "score": "0.46652958", "text": "func RunPropertyAssignmentTestForManagedClusterLoadBalancerProfile_ManagedOutboundIPs_STATUS(subject ManagedClusterLoadBalancerProfile_ManagedOutboundIPs_STATUS) string {\n\t// Copy subject to make sure assignment doesn't modify it\n\tcopied := subject.DeepCopy()\n\n\t// Use AssignPropertiesTo() for the first stage of conversion\n\tvar other v20210501s.ManagedClusterLoadBalancerProfile_ManagedOutboundIPs_STATUS\n\terr := copied.AssignProperties_To_ManagedClusterLoadBalancerProfile_ManagedOutboundIPs_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Use AssignPropertiesFrom() to convert back to our original type\n\tvar actual ManagedClusterLoadBalancerProfile_ManagedOutboundIPs_STATUS\n\terr = actual.AssignProperties_From_ManagedClusterLoadBalancerProfile_ManagedOutboundIPs_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Check for a match\n\tmatch := cmp.Equal(subject, actual, cmpopts.EquateEmpty())\n\tif !match {\n\t\tactualFmt := pretty.Sprint(actual)\n\t\tsubjectFmt := pretty.Sprint(subject)\n\t\tresult := diff.Diff(subjectFmt, actualFmt)\n\t\treturn result\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "f82f424373edc6a77cb99bb08f1ae1a7", "score": "0.4663303", "text": "func (r *ReconcileMobileSecurityService) updateConfigMapStatus(reqLogger logr.Logger, instance *mobilesecurityservicev1alpha1.MobileSecurityService) (*corev1.ConfigMap, error) {\n\treqLogger.Info(\"Updating ConfigMap Status for the MobileSecurityService\")\n\tconfigMapStatus, err := r.fetchConfigMap(reqLogger, instance)\n\tif err != nil {\n\t\treqLogger.Error(err, \"Failed to get ConfigMap Name for Status\", \"MobileSecurityService.Namespace\", instance.Namespace, \"MobileSecurityService.Name\", instance.Name)\n\t\treturn configMapStatus, err\n\t}\n\tif !reflect.DeepEqual(configMapStatus.Name, instance.Status.ConfigMapName) {\n\t\tinstance.Status.ConfigMapName = configMapStatus.Name\n\t\terr := r.client.Status().Update(context.TODO(), instance)\n\t\tif err != nil {\n\t\t\treqLogger.Error(err, \"Failed to update ConfigMap Name Status for the MobileSecurityService\")\n\t\t\treturn configMapStatus, err\n\t\t}\n\t}\n\treturn configMapStatus, nil\n}", "title": "" }, { "docid": "f97b9d6fb498ca3af62223e50336e94c", "score": "0.46577838", "text": "func cassStatus(w http.ResponseWriter, r *http.Request) {\n\tmetrics, err := gowrapmx4j.QueryMX4J(mx4j)\n\tif err != nil {\n\t\terrString := fmt.Sprintf(\"cassStatus Error: %#v\", err)\n\t\thttp.Error(w, errString, http.StatusServiceUnavailable)\n\t}\n\tlog.Debugf(\"metrics: %#v\", metrics)\n\n\tmbeans := gowrapmx4j.RegistryBeans() //metrics := mm.ValFunc(mm.MBean)\n\tjs, err := json.Marshal(mbeans)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprintf(w, \"cassStatus: Error marshaling JSON from MX4J data: %v\", err)\n\t}\n\tfmt.Fprintf(w, \"%s\", js)\n}", "title": "" }, { "docid": "a6d46b05c05b6b6aa643236d1d50aeaa", "score": "0.46519914", "text": "func (setting *MongodbDatabaseCollectionThroughputSetting) GetStatus() genruntime.ConvertibleStatus {\n\treturn &setting.Status\n}", "title": "" }, { "docid": "d07ccd0e4cbcd3380ea5bf5421241d1c", "score": "0.4646381", "text": "func (auth *ASMAuthResource) SetDesiredStatus(status resourcestatus.ResourceStatus) {\n\tauth.lock.Lock()\n\tdefer auth.lock.Unlock()\n\n\tauth.desiredStatusUnsafe = status\n}", "title": "" }, { "docid": "4426fde5fb02b29264388e06882f7b20", "score": "0.46390867", "text": "func (c *ClusterService) GetStatus() int {\n env.Output.WriteChDebug(\"(ClusterService::SetStatus) Get value\")\n return c.Status\n}", "title": "" }, { "docid": "b1fdae4f1a8b42e883b8f40c291b3b49", "score": "0.46369007", "text": "func (m *AlertHistoryState) SetStatus(value *AlertStatus)() {\n m.status = value\n}", "title": "" }, { "docid": "4b5c52e2f299ab7659166db4fb08e804", "score": "0.46295008", "text": "func (o *SourceDynamoDb) SetStatus(v StatusDynamoDb) {\n\to.Status = &v\n}", "title": "" }, { "docid": "f2697b84c6f874418fd8d2fefa640d8c", "score": "0.4629087", "text": "func (ctx *Context) SetStatus(status int) {\n\tctx.status = status\n}", "title": "" }, { "docid": "cefa264fb2a05e9a866edca7f18790e4", "score": "0.46273956", "text": "func (op *GetClickwrapAgreementsOp) Status(val string) *GetClickwrapAgreementsOp {\n\tif op != nil {\n\t\top.QueryOpts.Set(\"status\", val)\n\t}\n\treturn op\n}", "title": "" }, { "docid": "7c15951adad27da7b2b80e0feafc2e00", "score": "0.46158668", "text": "func (o *NodesGetParams) WithMetricStatus(metricStatus *string) *NodesGetParams {\n\to.SetMetricStatus(metricStatus)\n\treturn o\n}", "title": "" }, { "docid": "8df22d532ba2333ca8e140acbb802196", "score": "0.46095523", "text": "func (rsc *Resource) SetStatus(status RStatus) {\n\trsc.Status = status\n\trsc.Save()\n}", "title": "" }, { "docid": "880a50c8696bea99b6913b381cd4c435", "score": "0.4606201", "text": "func (s *testHealthServer) SetServingStatus(service string, status healthpb.HealthCheckResponse_ServingStatus) {\n\ts.mu.Lock()\n\ts.status[service] = status\n\tselect {\n\tcase <-s.update:\n\tdefault:\n\t}\n\ts.update <- struct{}{}\n\ts.mu.Unlock()\n}", "title": "" }, { "docid": "78f9c4268bca081e18a5d46217e3a898", "score": "0.46029267", "text": "func (compute *WorkspacesCompute) SetStatus(status genruntime.ConvertibleStatus) error {\n\t// If we have exactly the right type of status, assign it\n\tif st, ok := status.(*Workspaces_Compute_STATUS); ok {\n\t\tcompute.Status = *st\n\t\treturn nil\n\t}\n\n\t// Convert status to required version\n\tvar st Workspaces_Compute_STATUS\n\terr := status.ConvertStatusTo(&st)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to convert status\")\n\t}\n\n\tcompute.Status = st\n\treturn nil\n}", "title": "" }, { "docid": "78f9c4268bca081e18a5d46217e3a898", "score": "0.46029267", "text": "func (compute *WorkspacesCompute) SetStatus(status genruntime.ConvertibleStatus) error {\n\t// If we have exactly the right type of status, assign it\n\tif st, ok := status.(*Workspaces_Compute_STATUS); ok {\n\t\tcompute.Status = *st\n\t\treturn nil\n\t}\n\n\t// Convert status to required version\n\tvar st Workspaces_Compute_STATUS\n\terr := status.ConvertStatusTo(&st)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to convert status\")\n\t}\n\n\tcompute.Status = st\n\treturn nil\n}", "title": "" }, { "docid": "8292782e416e4ecfb4f534adb7715e1f", "score": "0.45996144", "text": "func RunPropertyAssignmentTestForDatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS(subject DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS) string {\n\t// Copy subject to make sure assignment doesn't modify it\n\tcopied := subject.DeepCopy()\n\n\t// Use AssignPropertiesTo() for the first stage of conversion\n\tvar other v1beta20210515s.DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS\n\terr := copied.AssignProperties_To_DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Use AssignPropertiesFrom() to convert back to our original type\n\tvar actual DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS\n\terr = actual.AssignProperties_From_DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Check for a match\n\tmatch := cmp.Equal(subject, actual, cmpopts.EquateEmpty())\n\tif !match {\n\t\tactualFmt := pretty.Sprint(actual)\n\t\tsubjectFmt := pretty.Sprint(subject)\n\t\tresult := diff.Diff(subjectFmt, actualFmt)\n\t\treturn result\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "5fff2fd1ed80927de5bd862dabcfaca2", "score": "0.45941034", "text": "func (o *MetricsCommand) SetStatus(v string) {\n\to.Status = &v\n}", "title": "" }, { "docid": "3b18dad50d580e439f3694ffb7f989bc", "score": "0.4589517", "text": "func (ta *TaskActivity) SetStatus(progress float64, status string) {\n\tif ta.stoppedByUser {\n\t\tpanic(\"task already stopped by user\")\n\t}\n\tta.notification.description = status\n\tta.notification.SetProgress(&progress)\n}", "title": "" }, { "docid": "452448b51e0117f4cd53abbd71d9ce7d", "score": "0.4586541", "text": "func (setting *DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {\n\tsrc, ok := source.(*v1beta20210515s.DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS)\n\tif ok {\n\t\t// Populate our instance from source\n\t\treturn setting.AssignProperties_From_DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS(src)\n\t}\n\n\t// Convert to an intermediate form\n\tsrc = &v1beta20210515s.DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS{}\n\terr := src.ConvertStatusFrom(source)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"initial step of conversion in ConvertStatusFrom()\")\n\t}\n\n\t// Update our instance from src\n\terr = setting.AssignProperties_From_DatabaseAccounts_MongodbDatabases_Collections_ThroughputSetting_STATUS(src)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"final step of conversion in ConvertStatusFrom()\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b28f9b071fa840daa911ce9233e4cce3", "score": "0.4585711", "text": "func (m *WindowsUpdateState) SetStatus(value *WindowsUpdateStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "b6901cbe2affb8442a09726772c6e3e3", "score": "0.45849535", "text": "func monitorComponentStatus(request *restful.Request, response *restful.Response) {\n\trequestParams := client.ParseMonitoringRequestParams(request)\n\n\tstatus := metrics.MonitorComponentStatus(requestParams)\n\tresponse.WriteAsJson(status)\n}", "title": "" }, { "docid": "2906f0dae49775a5b59e0b3f42304009", "score": "0.4579826", "text": "func (cluster *ManagedCluster) SetStatus(status genruntime.ConvertibleStatus) error {\n\t// If we have exactly the right type of status, assign it\n\tif st, ok := status.(*ManagedCluster_STATUS); ok {\n\t\tcluster.Status = *st\n\t\treturn nil\n\t}\n\n\t// Convert status to required version\n\tvar st ManagedCluster_STATUS\n\terr := status.ConvertStatusTo(&st)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to convert status\")\n\t}\n\n\tcluster.Status = st\n\treturn nil\n}", "title": "" }, { "docid": "76dfd8db1cd5e66a1c4ae21e0b2e7d62", "score": "0.457862", "text": "func (op *GetClickwrapVersionAgreementsOp) Status(val string) *GetClickwrapVersionAgreementsOp {\n\tif op != nil {\n\t\top.QueryOpts.Set(\"status\", val)\n\t}\n\treturn op\n}", "title": "" }, { "docid": "dfc218be8e406de6f79a2ce3a6f0703b", "score": "0.4576509", "text": "func SetStatus(status string) string {\n\tif status == \"PREPARING\" {\n\t\tstatus = \"ready_to_charge\"\n\t}\n\tif status == \"AVAILABLE\" {\n\t\tstatus = \"disconnected\"\n\t}\n\tif status == \"OCCUPIED\" || status == \"CHARGING\" {\n\t\tstatus = \"charging\"\n\t}\n\tif status == \"FINISHING\" {\n\t\tstatus = \"finished\"\n\t}\n\tif status == \"RESERVED\" {\n\t\tstatus = \"reserved\"\n\t}\n\tif status == \"UNAVAILABLE\" {\n\t\tstatus = \"unavailable\"\n\t}\n\tif status == \"SUSPENDEDEVSE\" || status == \"SUSPENDEDEV\" || status == \"FAULTED\" {\n\t\tstatus = \"error\"\n\t}\n\treturn status\n}", "title": "" }, { "docid": "28c1debc85b9bb496b6c1455844bd248", "score": "0.45759895", "text": "func (_m *Piece) SetStatus(_a0 piece.PieceStatus) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "e740b16af1786dddeac310a4e3007864", "score": "0.45739362", "text": "func SetRequestStatus(ctx context.Context, s map[string]string) bool {\r\n\ttc, ok := currentFromContext(ctx)\r\n\tif ok {\r\n\t\ttc.reqStatus = s\r\n\t}\r\n\treturn ok\r\n}", "title": "" }, { "docid": "3dbe12670d5eafbf3f8b49029255c6ca", "score": "0.45726037", "text": "func RunPropertyAssignmentTestForManagedVirtualNetworkSettings_STATUS(subject ManagedVirtualNetworkSettings_STATUS) string {\n\t// Copy subject to make sure assignment doesn't modify it\n\tcopied := subject.DeepCopy()\n\n\t// Use AssignPropertiesTo() for the first stage of conversion\n\tvar other v20210601s.ManagedVirtualNetworkSettings_STATUS\n\terr := copied.AssignProperties_To_ManagedVirtualNetworkSettings_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Use AssignPropertiesFrom() to convert back to our original type\n\tvar actual ManagedVirtualNetworkSettings_STATUS\n\terr = actual.AssignProperties_From_ManagedVirtualNetworkSettings_STATUS(&other)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\n\t// Check for a match\n\tmatch := cmp.Equal(subject, actual, cmpopts.EquateEmpty())\n\tif !match {\n\t\tactualFmt := pretty.Sprint(actual)\n\t\tsubjectFmt := pretty.Sprint(subject)\n\t\tresult := diff.Diff(subjectFmt, actualFmt)\n\t\treturn result\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "9a7699ab8c5a7326a28b647607581918", "score": "0.45680058", "text": "func (r *AliexpressSolutionFeedListGetAPIRequest) SetStatus(_status string) error {\n\tr._status = _status\n\tr.Set(\"status\", _status)\n\treturn nil\n}", "title": "" }, { "docid": "8213d17e516510dee956fc51204e8db2", "score": "0.45665225", "text": "func (p StatefulSet) Status(meta map[string]string) (interfaces.ResourceStatus, error) {\n\treturn statefulsetStatus(p.Client, p.StatefulSet.Name, p.APIClient)\n}", "title": "" }, { "docid": "e55de5b8732b98e38e6f01be9a8d18f2", "score": "0.4565687", "text": "func (r *ReconcileMobileSecurityService) updateStatus(reqLogger logr.Logger, configMapStatus *corev1.ConfigMap, deploymentStatus *v1beta1.Deployment, serviceStatus *corev1.Service, routeStatus *routev1.Route, instance *mobilesecurityservicev1alpha1.MobileSecurityService) error {\n\treqLogger.Info(\"Updating App Status for the MobileSecurityService\")\n\tif len(configMapStatus.UID) < 1 && len(deploymentStatus.UID) < 1 && len(serviceStatus.UID) < 1 && len(routeStatus.Name) < 1 {\n\t\terr := fmt.Errorf(\"Failed to get OK Status for MobileSecurityService\")\n\t\treqLogger.Error(err, \"One of the resources are not created\", \"MobileSecurityService.Namespace\", instance.Namespace, \"MobileSecurityService.Name\", instance.Name)\n\t\treturn err\n\t}\n\tstatus:= \"OK\"\n\tif !reflect.DeepEqual(status, instance.Status.AppStatus) {\n\t\tinstance.Status.AppStatus = status\n\t\terr := r.client.Status().Update(context.TODO(), instance)\n\t\tif err != nil {\n\t\t\treqLogger.Error(err, \"Failed to update Status for the MobileSecurityService App\")\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bc24108ddeb5af68f11e2037f28b24b3", "score": "0.45594898", "text": "func (o *AutoUpdateStatusCollectionGetParams) WithStatusTarget(statusTarget *string) *AutoUpdateStatusCollectionGetParams {\n\to.SetStatusTarget(statusTarget)\n\treturn o\n}", "title": "" }, { "docid": "a18dcdce20b61b81cd72705d3736f00a", "score": "0.45574895", "text": "func setStatHeader(w http.ResponseWriter, metric *MetricData) error {\n\tblob, err := json.Marshal(metric)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tw.Header().Set(\"X-Metric-Stat\", string(blob))\n\treturn nil\n}", "title": "" }, { "docid": "168a19ad76f32e4e5085ba405a4d87b5", "score": "0.4551499", "text": "func (s *ServiceObject) SetStatus(status int){\n\ts.Status = status\n}", "title": "" }, { "docid": "0341c818e5e994fe4579db41563a7c63", "score": "0.45491934", "text": "func (m *DeviceEvidence) SetHealthStatus(value *DeviceHealthStatus)() {\n err := m.GetBackingStore().Set(\"healthStatus\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "a0d667961d34aa660f52bfb6412e505f", "score": "0.45479897", "text": "func (op *GetClickwrapVersionAgreementsByNumberOp) Status(val string) *GetClickwrapVersionAgreementsByNumberOp {\n\tif op != nil {\n\t\top.QueryOpts.Set(\"status\", val)\n\t}\n\treturn op\n}", "title": "" } ]
5bc313ff9b57726aade69046ac95a452
ToString coerce a value to a string
[ { "docid": "61cd040765e0523b507a8f380efeb448", "score": "0.71309584", "text": "func toString(val interface{}) (string, error) {\n\n\tswitch t := val.(type) {\n\tcase string:\n\t\treturn t, nil\n\tcase int:\n\t\treturn strconv.Itoa(t), nil\n\tcase float64:\n\t\treturn strconv.FormatFloat(t, 'f', -1, 64), nil\n\tcase json.Number:\n\t\treturn t.String(), nil\n\tdefault:\n\t\treturn \"\", nil\n\t}\n}", "title": "" } ]
[ { "docid": "336d6383936295cc9b97d006bb75d18e", "score": "0.7610016", "text": "func ToString(value interface{}) string {\n\tres := fmt.Sprintf(\"%v\", value)\n\treturn string(res)\n}", "title": "" }, { "docid": "0139f1cda10dc1398346981169ee9949", "score": "0.7586041", "text": "func ValueToString(value interface{}) (s string, err error) {\n\t// nil values should return an empty string\n\tif reflect.TypeOf(value) == reflect.TypeOf(nil) {\n\t\treturn \"\", nil\n\t}\n\n\t// nil pointers should also return an empty string\n\tif reflect.TypeOf(value).Kind() == reflect.Ptr && reflect.ValueOf(value).IsNil() {\n\t\treturn \"\", nil\n\t}\n\n\t// Dereference any pointers\n\tif reflect.TypeOf(value).Kind() == reflect.Ptr {\n\t\telem := reflect.ValueOf(value).Elem()\n\n\t\t// Check if elem is a zero value, return empty string if it is.\n\t\tif elem == reflect.Zero(reflect.TypeOf(elem)) {\n\t\t\treturn \"\", nil\n\t\t}\n\t\tvalue = elem.Interface()\n\t}\n\n\tswitch t := reflect.TypeOf(value); t {\n\tcase reflect.TypeOf(\"\"):\n\t\treturn value.(string), nil\n\tcase reflect.TypeOf(int64(0)):\n\t\treturn strconv.FormatInt(value.(int64), 10), nil\n\tcase reflect.TypeOf([]uint8{}):\n\t\treturn base64.StdEncoding.EncodeToString(value.([]uint8)), nil\n\tcase reflect.TypeOf(timestamp.Timestamp{}):\n\t\tv := value.(timestamp.Timestamp)\n\t\treturn ptypes.TimestampString(&v), nil\n\tdefault:\n\t\treturn \"\", errors.New(fmt.Sprintf(\"Got unsupported value: %t\", t))\n\t}\n}", "title": "" }, { "docid": "50d0257d2efff9ac9e61ab2ec0d4a91a", "score": "0.75638044", "text": "func (v Value) ToString() string {\n\treturn BytesToString(v.val)\n}", "title": "" }, { "docid": "5aa64a25dab674af8b1b8c1c72fd8859", "score": "0.7507042", "text": "func ToString(v Value) string {\n\tif s, ok := v.(Stringer); ok {\n\t\treturn s.String()\n\t}\n\treturn v.Repr(NoPretty)\n}", "title": "" }, { "docid": "bcdef2ac393a58ce08a419b850554713", "score": "0.737081", "text": "func (f *messageFlattener) valueToString(value interface{}) (s string, err error) {\n\tvalue = dereferencePointer(value)\n\tif value == nil {\n\t\treturn \"\", nil\n\t}\n\n\tswitch t := reflect.TypeOf(value); t {\n\tcase reflect.TypeOf(\"\"):\n\t\treturn value.(string), nil\n\tcase reflect.TypeOf(int64(0)):\n\t\treturn strconv.FormatInt(value.(int64), 10), nil\n\tcase reflect.TypeOf([]uint8{}):\n\t\treturn f.valueEncoder.EncodeToString(value.([]uint8)), nil\n\tcase reflect.TypeOf(timestamp.Timestamp{}):\n\t\tv := value.(timestamp.Timestamp)\n\t\treturn ptypes.TimestampString(&v), nil\n\tdefault:\n\t\treturn \"\", errors.New(fmt.Sprintf(\"Got unsupported value: %t\", t))\n\t}\n}", "title": "" }, { "docid": "658a3c85fecf0d9fcc358c8793cbc9fb", "score": "0.7277034", "text": "func toString(v interface{}) string {\n\treturn fmt.Sprint(v)\n}", "title": "" }, { "docid": "085b0bf1e4a23205f9297fa2a46b9f97", "score": "0.7222956", "text": "func ToString(value interface{}) string {\n switch v := value.(type) {\n case string:\n return v\n case int:\n return strconv.FormatInt(int64(v), 10)\n case int8:\n return strconv.FormatInt(int64(v), 10)\n case int16:\n return strconv.FormatInt(int64(v), 10)\n case int32:\n return strconv.FormatInt(int64(v), 10)\n case int64:\n return strconv.FormatInt(v, 10)\n case uint:\n return strconv.FormatUint(uint64(v), 10)\n case uint8:\n return strconv.FormatUint(uint64(v), 10)\n case uint16:\n return strconv.FormatUint(uint64(v), 10)\n case uint32:\n return strconv.FormatUint(uint64(v), 10)\n case uint64:\n return strconv.FormatUint(v, 10)\n case float32:\n return strconv.FormatFloat(float64(v), 'E', -1, 32)\n case float64:\n return strconv.FormatFloat(v, 'E', -1, 64)\n }\n return \"\"\n}", "title": "" }, { "docid": "caa2c67c979da6ff736c8b8a6769ec1c", "score": "0.7166076", "text": "func ToString(v interface{}) string {\n\tif v == nil {\n\t\treturn \" \"\n\t}\n\tswitch value := v.(type) {\n\tcase string:\n\t\treturn value\n\tcase *string:\n\t\treturn *value\n\tcase fmt.Stringer:\n\t\treturn value.String()\n\tcase error:\n\t\treturn value.Error()\n\tdefault:\n\t\treturn fmt.Sprintf(\"%+v\", value)\n\t}\n}", "title": "" }, { "docid": "d6ee677efacf2408cc1fadfc2b43ae22", "score": "0.7160862", "text": "func toString(tv *types.TypedValue) string {\n\tif tv == nil {\n\t\treturn \"\"\n\t}\n\ti, err := typedvalues.Format(tv)\n\tif err != nil {\n\t\tlogrus.Warn(\"Failed to format input: %v\", err)\n\t}\n\n\treturn fmt.Sprintf(\"%v\", i)\n}", "title": "" }, { "docid": "c2f0bda06ecd3ebac57ea114a85be4f8", "score": "0.71607125", "text": "func (s *StringObject) ToString() string {\n\treturn fmt.Sprintf(`%s`, s.value)\n}", "title": "" }, { "docid": "14dde925f9266e4d7c39c4f08b5acbca", "score": "0.7139725", "text": "func ToString(v interface{}) string {\n\tvar s string\n\tswitch v.(type) {\n\tcase string:\n\t\ts = v.(string)\n\tcase []byte:\n\t\ts = string(v.([]byte))\n\tcase []rune:\n\t\ts = string(v.([]rune))\n\tcase int:\n\t\ts = strconv.Itoa(v.(int))\n\tcase int8:\n\t\ts = strconv.Itoa(int(v.(int8)))\n\tcase int16:\n\t\ts = strconv.Itoa(int(v.(int16)))\n\tcase int32: // as rune\n\t\ts = strconv.FormatInt(int64(v.(int32)), 10)\n\tcase int64:\n\t\ts = strconv.FormatInt(v.(int64), 10)\n\tcase uint:\n\t\ts = strconv.FormatUint(uint64(v.(uint)), 10)\n\tcase uint8: // as byte\n\t\ts = strconv.FormatUint(uint64(v.(uint8)), 10)\n\tcase uint16:\n\t\ts = strconv.FormatUint(uint64(v.(uint16)), 10)\n\tcase uint32:\n\t\ts = strconv.FormatUint(uint64(v.(uint32)), 10)\n\tcase uint64:\n\t\ts = strconv.FormatUint(v.(uint64), 10)\n\tcase float32:\n\t\ts = strconv.FormatFloat(float64(v.(float32)), 'f', -1, 64)\n\tcase float64:\n\t\ts = strconv.FormatFloat(v.(float64), 'f', -1, 64)\n\tcase bool:\n\t\ts = strconv.FormatBool(v.(bool))\n\tdefault:\n\t\ts = fmt.Sprint(v)\n\t}\n\n\treturn s\n}", "title": "" }, { "docid": "b92a233de0f08e381473789e15254195", "score": "0.7137638", "text": "func ToStr(v interface{}) string {\n\tif v == nil {\n\t\treturn \"\"\n\t}\n\tswitch v := v.(type) {\n\tcase string:\n\t\treturn v\n\tcase int:\n\t\treturn strconv.Itoa(v)\n\tcase int32:\n\t\treturn strconv.Itoa(int(v))\n\tcase int64:\n\t\treturn strconv.FormatInt(v, 10)\n\tcase bool:\n\t\treturn strconv.FormatBool(v)\n\tcase float32:\n\t\treturn strconv.FormatFloat(float64(v), 'f', -1, 32)\n\tcase float64:\n\t\treturn strconv.FormatFloat(v, 'f', -1, 64)\n\tcase []uint8:\n\t\treturn string(v)\n\tdefault:\n\t\tresultJSON, err := json.Marshal(v)\n\t\tif err != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\treturn string(resultJSON)\n\t}\n}", "title": "" }, { "docid": "78ea48a34b29b2637c831318fb7c65ed", "score": "0.71212924", "text": "func toString(x interface{}) string {\n\tswitch x := x.(type) {\n\tcase string:\n\t\treturn x\n\tcase fmt.Stringer:\n\t\treturn x.String()\n\tcase int:\n\t\treturn strconv.FormatInt(int64(x), 10)\n\tcase int8:\n\t\treturn strconv.FormatInt(int64(x), 10)\n\tcase int16:\n\t\treturn strconv.FormatInt(int64(x), 10)\n\tcase int32:\n\t\treturn strconv.FormatInt(int64(x), 10)\n\tcase int64:\n\t\treturn strconv.FormatInt(int64(x), 10)\n\tcase uint:\n\t\treturn strconv.FormatUint(uint64(x), 10)\n\tcase uint8:\n\t\treturn strconv.FormatUint(uint64(x), 10)\n\tcase uint16:\n\t\treturn strconv.FormatUint(uint64(x), 10)\n\tcase uint32:\n\t\treturn strconv.FormatUint(uint64(x), 10)\n\tcase uint64:\n\t\treturn strconv.FormatUint(uint64(x), 10)\n\tcase float32:\n\t\treturn strconv.FormatFloat(float64(x), 'f', 6, 32)\n\tcase float64:\n\t\treturn strconv.FormatFloat(x, 'f', 6, 64)\n\tcase []byte:\n\t\treturn string(x)\n\tcase []rune:\n\t\treturn string(x)\n\tcase nil:\n\t\treturn \"\"\n\tdefault:\n\t\treturn fmt.Sprint(x)\n\t}\n}", "title": "" }, { "docid": "e84c7cb54e34ae565322cfa4fe06f3c1", "score": "0.71195143", "text": "func (v Value) String() string {\n\treturn BytesToString(v.val)\n}", "title": "" }, { "docid": "508af62693ad1abd2e505b270bbd1576", "score": "0.7114843", "text": "func (v *Value) String() string {\n\treturn EncodeToString(*v)\n}", "title": "" }, { "docid": "6622b33d3d5022c7ce89219ad857307d", "score": "0.7093141", "text": "func valToString(v bigquery.Value) string {\n\tvar s string\n\tswitch v.(type) {\n\tcase string:\n\t\ts = v.(string)\n\tdefault:\n\t\ts = \"invalid string\"\n\t}\n\treturn s\n}", "title": "" }, { "docid": "06c4d3ca914e58cbe0221cb8f8f1ba59", "score": "0.7074652", "text": "func (v Value) ToPrintString() string {\n\treturn v.toString(0, false)\n}", "title": "" }, { "docid": "a2d071edad37e25e38e13401a728868c", "score": "0.70683736", "text": "func (v Value) String() string {\n\treturn strconv.FormatInt(int64(v), 10)\n}", "title": "" }, { "docid": "d56312d17d05e4616dd6f3b2e97bd8ea", "score": "0.7053109", "text": "func ValueToStr(field reflect.Value) (string, error) {\n\tif field.Kind() == reflect.Ptr && field.IsNil() {\n\t\treturn \"\", nil\n\t}\n\n\tv := reflect.Indirect(field)\n\tswitch v.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn strconv.FormatInt(v.Int(), 10), nil\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\treturn strconv.FormatUint(v.Uint(), 10), nil\n\tcase reflect.Bool:\n\t\treturn strconv.FormatBool(v.Bool()), nil\n\tcase reflect.Float32:\n\t\treturn strconv.FormatFloat(v.Float(), 'g', -1, 32), nil\n\tcase reflect.Float64:\n\t\treturn strconv.FormatFloat(v.Float(), 'g', -1, 64), nil\n\tcase reflect.String:\n\t\treturn v.String(), nil\n\tdefault:\n\t\treturn \"\", errors.New(\"reflectx: unexpected type for ValueToStr: \" + field.Type().String())\n\t}\n}", "title": "" }, { "docid": "1f81a637f91423392b6298dd6082133b", "score": "0.7042232", "text": "func ToString(_v interface{}) (v string, err error) {\n\tswitch _v.(type) {\n\tcase string:\n\t\tv = _v.(string)\n\tcase []byte:\n\t\tv = string(_v.([]byte))\n\tcase bool, int, int8, int16, int32, int64, uint, uint8, uint16, uint32,\n\t\tuint64:\n\t\tv = fmt.Sprintf(\"%d\", _v)\n\tcase float32, float64:\n\t\tv = fmt.Sprintf(\"%f\", _v)\n\tdefault:\n\t\terr = fmt.Errorf(\"unknown type of %T\", _v)\n\t}\n\treturn\n}", "title": "" }, { "docid": "57068c942418558810cb1e28ff022741", "score": "0.70407414", "text": "func ToString(v interface{}) string {\n\tresult := \"\"\n\tif v == nil {\n\t\treturn \"\"\n\t}\n\tswitch v.(type) {\n\tcase string:\n\t\tresult = v.(string)\n\tcase int:\n\t\tresult = strconv.Itoa(v.(int))\n\tcase int64:\n\t\tresult = strconv.FormatInt(v.(int64), 10)\n\tcase bool:\n\t\tresult = strconv.FormatBool(v.(bool))\n\tcase float64:\n\t\tresult = strconv.FormatFloat(v.(float64), 'f', -1, 64)\n\tcase uint8:\n\t\tresult = string(v.(uint8))\n\tcase []uint8:\n\t\tresult = string(v.([]uint8))\n\tdefault:\n\t\tresultJSON, err := json.Marshal(v)\n\t\tif err == nil {\n\t\t\tresult = string(resultJSON)\n\t\t} else {\n\t\t\tlog.Println(\"func ToString\", err)\n\t\t}\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "a1a701e8b919aedb1c37dcdbf152a1f0", "score": "0.70388955", "text": "func CoerceToString(val interface{}) (string, error) {\n\n\tswitch t := val.(type) {\n\tcase string:\n\t\treturn t, nil\n\tcase int:\n\t\treturn strconv.Itoa(t), nil\n\tcase int64:\n\t\treturn strconv.FormatInt(t, 10), nil\n\tcase float32:\n\t\treturn strconv.FormatFloat(float64(t), 'f', -1, 64), nil\n\tcase float64:\n\t\treturn strconv.FormatFloat(t, 'f', -1, 64), nil\n\tcase json.Number:\n\t\treturn t.String(), nil\n\tcase bool:\n\t\treturn strconv.FormatBool(t), nil\n\tcase nil:\n\t\treturn \"\", nil\n\tdefault:\n\t\tb, err := json.Marshal(t)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"unable to Coerce %#v to string\", t)\n\t\t}\n\t\treturn string(b), nil\n\t}\n}", "title": "" }, { "docid": "fc31d4c85f85879d57bb47925456c89e", "score": "0.699875", "text": "func (value Value) String() string {\n\treturn value.GetString(false, true)\n}", "title": "" }, { "docid": "a58907acacae0984b0d40c2afd4c1ffd", "score": "0.69732517", "text": "func (n NumberValue) String() string { return string(n) }", "title": "" }, { "docid": "9f35ef95c81b07cde222885b54474b43", "score": "0.697098", "text": "func String(val interface{}) string {\n\tvar buf []byte\n\n\tif val == nil {\n\t\treturn \"\"\n\t}\n\n\tswitch t := val.(type) {\n\n\tcase int:\n\t\tbuf = int64ToBytes(int64(t))\n\tcase int8:\n\t\tbuf = int64ToBytes(int64(t))\n\tcase int16:\n\t\tbuf = int64ToBytes(int64(t))\n\tcase int32:\n\t\tbuf = int64ToBytes(int64(t))\n\tcase int64:\n\t\tbuf = int64ToBytes(int64(t))\n\n\tcase uint:\n\t\tbuf = uint64ToBytes(uint64(t))\n\tcase uint8:\n\t\tbuf = uint64ToBytes(uint64(t))\n\tcase uint16:\n\t\tbuf = uint64ToBytes(uint64(t))\n\tcase uint32:\n\t\tbuf = uint64ToBytes(uint64(t))\n\tcase uint64:\n\t\tbuf = uint64ToBytes(uint64(t))\n\n\tcase float32:\n\t\tbuf = float32ToBytes(t)\n\tcase float64:\n\t\tbuf = float64ToBytes(t)\n\n\tcase complex128:\n\t\tbuf = complex128ToBytes(t)\n\tcase complex64:\n\t\tbuf = complex128ToBytes(complex128(t))\n\n\tcase bool:\n\t\tif val.(bool) == true {\n\t\t\treturn \"true\"\n\t\t}\n\n\t\treturn \"false\"\n\n\tcase string:\n\t\treturn t\n\n\tcase []byte:\n\t\treturn string(t)\n\n\tdefault:\n\t\treturn fmt.Sprintf(\"%v\", val)\n\t}\n\n\treturn string(buf)\n}", "title": "" }, { "docid": "6992be84fb18244745d730fa76851c32", "score": "0.69234544", "text": "func ToString(v interface{}) string {\n\tswitch v := v.(type) {\n\tcase Value:\n\t\treturn ToString(v.V)\n\tcase bool:\n\t\tif v {\n\t\t\treturn \"true\"\n\t\t}\n\t\treturn \"false\"\n\tcase int:\n\t\treturn strconv.Itoa(v)\n\tcase string:\n\t\treturn v\n\tcase rbxapijson.Type:\n\t\treturn v.String()\n\tcase []string:\n\t\treturn \"[\" + strings.Join(v, \", \") + \"]\"\n\tcase rbxapijson.Tags:\n\t\treturn \"[\" + strings.Join(v, \", \") + \"]\"\n\tcase rbxapijson.Parameters:\n\t\tn := v.GetLength()\n\t\tss := make([]string, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tparam := v.GetParameter(i).(rbxapijson.Parameter)\n\t\t\tss[i] = param.Type.String() + \" \" + param.Name\n\t\t\tif param.HasDefault {\n\t\t\t\tss[i] += \" = \" + param.Default\n\t\t\t}\n\t\t}\n\t\treturn \"(\" + strings.Join(ss, \", \") + \")\"\n\t}\n\treturn \"<unknown value \" + reflect.TypeOf(v).String() + \">\"\n}", "title": "" }, { "docid": "cbfb458d97e919f9a0210dd1e60d074f", "score": "0.69093865", "text": "func (v *Value) String() string {\n\tif v.isStmtValue {\n\t\tswitch v.Type {\n\t\t// string\n\t\tcase MYSQL_TYPE_DECIMAL:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_NEWDATE:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_NEWDECIMAL:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_STRING:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_VAR_STRING:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_TINY_BLOB:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_BLOB:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_MEDIUM_BLOB:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_LONG_BLOB:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_BIT:\n\t\t\treturn string(v.Inner)\n\t\t// int\n\t\tcase MYSQL_TYPE_TINY:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_YEAR:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_SHORT:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_INT24:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_LONG:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_LONGLONG:\n\t\t\treturn strconv.FormatInt(v.getInt(), 10)\n\t\t// float\n\t\tcase MYSQL_TYPE_FLOAT:\n\t\t\tfallthrough\n\t\tcase MYSQL_TYPE_DOUBLE:\n\t\t\treturn strconv.FormatFloat(v.getFloat(), 'f', -1, 64)\n\t\t}\n\t}\n\treturn string(v.Inner)\n}", "title": "" }, { "docid": "964b05ef6475a56a704edf80a5a3ecfe", "score": "0.6908462", "text": "func ToString(value interface{}) (string, error) {\n\tswitch t := value.(type) {\n\tcase []byte:\n\t\treturn string(value.([]byte)), nil\n\tcase string:\n\t\treturn value.(string), nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unexpected-type-%T\", t)\n\t}\n}", "title": "" }, { "docid": "f9d0a3ba9afc7224a0c66b22a8413be9", "score": "0.69044", "text": "func convertToString(value interface{}) (string, error) {\n\tswitch typed := value.(type) {\n\tcase string:\n\t\treturn string(typed), nil\n\tcase float64:\n\t\treturn fmt.Sprintf(\"%f\", typed), nil\n\tcase int64:\n\t\treturn strconv.FormatInt(typed, 10), nil\n\tcase int:\n\t\treturn strconv.Itoa(typed), nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"Could not convert %T to string\", value)\n\t}\n}", "title": "" }, { "docid": "d506731dab8ed62d18839925a09315fd", "score": "0.68571496", "text": "func ToString(v interface{}, opt *ToStringOpt) string {\n\tif v == nil {\n\t\treturn \"nil\"\n\t}\n\n\tif opt == nil {\n\t\topt = &ToStringOpt{Quotes: true}\n\t}\n\n\tswitch v := v.(type) {\n\tcase string:\n\t\tif opt.Quotes {\n\t\t\treturn fmt.Sprintf(\"'%s'\", v)\n\t\t}\n\t\tif opt.DoubleQuotes {\n\t\t\treturn fmt.Sprintf(`\"%s\"`, v)\n\t\t}\n\t\treturn v\n\tcase int,\n\t\tint8,\n\t\tint16,\n\t\tint32,\n\t\tint64,\n\t\tuint,\n\t\tuint8,\n\t\tuint16,\n\t\tuint32,\n\t\tuint64:\n\t\treturn fmt.Sprintf(\"%d\", v)\n\tcase float32, float64:\n\t\treturn strings.TrimRight(strings.TrimRight(fmt.Sprintf(\"%v\", v), \"0\"), \".\")\n\tcase bool:\n\t\tif v {\n\t\t\treturn \"1\"\n\t\t}\n\t\treturn \"0\"\n\tcase time.Time:\n\t\tt := v.Format(\"2006-01-02 15:04:05\")\n\t\tif opt.Quotes {\n\t\t\treturn fmt.Sprintf(\"'%s'\", t)\n\t\t}\n\t\tif opt.DoubleQuotes {\n\t\t\treturn fmt.Sprintf(`\"%s\"`, t)\n\t\t}\n\t\treturn t\n\t}\n\n\ttyp := reflect.TypeOf(v).Kind()\n\tif typ == reflect.Slice || typ == reflect.Array {\n\t\tvar s string\n\t\tvals := reflect.ValueOf(v)\n\t\tfor i := 0; i < vals.Len(); i++ {\n\t\t\tif i != 0 {\n\t\t\t\ts += \", \"\n\t\t\t}\n\t\t\ts += ToString(vals.Index(i).Interface(), opt)\n\t\t}\n\t\treturn s\n\t}\n\n\treturn fmt.Sprintf(\"%s\", v)\n}", "title": "" }, { "docid": "f764e281e5f43180079b5ce3016a8c9e", "score": "0.68551075", "text": "func ToString(v Value) string {\r\n\r\n\tif v == nil {\r\n\t\treturn \"nil\"\r\n\t}\r\n\r\n\tf, ok := v.(Function)\r\n\tif ok {\r\n\t\treturn fmt.Sprintf(\"func(%s)[%s]{...}\",\r\n\t\t\tstrings.Join(f.parameters, \", \"),\r\n\t\t\tstrings.Join(f.channels, \", \"))\r\n\t}\r\n\r\n\tswitch v2 := v.(type) {\r\n\tcase bool:\r\n\t\tif v2 {\r\n\t\t\treturn \"true\"\r\n\t\t}\r\n\t\treturn \"false\"\r\n\tcase int64:\r\n\t\treturn strconv.FormatInt(v2, 10)\r\n\tcase float64:\r\n\t\treturn strconv.FormatFloat(v2, 'f', -1, 64)\r\n\tdefault:\r\n\t\treturn fmt.Sprintf(\"%s\", v)\r\n\t}\r\n}", "title": "" }, { "docid": "f193f660e117711daa30f9315ca0f5d0", "score": "0.6841588", "text": "func ToString(i interface{}) string {\r\n\tv, _ := ToStringE(i)\r\n\treturn v\r\n}", "title": "" }, { "docid": "9cf3ba1ae19101480a478255a4d848c6", "score": "0.6829532", "text": "func (v Value) String() string {\n\treturn value_String(v)\n}", "title": "" }, { "docid": "74920deda030462b9fecf1e3b03d4500", "score": "0.682872", "text": "func (v Value) Str() string { v.testType(Tstring); return v.AsString() }", "title": "" }, { "docid": "6c6883b5f43bb57b733867185d029ce6", "score": "0.68167955", "text": "func ToString(_v interface{}) (v string, err error) {\n\tswitch t := _v.(type) {\n\tcase nil:\n\tcase string:\n\t\tv = t\n\tcase []byte:\n\t\tv = string(t)\n\tcase bool:\n\t\tif t {\n\t\t\tv = \"true\"\n\t\t} else {\n\t\t\tv = \"false\"\n\t\t}\n\tcase int:\n\t\tv = strconv.FormatInt(int64(t), 10)\n\tcase int8:\n\t\tv = strconv.FormatInt(int64(t), 10)\n\tcase int16:\n\t\tv = strconv.FormatInt(int64(t), 10)\n\tcase int32:\n\t\tv = strconv.FormatInt(int64(t), 10)\n\tcase int64:\n\t\tv = strconv.FormatInt(t, 10)\n\tcase uint:\n\t\tv = strconv.FormatUint(uint64(t), 10)\n\tcase uint8:\n\t\tv = strconv.FormatUint(uint64(t), 10)\n\tcase uint16:\n\t\tv = strconv.FormatUint(uint64(t), 10)\n\tcase uint32:\n\t\tv = strconv.FormatUint(uint64(t), 10)\n\tcase uint64:\n\t\tv = strconv.FormatUint(t, 10)\n\tcase float32:\n\t\tv = strconv.FormatFloat(float64(t), 'f', -1, 32)\n\tcase float64:\n\t\tv = strconv.FormatFloat(t, 'f', -1, 64)\n\tcase error:\n\t\tv = t.Error()\n\tcase time.Time:\n\t\tv = t.Format(time.RFC3339Nano)\n\tcase fmt.Stringer:\n\t\tv = t.String()\n\tdefault:\n\t\terr = ErrUnknownType\n\t}\n\treturn\n}", "title": "" }, { "docid": "abd5bf384bf1a6f53a6ddcb53a2a65ac", "score": "0.67954904", "text": "func ToStr(value interface{}, args ...int) (s string) {\n\tswitch v := value.(type) {\n\tcase bool:\n\t\ts = strconv.FormatBool(v)\n\tcase float32:\n\t\ts = strconv.FormatFloat(float64(v), 'f', argInt(args).Get(0, -1), argInt(args).Get(1, 32))\n\tcase float64:\n\t\ts = strconv.FormatFloat(v, 'f', argInt(args).Get(0, -1), argInt(args).Get(1, 64))\n\tcase int:\n\t\ts = strconv.FormatInt(int64(v), argInt(args).Get(0, 10))\n\tcase int8:\n\t\ts = strconv.FormatInt(int64(v), argInt(args).Get(0, 10))\n\tcase int16:\n\t\ts = strconv.FormatInt(int64(v), argInt(args).Get(0, 10))\n\tcase int32:\n\t\ts = strconv.FormatInt(int64(v), argInt(args).Get(0, 10))\n\tcase int64:\n\t\ts = strconv.FormatInt(v, argInt(args).Get(0, 10))\n\tcase uint:\n\t\ts = strconv.FormatUint(uint64(v), argInt(args).Get(0, 10))\n\tcase uint8:\n\t\ts = strconv.FormatUint(uint64(v), argInt(args).Get(0, 10))\n\tcase uint16:\n\t\ts = strconv.FormatUint(uint64(v), argInt(args).Get(0, 10))\n\tcase uint32:\n\t\ts = strconv.FormatUint(uint64(v), argInt(args).Get(0, 10))\n\tcase uint64:\n\t\ts = strconv.FormatUint(v, argInt(args).Get(0, 10))\n\tcase string:\n\t\ts = v\n\tcase []byte:\n\t\ts = string(v)\n\tdefault:\n\t\ts = fmt.Sprintf(\"%v\", v)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "abd5bf384bf1a6f53a6ddcb53a2a65ac", "score": "0.67954904", "text": "func ToStr(value interface{}, args ...int) (s string) {\n\tswitch v := value.(type) {\n\tcase bool:\n\t\ts = strconv.FormatBool(v)\n\tcase float32:\n\t\ts = strconv.FormatFloat(float64(v), 'f', argInt(args).Get(0, -1), argInt(args).Get(1, 32))\n\tcase float64:\n\t\ts = strconv.FormatFloat(v, 'f', argInt(args).Get(0, -1), argInt(args).Get(1, 64))\n\tcase int:\n\t\ts = strconv.FormatInt(int64(v), argInt(args).Get(0, 10))\n\tcase int8:\n\t\ts = strconv.FormatInt(int64(v), argInt(args).Get(0, 10))\n\tcase int16:\n\t\ts = strconv.FormatInt(int64(v), argInt(args).Get(0, 10))\n\tcase int32:\n\t\ts = strconv.FormatInt(int64(v), argInt(args).Get(0, 10))\n\tcase int64:\n\t\ts = strconv.FormatInt(v, argInt(args).Get(0, 10))\n\tcase uint:\n\t\ts = strconv.FormatUint(uint64(v), argInt(args).Get(0, 10))\n\tcase uint8:\n\t\ts = strconv.FormatUint(uint64(v), argInt(args).Get(0, 10))\n\tcase uint16:\n\t\ts = strconv.FormatUint(uint64(v), argInt(args).Get(0, 10))\n\tcase uint32:\n\t\ts = strconv.FormatUint(uint64(v), argInt(args).Get(0, 10))\n\tcase uint64:\n\t\ts = strconv.FormatUint(v, argInt(args).Get(0, 10))\n\tcase string:\n\t\ts = v\n\tcase []byte:\n\t\ts = string(v)\n\tdefault:\n\t\ts = fmt.Sprintf(\"%v\", v)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "b841da6c95c8913e2563d480af178212", "score": "0.67786604", "text": "func toString(s interface{}) string {\n\tif s != nil {\n\t\treturn s.(string)\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "b8a8a3d62b8c75b2b31920860fdf9ff4", "score": "0.677524", "text": "func ToStr(value interface{}, args ...int) (s string) {\n\tswitch v := value.(type) {\n\tcase bool:\n\t\ts = strconv.FormatBool(v)\n\tcase float32:\n\t\ts = strconv.FormatFloat(float64(v), 'f', ArgInt(args).Get(0, -1), ArgInt(args).Get(1, 32))\n\tcase float64:\n\t\ts = strconv.FormatFloat(v, 'f', ArgInt(args).Get(0, -1), ArgInt(args).Get(1, 64))\n\tcase int:\n\t\ts = strconv.FormatInt(int64(v), ArgInt(args).Get(0, 10))\n\tcase int8:\n\t\ts = strconv.FormatInt(int64(v), ArgInt(args).Get(0, 10))\n\tcase int16:\n\t\ts = strconv.FormatInt(int64(v), ArgInt(args).Get(0, 10))\n\tcase int32:\n\t\ts = strconv.FormatInt(int64(v), ArgInt(args).Get(0, 10))\n\tcase int64:\n\t\ts = strconv.FormatInt(v, ArgInt(args).Get(0, 10))\n\tcase uint:\n\t\ts = strconv.FormatUint(uint64(v), ArgInt(args).Get(0, 10))\n\tcase uint8:\n\t\ts = strconv.FormatUint(uint64(v), ArgInt(args).Get(0, 10))\n\tcase uint16:\n\t\ts = strconv.FormatUint(uint64(v), ArgInt(args).Get(0, 10))\n\tcase uint32:\n\t\ts = strconv.FormatUint(uint64(v), ArgInt(args).Get(0, 10))\n\tcase uint64:\n\t\ts = strconv.FormatUint(v, ArgInt(args).Get(0, 10))\n\tcase string:\n\t\ts = v\n\tcase []byte:\n\t\ts = string(v)\n\tdefault:\n\t\ts = fmt.Sprintf(\"%v\", v)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "28bb249aa6618c537a503dc8f5ae5b22", "score": "0.6728772", "text": "func ToString(in interface{}) *string {\n\treturn toString(in, false)\n}", "title": "" }, { "docid": "330ded8ee94b6dcc0971b91db831e99f", "score": "0.67149526", "text": "func ConvertToString(val interface{}) string {\n\tif bytes, isBytes := val.([]byte); isBytes {\n\t\treturn string(bytes)\n\t}\n\n\tif str, isString := val.(string); isString {\n\t\treturn str\n\t}\n\n\treturn fmt.Sprintf(\"%v\", val)\n}", "title": "" }, { "docid": "93863e5e0ad89e13f46c6b34b2080270", "score": "0.67146266", "text": "func (v Value) String() string {\n\treturn v.Join(\"|\", FormatGo)\n}", "title": "" }, { "docid": "3d094a363a5872c137cc1d427026ab3d", "score": "0.6672311", "text": "func (ev Value) String() string {\n\tif ev.Nil() {\n\t\treturn \"<<nil>>\"\n\t}\n\tswitch ev.Type.BaseType {\n\tcase VTBoolean:\n\t\treturn strconv.FormatBool(ev.Value.(bool))\n\tcase VTInteger:\n\t\treturn strconv.FormatInt(int64(ev.Value.(int)), 10)\n\tcase VTList:\n\t\tvar sb strings.Builder\n\t\tsb.WriteString(\"[\")\n\t\tfirst := true\n\t\tfor _, val := range ev.Value.([]Value) {\n\t\t\tif !first {\n\t\t\t\tsb.WriteString(\",\")\n\t\t\t}\n\t\t\tsb.WriteString(val.String())\n\t\t\tfirst = false\n\t\t}\n\t\tsb.WriteString(\"]\")\n\t\treturn sb.String()\n\tcase VTMap:\n\t\tvar sb strings.Builder\n\t\tsb.WriteString(\"{\")\n\n\t\t// To get a consistent map string we \"sort\" the map by key\n\t\tvalueMap := ev.Value.(map[string]Value)\n\t\tkeys := make([]string, 0, len(valueMap))\n\t\tfor key := range valueMap {\n\t\t\tkeys = append(keys, key)\n\t\t}\n\t\tsort.Strings(keys)\n\t\tfirst := true\n\t\tfor _, key := range keys {\n\t\t\tif !first {\n\t\t\t\tsb.WriteString(\",\")\n\t\t\t}\n\t\t\tsb.WriteString(key)\n\t\t\tsb.WriteString(\":\")\n\t\t\tsb.WriteString(valueMap[key].String())\n\t\t\tfirst = false\n\t\t}\n\n\t\tsb.WriteString(\"}\")\n\t\treturn sb.String()\n\tcase VTString, VTRegexp:\n\t\t// A string value is represented as a string literar including string markers (\"a string\")\n\t\tvar sb strings.Builder\n\t\tsb.WriteString(`\"`)\n\t\tsb.WriteString(ev.Value.(string))\n\t\tsb.WriteString(`\"`)\n\t\treturn sb.String()\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"value type %v has no string representation\", ev.Type.BaseType))\n\t}\n}", "title": "" }, { "docid": "7cb80032f7b66db169121b6c1b977526", "score": "0.6644811", "text": "func (v Value) AsString() string {\n\tif ln := byte(v.num) >> 4; ln > 0 {\n\t\tbuf := make([]byte, ln-1)\n\t\tcopy(buf, (*(*[8]byte)(unsafe.Pointer(&v.num)))[1:ln])\n\t\treturn string(buf)\n\t}\n\treturn *(*string)(v.ptr)\n}", "title": "" }, { "docid": "0f30c0ada45aa85728a81258e402d23f", "score": "0.66404235", "text": "func (v *Value) String() string {\n\tif v.Stringv != nil {\n\t\treturn *v.Stringv\n\t} else if v.Numberv != nil && v.Precision != nil {\n\t\treturn strconv.FormatFloat(*v.Numberv, 'f', int(*v.Precision), 32)\n\t} else {\n\t\treturn \"\"\n\t}\n}", "title": "" }, { "docid": "26574376ea9044674594d21b9e75e178", "score": "0.66357934", "text": "func (avt ValueType) String() string {\n\tswitch avt {\n\tcase ValueTypeEmpty:\n\t\treturn \"Empty\"\n\tcase ValueTypeStr:\n\t\treturn \"Str\"\n\tcase ValueTypeBool:\n\t\treturn \"Bool\"\n\tcase ValueTypeInt:\n\t\treturn \"Int\"\n\tcase ValueTypeDouble:\n\t\treturn \"Double\"\n\tcase ValueTypeMap:\n\t\treturn \"Map\"\n\tcase ValueTypeSlice:\n\t\treturn \"Slice\"\n\tcase ValueTypeBytes:\n\t\treturn \"Bytes\"\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "0f7f189cb8e228f1358d2f1d2cdabf91", "score": "0.6634771", "text": "func toString(i interface{}) string {\n\tv, err := toStringE(i)\n\tpanicerr(err)\n\treturn v\n}", "title": "" }, { "docid": "1b310adcf2dde02c6a40fe36a0226d78", "score": "0.662031", "text": "func (v Value) AsString() string {\n\tswitch v.Type() {\n\tcase ValueTypeEmpty:\n\t\treturn \"\"\n\n\tcase ValueTypeStr:\n\t\treturn v.Str()\n\n\tcase ValueTypeBool:\n\t\treturn strconv.FormatBool(v.Bool())\n\n\tcase ValueTypeDouble:\n\t\treturn float64AsString(v.Double())\n\n\tcase ValueTypeInt:\n\t\treturn strconv.FormatInt(v.Int(), 10)\n\n\tcase ValueTypeMap:\n\t\tjsonStr, _ := json.Marshal(v.Map().AsRaw())\n\t\treturn string(jsonStr)\n\n\tcase ValueTypeBytes:\n\t\treturn base64.StdEncoding.EncodeToString(*v.Bytes().getOrig())\n\n\tcase ValueTypeSlice:\n\t\tjsonStr, _ := json.Marshal(v.Slice().AsRaw())\n\t\treturn string(jsonStr)\n\n\tdefault:\n\t\treturn fmt.Sprintf(\"<Unknown OpenTelemetry attribute value type %q>\", v.Type())\n\t}\n}", "title": "" }, { "docid": "73c535b31157bd3ae13c634de54a2852", "score": "0.6610611", "text": "func convertToString(thing interface{}) string {\n\tfield := reflect.ValueOf(thing)\n\tvar value string\n\tswitch field.Kind() {\n\tcase reflect.String:\n\t\tvalue = field.String()\n\n\tcase reflect.Bool:\n\t\tif field.Bool() {\n\t\t\tvalue = \"1\"\n\t\t} else {\n\t\t\tvalue = \"0\"\n\t\t}\n\n\tcase reflect.Int:\n\t\tvalue = strconv.FormatInt(field.Int(), 10)\n\n\tcase reflect.Ptr:\n\t\tif !reflect.Indirect(field).IsValid() {\n\t\t\t// This happens if we have nil pointer. The only time this happens\n\t\t\t// is if we have a \"special\" boolean. Ignore these for now.\n\t\t} else {\n\t\t\tvalue = convertToString(reflect.Indirect(field))\n\t\t}\n\n\tcase reflect.Slice:\n\t\tvalues := []string{}\n\t\tfor j := 0; j < field.Len(); j++ {\n\t\t\telem := field.Index(j)\n\t\t\tvalues = append(values, convertToString(elem))\n\t\t}\n\t\tvalue = strings.Join(values, \" \")\n\n\tdefault:\n\t\tutils.Die(\"Can't convert type %s to string!\", field.Type().String())\n\t}\n\treturn value\n}", "title": "" }, { "docid": "5b003414c16efbfd632cf10d416de014", "score": "0.6599859", "text": "func (v Value) String() (string, error) {\n\tv, _ = v.Default()\n\tctx := v.ctx()\n\tif err := v.checkKind(ctx, adt.StringKind); err != nil {\n\t\treturn \"\", v.toErr(err)\n\t}\n\treturn v.eval(ctx).(*adt.String).Str, nil\n}", "title": "" }, { "docid": "b00b0fa51c76ecce7bdcd6d404c64af9", "score": "0.65977526", "text": "func (s RuneValue) String() string {\n\treturn string(s)\n}", "title": "" }, { "docid": "893e12c8ae785c3ed2626d0df4f924bc", "score": "0.65550315", "text": "func (v Value) String() string {\n\tsb := new(strings.Builder)\n\tv.encodeGraphQL(sb, 0)\n\treturn sb.String()\n}", "title": "" }, { "docid": "b1656406c3eb203581f5ca66266bc944", "score": "0.65522903", "text": "func valStr(v reflect.Value) string {\n\tif v.Kind() == reflect.String {\n\t\treturn v.String()\n\t}\n\treturn fmt.Sprint(v)\n}", "title": "" }, { "docid": "e6884200ba2651ac4954d964a663b968", "score": "0.6550138", "text": "func (i Int) ToString() String {\n\treturn String(fmt.Sprint(i))\n}", "title": "" }, { "docid": "8a69d8e3c6629d848b29d3f92401fc55", "score": "0.65324855", "text": "func (v Value) AsString() string {\n\treturn v.stringly\n}", "title": "" }, { "docid": "48a3b28c70b4bc88e64aafbe21e109fd", "score": "0.6530613", "text": "func ToString(it any) string {\n\t// first check for most likely cases for greatest efficiency\n\tswitch it := it.(type) {\n\tcase string:\n\t\treturn it\n\tcase *string:\n\t\treturn *it\n\tcase bool:\n\t\tif it {\n\t\t\treturn \"true\"\n\t\t}\n\t\treturn \"false\"\n\tcase *bool:\n\t\tif *it {\n\t\t\treturn \"true\"\n\t\t}\n\t\treturn \"false\"\n\tcase int:\n\t\treturn strconv.FormatInt(int64(it), 10)\n\tcase *int:\n\t\treturn strconv.FormatInt(int64(*it), 10)\n\tcase int32:\n\t\treturn strconv.FormatInt(int64(it), 10)\n\tcase *int32:\n\t\treturn strconv.FormatInt(int64(*it), 10)\n\tcase int64:\n\t\treturn strconv.FormatInt(it, 10)\n\tcase *int64:\n\t\treturn strconv.FormatInt(*it, 10)\n\tcase byte:\n\t\treturn strconv.FormatInt(int64(it), 10)\n\tcase *byte:\n\t\treturn strconv.FormatInt(int64(*it), 10)\n\tcase float64:\n\t\treturn strconv.FormatFloat(it, 'G', -1, 64)\n\tcase *float64:\n\t\treturn strconv.FormatFloat(*it, 'G', -1, 64)\n\tcase float32:\n\t\treturn strconv.FormatFloat(float64(it), 'G', -1, 32)\n\tcase *float32:\n\t\treturn strconv.FormatFloat(float64(*it), 'G', -1, 32)\n\tcase uintptr:\n\t\treturn fmt.Sprintf(\"%#x\", uintptr(it))\n\tcase *uintptr:\n\t\treturn fmt.Sprintf(\"%#x\", uintptr(*it))\n\t}\n\n\tif stringer, ok := it.(fmt.Stringer); ok {\n\t\treturn stringer.String()\n\t}\n\tif IfaceIsNil(it) {\n\t\treturn \"nil\"\n\t}\n\tv := NonPtrValue(reflect.ValueOf(it))\n\tvk := v.Kind()\n\tswitch {\n\tcase vk >= reflect.Int && vk <= reflect.Int64:\n\t\treturn strconv.FormatInt(v.Int(), 10)\n\tcase vk >= reflect.Uint && vk <= reflect.Uint64:\n\t\treturn strconv.FormatUint(v.Uint(), 10)\n\tcase vk == reflect.Bool:\n\t\treturn strconv.FormatBool(v.Bool())\n\tcase vk >= reflect.Float32 && vk <= reflect.Float64:\n\t\treturn strconv.FormatFloat(v.Float(), 'G', -1, 64)\n\tcase vk >= reflect.Complex64 && vk <= reflect.Complex128:\n\t\tcv := v.Complex()\n\t\trv := strconv.FormatFloat(real(cv), 'G', -1, 64) + \",\" + strconv.FormatFloat(imag(cv), 'G', -1, 64)\n\t\treturn rv\n\tcase vk == reflect.String:\n\t\treturn v.String()\n\tcase vk == reflect.Slice:\n\t\teltyp := SliceElType(it)\n\t\tif eltyp.Kind() == reflect.Uint8 { // []byte\n\t\t\treturn string(it.([]byte))\n\t\t}\n\t\tfallthrough\n\tdefault:\n\t\treturn fmt.Sprintf(\"%v\", it)\n\t}\n}", "title": "" }, { "docid": "e364a2bb5272594386347e61d1a38b0c", "score": "0.65015346", "text": "func (v StrVal) String() string { return string(v) }", "title": "" }, { "docid": "293971059f518f41049cc41e69e1a70a", "score": "0.6501104", "text": "func (b *VarStringColumnType) ToString(v interface{}) string {\n\treturn fmt.Sprintf(\"\\\"%s\\\"\", v.(string))\n}", "title": "" }, { "docid": "0672616266bf72b6ba6d9e9a7f6c34f9", "score": "0.649883", "text": "func ToString(value *string, defaultValue string) string {\n\tif value != nil {\n\t\treturn *value\n\t}\n\n\treturn defaultValue\n}", "title": "" }, { "docid": "07e4745bda1e371406b910fd826f092f", "score": "0.64829206", "text": "func (v Value) String() string {\n\treturn fmt.Sprintf(DefaultCurrency.Format, v/DefaultCurrency.Ratio, abs(v%DefaultCurrency.Ratio))\n}", "title": "" }, { "docid": "e549962c17764b9791b26fb0f8d17a44", "score": "0.6480946", "text": "func (n *node) String() string {\n\treturn fmt.Sprintf(\"%d\", n.value)\n}", "title": "" }, { "docid": "d8507fe3e947d13df271be9fadb49190", "score": "0.64722896", "text": "func StandardTypeToString(value interface{}) (string, error) {\n\tswitch val := value.(type) {\n\tcase float64:\n\t\treturn strconv.Itoa(int(val)), nil\n\tcase string:\n\t\treturn val, nil\n\tcase []byte:\n\t\tvar strValue string\n\t\tif !IsStringPrintable(val) {\n\t\t\t// We hexify like Python/pysnmp impl (keep compatibility) if the value contains non ascii letters:\n\t\t\t// https://github.com/etingof/pyasn1/blob/db8f1a7930c6b5826357646746337dafc983f953/pyasn1/type/univ.py#L950-L953\n\t\t\t// hexifying like pysnmp prettyPrint might lead to unpredictable results since `[]byte` might or might not have\n\t\t\t// elements outside of 32-126 range. New lines, tabs and carriage returns are also stripped from the string.\n\t\t\t// An alternative solution is to explicitly force the conversion to specific type using profile config.\n\t\t\tstrValue = fmt.Sprintf(\"%#x\", val)\n\t\t} else {\n\t\t\tstrValue = string(val)\n\t\t}\n\t\treturn strValue, nil\n\t}\n\treturn \"\", fmt.Errorf(\"invalid type %T for value %#v\", value, value)\n}", "title": "" }, { "docid": "7d6b692bf82f98cf8fc0b8628383ea46", "score": "0.64695966", "text": "func Tstring(v interface{}) string { return fmt.Sprintf(\"%v\", v) }", "title": "" }, { "docid": "ec26e27386b9e694d69d0ba39b339baf", "score": "0.64442456", "text": "func (n ValueDeclr) String() string {\n\treturn n.ValueConverter(n.Value)\n}", "title": "" }, { "docid": "83377cd571d81cc5aa39bd26a8401d21", "score": "0.64392865", "text": "func valueToString(v reflect.Value) (string, error) {\n if !v.IsValid() {\n return \"null\", nil\n }\n\n switch v.Kind() {\n case reflect.Ptr:\n return valueToString(reflect.Indirect(v))\n case reflect.Interface:\n return valueToString(v.Elem())\n case reflect.Bool:\n x := v.Bool()\n if x {\n return \"true\", nil\n } else {\n return \"false\", nil\n }\n\n case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n return strconv.FormatInt(v.Int(), 10), nil\n case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n return strconv.FormatUint(v.Uint(), 10), nil\n case reflect.UnsafePointer:\n return strconv.FormatUint(uint64(v.Pointer()), 10), nil\n\n case reflect.Float32, reflect.Float64:\n return strconv.FormatFloat(v.Float(), 'g', -1, 64), nil\n\n case reflect.String:\n return v.String(), nil\n\n //This is kind of a rough hack to replace the old []byte\n //detection with reflect.Uint8Type, it doesn't catch\n //zero-length byte slices\n case reflect.Slice:\n typ := v.Type()\n if typ.Elem().Kind() == reflect.Uint || typ.Elem().Kind() == reflect.Uint8 || typ.Elem().Kind() == reflect.Uint16 || typ.Elem().Kind() == reflect.Uint32 || typ.Elem().Kind() == reflect.Uint64 || typ.Elem().Kind() == reflect.Uintptr {\n if v.Len() > 0 {\n if v.Index(0).OverflowUint(257) {\n return string(v.Interface().([]byte)), nil\n }\n }\n }\n }\n return \"\", errors.New(\"Unsupported type\")\n}", "title": "" }, { "docid": "2345b58fcb3c12c7dd57a211bb28d5f7", "score": "0.6436762", "text": "func toStringValue(v reflect.Value, field reflect.StructField) (string, error) {\n\tif v.Kind() == reflect.Ptr {\n\t\tif v.IsNil() {\n\t\t\treturn \"\", fmt.Errorf(\"can not marshal a nil pointer\")\n\t\t}\n\t\tv = v.Elem()\n\t}\n\n\tif v.Type() == timeType {\n\t\tt := v.Interface().(SDKTime)\n\t\treturn formatTime(t), nil\n\t}\n\n\tif v.Type() == sdkDateType {\n\t\tt := v.Interface().(SDKDate)\n\t\treturn formatDate(t), nil\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.Bool:\n\t\treturn strconv.FormatBool(v.Bool()), nil\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn strconv.FormatInt(v.Int(), 10), nil\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn strconv.FormatUint(v.Uint(), 10), nil\n\tcase reflect.String:\n\t\treturn v.String(), nil\n\tcase reflect.Float32:\n\t\treturn strconv.FormatFloat(v.Float(), 'f', -1, 32), nil\n\tcase reflect.Float64:\n\t\treturn strconv.FormatFloat(v.Float(), 'f', -1, 64), nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"marshaling structure to a http.Request does not support field named: %s of type: %v\",\n\t\t\tfield.Name, v.Type().String())\n\t}\n}", "title": "" }, { "docid": "5416ca62e6b8d9cdff3e6766bacbf944", "score": "0.64302695", "text": "func ToString(val reflect.Value) string {\n\tif reflect.TypeOf(val).Kind() == reflect.Ptr {\n\t\tval = reflect.Indirect(val)\n\t}\n\n\tvar buffer bytes.Buffer\n\tif reflect.ValueOf(val).Kind() == reflect.Struct {\n\t\tfor i := 0; i < val.Type().NumField(); i++ {\n\t\t\tfieldName := val.Type().Field(i).Name\n\t\t\tfieldType := val.Type().Field(i)\n\t\t\tfieldTag := fieldType.Tag\n\t\t\tfieldValue := val.Field(i)\n\n\t\t\tswitch val.Field(i).Kind() {\n\t\t\tcase reflect.Ptr:\n\t\t\t\tfieldValue = reflect.Indirect(val.Field(i))\n\t\t\tdefault:\n\t\t\t\tfieldValue = val.Field(i)\n\t\t\t}\n\n\t\t\tif fieldTag != \"\" {\n\t\t\t\txmlTag := fieldTag.Get(\"xml\")\n\t\t\t\tif xmlTag != \"\" {\n\t\t\t\t\tfieldName = xmlTag\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif fieldValue.IsValid() {\n\t\t\t\tbuffer.WriteString(fmt.Sprintf(\"%s: %v\\n\", fieldName, fieldValue))\n\t\t\t} else {\n\t\t\t\tbuffer.WriteString(fmt.Sprintf(\"%s: %v\\n\", fieldName, \"nil\"))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn buffer.String()\n}", "title": "" }, { "docid": "5904946f6946534d2337ee4e5d63e659", "score": "0.64238435", "text": "func ToString(v interface{}) (string, error) {\n\tswitch value := reflect.ValueOf(v); v.(type) {\n\tcase string:\n\t\treturn value.String(), nil\n\tcase Bytes: //[]byte\n\t\treturn BytesToString(value.Bytes()), nil\n\tdefault:\n\t\tb, err := json.Marshal(v)\n\t\treturn string(b), err\n\t}\n}", "title": "" }, { "docid": "29e79cdfaa13a691dd63cc6b35117d50", "score": "0.64183074", "text": "func (node Scalar) String() string { return string(node) }", "title": "" }, { "docid": "b6b69ba91113f6f66158a3853c2b1a0d", "score": "0.6413582", "text": "func (n *Node) String() string {\n\treturn fmt.Sprintf(\"value[%d]\", n.Value)\n}", "title": "" }, { "docid": "04d6ca5924d8bfce8ec15fc273c1cc71", "score": "0.64049786", "text": "func (v Value) String() string {\n\tif v.Inner == nil {\n\t\treturn \"\"\n\t}\n\treturn hack.String(v.Inner.raw())\n}", "title": "" }, { "docid": "0ebd2560c7df9f5a4c55153e3df600df", "score": "0.64003545", "text": "func toString(v interface{}) string {\n\tvar key string\n\tif v == nil {\n\t\treturn key\n\t}\n\tswitch v := v.(type) {\n\tcase float64:\n\t\tkey = strconv.FormatFloat(v, 'f', -1, 64)\n\tcase float32:\n\t\tkey = strconv.FormatFloat(float64(v), 'f', -1, 32)\n\tcase int:\n\t\tkey = strconv.Itoa(v)\n\tcase uint:\n\t\tkey = strconv.FormatUint(uint64(v), 10)\n\tcase int8:\n\t\tkey = strconv.Itoa(int(v))\n\tcase uint8:\n\t\tkey = strconv.FormatUint(uint64(v), 10)\n\tcase int16:\n\t\tkey = strconv.Itoa(int(v))\n\tcase uint16:\n\t\tkey = strconv.FormatUint(uint64(v), 10)\n\tcase int32:\n\t\tkey = strconv.Itoa(int(v))\n\tcase uint32:\n\t\tkey = strconv.FormatUint(uint64(v), 10)\n\tcase int64:\n\t\tkey = strconv.FormatInt(v, 10)\n\tcase uint64:\n\t\tkey = strconv.FormatUint(v, 10)\n\tcase string:\n\t\tkey = v\n\tcase bool:\n\t\tkey = strconv.FormatBool(v)\n\tcase []byte:\n\t\tkey = string(v)\n\tcase fmt.Stringer:\n\t\tkey = v.String()\n\tdefault:\n\t\tnewValue, _ := json.Marshal(v)\n\t\tkey = string(newValue)\n\t}\n\treturn key\n}", "title": "" }, { "docid": "74e07d4cfe4c9d4655279d9739a7fe0f", "score": "0.6395818", "text": "func (v BytesVal) String() string { return string(v) }", "title": "" }, { "docid": "cb16b4de2fc66881403e429245e13b05", "score": "0.6392802", "text": "func (c *CellValue) String() (val string) {\n\tif c.StringVal != nil {\n\t\tval = *(c.StringVal)\n\t\treturn\n\t}\n\n\tif c.IntVal != nil {\n\t\tval = strconv.Itoa(*c.IntVal)\n\t\treturn\n\t}\n\n\tif c.FloatVal != nil {\n\t\tval = strconv.FormatFloat(*c.FloatVal, 'f', -1, 64) //-1 will remove unimportant 0s\n\t\treturn\n\t}\n\n\tval = string(c.Value)\n\treturn\n}", "title": "" }, { "docid": "164a86997fd838ee07b0dcb5b0537398", "score": "0.6385084", "text": "func ToString(i interface{}) string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\n\tif s, ok := i.(string); ok {\n\t\treturn s\n\t}\n\n\tif sl, ok := i.([]string); ok {\n\t\tif len(sl) == 1 {\n\t\t\treturn sl[0]\n\t\t}\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "2ba60fa159ec1ae173aef38b516fee9d", "score": "0.6384036", "text": "func String(i interface{}) string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\tswitch i.(type) {\n\tcase int:\n\t\treturn strconv.Itoa(i.(int))\n\tcase int8:\n\t\treturn strconv.FormatInt(int64(i.(int8)), 10)\n\tcase int32:\n\t\treturn strconv.FormatInt(int64(i.(int32)), 10)\n\tcase int64:\n\t\treturn strconv.FormatInt(int64(i.(int64)), 10)\n\tcase uint:\n\t\treturn strconv.FormatUint(uint64(i.(uint)), 10)\n\tcase uint8:\n\t\treturn strconv.FormatUint(uint64(i.(uint8)), 10)\n\tcase uint32:\n\t\treturn strconv.FormatUint(uint64(i.(uint32)), 10)\n\tcase uint64:\n\t\treturn strconv.FormatUint(uint64(i.(uint64)), 10)\n\tcase float32:\n\t\treturn strconv.FormatFloat(float64(i.(float32)), 'f', -1, 32)\n\tcase float64:\n\t\treturn strconv.FormatFloat(i.(float64), 'f', -1, 64)\n\tcase []byte:\n\t\treturn string(i.([]byte))\n\tcase string:\n\t\treturn i.(string)\n\tdefault:\n\t\treturn fmt.Sprintf(\"%v\", i)\n\t}\n}", "title": "" }, { "docid": "15d801cde6769b155452777e5398587e", "score": "0.63837284", "text": "func (i *int32Value) String() string { return fmt.Sprintf(\"%v\", *i) }", "title": "" }, { "docid": "29ba3dcf3f747d3d9fa2203aaae66d02", "score": "0.63799196", "text": "func (v PropertyValue) String() string {\n\tif v.IsComputed() {\n\t\t// For computed properties, show the type followed by an empty object string.\n\t\treturn fmt.Sprintf(\"%v{}\", v.TypeString())\n\t} else if v.IsOutput() {\n\t\tif !v.OutputValue().Known {\n\t\t\treturn MakeComputed(v.OutputValue().Element).String()\n\t\t} else if v.OutputValue().Secret {\n\t\t\treturn MakeSecret(v.OutputValue().Element).String()\n\t\t}\n\t\treturn v.OutputValue().Element.String()\n\t}\n\t// For all others, just display the underlying property value.\n\treturn fmt.Sprintf(\"{%v}\", v.V)\n}", "title": "" }, { "docid": "97b82fed5b7c827e2a70e5df429b2678", "score": "0.6379262", "text": "func (l *Label) ToStr() string {\n\treturn l.Key + \"=\" + l.Value\n}", "title": "" }, { "docid": "004329113113938f8d3463509ce6e8b3", "score": "0.6378346", "text": "func (v *Value) String() *String {\n\tdata, ok := v.value.(string)\n\tif !ok {\n\t\tv.chain.fail(\"\\nexpected string value, but got:\\n%s\",\n\t\t\tdumpValue(v.value))\n\t}\n\treturn &String{v.chain, data}\n}", "title": "" }, { "docid": "170db8122f3e018195d655ca8082c6d9", "score": "0.6365304", "text": "func (n *N) String() string {\n\treturn fmt.Sprintf(\"%d\", n.value)\n}", "title": "" }, { "docid": "1e79dd78abc6f9b51062b9157e8803d2", "score": "0.6346997", "text": "func (v EncryptValue) String() string {\n\treturn fmt.Sprintf(\"%d\", v.encryptKeyID)\n}", "title": "" }, { "docid": "50a7c4673fe24e6ed9d2be8bd0050359", "score": "0.63459116", "text": "func String(obj interface{}) string {\n\tswitch val := obj.(type) {\n\tcase []byte:\n\t\treturn string(val)\n\tcase string:\n\t\treturn val\n\t}\n\tv := reflect.ValueOf(obj)\n\tswitch v.Kind() {\n\tcase reflect.Invalid:\n\t\treturn \"\"\n\tcase reflect.Bool:\n\t\treturn strconv.FormatBool(v.Bool())\n\tcase reflect.String:\n\t\treturn v.String()\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn strconv.FormatInt(v.Int(), 10)\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn strconv.FormatUint(v.Uint(), 10)\n\tcase reflect.Float64:\n\t\treturn strconv.FormatFloat(v.Float(), 'f', -1, 64)\n\tcase reflect.Float32:\n\t\treturn strconv.FormatFloat(v.Float(), 'f', -1, 32)\n\tcase reflect.Ptr, reflect.Struct, reflect.Map:\n\t\tb, err := json.Marshal(v.Interface())\n\t\tif err != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\treturn string(b)\n\t}\n\treturn fmt.Sprintf(\"%v\", obj)\n}", "title": "" }, { "docid": "04d741d586e6ed3fc29f742d2dd82884", "score": "0.63429964", "text": "func (v *Value) String() string {\n\treturn fmt.Sprintf(\"(TxID:%s),(Config:%s),(Format:%s),(Tags:%s)\", v.TxID, v.Config, v.Format, v.Tags)\n}", "title": "" }, { "docid": "b09bb02fa6b66b5f6243cec8bb4df652", "score": "0.6336105", "text": "func (n Number) String() string { return string(n) }", "title": "" }, { "docid": "b09bb02fa6b66b5f6243cec8bb4df652", "score": "0.6336105", "text": "func (n Number) String() string { return string(n) }", "title": "" }, { "docid": "945c3b03ea726a3047db949f04ee1f9e", "score": "0.6334336", "text": "func (c *Coercable) AsString() string {\n\tvalue, ok := maybeStringToString(c.rawValue)\n\n\tif !ok {\n\t\tc.storeError(\"string\", \"string\")\n\t\tvalue, _ = c.defaultValue.(string)\n\t}\n\treturn value\n}", "title": "" }, { "docid": "7f97e5e985c7de2ec74282845925c19f", "score": "0.6326241", "text": "func ToStringE(i any) (string, error) {\n\tswitch s := i.(type) {\n\tcase string:\n\t\treturn s, nil\n\tcase bool:\n\t\treturn strconv.FormatBool(s), nil\n\tcase float64:\n\t\treturn strconv.FormatFloat(i.(float64), 'f', -1, 64), nil\n\tcase int64:\n\t\treturn strconv.FormatInt(i.(int64), 10), nil\n\tcase int:\n\t\treturn strconv.FormatInt(int64(i.(int)), 10), nil\n\tcase []byte:\n\t\treturn string(s), nil\n\tcase nil:\n\t\treturn \"null\", nil\n\tcase error:\n\t\treturn s.Error(), nil\n\tdefault:\n\t\treturn \"\", errors.New(\"Unable to Cast to string\")\n\t}\n}", "title": "" }, { "docid": "b8dd1dc16a6c2b4ae810a930b2fafefb", "score": "0.6323688", "text": "func (h *Value) String() string {\n\tif h.stringRep != nil {\n\t\treturn *h.stringRep\n\t} else if h.numRep != nil {\n\t\tstr := h.numRep.String()\n\t\th.stringRep = &str\n\t\treturn str\n\t} else if h.arrayRep != nil {\n\t\tvar buffer bytes.Buffer\n\t\tfor i, v := range h.arrayRep {\n\t\t\tif i != 0 {\n\t\t\t\tbuffer.WriteRune('\\n')\n\t\t\t}\n\t\t\tbuffer.WriteString(v.String())\n\t\t}\n\t\tstr := buffer.String()\n\t\th.stringRep = &str\n\t\treturn str\n\t}\n\tpanic(\"no way to generate a string representation\")\n\treturn \"\"\n}", "title": "" }, { "docid": "1f4da06136811912748fbb93bf60473d", "score": "0.6308675", "text": "func (a *Acheteur) ToString() string {\n\tret, _ := a.Marshal()\n\treturn string(ret)\n}", "title": "" }, { "docid": "39823b0b7c669856832ef126fd79974a", "score": "0.6308155", "text": "func (floatValue *Float32Value) ToString() string {\n\treturn strconv.FormatFloat(float64(floatValue.Value), 'f', 3, 64)\n}", "title": "" }, { "docid": "092fe732d10da6a9769f066975dab71d", "score": "0.6306926", "text": "func (r Record) String() (s string) {\n\tswitch v := r.v.(type) {\n\tcase string:\n\t\ts = v\n\n\tcase int64:\n\t\ts = strconv.FormatInt(v, 10)\n\n\tcase float64:\n\t\ts = strconv.FormatFloat(v, 'f', -1, 64)\n\t}\n\treturn\n}", "title": "" }, { "docid": "f0c6dadcf7a991b593968e2453d37db4", "score": "0.6298729", "text": "func (a *Struct) ValueStr(i int) string {\n\tif a.IsNull(i) {\n\t\treturn NullValueStr\n\t}\n\n\tdata, err := json.Marshal(a.GetOneForMarshal(i))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn string(data)\n}", "title": "" }, { "docid": "4869b962c5dd628863a5ca4324f86e95", "score": "0.6287454", "text": "func Stringify(o Object) string {\n\tswitch t := o.(type) {\n\tcase Integer:\n\t\treturn strconv.Itoa(t.Value)\n\tcase Float:\n\t\t//if the value is almost equal to a whole number, then only print .0 at the end and nothing crazy\n\t\tif t.Value-float64(int(t.Value)) < .0000000001 {\n\t\t\treturn fmt.Sprintf(\"%.0f.0\", t.Value)\n\t\t}\n\t\treturn fmt.Sprint(t.Value)\n\tcase Boolean:\n\t\tif t.Value {\n\t\t\treturn \"TRUE\"\n\t\t}\n\t\treturn \"FALSE\"\n\tcase String:\n\t\treturn t.Value\n\tdefault:\n\t\treturn \"(nil)\"\n\t}\n}", "title": "" }, { "docid": "d9e2285730c7767263f13c5478dd0079", "score": "0.6281906", "text": "func (sv *StringValue) String() string { return sv.Value }", "title": "" }, { "docid": "b97f52fdeaa322585e79974ce21cd866", "score": "0.6280645", "text": "func (user User) ToString() string {\n\treturn string(user.ToBytes())\n}", "title": "" }, { "docid": "9b4b43141fd65540fd11c3b541b7fd8f", "score": "0.6276268", "text": "func (v *value) String() string {\n\tdflt, ok := defaultValue(v.c)\n\tif !ok {\n\t\treturn \"[configurable]\"\n\t}\n\n\treturn fmt.Sprintf(\"%#v\", dflt)\n}", "title": "" }, { "docid": "106b9797f18c03af989e1be4ef0c30dd", "score": "0.62613726", "text": "func (n *Node) String() string {\n\treturn fmt.Sprint(n.Value)\n}", "title": "" }, { "docid": "48207a92112c3f6cab5eb28495141c91", "score": "0.6257223", "text": "func (cv *CommandValue) ValueToString(encoding ...string) (str string) {\n\tif cv.Type == contracts.ValueTypeString {\n\t\tstr = cv.stringValue\n\t\treturn\n\t}\n\n\treader := bytes.NewReader(cv.NumericValue)\n\n\tswitch cv.Type {\n\tcase contracts.ValueTypeBool:\n\t\tvar res bool\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t}\n\t\tstr = strconv.FormatBool(res)\n\tcase contracts.ValueTypeUint8:\n\t\tvar res uint8\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t}\n\t\tstr = strconv.FormatUint(uint64(res), 10)\n\tcase contracts.ValueTypeUint16:\n\t\tvar res uint16\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t}\n\t\tstr = strconv.FormatUint(uint64(res), 10)\n\tcase contracts.ValueTypeUint32:\n\t\tvar res uint32\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t}\n\t\tstr = strconv.FormatUint(uint64(res), 10)\n\tcase contracts.ValueTypeUint64:\n\t\tvar res uint64\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t}\n\t\tstr = strconv.FormatUint(res, 10)\n\tcase contracts.ValueTypeInt8:\n\t\tvar res int8\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t}\n\t\tstr = strconv.FormatInt(int64(res), 10)\n\tcase contracts.ValueTypeInt16:\n\t\tvar res int16\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t}\n\t\tstr = strconv.FormatInt(int64(res), 10)\n\tcase contracts.ValueTypeInt32:\n\t\tvar res int32\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t}\n\t\tstr = strconv.FormatInt(int64(res), 10)\n\tcase contracts.ValueTypeInt64:\n\t\tvar res int64\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t}\n\t\tstr = strconv.FormatInt(res, 10)\n\tcase contracts.ValueTypeFloat32:\n\t\t// just format\n\t\tvar res float32\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t\treturn\n\t\t}\n\t\tstr = strconv.FormatFloat(float64(res), 'g', -1, 32)\n\t\t/*\n\t\t\tfloatEncoding := getFloatEncoding(encoding)\n\n\t\t\tif floatEncoding == models.ENotation {\n\t\t\t\tvar res float32\n\t\t\t\tbinary.Read(reader, binary.BigEndian, &res)\n\t\t\t\tstr = fmt.Sprintf(\"%e\", res)\n\t\t\t} else if floatEncoding == models.Base64Encoding {\n\t\t\t\tstr = base64.StdEncoding.EncodeToString(cv.NumericValue)\n\t\t\t}\n\t\t*/\n\tcase contracts.ValueTypeFloat64:\n\t\t// just format\n\t\tvar res float64\n\t\terr := binary.Read(reader, binary.BigEndian, &res)\n\t\tif err != nil {\n\t\t\tstr = err.Error()\n\t\t\treturn\n\t\t}\n\t\tstr = strconv.FormatFloat(res, 'g', -1, 64)\n\t\t/*\n\t\t\tfloatEncoding := getFloatEncoding(encoding)\n\n\t\t\tif floatEncoding == models.ENotation {\n\t\t\t\tvar res float64\n\t\t\t\tbinary.Read(reader, binary.BigEndian, &res)\n\t\t\t\tstr = fmt.Sprintf(\"%e\", res)\n\t\t\t} else if floatEncoding == models.Base64Encoding {\n\t\t\t\tstr = base64.StdEncoding.EncodeToString(cv.NumericValue)\n\t\t\t}\n\t\t*/\n\tcase contracts.ValueTypeBinary:\n\t\t// produce string representation of first 20 bytes of binary value\n\t\tstr = fmt.Sprintf(fmt.Sprintf(\"Binary: [%v...]\", string(cv.BinValue[:20])))\n\tdefault:\n\t\t// ArrayType\n\t\tstr = cv.stringValue\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "cdf7a8fc56494d41110ef09eb487072b", "score": "0.6254365", "text": "func (a ValueDescriptor) String() string {\n\tout, err := json.Marshal(a)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\treturn string(out)\n}", "title": "" } ]
b37de16b366a312a2a1cd469d2b9d1e0
GetHwMacAddress retrieves the value of the leaf HwMacAddress from the OpenconfigInterfaces_Interfaces_Interface_Ethernet_State struct. Caution should be exercised whilst using this method since it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if HwMacAddress is set, it can safely use t.GetHwMacAddress() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.HwMacAddress == nil' before retrieving the leaf's value.
[ { "docid": "347d7a331b4f5701e9bde60be3951bc2", "score": "0.84487367", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet_State) GetHwMacAddress() string {\n\tif t == nil || t.HwMacAddress == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.HwMacAddress\n}", "title": "" } ]
[ { "docid": "98e43687a855622987a103f33f3a0564", "score": "0.80380505", "text": "func (t *Interface_Ethernet) GetHwMacAddress() string {\n\tif t == nil || t.HwMacAddress == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.HwMacAddress\n}", "title": "" }, { "docid": "5d07705c0650bbcccc284f51ac49f8ef", "score": "0.62938154", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet_State) GetMacAddress() string {\n\tif t == nil || t.MacAddress == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.MacAddress\n}", "title": "" }, { "docid": "a1259b353cce7dd380e90ca1c1cfa11f", "score": "0.61000705", "text": "func (m *ManagedDevice) GetWiFiMacAddress()(*string) {\n val, err := m.GetBackingStore().Get(\"wiFiMacAddress\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "b97df445b7297291c87f0d327081832c", "score": "0.6035586", "text": "func (t *Interface_Ethernet) GetMacAddress() string {\n\tif t == nil || t.MacAddress == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.MacAddress\n}", "title": "" }, { "docid": "614d8fda34050bc844f45ee56b48caf4", "score": "0.5734362", "text": "func getMacAddress() (net.HardwareAddr, error) {\n\tdevice := routedInterface(\"ip\", net.FlagUp|net.FlagBroadcast)\n\tif device == nil {\n\t\treturn nil, fmt.Errorf(\"can not determine the network interface\")\n\t}\n\n\treturn device.HardwareAddr, nil\n}", "title": "" }, { "docid": "a7717b0f19866cf56814dee0bab4d9a2", "score": "0.560787", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config) GetMacAddress() string {\n\tif t == nil || t.MacAddress == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.MacAddress\n}", "title": "" }, { "docid": "49c3663a92b299229e6348c3289619c8", "score": "0.5585223", "text": "func (m *NetworkInfo) GetMacAddress()(*string) {\n val, err := m.GetBackingStore().Get(\"macAddress\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "bbdbeaf1baae8d8e07eb4bba11987590", "score": "0.53643286", "text": "func GetMAC(addr net.Addr) net.HardwareAddr {\n\tifaces, err := net.Interfaces()\n\tip := GetIP(addr)\n\tif err != nil {\n\t\tpanic(\"Cannot access interfaces\")\n\t}\n\tfor _, iface := range ifaces {\n\t\taddrs, err := iface.Addrs()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfor _, addr := range addrs {\n\t\t\tif strings.Index(addr.String(), ip.String()) >= 0 {\n\t\t\t\treturn iface.HardwareAddr\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d2bfc1381aaf1c136276fda4fa5e1509", "score": "0.53455454", "text": "func (o *ManagementInterfaceAllOf) GetMacAddress() string {\n\tif o == nil || o.MacAddress == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.MacAddress\n}", "title": "" }, { "docid": "331e205dc73cbb3b417a312191590682", "score": "0.5249572", "text": "func GetVethMac(vethName string) (string, error) {\n\tlink, err := GetLinkByName(vethName)\n\tif err != nil {\n\t\tklog.Errorf(\"netlink.LinkByName(vethName) error: %v\", err)\n\t\treturn \"\", err\n\t}\n\treturn link.Attrs().HardwareAddr.String(), nil\n}", "title": "" }, { "docid": "29cf11ab0ecc098d0415355e2136e577", "score": "0.52487946", "text": "func (o *VirtualizationIweHostAllOf) GetHwPowerState() string {\n\tif o == nil || o.HwPowerState == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.HwPowerState\n}", "title": "" }, { "docid": "ce53848cd12f909e42a0636293531a1b", "score": "0.5227755", "text": "func GetMAC() (string, error) {\n\t// retrieve interface from name\n\tiface, err := net.InterfaceByName(ifname)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn iface.HardwareAddr.String(), nil\n}", "title": "" }, { "docid": "de9c1ef7054d8734e4271d15a897abd3", "score": "0.509247", "text": "func (m *TeamworkDeviceConfiguration) GetHardwareConfiguration()(TeamworkHardwareConfigurationable) {\n val, err := m.GetBackingStore().Get(\"hardwareConfiguration\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(TeamworkHardwareConfigurationable)\n }\n return nil\n}", "title": "" }, { "docid": "6bc8181f2803a6d65589e9a50d5b097f", "score": "0.506923", "text": "func (o *VnicEthIfInventory) GetMacAddress() string {\n\tif o == nil || o.MacAddress == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.MacAddress\n}", "title": "" }, { "docid": "9fcf062f1cb58383ee31adb9ea9758d6", "score": "0.50515735", "text": "func GetIntfMac(intfName string) (net.HardwareAddr, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "d8b18b3337bda48c1ae93481aa1db29b", "score": "0.50396", "text": "func (tree *HashTree) GetHash() hashtrees.Hash {\n\treturn tree.H\n}", "title": "" }, { "docid": "9e8b2cbc8cb713806ac87aaa81506f3e", "score": "0.5015811", "text": "func GetMACAddress(ctx context.Context,\n\ttimeout time.Duration,\n\tdev string,\n\tnetlinkClient netlinkwrapper.NetLink) (string, error) {\n\tretriever := &macAddressRetriever{\n\t\tdev: dev,\n\t\tnetlinkClient: netlinkClient,\n\t\tctx: ctx,\n\t\ttimeout: timeout,\n\t}\n\treturn retriever.retrieve()\n}", "title": "" }, { "docid": "c18c1a795ad98ab542dc9974b04374d8", "score": "0.5008097", "text": "func GetMACAddr() (addr string) {\n\tinterfaces, err := net.Interfaces()\n\tif err == nil {\n\t\tfor _, i := range interfaces {\n\t\t\tif i.Flags&net.FlagUp != 0 && bytes.Compare(i.HardwareAddr, nil) != 0 {\n\t\t\t\t// Don't use random as we have a real address\n\t\t\t\taddr = i.HardwareAddr.String()\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "790ba5eb7949c8e036d88278ab25ad5a", "score": "0.4983905", "text": "func GetMacAddr() (addr string) {\n\tr := strings.NewReplacer(\":\", \"\")\n\n\tinterfaces, err := net.Interfaces()\n\tif err == nil {\n\t\tfor _, i := range interfaces {\n\t\t\tlog.Printf(\"读取窗口信息%v %s %s\", i.Flags, i.Name, r.Replace(i.HardwareAddr.String()))\n\n\t\t\tif i.Flags&net.FlagUp != 0 && bytes.Compare(i.HardwareAddr, nil) != 0 {\n\t\t\t\t// Don't use random as we have a real address\n\t\t\t\taddr = i.HardwareAddr.String()\n\n\t\t\t\taddr = r.Replace(addr)\n\t\t\t\t//break\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "19639f41c453eedd334cd35da633476d", "score": "0.49729097", "text": "func (g *Gen) getHardwareAddr() ([]byte, error) {\n\tvar err error\n\tg.hardwareAddrOnce.Do(func() {\n\t\tvar hwAddr net.HardwareAddr\n\t\tif hwAddr, err = g.hwAddrFunc(); err == nil {\n\t\t\tcopy(g.hardwareAddr[:], hwAddr)\n\t\t\treturn\n\t\t}\n\n\t\t// Initialize hardwareAddr randomly in case\n\t\t// of real network interfaces absence.\n\t\tif _, err = io.ReadFull(g.rand, g.hardwareAddr[:]); err != nil {\n\t\t\treturn\n\t\t}\n\t\t// Set multicast bit as recommended by RFC-4122\n\t\tg.hardwareAddr[0] |= 0x01\n\t})\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\treturn g.hardwareAddr[:], nil\n}", "title": "" }, { "docid": "a2e375a2e6d6718c54e051fc7539cb09", "score": "0.49381492", "text": "func (l *libnet) GetMac() (lua.String, error) {\n\tifas, err := net.Interfaces()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfor _, ifa := range ifas {\n\t\tif addr := ifa.HardwareAddr.String(); addr != \"\" {\n\t\t\treturn lua.String(addr), nil\n\t\t}\n\t}\n\treturn \"\", errors.New(\"no valid mac address found\")\n}", "title": "" }, { "docid": "35aeaa6d8132b5d01b4af2ec1719f709", "score": "0.4933103", "text": "func (t *Interface_RoutedVlan_Ipv6) GetAddress(Ip string) *Interface_RoutedVlan_Ipv6_Address {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Ip\n\n\tif lm, ok := t.Address[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5ca116826558c9c333b6593fc426894c", "score": "0.49318492", "text": "func (priv *PrivateKey) GetWIFAddress() string {\n\tvar privateKeyPrefix byte\n\tif priv.isTestnet {\n\t\tprivateKeyPrefix = 0xEF\n\t} else {\n\t\tprivateKeyPrefix = 0x80\n\t}\n\n\treturn base58check.Encode(privateKeyPrefix, priv.key.Serialize())\n}", "title": "" }, { "docid": "52718f845a2a875d0e7c693592fa918f", "score": "0.4921469", "text": "func (t *OpenconfigSystem_System_Dns_HostEntries_HostEntry_State) GetIpv6Address() []string {\n\tif t == nil || t.Ipv6Address == nil {\n\t\treturn nil\n\t}\n\treturn t.Ipv6Address\n}", "title": "" }, { "docid": "8c2ea7670eed9b2d914a5c623382a2ce", "score": "0.4917655", "text": "func (a *ETHAddress) GetHex() string {\n\treturn a.address.Hex()\n}", "title": "" }, { "docid": "b1ec5909c29a7fd0c7442464878eec4e", "score": "0.49027768", "text": "func GetIntfMacAddress(intfName string) (string, error) {\n\tintfs, _ := net.Interfaces()\n\tfor _, intf := range intfs {\n\t\tif intf.Name == intfName {\n\t\t\t/* Mac address matched */\n\t\t\treturn intf.HardwareAddr.String(), nil\n\t\t}\n\t}\n\treturn \"\", errors.New(\"Interface not found\")\n}", "title": "" }, { "docid": "17c4c7863483a0b6b70f6c6f53d977c4", "score": "0.49023125", "text": "func (_Router *RouterSession) WETH() (common.Address, error) {\n\treturn _Router.Contract.WETH(&_Router.CallOpts)\n}", "title": "" }, { "docid": "15a740e683c17f706b2891f21ce3e8fd", "score": "0.48371956", "text": "func (p MagicPacket) HardwareAddr() net.HardwareAddr {\n\treturn net.HardwareAddr(p[bcastAddrOff : bcastAddrOff*2])\n}", "title": "" }, { "docid": "343496643a9ab0ba79296bd18e244cbc", "score": "0.4833028", "text": "func (endpoint *VethEndpoint) HardwareAddr() string {\n\treturn endpoint.NetPair.TAPIface.HardAddr\n}", "title": "" }, { "docid": "d388b4a38a384cb8ee6f6eca934a469f", "score": "0.48036334", "text": "func (epi *EndpointInterface) MacAddress() net.HardwareAddr {\n\treturn types.GetMacCopy(epi.mac)\n}", "title": "" }, { "docid": "40b701ea16aec70ce58f1d8e1d1bc6d5", "score": "0.48013994", "text": "func GetRouterMAC() (net.HardwareAddr, error) {\n\t// get the default gateway address from routes\n\tgatewayAddr := \"\"\n\tfRoute, err := os.Open(\"/proc/net/route\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer fRoute.Close()\n\n\ts := bufio.NewScanner(fRoute)\n\ts.Scan()\n\n\tfor s.Scan() {\n\t\tline := s.Text()\n\t\tfields := strings.Fields(line)\n\t\tif fields[1] == \"00000000\" {\n\t\t\tdecode, err := hex.DecodeString(fields[2])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tgatewayAddr = fmt.Sprintf(\"%v.%v.%v.%v\", decode[3], decode[2], decode[1], decode[0])\n\t\t}\n\t}\n\n\tif gatewayAddr == \"\" {\n\t\treturn nil, errors.New(\"no gateway found in routes\")\n\t}\n\n\t// look through arp tables for match to gateway address\n\tfArp, err := os.Open(\"/proc/net/arp\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer fArp.Close()\n\n\ts = bufio.NewScanner(fArp)\n\ts.Scan()\n\n\tfor s.Scan() {\n\t\tline := s.Text()\n\t\tfields := strings.Fields(line)\n\t\tif fields[0] == gatewayAddr {\n\t\t\treturn net.ParseMAC(fields[3])\n\t\t}\n\t}\n\n\treturn nil, errors.New(\"no gateway found\")\n}", "title": "" }, { "docid": "8b28f80cd2d723fe03cf5d80bed35a4f", "score": "0.4786864", "text": "func (js *JoinServer) GetHomeNetwork(ctx context.Context, joinEUI, devEUI types.EUI64, authorizer Authorizer) (*EndDeviceHomeNetwork, error) {\n\tif err := authorizer.RequireAuthorized(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdev, err := js.devices.GetByEUI(ctx, joinEUI, devEUI,\n\t\t[]string{\n\t\t\t\"net_id\",\n\t\t\t\"network_server_address\",\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, errRegistryOperation.WithCause(err)\n\t}\n\tctx = dev.Context\n\tif entityAuth, ok := authorizer.(EntityAuthorizer); ok {\n\t\tif err := entityAuth.RequireEntityContext(ctx); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tnetID := dev.NetId\n\n\tif netID == nil {\n\t\tsets, err := js.applicationActivationSettings.GetByID(ctx, dev.Ids.ApplicationIds, []string{\n\t\t\t\"home_net_id\",\n\t\t})\n\t\tif err != nil {\n\t\t\tif !errors.IsNotFound(err) {\n\t\t\t\treturn nil, errGetApplicationActivationSettings.WithCause(err)\n\t\t\t}\n\t\t\treturn nil, nil\n\t\t}\n\t\tnetID = sets.HomeNetId\n\t}\n\t// TODO: Return NSID (https://github.com/TheThingsNetwork/lorawan-stack/issues/4741).\n\treturn &EndDeviceHomeNetwork{\n\t\tNetID: types.MustNetID(netID),\n\t\tNetworkServerAddress: dev.NetworkServerAddress,\n\t}, nil\n}", "title": "" }, { "docid": "1f841d6c0aad984b341714bacdc858d4", "score": "0.4761928", "text": "func (_Router *RouterCallerSession) WETH() (common.Address, error) {\n\treturn _Router.Contract.WETH(&_Router.CallOpts)\n}", "title": "" }, { "docid": "61af690279b525a5d39fa42cc1512438", "score": "0.47515187", "text": "func WmaticAddressHash() common.Hash {\n\tif wmaticAddressHash == (common.Hash{}) {\n\t\twmaticAddressHash = WmaticAddress().Hash()\n\t}\n\n\treturn wmaticAddressHash\n}", "title": "" }, { "docid": "cb372b11296edaefd41084ab6c9d699a", "score": "0.47389448", "text": "func (rd *RouterDHCP) macToIP(hwaddr net.HardwareAddr) (net.IP, error) {\n\t//TODO(tcfw) link to hyper/vpc service\n\tIP, err := cidr.Host(rd.subnet, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn IP, nil\n}", "title": "" }, { "docid": "7b2a675939e2cc1acfdead6ee21a6717", "score": "0.47330403", "text": "func (t *Interface_Subinterface_Ipv6) GetAddress(Ip string) *Interface_Subinterface_Ipv6_Address {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Ip\n\n\tif lm, ok := t.Address[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e66d87b23563d2f18dfd251b8462947d", "score": "0.47284874", "text": "func (m *WindowsInformationProtectionWipeAction) GetTargetedDeviceMacAddress()(*string) {\n val, err := m.GetBackingStore().Get(\"targetedDeviceMacAddress\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "8640871abc844f0bb34f5b8c12a05228", "score": "0.47251698", "text": "func (o *DeviceInterfaceDataData) GetInterfaceMac() string {\n\tif o == nil || o.InterfaceMac == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.InterfaceMac\n}", "title": "" }, { "docid": "e7e2401d2a30bc273207057c5013c563", "score": "0.4724132", "text": "func getMacAddr() (addr string) {\n\tinterfaces, err := net.Interfaces()\n\tif err == nil {\n\t\tfor _, i := range interfaces {\n\t\t\tif i.Flags&net.FlagUp != 0 && bytes.Compare(i.HardwareAddr, nil) != 0 {\n\t\t\t\t// Don't use random as we have a real address\n\t\t\t\taddr = i.HardwareAddr.String()\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "2330dd12e75e4edfd86282f027d1d302", "score": "0.4722324", "text": "func (w *SCWallet) GetAddressHash(address fct.IAddress) (fct.IAddress, error) {\n\t_, adr, err := w.getWalletEntry([]byte(fct.W_RCD_ADDRESS_HASH), address)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn fct.CreateAddress(adr), nil\n}", "title": "" }, { "docid": "17ca6bdc98fa6d0a1b4f00c657305930", "score": "0.4717311", "text": "func (cli *Client) GetMacAddressTable(intf string) (*MacAddressTable, error) {\n\tvar req []*JSONRPCRequest\n\turl := fmt.Sprintf(\"%s://%s:%d/ins\", cli.protocol, cli.host, cli.port)\n\tif intf != \"\" {\n\t\treq = NewJSONRPCRequest([]string{\"show mac address-table interface \" + intf})\n\t} else {\n\t\treq = NewJSONRPCRequest([]string{\"show mac address-table\"})\n\t}\n\tpayload, err := json.Marshal(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := cli.callAPI(\"jsonrpc\", url, payload)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewMacAddressTableFromBytes(resp)\n}", "title": "" }, { "docid": "042132370e747123070d48eed4e244d0", "score": "0.46976173", "text": "func (t *Interface) GetEthernet() *Interface_Ethernet {\n\tif t != nil && t.Ethernet != nil {\n\t\treturn t.Ethernet\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7268025baa285d0cce3a844ab169e009", "score": "0.4696567", "text": "func (u Memo) GetHash() (result Hash, ok bool) {\n\tarmName, _ := u.ArmForSwitch(int32(u.Type))\n\n\tif armName == \"Hash\" {\n\t\tresult = *u.Hash\n\t\tok = true\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "7268025baa285d0cce3a844ab169e009", "score": "0.4696567", "text": "func (u Memo) GetHash() (result Hash, ok bool) {\n\tarmName, _ := u.ArmForSwitch(int32(u.Type))\n\n\tif armName == \"Hash\" {\n\t\tresult = *u.Hash\n\t\tok = true\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "7268025baa285d0cce3a844ab169e009", "score": "0.4696567", "text": "func (u Memo) GetHash() (result Hash, ok bool) {\n\tarmName, _ := u.ArmForSwitch(int32(u.Type))\n\n\tif armName == \"Hash\" {\n\t\tresult = *u.Hash\n\t\tok = true\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "db5087025cb051978c59222281397e93", "score": "0.4682324", "text": "func (o *ListInterfacesParams) SetEthMacAddress(ethMacAddress *string) {\n\to.EthMacAddress = ethMacAddress\n}", "title": "" }, { "docid": "c6e1bdcddeb83bec36f75a1ec58eedf0", "score": "0.46632105", "text": "func (kc Keychain) GetEth(addr common.Address) (keychain.Signer, bool) {\n\tif i, ok := kc.ethAddrToKeyIndex[addr]; ok {\n\t\treturn kc.Keys[i], true\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "27e3625f67ecd84af3932d7a16250761", "score": "0.46588627", "text": "func (_Router02 *Router02Session) WETH() (common.Address, error) {\n\treturn _Router02.Contract.WETH(&_Router02.CallOpts)\n}", "title": "" }, { "docid": "d88b06b13724fe7b6badffd93840aaf0", "score": "0.4658291", "text": "func GetEthTxFrom(hash string) (string, error) {\n\ttx, err := getEthTx(hash)\n\tif err != nil || tx == nil {\n\t\treturn \"\", err\n\t}\n\tcheckSumAddress := common.HexToAddress(tx.From)\n\treturn checkSumAddress.Hex(), nil\n}", "title": "" }, { "docid": "2af152513b170d45bc57c85c7756cb30", "score": "0.4649693", "text": "func GetMac() (mac string, err error) {\n\tmacs, err := GetMacArray()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(macs) > 0 {\n\t\treturn macs[0], nil\n\t}\n\treturn \"\", nil\n}", "title": "" }, { "docid": "9f87c6a8a5e30323d524c9982c11ea98", "score": "0.46127304", "text": "func (u ContractExecutable) GetWasmHash() (result Hash, ok bool) {\n\tarmName, _ := u.ArmForSwitch(int32(u.Type))\n\n\tif armName == \"WasmHash\" {\n\t\tresult = *u.WasmHash\n\t\tok = true\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "14f88c74fa1cf2a7f50ca0c039f393f2", "score": "0.46040902", "text": "func (o *IpamAddress6EditInput) GetAddress6MacAddr() string {\n\tif o == nil || o.Address6MacAddr == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Address6MacAddr\n}", "title": "" }, { "docid": "68aace9f605117ea5a1c2ff94860858f", "score": "0.4592105", "text": "func GetIPAndMAC() (string, string, error) {\n\tlog.Println(infoLog, \"Getting source MAC address and IP address\")\n\tvar currentIP, currentNetworkHardwareName string\n\tcurrentNetworkHardwareName = \"wlan0\"\n\tnetInterface, err := net.InterfaceByName(currentNetworkHardwareName)\n\tif err != nil {\n\t\treturn \"nil\", \"nil\", err\n\t}\n\tmacAddress := netInterface.HardwareAddr\n\taddresses, err := netInterface.Addrs()\n\tcurrentIP = addresses[0].String()\n\tipAddr := currentIP[:strings.IndexByte(currentIP, '/')]\n\thwAddr, err := net.ParseMAC(macAddress.String())\n\n\tif err != nil {\n\t\tlog.Println(errorLog, \"Not able to parse MAC address :\", err)\n\t\treturn \"nil\", \"nil\", err\n\t}\n\treturn ipAddr, hwAddr.String(), nil\n}", "title": "" }, { "docid": "4d59d8df3bca9f0ca12401b118b0311c", "score": "0.45771998", "text": "func (ea EthAddress) GetAddress() string {\n\treturn ea.address\n}", "title": "" }, { "docid": "76ad98ef7f7749f2290126c2bbdf4324", "score": "0.45767605", "text": "func (_Router *RouterCaller) WETH(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _Router.contract.Call(opts, &out, \"WETH\")\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "54d4dfebc8fb414779a5dcd5c436819e", "score": "0.4552821", "text": "func (_DataLedgerContract *DataLedgerContractCallerSession) GetIoTAddress(hash [32]byte) (common.Address, error) {\n\treturn _DataLedgerContract.Contract.GetIoTAddress(&_DataLedgerContract.CallOpts, hash)\n}", "title": "" }, { "docid": "3d4521159bcb2176982ed72a67237698", "score": "0.4551916", "text": "func (_Bridge *BridgeSession) WETH() (common.Address, error) {\n\treturn _Bridge.Contract.WETH(&_Bridge.CallOpts)\n}", "title": "" }, { "docid": "08e9bd2cd016b0e2c49762e9cfe4f2bd", "score": "0.45482296", "text": "func getMacAddr() (addr string) {\n\tinterfaces, err := net.Interfaces()\n\tif err == nil {\n\t\tfor _, i := range interfaces {\n\t\t\tif i.Flags&net.FlagUp != 0 && bytes.Compare(i.HardwareAddr, nil) != 0 {\n\t\t\t\t// Don't use random as we have a real address\n\t\t\t\taddr = i.HardwareAddr.String()\n\t\t\t\tprintln(addr)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t}\n\treturn\n}", "title": "" }, { "docid": "83987bbefc636d2901fc93b492330ec5", "score": "0.45336774", "text": "func (o *ManagementInterfaceAllOf) GetMacAddressOk() (*string, bool) {\n\tif o == nil || o.MacAddress == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MacAddress, true\n}", "title": "" }, { "docid": "3ead07507571fa249ff47d651feaf26c", "score": "0.4517089", "text": "func (_Router02 *Router02CallerSession) WETH() (common.Address, error) {\n\treturn _Router02.Contract.WETH(&_Router02.CallOpts)\n}", "title": "" }, { "docid": "8d744229f98f66cdec05f2d541d0a904", "score": "0.45161253", "text": "func (_DataLedgerContract *DataLedgerContractSession) GetIoTAddress(hash [32]byte) (common.Address, error) {\n\treturn _DataLedgerContract.Contract.GetIoTAddress(&_DataLedgerContract.CallOpts, hash)\n}", "title": "" }, { "docid": "cf9b8e5ed6861c04d62144349f73b100", "score": "0.45126525", "text": "func (o *IncomeVerificationPrecheckUser) GetHomeAddress() SignalAddressData {\n\tif o == nil || o.HomeAddress.Get() == nil {\n\t\tvar ret SignalAddressData\n\t\treturn ret\n\t}\n\treturn *o.HomeAddress.Get()\n}", "title": "" }, { "docid": "0c3cb941da94660499d91e5af86d0ff7", "score": "0.44861722", "text": "func (_Token *TokenSession) WETH() (common.Address, error) {\n\treturn _Token.Contract.WETH(&_Token.CallOpts)\n}", "title": "" }, { "docid": "c8893daeb5a1be667f7974ae3d4b20ab", "score": "0.4480181", "text": "func (o *IpamAddress6EditInput) GetAddress6Hostaddr() string {\n\tif o == nil || o.Address6Hostaddr == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Address6Hostaddr\n}", "title": "" }, { "docid": "c63d182b6782f2aaab318f1eaf2e9a23", "score": "0.4479395", "text": "func (self *LightChain) GetTdByHash(hash bgmcommon.Hash) *big.Int {\n\treturn self.hcPtr.GetTdByHash(hash)\n}", "title": "" }, { "docid": "128d38206a9d72a10f79588e14ee8ecb", "score": "0.44716778", "text": "func (_Bridge *BridgeCallerSession) WETH() (common.Address, error) {\n\treturn _Bridge.Contract.WETH(&_Bridge.CallOpts)\n}", "title": "" }, { "docid": "57de70386b7da8e633b534f4c471bde8", "score": "0.4468919", "text": "func (o *VirtualizationIweHostAllOf) HasHwPowerState() bool {\n\tif o != nil && o.HwPowerState != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8db0a758bc6c181cbcbc261646c7dce5", "score": "0.44549617", "text": "func (o *VirtualizationIweHostAllOf) GetHwPowerStateOk() (*string, bool) {\n\tif o == nil || o.HwPowerState == nil {\n\t\treturn nil, false\n\t}\n\treturn o.HwPowerState, true\n}", "title": "" }, { "docid": "362d5b08518dbea940283f346311300e", "score": "0.44514215", "text": "func (t *NetworkInstance_Interface) GetMacPinning() bool {\n\tif t == nil || t.MacPinning == nil {\n\t\treturn false\n\t}\n\treturn *t.MacPinning\n}", "title": "" }, { "docid": "ad6ca1894ed013f8bd6d69dc486ba5f4", "score": "0.44474384", "text": "func GetEthMinerFee(hash string) (fee int64, err error) {\n\ttx, err := getEthTx(hash)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\ttxrec, err1 := getEthTxReceipt(hash)\n\tif err1 != nil {\n\t\treturn 0, err\n\t}\n\tif tx == nil || txrec == nil {\n\t\treturn 0, nil\n\t}\n\tgasPrice, err2 := strconv.ParseInt(tx.GasPrice[2:], 16, 64)\n\tif err2 != nil {\n\t\tbeego.Error(err2)\n\t\treturn 0, err\n\t}\n\tgasUsed, err3 := strconv.ParseInt(txrec.GasUsed[2:], 16, 64)\n\tif err3 != nil {\n\t\tbeego.Error(err3)\n\t\treturn 0, err\n\t}\n\treturn gasPrice * gasUsed, nil\n}", "title": "" }, { "docid": "94b3ab3f659c35db085428a2ee627a22", "score": "0.44444233", "text": "func (_class HostCrashdumpClass) GetHost(sessionID SessionRef, self HostCrashdumpRef) (_retval HostRef, _err error) {\n\tif IsMock {\n\t\treturn _class.GetHostMock(sessionID, self)\n\t}\t\n\t_method := \"host_crashdump.get_host\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_selfArg, _err := convertHostCrashdumpRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"self\"), self)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_retval, _err = convertHostRefToGo(_method + \" -> \", _result.Value)\n\treturn\n}", "title": "" }, { "docid": "c1b28e134e615f21c13030789247dac0", "score": "0.44215053", "text": "func (s *SubtreeCache) GetNodeHash(id storage.NodeID, getSubtree GetSubtreeFunc) ([]byte, error) {\n\ts.mutex.RLock()\n\tdefer s.mutex.RUnlock()\n\treturn s.getNodeHashUnderLock(id, getSubtree)\n}", "title": "" }, { "docid": "33329bf8225f37b8ad7f577910f60d59", "score": "0.44134498", "text": "func (o *UsageHostHour) GetHour() time.Time {\n\tif o == nil || o.Hour.Get() == nil {\n\t\tvar ret time.Time\n\t\treturn ret\n\t}\n\treturn *o.Hour.Get()\n}", "title": "" }, { "docid": "36d3783b9f64a512bbac9a2907208a70", "score": "0.44036922", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface) GetEthernet() *OpenconfigInterfaces_Interfaces_Interface_Ethernet {\n\tif t != nil && t.Ethernet != nil {\n\t\treturn t.Ethernet\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1fdc0462554c9d86e3e0b5d3b8ba46f3", "score": "0.439365", "text": "func (t *Interface_RoutedVlan_Ipv6) GetNeighbor(Ip string) *Interface_RoutedVlan_Ipv6_Neighbor {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Ip\n\n\tif lm, ok := t.Neighbor[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6b31eb02ca9d2b5745bf66c92184437f", "score": "0.439098", "text": "func GetGateway(db *sqlx.DB, mac lorawan.EUI64) (Gateway, error) {\n\tvar gw Gateway\n\terr := db.Get(&gw, \"select * from gateway where mac = $1\", mac[:])\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn gw, ErrDoesNotExist\n\t\t}\n\t\treturn gw, errors.Wrap(err, \"select error\")\n\t}\n\treturn gw, nil\n}", "title": "" }, { "docid": "b649b8bff67339fa549f809d70584821", "score": "0.43886247", "text": "func (h *Hash) GetHex() string {\n\treturn h.hash.Hex()\n}", "title": "" }, { "docid": "f651a6a2815e6516fd45d3bd9a5b2b42", "score": "0.43834367", "text": "func (w *WebPage) GetHash() (value int) {\n\tif w == nil {\n\t\treturn\n\t}\n\treturn w.Hash\n}", "title": "" }, { "docid": "f66ee0e991966bb4a6be34e2a988bc5e", "score": "0.4381846", "text": "func (m *Windows10GeneralConfiguration) GetEdgeHomeButtonConfiguration()(EdgeHomeButtonConfigurationable) {\n val, err := m.GetBackingStore().Get(\"edgeHomeButtonConfiguration\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(EdgeHomeButtonConfigurationable)\n }\n return nil\n}", "title": "" }, { "docid": "41166118c31a2be2c6be1cd62a3847a8", "score": "0.43732858", "text": "func (_Router02 *Router02Caller) WETH(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _Router02.contract.Call(opts, &out, \"WETH\")\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "2a622ed31d5252b743f575959a030132", "score": "0.43682683", "text": "func (client *XenClient) VIFGetMAC(self string) (result string, err error) {\n\tobj, err := client.APICall(\"VIF.get_MAC\", self)\n\tif err != nil {\n\t\treturn\n\t}\n\tresult = obj.(string)\n\treturn\n}", "title": "" }, { "docid": "cad986acf990916482acdb048565f8f6", "score": "0.4364281", "text": "func (_Token *TokenCallerSession) WETH() (common.Address, error) {\n\treturn _Token.Contract.WETH(&_Token.CallOpts)\n}", "title": "" }, { "docid": "787984c67b80c0349b1a2d20756a5514", "score": "0.43614364", "text": "func (o AuditRequestHeaderOutput) Hmac() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *AuditRequestHeader) pulumi.BoolPtrOutput { return v.Hmac }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "352bc7e9595d82a1572eb85c0d7e8c1e", "score": "0.43542445", "text": "func (o *ManagementInterfaceAllOf) GetIpv6Address() string {\n\tif o == nil || o.Ipv6Address == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Ipv6Address\n}", "title": "" }, { "docid": "e26e2d909187b138127c44edb6c7ab63", "score": "0.43459904", "text": "func (mr MerkleRoot) GetHash() []byte {\n\treturn mr.Hash\n}", "title": "" }, { "docid": "745b569b0b3212d2e54d9aa769d74aa8", "score": "0.4342685", "text": "func (o *DeviceInterfaceDataData) GetInterfaceVendorMac() string {\n\tif o == nil || o.InterfaceVendorMac == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.InterfaceVendorMac\n}", "title": "" }, { "docid": "61a76e8d4f6c4e695c67933401428e83", "score": "0.43410218", "text": "func (m *NetworkInfo) GetWifiBand()(*WifiBand) {\n val, err := m.GetBackingStore().Get(\"wifiBand\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*WifiBand)\n }\n return nil\n}", "title": "" }, { "docid": "64584edfc05e3bf6d7d4079fc47c8b04", "score": "0.43380624", "text": "func (_Tendermintlightclient *TendermintlightclientSession) GetAppHash(height uint64) ([32]byte, error) {\n\treturn _Tendermintlightclient.Contract.GetAppHash(&_Tendermintlightclient.CallOpts, height)\n}", "title": "" }, { "docid": "094f9c4f6a4079a04d2366cd0cbce6fd", "score": "0.4337624", "text": "func (tree *CATree) GetHash() []byte {\n return tree.root.GetHashValue()\n}", "title": "" }, { "docid": "5c955956b22bb1d150ef96b04800f322", "score": "0.4333951", "text": "func (o *VnicEthIfInventory) GetMacAddressOk() (*string, bool) {\n\tif o == nil || o.MacAddress == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MacAddress, true\n}", "title": "" }, { "docid": "da3281132bdf2a3d2862494b9655f904", "score": "0.43196717", "text": "func (_Tendermintlightclient *TendermintlightclientCallerSession) GetAppHash(height uint64) ([32]byte, error) {\n\treturn _Tendermintlightclient.Contract.GetAppHash(&_Tendermintlightclient.CallOpts, height)\n}", "title": "" }, { "docid": "a4b3ed7400656fb1a8c689d06f3a0cf8", "score": "0.43175048", "text": "func (_Tendermintlightclient *TendermintlightclientCaller) GetAppHash(opts *bind.CallOpts, height uint64) ([32]byte, error) {\n\tvar (\n\t\tret0 = new([32]byte)\n\t)\n\tout := ret0\n\terr := _Tendermintlightclient.contract.Call(opts, out, \"getAppHash\", height)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "cb6700b73375e6f249df609452924a74", "score": "0.4315778", "text": "func (_GlobalEthWallet *GlobalEthWalletCaller) GetEthBalance(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _GlobalEthWallet.contract.Call(opts, out, \"getEthBalance\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "72fc59d8e8783c845e3112a7658e7c93", "score": "0.43133005", "text": "func (c *VXLANResolver) vtepMACForHost(nodename string) string {\n\tmac := c.nodeNameToVXLANMac[nodename]\n\n\tif mac != \"\" {\n\t\treturn mac\n\t}\n\n\thasher := sha1.New()\n\t_, err := hasher.Write([]byte(nodename))\n\tif err != nil {\n\t\tlogrus.WithError(err).WithField(\"node\", nodename).Panic(\"Failed to write hash for node\")\n\t}\n\tsha := hasher.Sum(nil)\n\thw := gonet.HardwareAddr(append([]byte(\"f\"), sha[0:5]...))\n\treturn hw.String()\n}", "title": "" }, { "docid": "b640b67cabcf3aca7a4bab9ad28abfef", "score": "0.43122587", "text": "func (network Network) GetAddress(wif *btcutil.WIF) (*btcutil.AddressPubKey, error) {\n\treturn btcutil.NewAddressPubKey(wif.PrivKey.PubKey().SerializeCompressed(), network.GetNetworkParams())\n}", "title": "" }, { "docid": "5c039802d4618115fc9d8fae6f2848cf", "score": "0.43102315", "text": "func (t *OpenconfigSystem_System_Dns_HostEntries_HostEntry_Config) GetIpv6Address() []string {\n\tif t == nil || t.Ipv6Address == nil {\n\t\treturn nil\n\t}\n\treturn t.Ipv6Address\n}", "title": "" }, { "docid": "cc9eec96daef8ca4f05aded090d88a27", "score": "0.43092597", "text": "func (o *SearchRestaurants200ResponseRestaurantsInnerLocalHoursOperational) GetMonday() string {\n\tif o == nil || o.Monday == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Monday\n}", "title": "" }, { "docid": "458a7b15080fb9b48ab2a2cb9c6acf46", "score": "0.43003526", "text": "func GetWsAddr(clientAddr string, config RPCConfigInterface) (*Node, error) {\n\treturn GetWsAddrContext(context.Background(), clientAddr, config)\n}", "title": "" }, { "docid": "9cf438bcb4e9d7f683b222999d814b5c", "score": "0.42989752", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_State) GetHardwarePort() string {\n\tif t == nil || t.HardwarePort == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.HardwarePort\n}", "title": "" }, { "docid": "2fb07f1355227913de22292116ab592d", "score": "0.42871043", "text": "func (o *StorageNetAppBaseIpInterfaceAllOf) GetHomeNode() string {\n\tif o == nil || o.HomeNode == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.HomeNode\n}", "title": "" } ]